Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

svn commit: r426254 - in /lenya/trunk/src: impl/java/org/apache/lenya/cms/p: msg#00206

cms.lenya.cvs

Subject: svn commit: r426254 - in /lenya/trunk/src: impl/java/org/apache/lenya/cms/publication/ impl/test/org/apache/lenya/cms/publication/ java/org/apache/lenya/cms/cocoon/acting/ java/org/apache/lenya/cms/cocoon/components/modules/input/ java/org/apache/lenya...

Author: andreas
Date: Thu Jul 27 14:27:04 2006
New Revision: 426254

URL: http://svn.apache.org/viewvc?rev=426254&view=rev
Log:
Made Document.getId() deprecated, replaced by getUUID() or getPath()

Modified:
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java

lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java

lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/ResourceTypeImpl.java

lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java

lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/LanguageExistsAction.java

lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/RevisionControllerAction.java

lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentInfoModule.java

lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java

lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java

lenya/trunk/src/java/org/apache/lenya/cms/cocoon/transformation/LinkRewritingTransformer.java
lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java

lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentIdToPathMapper.java
lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java
lenya/trunk/src/java/org/apache/lenya/cms/publication/PageEnvelope.java
lenya/trunk/src/java/org/apache/lenya/cms/publication/util/Collection.java

lenya/trunk/src/java/org/apache/lenya/cms/publication/util/CollectionImpl.java

lenya/trunk/src/java/org/apache/lenya/cms/publication/util/DocumentHelper.java
lenya/trunk/src/java/org/apache/lenya/cms/site/NodeFactory.java
lenya/trunk/src/java/org/apache/lenya/cms/site/NodeSet.java
lenya/trunk/src/java/org/apache/lenya/cms/site/SiteUtil.java
lenya/trunk/src/java/org/apache/lenya/cms/site/simple/DocumentStore.java
lenya/trunk/src/java/org/apache/lenya/cms/site/simple/SimpleSiteManager.java

lenya/trunk/src/modules-core/ac-impl/java/src/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java

lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Assets.java

lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ChangeLabel.java

lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ChangeNodeID.java

lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Clipboard.java

lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java

lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java

lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateLanguage.java

lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/InvokeWorkflow.java

lenya/trunk/src/modules/bxe/java/src/org/apache/lenya/cms/editors/bxe/BXE.java

lenya/trunk/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java

lenya/trunk/src/modules/lucene/java/src/org/apache/lenya/cms/lucene/IndexDocument.java

lenya/trunk/src/modules/lucene/java/src/org/apache/lenya/cms/lucene/IndexUpdater.java

lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/components/modules/input/SitetreeModule.java

lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/transformation/DocumentIndexTransformer.java

lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree/TreeSiteManager.java

lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Mkcol.java

lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Put.java

Modified:
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java
(original)
+++
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentImpl.java
Thu Jul 27 14:27:04 2006
@@ -589,4 +589,8 @@
}
return this.locator;
}
+
+ public String getPath() {
+ return getLocator().getPath();
+ }
}

Modified:
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java
(original)
+++
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DocumentManagerImpl.java
Thu Jul 27 14:27:04 2006
@@ -113,7 +113,7 @@

