You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by eg...@apache.org on 2003/08/12 15:26:58 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication Document.java DefaultDocument.java
egli 2003/08/12 06:26:58
Modified: src/java/org/apache/lenya/cms/publication Document.java
DefaultDocument.java
Log:
Added a method to query the complete URL without the
language suffix.
Revision Changes Path
1.13 +10 -1 cocoon-lenya/src/java/org/apache/lenya/cms/publication/Document.java
Index: Document.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/Document.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Document.java 30 Jul 2003 15:03:24 -0000 1.12
+++ Document.java 12 Aug 2003 13:26:58 -0000 1.13
@@ -84,6 +84,15 @@
String getCompleteURL();
/**
+ * Returns the complete URL of this document without
+ * the language-suffix:
+ * /{publication-id}/{area}{document-id}.{extension}
+ * The URL always starts with a slash (/).
+ * @return A string.
+ */
+ String getCompleteURLWithoutLanguage();
+
+ /**
* Returns the URL of this document:
* {document-id}{language-suffix}.{extension}
* The URL always starts with a slash (/).
1.23 +9 -5 cocoon-lenya/src/java/org/apache/lenya/cms/publication/DefaultDocument.java
Index: DefaultDocument.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/DefaultDocument.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- DefaultDocument.java 8 Aug 2003 09:10:34 -0000 1.22
+++ DefaultDocument.java 12 Aug 2003 13:26:58 -0000 1.23
@@ -218,11 +218,17 @@
* @see Document#getCompleteURL(String)
*/
public String getCompleteURL() {
- String languageSuffix = "".equals(getLanguage()) ? "" : ("_" + getLanguage());
+ return "/" + getPublication().getId() + "/" + getArea() + getDocumentURL();
+ }
+ /**
+ * @see Document#getCompleteURL(String)
+ */
+ public String getCompleteURLWithoutLanguage() {
String extensionSuffix = "".equals(getExtension()) ? "" : ("." + getExtension());
- return "/" + getPublication().getId() + "/" + getArea() + getDocumentURL();
+
+ return "/" + getPublication().getId() + "/" + getArea() + getId() + extensionSuffix;
}
/**
@@ -269,6 +275,4 @@
public String getDocumentURL() {
return documentURL;
}
-
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org