portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/impl CastorXmlPageManager.java AbstractPageManager.java
Date Thu, 21 Oct 2004 02:28:07 GMT
taylor      2004/10/20 19:28:07

  Modified:    components/page-manager/src/java/org/apache/jetspeed/page/document
                        FileSystemFolderHandler.java
                        DocumentHandlerFactoryImpl.java NodeSetImpl.java
                        AbstractNode.java
               components/page-manager/src/java/org/apache/jetspeed/om/folder/impl
                        FolderMetaDataImpl.java DocumentSetImpl.java
                        FolderImpl.java
               components/page-manager/src/java/META-INF page-mapping.xml
               components/page-manager/src/java/org/apache/jetspeed/page/impl
                        CastorXmlPageManager.java AbstractPageManager.java
  Log:
  Patch from Randy Watler to page manager:
  1, added Node.PATH_SEPARATOR[_CHAR] constants.
  2. removed DocumentSet.documentSetName, (use unique profiled path instead).
  3. added impl side AbstractNode.profiledPath member to avoid overloading Node.url member.
  4. use consistent rules for aggregating document sets, root links, folders, and pages: first unique profiled path matched is aggregated, duplicates are rejected.
  5. allow document set specified pages and folders to be located and returned with "/" page context.
  
  Revision  Changes    Path
  1.4       +22 -16    jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/FileSystemFolderHandler.java
  
  Index: FileSystemFolderHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/FileSystemFolderHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FileSystemFolderHandler.java	15 Oct 2004 06:57:50 -0000	1.3
  +++ FileSystemFolderHandler.java	21 Oct 2004 02:28:07 -0000	1.4
  @@ -167,14 +167,14 @@
           {
               try
               {
  -                if (path.endsWith("/"))
  +                if (path.endsWith(Folder.PATH_SEPARATOR))
                   {
                       Object obj = metadataDocHandler.getDocument(path + FolderMetaData.DOCUMENT_TYPE);
                       metadata = (FolderMetaData) obj;
                   }
                   else
                   {
  -                    Object obj =(FolderMetaData) metadataDocHandler.getDocument(path + "/"
  +                    Object obj =(FolderMetaData) metadataDocHandler.getDocument(path + Folder.PATH_SEPARATOR
                               + FolderMetaData.DOCUMENT_TYPE);
                       metadata = (FolderMetaData) obj;
                   }
  @@ -185,13 +185,13 @@
                   folder = new FolderImpl(path, handlerFactory, this);
               }
   
  -            if (!path.equals("/") && path.indexOf('/') > -1)
  +            if (!path.equals(Folder.PATH_SEPARATOR) && path.indexOf(Folder.PATH_SEPARATOR_CHAR) > -1)
               {
  -                folder.setParent(getFolder(path.substring(0, path.lastIndexOf('/'))));
  +                folder.setParent(getFolder(path.substring(0, path.lastIndexOf(Folder.PATH_SEPARATOR_CHAR))));
               }
  -            else if (!path.equals("/") && path.indexOf('/') < 0)
  +            else if (!path.equals(Folder.PATH_SEPARATOR) && path.indexOf(Folder.PATH_SEPARATOR_CHAR) < 0)
               {
  -                folder.setParent(getFolder("/"));
  +                folder.setParent(getFolder(Folder.PATH_SEPARATOR));
               }
           }
   
  @@ -229,13 +229,13 @@
               NodeSetImpl folders = new NodeSetImpl(path);
               for (int i = 0; i < children.length; i++)
               {
  -                if (path.endsWith("/"))
  +                if (path.endsWith(Folder.PATH_SEPARATOR))
                   {
                       folders.add(getFolder(path + children[i]));
                   }
                   else
                   {
  -                    folders.add(getFolder(path + "/" + children[i]));
  +                    folders.add(getFolder(path + Folder.PATH_SEPARATOR + children[i]));
                   }
               }
               return folders;
  @@ -338,20 +338,22 @@
           throws FolderNotFoundException, InvalidFolderException, NodeException
       {
           // path must be valid absolute path
  -        if ((path == null) || ! path.startsWith("/"))
  +        if ((path == null) || ! path.startsWith(Folder.PATH_SEPARATOR))
           {
               throw new InvalidFolderException( "Invalid path specified " + path );
           }
   
           // traverse folders and parse path from root,
           // accumualting matches in node set
  -        Folder folder = getFolder("/");
  +        Folder folder = getFolder(Folder.PATH_SEPARATOR);
           NodeSetImpl matched = new NodeSetImpl(null);
           getNodes(folder,path,regexp,matched);
   
           // return matched nodes filtered by document type
           if (documentType != null)
  +        {
               return matched.subset(documentType);
  +        }
           return matched;
       }
   
  @@ -359,23 +361,25 @@
           throws FolderNotFoundException, InvalidFolderException, NodeException
       {
           // test for trivial folder match
  -        if (path.equals("/"))
  +        if (path.equals(Folder.PATH_SEPARATOR))
           {
               matched.add(folder);
               return;
           }
   
           // remove leading separator
  -        if (path.startsWith("/"))
  +        if (path.startsWith(Folder.PATH_SEPARATOR))
  +        {
               path = path.substring(1);
  +        }
   
           // parse path for folder path match
  -        int separatorIndex = path.indexOf("/");
  +        int separatorIndex = path.indexOf(Folder.PATH_SEPARATOR);
           if (separatorIndex != -1)
           {
               // match folder name
               String folderName = path.substring(0,separatorIndex);
  -            String folderPath = (folder.getPath().endsWith("/") ? folder.getPath() : folder.getPath() + "/") + folderName;
  +            String folderPath = (folder.getPath().endsWith(Folder.PATH_SEPARATOR) ? folder.getPath() : folder.getPath() + Folder.PATH_SEPARATOR) + folderName;
               NodeSet matchedFolders = null;
               if (regexp)
               {
  @@ -410,13 +414,15 @@
   
           // match node name
           String nodeName = path;
  -        String nodePath = (folder.getPath().endsWith("/") ? folder.getPath() : folder.getPath() + "/") + nodeName;
  +        String nodePath = (folder.getPath().endsWith(Folder.PATH_SEPARATOR) ? folder.getPath() : folder.getPath() + Folder.PATH_SEPARATOR) + nodeName;
           if (regexp)
           {
               // get regexp matched nodes
               Iterator addIter = folder.getAllNodes().inclusiveSubset(nodePath).iterator();
               while (addIter.hasNext())
  +            {
                   matched.add((Node) addIter.next());
  +            }
           }
           else
           {
  
  
  
  1.2       +3 -3      jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/DocumentHandlerFactoryImpl.java
  
  Index: DocumentHandlerFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/DocumentHandlerFactoryImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DocumentHandlerFactoryImpl.java	3 Sep 2004 13:22:06 -0000	1.1
  +++ DocumentHandlerFactoryImpl.java	21 Oct 2004 02:28:07 -0000	1.2
  @@ -122,7 +122,7 @@
               }
               catch (UnsupportedDocumentTypeException e)
               {
  -                int lastSlash = documentPath.lastIndexOf("/");
  +                int lastSlash = documentPath.lastIndexOf(Node.PATH_SEPARATOR);
                   if(lastSlash < 0)
                   {
                       lastSlash = 0;
  @@ -135,4 +135,4 @@
               throw new UnsupportedDocumentTypeException("The path provided has no extension and may be a folder.");
           }
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.6       +3 -3      jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/NodeSetImpl.java
  
  Index: NodeSetImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/NodeSetImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NodeSetImpl.java	15 Oct 2004 06:57:50 -0000	1.5
  +++ NodeSetImpl.java	21 Oct 2004 02:28:07 -0000	1.6
  @@ -81,13 +81,13 @@
           }
           else if (resolveToPath != null)
           {
  -            if (resolveToPath.endsWith("/"))
  +            if (resolveToPath.endsWith(Node.PATH_SEPARATOR))
               {
                   return (Node) nodes.get(resolveToPath + name);
               }
               else
               {
  -                return (Node) nodes.get(resolveToPath + "/" + name);
  +                return (Node) nodes.get(resolveToPath + Node.PATH_SEPARATOR + name);
               }
           }
   
  
  
  
  1.6       +19 -4     jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/AbstractNode.java
  
  Index: AbstractNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/document/AbstractNode.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractNode.java	15 Oct 2004 06:57:50 -0000	1.5
  +++ AbstractNode.java	21 Oct 2004 02:28:07 -0000	1.6
  @@ -50,10 +50,10 @@
       private String path;
       private String url;
       private boolean hidden=false;
  +    private String profiledPath;
   
       public AbstractNode()
       {
  -
       }
   
       public GenericMetadata getMetadata()
  @@ -184,9 +184,9 @@
           if(getParent() != null)
           {
               parentName = getParent().getPath();
  -            if (! parentName.endsWith("/"))
  +            if (! parentName.endsWith(PATH_SEPARATOR))
               {
  -                parentName += "/";
  +                parentName += PATH_SEPARATOR;
               }
           }
           
  @@ -262,5 +262,20 @@
       public void setHidden( boolean hidden )
       {
           this.hidden = hidden;
  +    }
  +
  +    /**
  +     * @return Returns the profiled path.
  +     */
  +    public String getProfiledPath()
  +    {
  +        return profiledPath;
  +    }
  +    /**
  +     * @param path The profiled path to set.
  +     */
  +    public void setProfiledPath( String profiledPath )
  +    {
  +        this.profiledPath = profiledPath;
       }
   }
  
  
  
  1.5       +3 -3      jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMetaDataImpl.java
  
  Index: FolderMetaDataImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/FolderMetaDataImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FolderMetaDataImpl.java	9 Sep 2004 19:03:03 -0000	1.4
  +++ FolderMetaDataImpl.java	21 Oct 2004 02:28:07 -0000	1.5
  @@ -66,7 +66,7 @@
       public String getUrl()
       {
          
  -        return getParent().getPath()+"/"+getType();
  +        return getParent().getPath() + PATH_SEPARATOR + getType();
       }
       /**
        * <p>
  @@ -107,4 +107,4 @@
       {
           this.defaultPage = defaultPage;
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +7 -28     jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/DocumentSetImpl.java
  
  Index: DocumentSetImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/om/folder/impl/DocumentSetImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DocumentSetImpl.java	15 Oct 2004 06:51:04 -0000	1.1
  +++ DocumentSetImpl.java	21 Oct 2004 02:28:07 -0000	1.2
  @@ -31,7 +31,6 @@
    */
   public class DocumentSetImpl extends AbstractNode implements DocumentSet
   {
  -    private String documentSetName;
       private String profileLocatorName;
       private Vector documentPaths;
        
  @@ -55,31 +54,6 @@
   
       /**
        * <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>
        *
  @@ -142,7 +116,12 @@
           {
               // default document set paths
               DocumentSetPath defaultPath = new DocumentSetPathImpl();
  -            defaultPath.setPath("/" + documentSetName + "/*.*");
  +            String name = getName();
  +            if (name.endsWith(DOCUMENT_TYPE))
  +            {
  +                name = name.substring(0, name.length() - DOCUMENT_TYPE.length());
  +            }
  +            defaultPath.setPath(PATH_SEPARATOR + name + PATH_SEPARATOR + "*.*");
               defaultPath.setRegexp(true);
               documentPaths.add(defaultPath);
           }
  
  
  
  1.18      +6 -6      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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- FolderImpl.java	19 Oct 2004 04:42:01 -0000	1.17
  +++ FolderImpl.java	21 Oct 2004 02:28:07 -0000	1.18
  @@ -243,13 +243,13 @@
           {            
               if(metadata.getDocumentOrder() != null)
               {
  -                if (getPath().endsWith("/"))
  +                if (getPath().endsWith(PATH_SEPARATOR))
                   {
                       allNodes = new NodeSetImpl(getPath(), new NodeOrderCompartaor(metadata.getDocumentOrder(), getPath()));
                   }
                   else
                   {
  -                    allNodes = new NodeSetImpl(getPath(), new NodeOrderCompartaor(metadata.getDocumentOrder(), getPath()+"/"));
  +                    allNodes = new NodeSetImpl(getPath(), new NodeOrderCompartaor(metadata.getDocumentOrder(), getPath() + PATH_SEPARATOR));
                   }
               }
               else
  @@ -265,7 +265,7 @@
                   Node node = null;
                   try
                   {
  -                    if (getPath().endsWith("/"))
  +                    if (getPath().endsWith(PATH_SEPARATOR))
                       {
                           if(nodeNames[i].indexOf(".") > -1)
                           {    
  @@ -281,11 +281,11 @@
                           
                           if(nodeNames[i].indexOf(".") > -1)
                           {    
  -                            node = handlerFactory.getDocumentHandlerForPath(nodeNames[i]).getDocument(getPath() +"/"+ nodeNames[i]);
  +                            node = handlerFactory.getDocumentHandlerForPath(nodeNames[i]).getDocument(getPath() + PATH_SEPARATOR + nodeNames[i]);
                           }
                           else
                           {
  -                            node = folderHandler.getFolder(getPath() +"/"+ nodeNames[i]);
  +                            node = folderHandler.getFolder(getPath() + PATH_SEPARATOR + nodeNames[i]);
                           }
                       }
                       
  
  
  
  1.7       +0 -4      jakarta-jetspeed-2/components/page-manager/src/java/META-INF/page-mapping.xml
  
  Index: page-mapping.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/page-manager/src/java/META-INF/page-mapping.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- page-mapping.xml	15 Oct 2004 06:50:48 -0000	1.6
  +++ page-mapping.xml	21 Oct 2004 02:28:07 -0000	1.7
  @@ -131,10 +131,6 @@
     <class name="org.apache.jetspeed.om.folder.impl.DocumentSetImpl">
       <map-to xml="documentSet"/>
   
  -    <field name="documentSetName" type="java.lang.String">
  -      <bind-xml name="name" />
  -    </field>
  -
       <field name="profileLocatorName" type="java.lang.String">
         <bind-xml name="profileLocator" />
       </field>
  
  
  
  1.18      +239 -180  jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/impl/CastorXmlPageManager.java
  
  Index: CastorXmlPageManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/impl/CastorXmlPageManager.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- CastorXmlPageManager.java	19 Oct 2004 04:42:01 -0000	1.17
  +++ CastorXmlPageManager.java	21 Oct 2004 02:28:07 -0000	1.18
  @@ -140,7 +140,7 @@
           {
               // copy profiled page context from cached page context and return
               copyProfiledPageContext(cachedPageContext, pageContext);
  -            return ;
  +            return;
           }
   
           // determine profiled page context using profile locator; get
  @@ -172,22 +172,57 @@
               List searchPaths = generateProfilingSearchPaths(requestPath, locator, false);
   
               // find page in page manager content using search paths
  -            boolean profiled = findProfiledPageAndFolders(searchPaths, profiledFolder, profiledPage, profiledFolders, searchProfiledFolders);
  +            boolean profiled = findProfiledPageAndFolders(searchPaths, profiledPage, profiledFolder, profiledFolders, searchProfiledFolders);
   
               // profile fallback to default root folder to locate folder/page
               boolean rootFallback = false;
  -            if (rootFallback = (! profiled && ! requestPath.equals("/")))
  +            if (rootFallback = (! profiled && ! requestPath.equals(Folder.PATH_SEPARATOR)))
               {
  -                log.warn("computeProfiledPageContext(): Falling back to profiled root default page for " + requestPath);
  -                searchPaths = generateProfilingSearchPaths("/", locator, true);
  -                profiled = findProfiledPageAndFolders(searchPaths, profiledFolder, profiledPage, profiledFolders, searchProfiledFolders);
  +                // profile default root folder, (ignoring request path)
  +                searchPaths = generateProfilingSearchPaths(Folder.PATH_SEPARATOR, locator, true);
  +                profiled = findProfiledPageAndFolders(searchPaths, profiledPage, profiledFolder, profiledFolders, searchProfiledFolders);
  +
  +                // if profiled successfully at root fallback but failed previous
  +                // attempt, profile request path against available alternate profile
  +                // locators. This is used only to select a page: all other context
  +                // information remains determined from fallback.
  +                if (profiled && (pageContext.getLocators().size() > 1))
  +                {
  +                    // profile to locate request path using alternate locators
  +                    Page [] alternateProfiledPage = new Page[1];
  +                    Iterator locatorsIter = selectAlternatePageProfileLocators(pageContext.getLocators()).iterator();
  +                    while ((alternateProfiledPage[0] == null) && locatorsIter.hasNext())
  +                    {
  +                        ProfileLocator alternateLocator = (ProfileLocator) locatorsIter.next();
  +                        List alternateSearchPaths = generateProfilingSearchPaths(requestPath, alternateLocator, false);
  +                        findProfiledPageAndFolders(alternateSearchPaths, alternateProfiledPage);
  +                    }
  +
  +                    // if request path matched, use just profiled page; note: page is
  +                    // not used to generate page context, (fallback default root folder
  +                    // is used instead); otherwise continue with root default page match
  +                    if (alternateProfiledPage[0] != null)
  +                    {
  +                        log.debug("computeProfiledPageContext(): Using alternate locator match " + alternateProfiledPage[0] + " for " + requestPath);
  +                        profiledPage[0] = alternateProfiledPage[0];
  +                    }
  +                    else
  +                    {
  +                        log.warn("computeProfiledPageContext(): No alternate locator match: falling back to profiled root default page for " + requestPath);
  +                    }
  +                }
  +                else
  +                {
  +                    // fallback to root default page
  +                    log.warn("computeProfiledPageContext(): Falling back to profiled root default page for " + requestPath);
  +                }
               }
   
               // profiled folder and page
               if (profiled)
               {
  -                folder = (Folder) setProfiledNodeUrl(profiledFolder[0]);
  -                page = (Page) setProfiledNodeUrl(profiledPage[0]);
  +                folder = (Folder) setProfiledNodePathAndUrl((AbstractNode) profiledFolder[0]);
  +                page = (Page) setProfiledNodePathAndUrl((AbstractNode) profiledPage[0]);
               }
   
               // profile page context
  @@ -198,7 +233,7 @@
                   Iterator foldersIter = searchProfiledFolders.iterator();
                   while ((documentOrder == null) && foldersIter.hasNext())
                   {
  -                    FolderImpl profiledPageFolder = (FolderImpl) setProfiledNodeUrl((Node) foldersIter.next());
  +                    FolderImpl profiledPageFolder = (FolderImpl) setProfiledNodePathAndUrl((AbstractNode) foldersIter.next());
                       if ((profiledPageFolder.getMetaData() != null) && (profiledPageFolder.getMetaData().getDocumentOrder() != null) &&
                           ! profiledPageFolder.getMetaData().getDocumentOrder().isEmpty())
                       {
  @@ -218,14 +253,14 @@
                       Iterator aggregatePagesIter = aggregatePages.iterator();
                       while (aggregatePagesIter.hasNext())
                       {
  -                        siblingPages = addUniqueOrDescribedUrlNode((NodeSetImpl) siblingPages, setProfiledNodeUrl((Node) aggregatePagesIter.next()));
  +                        siblingPages = addUniqueOrDescribedUrlNode((NodeSetImpl) siblingPages, setProfiledNodePathAndUrl((AbstractNode) aggregatePagesIter.next()));
                       }
                   }
   
                   // profile parent folder using profiled parent
  -                if ((folder.getParent() != null) && ! folder.getUrl().equals("/"))
  +                if ((folder.getParent() != null) && ! ((AbstractNode) folder).getProfiledPath().equals(Folder.PATH_SEPARATOR))
                   {
  -                    parentFolder = (Folder) setProfiledNodeUrl(folder.getParent());
  +                    parentFolder = (Folder) setProfiledNodePathAndUrl((AbstractNode) folder.getParent());
                   }
   
                   // profile sibling folders by aggregating all siblings in profiled folders
  @@ -239,7 +274,7 @@
                       Iterator aggregateFoldersIter = aggregateFolders.iterator();
                       while (aggregateFoldersIter.hasNext())
                       {
  -                        siblingFolders = addUniqueOrDescribedUrlNode((NodeSetImpl) siblingFolders, setProfiledNodeUrl((Node) aggregateFoldersIter.next()));
  +                        siblingFolders = addUniqueOrDescribedUrlNode((NodeSetImpl) siblingFolders, setProfiledNodePathAndUrl((AbstractNode) aggregateFoldersIter.next()));
                       }
                   }
   
  @@ -254,10 +289,11 @@
                       Iterator aggregateFolderDocumentSetsIter = aggregateFolderDocumentSets.iterator();
                       while (aggregateFolderDocumentSetsIter.hasNext())
                       {
  -                        DocumentSet documentSet = (DocumentSet) aggregateFolderDocumentSetsIter.next();
  -                        if (! aggregateDocumentSets.containsKey(documentSet.getDocumentSetName()))
  +                        DocumentSet documentSet = (DocumentSet) setProfiledNodePathAndUrl((AbstractNode) aggregateFolderDocumentSetsIter.next());
  +                        String documentSetProfiledPath = ((AbstractNode) documentSet).getProfiledPath();
  +                        if (! aggregateDocumentSets.containsKey(documentSetProfiledPath))
                           {
  -                            aggregateDocumentSets.put(documentSet.getDocumentSetName(), documentSet);
  +                            aggregateDocumentSets.put(documentSetProfiledPath, documentSet);
                           }
                       }
                   }
  @@ -279,18 +315,18 @@
                           documentSetNodes = expandAndProfileDocumentSet(pageContext.getLocators(), documentSet, documentSetNodes);
                           if ((documentSetNodes != null) && (documentSetNodes.size() > 0))
                           {
  -                            documentSets.add(setProfiledNodeUrl(documentSet));
  +                            documentSets.add(documentSet);
                               documentSetNodeSets.put(documentSet, documentSetNodes);
                           }
                       }
                   }
   
                   // profile root links by aggregating all links in profiled root folders
  -                if (! rootFallback && ! requestPath.equals("/"))
  +                if (! rootFallback && ! requestPath.equals(Folder.PATH_SEPARATOR))
                   {
                       // profile root folders if required
  -                    searchPaths = generateProfilingSearchPaths("/", locator, true);
  -                    profiled = findProfiledPageAndFolders(searchPaths, profiledFolder, profiledPage, profiledFolders, searchProfiledFolders);
  +                    searchPaths = generateProfilingSearchPaths(Folder.PATH_SEPARATOR, locator, true);
  +                    profiled = findProfiledPageAndFolders(searchPaths, profiledPage, profiledFolder, profiledFolders, searchProfiledFolders);
                   }
                   if (profiled)
                   {
  @@ -299,8 +335,8 @@
                       foldersIter = profiledFolders.iterator();
                       while ((linkDocumentOrder == null) && foldersIter.hasNext())
                       {
  -                        FolderImpl profiledRootFolder = (FolderImpl) setProfiledNodeUrl((Node) foldersIter.next());
  -                        if (profiledRootFolder.getUrl().equals("/") && 
  +                        FolderImpl profiledRootFolder = (FolderImpl) setProfiledNodePathAndUrl((AbstractNode) foldersIter.next());
  +                        if (((AbstractNode) profiledRootFolder).getProfiledPath().equals(Folder.PATH_SEPARATOR) && 
                               (profiledRootFolder.getMetaData() != null) && (profiledRootFolder.getMetaData().getDocumentOrder() != null) &&
                               ! profiledRootFolder.getMetaData().getDocumentOrder().isEmpty())
                           {
  @@ -314,14 +350,14 @@
                       foldersIter = profiledFolders.iterator();
                       while (foldersIter.hasNext())
                       {
  -                        Folder aggregateLinksFolder = (Folder) setProfiledNodeUrl((Node) foldersIter.next());
  -                        if (aggregateLinksFolder.getUrl().equals("/"))
  +                        Folder aggregateLinksFolder = (Folder) setProfiledNodePathAndUrl((AbstractNode) foldersIter.next());
  +                        if (((AbstractNode) aggregateLinksFolder).getProfiledPath().equals(Folder.PATH_SEPARATOR))
                           {
                               NodeSet aggregateLinks = aggregateLinksFolder.getLinks();
                               Iterator aggregateLinksIter = aggregateLinks.iterator();
                               while (aggregateLinksIter.hasNext())
                               {
  -                                rootLinks = addUniqueOrDescribedUrlNode((NodeSetImpl) rootLinks, (Node) aggregateLinksIter.next());
  +                                rootLinks = addUniqueOrDescribedUrlNode((NodeSetImpl) rootLinks, setProfiledNodePathAndUrl((AbstractNode) aggregateLinksIter.next()));
                               }
                           }
                       }
  @@ -347,16 +383,16 @@
               {
                   // retrieve managed folder and page from request
                   String folderPath = requestPath;
  -                if (folderPath.endsWith(Page.DOCUMENT_TYPE) || folderPath.endsWith("/"))
  +                if (folderPath.endsWith(Page.DOCUMENT_TYPE) || folderPath.endsWith(Folder.PATH_SEPARATOR))
                   {
  -                    int lastSlashIndex = folderPath.lastIndexOf('/');
  +                    int lastSlashIndex = folderPath.lastIndexOf(Folder.PATH_SEPARATOR_CHAR);
                       if (lastSlashIndex > 0)
                       {
                           folderPath = folderPath.substring(0, lastSlashIndex);
                       }
                       else
                       {
  -                        folderPath = "/";
  +                        folderPath = Folder.PATH_SEPARATOR;
                       }
                   }
                   folder = getFolder(folderPath);
  @@ -376,7 +412,7 @@
                   log.warn("computeProfiledPageContext(): Falling back to managed root default page for " + requestPath);
                   try
                   {
  -                    folder = getFolder("/");
  +                    folder = getFolder(Folder.PATH_SEPARATOR);
                       String pagePath = folder.getDefaultPage(true);
                       page = folder.getPage(pagePath);
                   }
  @@ -394,7 +430,7 @@
                   siblingFolders = folder.getFolders();
                   try
                   {
  -                    Folder rootFolder = getFolder("/");
  +                    Folder rootFolder = getFolder(Folder.PATH_SEPARATOR);
                       rootLinks = rootFolder.getLinks();
                   }
                   catch (NodeException ne)
  @@ -417,18 +453,19 @@
                           while (documentSetsIter.hasNext())
                           {
                               DocumentSet documentSet = (DocumentSet) documentSetsIter.next();
  +                            String documentSetPath = documentSet.getPath();
   
                               // aggregate document sets
  -                            if (! documentSetNames.contains(documentSet.getDocumentSetName()))
  +                            if (! documentSetNames.contains(documentSetPath))
                               {
  -                                documentSetNames.add(documentSet.getDocumentSetName());
  +                                documentSetNames.add(documentSetPath);
   
                                   // expand document set using default document set order
                                   NodeSetImpl documentSetNodes = new NodeSetImpl(null, documentComparator);
                                   documentSetNodes = expandDocumentSet(documentSet, documentSetNodes);
                                   if ((documentSetNodes != null) && (documentSetNodes.size() > 0))
                                   {
  -                                    documentSets.add(setProfiledNodeUrl(documentSet));
  +                                    documentSets.add(documentSet);
                                       documentSetNodeSets.put(documentSet, documentSetNodes);
                                   }
                               }
  @@ -469,7 +506,7 @@
           }
   
           // generate search paths for profile locator from root
  -        List searchPaths = generateProfilingSearchPaths("/", navigationLocator, true);
  +        List searchPaths = generateProfilingSearchPaths(Folder.PATH_SEPARATOR, navigationLocator, true);
           if (log.isDebugEnabled())
           {
               Iterator pathsIter = searchPaths.iterator();
  @@ -488,13 +525,13 @@
               while ((documentOrder == null) && pathsIter.hasNext())
               {
                   String folderPath = (String) pathsIter.next();
  -                if (folderPath.endsWith("/") && (folderPath.length() > 1))
  +                if (folderPath.endsWith(Folder.PATH_SEPARATOR) && (folderPath.length() > 1))
                   {
                       folderPath = folderPath.substring(0, folderPath.length()-1);
                   }
                   try
                   {
  -                    FolderImpl folder = (FolderImpl) setProfiledNodeUrl((Node) getFolder(folderPath));
  +                    FolderImpl folder = (FolderImpl) setProfiledNodePathAndUrl((AbstractNode) getFolder(folderPath));
                       if ((folder.getMetaData() != null) && (folder.getMetaData().getDocumentOrder() != null) &&
                           ! folder.getMetaData().getDocumentOrder().isEmpty())
                       {
  @@ -536,7 +573,7 @@
                   String searchPath = (String) pathsIter.next();
   
                   // prefix document set path with search path
  -                if (searchPath.endsWith("/"))
  +                if (searchPath.endsWith(Folder.PATH_SEPARATOR))
                   {
                       searchPath += path.substring(1);
                   }
  @@ -552,7 +589,7 @@
                       Iterator pathNodesIter = filterDocumentSet(getNodes(searchPath, regexp, null)).iterator();
                       while (pathNodesIter.hasNext())
                       {
  -                        expandedNodes = addUniqueOrDescribedUrlNode(expandedNodes, (Node) pathNodesIter.next());
  +                        expandedNodes = addUniqueOrDescribedUrlNode(expandedNodes, setProfiledNodePathAndUrl((AbstractNode) pathNodesIter.next()));
                       }
                   }
                   catch (NodeException ne)
  @@ -578,7 +615,7 @@
               
               // get folder and page locator path elements
               List locatorPaths = new ArrayList();
  -            locatorPaths.add(new StringBuffer("/"));
  +            locatorPaths.add(new StringBuffer(Folder.PATH_SEPARATOR));
               int lastLocatorPathsCount = 0;
               String lastLocatorPropertyName = null;
               int lastLocatorPropertyValueLength = 0;
  @@ -599,7 +636,7 @@
                           if (locatorPropertyName.equals(lastLocatorPropertyName))
                           {
                               // duplicate last locator paths set, stripping last matching
  -                            // control value from each, appending nevw value, and adding new
  +                            // control value from each, appending new value, and adding new
                               // valued set to collection of locatorPaths
                               ArrayList multipleValueLocatorPaths = new ArrayList(lastLocatorPathsCount);
                               Iterator locatorPathsIter = locatorPaths.iterator();
  @@ -609,7 +646,7 @@
                                   StringBuffer multipleValueLocatorPath = new StringBuffer(locatorPath.toString());
                                   multipleValueLocatorPath.setLength(multipleValueLocatorPath.length() - lastLocatorPropertyValueLength - 1);
                                   multipleValueLocatorPath.append(locatorPropertyValue);
  -                                multipleValueLocatorPath.append('/');
  +                                multipleValueLocatorPath.append(Folder.PATH_SEPARATOR_CHAR);
                                   multipleValueLocatorPaths.add(multipleValueLocatorPath);
                               }
                               locatorPaths.addAll(multipleValueLocatorPaths);
  @@ -623,9 +660,9 @@
                                   StringBuffer locatorPath = (StringBuffer) locatorPathsIter.next();
                                   locatorPath.append(PROFILE_PROPERTY_FOLDER_PREFIX);
                                   locatorPath.append(locatorPropertyName);
  -                                locatorPath.append('/');
  +                                locatorPath.append(Folder.PATH_SEPARATOR_CHAR);
                                   locatorPath.append(locatorPropertyValue);
  -                                locatorPath.append('/');
  +                                locatorPath.append(Folder.PATH_SEPARATOR_CHAR);
                               }
   
                               // reset last locator property vars
  @@ -657,7 +694,7 @@
                   StringBuffer locatorPath = (StringBuffer) locatorPathsIter.next();
                   if (pagePath != null)
                   {
  -                    if (pagePath.startsWith("/"))
  +                    if (pagePath.startsWith(Folder.PATH_SEPARATOR))
                       {
                           locatorPath.append(pagePath.substring(1));
                       }
  @@ -673,9 +710,9 @@
           // add default page path with no locator path to paths
           if (pagePath != null)
           {
  -            if (! pagePath.startsWith("/"))
  +            if (! pagePath.startsWith(Folder.PATH_SEPARATOR))
               {
  -                paths.add("/" + pagePath);
  +                paths.add(Folder.PATH_SEPARATOR + pagePath);
               }
               else
               {
  @@ -698,7 +735,7 @@
           }
   
           // append page extension if required
  -        if ((pagePath.indexOf("/") == -1) && ! pagePath.endsWith(Page.DOCUMENT_TYPE))
  +        if ((pagePath.indexOf(Folder.PATH_SEPARATOR) == -1) && ! pagePath.endsWith(Page.DOCUMENT_TYPE))
           {
               pagePath = pagePath + Page.DOCUMENT_TYPE;
           }
  @@ -716,23 +753,23 @@
           // not a page); the empty page path here forces a folder path
           // to be created with a trailing slash... the folder then will
           // choose its default page name according to its own rules.
  -        if (! pagePath.startsWith("/"))
  +        if (! pagePath.startsWith(Folder.PATH_SEPARATOR))
           {
               if ((pagePath.length() > 0) || ! requestPath.endsWith(Page.DOCUMENT_TYPE))
               {
                   // append page path to request path
  -                int lastSlashIndex = requestPath.lastIndexOf('/');
  +                int lastSlashIndex = requestPath.lastIndexOf(Folder.PATH_SEPARATOR_CHAR);
                   if (lastSlashIndex > 0)
                   {
  -                    pagePath = requestPath.substring(0, lastSlashIndex) + "/" + pagePath;
  +                    pagePath = requestPath.substring(0, lastSlashIndex) + Folder.PATH_SEPARATOR + pagePath;
                   }
                   else if (requestPath.length() > 1)
                   {
  -                    pagePath = requestPath + "/" + pagePath;
  +                    pagePath = requestPath + Folder.PATH_SEPARATOR + pagePath;
                   }
                   else
                   {
  -                    pagePath = "/" + pagePath;
  +                    pagePath = Folder.PATH_SEPARATOR + pagePath;
                   }
               }
               else
  @@ -745,12 +782,27 @@
           return pagePath;
       }
   
  -    private boolean findProfiledPageAndFolders(List pageSearchPaths, Folder [] folder, Page [] page, List folders, List searchFolders)
  +    private boolean findProfiledPageAndFolders(List pageSearchPaths, Page [] page)
  +    {
  +        return findProfiledPageAndFolders(pageSearchPaths, page, null, null, null);
  +    }
  +
  +    private boolean findProfiledPageAndFolders(List pageSearchPaths, Page [] page, Folder [] folder, List folders, List searchFolders)
       {
  -        folder[0] = null;
  +        // reset profiled results
           page[0] = null;
  -        folders.clear();
  -        searchFolders.clear();
  +        if (folder != null)
  +        {
  +            folder[0] = null;
  +        }
  +        if (folders != null)
  +        {
  +            folders.clear();
  +        }
  +        if (searchFolders != null)
  +        {
  +            searchFolders.clear();
  +        }
   
           // iterate through search paths looking for page in page manager content
           int numSearchFoldersFound = 0;
  @@ -770,16 +822,16 @@
               try
               {
                   // match folder
  -                if (folderPath.endsWith(Page.DOCUMENT_TYPE) || folderPath.endsWith("/"))
  +                if (folderPath.endsWith(Page.DOCUMENT_TYPE) || folderPath.endsWith(Folder.PATH_SEPARATOR))
                   {
  -                    int lastSlashIndex = folderPath.lastIndexOf('/');
  +                    int lastSlashIndex = folderPath.lastIndexOf(Folder.PATH_SEPARATOR_CHAR);
                       if (lastSlashIndex > 0)
                       {
                           folderPath = folderPath.substring(0, lastSlashIndex);
                       }
                       else
                       {
  -                        folderPath = "/";
  +                        folderPath = Folder.PATH_SEPARATOR;
                       }
                   }
                   searchFolder = getFolder(folderPath);
  @@ -794,7 +846,7 @@
                           // trying to find page as last resort in root directory;
                           // otherwise, return only fallback page or explicitly
                           // specified default page name
  -                        boolean allowDefaulting = folderPath.equals( "/" );
  +                        boolean allowDefaulting = folderPath.equals( Folder.PATH_SEPARATOR );
                           pagePath = searchFolder.getDefaultPage(allowDefaulting);
                           
                           // if page path not fallback default page, profile again
  @@ -809,19 +861,19 @@
                               while (pageSearchPathsIter.hasNext())
                               {
                                   String pageSearchPath = (String) pageSearchPathsIter.next();
  -                                if (pageSearchPath.endsWith( "/" ))
  +                                if (pageSearchPath.endsWith( Folder.PATH_SEPARATOR ))
                                   {
                                       pageSearchPathsIter.set(pageSearchPath + pagePath);
                                   }
                                   else
                                   {
  -                                    pageSearchPathsIter.set(pageSearchPath + "/" + pagePath);
  +                                    pageSearchPathsIter.set(pageSearchPath + Folder.PATH_SEPARATOR + pagePath);
                                   }
                               }
   
                               // profile default page
                               log.debug("findProfiledPageAndFolders(): invoking again with default page: " + pagePath);
  -                            return findProfiledPageAndFolders(pageSearchPaths, folder, page, folders, searchFolders);
  +                            return findProfiledPageAndFolders(pageSearchPaths, page, folder, folders, searchFolders);
                           }
                       }
   
  @@ -853,8 +905,11 @@
               if ((page[0] == null) && (searchPage != null))
               {
                   // matched profiled folder/page
  -                folder[0] = searchFolder;
                   page[0] = searchPage;
  +                if (folder != null)
  +                {
  +                    folder[0] = searchFolder;
  +                }
                   
                   log.debug("findProfiledPageAndFolders(), using matched searchFolder = " + searchFolder);
                   log.debug("findProfiledPageAndFolders(), using matched searchPage = " + searchPage);
  @@ -863,77 +918,80 @@
               // return profiled folders and search profiled folders; the search
               // profiled folders are used to find other profiled documents, (i.e
               // document sets).
  -            if (searchFolder != null)
  +            if ((folders != null) && (searchFolders != null))
               {
  -                // profiled folder
  -                folders.add(searchFolder);
  -
  -                // parent search profiled folders, (excluding profile property folders)
  -                do
  +                if (searchFolder != null)
                   {
  -                    searchFolders.add(searchFolder);
  -                    searchFolder = (Folder) searchFolder.getParent();
  +                    // profiled folder
  +                    folders.add(searchFolder);
  +                    
  +                    // parent search profiled folders, (excluding profile property folders)
  +                    do
  +                    {
  +                        searchFolders.add(searchFolder);
  +                        searchFolder = (Folder) searchFolder.getParent();
  +                    }
  +                    while ((searchFolder != null) && ! searchFolder.getName().startsWith(PROFILE_PROPERTY_FOLDER_PREFIX));
                   }
  -                while ((searchFolder != null) && ! searchFolder.getName().startsWith(PROFILE_PROPERTY_FOLDER_PREFIX));
  -            }
  -            else
  -            {
  -                // add parents of missing profiled folders to search profiled
  -                // folders if they exist
  -                String searchFolderName = null;
  -                do
  -                {
  -                    // find parent path or folder
  -                    if (searchFolder == null)
  -                    {
  -                        // get parent folder path
  -                        int separatorIndex = folderPath.lastIndexOf("/");
  -                        if (separatorIndex > 0)
  -                        {
  -                            folderPath = folderPath.substring(0, separatorIndex);
  -                        }
  -                        else
  -                        {
  -                            folderPath = "/";
  -                        }
  -
  -                        // get folder if it exists and folder name
  -                        try
  -                        {
  -                            searchFolder = getFolder(folderPath);
  -                            searchFolderName = searchFolder.getName();
  -                        }
  -                        catch (NodeException ne)
  +                else
  +                {
  +                    // add parents of missing profiled folders to search profiled
  +                    // folders if they exist
  +                    String searchFolderName = null;
  +                    do
  +                    {
  +                        // find parent path or folder
  +                        if (searchFolder == null)
                           {
  -                            separatorIndex = folderPath.lastIndexOf("/");
  +                            // get parent folder path
  +                            int separatorIndex = folderPath.lastIndexOf(Folder.PATH_SEPARATOR);
                               if (separatorIndex > 0)
                               {
  -                                searchFolderName = folderPath.substring(separatorIndex+1);
  +                                folderPath = folderPath.substring(0, separatorIndex);
                               }
                               else
                               {
  -                                searchFolderName = "/";
  +                                folderPath = Folder.PATH_SEPARATOR;
  +                            }
  +                            
  +                            // get folder if it exists and folder name
  +                            try
  +                            {
  +                                searchFolder = getFolder(folderPath);
  +                                searchFolderName = searchFolder.getName();
  +                            }
  +                            catch (NodeException ne)
  +                            {
  +                                separatorIndex = folderPath.lastIndexOf(Folder.PATH_SEPARATOR);
  +                                if (separatorIndex > 0)
  +                                {
  +                                    searchFolderName = folderPath.substring(separatorIndex+1);
  +                                }
  +                                else
  +                                {
  +                                    searchFolderName = Folder.PATH_SEPARATOR;
  +                                }
                               }
                           }
  -                    }
  -                    else
  -                    {
  -                        // get folder as parent of search folder
  -                        searchFolder = (Folder) searchFolder.getParent();
  -                        if (searchFolder != null)
  +                        else
                           {
  -                            searchFolderName = searchFolder.getName();
  +                            // get folder as parent of search folder
  +                            searchFolder = (Folder) searchFolder.getParent();
  +                            if (searchFolder != null)
  +                            {
  +                                searchFolderName = searchFolder.getName();
  +                            }
  +                        }
  +                        
  +                        // add to search profiled folders if it exists, (excluding
  +                        // profile property folders)
  +                        if ((searchFolder != null) && ! searchFolderName.startsWith(PROFILE_PROPERTY_FOLDER_PREFIX))
  +                        {
  +                            searchFolders.add(searchFolder);
                           }
                       }
  -
  -                    // add to search profiled folders if it exists, (excluding
  -                    // profile property folders)
  -                    if ((searchFolder != null) && ! searchFolderName.startsWith(PROFILE_PROPERTY_FOLDER_PREFIX))
  -                    {
  -                        searchFolders.add(searchFolder);
  -                    }
  +                    while (! searchFolderName.equals(Folder.PATH_SEPARATOR) && ! searchFolderName.startsWith(PROFILE_PROPERTY_FOLDER_PREFIX));
                   }
  -                while (! searchFolderName.equals("/") && ! searchFolderName.startsWith(PROFILE_PROPERTY_FOLDER_PREFIX));
               }
           }
   
  @@ -942,7 +1000,7 @@
           // page requested: page selected cannot be ambiguous and using
           // any non root folder default is valid and better than a root
           // fallback default page.
  -        if ((page[0] == null) && (numSearchFoldersFound == 1) && ! lastSearchFolderFound.getPath().equals( "/" ) &&
  +        if ((page[0] == null) && (numSearchFoldersFound == 1) && ! lastSearchFolderFound.getPath().equals( Folder.PATH_SEPARATOR ) &&
               (! lastSearchFolderFoundPath.endsWith(Page.DOCUMENT_TYPE)))
           {
               // single search folder found: allow aggressive defaulting
  @@ -960,34 +1018,38 @@
               if (lastSearchFolderFoundPage != null)
               {
                   page[0] = lastSearchFolderFoundPage;
  -                folder[0] = lastSearchFolderFound;
  +                if (folder != null)
  +                {
  +                    folder[0] = lastSearchFolderFound;
  +                }
                   
                   log.debug("findProfiledPageAndFolders(), using matched default searchFolder = " + lastSearchFolderFound);
                   log.debug("findProfiledPageAndFolders(), using matched default searchPage = " + lastSearchFolderFoundPage);
               }
           }
   
  -        // return true if profiled page and folder found
  -        return ((page[0] != null) && (folder[0] != null));
  +        // return true if profiled page found
  +        return (page[0] != null);
       }
   
  -    private Node setProfiledNodeUrl(Node profiledNode)
  +    private AbstractNode setProfiledNodePathAndUrl(AbstractNode profiledNode)
       {
  -        // explicitly override profiled node urls to hide real ids and paths
  -        // that are artifacts of profiled content in file system
  -        if ((profiledNode instanceof AbstractNode) && ! (profiledNode instanceof Link))
  +        // explicitly override profiled node paths, urls, and titles to
  +        // hide real ids and paths that contain artifacts of profiled
  +        // content in file system
  +        if (profiledNode.getProfiledPath() == null)
           {
  -            AbstractNode profiledAbstractNode = (AbstractNode) profiledNode;
  -            if (! profiledAbstractNode.isUrlSet())
  +            String profiledPath = stripProfiledPath(profiledNode.getPath());
  +            if (profiledPath.startsWith(Folder.PATH_SEPARATOR))
               {
  -                String url = stripProfiledPath(profiledAbstractNode.getUrl());
  -                if (url.startsWith("/"))
  +                profiledNode.setProfiledPath(profiledPath);
  +                if (! profiledNode.isUrlSet())
                   {
  -                    profiledAbstractNode.setUrl(url);
  -                    if (profiledAbstractNode.getPath().equals(profiledAbstractNode.getTitle()))
  -                    {
  -                        profiledAbstractNode.setTitle(url);
  -                    }
  +                    profiledNode.setUrl(profiledPath);
  +                }
  +                if (profiledNode.getPath().equals(profiledNode.getTitle()))
  +                {
  +                    profiledNode.setTitle(profiledPath);
                   }
               }
           }
  @@ -1000,14 +1062,14 @@
           if (path != null)
           {
               // find last property pair folders in path
  -            int contentPathIndex = path.lastIndexOf("/" + PROFILE_PROPERTY_FOLDER_PREFIX);
  +            int contentPathIndex = path.lastIndexOf(Folder.PATH_SEPARATOR + PROFILE_PROPERTY_FOLDER_PREFIX);
               // advance past last property pair folders to base path
               if (contentPathIndex != -1)
               {
  -                contentPathIndex = path.indexOf("/", contentPathIndex+1);
  +                contentPathIndex = path.indexOf(Folder.PATH_SEPARATOR, contentPathIndex+1);
                   if (contentPathIndex != -1)
                   {
  -                    contentPathIndex = path.indexOf("/", contentPathIndex+1);
  +                    contentPathIndex = path.indexOf(Folder.PATH_SEPARATOR, contentPathIndex+1);
                       // strip property pairs from base path
                       if (contentPathIndex != -1)
                       {
  @@ -1015,7 +1077,7 @@
                       }
                       else
                       {
  -                        path = "/";
  +                        path = Folder.PATH_SEPARATOR;
                       }
                   }
               }
  @@ -1023,47 +1085,44 @@
           return path;
       }
   
  -    private NodeSetImpl addUniqueOrDescribedUrlNode(NodeSetImpl set, Node node)
  +    private NodeSetImpl addUniqueOrDescribedUrlNode(NodeSetImpl set, AbstractNode node)
       {
  -        // add node to node set only if url set
  -        if (node.getUrl() == null)
  +        // add node to node set only if profiled path set
  +        if (node.getProfiledPath() == null)
               return set;
   
  -        // add node to node set if is a link, has a unique url,
  +        // add node to node set if has a unique profiled path
           // or has metadata and entry in set does not; returns
           // new set if replace required
  -        if (! (node instanceof Link))
  +        Iterator setIter = set.iterator();
  +        while (setIter.hasNext())
           {
  -            Iterator setIter = set.iterator();
  -            while (setIter.hasNext())
  +            AbstractNode setNode = (AbstractNode) setIter.next();
  +            if (node.getProfiledPath().equals(setNode.getProfiledPath()))
               {
  -                Node setNode = (Node) setIter.next();
  -                if (node.getUrl().equals(setNode.getUrl()))
  +                // replace placeholder with described node
  +                if ((node.getMetadata() != null) && (setNode.getMetadata() == null))
                   {
  -                    // replace placeholder with described node
  -                    if ((node.getMetadata() != null) && (setNode.getMetadata() == null))
  +                    // cannot remove from NodeSet: copy to replace setNode and return new set
  +                    NodeSetImpl newSet = new NodeSetImpl(null, set.getComparator());
  +                    Iterator copyIter = set.iterator();
  +                    while (copyIter.hasNext())
                       {
  -                        // cannot remove from NodeSet: copy to replace setNode and return new set
  -                        NodeSetImpl newSet = new NodeSetImpl(null, set.getComparator());
  -                        Iterator copyIter = set.iterator();
  -                        while (copyIter.hasNext())
  +                        Node copyNode = (Node) copyIter.next();
  +                        if (copyNode != setNode)
                           {
  -                            Node copyNode = (Node) copyIter.next();
  -                            if (copyNode != setNode)
  -                            {
  -                                newSet.add(copyNode);
  -                            }
  -                            else
  -                            {
  -                                newSet.add(node);
  -                            }
  +                            newSet.add(copyNode);
  +                        }
  +                        else
  +                        {
  +                            newSet.add(node);
                           }
  -                        return newSet;
                       }
  -                    
  -                    // skip duplicate node
  -                    return set;
  +                    return newSet;
                   }
  +                
  +                // skip duplicate node
  +                return set;
               }
           }
   
  @@ -1085,13 +1144,13 @@
           {
               // compare names of links against order or each other by default
               String name1 = rootLink1.toString();
  -            int nameIndex1 = name1.lastIndexOf('/');
  +            int nameIndex1 = name1.lastIndexOf(Folder.PATH_SEPARATOR_CHAR);
               if (nameIndex1 != -1)
               {
                   name1 = name1.substring(nameIndex1 + 1);
               }
               String name2 = rootLink2.toString();
  -            int nameIndex2 = name2.lastIndexOf('/');
  +            int nameIndex2 = name2.lastIndexOf(Folder.PATH_SEPARATOR_CHAR);
               if (nameIndex2 != -1)
               {
                   name2 = name2.substring(nameIndex2 + 1);
  @@ -1155,7 +1214,7 @@
               {
                   Iterator pathNodesIter = filterDocumentSet(getNodes(path, regexp, null)).iterator();
                   while (pathNodesIter.hasNext())
  -                    expandedNodes.add((Node) pathNodesIter.next());
  +                    expandedNodes.add((AbstractNode) pathNodesIter.next());
               }
               catch (NodeException ne)
               {
  @@ -1169,11 +1228,11 @@
           // force relative paths to be root absolute
           if (path == null)
           {
  -            path = "/";
  +            path = Folder.PATH_SEPARATOR;
           }
  -        else if (! path.startsWith("/"))
  +        else if (! path.startsWith(Folder.PATH_SEPARATOR))
           {
  -            path = "/" + path;
  +            path = Folder.PATH_SEPARATOR + path;
           }
           return path;
       }
  @@ -1205,7 +1264,7 @@
           Iterator setIter = set.iterator();
           while (!filterRequired && setIter.hasNext())
           {
  -            Node node = (Node) setIter.next();
  +            AbstractNode node = (AbstractNode) setIter.next();
               filterRequired = (! (node instanceof Page) && ! (node instanceof Folder) && ! (node instanceof Link));
           }
           if (! filterRequired)
  @@ -1218,7 +1277,7 @@
           setIter = set.iterator();
           while (setIter.hasNext())
           {
  -            Node node = (Node) setIter.next();
  +            AbstractNode node = (AbstractNode) setIter.next();
               if ((node instanceof Page) || (node instanceof Folder) || (node instanceof Link))
               {
                   filteredSet.add(node);
  @@ -1355,14 +1414,14 @@
   
       protected Node addParent( Node childNode, String nodePath ) throws NodeException, InvalidFolderException
       {
  -        int lastSlash = nodePath.indexOf("/");
  +        int lastSlash = nodePath.indexOf(Folder.PATH_SEPARATOR);
           if (lastSlash > -1)
           {
               childNode.setParent(folderHandler.getFolder(nodePath.substring(0, lastSlash)));
           }
           else
           {
  -            childNode.setParent(folderHandler.getFolder("/"));
  +            childNode.setParent(folderHandler.getFolder(Folder.PATH_SEPARATOR));
           }
   
           return childNode;
  
  
  
  1.6       +21 -3     jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/impl/AbstractPageManager.java
  
  Index: AbstractPageManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/page-manager/src/java/org/apache/jetspeed/page/impl/AbstractPageManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractPageManager.java	15 Oct 2004 06:57:50 -0000	1.5
  +++ AbstractPageManager.java	21 Oct 2004 02:28:07 -0000	1.6
  @@ -15,6 +15,7 @@
    */
   package org.apache.jetspeed.page.impl;
   
  +import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  @@ -206,7 +207,7 @@
                   {
                       DocumentSet debug = (DocumentSet) debugIter.next();
                       NodeSet debugNodes = (NodeSet) documentSetNodeSets.get(debug);
  -                    String debugMessage = "document set " + debug.getDocumentSetName() + " = {";
  +                    String debugMessage = "document set " + debug + " = {";
                       Iterator nodesIter = debugNodes.iterator();
                       if (nodesIter.hasNext())
                       {
  @@ -237,8 +238,9 @@
               while (documentSetIter.hasNext())
               {
                   DocumentSet documentSet = (DocumentSet) documentSetIter.next();
  +                String documentSetName = documentSet.getUrl();
                   NodeSet documentSetNodes = (NodeSet) documentSetNodeSets.get(documentSet);
  -                pageContext.setDocumentSet(documentSet.getDocumentSetName(), documentSet, documentSetNodes);
  +                pageContext.setDocumentSet(documentSetName, documentSet, documentSetNodes);
               }
           }
       }
  @@ -264,6 +266,22 @@
       {
           // select page profile locator from session/principal profile locators
           return (ProfileLocator) profileLocators.get(ProfileLocator.PAGE_LOCATOR);
  +    }
  +
  +    protected List selectAlternatePageProfileLocators(Map profileLocators)
  +    {
  +        // select alternate page profile locators from session/principal profile locators
  +        List locators = new ArrayList(4);
  +        Iterator locatorsIter = profileLocators.entrySet().iterator();
  +        while (locatorsIter.hasNext())
  +        {
  +            Map.Entry locatorEntry = (Map.Entry) locatorsIter.next();
  +            if (! ((String) locatorEntry.getKey()).equals(ProfileLocator.PAGE_LOCATOR))
  +            {
  +                locators.add(locatorEntry.getValue());
  +            }
  +        }
  +        return locators;
       }
   
       protected ProfileLocator selectNavigationProfileLocator(String profileLocatorName, Map profileLocators)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message