taylor 2004/10/15 00:07:50 Modified: jetspeed-api/src/java/org/apache/jetspeed/profiler ProfiledPageContext.java ProfileLocator.java Profiler.java jetspeed-api/src/java/org/apache/jetspeed/page/document NodeSet.java FolderHandler.java jetspeed-api/src/java/org/apache/jetspeed/request RequestContext.java jetspeed-api/src/java/org/apache/jetspeed/page PageManager.java jetspeed-api/src/java/org/apache/jetspeed/om/folder Folder.java jetspeed-api/src/java/org/apache/jetspeed/mockobjects/request MockRequestContext.java Added: jetspeed-api/src/java/org/apache/jetspeed/om/folder DocumentSet.java DocumentSetPath.java Log: patch from Randy Watler additions to the api to support 1 or more locators when profiling, and docset model Revision Changes Path 1.2 +50 -6 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/profiler/ProfiledPageContext.java Index: ProfiledPageContext.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/profiler/ProfiledPageContext.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ProfiledPageContext.java 17 Sep 2004 20:06:53 -0000 1.1 +++ ProfiledPageContext.java 15 Oct 2004 07:07:49 -0000 1.2 @@ -15,6 +15,10 @@ */ package org.apache.jetspeed.profiler; +import java.util.Iterator; +import java.util.Map; + +import org.apache.jetspeed.om.folder.DocumentSet; import org.apache.jetspeed.om.folder.Folder; import org.apache.jetspeed.om.page.Page; import org.apache.jetspeed.page.document.NodeSet; @@ -33,16 +37,17 @@ * Initialize this page context. * * @param profiler The profiler initializing this page context. - * @param locator The profile locator used to create this page context. + * @param locators The map of profile locators by locator name + * used to create this page context. */ - void init(Profiler profiler, ProfileLocator locator); + void init(Profiler profiler, Map locators); /** - * Return ProfileLocator used to generate this page context. + * Return Map of ProfileLocator instances used to generate this page context. * - * @return The ProfileLocator instance. + * @return The Map of ProfileLocator instances by locator name. */ - ProfileLocator getLocator(); + Map getLocators(); /** * Return profiled Page. @@ -141,4 +146,43 @@ * @param links The root Link set. */ void setRootLinks(NodeSet links); + + /** + * Return profiled document set used for menu navigation. The + * returned value may or may not be equivalent to the result of + * accessing documents relative to other documents returned as part + * of this profiled context. + * + * @param name The name of the document set. + * @return The document set. + */ + DocumentSet getDocumentSet(String name); + + /** + * Return profiled document set used for menu navigation. This is + * a set of folders and documents defined by the document set + * related to the profiled page. The returned values may or may not + * be equivalent to the result of accessing documents relative to + * other documents returned as part of this profiled context. + * + * @param name The name of the document set. + * @return The expanded document set nodes. + */ + NodeSet getDocumentSetNodes(String name); + + /** + * Return profiled document set names. + * + * @return An iterator over document set names. + */ + Iterator getDocumentSetNames(); + + /** + * Set a named document set and expanded nodes. + * + * @param name The name of the document set. + * @param documentSet The document set. + * @param nodes The expanded document set nodes. + */ + void setDocumentSet(String name, DocumentSet documentSet, NodeSet nodes); } 1.5 +1 -9 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/profiler/ProfileLocator.java Index: ProfileLocator.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/profiler/ProfileLocator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ProfileLocator.java 8 Oct 2004 06:49:37 -0000 1.4 +++ ProfileLocator.java 15 Oct 2004 07:07:49 -0000 1.5 @@ -153,12 +153,4 @@ * @return The request path. */ String getRequestPath(); - - /** - * Creates a new ProfiledPageContext object that can be - * managed by the current Profiler implementation - * - * @return A new ProfiledPageContext object - */ - ProfiledPageContext createProfiledPageContext(); } 1.10 +3 -3 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/profiler/Profiler.java Index: Profiler.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/profiler/Profiler.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Profiler.java 9 Oct 2004 05:23:43 -0000 1.9 +++ Profiler.java 15 Oct 2004 07:07:49 -0000 1.10 @@ -73,10 +73,10 @@ * the specified locator and can be managed by the current * Profiler implementation * - * @param locator ProfileLocator object used to select page + * @param locators Map of ProfileLocator objects used to select page * @return A new ProfiledPageContext object */ - ProfiledPageContext createProfiledPageContext(ProfileLocator locator); + ProfiledPageContext createProfiledPageContext(Map locators); /** * For a given principal, lookup the associated profiling rule to that principal name. 1.3 +2 -2 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/NodeSet.java Index: NodeSet.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/NodeSet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- NodeSet.java 9 Sep 2004 19:04:02 -0000 1.2 +++ NodeSet.java 15 Oct 2004 07:07:49 -0000 1.3 @@ -50,7 +50,7 @@ Iterator iterator(); NodeSet subset(String type); - + NodeSet inclusiveSubset(String regex); NodeSet exclusiveSubset(String regex); 1.2 +23 -1 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java Index: FolderHandler.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/document/FolderHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FolderHandler.java 3 Sep 2004 13:24:05 -0000 1.1 +++ FolderHandler.java 15 Oct 2004 07:07:49 -0000 1.2 @@ -107,4 +107,26 @@ String[] listAll(String folderPath) throws FolderNotFoundException; + /** + * <p> + * getNodes + * </p> + * <p> + * Returns a set of nodes relative to the <code>folder</code> argument of the type + * indicated by the <code>documentType</code> argument. The <code>folder</code> argument + * may include regular expressions if indicated by the <code>regex</code> argument. The + * returned set is unordered. + * </p> + * + * @param path Path from which to locate documents + * @param regexp Flag indicating whether regexp should be expanded in path + * @param documentType document type to filter on. + * @return NodeSet of documents and folders located under the <code>path</code> argument. + * @throws FolderNotFoundException if folder under the <code>path</code> does not actually exist. + * @throws DocumentException if an error is encountered reading the folders. + * @throws InvalidFolderException + * @throws NodeException + */ + NodeSet getNodes(String path, boolean regexp, String documentType) throws FolderNotFoundException, InvalidFolderException, NodeException; + } 1.10 +7 -8 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/request/RequestContext.java Index: RequestContext.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/request/RequestContext.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- RequestContext.java 24 Aug 2004 14:17:48 -0000 1.9 +++ RequestContext.java 15 Oct 2004 07:07:49 -0000 1.10 @@ -27,7 +27,6 @@ import org.apache.jetspeed.capabilities.CapabilityMap; import org.apache.jetspeed.container.session.NavigationalState; import org.apache.jetspeed.container.url.PortalURL; -import org.apache.jetspeed.profiler.ProfileLocator; import org.apache.jetspeed.om.page.Page; import org.apache.pluto.om.common.Language; @@ -75,18 +74,18 @@ public ServletConfig getConfig(); /** - * Gets the profile locator for this request + * Gets the profile locators for this request * - * @return Profile + * @return Profile locators by locator name */ - public ProfileLocator getProfileLocator(); + public Map getProfileLocators(); /** - * Sets the target page profile for this request + * Sets the target page profile locators for this request * - * @param profile The target profile + * @param locators The target profile locators by locator name */ - public void setProfileLocator(ProfileLocator locator); + public void setProfileLocators(Map locators); /** * Gets the target page for this request 1.8 +41 -29 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java Index: PageManager.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/page/PageManager.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- PageManager.java 17 Sep 2004 20:06:53 -0000 1.7 +++ PageManager.java 15 Oct 2004 07:07:49 -0000 1.8 @@ -16,7 +16,10 @@ package org.apache.jetspeed.page; +import java.util.Map; + import org.apache.jetspeed.exception.JetspeedException; +import org.apache.jetspeed.om.folder.DocumentSet; import org.apache.jetspeed.om.folder.Folder; import org.apache.jetspeed.om.folder.FolderNotFoundException; import org.apache.jetspeed.om.folder.InvalidFolderException; @@ -26,6 +29,7 @@ import org.apache.jetspeed.om.page.Property; import org.apache.jetspeed.page.document.DocumentException; import org.apache.jetspeed.page.document.DocumentNotFoundException; +import org.apache.jetspeed.page.document.FailedToDeleteDocumentException; import org.apache.jetspeed.page.document.NodeException; import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException; import org.apache.jetspeed.profiler.ProfiledPageContext; @@ -42,7 +46,6 @@ /** The name of the service */ public String SERVICE_NAME = "PageManager"; - /** * Creates a new empty Page instance * @@ -78,7 +81,33 @@ */ public Page getPage(String id) throws PageNotFoundException, NodeException; + /** + * + * <p> + * getLink + * </p> + * + * Returns a Link document for the given path + * + * @param name The path of the document to be retrieved. + * @throws PageNotFoundException if the page cannot be found + * @throws NodeException + */ public Link getLink(String name) throws DocumentNotFoundException, UnsupportedDocumentTypeException, FolderNotFoundException, NodeException; + + /** + * + * <p> + * getDocumentSet + * </p> + * + * Returns a DocumentSet document for the given path + * + * @param name The path of the document to be retrieved. + * @throws PageNotFoundException if the page cannot be found + * @throws NodeException + */ + public DocumentSet getDocumentSet(String name) throws DocumentNotFoundException, UnsupportedDocumentTypeException, FolderNotFoundException, NodeException; /** * @@ -97,53 +126,36 @@ Folder getFolder(String folderPath) throws FolderNotFoundException, InvalidFolderException, NodeException; /** - * - * <p> - * getProfiledPageContext - * </p> - * - * @param locator - * @return profiled page context - * @throws PageNotFoundException if the page cannot be found. - * @throws DocumentException - * @throws NodeException - */ - public ProfiledPageContext getProfiledPageContext(ProfileLocator locator) throws PageNotFoundException, DocumentException, NodeException; - - /** - * * <p> - * getPage + * Compute profiled page context elements based on named profile + * locators associated with a session/principal in supplied + * context instance. * </p> * - * @param locator - * @return located Page instance + * @param page * @throws PageNotFoundException if the page cannot be found. * @throws DocumentException * @throws NodeException */ - public Page getPage(ProfileLocator locator) throws PageNotFoundException, DocumentException, NodeException; + public void computeProfiledPageContext(ProfiledPageContext pageContext) throws PageNotFoundException, DocumentException, NodeException; - /** Store the PSML document on disk, using its locator + /** Store the page on disk * - * @param profile the profile locator description. - * @return true if the operation succeeded + * @param page The page to be stored. */ public void registerPage(Page page) throws JetspeedException; /** Update a page in persistent storage * - * @param locator The description of the profile to be removed. + * @param page The page to be updated. */ public void updatePage(Page page) throws JetspeedException, PageNotUpdatedException; /** Remove a document. * - * @param locator The description of the profile to be removed. - * @throws UnsupportedDocumentTypeException - * @throws FailedToDeleteDocumentException - * @throws DocumentNotFoundException + * @param page The page to be removed. */ + public void removePage(Page page) throws JetspeedException, PageNotRemovedException; } 1.6 +13 -1 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java Index: Folder.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/om/folder/Folder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Folder.java 3 Sep 2004 13:24:05 -0000 1.5 +++ Folder.java 15 Oct 2004 07:07:49 -0000 1.6 @@ -128,6 +128,18 @@ /** * * <p> + * getDocumentSets + * </p> + * + * @return + * @throws DocumentException + * @throws NodeException + */ + NodeSet getDocumentSets() throws NodeException; + + /** + * + * <p> * getAllNodes * </p> * 1.1 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/om/folder/DocumentSet.java Index: DocumentSet.java =================================================================== /* * Copyright 2000-2001,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; import java.util.Vector; import org.apache.jetspeed.om.page.Document; /** * <p> * DocumentSet objects used to specify unstructured/logical navigation folders. * </p> * * @author <a href="mailto:[EMAIL PROTECTED]">Randy Watler</a> * @version $Id: DocumentSet.java,v 1.1 2004/10/15 07:07:49 taylor Exp $ * */ public interface DocumentSet extends Document { String DOCUMENT_TYPE = ".ds"; String getDocumentSetName(); void setDocumentSetName(String setName); String getProfileLocatorName(); void setProfileLocatorName(String locatorName); Vector getDocumentPaths(); void setDocumentPaths(Vector paths); Vector getDefaultedDocumentPaths(); } 1.1 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/om/folder/DocumentSetPath.java Index: DocumentSetPath.java =================================================================== /* * Copyright 2000-2001,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; /** * <p> * DocumentSetPath objects used to specify paths within DocumentSet. * </p> * * @author <a href="mailto:[EMAIL PROTECTED]">Randy Watler</a> * @version $Id: DocumentSetPath.java,v 1.1 2004/10/15 07:07:49 taylor Exp $ * */ public interface DocumentSetPath { String getPath(); void setPath(String path); boolean isRegexp(); void setRegexp(boolean regexp); } 1.4 +8 -9 jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/mockobjects/request/MockRequestContext.java Index: MockRequestContext.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/mockobjects/request/MockRequestContext.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- MockRequestContext.java 18 Aug 2004 13:55:57 -0000 1.3 +++ MockRequestContext.java 15 Oct 2004 07:07:49 -0000 1.4 @@ -30,7 +30,6 @@ import org.apache.jetspeed.container.url.PortalURL; import org.apache.jetspeed.mockobjects.MockHttpServletRequest; import org.apache.jetspeed.om.page.Page; -import org.apache.jetspeed.profiler.ProfileLocator; import org.apache.jetspeed.request.RequestContext; import org.apache.pluto.om.common.Language; import org.apache.pluto.om.common.ObjectID; @@ -52,7 +51,7 @@ private Map requestAttributes = new HashMap(); private Map sessionAttributes = new HashMap(); private String path; - private ProfileLocator locator; + private Map locators; private Subject subject; private Locale locale; private String mediaType; @@ -214,11 +213,11 @@ /* * (non-Javadoc) * - * @see org.apache.jetspeed.request.RequestContext#getProfileLocator() + * @see org.apache.jetspeed.request.RequestContext#getProfileLocators() */ - public ProfileLocator getProfileLocator() + public Map getProfileLocators() { - return locator; + return locators; } /* @@ -366,11 +365,11 @@ /* * (non-Javadoc) * - * @see org.apache.jetspeed.request.RequestContext#setProfileLocator(org.apache.jetspeed.profiler.ProfileLocator) + * @see org.apache.jetspeed.request.RequestContext#setProfileLocators(java.util.Map) */ - public void setProfileLocator( ProfileLocator locator ) + public void setProfileLocators( Map locators ) { - this.locator = locator; + this.locators = locators; } @@ -485,4 +484,4 @@ // TODO Auto-generated method stub } -} \ No newline at end of file +}
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]