You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by jw...@apache.org on 2005/05/14 20:49:27 UTC

svn commit: r170155 - in /lenya/trunk/src/java/org/apache/lenya/cms/repository: Node.java SourceNode.java

Author: jwkaltz
Date: Sat May 14 11:49:27 2005
New Revision: 170155

URL: http://svn.apache.org/viewcvs?rev=170155&view=rev
Log:
[minor change] rename Uri to URI. provide accessor

Modified:
    lenya/trunk/src/java/org/apache/lenya/cms/repository/Node.java
    lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java

Modified: lenya/trunk/src/java/org/apache/lenya/cms/repository/Node.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/repository/Node.java?rev=170155&r1=170154&r2=170155&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/repository/Node.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/repository/Node.java Sat May 14 11:49:27 2005
@@ -25,7 +25,7 @@
 /**
  * Repository node.
  * 
- * @version $Id:$
+ * @version $Id$
  */
 public interface Node extends Transactionable {
 
@@ -74,5 +74,12 @@
      * @throws TransactionException if the node does not exist.
      */
     String getMimeType() throws TransactionException;
+
+    /**
+     * Accessor for the source URI of this node
+     * @return the source URI
+     * @throws TransactionException if the node does not exist.
+     */
+    String getSourceURI();
 
 }

Modified: lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java?rev=170155&r1=170154&r2=170155&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/repository/SourceNode.java Sat May 14 11:49:27 2005
@@ -44,23 +44,23 @@
 /**
  * A repository node.
  * 
- * @version $Id:$
+ * @version $Id$
  */
 public class SourceNode extends AbstractLogEnabled implements Node {
 
-    private String sourceUri;
+    private String sourceURI;
     private ServiceManager manager;
     private IdentityMap identityMap;
 
     /**
      * Ctor.
      * @param map
-     * @param sourceUri
+     * @param sourceURI
      * @param manager
      * @param logger
      */
-    public SourceNode(IdentityMap map, String sourceUri, ServiceManager manager, Logger logger) {
-        this.sourceUri = sourceUri;
+    public SourceNode(IdentityMap map, String sourceURI, ServiceManager manager, Logger logger) {
+        this.sourceURI = sourceURI;
         this.manager = manager;
         enableLogging(logger);
         this.identityMap = map;
@@ -79,7 +79,7 @@
     }
 
     protected String getRealSourceURI() {
-        return "context://" + this.sourceUri.substring(Node.LENYA_PROTOCOL.length());
+        return "context://" + this.sourceURI.substring(Node.LENYA_PROTOCOL.length());
     }
 
     /**
@@ -87,7 +87,7 @@
      */
     public void checkin() throws TransactionException {
         if (!isCheckedOut()) {
-            throw new TransactionException("Cannot check in node [" + this.sourceUri
+            throw new TransactionException("Cannot check in node [" + this.sourceURI
                     + "]: not checked out!");
         }
 
@@ -119,7 +119,7 @@
     public void checkout() throws TransactionException {
 
         if (getLogger().isDebugEnabled())
-            getLogger().debug("SourceNode::checkout() called, sourceUri [" + sourceUri + "]");
+            getLogger().debug("SourceNode::checkout() called, sourceURI [" + sourceURI + "]");
 
         if (!isCheckedOut()) {
             try {
@@ -136,10 +136,10 @@
      */
     protected String getRCPath() throws IOException {
         String pubBase = Node.LENYA_PROTOCOL + Publication.PUBLICATION_PREFIX_URI + "/";
-        String publicationsPath = this.sourceUri.substring(pubBase.length());
+        String publicationsPath = this.sourceURI.substring(pubBase.length());
         String publicationId = publicationsPath.split("/")[0];
         String path = pubBase + publicationId + "/";
-        return this.sourceUri.substring(path.length());
+        return this.sourceURI.substring(path.length());
     }
 
     /**
@@ -148,7 +148,7 @@
     public void deleteTransactionable() throws TransactionException {
         try {
             if (!isCheckedOut()) {
-                throw new RuntimeException("Cannot delete source [" + this.sourceUri
+                throw new RuntimeException("Cannot delete source [" + this.sourceURI
                         + "]: not checked out!");
             } else {
                 SourceUtil.delete(getRealSourceURI(), this.manager);
@@ -164,7 +164,7 @@
         if (this.revisionController == null) {
             try {
                 String pubBase = Node.LENYA_PROTOCOL + Publication.PUBLICATION_PREFIX_URI + "/";
-                String publicationsPath = this.sourceUri.substring(pubBase.length());
+                String publicationsPath = this.sourceURI.substring(pubBase.length());
                 String publicationId = publicationsPath.split("/")[0];
 
                 Source contextSource = null;
@@ -222,7 +222,7 @@
      */
     public void saveTransactionable() throws TransactionException {
         if (!isCheckedOut()) {
-            throw new TransactionException("Cannot save node [" + this.sourceUri
+            throw new TransactionException("Cannot save node [" + this.sourceURI
                     + "]: not checked out!");
         }
         if (getLogger().isDebugEnabled()) {
@@ -343,7 +343,7 @@
      * @see java.lang.Object#toString()
      */
     public String toString() {
-        return "node " + this.sourceUri;
+        return "node " + this.sourceURI;
     }
 
     private byte[] data = null;
@@ -510,5 +510,13 @@
             }
         }
     }
+
+    /**
+     * @see org.apache.lenya.cms.repository.Node#getSourceURI()
+     */
+    public String getSourceURI() {
+        return sourceURI;
+    }
+
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org