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 ju...@apache.org on 2001/05/16 14:03:53 UTC

cvs commit: jakarta-slide/src/share/org/apache/slide/common Namespace.java XMLUnmarshaller.java

juergen     01/05/16 05:03:53

  Modified:    src/share/org/apache/slide/common Namespace.java
                        XMLUnmarshaller.java
  Log:
  removed the NRD from the API, to be put in NodePermission, see e-mails.
  
  Revision  Changes    Path
  1.31      +3 -9      jakarta-slide/src/share/org/apache/slide/common/Namespace.java
  
  Index: Namespace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Namespace.java	2001/05/10 18:36:19	1.30
  +++ Namespace.java	2001/05/16 12:03:46	1.31
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v 1.30 2001/05/10 18:36:19 juergen Exp $
  - * $Revision: 1.30 $
  - * $Date: 2001/05/10 18:36:19 $
  + * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v 1.31 2001/05/16 12:03:46 juergen Exp $
  + * $Revision: 1.31 $
  + * $Date: 2001/05/16 12:03:46 $
    *
    * ====================================================================
    *
  @@ -93,17 +93,11 @@
    * Namespace class.
    *
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.30 $
  + * @version $Revision: 1.31 $
    */
   public final class Namespace {
       
       
  -    
  -    /** private field to indicate, that the versionNumber is not correctly supported yet
  -     **/
  -    private static final NodeRevisionDescriptor dummyNodeRevisionDescriptor = null;
  -    
  -    
       // -------------------------------------------------------------- Constants
       
       
  @@ -533,7 +527,7 @@
       
       
       /**
  -     * Builds a new uri object to access this namespace. This call will
  +     * Builds a new uri object to access this namespace. This call will 
        * return a Uri which doesn't have its token field set. The store should
        * accept such Uri as valid, and bypass any check that is made based on the
        * state.
  @@ -660,7 +654,7 @@
               SubjectNode rootNode = new SubjectNode("/");
               NodePermission allAccess = new NodePermission("/", "/", "/");
               rootUri.getStore().createObject(rootUri, rootNode);
  -            rootUri.getStore().grantPermission(rootUri, dummyNodeRevisionDescriptor, allAccess);
  +            rootUri.getStore().grantPermission(rootUri, allAccess);
               
               // Create a dummy action
               Uri tempActionUri = getUri("/tempaction");
  @@ -689,7 +683,7 @@
               // And remove the all permission from the root node
               rootNode =
                   (SubjectNode) rootUri.getStore().retrieveObject(rootUri);
  -            rootUri.getStore().revokePermission(rootUri, dummyNodeRevisionDescriptor, allAccess);
  +            rootUri.getStore().revokePermission(rootUri, allAccess);
               rootUri.getStore().storeObject(rootUri, rootNode);
               
           } catch (SlideException e) {
  
  
  
  1.13      +47 -52    jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java
  
  Index: XMLUnmarshaller.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XMLUnmarshaller.java	2001/05/10 18:36:21	1.12
  +++ XMLUnmarshaller.java	2001/05/16 12:03:48	1.13
  @@ -1,13 +1,13 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v 1.12 2001/05/10 18:36:21 juergen Exp $
  - * $Revision: 1.12 $
  - * $Date: 2001/05/10 18:36:21 $
  + * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/XMLUnmarshaller.java,v 1.13 2001/05/16 12:03:48 juergen Exp $
  + * $Revision: 1.13 $
  + * $Date: 2001/05/16 12:03:48 $
    *
    * ====================================================================
    *
    * 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 apache@apache.org.
    *
    * 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.common;
   
  @@ -80,38 +80,33 @@
   
   /**
    * XMLUnmarshaller class.
  - *
  + * 
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.12 $
  + * @version $Revision: 1.13 $
    */
   public final class XMLUnmarshaller {
       
       
  -    
  -    /** private field to indicate, that the versionNumber is not correctly supported yet
  -     **/
  -    private static final NodeRevisionDescriptor dummyNodeRevisionDescriptor = null;
  -    
       // --------------------------------------------------------- Public Methods
       
       
       /**
        * Import data from Avalon configuration object.
  -     *
  +     * 
        * @param token CredentialsToken, used for access to the namespace
        * @param dataConfiguration Configuration object
  -     * @exception ConfigurationException Something went wrong during the
  +     * @exception ConfigurationException Something went wrong during the 
        * reading of the XML
        * @exception UnknownObjectClassException Object class not found
        * @exception ServiceAccessException Error accessing service
        */
  -    public static void unmarshal(NamespaceAccessToken accessToken,
  -                                 SlideToken token,
  -                                 Configuration dataConfiguration)
  -        throws ConfigurationException, UnknownObjectClassException,
  +    public static void unmarshal(NamespaceAccessToken accessToken, 
  +                                 SlideToken token, 
  +                                 Configuration dataConfiguration) 
  +        throws ConfigurationException, UnknownObjectClassException, 
           ServiceAccessException {
           
  -        loadObjectNode(accessToken, token,
  +        loadObjectNode(accessToken, token, 
                          dataConfiguration.getConfiguration("objectnode"));
           
       }
  @@ -122,19 +117,19 @@
       
       /**
        * Loads a Slide Object.
  -     *
  +     * 
        * @param token Credentials token
        * @param objectDefinition Configuration object
  -     * @exception ServiceAccessException Object creation failed because
  +     * @exception ServiceAccessException Object creation failed because 
        * a data access error occured
        * @exception UnknownObjectClassException Object class not found
  -     * @exception ConfigurationException Something went wrong during the
  +     * @exception ConfigurationException Something went wrong during the 
        * reading of the XML
        */
       private static void loadObjectNode
  -        (NamespaceAccessToken accessToken, SlideToken token,
  +        (NamespaceAccessToken accessToken, SlideToken token, 
            Configuration objectDefinition)
  -        throws ServiceAccessException, ConfigurationException,
  +        throws ServiceAccessException, ConfigurationException, 
           UnknownObjectClassException {
           
           String className = objectDefinition.getAttribute("classname");
  @@ -161,7 +156,7 @@
                   // Instantiation failed for some reason
                   throw new UnknownObjectClassException(className);
               } catch(IllegalAccessException e) {
  -                // The initializer could not be called because
  +                // The initializer could not be called because 
                   // of access restrictions
                   throw new UnknownObjectClassException(className);
               }
  @@ -171,10 +166,10 @@
               } else {
                   
                   if (object instanceof LinkNode) {
  -                    String linkedUri =
  +                    String linkedUri = 
                           objectDefinition.getAttribute("linkedUri");
                       accessToken.getStructureHelper().createLink
  -                        (token, (LinkNode) object, uri,
  +                        (token, (LinkNode) object, uri, 
                            new SubjectNode(linkedUri));
                   } else {
                       accessToken.getStructureHelper().create
  @@ -183,11 +178,11 @@
               }
               
               // Retrieving the list of permissions on the object
  -            Enumeration permissionDefinitions =
  +            Enumeration permissionDefinitions = 
                   objectDefinition.getConfigurations("permission");
               
               // We've made sure that the object exists.
  -            // We now parse the permissions definition list, adding each
  +            // We now parse the permissions definition list, adding each 
               // permission to the object's permission list.
               while (permissionDefinitions.hasMoreElements()) {
                   
  @@ -195,7 +190,7 @@
                       (Configuration) permissionDefinitions.nextElement();
                   // Create the NodePermission object matching the Castor object
                   
  -                String subjectUri =
  +                String subjectUri = 
                       permissionDefinition.getAttribute("subject");
                   
                   String actionUri =
  @@ -226,20 +221,20 @@
                   
                   // Adding the NodePermission to the ObjectNode
                   accessToken.getSecurityHelper()
  -                    .grantPermission(token, dummyNodeRevisionDescriptor, permission);
  +                    .grantPermission(token, permission);
                   
               }
               
               // Retrieve the list of revisions of the object
  -            Enumeration revisionDefinitions =
  +            Enumeration revisionDefinitions = 
                   objectDefinition.getConfigurations("revision");
               
               // We parse the revision definition list
               while (revisionDefinitions.hasMoreElements()) {
                   
  -                Configuration revisionDefinition =
  +                Configuration revisionDefinition = 
                       (Configuration) revisionDefinitions.nextElement();
  -                loadObjectRevision(accessToken, token, uri,
  +                loadObjectRevision(accessToken, token, uri, 
                                      revisionDefinition);
                   
               }
  @@ -261,11 +256,11 @@
               Domain.info("Insufficient credentials to create object");
           }
           
  -        Enumeration childConfigurations =
  +        Enumeration childConfigurations = 
               objectDefinition.getConfigurations("objectnode");
           
           while(childConfigurations.hasMoreElements()) {
  -            Configuration childConfiguration =
  +            Configuration childConfiguration = 
                   (Configuration) childConfigurations.nextElement();
               loadObjectNode(accessToken, token, childConfiguration);
           }
  @@ -275,17 +270,17 @@
       
       /**
        * Create the SlideProperties object associated with a ObjectNode.
  -     *
  +     * 
        * @param slideObject ObjectNode
  -     * @param propertiesDef Castor object describing the properties associated
  +     * @param propertiesDef Castor object describing the properties associated 
        * with the ObjectNode
        * @exception SlideException A data access error occured
        */
  -    private static void loadObjectRevision(NamespaceAccessToken accessToken,
  +    private static void loadObjectRevision(NamespaceAccessToken accessToken, 
                                              SlideToken token, String uri,
                                              Configuration revisionDefinition)
  -        throws ServiceAccessException, ConfigurationException,
  -        AccessDeniedException, ObjectNotFoundException,
  +        throws ServiceAccessException, ConfigurationException, 
  +        AccessDeniedException, ObjectNotFoundException, 
           LinkedObjectNotFoundException {
           
           // Retrieving the list of properties
  @@ -306,11 +301,11 @@
           long contentLength = 0;
           
           // Now creating the new revision descriptor object
  -        NodeRevisionDescriptor revisionDescriptor =
  +        NodeRevisionDescriptor revisionDescriptor = 
               new NodeRevisionDescriptor(contentLength);
           
           while (propertyDefinitions.hasMoreElements()) {
  -            Configuration propertyDefinition =
  +            Configuration propertyDefinition = 
                   (Configuration) propertyDefinitions.nextElement();
               String propertyName = propertyDefinition.getAttribute("name");
               String propertyValue = propertyDefinition.getValue();
  @@ -326,7 +321,7 @@
           // TODO : Parse predecessor list, and make the appropriate method call
           
           try {
  -            accessToken.getContentHelper().create(token, uri,
  +            accessToken.getContentHelper().create(token, uri, 
                                                     revisionDescriptor,
                                                     revisionContent);
           } catch(ObjectLockedException e) {
  @@ -344,14 +339,14 @@
       
       /**
        * Create the SlideProperties object associated with a ObjectNode.
  -     *
  +     * 
        * @param slideObject ObjectNode
  -     * @param propertiesDef Castor object describing the properties associated
  +     * @param propertiesDef Castor object describing the properties associated 
        * with the ObjectNode
        * @exception SlideException A data access error occured
        */
  -    private static void loadProperties(NamespaceAccessToken accessToken,
  -                                       SlideToken token,
  +    private static void loadProperties(NamespaceAccessToken accessToken, 
  +                                       SlideToken token, 
                                          ObjectNode slideObject)
           throws ServiceAccessException {
           
  @@ -370,8 +365,8 @@
               namespaceInterface.getDataHelper()
               .create(token, properties, slideObject.getUri());
               
  -            // Retrive from the Castor object a list containing
  -            // the definition of all the
  +            // Retrive from the Castor object a list containing 
  +            // the definition of all the 
               // SlideRevision objects associated with the SlideProperties object.
               Enumeration revisionsDef = propertiesDef.enumerateRevision();
               while (revisionsDef.hasMoreElements()) {
  @@ -401,10 +396,10 @@
           } catch (VersionException e) {
               // We stop at the first error, which would probably indicate that
               // the stuff we try to create already exists.
  -    } catch (DataException e) {
  +	} catch (DataException e) {
               // We stop at the first error, which would probably indicate that
               // the stuff we try to create already exists.
  -    } catch (AccessDeniedException e) {
  +	} catch (AccessDeniedException e) {
               // Idem
           } catch (ObjectLockedException e) {
               // Idem