portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r831775 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main: java/org/apache/jetspeed/portlets/spaces/ webapp/WEB-INF/ webapp/WEB-INF/view/spaces/
Date Sun, 01 Nov 2009 22:53:30 GMT
Author: ate
Date: Sun Nov  1 22:53:30 2009
New Revision: 831775

URL: http://svn.apache.org/viewvc?rev=831775&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-1057
- adding new individual SpaceNavigator and PageNavigator (splitted up JetspeedNavigator)
TODO: add SpaceNavigator to top menu bar and replace JetspeedNavigator with PageNavigator

Added:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/PageNavigator.java
  (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
  (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp
  (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/space-navigator.jsp
  (with props)
Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesManager.java
    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/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=831775&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/PageNavigator.java
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/PageNavigator.java
Sun Nov  1 22:53:30 2009
@@ -0,0 +1,149 @@
+/*
+ * 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.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.administration.PortalAdministration;
+import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.page.PageManager;
+import org.apache.jetspeed.spaces.Space;
+import org.apache.jetspeed.spaces.Spaces;
+import org.apache.portals.bridges.common.GenericServletPortlet;
+import org.apache.portals.messaging.PortletMessaging;
+
+/**
+ * Jetspeed Navigator
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class PageNavigator extends GenericServletPortlet
+{
+    private Spaces spacesService;
+    private PortalAdministration admin;
+    protected PageManager pageManager;    
+
+    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"); }
+        pageManager = (PageManager)context.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
+        if (null == pageManager)
+        {
+            throw new PortletException("Failed to find the Page Manager on portlet initialization");
+        }                       
+    }
+
+    @SuppressWarnings("unchecked")
+    public void doView(RenderRequest request, RenderResponse response)
+            throws PortletException, IOException
+    {    
+        String newSpace = (String)PortletMessaging.consume(request,"PageNavigator", "spaceChange");
+        if (newSpace != null)
+        {
+            request.getPortletSession().removeAttribute("spaces");
+            request.getPortletSession().removeAttribute("pages");
+            request.getPortletSession().setAttribute("space", newSpace);
+        }
+        Space space = (Space)request.getPortletSession().getAttribute("space");         
     
+        List<Space> spaces = (List<Space>)request.getPortletSession().getAttribute("spaces");
+        if (spaces == null)
+        {
+            // TODO: use environment
+            spaces = spacesService.listSpaces();
+        }              
+        request.getPortletSession().setAttribute("spaces", spaces);        
+        if (space == null)
+        {                
+            space = spaces.get(0);
+            request.getPortletSession().setAttribute("space", space);        
+        }            
+        
+        List<Page> pages = (List<Page>)request.getPortletSession().getAttribute("pages");
+        if (pages == null)
+        {
+            pages = spacesService.listPages(space);
+            request.getPortletSession().setAttribute("pages", pages);
+        }        
+        request.setAttribute("pages", pages);
+        
+        try
+        {
+            super.doView(request, response);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+        }
+    }
+    
+    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException,
+    IOException
+    {
+        String page = actionRequest.getParameter("page");
+        if (page != null)
+        {
+            String path = admin.getPortalURL(actionRequest, actionResponse, page);
+            actionResponse.sendRedirect(path);            
+        }
+        String addPage = actionRequest.getParameter("addPage");
+        if (addPage != null)
+        {
+            Space space = (Space)actionRequest.getPortletSession().getAttribute("space");
+            if (space != null)
+            {
+                String spacePath = space.getPath();
+                try
+                {
+                    String path = spacePath + "/" + addPage + ".psml";
+                    
+                    Page source = pageManager.getPage("/_user/template/min.psml");      
         
+                    Page newPage = pageManager.copyPage(source, path);
+                    newPage.setTitle(addPage);
+                    pageManager.updatePage(newPage);
+                    
+                    actionRequest.getPortletSession().removeAttribute("pages");
+                    String redirect = admin.getPortalURL(actionRequest, actionResponse, path);
+                    actionResponse.sendRedirect(redirect);                              
         
+                }
+                catch (Throwable t)
+                {
+                    t.printStackTrace();
+                }
+            }
+        }
+    }    
+}
\ No newline at end of file

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

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

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/PageNavigator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java?rev=831775&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
Sun Nov  1 22:53:30 2009
@@ -0,0 +1,173 @@
+/*
+ * 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.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.administration.PortalAdministration;
+import org.apache.jetspeed.page.PageManager;
+import org.apache.jetspeed.spaces.Space;
+import org.apache.jetspeed.spaces.Spaces;
+import org.apache.portals.bridges.common.GenericServletPortlet;
+import org.apache.portals.messaging.PortletMessaging;
+
+/**
+ * Jetspeed Navigator
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id$
+ */
+public class SpaceNavigator extends GenericServletPortlet
+{
+    private Spaces spacesService;
+    private PortalAdministration admin;
+    protected PageManager pageManager;    
+
+    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"); }
+        pageManager = (PageManager)context.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
+        if (null == pageManager)
+        {
+            throw new PortletException("Failed to find the Page Manager on portlet initialization");
+        }                       
+    }
+
+    @SuppressWarnings("unchecked")
+    public void doView(RenderRequest request, RenderResponse response)
+            throws PortletException, IOException
+    {    
+        String spaceName = (String)PortletMessaging.consume(request,"SpaceNavigator", "spaceChange");
+        if (spaceName != null)
+        {
+            request.getPortletSession().removeAttribute("spaces");
+            request.getPortletSession().removeAttribute("space");
+        }
+        else
+        {
+            spaceName = (String)request.getPortletSession().getAttribute("space");      
        
+        }
+        Space space = null;
+        List<Space> spaces = (List<Space>)request.getPortletSession().getAttribute("spaces");
+        if (spaces == null)
+        {
+            // TODO: use environment
+            spaces = spacesService.listSpaces();
+            request.setAttribute("spaces", spaces);        
+            request.getPortletSession().setAttribute("spaces", spaces);        
+        }              
+        request.setAttribute("spaces", spaces);        
+        if (spaceName != null)
+        {
+            for (Space sp: spaces)
+            {
+                if (sp.getName().equals(spaceName))
+                {
+                    space = sp;
+                    break;
+                }
+            }
+            if (space == null)
+            {                
+                spaceName = null;
+            }            
+        }
+        if (spaceName == null)
+        {
+            request.setAttribute("title", "Default Spaces");
+            space = spaces.get(0);
+            spaceName = space.getName();
+        }
+        else
+        {
+            request.setAttribute("title", spaceName);
+        }
+        
+        request.setAttribute("space", space);
+        request.getPortletSession().setAttribute("space", spaceName);        
+        
+        try
+        {
+            super.doView(request, response);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+        }
+    }
+    
+    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortletException,
+    IOException
+    {
+        String space = actionRequest.getParameter("space");
+        if (space != null)
+        {
+            Space s = getSpaceFromName(space);
+            if (s != null)
+            {
+                String path = admin.getPortalURL(actionRequest, actionResponse, s.getPath());
+                actionRequest.getPortletSession().setAttribute("space", space);     
+                PortletMessaging.publish(actionRequest, "PageNavigator", "spaceChange", space);
+                actionResponse.sendRedirect(path);
+            }
+            return;
+        }
+        String navAction = actionRequest.getParameter("navAction");
+        if (navAction != null)
+        {
+            // TODO: make this link configurable. We need JetspeedLinks like in Jetspeed-1
+            String path = admin.getPortalURL(actionRequest, actionResponse, "/Administrative/spaces.psml");
+            actionResponse.sendRedirect(path);
+            return;
+        }
+    }    
+    
+    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/SpaceNavigator.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesManager.java?rev=831775&r1=831774&r2=831775&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesManager.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpacesManager.java
Sun Nov  1 22:53:30 2009
@@ -130,7 +130,10 @@
                 Page source = pageManager.getPage("/_user/template/space-home.psml");   
            
                 Page home = pageManager.copyPage(source, spacePath + "/default-page.psml");
                 pageManager.updatePage(home);
+                // TODO: remove publish to JetspeedNavigator when replaced/removed for Space+PageNavigator
                 PortletMessaging.publish(actionRequest, "JetspeedNavigator", "spaceChange",
name);                
+                PortletMessaging.publish(actionRequest, "SpaceNavigator", "spaceChange",
name);
+                PortletMessaging.publish(actionRequest, "PageNavigator", "spaceChange", name);
                 // redirect
                 String path = admin.getPortalURL(actionRequest, actionResponse, spacePath);
                 actionResponse.sendRedirect(path);                        

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=831775&r1=831774&r2=831775&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 Sun
Nov  1 22:53:30 2009
@@ -2210,6 +2210,60 @@
       <keywords>admin,spaces,space,manager</keywords>                       

     </portlet-info>
   </portlet>
+ 
+   <portlet id="SpaceNavigator">
+    <description>Jetspeed spaces navigation management controller.</description>
+    <portlet-name>SpaceNavigator</portlet-name>
+    <display-name>Space Navigator</display-name>
+    <portlet-class>org.apache.jetspeed.portlets.spaces.SpaceNavigator</portlet-class>
+    <init-param>
+      <name>ViewPage</name>
+      <value>/WEB-INF/view/spaces/space-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>Space Navigator</title>
+      <short-title>SpaceNavigator</short-title>
+      <keywords>admin,spaces,space,navigator,pages,nav</keywords>           
            
+    </portlet-info>
+  </portlet>
+
+   <portlet id="PageNavigator">
+    <description>Jetspeed page navigation management controller.</description>
+    <portlet-name>PageNavigator</portlet-name>
+    <display-name>Page Navigator</display-name>
+    <portlet-class>org.apache.jetspeed.portlets.spaces.PageNavigator</portlet-class>
+    <init-param>
+      <name>ViewPage</name>
+      <value>/WEB-INF/view/spaces/page-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>Page Navigator</title>
+      <short-title>PageNavigator</short-title>
+      <keywords>admin,spaces,space,navigator,pages,nav</keywords>           
            
+    </portlet-info>
+  </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/page-navigator.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp?rev=831775&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp
Sun Nov  1 22:53:30 2009
@@ -0,0 +1,67 @@
+<%--
+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 title = (String)renderRequest.getAttribute("title");
+ 	%>
+<form id='jsPages' method="POST" action='<portlet:actionURL/>'>
+<table style="border-collapse: collapse;  width: 100%; margin-top: 0px; float: left;">
+	<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>
+<%
+Object princ2 = renderRequest.getUserPrincipal();
+if (princ2 != null) {
+%>
+	<tr><td class="portlet-section-subheader" colspan='10'><input type="text"
name="addPage" size="15" value="" ><input type="submit" value="Add Page" /></td></tr>
+<%
+}
+%>
+
+
+</table>
+</form>    

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

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

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/space-navigator.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/space-navigator.jsp?rev=831775&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/space-navigator.jsp
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/space-navigator.jsp
Sun Nov  1 22:53:30 2009
@@ -0,0 +1,67 @@
+<%--
+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 title = (String)renderRequest.getAttribute("title");
+    %>
+<form id='<jsSpaces' method="POST" action='<portlet:actionURL/>'>
+<table style="border-collapse: collapse;  width: 100%; margin-top: 0px; float: left;">
+    <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>
+<%
+Object princ = renderRequest.getUserPrincipal();
+if (princ != null) {
+%>
+    <tr><td class="portlet-section-subheader" colspan="3"><a href="<portlet:actionURL><portlet:param
name='navAction' value='addSpace'/></portlet:actionURL>">Add Space...</a></td></tr>
+<% } %>
+</table>
+</form>

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

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

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/space-navigator.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain



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