taylor      2004/10/14 23:51:04

  Modified:    components/page-manager/src/java/org/apache/jetspeed/om/folder/impl
                        FolderImpl.java
  Added:       components/page-manager/src/java/org/apache/jetspeed/om/folder/impl
                        DocumentSetImpl.java DocumentSetPathImpl.java
  Log:
  patch from Randy Watler, docset mapping for castor
  
  Revision  Changes    Path
  1.16      +16 -1     
jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java
  
  Index: FolderImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- FolderImpl.java   26 Sep 2004 06:10:20 -0000      1.15
  +++ FolderImpl.java   15 Oct 2004 06:51:04 -0000      1.16
  @@ -22,6 +22,7 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.jetspeed.om.common.GenericMetadata;
  +import org.apache.jetspeed.om.folder.DocumentSet;
   import org.apache.jetspeed.om.folder.Folder;
   import org.apache.jetspeed.om.folder.FolderMetaData;
   import org.apache.jetspeed.om.folder.FolderNotFoundException;
  @@ -191,6 +192,20 @@
       public NodeSet getLinks() throws NodeException
       {
           return getAllNodes().subset(Link.DOCUMENT_TYPE);
  +    }
  +
  +    /**
  +     * <p>
  +     * getDocumentSets
  +     * </p>
  +     * 
  +     * @see org.apache.jetspeed.om.folder.Folder#getDocumentSets()
  +     * @return @throws
  +     *         DocumentNotFoundException
  +     */
  +    public NodeSet getDocumentSets() throws NodeException
  +    {
  +        return getAllNodes().subset(DocumentSet.DOCUMENT_TYPE);
       }
   
       /**
  
  
  
  1.1                  
jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/DocumentSetImpl.java
  
  Index: DocumentSetImpl.java
  ===================================================================
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.om.folder.impl;
  
  import java.util.Vector;
  
  import org.apache.jetspeed.om.folder.DocumentSet;
  import org.apache.jetspeed.om.folder.DocumentSetPath;
  import org.apache.jetspeed.page.document.AbstractNode;
  
  /**
   * <p>
   * DocumentSetImpl
   * </p>
   * 
   * @author <a href="mailto:[EMAIL PROTECTED]">Randy Watler</a>
   * @version $Id: DocumentSetImpl.java,v 1.1 2004/10/15 06:51:04 taylor Exp $
   */
  public class DocumentSetImpl extends AbstractNode implements DocumentSet
  {
      private String documentSetName;
      private String profileLocatorName;
      private Vector documentPaths;
       
      public DocumentSetImpl()
      {
          documentPaths = new Vector();
      }
         
      /**
       * <p>
       * getType
       * </p>
       *
       * @see org.apache.jetspeed.om.page.Document#getType()
       * @return
       */
      public String getType()
      {
          return DOCUMENT_TYPE;
      }
  
      /**
       * <p>
       * getDocumentSetName
       * </p>
       *
       * @see org.apache.jetspeed.om.folder.DocumentSet#getDocumentSetName()
       * @return name
       */
      public String getDocumentSetName()
      {
          return documentSetName;
      }
      /**
       * <p>
       * setDocumentSetName
       * </p>
       *
       * @see 
org.apache.jetspeed.om.folder.DocumentSet#setDocumentSetName(java.lang.String)
       * @param setName
       */
      public void setDocumentSetName( String setName )
      {
          this.documentSetName = setName;
      }
  
      /**
       * <p>
       * getProfileLocatorName
       * </p>
       *
       * @see org.apache.jetspeed.om.folder.DocumentSet#getProfileLocatorName()
       * @return name
       */
      public String getProfileLocatorName()
      {
          return profileLocatorName;
      }
      /**
       * <p>
       * setProfileLocatorName
       * </p>
       *
       * @see 
org.apache.jetspeed.om.folder.DocumentSet#setProfileLocatorName(java.lang.String)
       * @param locatorName
       */
      public void setProfileLocatorName( String locatorName )
      {
          this.profileLocatorName = locatorName;
      }
  
  
      /**
       * <p>
       * getDocumentPaths
       * </p>
       *
       * @see org.apache.jetspeed.om.folder.DocumentSet#getDocumentPaths()
       * @return
       */
      public Vector getDocumentPaths()
      {
          return documentPaths;
      }
      /**
       * <p>
       * setDocumentPaths
       * </p>
       *
       * @see 
org.apache.jetspeed.om.folder.DocumentSet#setDocumentPaths(java.util.List)
       * @param paths
       */
      public void setDocumentPaths( Vector paths )
      {
          this.documentPaths = paths;
      }
      /**
       * <p>
       * getDefaultedDocumentPaths
       * </p>
       *
       * @see org.apache.jetspeed.om.folder.DocumentSet#getDefaultedDocumentPaths()
       * @return
       */
      public Vector getDefaultedDocumentPaths()
      {
          if (documentPaths.isEmpty())
          {
              // default document set paths
              DocumentSetPath defaultPath = new DocumentSetPathImpl();
              defaultPath.setPath("/" + documentSetName + "/*.*");
              defaultPath.setRegexp(true);
              documentPaths.add(defaultPath);
          }
          return documentPaths;
      }
  
  }
  
  
  
  1.1                  
jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/DocumentSetPathImpl.java
  
  Index: DocumentSetPathImpl.java
  ===================================================================
  /*
   * Copyright 2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.jetspeed.om.folder.impl;
  
  import org.apache.jetspeed.om.folder.DocumentSetPath;
  
  /**
   * <p>
   * DocumentSetPathImpl
   * </p>
   * 
   * @author <a href="mailto:[EMAIL PROTECTED]">Randy Watler</a>
   * @version $Id: DocumentSetPathImpl.java,v 1.1 2004/10/15 06:51:04 taylor Exp $
   */
  public class DocumentSetPathImpl implements DocumentSetPath
  {
      private String path;
      private boolean regexp;
       
      public DocumentSetPathImpl()
      {
      }
         
      /**
       * <p>
       * getPath
       * </p>
       *
       * @see org.apache.jetspeed.om.folder.DocumentSetPath#getPath()
       * @return path
       */
      public String getPath()
      {
          return path;
      }
      /**
       * <p>
       * setPath
       * </p>
       *
       * @see org.apache.jetspeed.om.folder.DocumentSetPath#setPath(java.lang.String)
       * @param path
       */
      public void setPath( String path )
      {
          this.path = path;
      }
  
      /**
       * <p>
       * isRegexp
       * </p>
       *
       * @see org.apache.jetspeed.om.folder.DocumentSetPath#isRegexp()
       * @return regexp
       */
      public boolean isRegexp()
      {
          return regexp;
      }
      /**
       * <p>
       * setRegexp
       * </p>
       *
       * @see org.apache.jetspeed.om.folder.DocumentSetPath#setRegexp(boolean)
       * @param regexp
       */
      public void setRegexp( boolean regexp )
      {
          this.regexp = regexp;
      }
  
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to