portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r929549 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets: ./ site/ spaces/ wicket/
Date Wed, 31 Mar 2010 14:25:46 GMT
Author: woonsan
Date: Wed Mar 31 14:25:45 2010
New Revision: 929549

URL: http://svn.apache.org/viewvc?rev=929549&view=rev
Log:
JS2-1102: Fixing the following problems in portal site manager portlet:
- new subfolders created by portal site manager do not appear in page navigator.
- various problems during moving/copying folders.
- the changes on folders are not reflected even when the folder re-expanded.

Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/AdminPortletWebPage.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/PageNavigator.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SiteBreadcrumbMenu.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/AdminPortletWebPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/AdminPortletWebPage.java?rev=929549&r1=929548&r2=929549&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/AdminPortletWebPage.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/AdminPortletWebPage.java
Wed Mar 31 14:25:45 2010
@@ -25,6 +25,7 @@ import javax.portlet.PortletResponse;
 
 import org.apache.commons.lang.BooleanUtils;
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
+import org.apache.jetspeed.request.RequestContext;
 import org.apache.wicket.Component;
 import org.apache.wicket.IPageMap;
 import org.apache.wicket.PageParameters;
@@ -185,6 +186,15 @@ public abstract class AdminPortletWebPag
     }
     
     /**
+     * Delegates the invocation to {@link AbstractAdminWebApplication#getPortalRequestContext()}.
+     * Please use the corresponding method of {@link AbstractAdminWebApplication} directly.
+     */
+    public RequestContext getPortalRequestContext()
+    {
+        return ((AbstractAdminWebApplication) getApplication()).getPortalRequestContext();
+    }
+    
+    /**
      * Delegates the invocation to {@link AbstractAdminWebApplication#setTitle(String)}.
      * Please use the corresponding method of {@link AbstractAdminWebApplication} directly.
      */

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java?rev=929549&r1=929548&r2=929549&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
Wed Mar 31 14:25:45 2010
@@ -578,11 +578,13 @@ public class PortalSiteManager extends A
                 {
                     excuteAction(getDocument(), REMOVE_ACTION);
                     DefaultMutableTreeNode node = getSelectedNode();
-                    DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node
-                            .getParent();
-                    parentNode.remove(node);
-                    LinkTree tree = (PortalTree) getPage().get("siteTree");
-                    tree.updateTree(target);
+                    if (node != null && node.getParent() != null)
+                    {
+                        DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent();
+                        parentNode.remove(node);
+                        LinkTree tree = (PortalTree) getPage().get("siteTree");
+                        tree.updateTree(target);
+                    }
                 }
             }.add(new JavascriptEventConfirmation("onclick", new ResourceModel("action.delete.confirm"))));
             infoForm.add(new AjaxButton("save",new ResourceModel("common.save"), infoForm)
@@ -2707,146 +2709,188 @@ public class PortalSiteManager extends A
                 @Override
                 protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                 {
-                    docAction(true, docOldName, getDocName(), docOldPath,
-                            getDocPath(), getCopyIds());
-                    ((ModalWindow) CopyMoveWindow.this.getParent())
-                            .close(target);
+                    docAction(true, docOldName, getDocName(), docOldPath, getDocPath(), getCopyIds());
+                    ((ModalWindow) CopyMoveWindow.this.getParent()).close(target);
                 }
 
                 @Override
                 protected void onError(AjaxRequestTarget target, Form<?> form)
                 {
-
                     target.addComponent(feedback);
                 }
             };
+            
             AjaxButton moveButton = new AjaxButton("move",new ResourceModel("common.move"),
copyForm)
             {
 
                 @Override
                 protected void onSubmit(AjaxRequestTarget target, Form<?> form)
                 {
-                    docAction(false, docOldName, getDocName(), docOldPath,
-                            getDocPath(), getCopyIds());
-                    ((ModalWindow) CopyMoveWindow.this.getParent())
-                            .close(target);
+                    docAction(false, docOldName, getDocName(), docOldPath, getDocPath(),
getCopyIds());
+                    ((ModalWindow) CopyMoveWindow.this.getParent()).close(target);
                 }
 
                 @Override
                 protected void onError(AjaxRequestTarget target, Form<?> form)
                 {
-
                     target.addComponent(feedback);
                 }
             };
+            
             copyButton.setVisibilityAllowed(true);
             moveButton.setVisibilityAllowed(true);
             copyForm.add(copyButton);
             copyForm.add(moveButton);
