portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r1577983 [1/2] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/om/folder/proxy/ components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/ components/jetsp...
Date Sun, 16 Mar 2014 05:00:08 GMT
Author: rwatler
Date: Sun Mar 16 05:00:07 2014
New Revision: 1577983

URL: http://svn.apache.org/r1577983
Log:
JS2-874: PortalSite generics propagation.

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/NodeProxy.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/NodeSetImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/MenuImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteRequestContextImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/menu/StandardNavigationsMenuDefinition.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/AbstractSiteView.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/PhysicalSiteView.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SearchPathsSiteView.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SearchPathsSiteViewProxy.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/SiteViewUtils.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/java/org/apache/jetspeed/portalsite/TestPortalSite.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteRequestContext.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/portalsite/PortalSiteSessionContext.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java?rev=1577983&r1=1577982&r2=1577983&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/om/folder/proxy/FolderProxy.java Sun Mar 16 05:00:07 2014
@@ -16,17 +16,6 @@
  */
 package org.apache.jetspeed.om.folder.proxy;
 
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.page.DynamicPage;
@@ -53,6 +42,17 @@ import org.apache.jetspeed.page.document
 import org.apache.jetspeed.portalsite.view.SearchPathsSiteView;
 import org.apache.jetspeed.portalsite.view.SiteViewSearchPath;
 
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
 /**
  * This class proxies PSML Folder instances to create a logical view
  * of site content using the Dynamic Proxy pattern.
@@ -193,7 +193,7 @@ public class FolderProxy extends NodePro
      * searchFolders - search folder objects along view search paths
      *                 in most to least specific order
      */
-    private List searchFolders;
+    private List<SearchFolder> searchFolders;
 
     /**
      * InheritanceFolder - data object used hold aggregated concrete search
@@ -215,7 +215,7 @@ public class FolderProxy extends NodePro
      * inheritanceFolders - inheritance graph folder list in most to
      *                      least specific order
      */
-    private List inheritanceFolders;
+    private List<InheritanceFolder> inheritanceFolders;
         
     /**
      * newInstance - creates a new proxy instance that implements the Folder interface
@@ -260,125 +260,125 @@ public class FolderProxy extends NodePro
      * @param args method arguments
      * @throws Throwable
      */
