portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r808139 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main: java/org/apache/jetspeed/portlets/spaces/ java/org/apache/jetspeed/portlets/toolbox/ webapp/WEB-INF/ webapp/WEB-INF/view/spaces/ webapp/WEB-INF/view/toolbox/ webapp/css/
Date Wed, 26 Aug 2009 17:53:59 GMT
Author: taylor
Date: Wed Aug 26 17:53:58 2009
New Revision: 808139

URL: http://svn.apache.org/viewvc?rev=808139&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-1057

Initial implementation of JetspeedToolbox and JetspeedNavigator portlets. They are testing in both desktop and portal mode.

Added:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/JetspeedNavigator.java   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesNavigator.java   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/toolbox/
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/toolbox/JetspeedToolbox.java   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/navigator.jsp   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces.vm   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp   (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/css/spaces.css   (with props)
Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/JetspeedNavigator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/JetspeedNavigator.java?rev=808139&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/JetspeedNavigator.java (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/JetspeedNavigator.java Wed Aug 26 17:53:58 2009
@@ -0,0 +1,214 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.spaces;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.administration.PortalAdministration;
+import org.apache.jetspeed.cache.JetspeedCacheMonitor;
+import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.spaces.Space;
+import org.apache.jetspeed.spaces.Spaces;
+import org.apache.portals.bridges.common.GenericServletPortlet;
+
+/**
+ * Jetspeed Navigator
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class JetspeedNavigator extends GenericServletPortlet
+{
+    private Spaces spacesService;
+    private PortalAdministration admin;
+
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+        PortletContext context = getPortletContext();
+        spacesService = (Spaces) context.getAttribute(CommonPortletServices.CPS_SPACES_SERVICE);
+        if (spacesService == null)
+                throw new PortletException(
+                        "Could not get instance of portal spaces service component");
+        admin = (PortalAdministration) getPortletContext().getAttribute(
+                CommonPortletServices.CPS_PORTAL_ADMINISTRATION);
+        if (null == admin) { throw new PortletException(
+                "Failed to find the Portal Administration on portlet initialization"); }        
+    }
+
+    @SuppressWarnings("unchecked")
+    public void doView(RenderRequest request, RenderResponse response)
+            throws PortletException, IOException
+    {    
+        Space space = null;
+        String spaceName = (String)request.getPortletSession().getAttribute("space", PortletSession.PORTLET_SCOPE);               
+        List<Space> spaces = (List<Space>)request.getPortletSession().getAttribute("spaces", PortletSession.PORTLET_SCOPE);
+        if (spaces == null)
+        {
+            // TODO: use environment
+            spaces = spacesService.listSpaces();
+        }              
+        request.getPortletSession().setAttribute("spaces", spaces, PortletSession.PORTLET_SCOPE);        
+        request.setAttribute("spaces", spaces);        
+        if (spaceName != null)
+        {
+            for (Space sp: spaces)
+            {
+                if (sp.getName().equals(spaceName))
+                {
+                    space = sp;
+                    break;
+                }
+            }
+            if (space == null)
+            {                
+                space = spaces.get(0);
+                spaceName = space.getName();
+            }            
+        }
+        else
+        {
+            spaceName = "Home";
+        }
+        request.setAttribute("space", space);
+        request.getPortletSession().setAttribute("space", spaceName, PortletSession.PORTLET_SCOPE);        
+        
+        List<Page> pages = (List<Page>)request.getPortletSession().getAttribute("pages", PortletSession.PORTLET_SCOPE);
+        if (pages == null)
+        {
+            if (space != null)
+                pages = spacesService.listPages(space);
+            else
+                pages = new ArrayList<Page>();
+        }        
+        request.setAttribute("pages", pages);
+        //request.getPortletSession().setAttribute("space", spaceName, PortletSession.PORTLET_SCOPE);        
+        
+        String tab = (String)request.getPortletSession().getAttribute("tab", PortletSession.PORTLET_SCOPE);
+        if (tab == null)
+        {
+            tab = "spaces";
+            request.getPortletSession().setAttribute("tab", tab, PortletSession.PORTLET_SCOPE);
+        }
+        request.setAttribute("tab", tab);
+        
+        if (tab.equals("spaces"))
+        {
+            request.setAttribute("title", "Default Spaces");
+        }
+        else 
+        {
+            request.setAttribute("title", spaceName);            
+        }
+        try
+        {
+            super.doView(request, response);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+        }
+    }
+    
+    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException,
+    IOException
+    {
+        String tab = actionRequest.getParameter("tab");
+        if (tab == null)
+        {
+            tab = "spaces";
+        }
+        if (tab.equals("dashboard"))
+        {
+//            List<Page> pages = null;
+//            String spaceName = (String)actionRequest.getPortletSession().getAttribute("space", PortletSession.PORTLET_SCOPE);               
+//
+//            if (spaceName == null)
+//            {
+//                spaceName = "Home";
+//            }               
+//            List<Space> spaces = spacesService.listSpaces();
+//            Space space = null;
+//            for (Space sp: spaces)
+//            {
+//                if (sp.getName().equals(spaceName))
+//                {
+//                    space = sp;
+//                    break;
+//                }
+//            }
+//            if (space == null)
+//            {                
+//                space = spaces.get(0);
+//                spaceName = space.getName();
+//            }                        
+            String path = admin.getPortalURL(actionRequest, actionResponse, "/default-page.psml");
+            actionRequest.getPortletSession().setAttribute("space", "Home", PortletSession.PORTLET_SCOPE);     
+            actionRequest.getPortletSession().setAttribute("tab", "pages", PortletSession.PORTLET_SCOPE);
+            actionResponse.sendRedirect(path);   
+            return;
+        }
+        actionRequest.getPortletSession().setAttribute("tab", tab, PortletSession.PORTLET_SCOPE);            
+        String space = actionRequest.getParameter("space");
+        if (space != null)
+        {
+            Space s = getSpaceFromName(space);
+            String path = admin.getPortalURL(actionRequest, actionResponse, s.getPath());
+            actionRequest.getPortletSession().setAttribute("space", space, PortletSession.PORTLET_SCOPE);     
+            actionRequest.getPortletSession().setAttribute("tab", "pages", PortletSession.PORTLET_SCOPE);
+            actionResponse.sendRedirect(path);
+            return;
+        }
+        String page = actionRequest.getParameter("page");
+        if (page != null)
+        {
+            String path = admin.getPortalURL(actionRequest, actionResponse, page);
+//            actionRequest.getPortletSession().setAttribute("space", space, PortletSession.PORTLET_SCOPE);     
+            actionRequest.getPortletSession().setAttribute("tab", "pages", PortletSession.PORTLET_SCOPE);
+            actionResponse.sendRedirect(path);            
+        }
+
+    }    
+    
+    protected Space getSpaceFromName(String spaceName)
+    {
+        List<Space> spaces = spacesService.listSpaces();
+        Space space = null;
+        for (Space sp: spaces)
+        {
+            if (sp.getName().equals(spaceName))
+            {
+                space = sp;
+                break;
+            }
+        }
+        return space;
+    }
+    
+}
\ No newline at end of file

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/JetspeedNavigator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/JetspeedNavigator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesNavigator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesNavigator.java?rev=808139&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesNavigator.java (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesNavigator.java Wed Aug 26 17:53:58 2009
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.spaces;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.portlets.dojo.AbstractAdminDojoVelocityPortlet;
+
+import org.apache.jetspeed.spaces.Space;
+import org.apache.jetspeed.spaces.Spaces;
+
+
+/**
+ * Spaces Navigator Portlet
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class SpacesNavigator extends AbstractAdminDojoVelocityPortlet
+{
+    private Spaces spacesService;
+    
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+        PortletContext context = getPortletContext();
+        spacesService = (Spaces) context.getAttribute(CommonPortletServices.CPS_SPACES_SERVICE);
+        if (spacesService == null)
+                throw new PortletException(
+                        "Could not get instance of portal spaces service component");
+    }
+   
+    @SuppressWarnings("unchecked")
+    public void doView(RenderRequest request, RenderResponse response)
+            throws PortletException, IOException
+    {
+        
+        List<Space> spaces = (List<Space>)request.getPortletSession().getAttribute("spaces", PortletSession.PORTLET_SCOPE);
+        if (spaces == null)
+        {
+            spaces = spacesService.listSpaces();
+        }
+        getContext(request).put("spaces", spaces);
+        super.doView(request, response);
+    }
+    
+}

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesNavigator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesNavigator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/toolbox/JetspeedToolbox.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/toolbox/JetspeedToolbox.java?rev=808139&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/toolbox/JetspeedToolbox.java (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/toolbox/JetspeedToolbox.java Wed Aug 26 17:53:58 2009
@@ -0,0 +1,541 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.toolbox;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Random;
+import java.util.StringTokenizer;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.components.portletregistry.PortletRegistry;
+import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.om.portlet.InitParam;
+import org.apache.jetspeed.om.portlet.LocalizedField;
+import org.apache.jetspeed.om.portlet.PortletApplication;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+import org.apache.jetspeed.page.PageManager;
+import org.apache.jetspeed.page.PageNotUpdatedException;
+import org.apache.jetspeed.page.document.NodeException;
+import org.apache.jetspeed.portlets.CategoryInfo;
+import org.apache.jetspeed.portlets.PortletInfo;
+import org.apache.jetspeed.profiler.Profiler;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.search.ParsedObject;
+import org.apache.jetspeed.search.SearchEngine;
+import org.apache.jetspeed.security.SecurityAccessController;
+import org.apache.portals.bridges.common.GenericServletPortlet;
+
+/**
+ * Jetspeed Toolbox
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class JetspeedToolbox extends GenericServletPortlet implements Comparator
+{
+    protected PortletRegistry registry;
+    protected SearchEngine searchEngine;
+    protected PageManager pageManager;
+    protected Profiler profiler;
+    protected SecurityAccessController securityAccessController;
+    protected Random rand;
+    
+    public final String[] DEFAULT_IMAGES = new String[]
+                                                      {
+                                                              "images/portlets/applications-development.png",
+                                                              "images/portlets/applications-system.png",
+                                                              "images/portlets/applications-other.png",
+                                                              "images/portlets/linux.png"
+                                                      };
+    public final static String PORTLET_ICON = "portlet-icon";
+    
+
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+        PortletContext context = getPortletContext();                
+        registry = (PortletRegistry)context.getAttribute(CommonPortletServices.CPS_REGISTRY_COMPONENT);
+        if (null == registry)
+        {
+            throw new PortletException("Failed to find the Portlet Registry on portlet initialization");
+        }        
+        searchEngine = (SearchEngine)context.getAttribute(CommonPortletServices.CPS_SEARCH_COMPONENT);
+        if (null == searchEngine)
+        {
+            throw new PortletException("Failed to find the Search Engine on portlet initialization");
+        }
+        pageManager = (PageManager)context.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
+        if (null == pageManager)
+        {
+            throw new PortletException("Failed to find the Page Manager on portlet initialization");
+        }        
+        securityAccessController = (SecurityAccessController)context.getAttribute(CommonPortletServices.CPS_SECURITY_ACCESS_CONTROLLER);
+        if (null == securityAccessController)
+        {
+            throw new PortletException("Failed to find the Security Access Controller on portlet initialization");
+        }
+        profiler = (Profiler)context.getAttribute(CommonPortletServices.CPS_PROFILER_COMPONENT);
+        if (null == profiler)
+        {
+            throw new PortletException("Failed to find the Profiler on portlet initialization");
+        }        
+        rand = new Random( 19580427 );
+    }
+
+    @SuppressWarnings("unchecked")
+    public void doView(RenderRequest request, RenderResponse response)
+            throws PortletException, IOException
+    {
+        String category = request.getParameter("category");
+        String filter = request.getParameter("filter");
+        if (filter == null ||  filter.equals("")) filter = null;       
+        if (category == null || category.equals("")) category = "All";
+
+        List<PortletInfo> portlets = retrievePortlets(request, null);
+        request.setAttribute("portlets", portlets);
+        //request.setAttribute(("category", category);
+        request.setAttribute("categories", retrieveCategories(request));
+        
+        String tab = (String)request.getPortletSession().getAttribute("tab", PortletSession.PORTLET_SCOPE);
+        if (tab == null)
+        {
+            tab = "portlets";
+            request.getPortletSession().setAttribute("tab", tab, PortletSession.PORTLET_SCOPE);
+        }
+        request.setAttribute("tab", tab);
+        
+        
+        
+        String hideShow = (String)request.getPortletSession().getAttribute("hideShow", PortletSession.PORTLET_SCOPE);
+        if (hideShow == null)
+        {
+            hideShow = "Hide";
+            request.getPortletSession().setAttribute("hideShow", hideShow, PortletSession.PORTLET_SCOPE);
+        }        
+        request.setAttribute("hideShow", hideShow);
+        super.doView(request, response);        
+    }
+    
+    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException,
+    IOException
+    {
+        String tab = actionRequest.getParameter("tab");
+        if (tab == null)
+        {
+            tab = "portlets";
+        }
+        actionRequest.getPortletSession().setAttribute("tab", tab, PortletSession.PORTLET_SCOPE);
+        String hideShow = actionRequest.getParameter("hideShow");
+        if (hideShow != null)
+        {
+            if (hideShow.equals("Hide"))
+                hideShow = "Show";
+            else
+                hideShow = "Hide";
+            actionRequest.getPortletSession().setAttribute("hideShow", hideShow, PortletSession.PORTLET_SCOPE);
+        }
+        String category = actionRequest.getParameter("category");
+        if (category != null)
+        {
+            CategoryResult result = getPortlets(actionRequest, category, "1", 10, null);    
+            actionRequest.getPortletSession().setAttribute("portlets", result.getList(),  PortletSession.PORTLET_SCOPE);
+        }
+        String filter = actionRequest.getParameter("filter");
+        if (filter != null)
+        {
+            if (filter.trim().equals(""))
+            {
+                filter = null;
+                category = "all";
+                actionRequest.getPortletSession().removeAttribute("portlets", PortletSession.PORTLET_SCOPE);
+            }
+            else
+                category = null;
+            CategoryResult result = getPortlets(actionRequest, category, "1", 10, filter);    
+            actionRequest.getPortletSession().setAttribute("portlets", result.getList(),  PortletSession.PORTLET_SCOPE);
+        }
+        
+        String portletAdd = actionRequest.getParameter("portletAdd");
+        if (portletAdd != null)
+        {
+            RequestContext requestContext = (RequestContext) actionRequest.getAttribute(RequestContext.REQUEST_PORTALENV);            
+            Page page = requestContext.getPage();            
+            Fragment fragment = pageManager.newFragment();
+            fragment.setType( Fragment.PORTLET );
+            fragment.setName(portletAdd);            
+            page.getRootFragment().getFragments().add(fragment);
+            try
+            {
+                pageManager.updatePage(page);
+            }
+            catch (PageNotUpdatedException e)
+            {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+            catch (NodeException e)
+            {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+    }    
+    
+    @SuppressWarnings("unchecked")
+    public List<PortletInfo> retrievePortlets(PortletRequest request, String filter)
+    {
+        List<PortletInfo> portletsList = (List<PortletInfo>)request.getPortletSession().getAttribute("portlets", PortletSession.PORTLET_SCOPE);
+        if (filter == null && portletsList != null)
+        {
+            return portletsList;
+        }        
+        Iterator portlets = null;
+        List list = new ArrayList();
+        Locale locale = request.getLocale();                
+        if (filter == null)
+            portlets = registry.getAllPortletDefinitions().iterator();
+        else
+            portlets = searchEngine.search(filter).getResults().iterator();        
+        while (portlets.hasNext())
+        {
+            PortletDefinition portlet = null;
+            if (filter == null)
+                portlet = (PortletDefinition)portlets.next();
+            else
+                portlet = getPortletFromParsedObject((ParsedObject)portlets.next());
+            
+            PortletInfo portletInfo = filterPortlet(portlet, locale, request);
+            if (portletInfo != null)
+            {
+                list.add(portletInfo);
+            }
+        }            
+        Collections.sort(list, this);
+//        if (filter == null ) 
+            request.getPortletSession().setAttribute("portlets", list,  PortletSession.PORTLET_SCOPE);
+        return list;
+    }
+ 
+    protected PortletDefinition getPortletFromParsedObject(ParsedObject po)
+    {
+        boolean found = false;
+        String name = "";
+        Map fields = po.getFields();
+        if(fields != null)
+        {
+            Object id = fields.get("ID");
+    
+            if(id != null)
+            {
+                if(id instanceof Collection)
+                {
+                    Collection coll = (Collection)id;
+                    name = (String) coll.iterator().next();
+                }
+                else
+                {
+                    name = (String)id;
+                }
+            }
+            
+            if(po.getType().equals("portlet"))
+            {
+                Object pa = fields.get("portlet_application");
+                String paName = "";
+                if(pa != null)
+                {
+                    if(id instanceof Collection)
+                    {
+                        Collection coll = (Collection)pa;
+                        paName = (String) coll.iterator().next();
+                    }
+                    else
+                    {
+                        paName = (String)pa;
+                    }
+                }
+                name = paName + "::" + name;
+                found = true;
+            }
+        }
+        if (found == false)
+            return null;
+        
+        return registry.getPortletDefinitionByUniqueName(name);
+    }
+ 
+    /**
+     * Filters portlets being added to the based on security checks and layout criteria
+     * 
+     * @param portlet
+     * @return null if filtered, otherwise PortletInfo to be added to list
+     */
+    protected PortletInfo filterPortlet(PortletDefinition portlet, Locale locale, PortletRequest request)
+    {
+        if (portlet == null)
+            return null;
+        if (filterByRole(portlet, request))
+        {
+            return null; 
+        }        
+        // Do not display Jetspeed Layout Applications
+        PortletApplication pa = (PortletApplication)portlet.getApplication();
+        if (pa.isLayoutApplication())
+            return null;
+        
+        // SECURITY filtering
+        String uniqueName = pa.getName() + "::" + portlet.getPortletName();
+        if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
+        {
+            InitParam param = portlet.getInitParam(PORTLET_ICON);
+            String image;
+            if (param != null)
+            {                
+                //String relativeImagePath = param.getValue();
+                //String context = muta.getWebApplicationDefinition().getContextRoot();
+                // Have to use a supported icon in jetspeed, otherwise image can be out of skew
+                String  imagePath = param.getParamValue();
+                if (imagePath == null)
+                {
+                    image = DEFAULT_IMAGES[rand.nextInt(DEFAULT_IMAGES.length)];
+                }
+                else
+                {
+                    if (-1 == imagePath.indexOf("/"))
+                        image = "images/portlets/" + param.getParamValue();
+                    else
+                        image = param.getParamValue();
+                }
+            }
+            else
+            {
+                image = DEFAULT_IMAGES[rand.nextInt(DEFAULT_IMAGES.length)];
+            }
+            return new PortletInfo(uniqueName, cleanup(portlet.getDisplayNameText(locale)), cleanup(portlet.getDescriptionText(locale)), image);
+        }
+        return null;
+    }
+ 
+    public int compare(Object obj1, Object obj2)
+    {
+        PortletInfo portlet1 = (PortletInfo)obj1;
+        PortletInfo portlet2 = (PortletInfo)obj2;
+        String name1 = portlet1.getDisplayName();
+        String name2 = portlet2.getDisplayName();
+        name1 = (name1 == null) ? "unknown" : name1;
+        name2 = (name2 == null) ? "unknown" : name2;
+        return name1.compareTo(name2);
+    }
+    
+    protected boolean filterByRole(PortletDefinition portlet, PortletRequest request)
+    {
+        boolean doFilter = false;
+        Collection c = portlet.getMetadata().getFields("selector.conditional.role");
+        if (c != null) 
+        {
+            Iterator it = c.iterator();
+            if (it.hasNext()) 
+            {
+                LocalizedField roleField = (LocalizedField) it.next();
+                String role = roleField.getValue();
+                if (role != null)
+                {
+                    if (role.equals("*"))
+                        doFilter = true;
+                    else
+                    {
+                        return (!request.isUserInRole(role));
+                    }
+                }
+            }
+        }
+        return doFilter;
+    }
+ 
+    protected String cleanup(String str)
+    {
+        if (str == null)
+            return str;
+        return str.replaceAll("\r|\n|\"|\'", "");
+    }
+ 
+    @SuppressWarnings("unchecked")
+    public List<CategoryInfo> retrieveCategories(PortletRequest request)
+    throws PortletException
+    {
+        List<CategoryInfo> categories = (List)request.getPortletSession().getAttribute("categories");
+        if (categories != null)
+        {
+            return categories;
+        }
+        Locale locale = request.getLocale();        
+        categories = new ArrayList<CategoryInfo>();
+        PortletPreferences prefs = request.getPreferences();
+        String cats = prefs.getValue("Categories", null);
+        if (cats == null)
+        {
+            throw new PortletException("No categories defined, please add categories via edit mode.");
+        }
+        StringTokenizer catTokenizer = new StringTokenizer(cats, ",");
+        while (catTokenizer.hasMoreTokens())
+        {
+            String name = catTokenizer.nextToken().trim();
+            CategoryInfo cat = new CategoryInfo(name);
+            String keywords = prefs.getValue("Keywords:" + name, null);
+            if (keywords != null)
+            {
+                StringTokenizer keyTokenizer = new StringTokenizer(keywords, ",");
+                StringBuffer searchString = new StringBuffer();
+                int count = 0;
+                while (keyTokenizer.hasMoreTokens())
+                {
+                    String keyword = keyTokenizer.nextToken().trim();
+                    if (count > 0)
+                    {
+                        searchString.append(" | ");
+                    }
+                    searchString.append(keyword);
+                    count++;
+                }
+                if (count > 0)
+                {
+                    Iterator portlets = searchEngine.search(searchString.toString()).getResults().iterator();
+                    while (portlets.hasNext())
+                    {
+                        PortletDefinition portlet = 
+                            getPortletFromParsedObject((ParsedObject)portlets.next());
+                        PortletInfo portletInfo = filterPortlet(portlet, locale, request);
+                        if (portletInfo != null)
+                        {
+                            cat.addPortlet(portletInfo);
+                        }                    
+                    }                
+                    Collections.sort(cat.getPortlets(), this);
+                    categories.add(cat);
+                }
+            }
+        }
+        request.getPortletSession().setAttribute("categories", categories);        
+        return categories;
+    }
+ 
+    private CategoryResult getPortlets(PortletRequest request,
+            String category, String pageNumber, int portletPerPages,String filter) 
+    {
+        List<PortletInfo> list = new ArrayList<PortletInfo>();
+        int portletCount = 0;
+        int strtCnt = 0; //getStartRow(pageNumber, portletPerPages);
+        int endCnt = 9; //getEndRow(pageNumber, portletPerPages);
+        try 
+        {           
+            if (category != null && category.equalsIgnoreCase("all")) 
+            {             
+                list = retrievePortlets(request, filter);
+                
+//                portletCount = tmpList.size();
+//                if (endCnt > portletCount)
+//                    endCnt = portletCount;
+//                for (int index = strtCnt; index < endCnt; index++) 
+//                {
+//                    list.add(tmpList.get(index));
+//                }
+            } 
+            else if (filter != null)
+            {
+                list = retrievePortlets(request, filter);
+//                portletCount = tmpList.size();
+//                if (endCnt > portletCount)
+//                    endCnt = portletCount;
+//                for (int index = strtCnt; index < endCnt; index++) {
+//                    list.add(tmpList.get(index));
+//                }
+            } 
+            else 
+            {
+                List<CategoryInfo> catList = retrieveCategories(request);
+                for (CategoryInfo catInfo : catList)
+                {
+                    if (catInfo.getName().equalsIgnoreCase(category)) 
+                    {
+                        list = catInfo.getPortlets();
+                        break;
+                    }                    
+                }
+            }
+        }
+        catch (Exception e) 
+        {
+            e.printStackTrace();
+        }
+        return new CategoryResult(list, portletCount);
+    }
+
+    class CategoryResult 
+    {
+        List<PortletInfo> list;
+
+        int resultSize;
+
+        /**
+         * @param list
+         * @param resultSize
+         */
+        public CategoryResult(List<PortletInfo> list, int resultSize) 
+        {
+            this.list = list;
+            this.resultSize = resultSize;
+        }
+
+        /**
+         * @return the list
+         */
+        public List<PortletInfo> getList() 
+        {
+            return list;
+        }
+
+        /**
+         * @return the resultSize
+         */
+        public int getResultSize()
+        {
+            return resultSize;
+        }
+    }
+    
+}
\ No newline at end of file

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/toolbox/JetspeedToolbox.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/toolbox/JetspeedToolbox.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml?rev=808139&r1=808138&r2=808139&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml Wed Aug 26 17:53:58 2009
@@ -154,6 +154,7 @@
 		<js:service name='PAM'/>
 		<js:service name='AuthenticationProvider'/>        
 		<js:service name='CacheMonitor'/>
+		<js:service name='SpacesService'/>
 	</js:services>
 
 </portlet-app>

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml?rev=808139&r1=808138&r2=808139&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml Wed Aug 26 17:53:58 2009
@@ -1714,6 +1714,140 @@
     </portlet-preferences>
   </portlet>
 
+<portlet id="OldJetspeedNavigator">
+    <description>Jetspeed spaces navigation management controller.</description>
+    <portlet-name>OldJetspeedNavigator</portlet-name>
+    <display-name>Jetspeed Navigator</display-name>
+    <portlet-class>org.apache.jetspeed.portlets.spaces.SpacesNavigator</portlet-class>
+    <init-param>
+      <name>dojo.requires.core</name>
+      <value>dojo.lang.*;dojo.event.*;dojo.io.*;dojo.widget.*;dojo.widget.LayoutContainer;dojo.widget.ContentPane;dojo.widget.SplitContainer;dojo.widget.AccordionContainer;dojo.widget.TabContainer;dojo.widget.Checkbox;dojo.widget.Dialog;dojo.widget.Button;dojo.widget.Menu2;jetspeed.widget.EditorTable</value>
+    </init-param>
+    <init-param>
+        <name>ViewPage</name>
+        <value>/WEB-INF/view/spaces/spaces.vm</value>
+    </init-param>
+    <init-param>
+        <name>portlet-icon</name>
+        <value>lock.png</value>
+    </init-param>                        
+    <expiration-cache>0</expiration-cache>
+    <supports>
+        <mime-type>text/html</mime-type>
+        <portlet-mode>VIEW</portlet-mode>
+        <portlet-mode>EDIT</portlet-mode>            
+    </supports>
+    <supported-locale>en</supported-locale>
+    <portlet-info>
+        <title>Old Jetspeed Navigator</title>
+        <short-title>Old Navigator</short-title>
+        <keywords>admin,spaces,space,navigator,pages,nav</keywords>                        
+    </portlet-info>
+</portlet>
+
+<portlet id="JetspeedNavigator">
+    <description>Jetspeed spaces navigation management controller.</description>
+    <portlet-name>JetspeedNavigator</portlet-name>
+    <display-name>Jetspeed Navigator</display-name>
+    <portlet-class>org.apache.jetspeed.portlets.spaces.JetspeedNavigator</portlet-class>
+    <init-param>
+        <name>ViewPage</name>
+        <value>/WEB-INF/view/spaces/navigator.jsp</value>
+    </init-param>
+    <init-param>
+        <name>portlet-icon</name>
+        <value>lock.png</value>
+    </init-param>                        
+    <expiration-cache>0</expiration-cache>
+    <supports>
+        <mime-type>text/html</mime-type>
+        <portlet-mode>VIEW</portlet-mode>
+        <portlet-mode>EDIT</portlet-mode>            
+    </supports>
+    <supported-locale>en</supported-locale>
+    <portlet-info>
+        <title>Jetspeed Navigator</title>
+        <short-title>Navigator</short-title>
+        <keywords>admin,spaces,space,navigator,pages,nav</keywords>                        
+    </portlet-info>
+</portlet>
+
+<portlet id="JetspeedToolbox">
+    <description>Jetspeed toolbox and portlet selection controller.</description>
+    <portlet-name>JetspeedToolbox</portlet-name>
+    <display-name>Jetspeed Toolbox</display-name>
+    <portlet-class>org.apache.jetspeed.portlets.toolbox.JetspeedToolbox</portlet-class>
+    <init-param>
+        <name>ViewPage</name>
+        <value>/WEB-INF/view/toolbox/toolbox.jsp</value>
+    </init-param>
+    <init-param>
+        <name>portlet-icon</name>
+        <value>linux.png</value>
+    </init-param>                        
+    <expiration-cache>0</expiration-cache>
+    <supports>
+        <mime-type>text/html</mime-type>
+        <portlet-mode>VIEW</portlet-mode>
+        <portlet-mode>EDIT</portlet-mode>            
+    </supports>
+    <supported-locale>en</supported-locale>
+    <portlet-info>
+        <title>Jetspeed Toolbox</title>
+        <short-title>Toolbox</short-title>
+        <keywords>admin,toolbox,portlet,selector,chooser</keywords>                        
+    </portlet-info>
+    <portlet-preferences>
+        <preference>
+            <name>Categories</name>
+            <value>Administration,Finance,Fun,News,Security,Sports,Technology,Tools,Tutorial</value>
+        </preference>
+        <preference>
+            <name>Keywords:Administration</name>
+            <value>admin,management</value>
+        </preference>
+        <preference>
+            <name>Keywords:Finance</name>
+            <value>finance,stock,market,money,quote</value>
+        </preference>
+        <preference>
+            <name>Keywords:Fun</name>
+            <value>fun,game,cool</value>
+        </preference>
+        <preference>
+            <name>Keywords:News</name>
+            <value>news,RSS,feed,headline</value>
+        </preference>
+        <preference>
+            <name>Keywords:Security</name>
+            <value>security</value>
+        </preference>
+        <preference>
+            <name>Keywords:Sports</name>
+            <value>sport,football,baseball,hockey,soccer,golf,tennis</value>
+        </preference>
+        <preference>
+            <name>Keywords:Technology</name>
+            <value>technology,computer,web</value>
+        </preference>
+        <preference>
+            <name>Keywords:Tools</name>
+            <value>tools,desktop,weather</value>
+        </preference>            
+        <preference>
+            <name>Keywords:Tutorial</name>
+            <value>demo,learn,tutorial,programming</value>
+        </preference>    
+        <preference>
+            <name>Columns</name>                    
+            <value>4</value>
+        </preference>
+        <preference>
+            <name>Rows</name>                    
+            <value>5</value>
+        </preference>
+    </portlet-preferences>                
+</portlet>
       
     <custom-portlet-mode>
         <description>a Custom Edit_defaults Mode</description>            

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/navigator.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/navigator.jsp?rev=808139&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/navigator.jsp (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/navigator.jsp Wed Aug 26 17:53:58 2009
@@ -0,0 +1,94 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+--%>
+<%@page import="java.util.List"%>
+<%@page import="java.text.DecimalFormat"%>
+<%@page import="java.text.NumberFormat"%>
+<%@page import="org.apache.jetspeed.spaces.Space"%>
+<%@page import="org.apache.jetspeed.om.page.Page"%>
+<%@page import="org.apache.jetspeed.CommonPortletServices"%>
+<%@ page contentType="text/html" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<portlet:defineObjects/>
+
+ 	<%
+ 	String tab = (String)renderRequest.getAttribute("tab");
+ 	String title = (String)renderRequest.getAttribute("title");
+ 	%>
+<table style="border-collapse: collapse;  width: 100%; margin-top: 8px; float: left;">
+	<tr>
+	<td class="portlet-section-subheader" colspan="3">
+	<a href="<portlet:actionURL><portlet:param name='tab' value='spaces'/></portlet:actionURL>">Spaces</a> | <a href="<portlet:actionURL><portlet:param name='tab' value='dashboard'/></portlet:actionURL>">Dashboard</a>
+	</td>
+    </tr>
+<% if (tab.equals("spaces")) { %>
+	<tr>
+		<th class="portlet-section-header" colspan="3"><%= title %></th>
+	</tr>
+     <tr>
+      <th class="portlet-section-subheader">Space Name</th>
+      <th class="portlet-section-subheader">Owner</th>
+      <th class="portlet-section-subheader">Path</th>
+     </tr>
+<%
+List<Space> spaces = (List<Space>)renderRequest.getAttribute("spaces");
+for (Space space : spaces)
+{
+%>     
+	
+     <tr>
+	   <td class="portlet-section-body"><a href="<portlet:actionURL><portlet:param name='space' value='<%=space.getName()%>'/></portlet:actionURL>"><%=space.getName() %></a></td>
+       <td class="portlet-section-body"><%=space.getOwner()%></td>
+       <td class="portlet-section-body"><%=space.getPath()%></td>
+     </tr>
+<%
+}
+%>
+	<tr>
+		<th class="portlet-section-header" colspan="3"></th>
+	</tr>
+<% } else if (tab.equals("pages")) { %>
+	<tr>
+		<th class="portlet-section-header" colspan="1"><%= title %> Space</th>
+	</tr>
+     <tr>
+      <th class="portlet-section-subheader">Page Name</th>
+     </tr>
+<%
+List<Page> pages = (List<Page>)renderRequest.getAttribute("pages");
+for (Page pg : pages)
+{
+%>     
+	
+     <tr>
+	   <td class="portlet-section-body"><a href="<portlet:actionURL><portlet:param name='page' value='<%=pg.getPath()%>'/></portlet:actionURL>"><%=pg.getTitle() %></a></td>
+     </tr>
+<%
+}
+%>
+	<tr>
+		<th class="portlet-section-header" colspan="1"></th>
+	</tr>
+<%
+}
+%>
+
+
+</table>
+    

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/navigator.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/navigator.jsp
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces.vm?rev=808139&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces.vm (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces.vm Wed Aug 26 17:53:58 2009
@@ -0,0 +1,132 @@
+#*
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+*#
+#set($rc = $renderRequest.getAttribute("org.apache.jetspeed.request.RequestContext"))
+#set($req = $rc.Request)
+#set($rooturl = "${req.scheme}://${req.serverName}:${req.serverPort}${req.contextPath}")
+
+<div dojoType="LayoutContainer"
+     layoutChildPriority="left-right"
+     style="width: 100%">
+    
+    <div id="spacesTabContainer" dojoType="TabContainer" selectedChild="spaces" doLayout="false">
+        <div id="spaces" dojoType="ContentPane" label="Spaces">
+        <p>Spaces</p>
+            <div class="tableContainer">
+              <div>
+                <table dojoType="jetspeed:EditorTable" widgetId="spacesTable" class="permissions" 
+                       headClass="fixedHeader" tbodyClass="scrollContent" 
+                       enableMultipleSelect="true" enableAlternateRows="true" 
+                       rowAlternateClass="alternateRow" 
+                       templateCssPath="/j2-admin/css/spaces.css" 
+                       cellpadding="0" cellspacing="0" border="0">
+
+                    <col width="70%"></col>
+                    <col width="30%"></col>
+
+                    <thead>
+                        <tr>
+                            <th field="name" dataType="String">Space Name</th>
+                            <th field="owner" dataType="String">Owner</th>
+                            <th field="path" dataType="String">Path</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                    </tbody>
+                </table>
+            </div> <!-- tableContainer --> 
+
+        </div> 
+
+        <div id="pages" dojoType="ContentPane" label="Pages">
+        <p>Pages</p>
+		</div>
+
+        <div id="dashboard" dojoType="ContentPane" label="Dashboard">
+        <p>Dashboard</p>        
+		</div>
+
+        <div id="toolbox" dojoType="ContentPane" label="Toolbox">
+        <p>Toolbox</p>        
+		</div>
+
+        <div id="search" dojoType="ContentPane" label="Search">
+        <p>Search</p>        
+		</div>
+
+		
+	</div>
+</div>
+
+<script language="JavaScript" type="text/javascript">
+
+function processTableRowEvent(e, tableName)
+{
+    dojo.widget.byId( tableName ).processTableRowEvent( e );
+}
+function updateEditor( rowData )
+{
+	var newLocation = "$rooturl" + window.djConfig.jetspeed.servletPath + rowData.path;
+	alert("row = " + newLocation);	
+   	window.location = newLocation;
+}
+function saveEntrySubmit( selectedRowData, removeEntry )
+{
+	// alert("save");
+}
+function okToChangeSelectionOrExit(invocation)
+{
+    if ( invocation != null )
+            invocation.proceed();	
+	return true;
+}
+function clearAndDisableEditor()
+{
+	// alert("Clear");
+}
+function getNewEntryPrototype()
+{
+    return { name: "", owner: "", path: "" };
+}
+
+
+function addListeners()
+{
+    var spacesTable = dojo.widget.byId("spacesTable");
+    dojo.event.connect( "around", spacesTable, "onUISelect", "okToChangeSelectionOrExit" );
+    dojo.event.connect(spacesTable, "onSelect", function(e) {
+        processTableRowEvent(e, "spacesTable");
+    });
+    dojo.event.connect(spacesTable, "updateEditor", updateEditor );
+    dojo.event.connect(spacesTable, "saveEntrySubmit", saveEntrySubmit );
+    dojo.event.connect(spacesTable, "clearAndDisableEditor", clearAndDisableEditor );
+    spacesTable.getNewEntryPrototype = getNewEntryPrototype;
+
+    var data = [] ;
+#foreach($sp in $spaces)
+    data.push( { name: "$sp.Name", owner: "$sp.Owner", path: "$sp.Path", Id: $velocityCount} );
+#end
+    spacesTable.js_masterdata = data;
+
+    spacesTable.js_type = "space";
+    spacesTable.saveWarningDialogWidgetId = "SaveWarningDialog";
+    spacesTable.parseData( spacesTable.js_masterdata );
+    spacesTable.render( true );
+}
+
+dojo.addOnLoad( window.addListeners );
+
+</script>

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces.vm
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp?rev=808139&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp Wed Aug 26 17:53:58 2009
@@ -0,0 +1,115 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+--%>
+<%@page import="java.util.List"%>
+<%@page import="java.text.DecimalFormat"%>
+<%@page import="java.text.NumberFormat"%>
+<%@page import="org.apache.jetspeed.spaces.Space"%>
+<%@page import="org.apache.jetspeed.om.page.Page"%>
+<%@page import="org.apache.jetspeed.portlets.PortletInfo"%>
+<%@page import="org.apache.jetspeed.portlets.CategoryInfo"%>
+<%@page import="org.apache.jetspeed.request.RequestContext"%>
+
+<%@ page contentType="text/html" %>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c_rt"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<portlet:defineObjects/>
+<c_rt:set var="requestContext" value="<%=request.getAttribute(RequestContext.REQUEST_PORTALENV)%>"/>
+<c:set var="portalContextPath" value="${requestContext.request.contextPath}"/>
+<c:if test="${empty portalContextPath}">
+  <c:set var="portalContextPath" value="/"/>
+</c:if>
+
+ 	<%
+ 	List<PortletInfo> portlets = (List<PortletInfo>)renderRequest.getAttribute("portlets");
+ 	String tab = (String)renderRequest.getAttribute("tab"); 	
+ 	String hideShow = (String)renderRequest.getAttribute("hideShow");
+ 	%>
+<form id='jsPortletSearch' method="POST" action='<portlet:actionURL/>'>
+<table style="border-collapse: collapse;  width: 100%; margin-top: 8px; float: left;">
+	<tr>
+	<td class="portlet-section-subheader" colspan='10'><a href="<portlet:actionURL><portlet:param name='tab' value='portlets'/></portlet:actionURL>">Portlets</a> | <a href="<portlet:actionURL><portlet:param name='tab' value='layout'/></portlet:actionURL>">Layout</a> | <a href="<portlet:actionURL><portlet:param name='tab' value='theme'/></portlet:actionURL>">Theme</a></td>
+    </tr>
+<% if (tab.equals("portlets")) { %>
+	<tr>
+		<th class="portlet-section-header" colspan="10">Portlets</th>
+	</tr>
+<tr><td class="portlet-section-subheader" colspan='10'><input type="text" name="filter" size="15" value="" ><input type="submit" value="search" /></td></tr>
+<%
+List<CategoryInfo> categories = (List<CategoryInfo>)renderRequest.getAttribute("categories");
+for (CategoryInfo c : categories)
+{
+%>     
+<tr><td class="portlet-section-subheader" colspan='10'><a href="<portlet:actionURL><portlet:param name='category' value='<%=c.getName()%>'/></portlet:actionURL>"><%=c.getName()%></a></td></tr>
+<%
+}
+%>
+<tr><td class="portlet-section-subheader" colspan='10'></td></tr>
+<%
+int count = 0;
+for (PortletInfo p : portlets)
+{
+    count++;
+    String imagePath = "/" + p.getImage();
+%>     
+     <tr>
+       <td style='width: 20%' class="portlet-section-body"><img src='<c:url context="${portalContextPath}" value="<%=imagePath%>"/>'/>
+	   <td style='width: 80%' class="portlet-section-body">
+		   <table>
+			<tr>
+			   <td class="portlet-section-body"><%=p.getDisplayName() %></td>
+		       <td class="portlet-section-body"></td>
+		     </tr>       
+			<tr>
+			   <td colspan='2' class="portlet-section-body"><a href="<portlet:actionURL><portlet:param name='portletPreview' value='<%=p.getName()%>'/></portlet:actionURL>">Preview</a> <a href="<portlet:actionURL><portlet:param name='portletAdd' value='<%=p.getName()%>'/></portlet:actionURL>">Add</a></td>			   
+		     </tr>
+			</table>
+		</td>
+     </tr>
+<%
+	if (count >= 10) break;
+}
+%>
+	<tr>
+		<th class="portlet-section-header" colspan="2"></th>
+	</tr>
+<% } else if (tab.equals("layout")) { %>
+	<tr>
+		<th class="portlet-section-header" colspan="1">Layout</th>
+	</tr>
+	<tr><td><img width="62" height="539" src='<c:url context="${portalContextPath}" value="/images/page-layouts.png"/>'/></td></tr>
+	<tr>
+		<th class="portlet-section-header" colspan="1"></th>
+	</tr>
+<% } else if (tab.equals("theme")) { %>
+	<tr>
+		<th class="portlet-section-header" colspan="1">Themes</th>
+	</tr>
+	<tr><td><img width="43" height="505" src='<c:url context="${portalContextPath}" value="/images/page-themes.png"/>'/></td></tr>
+	<tr>
+		<th class="portlet-section-header" colspan="1"></th>
+	</tr>
+<%
+}
+%>
+
+</table>
+</form>
+    

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/css/spaces.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/css/spaces.css?rev=808139&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/css/spaces.css (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/css/spaces.css Wed Aug 26 17:53:58 2009
@@ -0,0 +1,180 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+.permsRootLContainer { 
+    width: 100%;
+    height: 600px;
+}
+
+.permsTabLContainer { 
+    width: 100%;
+    height: 304px;
+}
+
+.editorLContainer {
+    width: 100%;
+    border: 1px solid grey;
+    height: 200px;
+}
+
+.editorLTop {
+    padding: 4px;
+    border-bottom: thin inset grey;
+    width: 100%;
+    height: 55px;
+}
+
+.editorLBottom  {
+    padding: 4px;
+    width: 100%;
+    height: 140px;
+}
+
+.resourceNameLContainer {
+    padding: 4px;
+    border-right: thin inset grey;
+    width: 370px
+    height: 55px
+}
+
+.editorControlsLContainer {
+    height: 55px
+    padding: 4px;
+}
+
+.rolesLContainer {
+    padding: 4px;
+    border-right: thin inset grey;
+    overflow-y: auto;
+    overflow-x: hidden
+}
+
+.actionsLContainer {
+    padding: 6px;
+    width: 210px;
+    overflow-y: auto;
+    overflow-x: hidden
+
+}
+
+.dojoDialog {
+    background : #eee;
+    border : 1px solid #999;
+    -moz-border-radius : 5px;
+    padding : 4px;
+    width: 320px;
+}
+
+.buttonbox {
+}
+
+.buttonbox .dojoButton {
+    float: right;
+    margin-right: 10px;
+    margin-bottom: 6px;
+}
+
+.buttonboxright {
+    display: block;
+    text-align: center;
+}
+.buttonboxright .dojoButton {
+    float: right;
+    margin-left: 10px;
+    margin-bottom: 6px;
+}
+
+.permissions {
+    font-family:Lucida Grande, Verdana;
+    font-size:0.8em;
+    width:100%;
+    border:1px solid #ccc;
+    cursor:default;
+}
+
+#permsTabContainer {
+    width: 100%;
+    top: 2px;  /* without this, the tabs are cut off at the top */
+    height: 304px;
+}
+
+* html div.tableContainer { /* IE only hack */
+    width: 95%;
+    border: 1px solid #ccc;
+    height: 285px;
+    overflow-x: hidden;
+    overflow-y: auto;
+}
+
+.permissions td,
+.permissions th{
+    border-right: 1px solid #999;
+    padding: 2px;
+    font-size:1.1em;
+}
+
+.permissions thead td, .permissions thead th {
+    background-image:url(/j2-admin/images/st-head.gif);
+    background-repeat:no-repeat;
+    background-position:top right;   
+    font-size:1.1em;
+    font-weight: bold;
+    text-align: left;
+}
+.permissions thead td.selectedUp, .permissions thead th.selectedUp {
+    background-image:url(/j2-admin/images/st-headup.gif);
+}
+.permissions thead td.selectedDown, .permissions thead th.selectedDown {
+    background-image:url(/j2-admin/images/st-headdown.gif);
+}
+
+* html div.tableContainer table thead tr td,
+* html div.tableContainer table thead tr th{
+    /* IE Only hacks */
+    position:relative;
+    top:expression(dojo.html.getFirstAncestorByTag(this,'table').parentNode.scrollTop-2);
+}
+
+
+html>body tbody.scrollContent {
+/*    height: 262px; */
+    overflow-x: hidden;
+    overflow-y: auto;
+}
+
+tbody.scrollContent td, tbody.scrollContent tr td {
+    background: #FFF;
+    padding: 2px;
+}
+
+tbody.scrollContent tr.alternateRow td {
+    background: #e3edfa;
+    padding: 2px;
+}
+
+tbody.scrollContent tr.selected td {
+    background: yellow;
+    padding: 2px;
+}
+tbody.scrollContent tr:hover td {
+    background: #a6c2e7;
+    padding: 2px;
+}
+tbody.scrollContent tr.selected:hover td {
+    background: #ff3;
+    padding: 2px;
+}

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/css/spaces.css
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/css/spaces.css
------------------------------------------------------------------------------
    svn:keywords = Id



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