+            
             if (copyFlag)
             {
                 copyButton.setVisible(true);
                 moveButton.setVisible(false);
-            } else
+            }
+            else
             {
                 copyButton.setVisible(false);
                 moveButton.setVisible(true);
             }
+            
+            setCopyIds(!copyFlag);
+            
             // Adding menu tree node
-            DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(
-                    new SiteTreeNode("Root", "/", FileType.Folder, false));
+            DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(new SiteTreeNode("Root",
"/", FileType.Folder, false));
             retrieveCopyFolders("/", rootNode);
             copyTreeNode = new DefaultTreeModel(rootNode);
-            final LinkTree copyTree = new LinkTree("copyTree",
-                    new PropertyModel(this, "copyTreeNode"))
+            
+            final LinkTree copyTree = new LinkTree("copyTree", new PropertyModel(this, "copyTreeNode"))
             {
-
                 @Override
                 protected void onNodeLinkClicked(Object node, BaseTree tree,
                         AjaxRequestTarget target)
                 {
                     DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node;
-                    SiteTreeNode siteNode = (SiteTreeNode) treeNode
-                            .getUserObject();
+                    SiteTreeNode siteNode = (SiteTreeNode) treeNode.getUserObject();
+                    boolean needToUpdate = false;
+                    
                     if (!tree.getTreeState().isNodeExpanded(treeNode))
                     {
                         if (siteNode.getDocType() == SiteTreeNode.FileType.Folder
                                 && !siteNode.isLoaded())
                         {
-                            retrieveCopyFolders(siteNode.getNodePath(),
-                                    treeNode);
+                            retrieveCopyFolders(siteNode.getNodePath(), treeNode);
                             siteNode.setLoaded(false);
-                            this.updateTree();
+                            needToUpdate = true;
                         }
+                        
                         this.getTreeState().expandNode(treeNode);
-                    } else
+                    }
+                    else
                     {
                         tree.getTreeState().collapseNode(treeNode);
                     }
+                    
+                    this.getTreeState().selectNode(treeNode, true);
+                    
+                    if (needToUpdate)
+                    {
+                        this.updateTree();
+                    }
+                    
                     setDocPath(siteNode.getNodePath());
                 }
             };
+            
             copyTree.getTreeState().expandNode(copyTreeNode);
             add(copyTree);
             add(copyForm);
         }
         
-        private void docAction(boolean copy, String oldName, String newName,
-                String oldPath, String newPath, boolean copyIds)
+        private void docAction(boolean copy, String oldName, String newName, String oldPath,
String newPath, boolean copyIds)
         {
             FileType docType = getUserSelectedNode().getDocType();
+            
             if (getUserSelectedNode().getDocType() == FileType.Folder)
             {
-                Folder tmpFolder = getJetspeedFolder(oldPath);
-                Folder newFolder;
+                Folder sourceFolder = getJetspeedFolder(oldPath);
+                Node sourceParentNode = sourceFolder.getParent();
+                
                 try
                 {
-                    newFolder = getServiceLocator().getPageManager()
-                            .copyFolder(tmpFolder,
-                                    newPath + JETSPEED_PATH_SEPRATOR + newName);
-                    folderAction(newFolder, SAVE_ACTION);
+                    String destFolderPath = newPath + JETSPEED_PATH_SEPRATOR + newName;
+                    getServiceLocator().getPageManager().deepCopyFolder(sourceFolder, destFolderPath,
getFolderOwner(sourceFolder));
+                    
+                    Folder destFolder = getServiceLocator().getPageManager().getFolder(destFolderPath);
+                    if (destFolder.getParent() != null)
+                    {
+                        setFolderTreeNodeLoadedByPath(destFolder.getParent(), false);
+                    }
+                    
                     if (!copy)
                     {
-                        folderAction(tmpFolder, REMOVE_ACTION);
+                        folderAction(sourceFolder, REMOVE_ACTION);
+                        
+                        if (sourceParentNode != null)
+                        {
+                            setFolderTreeNodeLoadedByPath(sourceParentNode, false);
+                        }
                     }
                 }
-                catch (NodeException e)
+                catch (Exception e)
                 {
                     log.error("Failed to copy folder.", e);
                 }
-            } else if (docType == FileType.Page)
+            }
+            else if (docType == FileType.Page)
             {
-                Page tmpPage = getJetspeedPage(oldPath);
-                Page newPage;
+                Page sourcePage = getJetspeedPage(oldPath);
+                Node sourceParentNode = sourcePage.getParent();
+                
                 try
                 {
-                    newPage = getServiceLocator().getPageManager()
-                            .copyPage(tmpPage,
-                                    newPath + JETSPEED_PATH_SEPRATOR + newName,
-                                    copyIds);
+                    Page newPage = getServiceLocator().getPageManager().copyPage(sourcePage,
newPath + JETSPEED_PATH_SEPRATOR + newName, copyIds);
                     PageAction(newPage, SAVE_ACTION);
+                    
+                    if (newPage.getParent() != null)
+                    {
+                        setFolderTreeNodeLoadedByPath(newPage.getParent(), false);
+                    }
+                    
                     if (!copy)
                     {
-                        PageAction(tmpPage, REMOVE_ACTION);
+                        PageAction(sourcePage, REMOVE_ACTION);
+                        
+                        if (sourceParentNode != null)
+                        {
+                            setFolderTreeNodeLoadedByPath(sourceParentNode, false);
+                        }
                     }
                 }
                 catch (NodeException e)
                 {
                     log.error("Failed to copy page.", e);
                 }
-            } else if (docType == FileType.Link)
+            }
+            else if (docType == FileType.Link)
             {
-                Link tmpLink = getJetspeedLink(oldPath);
-                Link newLink;
+                Link sourceLink = getJetspeedLink(oldPath);
+                Node sourceParentNode = sourceLink.getParent();
+                
                 try
                 {
-                    newLink = getServiceLocator().getPageManager()
-                            .copyLink(tmpLink,
-                                    newPath + JETSPEED_PATH_SEPRATOR + newName);
+                    Link newLink = getServiceLocator().getPageManager().copyLink(sourceLink,
newPath + JETSPEED_PATH_SEPRATOR + newName);
                     linkAction(newLink, SAVE_ACTION);
+                    
+                    if (newLink.getParent() != null)
+                    {
+                        setFolderTreeNodeLoadedByPath(newLink.getParent(), false);
+                    }
+                    
                     if (!copy)
                     {
-                        linkAction(tmpLink, REMOVE_ACTION);
+                        linkAction(sourceLink, REMOVE_ACTION);
+                        
+                        if (sourceParentNode != null)
+                        {
+                            setFolderTreeNodeLoadedByPath(sourceParentNode, false);
+                        }
                     }
                 }
                 catch (NodeException e)
@@ -3283,9 +3327,13 @@ public class PortalSiteManager extends A
         treeRoot = new DefaultTreeModel(rootNode);
         return rootNode;
     }
