On Mon, Jun 11, 2012 at 05:46:27PM -0700, vitsin wrote: > I'm happy you boys having fun :-) > > I'll try again, less generic, more specific. > > Satchmo (and other e-Commerse open source solutions like JadaSite, > Shopizer, etc) see the main concept of Product as bunch of predefined by > admin Products and their properties. > What my shop needs is: Generic product while its being created by User (not > admin) from certain peaces. > > Let's say user defined such Generic product from template conf param-s > (what ever they are) and now click on Preview button to see picture of what > it could be at the end. > By clicking on Preview, I need on server side to start over some > bash/p-language wrapper for bunch of JARs that we'll be exec() in certain > sequence and return back > raster image file(or error msg). > > What's the Django/Satchmo way to do such Preview functionality please?
This part isn't django specific. When running java cruft outside of command line interactive or from a build system such as a Makefile you aim to do the work with the minimum number of long running servers running from an equal or smaller number of persistant JVMs. You interface using the lightest protocol for which you understand how to debug. Ideally, have a long running JVM running a single server that speaks a simple protocol such as HTTP that accepts a config on input, calls your own custom java that uses the classes in those jars in an appropriate sequence, then spits the image back from where it came. (Or returns a location of where the image is, and drops the image out as a file named by a hash of the config, so you can cache the work for identical config files). Starting a JVM is expensive. If you leave the JVM running you can split the cost of starting the JVM across multiple previews. This part is django specific. When you get the config, store it in a format that the java can use in a text or blob field in an appropriate model, along with a short hash or ID. In your django template for the image you give a URL based off of the hash or ID. An http get request against that URL would be sent to the java to either retrieve a cached image for the config, or generate the image and send it. Your long running java process would have atleast read access to the same database to be able to retrieve the config from it. > --vs > > > On Monday, June 11, 2012 6:55:17 PM UTC-4, Tomas Neme wrote: > > > > > OK, > > > so let's say I need my template to call some JAR and get back from it > > some > > > /path/file.ext, mean real file that I wanna show in this template. > > > Than how with Django+Satchmo can I achieve this please? > > > > #yuck# indeed :/ > > > > not sure, but maybe this may help? > > http://stackoverflow.com/questions/3652554/calling-java-from-python > > > > -- > > "The whole of Japan is pure invention. There is no such country, there are > > no such people" --Oscar Wilde > > > > |_|0|_| > > |_|_|0| > > |0|0|0| > > > > (\__/) > > (='.'=)This is Bunny. Copy and paste bunny > > (")_(") to help him gain world domination. > > > > -- > You received this message because you are subscribed to the Google Groups > "Satchmo users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/satchmo-users/-/lxTXp_goRYQJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/satchmo-users?hl=en. > -- Chris Dukes. This message is not confidential. Due to the nature of how email is sent, it's only slightly more private than a postcard. Use GPG if you want correspondence to be confidential and private. -- You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.
