Author: andreas
Date: Fri Nov 16 01:24:46 2007
New Revision: 595608
URL: http://svn.apache.org/viewvc?rev=595608&view=rev
Log:
AbstractLink: throw UnsupportedOperationException in getDocument() if node has no UUID.
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/site/AbstractLink.java
Modified: lenya/trunk/src/java/org/apache/lenya/cms/site/AbstractLink.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/site/AbstractLink.java?rev=595608&r1=595607&r2=595608&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/site/AbstractLink.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/site/AbstractLink.java Fri Nov 16 01:24:46 2007
@@ -101,10 +101,15 @@
private DocumentFactory factory;
public Document getDocument() {
- Publication pub = getNode().getStructure().getPublication();
- String area = getNode().getStructure().getArea();
+ SiteNode node = getNode();
+ String uuid = node.getUuid();
+ if (uuid == null) {
+ throw new UnsupportedOperationException("The node [" + node + "] has no UUID.");
+ }
+ Publication pub = node.getStructure().getPublication();
+ String area = node.getStructure().getArea();
try {
- return this.factory.get(pub, area, getNode().getUuid(), getLanguage());
+ return this.factory.get(pub, area, uuid, getLanguage());
} catch (DocumentBuildException e) {
throw new RuntimeException(e);
}
@@ -121,4 +126,4 @@
protected void save() {}
-}
+}
\ No newline at end of file
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.