-
-    private DefaultMutableTreeNode retrieveFolders(String folderPath,
-            DefaultMutableTreeNode rootNode)
+    
+    private DefaultMutableTreeNode retrieveFolders(String folderPath, DefaultMutableTreeNode
rootNode)
+    {
+        return retrieveFolders(folderPath, rootNode, true);
+    }
+    
+    private DefaultMutableTreeNode retrieveFolders(String folderPath, DefaultMutableTreeNode
rootNode, boolean cleanBeforeRetrieve)
     {
         try
         {
@@ -3293,30 +3341,36 @@ public class PortalSiteManager extends A
             Folder folder;
             DefaultMutableTreeNode tmpNode;
             Page page;
-            Folder rootfolder = getServiceLocator().getPageManager().getFolder(
-                    folderPath);
+            Folder rootfolder = getServiceLocator().getPageManager().getFolder(folderPath);
+            
             if (rootNode == null)
             {
-                rootNode = new DefaultMutableTreeNode(new SiteTreeNode(
-                        rootfolder, true));
+                rootNode = new DefaultMutableTreeNode(new SiteTreeNode(rootfolder, true));
+            }
+            
+            if (cleanBeforeRetrieve)
+            {
+                rootNode.removeAllChildren();
             }
+            
             Iterator folders = rootfolder.getFolders().iterator();
             while (folders.hasNext())
             {
                 folder = (Folder) folders.next();
+                
                 if (rootfolder.getPath().equals("/_user"))
                 {
                     if (folder.getName().startsWith("template"))
                     {
-                        rootNode.add(new DefaultMutableTreeNode(
-                                new SiteTreeNode(folder)));
+                        rootNode.add(new DefaultMutableTreeNode(new SiteTreeNode(folder)));
                     }
-                } else
+                }
+                else
                 {
-                    rootNode.add(new DefaultMutableTreeNode(new SiteTreeNode(
-                            folder)));
+                    rootNode.add(new DefaultMutableTreeNode(new SiteTreeNode(folder)));
                 }
             }
+            
             Iterator pages = rootfolder.getPages().iterator();
             while (pages.hasNext())
             {
@@ -3325,6 +3379,7 @@ public class PortalSiteManager extends A
                 tmpNode.setAllowsChildren(false);
                 rootNode.add(tmpNode);
             }
+            
             Iterator links = rootfolder.getLinks().iterator();
             while (links.hasNext())
             {
@@ -3338,6 +3393,7 @@ public class PortalSiteManager extends A
         {
             log.error("Failed to retrieve folders ", e);
         }
+        
         return rootNode;
     }
 
@@ -3841,7 +3897,49 @@ public class PortalSiteManager extends A
         }
         return (dir.delete());
     }
