We currently have a Servoy solution in place which is being used to handle our back-office order fullfillment. We also run a large eCommerce store running of ePages. What I need to impliment is a system where by an order is sent over to Servoy and added as a new order in Servoy.
From looking around this forum and documentation I get the idea that writing a few servlets is the way to go. I can construct a request or a SOAP call to Servoy, but I don’t know where to begin writing a Servlet.
I have the experience to actually write passible JavaScript (and some Java from about 6 years ago), but I have no Servoy, Filemaker, Servlet experience. Oh and by the way I’ve been given about three weeks to get it up and running!!
Can someone point me in the right direction, I could do with
A basic idea (development enviroment) of how to test servlets and beans ie. what directory they go in to, how to get them to compile and run (do I need to/how do I restart servoy)
Details of relevent APIs, and functions to INSERT data into a table in servoy from the bean.
From what I’ve seen of Servoy its seems impressive. Hopefully once this project is completed I will get a chance to have a look at it. Until then I hope someone can help me with this little Servlet?
Whilst this may turn out to be a stupid question, I’ll ask it anyway.
Is there any reason why you can’t point your Servoy solution at the database which runs your ecommerce website and either :
Use Servoy to directly interact with the order table data which already exists and manipulate it ?
Use an opening method in the Servoy solution to query for the recent orders or modified orders and run an update to local files ?
I spent 3 man-days defining a webservice and windowsservice to move data backwards and forwards locally to a web site and then recreated the whole thing in 30 minutes using Servoy !
We can’t do a direct connection to the database on the server as our hosting provider is not keen on opening up the database to Servoy. They cite reliability as the reason. We use a specialised hosting platform, and changing the host is not an option as we are happy with them.
Also part of the spec I’ve been given states that every time an order is placed it should be sent directly to Servoy. We don’t want a load of orders to be processed in one batch, but spread the load.
Hey I’m just a coder!
I don’t mind spending a week trying to get it to work, as long as I can get it to work. So even if you can point me in the right direction I would be grateful.
We can’t do a direct connection to the database on the server as our hosting provider is not keen on opening up the database to Servoy. They cite reliability as the reason. We use a specialised hosting platform, and changing the host is not an option as we are happy with them.
Ciao, Oliver
would your provider accept to let you directly interact with a replicated or a proxy table?
If so, all you have to do is to set the main database to write data on the proxy table every time an order is entered, in order to keep the two tables in sync.
Sorry if I seem to be asking as opposed to advising…
If you are not fully conversant with Servoy but are more fluent with what has been done to work with FileMaker, you may not be aware that Servoy is purely the RAD tool used to develop the solution front end.
Thus the database is completely external to the presentation and Logic layers - which is completely unlike FM.
With that in mind is there a better way then for you to write the order directly to the database from the web site at the point of ordering.
This will then be picked up by Servoy front end which simply points to the records in the database.
Sorry if you are already aware of this but thought it might be good to point this out - just in case.
I recently ran into the same problem. We are using servoy to
put some data in a database which consists - as you might
have expected - of some tables with relations. Few relations
tend to be more complex then others. I.e. there is a user and his
n std telephone numbers, m std emails, k logins for p projects and
stuff like that. When creating a user record we have to store
defaults in some of the linked tables.
Since we are using servoy to create user database records as
well as a web fontend, we wondered if its possible to keep the code
for the complex operations in one place (it would be awful to deploy
changes in more than one place).
So I sat down and wrote a Servlet plugin for servoy, providing
a kind-of-web-service “webConnector” access to call methods
of a specific servoy solution via http requests. I recently got to
know that the servoy developers are
aware of the problems arising when thinking about that but have
scheduled development for an “easy-to-use” convinient interface
for 4th quarter 20004 or 1st quarter of 2005.
My “webConnector” works like this:
Open a Solution in the servoy server, initializing a plugin with
a “callback” method. This can be done on solution start.
The plugin itself registers with the tomcat of the servoy server
providing access to its handlers (doGet, doPost). Within these
I parse the requests parameters and URL packaging them for the
callback.
The callback is called from the servlet with the parameter names
and values as arguments. At now this works completely
asynchronously, i.e. you have no chance of getting any result code
or the like. This is still work in progress (might be solved by thread
synchronisation or a row in a database table).
This has just been prototype development but might be useful
for your problem. If you are interested I’d mail you a jar and example
solution.
Thank you for your interest. I’d really like to know what you think
about this stuff.
Attached you can find two files: A sample solution with one form
(connected to a database table dummy) and a jar containing the
Servlet-Plugin.
I am new to servoy, hopefully you are able to get things working
with these two files. I think you have to copy the jar in the plugin
directory and import the solution attaching it to a dummy table. that
should work.
Now check the button “call plugin” of the solution. This will
initialize the plugins web-Callback.
Again send the http request and you will get a dialog in servoy
telling you the callback arrived, displaying one of the params.
The above steps show how it works: Initialize a callback (currently
only one
single callback is possible), then call it from the servlet. The
parameters are optional, they are packaged in JAVA Arrays which
have to be sorted into javascript arrays in your solution.
There are many improvements left:
Provide a number of callbacks (using a hash or something).
Switch via the servlet-URL between the different callbacks.
Provide a mechanism to distinguish different solutions methods.
Build a synchonisation to keep track whether the method
succeeded or failed. (This is currently not possible because the
method call is inserted asynchronuously into the swing event queue)
The source is there in the jar. If some of you are willing to improve
or enhance this stuff for their needs I’d kindly appreciate to have
a look. If this prototype is interesting enough for a few of other
developers I’d maintain a repository to keep track of the development. I used eclipse for development and encourage
you to do the same since eclipse in my opinion is a very
powerful and easy development environment.
Thank you for your opinions. If there are questions feel free to ask.
Till friday I’m here, afterwards I’ll be travelling three weeks through
south-africa.
Another issue is the fact that this seems to be a client plugin with server functionality. That means you have to have a local client running. Maybe necessary anyhow but then there has to be a check in the plugin to see if it is running on the server. Otherwise the client will load it with an error message
You are absolutely right!
I discussed this with Jan Blok from Servoy.
They are planning to implement support for this problem
using a more native approach. He told me of a socalled
HeadlessClient, which allows access to many of a solutions
properties and methods.
Unfortunately the implemntation is scheduled for Q4/04 or
Q1/05. Until then we have to work on this workaround
replacing it with an easy and beautiful piece of code when
it is available.