how to make adapter work

53 views
Skip to first unread message

yuan

unread,
Mar 24, 2012, 12:02:11 AM3/24/12
to WireIt
help! I don't know whether I've used the adapter properly:
Firstly,I try to realize the save function like the example of
WiringEditor based on json-rpc adapter.Because I don't want to use the
php which need apache container while I am using the tomcat container,
I choose to use the ajax backend.
My project aim to connect Oracle database with Java and SSH framework
So my steps are follows:
I change the WiringEditer's index.jsp by adding:
<script type="text/javascript" src="../wireit/js/adapters/ajax.js"></
script>
Then I change the WiringEditor.js in the 47th line:
options.adapter = WireIt.WiringEditor.adapters.Ajax;
this.adapter = options.adapter ;//||
WireIt.WiringEditor.adapters.JsonRpc;
So the adapter will direct to the ajax.js
Then I change the ajax.js in the 15th line:
url: 'wireitWorkflow/saveWorkflowAction'
Then I debug by open the wiringEditor's index.jsp in the browser I
find that when it goes to the utilities.js 2944th line it doesn't
carry out the expect action,only when I open the wiringEditor page by
config the result of success page of saveWorkflowAction to be the
WiringEditer's index.jsp,then when comes to the utilities.js 2944th
line it will carry out saveWorkflowAction(but I don't want to carry it
twice). I wonder if I should not use the asynRequest funnction in
utilities.js and directly call my saveaction in the savefunction of
ajax.js?
What's more I don't know how to make the action get postData which I
want to save.
Thanks in advance

Eric Abouaf

unread,
Apr 3, 2012, 12:47:40 PM4/3/12
to wir...@googlegroups.com
You should probably adapt the AjaxAdapter to your needs, because it has strong assumptions on how your webservice is supposed to work (especially which HTTP methods to use).

A debug tool is required to debug this part. Firebug or the webkit console tools are your friends :)

yuan

unread,
May 22, 2012, 2:07:28 AM5/22/12
to WireIt
Hi, Thank you for the tools recommended,i partly succeeded in saving
the process by changing the utilities.js in line 2939:D=D+"?"+A
Now i wonder how to make the load function work to show the data i
have saved, when i click the load button it just popup a load panel
whose body just has:"Filter: <input type='text' id='loadFilter' /><div
id='loadPanelBody'></div>" , i don't know what to input and how to
submit it




Thanks very much for your assistance.




Best Wishes.
Mandy

yuan

unread,
May 23, 2012, 7:41:47 AM5/23/12
to WireIt
Hi,
    i know why there is no content shown in load panel now, it's
because it didn't save the wiring properly in mysql database, when i
click save, it saved the name in the language field, the language in
working field, the working in name field. so it can not load the
wiring. Then i change the save function in WiringEditor.php:
    public function saveWiring( $name, $working,$language) ..
rather than:
 public function saveWiring( $language,$name, $working) ..
it's quite strange, because i haven't changed it before ,and the
node" // variable needs to be in alphabetical order" might be
misleading?

Anyway, the load function in WiringEditor finally work , thank you all
who have helped me!~


Best Wishes,
Mandy
Reply all
Reply to author
Forward
0 new messages