What I was trying to do is use Velocity to implement the Layout for a page and then have some Screens that are implemented in JSP and some in Velocity.
Ok, got it. You can't mix VM & JSP this way. The code forces the Screen & Layout to both be either JSP or VM. Seems to me that you ought to be able to do this, but I'm not familiar enough with Turbine to know if this is a limitation of Turbine or Jetspeed. If Turbine can support this scenario how hard would it be to get Jetspeed to do it ? Here's the code that's causing my scenario not to work. This is with Jetspeed 1.5 It's in the org.apache.jetspeed.modules.pages.JetspeedTemplatePage.doBuildAfterActio n(RunData) method. ..... ---> This section forces the extension onto the template name. String ext = TurbineTemplate.getDefaultExtension(); ..... if (template.lastIndexOf('.')<0) { template=template+"."+ext; } if ( logger.isDebugEnabled() ) { logger.debug("JetspeedTemplatePage: requested template = " + template); } ---> This section looks up the JSP screen, no problem because it's there // get real path now - this is a fix to get us thru 1.3a2 // when the TurbineTemplateService can locate resources by NLS and mediatype, // then it can be removed String locatedScreen = TemplateLocator.locateScreenTemplate(data, template); data.setScreenTemplate( locatedScreen ); if ( logger.isDebugEnabled() ) { logger.debug("JetspeedTemplatePage: calculated template = " + locatedScreen); } ---> This section assumes that the Layout is the same templating technology as the screen ---> but the JSP version of the Layout isn't there so it fails returning NULL (because I removed it) ---> which ultimately causes a null pointer exception to be thrown. ---> OR ---> It finds the wrong Layout (because I did not remove it) and dynamically switches the Layout ---> from the VM version to the JSP version which seems to really screw up the state of the portal from ---> that point forward String layout = TemplateLocator.locateLayoutTemplate(data, template); data.setLayoutTemplate(layout); if ( logger.isDebugEnabled() ) { logger.debug("JetspeedTemplatePage: layoutTemplate is finally " + layout); } ..... Thanks, Tom -----Original Message----- From: Hampton, Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 1:00 PM To: Jetspeed Users List Subject: RE: What do you need to do to add a new screen ? Ok, so I changed the code in left.vm to the following Jslink.getTemplate("Page2.jsp") This caused the template to be found but also caused left.jsp to be rendered instead of left.vm which confuses me. I would have expected left.vm to be rendered using velocity and for Page2 to be rendered by JSP. What's even more weird is that the top & bottom are still rendering top.vm & bottom.vm. Any insight as to what I'm doing wrong ? I feel like I'm missing something simple here. Thanks, Tom -----Original Message----- From: Hampton, Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 9:46 AM To: Jetspeed Users List Subject: RE: What do you need to do to add a new screen ? David, Thank you. The jslink example helps a lot. The $jslink.getTemplate("Page2") is working. But I also have some templates that are JSP. The $jslink.getTemplate() method seems to only be finding VM templates and not the JSP templates. Is it possible to link from a VM template such as left.vm to a JSP template ? Thanks, Tom -----Original Message----- From: David Sean Taylor [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 16, 2004 11:58 PM To: Jetspeed Users List Subject: Re: What do you need to do to add a new screen ? Hampton, Thomas wrote: > Right, so I changed it to $jslink.getTemplate() but it still does not bring up my screen. Still a blank screen. > Is there anything else that needs to be done besides creating the Page2.vm file and putting it in the correct directory and then calling $jslink.getTemplate("Page2") from the Left.vm file ? > > Where are things like jslink, link, jlink, and clink documented, I've looked around but am not finding where these things are documented. How do I know what these references are and what methods are available on them ? > Its documented in the JetspeedLink.java interface http://cvs.apache.org/viewcvs.cgi/jakarta-jetspeed/src/java/org/apache/j etspeed/util/template/JetspeedLink.java?rev=1.15&view=markup The $jslink is self-documented with examples in the "JSLink Examples" portlet. Add this portlet to your page with the customizer and you will see The other variations ($clink, $link, $jlink) we tried to deprecate. > Thanks for your help. > Tom > > ________________________________ > > From: David Sean Taylor [mailto:[EMAIL PROTECTED] > Sent: Tue 11/16/2004 6:38 PM > To: Jetspeed Users List > Subject: Re: What do you need to do to add a new screen ? > > > > Hampton, Thomas wrote: > > >>I created a new screen "template" in the >>webapp\WEB-INF\templates\vm\screens\html directory. Then I modified the >>left.vm file as follows. >> >> <td> >> <a href="$jslink.getPage("Page2")"> >> <img src="images/leftnav_api.gif" border="0"> >> </a> >> </td> >> </tr> >> <tr> >> <td> >> <a href="$jslink.getTemplate("EditAccount")"> >> <img src="images/leftnav_api.gif" border="0"> >> </a> >> </td> >> </tr> >> >>What I want to happen is for the "Page2" screen to come up the same way >>the "EditAccount" screen does. But I just get a blank page. The >>EditAccount screen comes up ok. So I'm sure that I have not done >>something that is needed to "register" the "Page2" screen template, but >>I don't know what I'm missing. The "Page2" template just has static >>text in it right now. >> >>What am I missing ? >> >> > > $jslink.getPage gets a PSML page, not a turbine template > I think you may be confusing it with $link.getPage > Why not use $jslink.getTemplate here too > > -- > David Sean Taylor > Bluesunrise Software > [EMAIL PROTECTED] > [office] +01 707 773 4646 > [mobile] +01 707 529 9194 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > ------------------------------------------------------------------------ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- David Sean Taylor Bluesunrise Software [EMAIL PROTECTED] [office] +01 707 773 4646 [mobile] +01 707 529 9194 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]