Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
FormAPI / Callout question
Annad
Hi,
I am trying to do a callaout to a perl program based on the value of an other field.
For example, I have a browse field called "Leftmenu File Name" in the DCT that the user can browse and choose the left menu item (which is an xml file). These xml files exist on TeamSite Content center.
There's an other field in the DCT which is a cgi-callout field. When the user clicks on this button I want to use the FormAPI oncallout event approach to check if the selected file of the "LeftMenu File Name" field actually exists on the TeamSite server.
As far as I know, with the oncallout approach I cannot check the existance of a TeamSite server side.
Is there any other way to do this.
Thanks,
Anna.
Find more posts tagged with
Comments
nipper
Your question is not clear, but from what I understand, call server requests will work.
Is this how you want it to work:
user selects left nav,
user enters clicks button (to check the existence of file pointed to by left nav) [BTW, it sounds as if this callout is unneeded, it would be better to have on item change, left nave, run call server)
Call server starts IPL process on TS server, passing it XML file name and callback function. IPL processes and sets a variable pass/fail and returns, running the callback function in JS. The callback, looking at pass/fail decides what to do.
Am I anywhere near the mark ?
Andy
Annad
Hi Andy,
I always thought that since CallServer runs on a separate thread, FormAPI will not wait for CallServer to come back.
Now I see how it will work.
Thanks,
Anna.
Annad
Andy,
One more question:
Can I use the Callserver technique on a 'Save' action and allow save to take place only after the Callserver script returns? This time, in the CallServer script I need to check if the selected left nav item exists on the xml file (only for already existing files). If not, the save should not happen.
Thanks.
Anna.
nipper
I have not used call server on the save and think there may be an issue with the asynchronous nature of the call server.
What I might do instead is when exec the call server when the left nav is selected, I make a call server code to verify the filename is good, any directories are created that are required etc and then set a field called DCRName (hidden in the DCR, also required). Then on the save event I run IWDatacapture.save(myDcrName);
FInally, I would make the left nav selection read only (it makes your life much easier).
HTH
Andy
Annad
I was also concerned about the asynchronous nature of the call server.
In our design, the left nav is managed within the XML file. Now, each of the node in the xml file has a unique id which helps us to rely on the ID rather than the node label. When a user chooses a left nav node from their content DCR, I would set the ID as a readonly/hidden variable and show them only the label of the node they chose. However, if the left nav node on the XML file is modified/deleted by the left nav authors, I want the content author to see the changes updated on their DCR when they load an existing dcr or even validate it on a 'save' action.
Thanks,
Anna.
nipper
How "real time" are you talking. If I open a DCR and you edit and save a left nav (removing what I am working on) you want my changes to get flagged and then I make another choice ?
I *suppose* you could write that. However I expect that is a cornercase that may not be worth trying to solve. Or at least after you have the other 99.8% working perfectly.
I think you would be better fixing that issue in the TPL or in the workflow.
HTH
Andy