// Write Lenya-internal meta-data
MetaData lenyaMetaData =
document.getMetaData(DocumentImpl.METADATA_NAMESPACE);
-
+
lenyaMetaData.setValue(DocumentImpl.METADATA_RESOURCE_TYPE,
documentType.getName());
lenyaMetaData.setValue(DocumentImpl.METADATA_CONTENT_TYPE, "xml");
lenyaMetaData.setValue(DocumentImpl.METADATA_EXTENSION, extension);
@@ -400,10 +400,8 @@
for (int i = 0; i < languages.length; i++) {

Document sourceVersion = identityMap.getLanguageVersion(source,
languages[i]);
- Document targetVersion = identityMap.get(target.getPublication(),
- target.getArea(),
- target.getId(),
- languages[i]);
+ DocumentLocator targetLocator =
sourceVersion.getLocator().getLanguageVersion(languages[i]);
+ Document targetVersion = identityMap.get(targetLocator);
copy(sourceVersion, targetVersion);
}
}
@@ -480,10 +478,10 @@
* @throws DocumentBuildException if the target could not be built.
*/
protected Document getTarget(Document source) throws
DocumentBuildException {
- String rootSourceId = getRootSource().getId();
- String rootTargetId = getRootTarget().getId();
- String childId = source.getId().substring(rootSourceId.length());
- String targetId = rootTargetId + childId;
+ String rootSourcePath = getRootSource().getPath();
+ String rootTargetPath = getRootTarget().getPath();
+ String childId =
source.getPath().substring(rootSourcePath.length());
+ String targetId = rootTargetPath + childId;
return
getRootTarget().getIdentityMap().get(getRootTarget().getPublication(),
getRootTarget().getArea(),
targetId,

Modified:
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/ResourceTypeImpl.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/ResourceTypeImpl.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/ResourceTypeImpl.java
(original)
+++
lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/ResourceTypeImpl.java
Thu Jul 27 14:27:04 2006
@@ -16,7 +16,6 @@
*/
package org.apache.lenya.cms.publication;

-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;

Modified:
lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java
(original)
+++
lenya/trunk/src/impl/test/org/apache/lenya/cms/publication/DefaultDocumentTest.java
Thu Jul 27 14:27:04 2006
@@ -45,7 +45,7 @@
*/
protected void doDocumentTest(DocumentTestSet testSet) throws
PublicationException {
Document document = getDocument(testSet);
- getLogger().info("ID: " + document.getId());
+ getLogger().info("UUID: " + document.getUUID());
getLogger().info("Area: " + document.getArea());
getLogger().info("Language: " + document.getLanguage());
getLogger().info("Document URL: " +
document.getCanonicalDocumentURL());
@@ -54,7 +54,7 @@

Publication publication = PublicationUtil.getPublication(getManager(),
"test");
assertEquals(document.getPublication(), publication);
- assertEquals(document.getId(), testSet.getId());
+ assertEquals(document.getUUID(), testSet.getUUId());
assertEquals(document.getArea(), testSet.getArea());
assertEquals(document.getLanguage(), testSet.getLanguage());
assertEquals(document.getCanonicalDocumentURL(), testSet.getUrl());
@@ -102,7 +102,7 @@
Publication pub = PublicationUtil.getPublication(getManager(), "test");
DocumentIdentifier id = new DocumentIdentifier(pub,
testSet.getArea(),
- testSet.getId(),
+ testSet.getUUId(),
testSet.getLanguage());
DocumentImpl document = new DocumentImpl(getManager(),
getIdentityMap(), id, getLogger());
document.setDocumentURL(testSet.getUrl());
@@ -153,9 +153,9 @@
}

/**
- * @return The ID.
+ * @return The UUID.
*/
- public String getId() {
+ public String getUUId() {
return this.id;
}


Modified:
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/LanguageExistsAction.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/LanguageExistsAction.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/LanguageExistsAction.java
(original)
+++
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/LanguageExistsAction.java
Thu Jul 27 14:27:04 2006
@@ -76,7 +76,7 @@
String language = doc.getLanguage();

if (!doc.existsInAnyLanguage()) {
- throw new DocumentDoesNotExistException("Document " + doc.getId()
+ throw new DocumentDoesNotExistException("Document " + doc
+ " does not exist. Check sitetree, it might need to be
reloaded.");
}
List availableLanguages = Arrays.asList(doc.getLanguages());

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/RevisionControllerAction.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/RevisionControllerAction.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/RevisionControllerAction.java
(original)
+++
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/RevisionControllerAction.java
Thu Jul 27 14:27:04 2006
@@ -135,7 +135,7 @@
// cannot be get from
// the page-envelope

- String documentid = document.getId();
+ String documentid = document.getPath();
int bx = documentid.lastIndexOf("-bxe");

if (bx > 0) {

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentInfoModule.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentInfoModule.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentInfoModule.java
(original)
+++
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentInfoModule.java
Thu Jul 27 14:27:04 2006
@@ -169,7 +169,7 @@
return SiteUtil.isVisibleInNavigation(this.manager, document);
} catch (SiteException e) {
throw new ConfigurationException("Obtaining navigation visibility
failed ["
- + document.getId() + "]: " + e.getMessage(), e);
+ + document + "]: " + e.getMessage(), e);
}

}

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java
(original)
+++
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DocumentURLModule.java
Thu Jul 27 14:27:04 2006
@@ -55,12 +55,12 @@
}

final String area = attributes[0];
- final String documentId = attributes[1];
+ final String uuid = attributes[1];
final String language = attributes[2];

try {
DocumentHelper helper = new DocumentHelper(this.manager,
objectModel);
- url = helper.getDocumentUrl(documentId, area, language);
+ url = helper.getDocumentUrl(uuid, area, language);
} catch (Exception e) {
throw new ConfigurationException("Resolving attribute [" + name +
"] failed: ", e);
}

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
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
Thu Jul 27 14:27:04 2006
@@ -38,6 +38,7 @@
* related information such as document-id, area, publication-id.
*
* @see org.apache.lenya.cms.publication.PageEnvelope
+ * @deprecated use DocumentInfoModule instead.
*/
public class PageEnvelopeModule extends AbstractPageEnvelopeModule {


Modified:
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/transformation/LinkRewritingTransformer.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/transformation/LinkRewritingTransformer.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/transformation/LinkRewritingTransformer.java
(original)
+++
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/transformation/LinkRewritingTransformer.java
Thu Jul 27 14:27:04 2006
@@ -225,7 +225,7 @@

targetDocument = this.identityMap.get(publication,
getCurrentDocument().getArea(),
- targetDocument.getId(),
+ targetDocument.getUUID(),
targetDocument.getLanguage());

if (targetDocument.exists()) {

Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/Document.java Thu Jul
27 14:27:04 2006
@@ -61,6 +61,7 @@
/**
* Returns the document ID of this document.
* @return the document-id of this document.
+ * @deprecated use {@link #getUUID()} or {@link #getPath()}, respectively,
instead.
*/
String getId();

@@ -247,4 +248,9 @@
* @return The locator for this document.
*/
DocumentLocator getLocator();
+
+ /**
+ * @return The path of this document in the site structure.
+ */
+ String getPath();
}

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentIdToPathMapper.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentIdToPathMapper.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentIdToPathMapper.java
(original)
+++
lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentIdToPathMapper.java
Thu Jul 27 14:27:04 2006
@@ -30,12 +30,12 @@
* Compute the document-path for a given publication, area and
document-id. The file separator
* is the slash (/).
*
- * @param documentId the document-id of the document
+ * @param uuid the UUID of the document
* @param language the language of the document
*
* @return the path to the document, without publication ID and area
*/
- String getPath(String documentId, String language);
+ String getPath(String uuid, String language);

/**
* Compute the document-path for a given publication, area, document-id
and language

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/DocumentLocator.java
Thu Jul 27 14:27:04 2006
@@ -86,7 +86,7 @@

public DocumentLocator getParent() {
int lastSlashIndex = getPath().lastIndexOf("/");
- if (lastSlashIndex > 0) {
+ if (lastSlashIndex > -1) {
String parentPath = getPath().substring(0, lastSlashIndex);
return getPathVersion(parentPath);
} else {
@@ -101,5 +101,9 @@
} else {
return getPathVersion(defaultPath);
}
+ }
+
+ public DocumentLocator getLanguageVersion(String language) {
+ return DocumentLocator.getLocator(getPublicationId(), getArea(),
getPath(), language);
}
}

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/publication/PageEnvelope.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/publication/PageEnvelope.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/PageEnvelope.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/PageEnvelope.java Thu
Jul 27 14:27:04 2006
@@ -205,7 +205,7 @@
return "Resolving page envelope failed:" + "\n URI: " +
request.getRequestURI()
+ "\n Context: " + getContext() + "\n Publication ID: "
+ getPublication().getId() + "\n Area: " +
this.document.getArea()
- + "\n Document ID: " + this.document.getId();
+ + "\n Document UUID: " + this.document.getUUID();
}

/**

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/publication/util/Collection.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/publication/util/Collection.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/publication/util/Collection.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/publication/util/Collection.java
Thu Jul 27 14:27:04 2006
@@ -41,7 +41,7 @@
String ELEMENT_DOCUMENT = "document";

/** attribute for document IDs */
- String ATTRIBUTE_ID = "id";
+ String ATTRIBUTE_UUID = "uuid";

/**
* Returns the documents in this collection.

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/publication/util/CollectionImpl.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/publication/util/CollectionImpl.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/java/org/apache/lenya/cms/publication/util/CollectionImpl.java
(original)
+++
lenya/trunk/src/java/org/apache/lenya/cms/publication/util/CollectionImpl.java
Thu Jul 27 14:27:04 2006
@@ -172,7 +172,7 @@
* @throws DocumentBuildException when something went wrong.
*/
protected Document loadDocument(Element documentElement) throws
DocumentBuildException {
- String documentId = documentElement.getAttribute(ATTRIBUTE_ID);
+ String documentId = documentElement.getAttribute(ATTRIBUTE_UUID);
Document document =
getDelegate().getIdentityMap().get(getDelegate().getPublication(),
getDelegate().getArea(),
documentId,
@@ -189,9 +189,9 @@

NamespaceHelper helper = getNamespaceHelper();
Element collectionElement =
helper.getDocument().getDocumentElement();
- if (collectionElement.getAttributeNS(null, ATTRIBUTE_ID) == null
- | collectionElement.getAttribute(ATTRIBUTE_ID).equals(""))
{
- collectionElement.setAttributeNS(null, ATTRIBUTE_ID,
getDelegate().getId());
+ if (collectionElement.getAttributeNS(null, ATTRIBUTE_UUID) == null
+ |
collectionElement.getAttribute(ATTRIBUTE_UUID).equals("")) {
+ collectionElement.setAttributeNS(null, ATTRIBUTE_UUID,
getDelegate().getUUID());
}
Element[] existingDocumentElements =
helper.getChildren(collectionElement,
ELEMENT_DOCUMENT);
@@ -230,7 +230,7 @@
throws DocumentException {
try {
Element documentElement = helper.createElement(ELEMENT_DOCUMENT);
- documentElement.setAttributeNS(null, ATTRIBUTE_ID,
document.getId());
+ documentElement.setAttributeNS(null, ATTRIBUTE_UUID,
document.getUUID());
return documentElement;
} catch (final DOMException e) {
throw new DocumentException(e);

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/publication/util/DocumentHelper.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/publication/util/DocumentHelper.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/java/org/apache/lenya/cms/publication/util/DocumentHelper.java
(original)
+++
lenya/trunk/src/java/org/apache/lenya/cms/publication/util/DocumentHelper.java
Thu Jul 27 14:27:04 2006
@@ -77,13 +77,13 @@
* Creates a document URL. <br/>If the document ID is null, the current
document ID is used.
* <br/>If the document area is null, the current area is used. <br/>If
the language is null,
* the current language is used.
- * @param documentId The target document ID.
+ * @param uuid The target document UUID.
* @param documentArea The target area.
* @param language The target language.
* @return A string.
* @throws ProcessingException if something went wrong.
*/
- public String getDocumentUrl(String documentId, String documentArea,
String language)
+ public String getDocumentUrl(String uuid, String documentArea, String
language)
throws ProcessingException {

String url = null;
@@ -92,8 +92,8 @@
Request request = ObjectModelHelper.getRequest(this.objectModel);
String webappUrl = ServletHelper.getWebappURI(request);
Document envDocument = this.identityMap.getFromURL(webappUrl);
- if (documentId == null) {
- documentId = envDocument.getId();
+ if (uuid == null) {
+ uuid = envDocument.getUUID();
}

if (documentArea == null) {
@@ -106,10 +106,7 @@
language = envDocument.getLanguage();
}

- Document document = this.identityMap.get(this.publication,
- documentArea,
- documentId,
- language);
+ Document document = this.identityMap.get(this.publication,
documentArea, uuid, language);
url = document.getCanonicalWebappURL();

String contextPath = request.getContextPath();
@@ -189,7 +186,7 @@
String[] languages = document.getLanguages();

if (languages.length == 0) {
- throw new DocumentException("The document [" + document.getId()
+ throw new DocumentException("The document [" + document
+ "] does not exist in any language!");
}


Modified: lenya/trunk/src/java/org/apache/lenya/cms/site/NodeFactory.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/site/NodeFactory.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/site/NodeFactory.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/site/NodeFactory.java Thu Jul 27
14:27:04 2006
@@ -26,21 +26,21 @@

private static Map nodes = new WeakHashMap();

- public static SiteNode getNode(Publication pub, String area, String docId)
{
- String key = SiteNode.getKey(pub, area, docId);
+ public static SiteNode getNode(Publication pub, String area, String path) {
+ String key = SiteNode.getKey(pub, area, path);
SiteNode node = null;
if (nodes.containsKey(key)) {
node = (SiteNode) nodes.get(key);
}
else {
- node = new SiteNode(pub, area, docId);
+ node = new SiteNode(pub, area, path);
nodes.put(key, node);
}
return node;
}

public static SiteNode getNode(Document document) {
- return getNode(document.getPublication(), document.getArea(),
document.getId());
+ return getNode(document.getPublication(), document.getArea(),
document.getPath());
}

}

Modified: lenya/trunk/src/java/org/apache/lenya/cms/site/NodeSet.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/site/NodeSet.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/site/NodeSet.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/site/NodeSet.java Thu Jul 27
14:27:04 2006
@@ -51,7 +51,7 @@
public NodeSet(DocumentSet documents) {
Document[] docs = documents.getDocuments();
for (int i = 0; i < docs.length; i++) {
- SiteNode node = new SiteNode(docs[i].getPublication(),
docs[i].getArea(), docs[i].getId());
+ SiteNode node = new SiteNode(docs[i].getPublication(),
docs[i].getArea(), docs[i].getPath());
if (!contains(node)) {
add(node);
}

Modified: lenya/trunk/src/java/org/apache/lenya/cms/site/SiteUtil.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/site/SiteUtil.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/site/SiteUtil.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/site/SiteUtil.java Thu Jul 27
14:27:04 2006
@@ -28,6 +28,7 @@
import org.apache.lenya.cms.publication.DocumentBuildException;
import org.apache.lenya.cms.publication.DocumentException;
import org.apache.lenya.cms.publication.DocumentFactory;
+import org.apache.lenya.cms.publication.DocumentLocator;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.util.DocumentSet;

@@ -260,15 +261,16 @@
DocumentException, DocumentBuildException {

String targetArea = baseTarget.getArea();
- String sourceId = baseSource.getId();
+ String sourceId = baseSource.getPath();

- String suffix = source.getId().substring(sourceId.length());
- String targetId = baseTarget.getId() + suffix;
+ String suffix = source.getPath().substring(sourceId.length());
+ String targetId = baseTarget.getPath() + suffix;

- Document target =
source.getIdentityMap().get(baseTarget.getPublication(),
+ DocumentLocator targetLocator =
DocumentLocator.getLocator(baseTarget.getPublication().getId(),
targetArea,
targetId,
source.getLanguage());
+ Document target = source.getIdentityMap().get(targetLocator);
switch (mode) {
case MODE_REPLACE:
break;
@@ -473,7 +475,7 @@
selector = (ServiceSelector) manager.lookup(SiteManager.ROLE +
"Selector");
String siteManagerHint = doc.getPublication().getSiteManagerHint();
siteManager = (SiteManager) selector.select(siteManagerHint);
- return siteManager.getPath(doc.getArea(), doc.getId());
+ return siteManager.getPath(doc.getArea(), doc.getUUID());
} catch (ServiceException e) {
throw new SiteException(e);
} finally {

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/site/simple/DocumentStore.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/site/simple/DocumentStore.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/site/simple/DocumentStore.java
(original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/site/simple/DocumentStore.java
Thu Jul 27 14:27:04 2006
@@ -38,7 +38,7 @@
*/
public class DocumentStore extends CollectionImpl implements SiteStructure {

- protected static final String DOCUMENT_ID = "/site";
+ protected static final String DOCUMENT_PATH = "/site";

/**
* The identifiable type.
@@ -57,7 +57,7 @@
String area, Logger _logger) throws DocumentException {
super(manager, map, new DocumentIdentifier(publication,
area,
- DOCUMENT_ID,
+ DOCUMENT_PATH,
publication.getDefaultLanguage()), _logger);
}

@@ -78,7 +78,7 @@
* @see
org.apache.lenya.cms.publication.util.CollectionImpl#loadDocument(org.w3c.dom.Element)
*/
protected Document loadDocument(Element documentElement) throws
DocumentBuildException {
- String documentId = documentElement.getAttribute(ATTRIBUTE_ID);
+ String documentId = documentElement.getAttribute(ATTRIBUTE_UUID);
String language = documentElement.getAttribute(ATTRIBUTE_LANGUAGE);
Document document =
getDelegate().getIdentityMap().get(getDelegate().getPublication(),
getDelegate().getArea(),

Modified:
lenya/trunk/src/java/org/apache/lenya/cms/site/simple/SimpleSiteManager.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/site/simple/SimpleSiteManager.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/java/org/apache/lenya/cms/site/simple/SimpleSiteManager.java
(original)
+++
lenya/trunk/src/java/org/apache/lenya/cms/site/simple/SimpleSiteManager.java
Thu Jul 27 14:27:04 2006
@@ -139,7 +139,7 @@
*/
public boolean contains(Document resource) throws SiteException {

- if (resource.getId().equals(DocumentStore.DOCUMENT_ID)) {
+ if (resource.getPath().equals(DocumentStore.DOCUMENT_PATH)) {
return true;
}


Modified:
lenya/trunk/src/modules-core/ac-impl/java/src/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/ac-impl/java/src/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules-core/ac-impl/java/src/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java
(original)
+++
lenya/trunk/src/modules-core/ac-impl/java/src/org/apache/lenya/cms/ac/DocumentPolicyManagerWrapper.java
Thu Jul 27 14:27:04 2006
@@ -84,10 +84,10 @@
if (map.isDocument(webappUrl)) {
Document document = map.getFromURL(webappUrl);
if (document.existsInAnyLanguage()) {
- url = "/" + document.getArea() + document.getId();
+ url = "/" + document.getArea() + document.getPath();
if (getLogger().isDebugEnabled()) {
getLogger().debug(" Document exists");
- getLogger().debug(" Document ID: [" +
document.getId() + "]");
+ getLogger().debug(" Document path: [" +
document.getPath() + "]");
}
}
}

Modified:
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Assets.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Assets.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Assets.java
(original)
+++
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Assets.java
Thu Jul 27 14:27:04 2006
@@ -22,14 +22,12 @@
import java.util.List;
import java.util.Map;

-import org.apache.avalon.framework.service.ServiceSelector;
import org.apache.cocoon.servlet.multipart.Part;
import org.apache.lenya.ac.User;
import org.apache.lenya.cms.publication.Document;
import org.apache.lenya.cms.publication.Resource;
import org.apache.lenya.cms.publication.ResourcesManager;
import org.apache.lenya.cms.repository.Node;
-import org.apache.lenya.cms.site.SiteManager;
import org.apache.lenya.cms.site.SiteUtil;
import org.apache.lenya.cms.usecase.UsecaseException;
import org.apache.lenya.util.ServletHelper;
@@ -142,7 +140,7 @@
Resource theResource =
resourcesManager.getResource(getSourceDocument(), assetName);
if (theResource == null)
throw new Exception("no such resource [" + assetName + "]
exists for document [ "
- + getSourceDocument().getId() + "]");
+ + getSourceDocument() + "]");

// Lock the resource nodes
List nodes = new ArrayList();

Modified:
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ChangeLabel.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ChangeLabel.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ChangeLabel.java
(original)
+++
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ChangeLabel.java
Thu Jul 27 14:27:04 2006
@@ -80,7 +80,7 @@
.getSiteManagerHint());

if (document.exists()) {
- setParameter(DOCUMENT_ID, document.getId());
+ setParameter(DOCUMENT_ID, document.getUUID());
setParameter(LABEL, siteManager.getLabel(document));
}
} catch (final Exception e) {

Modified:
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ChangeNodeID.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ChangeNodeID.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ChangeNodeID.java
(original)
+++
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/ChangeNodeID.java
Thu Jul 27 14:27:04 2006
@@ -153,12 +153,9 @@
String nodeId = getParameterAsString(NODE_ID);
DocumentLocator parentLocator =
getSourceDocument().getLocator().getParent();
Document parent = identityMap.get(parentLocator);
- String parentId = "";
- // if the document is at the top level, the parent is null
- if (parent != null)
- parentId = parent.getId();
+ String parentPath = parent.getPath();
Publication publication = getSourceDocument().getPublication();
- Document document = identityMap.get(publication,
getSourceDocument().getArea(), parentId
+ Document document = identityMap.get(publication,
getSourceDocument().getArea(), parentPath
+ "/" + nodeId, getSourceDocument().getLanguage());
return document;
}
@@ -221,9 +218,9 @@

Document document = getSourceDocument();

- String oldDocumentId = document.getId();
- int lastSlashIndex = oldDocumentId.lastIndexOf("/");
- String strippedDocumentId = oldDocumentId.substring(0, lastSlashIndex
+ 1);
+ String oldPath = document.getPath();
+ int lastSlashIndex = oldPath.lastIndexOf("/");
+ String strippedDocumentId = oldPath.substring(0, lastSlashIndex + 1);
String newDocumentId = strippedDocumentId + nodeId;

return newDocumentId;

Modified:
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Clipboard.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Clipboard.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Clipboard.java
(original)
+++
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Clipboard.java
Thu Jul 27 14:27:04 2006
@@ -31,7 +31,7 @@

private String publicationId;
private String area;
- private String documentId;
+ private String uuid;
private String language;
private int method;

@@ -46,7 +46,7 @@
public Clipboard(Document document, int _method) {
this.publicationId = document.getPublication().getId();
this.area = document.getArea();
- this.documentId = document.getId();
+ this.uuid = document.getUUID();
this.language = document.getLanguage();
this.method = _method;
}
@@ -59,7 +59,7 @@
* @throws DocumentBuildException if the document could not be built.
*/
public Document getDocument(DocumentFactory identityMap, Publication
publication) throws DocumentBuildException {
- Document document = identityMap.get(publication, this.area,
this.documentId, this.language);
+ Document document = identityMap.get(publication, this.area, this.uuid,
this.language);
return document;
}


Modified:
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java
(original)
+++
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java
Thu Jul 27 14:27:04 2006
@@ -141,7 +141,7 @@
DocumentFactory map = getDocumentIdentityMap();
Document document = map.get(getPublication(),
getArea(),
- getNewDocumentId(),
+ getNewDocumentPath(),
getParameterAsString(LANGUAGE));

Document initialDocument = getInitialDocument();
@@ -197,7 +197,7 @@
/**
* @return the id of the new document being created in the usecase
*/
- protected abstract String getNewDocumentId();
+ protected abstract String getNewDocumentPath();

/**
* If the document created in the usecase shall have initial contents
copied from an existing
@@ -318,7 +318,7 @@
DocumentFactory map = getDocumentIdentityMap();
document = map.get(getPublication(),
getArea(),
- getNewDocumentId(),
+ getNewDocumentPath(),
getParameterAsString(LANGUAGE));

} catch (Exception e) {

Modified:
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java
(original)
+++
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java
Thu Jul 27 14:27:04 2006
@@ -21,6 +21,7 @@
import org.apache.avalon.framework.service.ServiceSelector;
import org.apache.lenya.cms.publication.Document;
import org.apache.lenya.cms.publication.DocumentBuilder;
+import org.apache.lenya.cms.publication.DocumentLocator;
import org.apache.lenya.cms.publication.Publication;

/**
@@ -30,7 +31,7 @@
*/
public class CreateDocument extends Create {

- protected static final String PARENT_ID = "parentId";
+ protected static final String PARENT_PATH = "parentId";

protected static final String DOCUMENT_TYPE = "doctype";

@@ -49,9 +50,9 @@

Document parent = getSourceDocument();
if (parent == null) {
- setParameter(PARENT_ID, "");
+ setParameter(PARENT_PATH, "");
} else {
- setParameter(PARENT_ID, parent.getId());
+ setParameter(PARENT_PATH, parent.getPath());
String[] languages = parent.getPublication().getLanguages();
setParameter(LANGUAGES, languages);
}
@@ -99,7 +100,7 @@
addErrorMessage("The document ID may not contain any special
characters.");
} else {
Publication publication = getSourceDocument().getPublication();
- String newDocumentId = getNewDocumentId();
+ String newDocumentId = getNewDocumentPath();
Document document =
getSourceDocument().getIdentityMap().get(publication,
getSourceDocument().getArea(),
newDocumentId,
@@ -140,26 +141,20 @@
}

/**
- * @see Create#getNewDocumentId()
+ * @see Create#getNewDocumentPath()
*/
- protected String getNewDocumentId() {
+ protected String getNewDocumentPath() {
if (getParameterAsBoolean(DOCUMENT_ID_PROVIDED, false)) {
return getParameterAsString(DOCUMENT_ID);
} else {
String relation = getRelation();
- Document sourceDoc = getSourceDocument();
+ DocumentLocator sourceLoc = getSourceDocument().getLocator();
if (relation.equals(RELATION_CHILD)) {
- return sourceDoc.getId() + "/" + getNewDocumentName();
- } else if (relation.equals(RELATION_BEFORE)) {
- return sourceDoc.getId().substring(0,
- sourceDoc.getId().lastIndexOf(sourceDoc.getName()))
- + getNewDocumentName();
- } else if (relation.equals(RELATION_AFTER)) {
- return sourceDoc.getId().substring(0,
- sourceDoc.getId().lastIndexOf(sourceDoc.getName()))
- + getNewDocumentName();
+ return sourceLoc.getChild(getNewDocumentName()).getPath();
+ } else if (relation.equals(RELATION_BEFORE) ||
relation.equals(RELATION_AFTER)) {
+ return
sourceLoc.getParent().getChild(getNewDocumentName()).getPath();
} else {
- return getSourceDocument().getId() + "/" +
getNewDocumentName();
+ throw new IllegalStateException("unsupported relation " +
relation);
}
}
}

Modified:
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateLanguage.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateLanguage.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateLanguage.java
(original)
+++
lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateLanguage.java
Thu Jul 27 14:27:04 2006
@@ -73,7 +73,7 @@
for (int i = 0; i < languages.length; i++) {
Document version = map.get(source.getPublication(),
source.getArea(),
- source.getId(),
+ source.getUUID(),
languages[i]);
if (!version.exists()) {
nonExistingLanguages.add(languages[i]);
@@ -90,7 +90,7 @@

Document source = getSourceDocument();
if (source != null) {
- setParameter(DOCUMENT_ID, source.getId());
+ setParameter(DOCUMENT_ID, source.getUUID());
try {
List nonExistingLanguages = getNonExistingLanguages();
setParameter(LANGUAGES, nonExistingLanguages
@@ -111,10 +111,10 @@

/**
* For new language version of a document, id is the same as that
document's
- * @see Create#getNewDocumentId()
+ * @see Create#getNewDocumentPath()
*/
- protected String getNewDocumentId() {
- return getSourceDocument().getId();
+ protected String getNewDocumentPath() {
+ return getSourceDocument().getPath();
}

/**

Modified:
lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/InvokeWorkflow.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/InvokeWorkflow.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/InvokeWorkflow.java
(original)
+++
lenya/trunk/src/modules-core/workflow-impl/java/src/org/apache/lenya/cms/workflow/usecases/InvokeWorkflow.java
Thu Jul 27 14:27:04 2006
@@ -65,7 +65,7 @@
getSourceDocument(),
getEvent())) {
addErrorMessage("error-workflow-document", new String[] {
getEvent(),
- getSourceDocument().getId() });
+ getSourceDocument().toString() });
}
}


Modified:
lenya/trunk/src/modules/bxe/java/src/org/apache/lenya/cms/editors/bxe/BXE.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules/bxe/java/src/org/apache/lenya/cms/editors/bxe/BXE.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules/bxe/java/src/org/apache/lenya/cms/editors/bxe/BXE.java
(original)
+++
lenya/trunk/src/modules/bxe/java/src/org/apache/lenya/cms/editors/bxe/BXE.java
Thu Jul 27 14:27:04 2006
@@ -46,7 +46,7 @@

Document doc = getSourceDocument();
DocumentIdToPathMapper mapper =
doc.getPublication().getPathMapper();
- String path = mapper.getPath(doc.getId(), doc.getLanguage());
+ String path = mapper.getPath(doc.getUUID(), doc.getLanguage());
String sourceUri = doc.getSourceURI();
String pubId = doc.getPublication().getId();
String tempSourceUri = "context://lenya/pubs/" + pubId +
"/work/bxe/content/"
@@ -85,7 +85,7 @@
getSourceDocument(),
getEvent())) {
addErrorMessage("error-workflow-document", new String[] {
getEvent(),
- getSourceDocument().getId() });
+ getSourceDocument().toString() });
}
}


Modified:
lenya/trunk/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java
(original)
+++
lenya/trunk/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java
Thu Jul 27 14:27:04 2006
@@ -40,7 +40,6 @@
import org.apache.lenya.xml.ValidationUtil;
import org.w3c.dom.Document;
import org.w3c.tidy.Tidy;
-import org.xml.sax.SAXException;

/**
* Fckeditor Usecase
@@ -82,7 +81,7 @@
getSourceDocument(),
getEvent())) {
addErrorMessage("error-workflow-document", new String[] {
getEvent(),
- getSourceDocument().getId() });
+ getSourceDocument().toString() });
}
}


Modified:
lenya/trunk/src/modules/lucene/java/src/org/apache/lenya/cms/lucene/IndexDocument.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules/lucene/java/src/org/apache/lenya/cms/lucene/IndexDocument.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules/lucene/java/src/org/apache/lenya/cms/lucene/IndexDocument.java
(original)
+++
lenya/trunk/src/modules/lucene/java/src/org/apache/lenya/cms/lucene/IndexDocument.java
Thu Jul 27 14:27:04 2006
@@ -83,7 +83,7 @@
protected Node[] getNodesToLock() throws UsecaseException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("IndexDocument::getObjectsToLock() called on
source document ["
- + getSourceDocument().getId() + "]");
+ + getSourceDocument() + "]");
}

Node[] objects = { getSourceDocument().getRepositoryNode() };

Modified:
lenya/trunk/src/modules/lucene/java/src/org/apache/lenya/cms/lucene/IndexUpdater.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules/lucene/java/src/org/apache/lenya/cms/lucene/IndexUpdater.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules/lucene/java/src/org/apache/lenya/cms/lucene/IndexUpdater.java
(original)
+++
lenya/trunk/src/modules/lucene/java/src/org/apache/lenya/cms/lucene/IndexUpdater.java
Thu Jul 27 14:27:04 2006
@@ -50,7 +50,7 @@
try {
String[] formats = doc.getResourceType().getFormats();
if (Arrays.asList(formats).contains("luceneIndex")) {
- String docString = doc.getPublication().getId() + "/" +
doc.getArea() + doc.getId()
+ String docString = doc.getPublication().getId() + "/" +
doc.getArea() + doc.getUUID()
+ "/" + doc.getLanguage();
uri = "cocoon://modules/lucene/" + operation + "-document/" +
docString + ".xml";
SourceUtil.readDOM(uri, this.manager);

Modified:
lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/components/modules/input/SitetreeModule.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/components/modules/input/SitetreeModule.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/components/modules/input/SitetreeModule.java
(original)
+++
lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/components/modules/input/SitetreeModule.java
Thu Jul 27 14:27:04 2006
@@ -90,22 +90,22 @@
SiteTree authoringTree = _manager.getTree(map,
publication,
Publication.AUTHORING_AREA);
- value = authoringTree.getNode(envelope.getDocument().getId());
+ value =
authoringTree.getNode(envelope.getDocument().getPath());
}

if (name.equals(LIVE_NODE)) {
SiteTree liveTree = _manager.getTree(map, publication,
Publication.LIVE_AREA);
- value = liveTree.getNode(envelope.getDocument().getId());
+ value = liveTree.getNode(envelope.getDocument().getPath());
}

if (name.equals(TRASH_NODE)) {
SiteTree trashTree = _manager.getTree(map, publication,
Publication.TRASH_AREA);
- value = trashTree.getNode(envelope.getDocument().getId());
+ value = trashTree.getNode(envelope.getDocument().getPath());
}

if (name.equals(ARCHIVE_NODE)) {
SiteTree archiveTree = _manager.getTree(map, publication,
Publication.ARCHIVE_AREA);
- value = archiveTree.getNode(envelope.getDocument().getId());
+ value = archiveTree.getNode(envelope.getDocument().getPath());
}
} catch (Exception e) {
throw new ConfigurationException("Obtaining value for [" + name +
"] failed: ", e);

Modified:
lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/transformation/DocumentIndexTransformer.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/transformation/DocumentIndexTransformer.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/transformation/DocumentIndexTransformer.java
(original)
+++
lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/cocoon/transformation/DocumentIndexTransformer.java
Thu Jul 27 14:27:04 2006
@@ -154,15 +154,15 @@
cIncludePrefix = "ci:";
}

- String documentId = this.document.getId();
+ String path = this.document.getPath();
String language = this.document.getLanguage();
String defaultLanguage = this.publication.getDefaultLanguage();
- SiteTreeNode[] children =
this.siteTree.getNode(documentId).getChildren();
+ SiteTreeNode[] children =
this.siteTree.getNode(path).getChildren();

super.startElement(uri, localName, raw, attr);

for (int i = 0; i < children.length; i++) {
- String childId = documentId + "/" + children[i].getId();
+ String childId = path + "/" + children[i].getId();

// get child document with the same language than the
parent
// document

Modified:
lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree/TreeSiteManager.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree/TreeSiteManager.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree/TreeSiteManager.java
(original)
+++
lenya/trunk/src/modules/sitetree/java/src/org/apache/lenya/cms/site/tree/TreeSiteManager.java
Thu Jul 27 14:27:04 2006
@@ -163,7 +163,7 @@
*/
public boolean contains(Document resource) throws SiteException {
SiteTree tree = getTree(resource);
- SiteTreeNode node = tree.getNode(resource.getId());
+ SiteTreeNode node = tree.getNode(resource.getPath());
boolean exists = node != null && node.getLabel(resource.getLanguage())
!= null;
return exists;
}
@@ -174,7 +174,7 @@
public String getUUID(Document resource) throws SiteException {
String uuid = null;
SiteTree tree = getTree(resource);
- SiteTreeNode node = tree.getNode(resource.getId());
+ SiteTreeNode node = tree.getNode(resource.getPath());
if (node != null) {
uuid = node.getUUID();
}
@@ -189,7 +189,7 @@
*/
public boolean containsInAnyLanguage(Document resource) throws
SiteException {
SiteTree tree = getTree(resource);
- SiteTreeNode node = tree.getNode(resource.getId());
+ SiteTreeNode node = tree.getNode(resource.getPath());
return node != null;
}

@@ -201,9 +201,9 @@
SiteTree sourceTree = getTree(sourceDocument);
SiteTree destinationTree = getTree(destinationDocument);

- SiteTreeNode sourceNode = sourceTree.getNode(sourceDocument.getId());
+ SiteTreeNode sourceNode = sourceTree.getNode(sourceDocument.getPath());
if (sourceNode == null) {
- throw new SiteException("The node for source document [" +
sourceDocument.getId()
+ throw new SiteException("The node for source document [" +
sourceDocument
+ "] doesn't exist!");
}

@@ -217,7 +217,7 @@
String siblingDocId = null;

// same document ID -> insert at the same position
- if (sourceDocument.getId().equals(destinationDocument.getId())) {
+ if (sourceDocument.getPath().equals(destinationDocument.getPath())) {
for (int i = 0; i < siblings.length; i++) {
String docId = parentId + "/" + siblings[i].getId();
sibling = destinationTree.getNode(docId);
@@ -232,22 +232,22 @@
if (label == null) {
// the node that we're trying to publish
// doesn't have this language
- throw new SiteException("The node " + sourceDocument.getId()
+ throw new SiteException("The node " + sourceDocument.getPath()
+ " doesn't contain a label for language " +
sourceDocument.getLanguage());
}
- SiteTreeNode destinationNode =
destinationTree.getNode(destinationDocument.getId());
+ SiteTreeNode destinationNode =
destinationTree.getNode(destinationDocument.getPath());
if (destinationNode == null) {
Label[] labels = { label };

if (siblingDocId == null) {
- destinationTree.addNode(destinationDocument.getId(),
+ destinationTree.addNode(destinationDocument.getPath(),
labels,
sourceNode.visibleInNav(),
sourceNode.getHref(),
sourceNode.getSuffix(),
sourceNode.hasLink());
} else {
- destinationTree.addNode(destinationDocument.getId(),
+ destinationTree.addNode(destinationDocument.getPath(),
labels,
sourceNode.visibleInNav(),
sourceNode.getHref(),
@@ -260,7 +260,7 @@
// if the node already exists in the live
// tree simply insert the label in the
// live tree
- destinationTree.setLabel(destinationDocument.getId(), label);
+ destinationTree.setLabel(destinationDocument.getPath(), label);
}

}
@@ -273,7 +273,7 @@
document.getPublication(),
document.getArea());

- SiteTreeNode node = tree.getNode(document.getId());
+ SiteTreeNode node = tree.getNode(document.getPath());

if (node == null) {
throw new SiteException("Sitetree node for document [" + document
+ "] does not exist!");
@@ -294,7 +294,7 @@
node.removeLabel(label);

if (node.getLabels().length == 0) {
- tree.removeNode(document.getId());
+ tree.removeNode(document.getPath());
} else {
tree.save();
}
@@ -317,7 +317,7 @@
labelObject.setLabel(label);

SiteTree tree = getTree(document);
- tree.setLabel(document.getId(), labelObject);
+ tree.setLabel(document.getPath(), labelObject);
}

/**
@@ -326,7 +326,7 @@
*/
public void setVisibleInNav(Document document, boolean visibleInNav)
throws SiteException {
SiteTree tree = getTree(document);
- tree.setVisibleInNav(document.getId(), visibleInNav);
+ tree.setVisibleInNav(document.getPath(), visibleInNav);
}

/**
@@ -340,7 +340,7 @@
Label label = null;
SiteTree siteTree = getTree(document);
if (siteTree != null) {
- SiteTreeNode node = siteTree.getNode(document.getId());
+ SiteTreeNode node = siteTree.getNode(document.getPath());
if (node == null) {
throw new SiteException("Node for document [" + document + "]
does not exist!");
}
@@ -389,12 +389,12 @@
SiteTree tree = getTree(document);
Label label = new Label("", document.getLanguage());

- SiteTreeNode node = tree.getNode(document.getId());
+ SiteTreeNode node = tree.getNode(document.getPath());
if (node == null) {
Label[] labels = { label };
- tree.addNode(document.getId(), labels, true, null, null, false);
+ tree.addNode(document.getPath(), labels, true, null, null, false);
} else {
- tree.addLabel(document.getId(), label);
+ tree.addLabel(document.getPath(), label);
}

}
@@ -451,7 +451,7 @@
* @throws SiteException if an error occurs.
*/
protected String computeUniqueDocumentId(Document document) throws
SiteException {
- String documentId = document.getId();
+ String documentId = document.getPath();

SiteTree tree = getTree(document);

@@ -491,7 +491,7 @@

public boolean isVisibleInNav(Document document) throws SiteException {
SiteTree tree = getTree(document);
- return tree.isVisibleInNav(document.getId());
+ return tree.isVisibleInNav(document.getPath());
}

public String getPath(String area, String uuid) throws SiteException {

Modified:
lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Mkcol.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Mkcol.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Mkcol.java
(original)
+++
lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Mkcol.java
Thu Jul 27 14:27:04 2006
@@ -25,11 +25,9 @@
import org.apache.lenya.cms.metadata.MetaDataException;
import org.apache.lenya.cms.metadata.dublincore.DublinCore;
import org.apache.lenya.cms.publication.Document;
-import org.apache.lenya.cms.publication.DocumentException;
import org.apache.lenya.cms.publication.DocumentFactory;
import org.apache.lenya.cms.publication.DocumentManager;
import org.apache.lenya.cms.publication.ResourceType;
-import org.apache.lenya.cms.repository.RepositoryException;
import org.apache.lenya.cms.site.usecases.Create;
import org.apache.lenya.workflow.WorkflowManager;

@@ -81,7 +79,7 @@
DocumentFactory map = getDocumentIdentityMap();
Document document = map.get(getPublication(),
doc.getArea(),
- doc.getId(),
+ doc.getUUID(),
doc.getLanguage());

resourceType = (ResourceType) selector.select(TYPE);
@@ -148,7 +146,7 @@
return null;
}

- protected String getNewDocumentId() {
+ protected String getNewDocumentPath() {
// TODO Auto-generated method stub
return null;
}

Modified:
lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Put.java
URL:
http://svn.apache.org/viewvc/lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Put.java?rev=426254&r1=426253&r2=426254&view=diff
==============================================================================
---
lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Put.java
(original)
+++
lenya/trunk/src/modules/webdav/java/src/org/apache/lenya/cms/usecases/webdav/Put.java
Thu Jul 27 14:27:04 2006
@@ -108,7 +108,7 @@
DocumentFactory map = getDocumentIdentityMap();
Document document = map.get(getPublication(),
doc.getArea(),
- doc.getId(),
+ doc.getUUID(),
doc.getLanguage());
//lookupResourceType(extension)
resourceType = lookUpExtension(extension, selector);
@@ -262,9 +262,9 @@
}


- protected String getNewDocumentId() {
+ protected String getNewDocumentPath() {
Document doc = getSourceDocument();
- return doc.getId();
+ return doc.getUUID();
}

protected boolean getVisibleInNav(){


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
user-groups.jax...    php.zend.framew...    os.solaris.open...    web.quixote.use...    java.openjdk.ho...    ietf.secmech/20...    gnu.glpk/2004-0...    recreation.cars...    network.smokepi...    linux.drivers.i...    cms.opencms.dev...    fonts.gfontview...    text.xml.soap.u...    voip.nist-sip/2...    debian.ports.hp...    xfree86.interna...    science.biology...    qnx.openqnx.dev...    mail.sylpheed.c...    busybox/bios/20...    emulators.kvm.s...    hardware.openco...    apple.fink.begi...    kde.german/2006...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation