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 - Save As and Generate buttons
mvaidhya
Hi,
With the "Generate" and the "Save As" buttons, the user has the option or ability to rename/overwrite an existing file.Here are a couple of things that we want to do:
1) We don't want to allow renaming/overwriting an existing file. I read in one of the posts that we can prevent renaming by setting the attribute in the iw.cfg file. Has anyone tried this and stumbled into any issues with this?
2) While "Generating" the pages, we want to use the same DCR name for the Generated page also. For example, if we edit the dcr "Abc", then we want to generate "Abc.htm" in a certain folder when the user clicks the "Generate" button. Basically, we don't to present the user with the dialog box that asks for the file name.
Thanks in advance for your help!
Find more posts tagged with
Comments
Migrateduser
Gosh Interwoven, everyone seems to have these issues - maybe some functionality should be built into the base product.
You can disable Generate and Save As using FormAPI. You can default the filename for the user the first time it is saved using FormAPI (possibly reading some values from the form) - or you can trigger onSaveNameSpecified and since they are XML files you can use MSXML to open a connection to the server and see if the file exists, append some number or whatever if it does, see if that file exists, add one to the number, etc. (to avoid overwrite), or disallow save (alert and return false).
You can use an onSave event to callServer to (re)generate according to whatever rules you want. I think if you search devenet with no time restrictions you will find both. If you need sample code let me know - I have done all of these.
mvaidhya
Thank you for your response.
I was able to disable the buttons using FormAPI. But now, we have decided not to disable the buttons - instead default the filename so that the user cannot change/overwrite a file when using the "Save As" and "Generate" buttons.
Can you post some sample code on how you did this?
Migrateduser
See the attachment. This is not my real code so it hasn't been tested. It should also be more modular (hard-coding port 81 and templatedata for instance may not be good). You will have to modify this to get it working for you. May not work in Netscape.