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)
modify the behaviour of the preview button
System
I need to modify the behaviour of the preview button in the template to call a "custom preview module" for some branches.
I saw in TS 5.5.2, this was done in /iw-home/httpd/webapps/webdesk/templating/datacapture_buttonframe.jsp
I am trying to do the same in TS 6.1, i did modify /iw-home/httpd/webapps/content_center/formspub/datacapture_buttonframe.jsp, but I don't see my modifs (I did add an alert in the code) :
else if(buttonClicked.indexOf("preview") != -1) {
alert('preview button clicked');
doPreview();
}
I even tried to delete the content of the whole file, but Teamsite continues to show me the "Select a presentation template popup" !
So I guess i'm not modifying the good file (my knowledge of java is weak).
Anyone can help ?
Find more posts tagged with
Comments
Dwayne
Given that this is a completely unsupported thing to do ...
What we found was that, to get similar changes here to be visible, we did the following:
Edit the .jsp file (you've already done this part)
Find the .class file that corresponds to your .jsp under IW-HOME/httpd/webapps/WEB-INF/classes, and delete or rename it
Find the .java file that corresponds to your .jsp under IW-HOME/httpd/webappps/WEB-INF/jspc, and delete or rename it
Run iwreset -ui
It could be that only the .java file needs to be removed, we didn't test that scenario. I DO know that just removing the .class file doesn't work.
Of course, long term, you should put your modified .jsp file into the appropriate .war file, so that your modifications will show up when you reinstall the webapps.
Adam Stoller
What they did at my customer site was they deactivated the Preview button via FormAPI code *and* included their own cgi-callout in the DCT for running their custom Preview command (which, in our case, deploys the content to a preview server and then displays links to the pages on the preview server for the user to click on).
This is working within supported code - though once you get to 6.x you can ignore the FormAPI code for deactivating the Preview button and just disable it via the templating.cfg option
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Why all the FormAPI - why not just have the TPL check if it's running in preview mode and deploy/list links/etc. based on that? Maybe I'm missing something.
Adam Stoller
I can't say for sure - as I wasn't involved with the project when that part of the design was done - but it works. For one thing, normally Preview generates files with zz_ prefixes, our way we don't have to deal with that, we use iwpt_compile.ipl to generate the files to a temporary location, from which they are deployed (we don't care about EAs on the Previewed files).
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Good enough, just curious. I think I've implemented both ways, not real sure which was better but having fewer places to look for business logic (just Perl instead of Javascript and Perl) seems like a good approach. Of course both seem like questionable ways to encode business rules.
civ3
Wonder if these changed can be put into UITK. So it won't get lost next time you do some changed to the content center interface.
Migrateduser
Hello Dwayne,
I did try what you did, but there are 2 problems :
1/ the java file that is created back it the original file provided by teamsite (even the file date is the teamsite installation date), I don't see my modifications in the file, so I guess it takes the java file from somewhere else instead of creating it from the jsp
2/ the class file is not generated.
Anyone knows where I can find documentation for doing such "crazy" things ?
Thank you,
Pierre-Yves.
Dwayne
That's very strange. Did you verify that your modified .JSP file was not overwritten as well?
We tested on a Windows box. Perhaps it's different on Solaris.
Have you considered going with Fish's suggestion? It would be a better supported solution, anyway.
Migrateduser
The modified JSP is still there...
Maybe I'll find out some informations in "Adding custom java code" from the User Interface customization guide... it's not custom java code but maybe there is something there...
Fish's suggestion is excellent but since some branches use the default preview and some not, it would mean that the preview button location would be in the DCT when it's custom and at it's standard location when it's de default preview which will never be accepted by our business...
The ideal solution would be to have to possibility to add custom buttons in templating.cfg in addition of hiding them...
For now I'm scared to have no choice but doing this hack again... if I find out how to make my custom modifications visible !
Adam Stoller
Actually, with the custom cgi-callout Preview button, you could make the CGI that is run cognizant of which branches to do the special processing in, and which to do the "normal" processing in. Unfortunately, I'm not sure what the actual command is that generates files with the zz_ extension, marks the files as private, and takes care of all the proxying with zz_ extensions ... so I guess given that, unless you can find out how to do that, you might be better off trying to get the other solution to work...(if you do figure out what the correct command is to use to get the OOTB Preview functionality to work - please post it here)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com