You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/08/14 11:35:55 UTC
svn commit: r565674 - in /lenya/trunk/src:
java/org/apache/lenya/cms/rc/RCML.java
modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java
modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeRCML.java
Author: andreas
Date: Tue Aug 14 02:35:51 2007
New Revision: 565674
URL: http://svn.apache.org/viewvc?view=rev&rev=565674
Log:
Re-added newVersion parameter to RCML
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/rc/RCML.java
lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNode.java
lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeRCML.java
Modified: lenya/trunk/src/java/org/apache/lenya/cms/rc/RCML.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/rc/RCML.java?view=diff&rev=565674&r1=565673&r2=565674
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/rc/RCML.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/rc/RCML.java Tue Aug 14 02:35:51 2007
@@ -45,9 +45,10 @@
* Check the RCML in.
* @param node The node.
* @param backup If a backup shall be created.
+ * @param newVersion If the revision number should be increased.
* @throws RevisionControlException if an error occurs.
*/
- void checkIn(Node node, boolean backup) throws RevisionControlException;
+ void checkIn(Node node, boolean backup, boolean newVersion) throws RevisionControlException;
/**
* Check the RCML out.
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?view=diff&rev=565674&r1=565673&r2=565674
==============================================================================
--- 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 Aug 14 02:35:51 2007
@@ -110,7 +110,7 @@
throw new RepositoryException("Cannot check in node [" + getSourceURI()
+ "]: not checked out by this session!");
}
- rcml.checkIn(this, exists());
+ rcml.checkIn(this, exists(), getSession().isDirty(this));
} catch (Exception e) {
throw new RepositoryException(e);
}
@@ -125,7 +125,7 @@
throw new RepositoryException("Cannot check in node [" + getSourceURI()
+ "]: not checked out!");
}
- rcml.checkIn(this, false);
+ rcml.checkIn(this, false, false);
} catch (Exception e) {
throw new RepositoryException(e);
}
@@ -472,5 +472,5 @@
throw new RepositoryException(e);
}
}
-
+
}
Modified: lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeRCML.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeRCML.java?view=diff&rev=565674&r1=565673&r2=565674
==============================================================================
--- lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeRCML.java (original)
+++ lenya/trunk/src/modules/sourcerepository/java/src/org/apache/lenya/cms/repository/SourceNodeRCML.java Tue Aug 14 02:35:51 2007
@@ -133,9 +133,10 @@
* @param type co for a check out, ci for a check in
* @param time
* @param backup Create backup element
+ * @param newVersion If the revision number shall be increased.
* @throws RevisionControlException if an error occurs
*/
- public synchronized void checkOutIn(Node node, short type, long time, boolean backup)
+ public synchronized void checkOutIn(Node node, short type, long time, boolean backup, boolean newVersion)
throws RevisionControlException {
String identity = node.getSession().getIdentity().getUser().getId();
@@ -165,7 +166,9 @@
if (latestEntry != null) {
version = latestEntry.getVersion();
}
- version++;
+ if (newVersion) {
+ version++;
+ }
entry = new CheckInEntry(sessionId, identity, time, version, backup);
break;
case RCML.co:
@@ -581,20 +584,20 @@
return entry != null && entry.getType() == RCML.co;
}
- public synchronized void checkIn(Node node, boolean backup) throws RevisionControlException {
+ public synchronized void checkIn(Node node, boolean backup, boolean newVersion) throws RevisionControlException {
long time = new Date().getTime();
if (backup) {
makeBackup(time);
}
- checkOutIn(node, RCML.ci, time, backup);
+ checkOutIn(node, RCML.ci, time, backup, newVersion);
pruneEntries();
write();
}
public synchronized void checkOut(Node node) throws RevisionControlException {
- checkOutIn(node, RCML.co, new Date().getTime(), false);
+ checkOutIn(node, RCML.co, new Date().getTime(), false, false);
}
public boolean isCheckedOutBySession(Session session) throws RevisionControlException {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org