-
+    
+    private void setFolderTreeNodeLoadedByPath(final Node node, boolean loaded)
+    {
+        DefaultMutableTreeNode destParentTreeNode = getTreeNodeByPath(node.getPath());
+        SiteTreeNode siteTreeNode = (SiteTreeNode) destParentTreeNode.getUserObject();
+        siteTreeNode.setLoaded(loaded);
+    }
+    
+    private DefaultMutableTreeNode getTreeNodeByPath(String path)
+    {
+        PortalTree tree = (PortalTree) getPage().get("siteTree");
+        TreeModel treeModel = tree.getModelObject();
+        List<DefaultMutableTreeNode> treeNodeList = new ArrayList<DefaultMutableTreeNode>();
+        findTreeNodeByPath((DefaultMutableTreeNode) treeModel.getRoot(), path, treeNodeList,
1);
+        return (treeNodeList.isEmpty() ? null : treeNodeList.get(0));
+    }
+    
+    private void findTreeNodeByPath(DefaultMutableTreeNode node, String path, List<DefaultMutableTreeNode>
treeNodeList, int maxSize)
+    {
+        SiteTreeNode siteTreeNode = (SiteTreeNode) node.getUserObject();
+        
+        if (siteTreeNode != null && path.equals(siteTreeNode.getNodePath()))
+        {
+            treeNodeList.add(node);
+        }
+        
+        if (treeNodeList.size() >= maxSize)
+        {
+            return;
+        }
+        
+        for (Enumeration children = node.children(); children.hasMoreElements(); )
+        {
+            DefaultMutableTreeNode child = (DefaultMutableTreeNode) children.nextElement();
+            findTreeNodeByPath(child, path, treeNodeList, maxSize);
+            
+            if (treeNodeList.size() >= maxSize)
+            {
+                return;
+            }
+        }
+    }
+    
     private DefaultMutableTreeNode getSelectedNode()
     {
         PortalTree tree = (PortalTree) getPage().get("siteTree");
@@ -4545,7 +4643,12 @@ public class PortalSiteManager extends A
         }
         return folder;
     }
