You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by pn...@apache.org on 2003/08/18 08:48:15 UTC

cvs commit: jakarta-slide/src/share/org/apache/slide/content ContentImpl.java NodeRevisionDescriptor.java NodeRevisionDescriptors.java

pnever      2003/08/17 23:48:15

  Modified:    src/share/org/apache/slide/content ContentImpl.java
                        NodeRevisionDescriptor.java
                        NodeRevisionDescriptors.java
  Log:
  Prepare for binding
  
  Revision  Changes    Path
  1.46      +51 -50    jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java
  
  Index: ContentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- ContentImpl.java	25 Apr 2003 13:51:38 -0000	1.45
  +++ ContentImpl.java	18 Aug 2003 06:48:14 -0000	1.46
  @@ -103,8 +103,8 @@
       static {
           try {
               String uriRedirectorClassName = Domain.getParameter(I_URIREDIRECTORCLASS, I_URIREDIRECTORCLASS_DEFAULT);
  -                uriRedirectorClass = Class.forName( uriRedirectorClassName );
  -            }
  +            uriRedirectorClass = Class.forName( uriRedirectorClassName );
  +        }
           catch( Exception x ) {
               Domain.warn( "Loading of redirector class failed: "+x.getMessage() );
           }
  @@ -177,12 +177,12 @@
        */
       public NodeRevisionDescriptors retrieve(SlideToken token, String strUri)
           throws ObjectNotFoundException, AccessDeniedException,
  -    LinkedObjectNotFoundException, ServiceAccessException, ObjectLockedException {
  +        LinkedObjectNotFoundException, ServiceAccessException, ObjectLockedException {
           
           String originalUri = strUri;
           strUri = redirectUri( originalUri ); // security token null - is ignored anyway
           
  -        ObjectNode associatedObject = 
  +        ObjectNode associatedObject =
               structureHelper.retrieve(token, strUri, false);
           
           // Checking security and locking
  @@ -241,20 +241,20 @@
           }
           
           if( latestNrn == null ) {
  -        // Retrieving latest revision numbers
  -        NodeRevisionNumber branchLatestRevisionNumber =
  -            realRevisionDescriptors.getLatestRevision(branch);
  -        
  -        if (branchLatestRevisionNumber == null) {
  -            throw new BranchNotFoundException
  -                (realRevisionDescriptors.getUri().toString(), branch);
  -        }
  +            // Retrieving latest revision numbers
  +            NodeRevisionNumber branchLatestRevisionNumber =
  +                realRevisionDescriptors.getLatestRevision(branch);
  +            
  +            if (branchLatestRevisionNumber == null) {
  +                throw new BranchNotFoundException
  +                    (realRevisionDescriptors.getUri().toString(), branch);
  +            }
               result = retrieve(token, realRevisionDescriptors,
  -                        branchLatestRevisionNumber);
  +                              branchLatestRevisionNumber);
           }
           else {
               result = retrieve( token, revisionDescriptors,
  -                               latestNrn );
  +                              latestNrn );
           }
           
           return result;
  @@ -322,11 +322,11 @@
           
           if( latestNrn == null ) {
               result = retrieve( token, revisionDescriptors,
  -                        realRevisionDescriptors.getLatestRevision());
  +                              realRevisionDescriptors.getLatestRevision());
           }
           else {
               result = retrieve( token, revisionDescriptors,
  -                               latestNrn );
  +                              latestNrn );
           }
           
           return result;
  @@ -366,7 +366,7 @@
           RevisionNotFoundException, RevisionContentNotFoundException,
           ObjectLockedException {
           
  -        ObjectNode associatedObject = 
  +        ObjectNode associatedObject =
               structureHelper.retrieve(token, strUri, false);
           
           // Checking security and locking
  @@ -402,7 +402,7 @@
           ObjectLockedException {
           
           // Retrieve the associated object
  -        ObjectNode associatedObject = 
  +        ObjectNode associatedObject =
               structureHelper.retrieve(token, strUri, false);
           
           // Next we do a security check and a locking check for modifyRevisions
  @@ -448,7 +448,7 @@
           ServiceAccessException, ObjectLockedException {
           
           // Retrieve the associated object
  -        ObjectNode associatedObject = 
  +        ObjectNode associatedObject =
               structureHelper.retrieve(token, strUri, false);
           
           // Next we do a security check and a locking check for modifyRevisions
  @@ -474,11 +474,13 @@
               revisionDescriptor.setCreationDate(new Date());
           }
           // set the display name (in case of copy)
  -        String resourceName = strUri;
  -        int lastSlash = resourceName.lastIndexOf('/');
  -        if (lastSlash != -1)
  -            resourceName = resourceName.substring(lastSlash + 1);
  -        revisionDescriptor.setName(resourceName);
  +        if (!Configuration.useBinding(namespace.getUri(token, strUri).getStore())) {
  +            String resourceName = strUri;
  +            int lastSlash = resourceName.lastIndexOf('/');
  +            if (lastSlash != -1)
  +                resourceName = resourceName.substring(lastSlash + 1);
  +            revisionDescriptor.setName(resourceName);
  +        }
           
           Uri objectUri = namespace.getUri(token, strUri);
           
  @@ -562,11 +564,10 @@
                   
               } else {
                   
  -                try {
  -                    { 
  -                        // merge the new received properties into the 
  +                try { {
  +                        // merge the new received properties into the
                           // revisionDescriptor
  -
  +                        
                           // We update the descriptor's properties
                           NodeRevisionDescriptor oldRevisionDescriptor =
                               objectUri.getStore()
  @@ -577,7 +578,7 @@
                           while (newPropertiesList.hasMoreElements()) {
                               oldRevisionDescriptor
                                   .setProperty((NodeProperty) newPropertiesList
  -                                             .nextElement() );
  +                                                 .nextElement() );
                           }
                           
                           // now use the merged revision descriptor
  @@ -672,11 +673,11 @@
               // Retrieving latest revision numbers
               NodeRevisionNumber branchLatestRevisionNumber =
                   revisionDescriptors.getLatestRevision(branch);
  -        
  +            
               if (branchLatestRevisionNumber == null) {
                   throw new BranchNotFoundException(strUri, branch);
               }
  -        
  +            
               create(token, strUri, branchLatestRevisionNumber,
                      newRevisionDescriptor, revisionContent);
           }
  @@ -702,14 +703,14 @@
        * @return the NodeRevisionNumber of the created revision.
        */
       public NodeRevisionNumber fork(SlideToken token, String strUri, String branchName,
  -                     NodeRevisionDescriptor basedOnRevisionDescriptor)
  +                                   NodeRevisionDescriptor basedOnRevisionDescriptor)
           throws ObjectNotFoundException, AccessDeniedException,
           LinkedObjectNotFoundException, ServiceAccessException,
           RevisionDescriptorNotFoundException, ObjectLockedException,
           NodeNotVersionedException, RevisionAlreadyExistException {
           
           return fork(token, strUri, branchName,
  -             basedOnRevisionDescriptor.getRevisionNumber());
  +                    basedOnRevisionDescriptor.getRevisionNumber());
           
       }
       
  @@ -726,7 +727,7 @@
        * @return the NodeRevisionNumber of the created revision.
        */
       public NodeRevisionNumber fork(SlideToken token, String strUri, String branchName,
  -                     NodeRevisionNumber basedOnRevisionNumber)
  +                                   NodeRevisionNumber basedOnRevisionNumber)
           throws ObjectNotFoundException, AccessDeniedException,
           LinkedObjectNotFoundException, ServiceAccessException,
           RevisionDescriptorNotFoundException, ObjectLockedException,
  @@ -736,7 +737,7 @@
               return null;
           
           // Retrieve the associated object
  -        ObjectNode associatedObject = 
  +        ObjectNode associatedObject =
               structureHelper.retrieve(token, strUri, false);
           
           // Next we do a security check and a locking check for modifyRevisions
  @@ -861,7 +862,7 @@
           RevisionAlreadyExistException {
           
           // Retrieve the associated object
  -        ObjectNode associatedObject = 
  +        ObjectNode associatedObject =
               structureHelper.retrieve(token, strUri, false);
           
           // Next we do a security check and a locking check for modifyRevisions
  @@ -953,7 +954,7 @@
           RevisionNotFoundException {
           
           // Retrieve the associated object
  -        ObjectNode associatedObject = 
  +        ObjectNode associatedObject =
               structureHelper.retrieve(token, strUri, false);
           
           // Next we do a security check and a locking check for modifyRevisions
  @@ -1088,7 +1089,7 @@
           RevisionDescriptorNotFoundException, ObjectLockedException {
           
           // Retrieve the associated object
  -        ObjectNode associatedObject = 
  +        ObjectNode associatedObject =
               structureHelper.retrieve(token, strUri, false);
           
           // Next we do a security check and a locking check for modifyRevisions
  @@ -1145,7 +1146,7 @@
           ObjectLockedException, NodeNotVersionedException {
           
           // Retrieve the associated object
  -        ObjectNode associatedObject = 
  +        ObjectNode associatedObject =
               structureHelper.retrieve(token, strUri, false);
           
           // Next we do a security check and a locking check for modifyRevisions
  @@ -1252,10 +1253,10 @@
        */
       protected void create( SlideToken token, String strUri,
                             NodeRevisionDescriptor revisionDescriptor )
  -    throws ObjectNotFoundException, AccessDeniedException,
  -    RevisionAlreadyExistException, LinkedObjectNotFoundException,
  -    ServiceAccessException, RevisionDescriptorNotFoundException,
  -    ObjectLockedException, NodeNotVersionedException {
  +        throws ObjectNotFoundException, AccessDeniedException,
  +        RevisionAlreadyExistException, LinkedObjectNotFoundException,
  +        ServiceAccessException, RevisionDescriptorNotFoundException,
  +        ObjectLockedException, NodeNotVersionedException {
           
           // Retrieve the associated object
           ObjectNode associatedObject =
  @@ -1343,8 +1344,8 @@
            NodeRevisionDescriptor revisionDescriptor,
            NodeRevisionContent revisionContent, int type)
           throws AccessDeniedException, ObjectNotFoundException,
  -               LinkedObjectNotFoundException, ObjectLockedException,
  -               ServiceAccessException {
  +        LinkedObjectNotFoundException, ObjectLockedException,
  +        ServiceAccessException {
           ContentInterceptor[] contentInterceptors =
               namespace.getContentInterceptors();
           for (int i = 0; i < contentInterceptors.length; i++) {
  
  
  
  1.28      +5 -5      jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptor.java
  
  Index: NodeRevisionDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptor.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- NodeRevisionDescriptor.java	14 May 2002 14:37:45 -0000	1.27
  +++ NodeRevisionDescriptor.java	18 Aug 2003 06:48:14 -0000	1.28
  @@ -972,7 +972,7 @@
       private void initDefaultProperties() {
           
           setCreationDate(new Date());
  -        setName("");
  +//        setName("");
           // By default, a resource is a collection
           setResourceType("<collection/>");
           setProperty(SOURCE, "");  // live property, can not be modified
  
  
  
  1.13      +5 -5      jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptors.java
  
  Index: NodeRevisionDescriptors.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeRevisionDescriptors.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- NodeRevisionDescriptors.java	11 Jul 2002 14:56:43 -0000	1.12
  +++ NodeRevisionDescriptors.java	18 Aug 2003 06:48:14 -0000	1.13
  @@ -227,7 +227,7 @@
       /**
        * Uri mutator.
        */
  -    void setUri(String uri) {
  +    public void setUri(String uri) {
           this.uri = uri;
       }