jvanzyl 01/05/13 08:15:18
Modified: src/java/org/apache/turbine/modules/layouts
VelocityXslLayout.java
Log:
- just cleaning up some comments in XSL layout while trying to
make an example with it in the TDK.
Revision Changes Path
1.3 +23 -10
jakarta-turbine/src/java/org/apache/turbine/modules/layouts/VelocityXslLayout.java
Index: VelocityXslLayout.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/layouts/VelocityXslLayout.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- VelocityXslLayout.java 2001/05/05 17:45:48 1.2
+++ VelocityXslLayout.java 2001/05/13 15:15:17 1.3
@@ -76,7 +76,7 @@
* <br><br>
* Once the (XML) screen and navigation templates have been inserted into
* the layout template the result is transformed with a XSL stylesheet.
- * The stylesheet (with the same name than the scren template) is loaded
+ * The stylesheet (with the same name than the screen template) is loaded
* and executed by the XSLT service, so it is important that you correctly
* set up your XSLT service. If the named stylsheet does not exist the
* default.xsl stylesheet is executed. If default.xsl does not exist
@@ -86,8 +86,6 @@
* located in screens and navigations there should be relatively few reasons
* to subclass this Layout.
*
- *
- *
* @author <a href="mailto:[EMAIL PROTECTED]">Leon Messerschmidt</a>
*/
public class VelocityXslLayout extends Layout
@@ -113,25 +111,40 @@
ConcreteElement results = ScreenLoader.getInstance()
.eval(data, data.getScreen());
+
if (results != null)
+ {
returnValue = results.toString();
+ }
- /* variable for the screen in the layout template */
+ /*
+ * variable for the screen in the layout template
+ */
context.put("screen_placeholder", returnValue);
- /* variable to reference the navigation screen in the layout template */
+ /*
+ * variable to reference the navigation screen in
+ * the layout template
+ */
context.put("navigation", new TemplateNavigation( data ));
- /* Grab the layout template set in the WebMacroSitePage. If null, then
- * use the default layout template (done by the TemplateInfo object) */
+ /*
+ * Grab the layout template set in the WebMacroSitePage.
+ * If null, then use the default layout template
+ * (done by the TemplateInfo object)
+ */
String templateName = data.getTemplateInfo().getLayoutTemplate();
- /* Now, generate the layout template */
+ /*
+ * Now, generate the layout template.
+ */
String temp = TurbineVelocity.handleRequest(context,
"layouts" + templateName);
- /* Finally we do a transformation and send the result back to the
- browser */
+ /*
+ * Finally we do a transformation and send the result
+ * back to the browser
+ */
TurbineXSLT.transform (data.getTemplateInfo().getScreenTemplate(),
new StringReader(temp), data.getOut());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]