juergen     01/02/19 09:03:07

  Modified:    src/share/org/apache/slide/macro MacroImpl.java
  Log:
  nothing changed
  
  Revision  Changes    Path
  1.9       +55 -54    jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java
  
  Index: MacroImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- MacroImpl.java    2001/02/08 19:22:32     1.8
  +++ MacroImpl.java    2001/02/19 17:03:06     1.9
  @@ -1,13 +1,13 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v 1.8 
2001/02/08 19:22:32 remm Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/02/08 19:22:32 $
  + * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v 1.9 
2001/02/19 17:03:06 juergen Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/02/19 17:03:06 $
    *
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -15,7 +15,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -23,15 +23,15 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
  - *    any, must include the following acknowlegement:  
  - *       "This product includes software developed by the 
  + *    any, must include the following acknowlegement:
  + *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
  - *    from this software without prior written permission. For written 
  + *    from this software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache"
  @@ -59,7 +59,7 @@
    *
    * [Additional notices, if required by prior licensing conditions]
    *
  - */ 
  + */
   
   package org.apache.slide.macro;
   
  @@ -74,9 +74,9 @@
   
   /**
    * Macro helper class.
  - * 
  + *
    * @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   public final class MacroImpl implements Macro {
       
  @@ -86,14 +86,14 @@
       
       /**
        * Constructor.
  -     * 
  +     *
        * @param namespace Namespace
        * @param namespaceConfig Namespace configuration
        * @param contentHelper Access to content
        * @param structureHelper Access to structure
        */
  -    public MacroImpl(Namespace namespace, NamespaceConfig namespaceConfig, 
  -                     Security securityHelper, Content contentHelper, 
  +    public MacroImpl(Namespace namespace, NamespaceConfig namespaceConfig,
  +                     Security securityHelper, Content contentHelper,
                        Structure structureHelper) {
           this.namespace = namespace;
           this.namespaceConfig = namespaceConfig;
  @@ -141,30 +141,30 @@
       
       /**
        * Recursive copy with overwrite macro.
  -     * 
  +     *
        * @param token Credentials token
        * @param sourceUri Uri of the source
        * @param destinationUri Uri of the destination
        * @exception CopyMacroException Generic Slide exception
        */
  -    public void copy(SlideToken token, String sourceUri, 
  +    public void copy(SlideToken token, String sourceUri,
                        String destinationUri)
           throws CopyMacroException, DeleteMacroException {
  -        this.copy(token, sourceUri, destinationUri, 
  +        this.copy(token, sourceUri, destinationUri,
                     RECURSIVE_OVERWRITE_PARAMETERS);
       }
       
       
       /**
        * Copy macro.
  -     * 
  +     *
        * @param token Credentials token
        * @param sourceUri Uri of the source
        * @param destinationUri Uri of the destination
        * @param parameters Macro parameters
        * @exception CopyMacroException Generic Slide exception
        */
  -    public void copy(SlideToken token, String sourceUri, 
  +    public void copy(SlideToken token, String sourceUri,
                        String destinationUri, MacroParameters parameters)
           throws CopyMacroException, DeleteMacroException {
           
  @@ -179,7 +179,7 @@
                   // Silent catch, the target doesn't exist
               } catch(SlideException e) {
                   // We try to delete the target anyway.
  -                // It will probably fail again, but we will get a properly 
  +                // It will probably fail again, but we will get a properly
                   // packaged exception
                   delete(token, destinationUri);
               }
  @@ -200,24 +200,24 @@
       
       /**
        * Recursive move with overwrite macro.
  -     * 
  +     *
        * @param token Credentials token
        * @param sourceUri Uri of the source
        * @param destinationUri Uri of the destination
        * @exception CopyMacroException Exception occured during copy
        * @exception DeleteMacroException Exception occured during deletion
        */
  -    public void move(SlideToken token, String sourceUri, 
  +    public void move(SlideToken token, String sourceUri,
                        String destinationUri)
           throws CopyMacroException, DeleteMacroException {
  -        move(token, sourceUri, destinationUri, 
  +        move(token, sourceUri, destinationUri,
                RECURSIVE_OVERWRITE_PARAMETERS);
       }
       
       
       /**
        * Move macro.
  -     * 
  +     *
        * @param token Credentials token
        * @param sourceUri Uri of the source
        * @param destinationUri Uri of the destination
  @@ -225,7 +225,7 @@
        * @exception CopyMacroException Exception occured during copy
        * @exception DeleteMacroException Exception occured during deletion
        */
  -    public void move(SlideToken token, String sourceUri, 
  +    public void move(SlideToken token, String sourceUri,
                        String destinationUri, MacroParameters parameters)
           throws CopyMacroException, DeleteMacroException {
           copy(token, sourceUri, destinationUri, parameters);
  @@ -235,7 +235,7 @@
       
       /**
        * Recursive delete.
  -     * 
  +     *
        * @param token Credentials token
        * @param targetUri Uri of the object to delete
        * @exception DeleteMacroException Generic Slide exception
  @@ -248,14 +248,14 @@
       
       /**
        * Delete macro.
  -     * 
  +     *
        * @param token Credentials token
        * @param targetUri Uri of the source
  -     * @param parameters Macro parameters, not used right now, 
  +     * @param parameters Macro parameters, not used right now,
        * so it can be null
        * @exception DeleteMacroException Generic Slide exception
        */
  -    public void delete(SlideToken token, String targetUri, 
  +    public void delete(SlideToken token, String targetUri,
                          MacroParameters parameters)
           throws DeleteMacroException {
           Domain.info("Delete " + targetUri);
  @@ -277,18 +277,18 @@
       
       /**
        * Copy object.
  -     * 
  +     *
        * @param token Credentials token
        * @param sourceUri Uri of the source
        * @param destinationUri Uri of the destination
        * @param parameters Macro parameters
        * @param CopyMacroException Exception occured during copy
        */
  -    private void copyObject(SlideToken token, String sourceUri, 
  +    private void copyObject(SlideToken token, String sourceUri,
                               String destinationUri, MacroParameters parameters,
                               CopyMacroException e) {
           
  -        Domain.info("Copy object : from " + sourceUri + " to " 
  +        Domain.info("Copy object : from " + sourceUri + " to "
                    + destinationUri);
           
           try {
  @@ -299,7 +299,7 @@
               ObjectNode object = structureHelper.retrieve(token, sourceUri);
               
               // Creating the copy
  -            structureHelper.create(token, object.copyObject(), 
  +            structureHelper.create(token, object.copyObject(),
                                      destinationUri);
               
               // Trying to recreate permissions
  @@ -309,32 +309,32 @@
                       .enumeratePermissions(token, object);
                   
                   while (permissions.hasMoreElements()) {
  -                    NodePermission permission = 
  +                    NodePermission permission =
                           (NodePermission) permissions.nextElement();
  -                    NodePermission newPermission = 
  -                        new NodePermission(destinationUri, 
  +                    NodePermission newPermission =
  +                        new NodePermission(destinationUri,
                                              permission.getSubjectUri(),
  -                                           permission.getActionUri(), 
  +                                           permission.getActionUri(),
                                              permission.isInheritable());
                       securityHelper.grantPermission(token, newPermission);
                   }
                   
               } catch (AccessDeniedException ex) {
  -                // Means that we don't have modifyPermissions rights 
  +                // Means that we don't have modifyPermissions rights
                   // (root access) on the target.
  -                // The copy should definitely succeed anyway, 
  +                // The copy should definitely succeed anyway,
                   // so we silently catch the exception.
               }
               
               // Now copying revision descriptors and content
               
  -            NodeRevisionDescriptors revisionDescriptors = 
  +            NodeRevisionDescriptors revisionDescriptors =
                   contentHelper.retrieve(token, sourceUri);
               
               if (revisionDescriptors.hasRevisions()) {
                   
                   // Iterators
  -                NodeRevisionNumber currentRevisionNumber = 
  +                NodeRevisionNumber currentRevisionNumber =
                       revisionDescriptors.getInitialRevision();
                   NodeRevisionDescriptor currentRevisionDescriptor = null;
                   NodeRevisionContent currentRevisionContent = null;
  @@ -344,7 +344,7 @@
                   
                   // Creating the initial revision
                   currentRevisionDescriptor = contentHelper
  -                    .retrieve(token, revisionDescriptors, 
  +                    .retrieve(token, revisionDescriptors,
                                 currentRevisionNumber);
                   if (currentRevisionDescriptor.getContentLength() > 0) {
                       currentRevisionContent = contentHelper
  @@ -353,8 +353,8 @@
                   } else {
                       currentRevisionContent = null;
                   }
  -                contentHelper.create(token, destinationUri, 
  -                                     currentRevisionDescriptor, 
  +                contentHelper.create(token, destinationUri,
  +                                     currentRevisionDescriptor,
                                        currentRevisionContent);
                   
               }
  @@ -363,7 +363,7 @@
               // Algorithm :
               // - While Stack is not empty
               // - Pop a revision number
  -            // - For each successor of that number, create a new revision 
  +            // - For each successor of that number, create a new revision
               //   based of the old revision
               // - Add the successor to the stack
               
  @@ -376,7 +376,7 @@
                   String childUri = (String) childrenList.nextElement();
                   String childDestinationUri = destinationUri + childUri
                       .substring(object.getUri().length());
  -                copyObject(token, childUri, childDestinationUri, 
  +                copyObject(token, childUri, childDestinationUri,
                              parameters, e);
               }
               
  @@ -390,28 +390,28 @@
       
       /**
        * Delete object function. Recursive for now.
  -     * 
  +     *
        * @param token Credentials token
        * @param targetUri Uri of the source
  -     * @param parameters Macro parameters, not used right now, so it can 
  +     * @param parameters Macro parameters, not used right now, so it can
        * be null
        * @param e Nested exception
        */
  -    private void deleteObject(SlideToken token, String targetUri, 
  +    private void deleteObject(SlideToken token, String targetUri,
                                 MacroException e) {
  -        
  +          
           Domain.info("Delete object : " + targetUri);
           
           try {
               
  -            ObjectNode currentObject = structureHelper.retrieve(token, 
  +            ObjectNode currentObject = structureHelper.retrieve(token,
                                                                   targetUri);
               
               // Removing children objects
               if (currentObject.hasChildren()) {
                   Enumeration children = currentObject.enumerateChildren();
                   while (children.hasMoreElements()) {
  -                    deleteObject(token, (String) children.nextElement(), 
  +                    deleteObject(token, (String) children.nextElement(),
                                    e);
                   }
               }
  @@ -423,12 +423,12 @@
               
               /*
                 try {
  -              NodeProperties properties = 
  +              NodeProperties properties =
                 structureHelper.retrieve(token, currentObject);
                 structureHelper.remove(token, properties);
                 structureHelper.remove(token, currentObject);
                 } catch(StructureException ex) {
  -              // Perhaps there were no properties associated with 
  +              // Perhaps there were no properties associated with
                 // this object ...
                 ex.printStackTrace();
                 }
  @@ -441,3 +441,4 @@
       }
       
   }
  +
  
  
  

Reply via email to