You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/01/10 04:18:52 UTC
svn commit: r124757 - in lenya/trunk/src: java/org/apache/lenya/cms/cocoon/components/modules/input java/org/apache/lenya/cms/cocoon/scheduler java/org/apache/lenya/cms/publication java/org/apache/lenya/cms/scheduler test/org/apache/lenya/cms/publication webapp/lenya/content/info webapp/lenya/content/publishing
Author: gregor
Date: Sun Jan 9 19:18:50 2005
New Revision: 124757
URL: http://svn.apache.org/viewcvs?view=rev&rev=124757
Log:
Changed ocurrences of DocumentURL to use CanonicalDocumentURL
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/scheduler/SchedulerHelper.java
lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java
lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java
lenya/trunk/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java
lenya/trunk/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java
lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java
lenya/trunk/src/webapp/lenya/content/info/archive.xsp
lenya/trunk/src/webapp/lenya/content/info/deactivate.xsp
lenya/trunk/src/webapp/lenya/content/info/delete.xsp
lenya/trunk/src/webapp/lenya/content/publishing/referenced-documents.xsp
lenya/trunk/src/webapp/lenya/content/publishing/screen.xsp
Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java?view=diff&rev=124757&p1=lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java&r1=124756&p2=lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java&r2=124757
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java Sun Jan 9 19:18:50 2005
@@ -79,9 +79,9 @@
} else if (name.equals(PageEnvelope.DOCUMENT_LABEL)) { // FIXME: Why is this here?
value = envelope.getDocument().getLabel();
} else if (name.equals(PageEnvelope.DOCUMENT_URL)) {
- value = envelope.getDocument().getDocumentURL();
+ value = envelope.getDocument().getCanonicalDocumentURL();
} else if (name.equals(PageEnvelope.DOCUMENT_URL_WITHOUT_LANGUAGE)) {
- value = envelope.getDocument().getCompleteURLWithoutLanguage();
+ value = envelope.getDocument().getCanonicalWebappURL();
} else if (name.equals(PageEnvelope.DOCUMENT_PATH)) {
value = envelope.getDocumentPath();
} else if (name.equals(PageEnvelope.DOCUMENT_FILE)) {
@@ -151,7 +151,7 @@
+ URI_PARAMETER_DOCTYPE);
String source =
- envelope.getDocument().getArea() + envelope.getDocument().getDocumentURL();
+ envelope.getDocument().getArea() + envelope.getDocument().getCanonicalDocumentURL();
Request request = ObjectModelHelper.getRequest(objectModel);
map = parameterizer.parameterize(filterURI(request.getRequestURI()), filterURI(source), parameters);
Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/scheduler/SchedulerHelper.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/scheduler/SchedulerHelper.java?view=diff&rev=124757&p1=lenya/trunk/src/java/org/apache/lenya/cms/cocoon/scheduler/SchedulerHelper.java&r1=124756&p2=lenya/trunk/src/java/org/apache/lenya/cms/cocoon/scheduler/SchedulerHelper.java&r2=124757
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/scheduler/SchedulerHelper.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/scheduler/SchedulerHelper.java Sun Jan 9 19:18:50 2005
@@ -76,7 +76,7 @@
objectModel);
schedulerParameters.put(ServletJob.PARAMETER_DOCUMENT_URL, envelope.getDocument()
- .getCompleteURL());
+ .getCanonicalWebappURL());
schedulerParameters.put(LoadQuartzServlet.PARAMETER_PUBLICATION_ID, envelope
.getPublication().getId());
map.putAll(schedulerParameters.getPrefixedMap());
Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java?view=diff&rev=124757&p1=lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java&r1=124756&p2=lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java&r2=124757
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultDocument.java Sun Jan 9 19:18:50 2005
@@ -39,26 +39,6 @@
private DublinCore dublincore;
private DocumentIdentityMap identityMap;
private ResourcesManager resourcesManager;
- /**
- * Creates a new instance of DefaultDocument.
- * @param map The identity map the document belongs to.
- * @param id The document ID (starting with a slash).
- * @deprecated Use {@link DefaultDocumentBuilder}instead.
- */
- public DefaultDocument(DocumentIdentityMap map, String id) {
-
- if (id == null) {
- throw new IllegalArgumentException("The document ID must not be null!");
- }
- if (!id.startsWith("/")) {
- throw new IllegalArgumentException("The document ID must start with a slash!");
- }
- this.id = id;
-
- this.identityMap = map;
- this.dublincore = new DublinCoreProxy(this);
- this.resourcesManager = new DefaultResourcesManager(this);
- }
/**
* Creates a new instance of DefaultDocument. The language of the document is the default
@@ -233,28 +213,13 @@
}
/**
- * @see org.apache.lenya.cms.publication.Document#getCompleteURL()
- */
- public String getCompleteURL() {
- return "/" + getPublication().getId() + "/" + getArea() + getDocumentURL();
- }
-
- /**
* @see Document#getCompleteInfoURL()
*/
public String getCompleteInfoURL() {
return "/" + getPublication().getId() + "/" + Publication.INFO_AREA_PREFIX + getArea()
- + getDocumentURL();
+ + getCanonicalDocumentURL();
}
- /**
- * @see Document#getCompleteURLWithoutLanguage()
- */
- public String getCompleteURLWithoutLanguage() {
- String extensionSuffix = "".equals(getExtension()) ? "" : ("." + getExtension());
-
- return "/" + getPublication().getId() + "/" + getArea() + getId() + extensionSuffix;
- }
/**
* Sets the area.
@@ -297,13 +262,6 @@
}
/**
- * @see org.apache.lenya.cms.publication.Document#getDocumentURL()
- */
- public String getDocumentURL() {
- return documentURL;
- }
-
- /**
* @see org.apache.lenya.cms.publication.Document#exists()
*/
public boolean exists() throws DocumentException {
@@ -390,14 +348,14 @@
* @see org.apache.lenya.cms.publication.Document#getCanonicalWebappURL()
*/
public String getCanonicalWebappURL() {
- return getCompleteURL();
+ return "/" + getPublication().getId() + "/" + getArea() + getCanonicalDocumentURL();
}
/**
* @see org.apache.lenya.cms.publication.Document#getCanonicalDocumentURL()
*/
public String getCanonicalDocumentURL() {
- return getDocumentURL();
+ return documentURL;
}
/**
Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java?view=diff&rev=124757&p1=lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java&r1=124756&p2=lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java&r2=124757
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java Sun Jan 9 19:18:50 2005
@@ -80,37 +80,10 @@
String getCompleteInfoURL();
/**
- * Returns the complete URL of this document:<br/>
- * /{publication-id}/{area}{document-id}{language-suffix}.{extension}
- * @return A string.
- * @deprecated Use {@link #getCanonicalWebappURL()} instead.
- */
- 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.
- * @deprecated Use {@link #getCanonicalWebappURL()} instead.
- */
- String getCompleteURLWithoutLanguage();
-
- /**
* Returns the canonical document URL.
* @return A string.
*/
String getCanonicalDocumentURL();
-
- /**
- * Returns the URL of this document:
- * {document-id}{language-suffix}.{extension}
- * The URL always starts with a slash (/).
- * @return A string.
- * @deprecated Use {@link #getCanonicalDocumentURL()} instead.
- */
- String getDocumentURL();
/**
* Returns the dublin core class for this document.
Modified: lenya/trunk/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java?view=diff&rev=124757&p1=lenya/trunk/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java&r1=124756&p2=lenya/trunk/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java&r2=124757
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/scheduler/LoadQuartzServlet.java Sun Jan 9 19:18:50 2005
@@ -300,7 +300,7 @@
*/
public void deleteDocumentJobs(org.apache.lenya.cms.publication.Document document)
throws DocumentBuildException, SchedulerException, PublicationException {
- log.debug("Requested to delete jobs for document URL [" + document.getCompleteURL() + "]");
+ log.debug("Requested to delete jobs for document URL [" + document.getCanonicalWebappURL() + "]");
getScheduler().deleteJobs(document);
}
@@ -392,7 +392,7 @@
NamespaceMap requestParameters = new NamespaceMap(PREFIX);
requestParameters.put(PARAMETER_ACTION, DOCUMENT_DELETED);
requestParameters.put(PARAMETER_PUBLICATION_ID, document.getPublication().getId());
- requestParameters.put(PARAMETER_DOCUMENT_URL, document.getCompleteURL());
+ requestParameters.put(PARAMETER_DOCUMENT_URL, document.getCanonicalWebappURL());
String requestUri = "http://127.0.0.1:" + port + servletContextPath + "?";
Map map = requestParameters.getMap();
Modified: lenya/trunk/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java?view=diff&rev=124757&p1=lenya/trunk/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java&r1=124756&p2=lenya/trunk/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java&r2=124757
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/scheduler/SchedulerWrapper.java Sun Jan 9 19:18:50 2005
@@ -520,7 +520,7 @@
for (int i = 0; i < jobs.length; i++) {
ServletJob job = jobs[i].getJob();
String documentUrl = job.getDocumentUrl(jobs[i].getJobDetail());
- if (documentUrl.equals(document.getCompleteURL())) {
+ if (documentUrl.equals(document.getCanonicalWebappURL())) {
deleteJob(jobs[i].getJobDetail().getName(), jobGroup);
changed = true;
}
Modified: lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java?view=diff&rev=124757&p1=lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java&r1=124756&p2=lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java&r2=124757
==============================================================================
--- lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java (original)
+++ lenya/trunk/src/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java Sun Jan 9 19:18:50 2005
@@ -74,8 +74,8 @@
System.out.println("ID: " + document.getId());
System.out.println("Area: " + document.getArea());
System.out.println("Language: " + document.getLanguage());
- System.out.println("Document URL: " + document.getDocumentURL());
- System.out.println("Complete URL: " + document.getCompleteURL());
+ System.out.println("Document URL: " + document.getCanonicalDocumentURL());
+ System.out.println("Complete URL: " + document.getCanonicalWebappURL());
System.out.println("Extension: " + document.getExtension());
Publication publication = PublicationHelper.getPublication();
@@ -83,8 +83,8 @@
assertEquals(document.getId(), testSet.getId());
assertEquals(document.getArea(), testSet.getArea());
assertEquals(document.getLanguage(), testSet.getLanguage());
- assertEquals(document.getDocumentURL(), testSet.getUrl());
- assertEquals(document.getCompleteURL(), "/" + publication.getId() + "/"
+ assertEquals(document.getCanonicalDocumentURL(), testSet.getUrl());
+ assertEquals(document.getCanonicalWebappURL(), "/" + publication.getId() + "/"
+ document.getArea() + testSet.getUrl());
assertEquals(document.getExtension(), testSet.getExtension());
Modified: lenya/trunk/src/webapp/lenya/content/info/archive.xsp
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/content/info/archive.xsp?view=diff&rev=124757&p1=lenya/trunk/src/webapp/lenya/content/info/archive.xsp&r1=124756&p2=lenya/trunk/src/webapp/lenya/content/info/archive.xsp&r2=124757
==============================================================================
--- lenya/trunk/src/webapp/lenya/content/info/archive.xsp (original)
+++ lenya/trunk/src/webapp/lenya/content/info/archive.xsp Sun Jan 9 19:18:50 2005
@@ -50,7 +50,7 @@
for (int i = 0; i < references.length; i++) {
<inconsistent-document>
- <xsp:attribute name="href"><xsp-request:get-context-path/><xsp:expr>references[i].getCompleteURL()</xsp:expr></xsp:attribute>
+ <xsp:attribute name="href"><xsp-request:get-context-path/><xsp:expr>references[i].getCanonicalWebappURL()</xsp:expr></xsp:attribute>
<xsp:expr>references[i].getId()</xsp:expr> [<xsp:expr>references[i].getLanguage()</xsp:expr>]
</inconsistent-document>
}
Modified: lenya/trunk/src/webapp/lenya/content/info/deactivate.xsp
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/content/info/deactivate.xsp?view=diff&rev=124757&p1=lenya/trunk/src/webapp/lenya/content/info/deactivate.xsp&r1=124756&p2=lenya/trunk/src/webapp/lenya/content/info/deactivate.xsp&r2=124757
==============================================================================
--- lenya/trunk/src/webapp/lenya/content/info/deactivate.xsp (original)
+++ lenya/trunk/src/webapp/lenya/content/info/deactivate.xsp Sun Jan 9 19:18:50 2005
@@ -85,7 +85,7 @@
for (int i = 0; i < references.length; i++) {
<inconsistent-document>
- <xsp:attribute name="href"><xsp-request:get-context-path/><xsp:expr>references[i].getCompleteURL()</xsp:expr></xsp:attribute>
+ <xsp:attribute name="href"><xsp-request:get-context-path/><xsp:expr>references[i].getCanonicalWebappURL()</xsp:expr></xsp:attribute>
<xsp:expr>references[i].getId()</xsp:expr> [<xsp:expr>references[i].getLanguage()</xsp:expr>]
</inconsistent-document>
}
Modified: lenya/trunk/src/webapp/lenya/content/info/delete.xsp
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/content/info/delete.xsp?view=diff&rev=124757&p1=lenya/trunk/src/webapp/lenya/content/info/delete.xsp&r1=124756&p2=lenya/trunk/src/webapp/lenya/content/info/delete.xsp&r2=124757
==============================================================================
--- lenya/trunk/src/webapp/lenya/content/info/delete.xsp (original)
+++ lenya/trunk/src/webapp/lenya/content/info/delete.xsp Sun Jan 9 19:18:50 2005
@@ -51,7 +51,7 @@
for (int i = 0; i < references.length; i++) {
<inconsistent-document>
- <xsp:attribute name="href"><xsp-request:get-context-path/><xsp:expr>references[i].getCompleteURL()</xsp:expr></xsp:attribute>
+ <xsp:attribute name="href"><xsp-request:get-context-path/><xsp:expr>references[i].getCanonicalWebappURL()</xsp:expr></xsp:attribute>
<xsp:expr>references[i].getId()</xsp:expr> [<xsp:expr>references[i].getLanguage()</xsp:expr>]
</inconsistent-document>
}
Modified: lenya/trunk/src/webapp/lenya/content/publishing/referenced-documents.xsp
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/content/publishing/referenced-documents.xsp?view=diff&rev=124757&p1=lenya/trunk/src/webapp/lenya/content/publishing/referenced-documents.xsp&r1=124756&p2=lenya/trunk/src/webapp/lenya/content/publishing/referenced-documents.xsp&r2=124757
==============================================================================
--- lenya/trunk/src/webapp/lenya/content/publishing/referenced-documents.xsp (original)
+++ lenya/trunk/src/webapp/lenya/content/publishing/referenced-documents.xsp Sun Jan 9 19:18:50 2005
@@ -45,7 +45,7 @@
</xsp:logic><referenced-documents><xsp:logic>
for (int i = 0; i < references.length; i++) {
- <referenced-document><xsp:attribute name="href"><xsp-request:get-context-path/><xsp:expr>references[i].getCompleteURL()</xsp:expr></xsp:attribute><xsp:expr>references[i].getId()</xsp:expr> [<xsp:expr>references[i].getLanguage()</xsp:expr>]</referenced-document>
+ <referenced-document><xsp:attribute name="href"><xsp-request:get-context-path/><xsp:expr>references[i].getCanonicalWebappURL()</xsp:expr></xsp:attribute><xsp:expr>references[i].getId()</xsp:expr> [<xsp:expr>references[i].getLanguage()</xsp:expr>]</referenced-document>
}
</xsp:logic></referenced-documents><xsp:logic>
}
Modified: lenya/trunk/src/webapp/lenya/content/publishing/screen.xsp
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/content/publishing/screen.xsp?view=diff&rev=124757&p1=lenya/trunk/src/webapp/lenya/content/publishing/screen.xsp&r1=124756&p2=lenya/trunk/src/webapp/lenya/content/publishing/screen.xsp&r2=124757
==============================================================================
--- lenya/trunk/src/webapp/lenya/content/publishing/screen.xsp (original)
+++ lenya/trunk/src/webapp/lenya/content/publishing/screen.xsp Sun Jan 9 19:18:50 2005
@@ -130,7 +130,7 @@
for (int i = 0; i < references.length; i++) {
<referenced-document>
- <xsp:attribute name="href"><xsp-request:get-context-path/><xsp:expr>references[i].getCompleteURL()</xsp:expr></xsp:attribute>
+ <xsp:attribute name="href"><xsp-request:get-context-path/><xsp:expr>references[i].getCanonicalWebappURL()</xsp:expr></xsp:attribute>
<xsp:expr>references[i].getId()</xsp:expr> [<xsp:expr>references[i].getLanguage()</xsp:expr>]
</referenced-document>
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org