Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
cgi-callout for loading an html page?
mogoo
What would be the syntax if all I wanted to do is open a static html page in a new browser window via a button in the TPL? I'm guessing that would be a cgi-callout, but I can't seem to figure out the right syntax. Do I call on iw_cgi_wrapper.cgi, or something else? Also, the html page is in the staging area of the same branch as the TPL... how do I handle the pathing?
Thanks for any help!
maureen
Find more posts tagged with
Comments
james1
If the file is not in the current workarea, then I would suggest writing a simple CGI program that simply redirects the end user to the file you want them to look at.
i.e.:
#!/usr/local/bin/perl
print "Location: /iw-mount/default/main/STAGING/file.html\n\n";
exit 0;
Then you can use this CGI as a <cgi-callout>.
mogoo
OK, this is what I've got so far.
in my DCT...
<cgi-callout url="/iw-bin/iw_cgi_wrapper.cgi/load_html.ipl" label=...../>
then, in load_html.ipl...
my $file = '/default/main/....filename.html';
open FILE, $file or die "Cannot open $file for read :$!";
while(<FILE>){
print "$_";
}
...this is getting me a 500 Internal Server Error. What am I doing wrong? Is there an easier way?
akshathp
Error is probably for some syntax error or could even be the execute bit which is not set ON.
Try to execute the ipl file from your command prompt. It should let you know of possible basic errors.
Hope this helps.
Akshat Pramod Sharma
Interwoven Inc.
Adam Stoller
Did you try the code that James suggested?
Other than that - please indicate:
- the version of TeamSite / TeamSite Templating that you are using
- the platform / OS that your TeamSite server is running on
- the browser (vendor and version) that you are using
Otherwise, it is difficult to diagnose what is happening
--fish
(Interwoven, Curriculum Development)
james1
It seems that your CGI is not printing any HTTP headers. This is a sure-fire recipe for Internal Server Errors.
In any case, I cannot recommend continuing down your chosen path. Because the end user's browser will see your HTML at the URL /iw-bin/iw_cgi_wrapper.cgi/load_html.ipl, relative links to images and other HTML pages will not be virtualized correctly.
Instead, I would urge you to use the two-line Perl script I recommended earlier.
-- James
mogoo
I'm not really sure I understand James' suggestion. Is this code supposed to go in my "load_html.ipl", or would it go in "james.cgi", which I would call on instead of iw_cgi_wrapper.cgi?
I'm pretty sure it's just the way I've coded my file, as opposed to the server. I've substituted "example_datacapture_callout.ipl" instead of "load_html.ipl", and it works. All I'm trying to do here is put a button in the DCT so the user can pop up an html page that exists in the staging area of same branch. I'm guessing it's possible, and I don't care how it's done; there may be an easier way than what I'm trying...
TSTv5.0, Solaris, viewing on IE5.0 Windows
akshathp
I believe James was suggesting to use "james.cgi" instead of "load_html.ipl" in your cgi callout.
This generic CGI should be able to easily redirect to the desired file in STAGING Area.
In short, you do not need load_html.ipl incase you opt to use the cgi james suggested.
Also, if possible please attach the entire code of your ipl file. If this is the entire code then James is very right that you are missing http headers.
print "Content-type: text/html \n\n";
Hope this helps.
Akshat Pramod Sharma
Interwoven Inc.
james1
> I'm not really sure I understand James' suggestion. Is this code
> supposed to go in my "load_html.ipl", or would it go in "james.cgi",
> which I would call on instead of iw_cgi_wrapper.cgi?
Either way should work fine.
-- James
mogoo
Actually, I figured it out, thanks to ghoti's post on another thread... this is all I was looking to do...
<cgi-callout url="/iw/webdesk/sce?vpath=/default/main/XYZ.html"/>
Thanks everyone for your help!