Author: andreas
Date: Tue Jan 13 02:44:37 2009
New Revision: 734097
URL: http://svn.apache.org/viewvc?rev=734097&view=rev
Log:
Fix existence check for source nodes.
Modified:
lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java
Modified: lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java?rev=734097&r1=734096&r2=734097&view=diff
==============================================================================
--- lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java (original)
+++ lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java Tue Jan 13 02:44:37 2009
@@ -396,15 +396,19 @@
public boolean exists() throws RepositoryException {
try {
- RCMLEntry entry = getRcml().getLatestEntry();
+ RCML rcml = getRcml();
+ RCMLEntry entry = rcml.getLatestEntry();
if (entry == null) {
return false;
} else if (entry.getType() == RCML.ci) {
return true;
- }
- else {
- // before check-in, the node exists only in the session that created it
- return entry.getSessionId().equals(getSession().getId());
+ } else {
+ if (rcml.getLatestCheckInEntry() != null) {
+ return true;
+ } else {
+ // before first check-in, the node exists only in the session that created it
+ return entry.getSessionId().equals(getSession().getId());
+ }
}
} catch (RevisionControlException e) {
throw new RepositoryException(e);
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.