cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From step...@apache.org
Subject cvs commit: xml-cocoon2/src/scratchpad/webapp/samples/slide principal2html4users.xsl rdf2html4content.xsl rdf2html4locks.xsl rdf2html4permissions.xsl rdf2html4properties.xsl sitemap.xmap slide.xconf rdf2html.xsl
Date Sun, 21 Jul 2002 22:50:55 GMT
stephan     2002/07/21 15:50:55

  Modified:    src/scratchpad/src/org/apache/cocoon/acting
                        PrincipalMultiAction.java SourceMultiAction.java
               src/scratchpad/src/org/apache/cocoon/components/repository/impl
                        SlidePrincipalProvider.java slidepp.xconf
               src/scratchpad/src/org/apache/cocoon/components/source/impl
                        SlideSource.java
               src/scratchpad/webapp/samples/slide principal2html4users.xsl
                        rdf2html4content.xsl rdf2html4locks.xsl
                        rdf2html4permissions.xsl rdf2html4properties.xsl
                        sitemap.xmap slide.xconf
  Removed:     src/scratchpad/webapp/samples/slide rdf2html.xsl
  Log:
  Create code to add principals to the slide repository.
  The forms are now using the PrincipalMultiAction and SourceMultiAction.
  
  Revision  Changes    Path
  1.2       +2 -2      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/acting/PrincipalMultiAction.java
  
  Index: PrincipalMultiAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/acting/PrincipalMultiAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PrincipalMultiAction.java	8 Jul 2002 08:15:12 -0000	1.1
  +++ PrincipalMultiAction.java	21 Jul 2002 22:50:54 -0000	1.2
  @@ -131,7 +131,7 @@
               Principal principal = new Principal(principal_name, principal_role, principal_password);
   
               principalprovider.addPrincipal(caller, principal);
  -
  + 
           } catch (ComponentException ce) {
               getLogger().error("Could not lookup for component.", ce);
               throw new ProcessingException("Could not lookup for component.", ce);
  
  
  
  1.3       +2 -2      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/acting/SourceMultiAction.java
  
  Index: SourceMultiAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/acting/SourceMultiAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SourceMultiAction.java	9 Jul 2002 21:41:34 -0000	1.2
  +++ SourceMultiAction.java	21 Jul 2002 22:50:54 -0000	1.3
  @@ -94,7 +94,7 @@
   public class SourceMultiAction extends AbstractMethodAction implements Contextualizable,
ThreadSafe {
   
       public final static String SOURCE_URI = "cocoon-source-uri";
  -    public final static String SOURCE_PROPERTY_NAMESPACE = "cocooon-source-property-namespace";
  +    public final static String SOURCE_PROPERTY_NAMESPACE = "cocoon-source-property-namespace";
       public final static String SOURCE_PROPERTY_NAME = "cocoon-source-property-name";
       public final static String SOURCE_PROPERTY_VALUE = "cocoon-source-property-value";
       public final static String SOURCE_PERMISSION_PRINCIPAL = "cocoon-source-permission-principal";
  
  
  
  1.4       +125 -12   xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/SlidePrincipalProvider.java
  
  Index: SlidePrincipalProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/SlidePrincipalProvider.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SlidePrincipalProvider.java	8 Jul 2002 08:39:25 -0000	1.3
  +++ SlidePrincipalProvider.java	21 Jul 2002 22:50:55 -0000	1.4
  @@ -77,6 +77,7 @@
   import org.apache.slide.authenticate.SecurityToken;
   import org.apache.slide.common.NamespaceAccessToken;
   import org.apache.slide.common.NamespaceConfig;
  +import org.apache.slide.common.ServiceAccessException;
   import org.apache.slide.common.SlideException;
   import org.apache.slide.common.SlideToken;
   import org.apache.slide.common.SlideTokenImpl;
  @@ -85,13 +86,18 @@
   import org.apache.slide.content.NodeRevisionDescriptor;
   import org.apache.slide.content.NodeRevisionDescriptors;
   import org.apache.slide.content.RevisionDescriptorNotFoundException;
  +import org.apache.slide.macro.Macro;
  +import org.apache.slide.macro.MacroException;
  +import org.apache.slide.macro.MacroParameters;
   import org.apache.slide.security.Security;
   import org.apache.slide.structure.GroupNode;
  +import org.apache.slide.structure.ObjectAlreadyExistsException;
   import org.apache.slide.structure.ObjectNode;
   import org.apache.slide.structure.ObjectNotFoundException;
   import org.apache.slide.structure.Structure;
   import org.apache.slide.structure.SubjectNode;
   
  +import java.util.Date;
   import java.util.Enumeration;
   import java.util.Vector;
   
  @@ -126,7 +132,7 @@
       //private Lock lock;
   
       /** Macro helper. */
  -    //private Macro macro;
  +    private Macro macro;
   
       /** Slide token. */
       //private SlideToken slidetoken;
  @@ -183,7 +189,8 @@
                   this.namespace = sliderepository.getDomain().getDefaultNamespace();
   
               if (sliderepository.getDomain().getNamespaceToken(this.namespace)==null)
  -                throw new ProcessingException("Repository with the namespace '"+this.namespace+"'
couldn't be found");
  +                throw new ProcessingException("Repository with the namespace '"+
  +                                              this.namespace+"' couldn't be found");
   
               this.nat = sliderepository.getDomain().getNamespaceToken(this.namespace);
               this.config = this.nat.getNamespaceConfig();
  @@ -191,7 +198,7 @@
               this.content = nat.getContentHelper();
               this.security = nat.getSecurityHelper();
               //this.lock = nat.getLockHelper();
  -           // this.macro = nat.getMacroHelper();
  +            this.macro = nat.getMacroHelper();
   
           } catch (ComponentException ce) {
               getLogger().error("Could not lookup for component.", ce);
  @@ -238,12 +245,20 @@
                       if (roles.hasMoreElements())
                           role = (String)children.nextElement();*/
   
  -                    NodeRevisionDescriptors revisionDescriptors = 
  -                        content.retrieve(slidetoken, user);
  +                    String password = null;
  +                    try {
  +                        NodeRevisionDescriptors revisionDescriptors = 
  +                            content.retrieve(slidetoken, user);
   
  -                    // Retrieve latest revision descriptor
  -                    NodeRevisionDescriptor revisionDescriptor = this.content.retrieve(slidetoken,
revisionDescriptors);
  -                    String password = revisionDescriptor.getProperty("password").getValue().toString();
  +                        // Retrieve latest revision descriptor
  +                        NodeRevisionDescriptor revisionDescriptor = 
  +                            this.content.retrieve(slidetoken, revisionDescriptors);
  +
  +                        if (revisionDescriptor.getProperty("password")!=null) 
  +                            password = (String)revisionDescriptor.getProperty("password").getValue();
  +                    } catch (RevisionDescriptorNotFoundException rdnfe) {
  +                        // ignore
  +                    }
   
                       principals.add(new Principal(name, /*role,*/ password));
                   }
  @@ -262,11 +277,64 @@
   
       /**
        * Add or modify a given principal.
  +     * The implementation is similar to org.apache.slide.admin.users.AddUserAction.
        *
        * @param caller The principal, which should do the operation.
        * @param principal The Principal, which should be add/modified.
        */
       public void addPrincipal(Principal caller, Principal principal) throws ProcessingException
{
  +        // do the actual transaction
  +        try {
  +            try {
  +                nat.begin();
  +
  +                SlideToken slidetoken = new SlideTokenImpl(new CredentialsToken(caller));
  +
  +                String strUri = config.getUsersPath() + "/" + principal.getName();
  +
  +                // create the node in the structure
  +                ObjectNode object;
  +                object = new slideroles.basic.UserRoleImpl();
  +                structure.create(slidetoken, object, strUri);
  +
  +                // create a revision with the appropriate properties set
  +                NodeRevisionDescriptor revision = 
  +                    new NodeRevisionDescriptor(0);
  +                revision.setProperty(
  +                    new NodeProperty("resourcetype", "<collection/>",
  +                                     true));
  +                revision.setCreationDate(new Date());
  +                revision.setLastModified(new Date());
  +                revision.setProperty(new NodeProperty("getcontentlength", "0", true));
  +                revision.setProperty(new NodeProperty("source", "", true));
  +                revision.setProperty(new NodeProperty("password", principal.getPassword(),
  +                                     NodeProperty.SLIDE_NAMESPACE));
  +                content.store(slidetoken, strUri, revision, null);
  +
  +                nat.commit();
  +
  +            } catch (ObjectAlreadyExistsException e) {
  +                // duplicate username
  +                getLogger().warn("Could not create user", e);
  +            } catch (ServiceAccessException e) {
  +                // low level service access failed
  +                getLogger().warn("Could not create user", e);
  +                throw new ProcessingException("Could not create user", e);
  +            } catch (Exception e) {
  +                // any other errors are unanticipated
  +                getLogger().warn("Could not create user", e);
  +                throw new ProcessingException("Could not create user", e);
  +            }
  +        } catch (Exception e) {
  +            // rollback the transaction
  +            getLogger().warn("Could not create user", e);
  +            try {
  +                nat.rollback();
  +            } catch (Exception e2) {
  +                // ignore
  +                getLogger().error("Could roll back the operation", e2);
  +            }
  +        }
       }
   
       /**
  @@ -277,6 +345,45 @@
        */
       public void removePrincipal(Principal caller, Principal principal)
           throws ProcessingException {
  +
  +        if (principal.getName().length() > 0) {
  +            // get the helpers
  +            Macro macro = nat.getMacroHelper();
  +
  +            SlideToken slidetoken = new SlideTokenImpl(new CredentialsToken(caller));
  +
  +            // get the path of the current authenticated user
  +            String selfUri = config.getUsersPath() + "/" + caller.getName();
  +
  +            String strUri = config.getUsersPath() + "/" + principal.getName();
  +
  +            // do the actual transaction
  +            try {
  +                try {
  +                    nat.begin();
  +
  +                    // the user may not delete herself
  +                    if (!selfUri.equals(strUri))
  +                        macro.delete(slidetoken, strUri, new MacroParameters(true, false));
  +
  +                    nat.commit();
  +
  +                } catch (MacroException e) {
  +                    // some aspect of the delete operation failed
  +                    getLogger().warn("Could not remove user", e);
  +                    throw new ProcessingException("Could not remove user", e);
  +                }
  +            } catch (Exception e) {
  +                // rollback the transaction
  +                try {
  +                    nat.rollback();
  +                } catch (Exception e2) {
  +                    // ignore
  +                    getLogger().error("Could roll back the operation", e2);
  +                }
  +            }
  +        }
  +
       }
   
       /**
  @@ -316,6 +423,7 @@
   
               return principalgroupArray;
           } catch (SlideException se) {
  +            getLogger().error("Could not retrieve principal groups", se);
               throw new ProcessingException(se);
           }
       }
  @@ -357,7 +465,8 @@
        * @param member The principal whose membership is to be checked.
        * @return True if the principal is a member of this group, false otherwise.
        */
  -    public boolean isMember(Principal caller, PrincipalGroup group, Principal member) throws
ProcessingException {
  +    public boolean isMember(Principal caller, PrincipalGroup group, Principal member) 
  +          throws ProcessingException {
           Principal[] members = members(caller, group);
           for(int i=0; i<members.length; i++)
               if (members[i].equals(member))
  @@ -405,7 +514,10 @@
                           // Retrieve latest revision descriptor
                           NodeRevisionDescriptor revisionDescriptor = this.content.retrieve(slidetoken,
                                                                                         
   revisionDescriptors);
  -                        String password = revisionDescriptor.getProperty("password").getValue().toString();
  +                        String password = null;
  +                        if ((revisionDescriptor.getProperty("password")!=null) &&
  +                            (revisionDescriptor.getProperty("password").getValue()!=null))
  +                            password = revisionDescriptor.getProperty("password").getValue().toString();
   
                           principals.add(new Principal(name/*, role*/, password));
                       }
  @@ -432,7 +544,8 @@
        * @param group The given group.
        * @param principal The principal to remove from this group.
        */
  -    public void removeMember(Principal caller, PrincipalGroup group, Principal principal)
throws ProcessingException {
  +    public void removeMember(Principal caller, PrincipalGroup group, Principal principal)

  +        throws ProcessingException {
       }
   }
   
  
  
  
  1.3       +2 -2      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/slidepp.xconf
  
  Index: slidepp.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/repository/impl/slidepp.xconf,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- slidepp.xconf	5 Jul 2002 13:37:36 -0000	1.2
  +++ slidepp.xconf	21 Jul 2002 22:50:55 -0000	1.3
  @@ -7,11 +7,11 @@
      -->
    <component role="org.apache.cocoon.components.repository.PrincipalProviderSelector"

               class="org.apache.cocoon.components.ExtendedComponentSelector"
  -            logger="core.repositories" default="slide">
  +            logger="core.repositories.principalprovider" default="slide">
   
     <!-- Default implementation via Jakarta Slide -->
     <component-instance class="org.apache.cocoon.components.repository.impl.SlidePrincipalProvider"

  -                      name="slide" logger="core.repositories.slide"
  +                      name="slide" logger="core.repositories.principalprovider.slide"
                         repository="slide" namespace="myrepository"/>
    </component>
   </xconf>
  
  
  
  1.12      +2 -2      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSource.java
  
  Index: SlideSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSource.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SlideSource.java	9 Jul 2002 21:41:34 -0000	1.11
  +++ SlideSource.java	21 Jul 2002 22:50:55 -0000	1.12
  @@ -1135,7 +1135,7 @@
       
       public void removeSourceProperty(String namespace, String name) throws SourceException
{
           try {
  -            if (revisionDescriptor!=null) {
  +            if ((revisionDescriptor!=null) && (!namespace.equals("DAV:"))) {
                   revisionDescriptor.removeProperty(name,namespace);
                   content.store(slideToken, this.config.getFilesPath()+this.uri, revisionDescriptor,
null);
               }
  
  
  
  1.4       +20 -15    xml-cocoon2/src/scratchpad/webapp/samples/slide/principal2html4users.xsl
  
  Index: principal2html4users.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/principal2html4users.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- principal2html4users.xsl	8 Jul 2002 21:20:30 -0000	1.3
  +++ principal2html4users.xsl	21 Jul 2002 22:50:55 -0000	1.4
  @@ -93,8 +93,8 @@
                  <tr>
     
                   <form action="" method="post">
  -                <input type="hidden" name="name" value="{@pl:name}"/>
  -                <input type="hidden" name="method" value="removePrincipal"/>
  +                <input type="hidden" name="cocoon-principal-name" value="{@pl:name}"/>
  +                <input type="hidden" name="method" value="doRemovePrincipal"/>
    
                    <td align="left">
                     <xsl:value-of select="@pl:name"/>
  @@ -109,12 +109,13 @@
                   <td align="left"><xsl:value-of select="@pl:role"/></td>
    
                   <form action="" method="post">
  -                <input type="hidden" name="principal" value="{@pl:name}"/>
  -                <input type="hidden" name="method" value="removePrincipalGroupMember"/>
  +                <input type="hidden" name="cocoon-principal-name" value="{@pl:name}"/>
  +                <input type="hidden" name="method" value="doRemovePrincipalGroupMember"/>
    
                    <td align="left">
                     <xsl:variable name="name" select="@pl:name"/>
  -                  <select name="group" size="{count(../pl:group/pl:principal[@pl:name=$name])}">
  +                  <select name="cocoon-principal-group-name" 
  +                          size="{count(../pl:group/pl:principal[@pl:name=$name])}">
                      <xsl:for-each select="../pl:group/pl:principal[@pl:name=$name]">
                       <option><xsl:value-of select="../@pl:name"/></option>
                      </xsl:for-each>
  @@ -134,12 +135,12 @@
                   <td align="left"></td>
    
                   <form action="" method="post">
  -                <input type="hidden" name="principal" value="{@pl:name}"/>
  -                <input type="hidden" name="method" value="addPrincipalGroupMember"/>
  +                <input type="hidden" name="cocoon-principal-name" value="{@pl:name}"/>
  +                <input type="hidden" name="method" value="doAddPrincipalGroupMember"/>
    
                    <td align="left">
                     <xsl:variable name="name" select="@pl:name"/>
  -                  <select name="group" size="1">
  +                  <select name="cocoon-principal-group-name" size="1">
                      <xsl:for-each select="../pl:group">
                       <option><xsl:value-of select="@pl:name"/></option>
                      </xsl:for-each>
  @@ -156,16 +157,18 @@
    
                 <tr>
                  <form action="" method="post">
  -                <input type="hidden" name="method" value="addPrincipal"/>
  +                <input type="hidden" name="method" value="doAddPrincipal"/>
                   <td align="left">
  -                 <input name="principal" type="text" size="10" maxlength="40"/>
  +                 <input name="cocoon-principal-name" type="text" size="10" maxlength="40"/>
                   </td>
                   <td align="left"></td>
                   <td align="left">
  -                 <input name="role" type="text" size="10" maxlength="40"/>
  +                 <input name="cocoon-principal-role" type="text" size="10" maxlength="40"/>
  +                </td>
  +                <td align="left">Password:</td>
  +                <td align="left">
  +                 <input name="cocoon-principal-password" type="text" size="10" maxlength="40"/>
                   </td>
  -                <td align="left"></td>
  -                <td align="left"></td>
                   <td align="right">
                    <input type="submit" name="cocoon-action-addprincipal" value="Add user"/>
                   </td>
  @@ -213,7 +216,8 @@
                  <tr>
   
                   <form action="" method="post">
  -                <input type="hidden" name="name" value="{@pl:name}"/>
  +                 <input type="hidden" name="cocoon-principal-group-name" value="{@pl:name}"/>
  +                 <input type="hidden" name="method" value="doRemovePrincipalGroup"/>
    
                    <td align="left">
                     <xsl:value-of select="@pl:name"/>
  @@ -229,8 +233,9 @@
   
                 <tr>
                  <form action="" method="post">
  +                <input type="hidden" name="method" value="doAddPrincipalGroup"/>
                   <td align="left">
  -                 <input name="group" type="text" size="15" maxlength="40"/>
  +                 <input name="cocoon-principal-group-name" type="text" size="15" maxlength="40"/>
                   </td>
                   <td align="right">
                    <input type="submit" name="cocoon-action-addgroup" value="Add group"/>
  
  
  
  1.6       +1 -1      xml-cocoon2/src/scratchpad/webapp/samples/slide/rdf2html4content.xsl
  
  Index: rdf2html4content.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/rdf2html4content.xsl,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- rdf2html4content.xsl	9 Jul 2002 21:41:34 -0000	1.5
  +++ rdf2html4content.xsl	21 Jul 2002 22:50:55 -0000	1.6
  @@ -153,7 +153,7 @@
                     select="/rdf:RDF/rdf:Description[@rdf:about=$location]/dav:getlastmodified"/></td>
                   <td align="right">
                    <form action="" method="post">
  -                  <input type="hidden" name="method" value="deleteSource"/>
  +                  <input type="hidden" name="method" value="doDeleteSource"/>
                     <input type="hidden" name="cocoon-source-uri" value="{../../@rdf:about}"/>
                     <input type="submit" name="cocoon-action-deletesource" value="Delete"/>
                    </form>
  
  
  
  1.3       +10 -8     xml-cocoon2/src/scratchpad/webapp/samples/slide/rdf2html4locks.xsl
  
  Index: rdf2html4locks.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/rdf2html4locks.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- rdf2html4locks.xsl	5 Jul 2002 13:37:37 -0000	1.2
  +++ rdf2html4locks.xsl	21 Jul 2002 22:50:55 -0000	1.3
  @@ -147,8 +147,9 @@
                   <td align="left"><xsl:value-of select="@exclusive"/></td>
                   <td align="right">
                    <form action="" method="post">
  -                  <input type="hidden" name="uri" value="{../../../../@uri}"/>
  -                  <input type="hidden" name="locksubject" value="{@subject}"/>
  +                  <input type="hidden" name="method" value="doDeleteLock"/>
  +                  <input type="hidden" name="cocoon-source-uri" value="{../../../../@uri}"/>
  +                  <input type="hidden" name="cocoon-lock-subject" value="{@subject}"/>
   
                     <input type="submit" name="cocoon-action-deletelock" value="Delete"/>
                    </form>
  @@ -158,24 +159,25 @@
   
                 <tr>
                  <form action="" method="post">
  -                <input type="hidden" name="uri" value="{@rdf:about}"/>
  +                <input type="hidden" name="method" value="doAddLock"/>
  +                <input type="hidden" name="cocoon-source-uri" value="{@rdf:about}"/>
                   <td align="left">
  -                 <input name="locksubject" type="text" size="20" maxlength="40"/>
  +                 <input name="cocoon-lock-subject" type="text" size="20" maxlength="40"/>
                   </td>
                   <td align="left">
  -                 <input name="locktype" type="text" size="15" maxlength="40"/>
  +                 <input name="cocoon-lock-type" type="text" size="15" maxlength="40"/>
                   </td>
                   <td align="left">
  -                 <input name="lockexpiration" type="text" size="15" maxlength="40"/>
  +                 <input name="cocoon-lock-expiration" type="text" size="15" maxlength="40"/>
                   </td>
                   <td align="left">
  -                 <select name="lockinheritable">
  +                 <select name="cocoon-lock-inheritable">
                     <option>true</option>
                     <option>false</option>
                    </select>
                   </td>
                   <td align="left">
  -                 <select name="lockexclusive">
  +                 <select name="cocoon-lock-exclusive">
                     <option>true</option>
                     <option>false</option>
                    </select>
  
  
  
  1.3       +10 -8     xml-cocoon2/src/scratchpad/webapp/samples/slide/rdf2html4permissions.xsl
  
  Index: rdf2html4permissions.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/rdf2html4permissions.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- rdf2html4permissions.xsl	5 Jul 2002 13:37:37 -0000	1.2
  +++ rdf2html4permissions.xsl	21 Jul 2002 22:50:55 -0000	1.3
  @@ -145,9 +145,10 @@
                   <td align="left"><xsl:value-of select="@negative"/></td>
                   <td align="right">
                    <form action="" method="post">
  -                  <input type="hidden" name="uri" value="{../../../../@uri}"/>
  -                  <input type="hidden" name="permissionprincipal" value="{@subject}"/>
  -                  <input type="hidden" name="permissionprivilege" value="{@action}"/>
  +                  <input type="hidden" name="method" value="doDeletePermission"/>
  +                  <input type="hidden" name="cocoon-source-uri" value="{../../../../@uri}"/>
  +                  <input type="hidden" name="cocoon-permission-principal" value="{@subject}"/>
  +                  <input type="hidden" name="cocoon-permission-privilege" value="{@action}"/>
   
                     <input type="submit" name="cocoon-action-deletepermission" value="Delete"/>
                    </form>
  @@ -157,16 +158,17 @@
   
                 <tr>
                  <form action="" method="post">
  -                <input type="hidden" name="uri" value="{@rdf:about}"/>
  +                <input type="hidden" name="method" value="doAddPermission"/>
  +                <input type="hidden" name="cocoon-source-uri" value="{@rdf:about}"/>
                   <td align="left">
  -                 <select name="permissonprincipal">
  +                 <select name="cocoon-permisson-principal">
                     <option>ALL</option>
                     <option>SELF</option>
                     <option>GUEST</option>
                    </select>
                   </td>
                   <td align="left">
  -                 <select name="permissonprivilege">
  +                 <select name="cocoon-permisson-privilege">
                     <option>all</option>
                     <option>read</option>
                     <option>write</option>
  @@ -190,13 +192,13 @@
                    </select>
                   </td>
                   <td align="left">
  -                 <select name="permissoninheritable">
  +                 <select name="cocoon-permisson-inheritable">
                     <option>true</option>
                     <option>false</option>
                    </select>
                   </td>
                   <td align="left">
  -                 <select name="permissondeny">
  +                 <select name="cocoon-permisson-negative">
                     <option>true</option>
                     <option>false</option>
                    </select>
  
  
  
  1.5       +10 -8     xml-cocoon2/src/scratchpad/webapp/samples/slide/rdf2html4properties.xsl
  
  Index: rdf2html4properties.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/rdf2html4properties.xsl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- rdf2html4properties.xsl	5 Jul 2002 13:37:37 -0000	1.4
  +++ rdf2html4properties.xsl	21 Jul 2002 22:50:55 -0000	1.5
  @@ -147,9 +147,10 @@
                  <td align="left"><xsl:value-of select="."/></td>
                  <td align="right">
                   <form action="" method="post">
  -                 <input type="hidden" name="uri" value="{../@rdf:about}"/>
  -                 <input type="hidden" name="namespace" value="{namespace-uri()}"/>
  -                 <input type="hidden" name="name" value="{local-name()}"/>
  +                 <input type="hidden" name="method" value="doDeleteProperty"/>
  +                 <input type="hidden" name="cocoon-source-uri" value="{../@rdf:about}"/>
  +                 <input type="hidden" name="cocoon-source-property-namespace" value="{namespace-uri()}"/>
  +                 <input type="hidden" name="cocoon-source-property-name" value="{local-name()}"/>
    
                    <input type="submit" name="cocoon-action-deleteproperty" value="Delete"/>
                   </form>
  @@ -159,15 +160,16 @@
   
                <tr>
                 <form action="" method="post">
  -               <input type="hidden" name="uri" value="{@rdf:about}"/>
  +               <input type="hidden" name="method" value="doAddProperty"/>
  +               <input type="hidden" name="cocoon-source-uri" value="{@rdf:about}"/>
                   <td align="left">
  -                 <input name="namespace" type="text" size="25" maxlength="40"/>
  +                 <input name="cocoon-source-property-namespace" type="text" size="25"
maxlength="40"/>
                   </td>
                   <td align="left">
  -                 <input name="name" type="text" size="15" maxlength="40"/>
  +                 <input name="cocoon-source-property-name" type="text" size="15" maxlength="40"/>
                   </td>
                   <td align="left">
  -                 <input name="value" type="text" size="15" maxlength="40"/>
  +                 <input name="cocoon-source-property-value" type="text" size="15" maxlength="40"/>
                   </td>
                   <td align="right">
                    <input type="submit" name="cocoon-action-addproperty" value="Add/Modify"/>
  @@ -175,7 +177,7 @@
                  </form>
                 </tr>
   
  -              </font>
  +             </font>
   
               </table>
              </td>
  
  
  
  1.8       +17 -2     xml-cocoon2/src/scratchpad/webapp/samples/slide/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/sitemap.xmap,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- sitemap.xmap	9 Jul 2002 21:41:34 -0000	1.7
  +++ sitemap.xmap	21 Jul 2002 22:50:55 -0000	1.8
  @@ -96,8 +96,19 @@
       <map:serialize type="xml"/>
      </map:match>
   
  +   <map:match pattern="repository-authlist">
  +    <map:generate type="principallist">
  +     <map:parameter name="principalprovider" value="slide"/>
  +     <map:parameter name="principalcaller" value="root"/>
  +    </map:generate>
  +
  +    <map:transform src="context://samples/common/style/xsl/html/simple-xml2html.xsl"/>
  +
  +    <map:serialize type="html"/>
  +   </map:match>
  +
      <map:handle-errors>
  -    <map:transform src="context://stylesheets/system/error2html.xsl"/>
  +    <map:transform src="context://samples/common/style/xsl/html/error2html.xsl"/>
       <map:serialize status-code="500"/>
      </map:handle-errors>
   
  @@ -165,6 +176,7 @@
        <!-- ============= Source properties =============== -->
        <map:match pattern="properties/**">
         <map:act type="source-actions">
  +       <map:parameter name="method" value="{request:method}"/>
          <map:parameter name="cocoon-source-principal" value="root"/>
         </map:act>
   
  @@ -176,6 +188,7 @@
        <!-- ============= Source permissions ============== -->
        <map:match pattern="permissions/**">
         <map:act type="source-actions">
  +       <map:parameter name="method" value="{request:method}"/>
          <map:parameter name="cocoon-source-principal" value="root"/>
         </map:act>
   
  @@ -187,6 +200,7 @@
        <!-- ============= Source locks ==================== -->
        <map:match pattern="locks/**">
         <map:act type="source-actions">
  +       <map:parameter name="method" value="{request:method}"/>
          <map:parameter name="cocoon-source-principal" value="root"/>
         </map:act>
   
  @@ -204,7 +218,8 @@
        <!-- ============= Repository users =============== -->
        <map:match pattern="users/**">
         <map:act type="principal-actions">
  -       <map:parameter name="cocoon-repository-principal" value="root"/>
  +       <map:parameter name="method" value="{request:method}"/>
  +       <map:parameter name="cocoon-caller-principal-name" value="root"/>
         </map:act>
   
         <map:generate type="principallist">
  
  
  
  1.6       +41 -4     xml-cocoon2/src/scratchpad/webapp/samples/slide/slide.xconf
  
  Index: slide.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/slide.xconf,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- slide.xconf	18 Jul 2002 22:25:35 -0000	1.5
  +++ slide.xconf	21 Jul 2002 22:50:55 -0000	1.6
  @@ -38,7 +38,7 @@
           The following jdbc sample configuration uses the hsql Database Engine
           a relational database engine written in Java, for more info:
           http://hsqldb.sourceforge.net/
  -        -->
  +        -->     
           <definition>
               <store name="jdbc">
               <nodestore classname="slidestore.reference.JDBCDescriptorsStore">
  @@ -68,6 +68,40 @@
               </store>
               <scope match="/" store="jdbc" />
           </definition>
  +        <!-- ### MySQL Configuration ###
  +        The following jdbc sample configuration uses the MySQL Database.
  +        -->
  +        <!--
  +        <definition>
  +            <store name="jdbc">
  +            <nodestore classname="slidestore.mysql.MySQLDescriptorsStore">
  +                <parameter name="driver">org.gjt.mm.mysql.Driver</parameter>
  +                <parameter name="url">jdbc:mysql://localhost/myDB</parameter>
  +                <parameter name="user">cocoon</parameter>
  +                <parameter name="password">cocoon</parameter>
  +            </nodestore>
  +            <securitystore>
  +                <reference store="nodestore" />
  +            </securitystore>
  +            <lockstore>
  +                <reference store="nodestore" />
  +            </lockstore>
  +            <revisiondescriptorsstore>
  +                <reference store="nodestore" />
  +            </revisiondescriptorsstore>
  +            <revisiondescriptorstore>
  +                <reference store="nodestore" />
  +            </revisiondescriptorstore>
  +            <contentstore classname="slidestore.mysql.MySQLContentStore">
  +                <parameter name="driver">org.gjt.mm.mysql.Driver</parameter>
  +                <parameter name="url">jdbc:mysql://localhost/myDB</parameter>
  +                <parameter name="user">cocoon</parameter>
  +                <parameter name="password">cocoon</parameter>
  +            </contentstore>
  +            </store>
  +            <scope match="/" store="jdbc" />
  +        </definition>
  +        -->
           <!-- ### Mixed JDBC - Filesystem ###
           stores: slidestore.reference.JDBCDescriptorsStore
                   slidestore.reference.FileContentStore
  @@ -166,14 +200,16 @@
                       <objectnode classname="slideroles.basic.RootRoleImpl"
                           uri="/users/root">
                           <revision>
  -                            <property name="password">root</property>
  +                            <property name="password"
  +                                      namespace="http://jakarta.apache.org/slide/">root</property>
                           </revision>
                       </objectnode>
                       <!-- /users/john represents an authenticated user -->
                       <objectnode classname="slideroles.basic.UserRoleImpl"
                           uri="/users/john">
                           <revision>
  -                            <property name="password">john</property>
  +                            <property name="password"
  +                                      namespace="http://jakarta.apache.org/slide/">john</property>
                           </revision>
                       </objectnode>
                       <!-- /users/guest represents an authenticated or
  @@ -181,7 +217,8 @@
                       <objectnode classname="slideroles.basic.GuestRoleImpl"
                           uri="/users/guest">
                           <revision>
  -                            <property name="password"/>
  +                            <property name="password" 
  +                                      namespace="http://jakarta.apache.org/slide/"/>
                           </revision>
                       </objectnode>
                   </objectnode>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message