henning 2003/08/05 03:50:12
Modified: src/java/org/apache/turbine/services/pull/tools
ContentTool.java
Log:
Add methods to pull absolute and relative URIs from the content tool
without looking at the default method. This might necessary if you
use relative links but need a few absolute links (e.g. for Batik/FOP).
Revision Changes Path
1.4 +34 -1
jakarta-turbine-2/src/java/org/apache/turbine/services/pull/tools/ContentTool.java
Index: ContentTool.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/pull/tools/ContentTool.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ContentTool.java 4 Aug 2003 13:49:31 -0000 1.3
+++ ContentTool.java 5 Aug 2003 10:50:12 -0000 1.4
@@ -180,4 +180,37 @@
return wantRelative ?
dataURI.getRelativeLink() : dataURI.getAbsoluteLink();
}
+
+ /**
+ * Returns the Turbine URI of a given Path. The
+ * result is always an absolute path starting with
+ * the server scheme (http/https).
+ *
+ * @param path The path to translate
+ *
+ * @return Turbine translated absolute path
+ */
+ public String getAbsoluteURI(String path)
+ {
+ dataURI.setScriptName(path);
+
+ return dataURI.getAbsoluteLink();
+ }
+
+ /**
+ * Returns the Turbine URI of a given Path. The
+ * result is always relative to the context of
+ * the application.
+ *
+ * @param path The path to translate
+ *
+ * @return Turbine translated absolute path
+ */
+ public String getRelativeURI(String path)
+ {
+ dataURI.setScriptName(path);
+
+ return dataURI.getRelativeLink();
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]