-
+    
+    protected void invalidatePortalSiteSessionContext()
+    {
+        getPortalRequestContext().setSessionAttribute(PortalReservedParameters.PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY,
null);
+    }
+    
     protected boolean folderAction(Folder folder, String action)
     {
         if (action.equals(SAVE_ACTION))
@@ -4553,13 +4656,14 @@ public class PortalSiteManager extends A
             try
             {
                 getServiceLocator().getPageManager().updateFolder(folder);
+                invalidatePortalSiteSessionContext();
             }
             catch (FolderNotUpdatedException e)
             {
                 log.error("Folder is not updated.", e);
                 return false;
             }
-            catch (NodeException e)
+            catch (Exception e)
             {
                 log.error("Unexpected exception.", e);
                 return false;
@@ -4570,13 +4674,14 @@ public class PortalSiteManager extends A
             try
             {
                 getServiceLocator().getPageManager().removeFolder(folder);
+                invalidatePortalSiteSessionContext();
             }
             catch (FolderNotRemovedException e)
             {
                 log.error("Folder is not removed.", e);
                 return false;
             }
-            catch (NodeException e)
+            catch (Exception e)
             {
                 log.error("Unexpected exception.", e);
                 return false;
@@ -4592,13 +4697,9 @@ public class PortalSiteManager extends A
             try
             {
                 getServiceLocator().getPageManager().updatePage(page);
+                invalidatePortalSiteSessionContext();
             }
-            catch (FolderNotUpdatedException e)
-            {
-                log.error("Folder is not updated.", e);
-                return false;
-            }
-            catch (NodeException e)
+            catch (Exception e)
             {
                 log.error("Unexpected exception.", e);
                 return false;
@@ -4609,13 +4710,9 @@ public class PortalSiteManager extends A
             try
             {
                 getServiceLocator().getPageManager().removePage(page);
+                invalidatePortalSiteSessionContext();
             }
-            catch (FolderNotRemovedException e)
-            {
-                log.error("Folder is not removed.", e);
-                return false;
-            }
-            catch (NodeException e)
+            catch (Exception e)
             {
                 log.error("Unexpected exception.", e);
                 return false;
@@ -4631,13 +4728,9 @@ public class PortalSiteManager extends A
             try
             {
                 getServiceLocator().getPageManager().updateLink(link);
+                invalidatePortalSiteSessionContext();
             }
-            catch (FolderNotUpdatedException e)
-            {
-                log.error("Folder is not updated.", e);
-                return false;
-            }
-            catch (NodeException e)
+            catch (Exception e)
             {
                 log.error("Unexpected exception.", e);
                 return false;
@@ -4648,13 +4741,9 @@ public class PortalSiteManager extends A
             try
             {
                 getServiceLocator().getPageManager().removeLink(link);
+                invalidatePortalSiteSessionContext();
             }
-            catch (FolderNotRemovedException e)
-            {
-                log.error("Folder is not removed.", e);
-                return false;
-            }
-            catch (NodeException e)
+            catch (Exception e)
             {
                 log.error("Unexpected exception.", e);
                 return false;
@@ -5055,4 +5144,18 @@ public class PortalSiteManager extends A
         
         return siteTreeNode;
     }
+    
+    private String getFolderOwner(final Folder folder)
+    {
+        String owner = null;
+        
+        SecurityConstraints constraints = folder.getSecurityConstraints();
+        
+        if (constraints != null)
+        {
+            owner = constraints.getOwner();
+        }
+        
+        return owner;
+    }
 }   

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/PageNavigator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/PageNavigator.java?rev=929549&r1=929548&r2=929549&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/PageNavigator.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/PageNavigator.java
Wed Mar 31 14:25:45 2010
@@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletReq
 import org.apache.commons.lang.StringUtils;
 import org.apache.jetspeed.CommonPortletServices;
 import org.apache.jetspeed.Jetspeed;
+import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.administration.PortalAdministration;
 import org.apache.jetspeed.container.url.BasePortalURL;
 import org.apache.jetspeed.om.folder.Folder;
@@ -66,12 +67,12 @@ public class PageNavigator extends Gener
     /**
      * PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY - session portal site context attribute key
      */
-    private static String PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY = "org.apache.jetspeed.portalsite.PortalSiteSessionContext";
+    private static String PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY = PortalReservedParameters.PORTAL_SITE_SESSION_CONTEXT_ATTR_KEY;
 
     /**
      * PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY - request portal site context attribute key
      */
-    private static String PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY = "org.apache.jetspeed.portalsite.PortalSiteRequestContext";
+    private static String PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY = PortalReservedParameters.PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY;
     
     public static final String DEFAULT_PAGES_MENU = "pages";
     public static final String DEFAULT_LINKS_MENU = "links";

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SiteBreadcrumbMenu.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SiteBreadcrumbMenu.java?rev=929549&r1=929548&r2=929549&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SiteBreadcrumbMenu.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SiteBreadcrumbMenu.java
Wed Mar 31 14:25:45 2010
@@ -21,7 +21,6 @@ import java.io.Serializable;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
-import java.util.Stack;
 
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
@@ -30,9 +29,8 @@ import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
 import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.administration.PortalAdministration;
-import org.apache.jetspeed.page.PageManager;
-import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.portalsite.Menu;
 import org.apache.jetspeed.portalsite.MenuElement;
 import org.apache.jetspeed.portalsite.MenuOption;
@@ -49,7 +47,7 @@ import org.apache.portals.bridges.common
  */
 public class SiteBreadcrumbMenu extends GenericServletPortlet
 {
-    public static final String PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY = "org.apache.jetspeed.portalsite.PortalSiteRequestContext";
+    public static final String PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY = PortalReservedParameters.PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY;
     
     private Spaces spacesService;
     private PortalAdministration admin;

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java?rev=929549&r1=929548&r2=929549&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/wicket/AbstractAdminWebApplication.java
Wed Mar 31 14:25:45 2010
@@ -116,7 +116,12 @@ public abstract class AbstractAdminWebAp
     {
         return ((PortletRequestContext) RequestContext.get()).getPortletRequest();
     }
-
+    
+    public org.apache.jetspeed.request.RequestContext getPortalRequestContext()
+    {
+        return (org.apache.jetspeed.request.RequestContext) getPortletRequest().getAttribute(org.apache.jetspeed.request.RequestContext.REQUEST_PORTALENV);
+    }
+    
     public PortletResponse getPortletResponse()
     {
         return ((PortletRequestContext) RequestContext.get()).getPortletResponse();



---------------------------------------------------------------------
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