-    public Object invoke(Object proxy, Method m, Object [] args) throws Throwable
+    public Object invoke(Object proxy, Method method, Object [] args) throws Throwable
     {
         // proxy implementation method dispatch
-        if (m.equals(GET_ALL_METHOD))
+        if (method.equals(GET_ALL_METHOD))
         {
             return getAll(proxy);
         }
-        else if (m.equals(GET_DEFAULT_PAGE_METHOD))
+        else if (method.equals(GET_DEFAULT_PAGE_METHOD))
         {
             return getDefaultPage(proxy);
         }
-        else if (m.equals(GET_DYNAMIC_PAGES_METHOD))
+        else if (method.equals(GET_DYNAMIC_PAGES_METHOD))
         {
             return getDynamicPages(proxy);
         }
-        else if (m.equals(GET_DYNAMIC_PAGE_METHOD))
+        else if (method.equals(GET_DYNAMIC_PAGE_METHOD))
         {
             return getDynamicPage(proxy, (String)args[0]);
         }
-        else if (m.equals(GET_FOLDERS_METHOD))
+        else if (method.equals(GET_FOLDERS_METHOD))
         {
             return getFolders(proxy);
         }
-        else if (m.equals(GET_FOLDER_METHOD))
+        else if (method.equals(GET_FOLDER_METHOD))
         {
             return getFolder(proxy, (String)args[0]);
         }
-        else if (m.equals(GET_FRAGMENT_DEFINITIONS_METHOD))
+        else if (method.equals(GET_FRAGMENT_DEFINITIONS_METHOD))
         {
             return getFragmentDefinitions(proxy);
         }
-        else if (m.equals(GET_FRAGMENT_DEFINITION_METHOD))
+        else if (method.equals(GET_FRAGMENT_DEFINITION_METHOD))
         {
             return getFragmentDefinition(proxy, (String)args[0]);
         }
-        else if (m.equals(GET_LINKS_METHOD))
+        else if (method.equals(GET_LINKS_METHOD))
         {
             return getLinks(proxy);
         }
-        else if (m.equals(GET_LINK_METHOD))
+        else if (method.equals(GET_LINK_METHOD))
         {
             return getLink(proxy, (String)args[0]);
         }
-        else if (m.equals(GET_MENU_DEFINITIONS_METHOD))
+        else if (method.equals(GET_MENU_DEFINITIONS_METHOD))
         {
             return getMenuDefinitions();
         }
-        else if (m.equals(GET_METADATA_METHOD))
+        else if (method.equals(GET_METADATA_METHOD))
         {
             return getMetadata();
         }
-        else if (m.equals(GET_NAME_METHOD))
+        else if (method.equals(GET_NAME_METHOD))
         {
             return getName();
         }
-        else if (m.equals(GET_PAGES_METHOD))
+        else if (method.equals(GET_PAGES_METHOD))
         {
             return getPages(proxy);
         }
-        else if (m.equals(GET_PAGE_METHOD))
+        else if (method.equals(GET_PAGE_METHOD))
         {
             return getPage(proxy, (String)args[0]);
         }
-        else if (m.equals(GET_PAGE_TEMPLATES_METHOD))
+        else if (method.equals(GET_PAGE_TEMPLATES_METHOD))
         {
             return getPageTemplates(proxy);
         }
-        else if (m.equals(GET_PAGE_TEMPLATE_METHOD))
+        else if (method.equals(GET_PAGE_TEMPLATE_METHOD))
         {
             return getPageTemplate(proxy, (String)args[0]);
         }
-        else if (m.equals(GET_SHORT_TITLE_LOCALE_METHOD))
+        else if (method.equals(GET_SHORT_TITLE_LOCALE_METHOD))
         {
             return getShortTitle((Locale)args[0]);
         }
-        else if (m.equals(GET_SHORT_TITLE_METHOD))
+        else if (method.equals(GET_SHORT_TITLE_METHOD))
         {
             return getShortTitle();
         }
-        else if (m.equals(GET_TITLE_LOCALE_METHOD))
+        else if (method.equals(GET_TITLE_LOCALE_METHOD))
         {
             return getTitle((Locale)args[0]);
         }
-        else if (m.equals(GET_TITLE_METHOD))
+        else if (method.equals(GET_TITLE_METHOD))
         {
             return getTitle();
         }
-        else if (m.equals(GET_PARENT_METHOD))
+        else if (method.equals(GET_PARENT_METHOD))
         {
             return getParent();
         }
-        else if (m.equals(GET_PATH_METHOD))
+        else if (method.equals(GET_PATH_METHOD))
         {
             return getPath();
         }
-        else if (m.equals(GET_URL_METHOD))
+        else if (method.equals(GET_URL_METHOD))
         {
             return getUrl();
         }
-        else if (m.equals(EQUALS_METHOD))
+        else if (method.equals(EQUALS_METHOD))
         {
             return new Boolean(equals(args[0]));
         }
-        else if (m.equals(HASH_CODE_METHOD))
+        else if (method.equals(HASH_CODE_METHOD))
         {
             return new Integer(hashCode());
         }
-        else if (m.equals(IS_HIDDEN_METHOD))
+        else if (method.equals(IS_HIDDEN_METHOD))
         {
             return new Boolean(isHidden());
         }
-        else if (m.equals(TO_STRING_METHOD))
+        else if (method.equals(TO_STRING_METHOD))
         {
             return toString();
         }
     
         // proxy suppression of not implemented or mutable methods
-        if (m.equals(GET_PAGE_SECURITY_METHOD) ||
-            m.getName().startsWith("set"))
+        if (method.equals(GET_PAGE_SECURITY_METHOD) ||
+            method.getName().startsWith("set"))
         {
             throw new RuntimeException("Folder instance is immutable from proxy.");
         }
@@ -386,7 +386,7 @@ public class FolderProxy extends NodePro
         try
         {
             // attempt to invoke method on delegate Folder instance
-            return m.invoke(defaultFolderReference.getFolder(), args);
+            return method.invoke(defaultFolderReference.getFolder(), args);
         }
         catch (InvocationTargetException ite)
         {
@@ -1092,8 +1092,8 @@ public class FolderProxy extends NodePro
         try
         {
             // get children proxies
-            List allChildren = new ArrayList();
-            List folderDocumentOrder = null;
+            List<Node> allChildren = new ArrayList<Node>();
+            List<String> folderDocumentOrder = null;
             Iterator foldersIter = getSearchFolders().iterator();
             while (foldersIter.hasNext())
             {
@@ -1160,7 +1160,7 @@ public class FolderProxy extends NodePro
                 // capture most specific document ordering
                 if (folderDocumentOrder == null)
                 {
-                    List documentOrder = folder.getDocumentOrder();
+                    List<String> documentOrder = folder.getDocumentOrder();
                     if ((documentOrder != null) && !documentOrder.isEmpty()) 
                     {
                         folderDocumentOrder = documentOrder;
@@ -1173,13 +1173,13 @@ public class FolderProxy extends NodePro
             if (allChildren.size() > 1)
             {
                 final List order = folderDocumentOrder;
-                Comparator comparator = new Comparator()
+                Comparator<Node> comparator = new Comparator<Node>()
                     {
-                        public int compare(Object proxyNode1, Object proxyNode2)
+                        public int compare(Node proxyNode1, Node proxyNode2)
                         {
                             // compare names of nodes against order or each other by default
-                            String name1 = ((Node)proxyNode1).getName();
-                            String name2 = ((Node)proxyNode2).getName();
+                            String name1 = proxyNode1.getName();
+                            String name2 = proxyNode2.getName();
                             if (order != null)
                             {
                                 // compare names against order
@@ -1233,8 +1233,8 @@ public class FolderProxy extends NodePro
         if (searchFolders == null)
         {
             // search for existing folders along search paths
-            List searchPaths = getView().getSearchPaths();
-            searchFolders = new ArrayList(searchPaths.size());
+            List<SiteViewSearchPath> searchPaths = getView().getSearchPaths();
+            searchFolders = new ArrayList<SearchFolder>(searchPaths.size());
             Iterator pathsIter = searchPaths.iterator();
             while (pathsIter.hasNext())
             {
@@ -1303,11 +1303,11 @@ public class FolderProxy extends NodePro
             List searchFolders = folder.getSearchFolders();
             if (getParent() != null)
             {
-                inheritanceFolders = new ArrayList(searchFolders.size() * 2);
+                inheritanceFolders = new ArrayList<InheritanceFolder>(searchFolders.size() * 2);
             }
             else
             {
-                inheritanceFolders = new ArrayList(searchFolders.size());
+                inheritanceFolders = new ArrayList<InheritanceFolder>(searchFolders.size());
             }        
             do
             {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/NodeProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/NodeProxy.java?rev=1577983&r1=1577982&r2=1577983&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/NodeProxy.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/NodeProxy.java Sun Mar 16 05:00:07 2014
@@ -16,6 +16,14 @@
  */
 package org.apache.jetspeed.page.document.proxy;
 
+import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.om.folder.MenuDefinition;
+import org.apache.jetspeed.page.document.Node;
+import org.apache.jetspeed.portalsite.view.SearchPathsSiteView;
+import org.apache.jetspeed.portalsite.view.SearchPathsSiteViewProxy;
+import org.apache.jetspeed.portalsite.view.SiteViewMenuDefinitionLocator;
+import org.apache.jetspeed.portalsite.view.SiteViewUtils;
+
 import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
@@ -25,13 +33,6 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.jetspeed.om.folder.Folder;
-import org.apache.jetspeed.page.document.Node;
-import org.apache.jetspeed.portalsite.view.SearchPathsSiteView;
-import org.apache.jetspeed.portalsite.view.SiteViewMenuDefinitionLocator;
-import org.apache.jetspeed.portalsite.view.SearchPathsSiteViewProxy;
-import org.apache.jetspeed.portalsite.view.SiteViewUtils;
-
 /**
  * This class proxies Node instances to create a logical
  * view of site content.
@@ -81,7 +82,7 @@ public abstract class NodeProxy extends 
      * menuDefinitionLocators - menu definitions aggregated by name saved in
      *                          menu definition locators
      */
-    private List menuDefinitionLocators;
+    private List<SiteViewMenuDefinitionLocator> menuDefinitionLocators;
 
     /**
      * menuDefinitionLocatorsAggregated - boolean flag to indicate
@@ -92,7 +93,7 @@ public abstract class NodeProxy extends 
     /**
      * menuDefinitions - menu definitions aggregated by name
      */
-    private List menuDefinitions;
+    private List<MenuDefinition> menuDefinitions;
 
     /**
      * menuDefinitionsAggregated - boolean flag to indicate menuDefinitions
@@ -199,7 +200,7 @@ public abstract class NodeProxy extends 
      *
      * @return definition list
      */
-    public List getMenuDefinitions()
+    public List<MenuDefinition> getMenuDefinitions()
     {
         // get menu definitions aggregated by name from
         // aggregated menu definition locators
@@ -208,7 +209,7 @@ public abstract class NodeProxy extends 
             List locators = getMenuDefinitionLocators();
             if (locators != null)
             {
-                menuDefinitions = Collections.synchronizedList(new ArrayList(locators.size()));
+                menuDefinitions = Collections.synchronizedList(new ArrayList<MenuDefinition>(locators.size()));
                 Iterator locatorsIter = locators.iterator();
                 while (locatorsIter.hasNext())
                 {
@@ -226,7 +227,7 @@ public abstract class NodeProxy extends 
      *
      * @return definition locator list
      */
-    public List getMenuDefinitionLocators()
+    public List<SiteViewMenuDefinitionLocator> getMenuDefinitionLocators()
     {
         // get menu definition locators aggregated by name
         if (! menuDefinitionLocatorsAggregated)
@@ -242,12 +243,12 @@ public abstract class NodeProxy extends 
      *                               to be used by derived implementations to aggregate
      *                               menu definition locators
      *
-     * @param locators list of menu definition locators to merge
+     * @param definitions list of menu definitions to merge
      * @param definitionNode menu definition node
      * @param path menu definition path
      * @param override override menu definition
      */
-    public void mergeMenuDefinitionLocators(List definitions, Node definitionNode, String path, boolean override)
+    public void mergeMenuDefinitionLocators(List<MenuDefinition> definitions, Node definitionNode, String path, boolean override)
     {
         // merge definitions into aggregated menu definition
         // locators if defined
@@ -261,7 +262,7 @@ public abstract class NodeProxy extends 
      *
      * @param locators list of menu definition locators to merge
      */
-    public void mergeMenuDefinitionLocators(List locators)
+    public void mergeMenuDefinitionLocators(List<SiteViewMenuDefinitionLocator> locators)
     {
         // merge locators into aggregated menu definition
         // locators if defined

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/NodeSetImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/NodeSetImpl.java?rev=1577983&r1=1577982&r2=1577983&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/NodeSetImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/page/document/proxy/NodeSetImpl.java Sun Mar 16 05:00:07 2014
@@ -16,14 +16,14 @@
  */
 package org.apache.jetspeed.page.document.proxy;
 
+import org.apache.jetspeed.page.document.Node;
+import org.apache.jetspeed.page.document.NodeSet;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.regex.Pattern;
 
-import org.apache.jetspeed.page.document.Node;
-import org.apache.jetspeed.page.document.NodeSet;
-
 /**
  * This class implements generic NodeSet ordered lists
  * used with proxied instances of PSML Folders to create a
@@ -37,14 +37,14 @@ public class NodeSetImpl implements Node
     /**
      * nodes - list of proxy nodes
      */
-    private List nodes;
+    private List<Node> nodes;
 
     /**
      * NodeSetImpl - construct immutable proxy Node NodeSet list
      *
      * @param nodes list of proxy Nodes
      */
-    public NodeSetImpl(List nodes)
+    public NodeSetImpl(List<Node> nodes)
     {
         this.nodes = nodes;
     }
@@ -90,7 +90,7 @@ public class NodeSetImpl implements Node
     public NodeSet subset(String type)
     {
         // search for matching nodes
-        List subsetNodes = null;
+        List<Node> subsetNodes = null;
         Iterator nodesIter = nodes.iterator();
         while (nodesIter.hasNext())
         {
@@ -99,7 +99,7 @@ public class NodeSetImpl implements Node
             {
                 if (subsetNodes == null)
                 {
-                    subsetNodes = new ArrayList(nodes.size());
+                    subsetNodes = new ArrayList<Node>(nodes.size());
                 }
                 subsetNodes.add(node);
             }
@@ -122,7 +122,7 @@ public class NodeSetImpl implements Node
     public NodeSet inclusiveSubset(String regex)
     {
         // search for matching nodes
-        List subsetNodes = null;
+        List<Node> subsetNodes = null;
         Pattern pattern = Pattern.compile(regex);
         Iterator nodesIter = nodes.iterator();
         while (nodesIter.hasNext())
@@ -132,7 +132,7 @@ public class NodeSetImpl implements Node
             {
                 if (subsetNodes == null)
                 {
-                    subsetNodes = new ArrayList(nodes.size());
+                    subsetNodes = new ArrayList<Node>(nodes.size());
                 }
                 subsetNodes.add(node);
             }
@@ -155,7 +155,7 @@ public class NodeSetImpl implements Node
     public NodeSet exclusiveSubset(String regex)
     {
         // search for matching nodes
-        List subsetNodes = null;
+        List<Node> subsetNodes = null;
         Pattern pattern = Pattern.compile(regex);
         Iterator nodesIter = nodes.iterator();
         while (nodesIter.hasNext())
@@ -165,7 +165,7 @@ public class NodeSetImpl implements Node
             {
                 if (subsetNodes == null)
                 {
-                    subsetNodes = new ArrayList(nodes.size());
+                    subsetNodes = new ArrayList<Node>(nodes.size());
                 }
                 subsetNodes.add(node);
             }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/MenuImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/MenuImpl.java?rev=1577983&r1=1577982&r2=1577983&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/MenuImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/MenuImpl.java Sun Mar 16 05:00:07 2014
@@ -80,7 +80,7 @@ public class MenuImpl extends MenuElemen
      * @param context request context
      * @param menus related menu definition names set
      */
-    public MenuImpl(MenuDefinition definition, String path, PortalSiteRequestContextImpl context, Set menus)
+    public MenuImpl(MenuDefinition definition, String path, PortalSiteRequestContextImpl context, Set<String> menus)
     {
         this((MenuImpl)null, definition, path, context, menus);
     }
@@ -94,7 +94,7 @@ public class MenuImpl extends MenuElemen
      * @param context request context
      * @param menus related menu definition names set
      */
-    public MenuImpl(MenuImpl parent, MenuDefinition definition, String path, PortalSiteRequestContextImpl context, Set menus)
+    public MenuImpl(MenuImpl parent, MenuDefinition definition, String path, PortalSiteRequestContextImpl context, Set<String> menus)
     {
         this(((PortalSiteSessionContextImpl)context.getSessionContext()).getSiteView(), parent, definition, path, context, menus);
     }
@@ -109,7 +109,7 @@ public class MenuImpl extends MenuElemen
      * @param context request context
      * @param menus related menu definition names set
      */
-    protected MenuImpl(AbstractSiteView view, MenuImpl parent, MenuDefinition definition, String path, PortalSiteRequestContextImpl context, Set menus)
+    protected MenuImpl(AbstractSiteView view, MenuImpl parent, MenuDefinition definition, String path, PortalSiteRequestContextImpl context, Set<String> menus)
     {
         super(view, parent);
         this.definition = definition;
@@ -146,7 +146,7 @@ public class MenuImpl extends MenuElemen
                 // options to include all folder children if not to
                 // be expanded with paths and depth inclusion is
                 // specified
-                List overrideOptionViews = null;
+                List<Node> overrideOptionViews = null;
                 if (optionView != null)
                 {
                     if ((optionView instanceof Folder) && !definition.isPaths() && (definition.getDepth() != 0))
@@ -164,7 +164,7 @@ public class MenuImpl extends MenuElemen
 
                         // override menu options with visible folder contents
                         // or create empty menu if no contents exist
-                        List folderChildren = null;
+                        List<Node> folderChildren = null;
                         try
                         {
                             folderChildren = view.getNodeViews(folderChildrenPath, context.getPageOrTemplate(), path, true, true, true);
@@ -187,7 +187,7 @@ public class MenuImpl extends MenuElemen
                     else
                     {
                         // override menu options with single folder/page/link
-                        overrideOptionViews = new ArrayList(1);
+                        overrideOptionViews = new ArrayList<Node>(1);
                         overrideOptionViews.add(optionView);
                     }
                     
@@ -207,7 +207,7 @@ public class MenuImpl extends MenuElemen
                 {
                     if (menus == null)
                     {
-                        menus = new HashSet(4);
+                        menus = new HashSet<String>(4);
                     }
                     menuNameReferenced = menus.add(definition.getName());
                 }
@@ -218,7 +218,7 @@ public class MenuImpl extends MenuElemen
                 // merge/filter operations apply to options bounded
                 // by separators
                 MenuSeparatorImpl separator = null;
-                List separatedElements = null;
+                List<MenuElement> separatedElements = null;
 
                 // process each defined menu element
                 Iterator menuElementsIter = definition.getMenuElements().iterator();
@@ -240,7 +240,7 @@ public class MenuImpl extends MenuElemen
                         {
                             order = definition.getOrder();
                         }
-                        List optionsAndMenus = constructMenuElements(view, context, path, optionDefinition.getOptions(), null, optionDefinition.getDepth(), optionDefinition.isPaths(), optionDefinition.isRegexp(), locatorName, order);
+                        List<MenuElement> optionsAndMenus = constructMenuElements(view, context, path, optionDefinition.getOptions(), null, optionDefinition.getDepth(), optionDefinition.isPaths(), optionDefinition.isRegexp(), locatorName, order);
 
                         // append option and menu elements to current separator
                         // elements list
@@ -270,7 +270,7 @@ public class MenuImpl extends MenuElemen
                                 {
                                     initialSize++;
                                 }
-                                this.elements = new ArrayList(initialSize);
+                                this.elements = new ArrayList<MenuElement>(initialSize);
                             }
                             if (separator != null)
                             {
@@ -297,7 +297,7 @@ public class MenuImpl extends MenuElemen
                         // append menu element to current separated elements list
                         if (separatedElements == null)
                         {
-                            separatedElements = new ArrayList(1);
+                            separatedElements = new ArrayList<MenuElement>(1);
                         }
                         appendMenuElement(nestedMenu, separatedElements);
 
@@ -341,7 +341,7 @@ public class MenuImpl extends MenuElemen
                                         // append menu element to current separated elements list
                                         if (separatedElements == null)
                                         {
-                                            separatedElements = new ArrayList(1);
+                                            separatedElements = new ArrayList<MenuElement>(1);
                                         }
                                         appendMenuElement(includeMenu, separatedElements);
                                     }
@@ -377,7 +377,7 @@ public class MenuImpl extends MenuElemen
                                                             {
                                                                 initialSize++;
                                                             }
-                                                            this.elements = new ArrayList(initialSize);
+                                                            this.elements = new ArrayList<MenuElement>(initialSize);
                                                         }
                                                         if (separator != null)
                                                         {
@@ -399,7 +399,7 @@ public class MenuImpl extends MenuElemen
                                                     // append menu element to current separated elements list
                                                     if (separatedElements == null)
                                                     {
-                                                        separatedElements = new ArrayList(includeMenu.getElements().size());
+                                                        separatedElements = new ArrayList<MenuElement>(includeMenu.getElements().size());
                                                     }
                                                     appendMenuElement(includeElement, separatedElements);
                                                 }
@@ -496,7 +496,7 @@ public class MenuImpl extends MenuElemen
      * @param appendMenuElement option/menu element to append
      * @param menuElements option/menu element list
      */
-    private void appendMenuElement(MenuElementImpl appendMenuElement, List menuElements)
+    private void appendMenuElement(MenuElementImpl appendMenuElement, List<MenuElement> menuElements)
     {
         // make sure new menu element is unique and
         // add to menu element list
@@ -516,7 +516,7 @@ public class MenuImpl extends MenuElemen
      * @param appendMenuElements option/menu element list to append
      * @param menuElements option/menu element list
      */
-    private void appendMenuElements(List appendMenuElements, List menuElements)
+    private void appendMenuElements(List<MenuElement> appendMenuElements, List<MenuElement> menuElements)
     {
         // make sure new menu elements are unique and
         // add to menu element list
@@ -537,7 +537,7 @@ public class MenuImpl extends MenuElemen
      * @param removeMenuElements option/menu element list to remove
      * @param menuElements option/menu element list
      */
-    private void removeMenuElements(List removeMenuElements, List menuElements)
+    private void removeMenuElements(List<MenuElement> removeMenuElements, List<MenuElement> menuElements)
     {
         // remove equivalent menu elements from menu
         // element list
@@ -565,13 +565,13 @@ public class MenuImpl extends MenuElemen
      * @param locatorName profile locator name
      * @param order ordering patterns list
      */
-    private List constructMenuElements(AbstractSiteView view, PortalSiteRequestContextImpl context, String path, String options, List overrideElementViews, int depth, boolean paths, boolean regexp, String locatorName, String order)
+    private List<MenuElement> constructMenuElements(AbstractSiteView view, PortalSiteRequestContextImpl context, String path, String options, List<Node> overrideElementViews, int depth, boolean paths, boolean regexp, String locatorName, String order)
     {
         if (options != null)
         {
             // use override element views if specified; otherwise
             // compute view list using specified menu options
-            List elementViews = overrideElementViews;
+            List<Node> elementViews = overrideElementViews;
             if (elementViews == null)
             {
                 // split multiple comma separated option paths from specified options 
@@ -590,7 +590,7 @@ public class MenuImpl extends MenuElemen
                         {
                             // get list of visible views for path from view and append
                             // to list if unique and pass profile locator name filter
-                            List pathViews = null;
+                            List<Node> pathViews = null;
                             try
                             {
                                 pathViews = view.getNodeViews(optionPath, context.getPageOrTemplate(), path, true, true, true);
@@ -612,7 +612,7 @@ public class MenuImpl extends MenuElemen
                                     {
                                         if (elementViews == null)
                                         {
-                                            elementViews = new ArrayList();
+                                            elementViews = new ArrayList<Node>();
                                         }
                                         appendMenuElementViews(pathView, elementViews);
                                     }
@@ -640,7 +640,7 @@ public class MenuImpl extends MenuElemen
                             {
                                 if (elementViews == null)
                                 {
-                                    elementViews = new ArrayList();
+                                    elementViews = new ArrayList<Node>();
                                 }
                                 appendMenuElementViews(pathView, elementViews);
                             }
@@ -663,7 +663,7 @@ public class MenuImpl extends MenuElemen
             if ((order != null) && (elementViews.size() > 1))
             {
                 // create ordered element views
-                List orderedElementViews = new ArrayList(elementViews.size());
+                List<Node> orderedElementViews = new ArrayList<Node>(elementViews.size());
                 
                 // split multiple comma separated elements orderings
                 // after converted to regexp pattern
@@ -730,7 +730,7 @@ public class MenuImpl extends MenuElemen
             if (paths && (depth == 0) && (elementViews.size() == 1) &&
                 ((elementViews.get(0) instanceof Folder) || (elementViews.get(0) instanceof Page)))
             {
-                Node parentNode = ((Node)elementViews.get(0)).getParent();
+                Node parentNode = elementViews.get(0).getParent();
                 while (parentNode != null)
                 {
                     elementViews.add(0, parentNode);
@@ -739,6 +739,7 @@ public class MenuImpl extends MenuElemen
             }
             
             // convert elements views into menu elements
+            List<MenuElement> menuElements = new ArrayList<MenuElement>(elementViews.size());
             DefaultMenuOptionsDefinition defaultMenuOptionsDefinition = null;
             ListIterator elementViewsIter = elementViews.listIterator();
             while (elementViewsIter.hasNext())
@@ -765,10 +766,9 @@ public class MenuImpl extends MenuElemen
                     menuElement = new MenuOptionImpl(view, this, elementView, defaultMenuOptionsDefinition);
                 }
 
-                // replace element view with menu element
-                elementViewsIter.set(menuElement);
+                // save element view menu element
+                menuElements.add(menuElement);
             }
-            List menuElements = elementViews;
 
             // return list of menu elements constructed from element views
             return menuElements;
@@ -785,7 +785,7 @@ public class MenuImpl extends MenuElemen
      * @param pathView menu element page, folder, or link view at path
      * @param elementViews element views list
      */
-    private void appendMenuElementViews(Node pathView, List elementViews)
+    private void appendMenuElementViews(Node pathView, List<Node> elementViews)
     {
         // make sure new view is unique and add
         // to element views list

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteRequestContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteRequestContextImpl.java?rev=1577983&r1=1577982&r2=1577983&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteRequestContextImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteRequestContextImpl.java Sun Mar 16 05:00:07 2014
@@ -16,21 +16,13 @@
  */
 package org.apache.jetspeed.portalsite.impl;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Collections;
-
 import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.om.page.BaseConcretePageElement;
+import org.apache.jetspeed.om.page.BaseFragmentElement;
 import org.apache.jetspeed.om.page.BaseFragmentsElement;
+import org.apache.jetspeed.om.page.DynamicPage;
 import org.apache.jetspeed.om.page.FragmentDefinition;
 import org.apache.jetspeed.om.page.FragmentReference;
-import org.apache.jetspeed.om.page.DynamicPage;
-import org.apache.jetspeed.om.page.BaseConcretePageElement;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageTemplate;
 import org.apache.jetspeed.page.document.Node;
@@ -42,6 +34,16 @@ import org.apache.jetspeed.portalsite.Me
 import org.apache.jetspeed.portalsite.PortalSiteRequestContext;
 import org.apache.jetspeed.portalsite.PortalSiteSessionContext;
 import org.apache.jetspeed.portalsite.view.SiteViewMenuDefinitionLocator;
+import org.apache.jetspeed.profiler.ProfileLocator;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * This class encapsulates managed request state for and
@@ -60,7 +62,7 @@ public class PortalSiteRequestContextImp
     /**
      * requestProfileLocators - map of request profile locators by locator names
      */
-    private Map requestProfileLocators;
+    private Map<String,ProfileLocator> requestProfileLocators;
 
     /**
      * requestPath - request path if not using profile locators
@@ -123,7 +125,7 @@ public class PortalSiteRequestContextImp
     /**
      * requestFragmentDefinitions - cached request request fragment definition views map
      */
-    private Map requestFragmentDefinitions;
+    private Map<String,FragmentDefinition> requestFragmentDefinitions;
 
     /**
      * requestFragmentDefinitionsCached - cached flag for request fragment definition views map
@@ -168,13 +170,13 @@ public class PortalSiteRequestContextImp
     /**
      * pageMenuDefinitionNames - cached menu definition names for request page
      */
-    private Set pageMenuDefinitionNames;
+    private Set<String> pageMenuDefinitionNames;
 
     /**
      * menuDefinitionLocatorCache - cached menu definition locators for
      *                              relative menus valid for request
      */
-    private Map menuDefinitionLocatorCache;
+    private Map<SiteViewMenuDefinitionLocator,MenuImpl> menuDefinitionLocatorCache;
 
     /**
      * PortalSiteRequestContextImpl - constructor
@@ -189,7 +191,7 @@ public class PortalSiteRequestContextImp
      * @param forceReservedVisible force reserved/hidden folders visible in site view
      * @param forceTemplatesAccessible force templates accessible to requests in site view
      */
-    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceReservedVisible, boolean forceTemplatesAccessible)
+    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceReservedVisible, boolean forceTemplatesAccessible)
     {
         this.sessionContext = sessionContext;
         this.requestProfileLocators = requestProfileLocators;
@@ -211,7 +213,7 @@ public class PortalSiteRequestContextImp
      * @param useHistory flag indicating whether to use visited page
      *                   history to select default page per site folder
      */
-    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory)
+    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory)
     {
         this(sessionContext, requestProfileLocators, requestUserPrincipal, requestFallback, useHistory, false, false);
     }
@@ -225,7 +227,7 @@ public class PortalSiteRequestContextImp
      * @param requestFallback flag specifying whether to fallback to root folder
      *                        if locators do not select a page or access is forbidden
      */
-    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback)
+    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestFallback)
     {
         this(sessionContext, requestProfileLocators, requestUserPrincipal, requestFallback, true, false, false);
     }
@@ -237,7 +239,7 @@ public class PortalSiteRequestContextImp
      * @param requestProfileLocators request profile locators
      * @param requestUserPrincipal request user principal
      */
-    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map requestProfileLocators, String requestUserPrincipal)
+    public PortalSiteRequestContextImpl(PortalSiteSessionContextImpl sessionContext, Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal)
     {
         this(sessionContext, requestProfileLocators, requestUserPrincipal, true, true, false, false);
     }
@@ -326,7 +328,7 @@ public class PortalSiteRequestContextImp
      *  
      * @return request profile locators
      */
-    public Map getLocators()
+    public Map<String,ProfileLocator> getLocators()
     {
         return requestProfileLocators;
     }
@@ -367,19 +369,17 @@ public class PortalSiteRequestContextImp
      * @throws NodeNotFoundException if page not found
      * @throws SecurityException if page view access not granted
      */
-    public Map getManagedFragmentDefinitions() throws NodeNotFoundException
+    public Map<String,FragmentDefinition> getManagedFragmentDefinitions() throws NodeNotFoundException
     {
         // convert map of views to map of managed fragment definitions
-        Map fragmentDefinitions = getFragmentDefinitions();
+        Map<String,FragmentDefinition> fragmentDefinitions = getFragmentDefinitions();
         if (fragmentDefinitions != null)
         {
-            Map managedFragmentDefinitions = new HashMap(4);
-            Iterator fragmentDefinitionsIter = fragmentDefinitions.entrySet().iterator();
-            while (fragmentDefinitionsIter.hasNext())
+            Map<String,FragmentDefinition> managedFragmentDefinitions = new HashMap<String,FragmentDefinition>(4);
+            for (Map.Entry<String,FragmentDefinition> fragmentDefinitionEntry : fragmentDefinitions.entrySet())
             {
-                Map.Entry fragmentDefinitionEntry = (Map.Entry)fragmentDefinitionsIter.next();
-                String id = (String)fragmentDefinitionEntry.getKey();
-                FragmentDefinition fragmentDefinition = (FragmentDefinition)fragmentDefinitionEntry.getValue();
+                String id = fragmentDefinitionEntry.getKey();
+                FragmentDefinition fragmentDefinition = fragmentDefinitionEntry.getValue();
                 FragmentDefinition managedFragmentDefinition = sessionContext.getManagedFragmentDefinition(fragmentDefinition);
                 if (managedFragmentDefinition != null)
                 {
@@ -516,7 +516,7 @@ public class PortalSiteRequestContextImp
      * @throws NodeNotFoundException if page or fragment definition not found
      * @throws SecurityException if page view access not granted
      */
-    public Map getFragmentDefinitions() throws NodeNotFoundException
+    public Map<String,FragmentDefinition> getFragmentDefinitions() throws NodeNotFoundException
     {
         if (!requestFragmentDefinitionsCached)
         {
@@ -526,10 +526,10 @@ public class PortalSiteRequestContextImp
             if (pageOrTemplate != null)
             {
                 // merge fragment reference ids from requested page and page template
-                Set refIds = new HashSet(4);
-                List requestPageFragmentReferences = pageOrTemplate.getFragmentsByInterface(FragmentReference.class);
+                Set<String> refIds = new HashSet<String>(4);
+                List<BaseFragmentElement> requestPageFragmentReferences = pageOrTemplate.getFragmentsByInterface(FragmentReference.class);
                 mergeFragmentDefinitionRefIds(requestPageFragmentReferences, refIds);
-                List requestPageTemplateFragmentReferences = ((pageTemplate != null) ? pageTemplate.getFragmentsByInterface(FragmentReference.class) : null);
+                List<BaseFragmentElement> requestPageTemplateFragmentReferences = ((pageTemplate != null) ? pageTemplate.getFragmentsByInterface(FragmentReference.class) : null);
                 mergeFragmentDefinitionRefIds(requestPageTemplateFragmentReferences, refIds);
                 
                 // scan through site looking for each first matching fragment
@@ -572,7 +572,7 @@ public class PortalSiteRequestContextImp
                         {
                             if (requestFragmentDefinitions == null)
                             {
-                                requestFragmentDefinitions = Collections.synchronizedMap(new HashMap(4));
+                                requestFragmentDefinitions = Collections.synchronizedMap(new HashMap<String,FragmentDefinition>(4));
                             }
                             requestFragmentDefinitions.put(refId, requestFragmentDefinition);
                         }
@@ -600,7 +600,7 @@ public class PortalSiteRequestContextImp
      * @param fragmentReferences list of fragment references
      * @param refIds merged set of unique reference ids
      */
-    private void mergeFragmentDefinitionRefIds(List fragmentReferences, Set refIds)
+    private void mergeFragmentDefinitionRefIds(List<BaseFragmentElement> fragmentReferences, Set<String> refIds)
     {
         // merge list of fragment reference reference ids 
         if ((fragmentReferences != null) && !fragmentReferences.isEmpty())
@@ -794,7 +794,7 @@ public class PortalSiteRequestContextImp
      *  
      * @return menu names set
      */
-    public Set getStandardMenuNames()
+    public Set<String> getStandardMenuNames()
     {
         // return standard menu names defined for session
         return sessionContext.getStandardMenuNames();
@@ -809,7 +809,7 @@ public class PortalSiteRequestContextImp
      * @throws NodeNotFoundException if page not found
      * @throws SecurityException if page view access not granted
      */
-    public Set getCustomMenuNames() throws NodeNotFoundException
+    public Set<String> getCustomMenuNames() throws NodeNotFoundException
     {
         // menus only available for concrete page requests
         if (isConcretePage())
@@ -819,21 +819,21 @@ public class PortalSiteRequestContextImp
             // return available menu definition names from
             // current request page and page template if not
             // previously cached in this context
-            Set standardMenuNames = sessionContext.getStandardMenuNames();
+            Set<String> standardMenuNames = sessionContext.getStandardMenuNames();
             if ((page != null) && (standardMenuNames != null) && (pageMenuDefinitionNames == null))
             {
-                List pageLocators = sessionContext.getMenuDefinitionLocators(page);
-                List pageTemplateLocators = ((pageTemplate != null) ? sessionContext.getMenuDefinitionLocators(pageTemplate) : null);
+                List<SiteViewMenuDefinitionLocator> pageLocators = sessionContext.getMenuDefinitionLocators(page);
+                List<SiteViewMenuDefinitionLocator> pageTemplateLocators = ((pageTemplate != null) ? sessionContext.getMenuDefinitionLocators(pageTemplate) : null);
                 if ((pageLocators != null) || (pageTemplateLocators != null))
                 {
                     // get custom definition names
-                    pageMenuDefinitionNames = Collections.synchronizedSet(new HashSet(8));
+                    pageMenuDefinitionNames = Collections.synchronizedSet(new HashSet<String>(8));
                     mergeMenuDefinitionLocatorNames(pageLocators, standardMenuNames, pageMenuDefinitionNames);
                     mergeMenuDefinitionLocatorNames(pageTemplateLocators, standardMenuNames, pageMenuDefinitionNames);
                 }
                 else
                 {
-                    pageMenuDefinitionNames = Collections.synchronizedSet(new HashSet(0));
+                    pageMenuDefinitionNames = Collections.synchronizedSet(new HashSet<String>(0));
                 }
             }
             return pageMenuDefinitionNames;
@@ -848,7 +848,7 @@ public class PortalSiteRequestContextImp
      * @param excludeNames excluded names set
      * @param names merged names set
      */
-    private void mergeMenuDefinitionLocatorNames(List locators, Set excludeNames, Set names)
+    private void mergeMenuDefinitionLocatorNames(List<SiteViewMenuDefinitionLocator> locators, Set<String> excludeNames, Set<String> names)
     {
         // merge menu definition locator names
         if (locators != null)
@@ -893,7 +893,7 @@ public class PortalSiteRequestContextImp
      * @throws NodeNotFoundException if page not found
      * @throws SecurityException if page view access not granted
      */
-    public Menu getMenu(String name, Set names) throws NodeNotFoundException
+    public Menu getMenu(String name, Set<String> names) throws NodeNotFoundException
     {
         if (name != null)
         {
@@ -918,7 +918,7 @@ public class PortalSiteRequestContextImp
                     // lookup and return cached relative/request menus
                     if (menuDefinitionLocatorCache != null)
                     {
-                        MenuImpl menu = (MenuImpl)menuDefinitionLocatorCache.get(locator);
+                        MenuImpl menu = menuDefinitionLocatorCache.get(locator);
                         if (menu != null)
                         {
                             return menu;
@@ -952,7 +952,7 @@ public class PortalSiteRequestContextImp
                         // cache relative menu for request
                         if (menuDefinitionLocatorCache == null)
                         {
-                            menuDefinitionLocatorCache = Collections.synchronizedMap(new HashMap(8));
+                            menuDefinitionLocatorCache = Collections.synchronizedMap(new HashMap<SiteViewMenuDefinitionLocator,MenuImpl>(8));
                         }
                         menuDefinitionLocatorCache.put(locator, menu);
                     }
@@ -961,7 +961,7 @@ public class PortalSiteRequestContextImp
                         // cache absolute menu for session
                         if (sessionContext.getMenuDefinitionLocatorCache() == null)
                         {
-                            sessionContext.setMenuDefinitionLocatorCache(Collections.synchronizedMap(new HashMap(8)));
+                            sessionContext.setMenuDefinitionLocatorCache(Collections.synchronizedMap(new HashMap<SiteViewMenuDefinitionLocator,MenuImpl>(8)));
                         }
                         sessionContext.getMenuDefinitionLocatorCache().put(locator, menu);
                     }
@@ -1005,7 +1005,7 @@ public class PortalSiteRequestContextImp
         if ((nodes != null) && !nodes.isEmpty())
         {
             // filter node views in node set
-            List filteredNodes = null;
+            List<Node> filteredNodes = null;
             Iterator nodesIter = nodes.iterator();
             while (nodesIter.hasNext())
             {
@@ -1017,7 +1017,7 @@ public class PortalSiteRequestContextImp
                     // and copy preceding node views
                     if (filteredNodes == null)
                     {
-                        filteredNodes = new ArrayList(nodes.size());
+                        filteredNodes = new ArrayList<Node>(nodes.size());
                         Iterator copyIter = nodes.iterator();
                         while (copyIter.hasNext())
                         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java?rev=1577983&r1=1577982&r2=1577983&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/impl/PortalSiteSessionContextImpl.java Sun Mar 16 05:00:07 2014
@@ -16,18 +16,6 @@
  */
 package org.apache.jetspeed.portalsite.impl;
 
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpSessionActivationListener;
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
-import javax.servlet.http.HttpSessionEvent;
-
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.BaseFragmentsElement;
 import org.apache.jetspeed.om.page.DynamicPage;
@@ -49,10 +37,20 @@ import org.apache.jetspeed.portalsite.vi
 import org.apache.jetspeed.portalsite.view.SiteViewMenuDefinitionLocator;
 import org.apache.jetspeed.profiler.ProfileLocator;
 import org.apache.jetspeed.profiler.ProfileLocatorProperty;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.servlet.http.HttpSessionActivationListener;
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
+import javax.servlet.http.HttpSessionEvent;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * This class encapsulates managed session state for and
  * interface to the portal-site component and subscribes
@@ -95,7 +93,7 @@ public class PortalSiteSessionContextImp
     /**
      * profileLocators - map of session profile locators by locator names
      */
-    private transient Map profileLocators;
+    private transient Map<String,ProfileLocator> profileLocators;
 
     /**
      * forceReservedVisible - force reserved/hidden folders visible in site view
@@ -115,13 +113,13 @@ public class PortalSiteSessionContextImp
     /**
      * folderPageHistory - map of last page visited by folder 
      */
-    private transient Map folderPageHistory;
+    private transient Map<String,String> folderPageHistory;
 
     /**
      * menuDefinitionLocatorCache - cached menu definition locators for
      *                              absolute menus valid for session
      */
-    private transient Map menuDefinitionLocatorCache;
+    private transient Map<SiteViewMenuDefinitionLocator,MenuImpl> menuDefinitionLocatorCache;
 
     /**
      * subscribed - flag that indicates whether this context
@@ -159,7 +157,7 @@ public class PortalSiteSessionContextImp
      * @param requestUserPrincipal request user principal
      * @return new request context instance
      */
-    public PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal)
+    public PortalSiteRequestContext newRequestContext(Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal)
     {
         return new PortalSiteRequestContextImpl(this, requestProfileLocators, requestUserPrincipal, true, true, false, false);
     }
@@ -173,7 +171,7 @@ public class PortalSiteSessionContextImp
      *                        if locators do not select a page or access is forbidden
      * @return new request context instance
      */
-    public PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback)
+    public PortalSiteRequestContext newRequestContext(Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestFallback)
     {
         return new PortalSiteRequestContextImpl(this, requestProfileLocators, requestUserPrincipal, requestFallback, true, false, false);
     }
@@ -189,7 +187,7 @@ public class PortalSiteSessionContextImp
      *                   history to select default page per site folder
      * @return new request context instance
      */
-    public PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory)
+    public PortalSiteRequestContext newRequestContext(Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory)
     {
         return new PortalSiteRequestContextImpl(this, requestProfileLocators, requestUserPrincipal, requestFallback, useHistory, false, false);
     }
@@ -207,7 +205,7 @@ public class PortalSiteSessionContextImp
      * @param forceTemplatesAccessible force templates accessible to requests in site view
      * @return new request context instance
      */
-    public PortalSiteRequestContext newRequestContext(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceReservedVisible, boolean forceTemplatesAccessible)
+    public PortalSiteRequestContext newRequestContext(Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceReservedVisible, boolean forceTemplatesAccessible)
     {
         return new PortalSiteRequestContextImpl(this, requestProfileLocators, requestUserPrincipal, requestFallback, useHistory, forceReservedVisible, forceTemplatesAccessible);
     }
@@ -318,7 +316,7 @@ public class PortalSiteSessionContextImp
      * @throws NodeNotFoundException if not found
      * @throws SecurityException if view access not granted
      */
-    public BaseFragmentsElement selectRequestPageOrTemplate(Map requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceReservedVisible, boolean forceTemplatesAccessible, String [] requestPageContentPath) throws NodeNotFoundException
+    public BaseFragmentsElement selectRequestPageOrTemplate(Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceReservedVisible, boolean forceTemplatesAccessible, String [] requestPageContentPath) throws NodeNotFoundException
     {
         return selectRequestPageOrTemplate(requestProfileLocators, null, null, requestUserPrincipal, requestFallback, useHistory, forceReservedVisible, forceTemplatesAccessible, requestPageContentPath);
     }
@@ -341,7 +339,7 @@ public class PortalSiteSessionContextImp
      * @throws NodeNotFoundException if not found
      * @throws SecurityException if view access not granted
      */
-    private BaseFragmentsElement selectRequestPageOrTemplate(Map requestProfileLocators, String requestPath, String requestServerName, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceReservedVisible, boolean forceTemplatesAccessible, String [] requestPageContentPath) throws NodeNotFoundException
+    private BaseFragmentsElement selectRequestPageOrTemplate(Map<String,ProfileLocator> requestProfileLocators, String requestPath, String requestServerName, String requestUserPrincipal, boolean requestFallback, boolean useHistory, boolean forceReservedVisible, boolean forceTemplatesAccessible, String [] requestPageContentPath) throws NodeNotFoundException
     {
         // validate and update session profile locators if modified
         if (updateSessionProfileLocators(requestProfileLocators, requestUserPrincipal, forceReservedVisible))
@@ -1163,7 +1161,7 @@ public class PortalSiteSessionContextImp
      * @throws NodeNotFoundException if not found
      * @throws SecurityException if view access not granted
      */
-    public Folder getRequestRootFolder(Map requestProfileLocators, String requestUserPrincipal, boolean requestForceReservedVisible) throws NodeNotFoundException
+    public Folder getRequestRootFolder(Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestForceReservedVisible) throws NodeNotFoundException
     {
         // validate and update session profile locators if modified
         if (updateSessionProfileLocators(requestProfileLocators, requestUserPrincipal, requestForceReservedVisible))
@@ -1190,7 +1188,7 @@ public class PortalSiteSessionContextImp
      * @param requestForceReservedVisible force reserved/hidden folders visible for request
      * @return profile locators validation flag
      */
-    private boolean updateSessionProfileLocators(Map requestProfileLocators, String requestUserPrincipal, boolean requestForceReservedVisible)
+    private boolean updateSessionProfileLocators(Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestForceReservedVisible)
     {
         // valid request profile locators are required
         if ((requestProfileLocators == null) || !requestProfileLocators.isEmpty())
@@ -1337,7 +1335,7 @@ public class PortalSiteSessionContextImp
         while (view == null)
         {
             // access site view and test for creation
-            Map createViewProfileLocators = null;
+            Map<String,ProfileLocator> createViewProfileLocators = null;
             String createViewUserPrincipal = null;
             boolean createView = false;
             synchronized (this)
@@ -1433,7 +1431,7 @@ public class PortalSiteSessionContextImp
     /**
      * getProfileLocators - get session profile locators
      */
-    public Map getProfileLocators()
+    public Map<String,ProfileLocator> getProfileLocators()
     {
         return profileLocators;
     }
@@ -1443,7 +1441,7 @@ public class PortalSiteSessionContextImp
      *  
      * @return menu names set
      */
-    public Set getStandardMenuNames()
+    public Set<String> getStandardMenuNames()
     {
         // return standard menu names defined for site view
         AbstractSiteView view = getSiteView();
@@ -1457,7 +1455,7 @@ public class PortalSiteSessionContextImp
      * @param node site view node view
      * @return definition locator list
      */
-    public List getMenuDefinitionLocators(Node node)
+    public List<SiteViewMenuDefinitionLocator> getMenuDefinitionLocators(Node node)
     {
         // return menu definition locators for node in site view
         AbstractSiteView view = getSiteView();
@@ -1483,7 +1481,7 @@ public class PortalSiteSessionContextImp
      * getManagedPageOrTemplate - get managed page, page template, dynamic page, or
      *                            fragment definition instance from page view
      *  
-     * @param page page view
+     * @param pageOrTemplate page view
      * @return managed page
      */
     public BaseFragmentsElement getManagedPageOrTemplate(BaseFragmentsElement pageOrTemplate)
@@ -1556,10 +1554,10 @@ public class PortalSiteSessionContextImp
      *
      * @param requestProfileLocators map of profile locators for request
      * @param requestUserPrincipal request user principal
-     * @param forceReservedVisible force reserved/hidden folders visible for request
+     * @param requestForceReservedVisible force reserved/hidden folders visible for request
      * @return user folder path or null
      */
-    public String getUserFolderPath(Map requestProfileLocators, String requestUserPrincipal, boolean requestForceReservedVisible)
+    public String getUserFolderPath(Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestForceReservedVisible)
     {
         // validate and update session profile locators if modified
         if (updateSessionProfileLocators(requestProfileLocators, requestUserPrincipal, forceReservedVisible))
@@ -1576,10 +1574,10 @@ public class PortalSiteSessionContextImp
      *
      * @param requestProfileLocators map of profile locators for request
      * @param requestUserPrincipal request user principal
-     * @param forceReservedVisible force reserved/hidden folders visible for request
+     * @param requestForceReservedVisible force reserved/hidden folders visible for request
      * @return base folder path or null
      */
-    public String getBaseFolderPath(Map requestProfileLocators, String requestUserPrincipal, boolean requestForceReservedVisible)
+    public String getBaseFolderPath(Map<String,ProfileLocator> requestProfileLocators, String requestUserPrincipal, boolean requestForceReservedVisible)
     {
         // validate and update session profile locators if modified
         if (updateSessionProfileLocators(requestProfileLocators, requestUserPrincipal, forceReservedVisible))
@@ -1597,7 +1595,7 @@ public class PortalSiteSessionContextImp
      *
      * @return menu definition locators cache
      */
-    public Map getMenuDefinitionLocatorCache()
+    public Map<SiteViewMenuDefinitionLocator,MenuImpl> getMenuDefinitionLocatorCache()
     {
         return menuDefinitionLocatorCache;
     }
@@ -1608,7 +1606,7 @@ public class PortalSiteSessionContextImp
      *
      * @return menu definition locators cache
      */
-    public void setMenuDefinitionLocatorCache(Map cache)
+    public void setMenuDefinitionLocatorCache(Map<SiteViewMenuDefinitionLocator,MenuImpl> cache)
     {
         menuDefinitionLocatorCache = cache;
     }
@@ -1910,11 +1908,11 @@ public class PortalSiteSessionContextImp
         }
     }
 
-	private synchronized Map getFolderPageHistory()
+	private synchronized Map<String,String> getFolderPageHistory()
     {
 		if (folderPageHistory == null)
         {
-			folderPageHistory = new HashMap();
+			folderPageHistory = new HashMap<String,String>();
 		}
 		return folderPageHistory;
 	}

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/menu/StandardNavigationsMenuDefinition.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/menu/StandardNavigationsMenuDefinition.java?rev=1577983&r1=1577982&r2=1577983&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/menu/StandardNavigationsMenuDefinition.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/menu/StandardNavigationsMenuDefinition.java Sun Mar 16 05:00:07 2014
@@ -16,13 +16,8 @@
  */
 package org.apache.jetspeed.portalsite.menu;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
 import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.om.folder.MenuDefinitionElement;
 import org.apache.jetspeed.om.folder.impl.StandardMenuDefinitionImpl;
 import org.apache.jetspeed.om.folder.impl.StandardMenuIncludeDefinitionImpl;
 import org.apache.jetspeed.om.folder.impl.StandardMenuOptionsDefinitionImpl;
@@ -30,6 +25,12 @@ import org.apache.jetspeed.om.folder.imp
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.portalsite.view.AbstractSiteView;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
 /**
  * This class provides a menu definition for the standard
  * navigations menu.
@@ -43,7 +44,7 @@ public class StandardNavigationsMenuDefi
      * menuElements - ordered polymorphic list of menu option, nested
      *                menu, separator, include, and exclude definitions
      */
-    private List menuElements;
+    private List<MenuDefinitionElement> menuElements;
 
     /**
      * StandardNavigationsMenuDefinition - constructor
@@ -70,12 +71,12 @@ public class StandardNavigationsMenuDefi
      *
      * @return element list
      */
-    public synchronized List getMenuElements()
+    public synchronized List<MenuDefinitionElement> getMenuElements()
     {
         // instantiate menu elements if necessary
         if (menuElements == null)
         {
-            menuElements = new ArrayList(4);
+            menuElements = new ArrayList<MenuDefinitionElement>(4);
             menuElements.add(new StandardMenuSeparatorDefinitionImpl()
                 {
                     /**

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/AbstractSiteView.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/AbstractSiteView.java?rev=1577983&r1=1577982&r2=1577983&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/AbstractSiteView.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/AbstractSiteView.java Sun Mar 16 05:00:07 2014
@@ -16,12 +16,6 @@
  */
 package org.apache.jetspeed.portalsite.view;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.page.DynamicPage;
@@ -39,6 +33,12 @@ import org.apache.jetspeed.portalsite.me
 import org.apache.jetspeed.portalsite.menu.StandardNavigationsMenuDefinition;
 import org.apache.jetspeed.portalsite.menu.StandardPagesMenuDefinition;
 
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
 /**
  * This abstract class defines the base implementation for
  * views of site content.
@@ -82,7 +82,7 @@ public abstract class AbstractSiteView
     /**
      * STANDARD_MENU_NAMES - set of supported standard menu names
      */
-    private final static Set STANDARD_MENU_NAMES = new HashSet(3);
+    private final static Set<String> STANDARD_MENU_NAMES = new HashSet<String>(3);
     static
     {
         STANDARD_MENU_NAMES.add(STANDARD_BACK_MENU_NAME);
@@ -94,7 +94,7 @@ public abstract class AbstractSiteView
     /**
      * STANDARD_MENU_DEFINITION_LOCATORS - list of standard menu definition locators
      */
-    private final static List STANDARD_MENU_DEFINITION_LOCATORS = new ArrayList(4);
+    private final static List<SiteViewMenuDefinitionLocator> STANDARD_MENU_DEFINITION_LOCATORS = new ArrayList<SiteViewMenuDefinitionLocator>(4);
     static
     {
         STANDARD_MENU_DEFINITION_LOCATORS.add(new SiteViewMenuDefinitionLocator(new StandardBackMenuDefinition()));
@@ -341,7 +341,7 @@ public abstract class AbstractSiteView
      * @param onlyVisible node required to be visible, (or current)
      * @return list of folder, page, or link node views
      */
-    public List getNodeViews(String regexpPath, Node currentNode, String menuPath, boolean onlyConcrete, boolean onlyViewable, boolean onlyVisible)
+    public List<Node> getNodeViews(String regexpPath, Node currentNode, String menuPath, boolean onlyConcrete, boolean onlyViewable, boolean onlyVisible)
     {
         // determine current folder and page
         String currentRegexpPath = regexpPath;
@@ -363,7 +363,7 @@ public abstract class AbstractSiteView
             if (currentPage != null)
             {
                 // return current page, (assume viewable)
-                List views = new ArrayList(1);
+                List<Node> views = new ArrayList<Node>(1);
                 views.add(currentPage);
                 return views;
             }
@@ -381,7 +381,7 @@ public abstract class AbstractSiteView
             if (currentRegexpPath.equals(ALT_CURRENT_PAGE_PATH_0))
             {
                 // return current node, (assume viewable)
-                List views = new ArrayList(1);
+                List<Node> views = new ArrayList<Node>(1);
                 views.add(currentNode);
                 return views;
             }
@@ -463,17 +463,17 @@ public abstract class AbstractSiteView
                                     if (subfolders.size() > 1)
                                     {
                                         // recursively process matching sub-folders
-                                        List views = null;
+                                        List<Node> views = null;
                                         Iterator subfoldersIter = subfolders.iterator();
                                         while (subfoldersIter.hasNext())
                                         {
                                             currentFolder = (Folder)subfoldersIter.next();
-                                            List subfolderViews = getNodeViews(currentRegexpPath, currentFolder, menuPath, onlyConcrete, onlyViewable, onlyVisible);
+                                            List<Node> subfolderViews = getNodeViews(currentRegexpPath, currentFolder, menuPath, onlyConcrete, onlyViewable, onlyVisible);
                                             if ((subfolderViews != null) && !subfolderViews.isEmpty())
                                             {
                                                 if (views == null)
                                                 {
-                                                    views = new ArrayList();
+                                                    views = new ArrayList<Node>();
                                                 }
                                                 views.addAll(subfolderViews);
                                             }
@@ -545,7 +545,7 @@ public abstract class AbstractSiteView
                             children = children.inclusiveSubset(pathPattern);
                             if ((children != null) && !children.isEmpty())
                             {
-                                List views = null;
+                                List<Node> views = null;
                                 Iterator childrenIter = children.iterator();
                                 while (childrenIter.hasNext())
                                 {
@@ -556,7 +556,7 @@ public abstract class AbstractSiteView
                                     {
                                         if (views == null)
                                         {
-                                            views = new ArrayList(children.size());
+                                            views = new ArrayList<Node>(children.size());
                                         }
                                         views.add(child);
                                     }
@@ -574,7 +574,7 @@ public abstract class AbstractSiteView
                                 (!onlyVisible || isVisible(child, currentPage)) &&
                                 (!onlyViewable || isViewable(child, onlyVisible)))
                             {
-                                List views = new ArrayList(1);
+                                List<Node> views = new ArrayList<Node>(1);
                                 views.add(currentFolder);
                                 return views;
                             }
@@ -599,7 +599,7 @@ public abstract class AbstractSiteView
         if ((!onlyVisible || isVisible(currentFolder, null)) &&
             (!onlyViewable || isViewable(currentFolder, onlyVisible)))
         {
-            List views = new ArrayList(1);
+            List<Node> views = new ArrayList<Node>(1);
             views.add(currentFolder);
             return views;
         }
@@ -876,7 +876,7 @@ public abstract class AbstractSiteView
      *  
      * @return menu names set
      */
-    public Set getStandardMenuNames()
+    public Set<String> getStandardMenuNames()
     {
         // return constant standard menu names
         return STANDARD_MENU_NAMES;
@@ -888,7 +888,7 @@ public abstract class AbstractSiteView
      *  
      * @return menu definition locators list
      */
-    public List getStandardMenuDefinitionLocators()
+    public List<SiteViewMenuDefinitionLocator> getStandardMenuDefinitionLocators()
     {
         // return constant standard menu definition locators
         return STANDARD_MENU_DEFINITION_LOCATORS;
@@ -900,7 +900,7 @@ public abstract class AbstractSiteView
      * @param node node view
      * @return definition locator list
      */
-    public abstract List getMenuDefinitionLocators(Node node);
+    public abstract List<SiteViewMenuDefinitionLocator> getMenuDefinitionLocators(Node node);
 
     /**
      * getMenuDefinitionLocator - get named view node menu definition locator

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/PhysicalSiteView.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/PhysicalSiteView.java?rev=1577983&r1=1577982&r2=1577983&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/PhysicalSiteView.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/main/java/org/apache/jetspeed/portalsite/view/PhysicalSiteView.java Sun Mar 16 05:00:07 2014
@@ -16,10 +16,6 @@
  */
 package org.apache.jetspeed.portalsite.view;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.page.DynamicPage;
@@ -32,6 +28,10 @@ import org.apache.jetspeed.page.document
 import org.apache.jetspeed.page.document.NodeException;
 import org.apache.jetspeed.page.document.NodeNotFoundException;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+
 /**
  * This class defines a physical view of site content.
  * 
@@ -40,7 +40,7 @@ import org.apache.jetspeed.page.document
  */
 public class PhysicalSiteView extends AbstractSiteView
 {
-    private static final List NULL_LOCATORS = new ArrayList(0);
+    private static final List<SiteViewMenuDefinitionLocator> NULL_LOCATORS = new ArrayList<SiteViewMenuDefinitionLocator>(0);
     
     /**
      * userPrincipal - user principal for view
@@ -50,7 +50,7 @@ public class PhysicalSiteView extends Ab
     /**
      * menuDefinitionLocatorsCache - cached menu definition locators
      */
-    private ConcurrentHashMap menuDefinitionLocatorsCache = new ConcurrentHashMap();
+    private ConcurrentHashMap<String,List<SiteViewMenuDefinitionLocator>> menuDefinitionLocatorsCache = new ConcurrentHashMap<String,List<SiteViewMenuDefinitionLocator>>();
     
     /**
      * PhysicalSiteView - basic constructor
@@ -111,11 +111,11 @@ public class PhysicalSiteView extends Ab
      * @param node node view
      * @return definition locator list
      */
-    public List getMenuDefinitionLocators(Node node)
+    public List<SiteViewMenuDefinitionLocator> getMenuDefinitionLocators(Node node)
     {
         // access cached menu definition locators
         String path = node.getPath();
-        List locators = (List)menuDefinitionLocatorsCache.get(path);
+        List<SiteViewMenuDefinitionLocator> locators = menuDefinitionLocatorsCache.get(path);
         if (locators == null)
         {
             if (node instanceof Folder)
@@ -142,7 +142,7 @@ public class PhysicalSiteView extends Ab
                 // locator defaults
                 Page page = (Page)node;
                 Folder folder = (Folder)node.getParent();
-                locators = SiteViewUtils.mergeMenuDefinitionLocators(page.getMenuDefinitions(), page, folder.getPath(), true, locators);
+                locators = SiteViewUtils.mergeMenuDefinitionLocators(page.getMenuDefinitions(), page, folder.getPath(), true, null);
                 locators = SiteViewUtils.mergeMenuDefinitionLocators(getMenuDefinitionLocators(folder), locators);
             }
             else if (node instanceof DynamicPage)
@@ -154,7 +154,7 @@ public class PhysicalSiteView extends Ab
                 // locator defaults
                 DynamicPage dynamicPage = (DynamicPage)node;
                 Folder folder = (Folder)node.getParent();
-                locators = SiteViewUtils.mergeMenuDefinitionLocators(dynamicPage.getMenuDefinitions(), dynamicPage, folder.getPath(), true, locators);
+                locators = SiteViewUtils.mergeMenuDefinitionLocators(dynamicPage.getMenuDefinitions(), dynamicPage, folder.getPath(), true, null);
                 locators = SiteViewUtils.mergeMenuDefinitionLocators(getMenuDefinitionLocators(folder), locators);
             }
             else if (node instanceof PageTemplate)
@@ -162,10 +162,10 @@ public class PhysicalSiteView extends Ab
                 // merge only page template menu definition locators by name
                 PageTemplate pageTemplate = (PageTemplate)node;
                 Folder folder = (Folder)node.getParent();
-                locators = SiteViewUtils.mergeMenuDefinitionLocators(pageTemplate.getMenuDefinitions(), pageTemplate, folder.getPath(), false, locators);
+                locators = SiteViewUtils.mergeMenuDefinitionLocators(pageTemplate.getMenuDefinitions(), pageTemplate, folder.getPath(), false, null);
             }
             locators = ((locators != null) ? locators : NULL_LOCATORS);
-            List cachedLocators = (List)menuDefinitionLocatorsCache.putIfAbsent(path, locators);
+            List<SiteViewMenuDefinitionLocator> cachedLocators = menuDefinitionLocatorsCache.putIfAbsent(path, locators);
             locators = ((cachedLocators != null) ? cachedLocators : locators);
         }
         return ((locators != NULL_LOCATORS) ? locators : null);



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


Mime
View raw message