portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r912646 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main: java/org/apache/jetspeed/portlets/ java/org/apache/jetspeed/portlets/site/ resources/org/apache/jetspeed/portlets/site/ resources/org/apache/jetspeed/portlets/spaces/res...
Date Mon, 22 Feb 2010 16:40:10 GMT
Author: woonsan
Date: Mon Feb 22 16:40:10 2010
New Revision: 912646

URL: http://svn.apache.org/viewvc?rev=912646&view=rev
Log:
JS2-1108: Adding page editing button in page navigator portlet.

Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/AdminPortletWebPage.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManager.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
    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/view/spaces/page-navigator.jsp

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/AdminPortletWebPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/AdminPortletWebPage.java?rev=912646&r1=912645&r2=912646&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/AdminPortletWebPage.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/AdminPortletWebPage.java
Mon Feb 22 16:40:10 2010
@@ -17,10 +17,15 @@
 
 package org.apache.jetspeed.portlets;
 
+import java.util.Enumeration;
+
+import javax.portlet.PortletPreferences;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletResponse;
 
+import org.apache.commons.lang.BooleanUtils;
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
+import org.apache.wicket.Component;
 import org.apache.wicket.IPageMap;
 import org.apache.wicket.PageParameters;
 import org.apache.wicket.markup.html.WebPage;
@@ -233,4 +238,33 @@
        return ((AbstractAdminWebApplication) getApplication()).getUserPrincipalName();
     }
     
+    /**
+     * Set visibilities of components in a page based on preferences.
+     * The preference name for a component is prepended by the specified preferenceNamePrefix.
+     * @param prefix
+     * @param defaultVisibility
+     */
+    public void setVisibilitiesOfChildComponentsByPreferences(String prefix, boolean defaultVisibility)
+    {
+        PortletRequest request = ((AbstractAdminWebApplication) getApplication()).getPortletRequest();
+        PortletPreferences prefs = request.getPreferences();
+        
+        for (Enumeration<String> prefNames = prefs.getNames(); prefNames.hasMoreElements();
)
+        {
+            String prefName = prefNames.nextElement();
+            
+            if (prefName.startsWith(prefix))
+            {
+                String componentName = prefName.substring(prefix.length());
+                String prefValue = prefs.getValue(prefName, defaultVisibility ? "true" :
"false");
+                Component component = get(componentName);
+                
+                if (component != null)
+                {
+                    component.setVisibilityAllowed(true).setVisible(BooleanUtils.toBoolean(prefValue));
+                }
+            }
+        }
+    }
+    
 }
\ No newline at end of file

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java?rev=912646&r1=912645&r2=912646&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
Mon Feb 22 16:40:10 2010
@@ -139,6 +139,10 @@
  */
 public class PortalSiteManager extends AdminPortletWebPage
 {
+    
+    public static final String PORTAL_SITE_MANAGER_INIT_NODE_TYPE_PARAM = "_jssmnodetype";
+    
+    public static final String PORTAL_SITE_MANAGER_INIT_NODE_PATH_PARAM = "_jssmnodepath";
 
     protected static final Logger log = LoggerFactory.getLogger(PortalSiteManager.class);
     // components
@@ -200,8 +204,7 @@
         super();
         List<ITab> tabList = new ArrayList<ITab>();
         DefaultMutableTreeNode rootNode = populateTree();
-        populateDocument(new SiteTreeNode("ROOT", "/",
-                SiteTreeNode.FileType.Folder, true));
+        populateDocument(getInitSiteTreeNode());
         PortalTree siteTree = new PortalTree("siteTree", new PropertyModel(
                 this, "treeRoot"));
         siteTree.getTreeState().expandNode(rootNode);
@@ -271,6 +274,8 @@
         add(treeForm);
         add(tabPanel);
         controlTabs();
+        
+        setVisibilitiesOfChildComponentsByPreferences("component.visibility.", true);
     }
 
     private class PortalTree extends LinkTree
@@ -4895,4 +4900,75 @@
         definition.setProfile(options.getProfile());          
         return definition;
     }
+    
+    private SiteTreeNode getInitSiteTreeNode()
+    {
+        SiteTreeNode siteTreeNode = null;
+        
+        PortletRequest portletRequest = getPortletRequest();
+        String pathParam = portletRequest.getParameter(PORTAL_SITE_MANAGER_INIT_NODE_PATH_PARAM);
+        
+        if (pathParam == null)
+        {
+            pathParam = getPreference(PORTAL_SITE_MANAGER_INIT_NODE_PATH_PARAM);
+            
+            if (pathParam == null)
+            {
+                pathParam = getInitParam(PORTAL_SITE_MANAGER_INIT_NODE_PATH_PARAM);
+            }
+        }
+        
+        if (pathParam != null)
+        {
+            String type = PAGE_NODE_TYPE;
+            String typeParam = null;
+            
+            if (typeParam == null)
+            {
+                typeParam = getPreference(PORTAL_SITE_MANAGER_INIT_NODE_TYPE_PARAM);
+                
+                if (typeParam == null)
+                {
+                    typeParam = getInitParam(PORTAL_SITE_MANAGER_INIT_NODE_TYPE_PARAM);
+                }
+            }
+            
+            if (typeParam != null)
+            {
+                type = typeParam;
+            }
+            
+            PageManager pageManager = getServiceLocator().getPageManager();
+            
+            try
+            {
+                if (PAGE_NODE_TYPE.equals(type))
+                {
+                    Page page = pageManager.getPage(pathParam);
+                    siteTreeNode = new SiteTreeNode(page.getName(), page.getPath(), SiteTreeNode.FileType.Page,
true);
+                }
+                else if (FOLDER_NODE_TYPE.equals(type))
+                {
+                    Folder folder = pageManager.getFolder(pathParam);
+                    siteTreeNode = new SiteTreeNode(folder.getName(), folder.getPath(), SiteTreeNode.FileType.Folder,
true);
+                }
+                else if (LINK_NODE_TYPE.equals(type))
+                {
+                    Link link = pageManager.getLink(pathParam);
+                    siteTreeNode = new SiteTreeNode(link.getName(), link.getPath(), SiteTreeNode.FileType.Link,
true);
+                }
+            }
+            catch (Exception e)
+            {
+                
+            }
+        }
+        
+        if (siteTreeNode == null)
+        {
+            siteTreeNode = new SiteTreeNode("ROOT", "/", SiteTreeNode.FileType.Folder, true);
+        }
+        
+        return siteTreeNode;
+    }
 }   

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManager.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManager.html?rev=912646&r1=912645&r2=912646&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManager.html
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManager.html
Mon Feb 22 16:40:10 2010
@@ -78,9 +78,6 @@
     </td>
   </tr>
   <tr>
-    <td colspan="2" class="portlet-section-header"></td>
-  </tr>
-  <tr>
     <td colspan="2" class="portlet-section-body">
       <form wicket:id="treeForm">
         <input type="text" wicket:id="userFolder" />

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties?rev=912646&r1=912645&r2=912646&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
Mon Feb 22 16:40:10 2010
@@ -35,3 +35,5 @@
 spaces.pages.label.add = Add Page
 spaces.pages.label.space.title = {0}
 spaces.pages.label.template = Template
+spaces.pages.label.siteNodeEditor = Site Node Editor
+spaces.pages.label.close = Close

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=912646&r1=912645&r2=912646&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
Mon Feb 22 16:40:10 2010
@@ -1,173 +1,177 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-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.
--->
+  <!--
+    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.
+  -->
 <portlet-app id="j2-admin" version="1.0"
-    xmlns="http://portals.apache.org/jetspeed"
-    xmlns:js="http://portals.apache.org/jetspeed"
-    xmlns:dc="http://www.purl.org/dc"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/jetspeed-portlet.xsd">
-
-   <js:security-constraint-ref>admin</js:security-constraint-ref>
- 
-    <dc:title>Jetspeed-2 Administration Portlets</dc:title>
-    <dc:title xml:lang="en">Jetspeed-2 Administration Portlets</dc:title>
-    <dc:creator>J2 Team</dc:creator>
-    <js:metadata name="pa-version">2.2</js:metadata>
- 
-    <portlet>
-        <portlet-name>LoginPortlet</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-        <dc:title>Login Portlet</dc:title>
-        <dc:creator>J2 Team</dc:creator>
-    </portlet>
-    
-    <portlet>
-        <portlet-name>LoginPortletForXHTMLBasic</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-        <dc:title>Login XHTML Portlet</dc:title>
-        <dc:creator>J2 Team</dc:creator>
-        <js:metadata name="selector.conditional.role">admin</js:metadata>   
                     
-    </portlet>
-
-    <portlet>
-        <portlet-name>OpenIDLoginPortlet</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-        <dc:title>OpenID Login Portlet</dc:title>
-        <dc:creator>J2 Team</dc:creator>
-    </portlet>
-    
-    <portlet>
-        <portlet-name>PortalLoginPortlet</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-        <dc:title>Portal Login Portlet</dc:title>
-        <dc:creator>J2 Team</dc:creator>
-         <js:metadata name="selector.conditional.role">admin</js:metadata>  
                      
-    </portlet>
-
-  	<portlet>
-        <portlet-name>MFALogin</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-        <dc:title>Login</dc:title>
-        <dc:creator>J2 Team</dc:creator>
-    </portlet>
-    
-    <portlet>
-        <portlet-name>LocaleSelector</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-        <dc:title>Locale Selector Portlet</dc:title>
-        <dc:creator>J2 Team</dc:creator>
-    </portlet>
-
-    <portlet>
-         <portlet-name>DateTimePortlet</portlet-name>
-         <js:security-constraint-ref>public-view</js:security-constraint-ref>
-    </portlet>
-
-    <portlet>
-         <portlet-name>ForgottenPasswordPortlet</portlet-name>
-         <js:security-constraint-ref>public-view</js:security-constraint-ref>
-         <js:metadata name="merge.portal.parameters.with.portlet.parameters">true</js:metadata>
-         <js:metadata name="merge.portal.parameters.before.portlet.parameters">true</js:metadata>
-    </portlet>
-
-    <portlet>
-         <portlet-name>UserRegistrationPortlet</portlet-name>
-         <js:security-constraint-ref>public-view</js:security-constraint-ref>
-         <js:metadata name="merge.portal.parameters.with.portlet.parameters">true</js:metadata>
-         <js:metadata name="merge.portal.parameters.before.portlet.parameters">true</js:metadata>
-    </portlet>
-
-    <portlet>
-         <portlet-name>CategoryPortletSelector</portlet-name>
-         <js:security-constraint-ref>AEUV</js:security-constraint-ref>
-         <js:metadata name="merge.portal.parameters.with.portlet.parameters">true</js:metadata>
-         <js:metadata name="merge.portal.parameters.before.portlet.parameters">true</js:metadata>
-         <js:metadata name="selector.conditional.role">admin</js:metadata>  
               
-    </portlet>   
-
-    <portlet>
-        <portlet-name>WelcomeToJetspeed</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-         <js:metadata name="selector.conditional.role">*</js:metadata>      
                          
-    </portlet>
-
-    <portlet>
-        <portlet-name>AboutJetspeed</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-         <js:metadata name="selector.conditional.role">*</js:metadata>      
                  
-    </portlet>
-
-    <portlet>
-        <portlet-name>JetspeedDeveloper</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-        <js:metadata name="selector.conditional.role">*</js:metadata>       
                 
-    </portlet>
-	
-	<portlet>
-		<portlet-name>ChangePasswordPortlet</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-	</portlet>
-			
-    <portlet>
-        <portlet-name>SSOIFramePortlet</portlet-name>
-        <js:security-constraint-ref>user-edit</js:security-constraint-ref>  
    
-    </portlet>
-
-    <portlet>
-        <portlet-name>SSOWebContentPortlet</portlet-name>
-        <js:security-constraint-ref>user-edit</js:security-constraint-ref>  
    
-    </portlet>
-
-	<portlet>
-		<portlet-name>BreadcrumbMenu</portlet-name>
-        <js:security-constraint-ref>public-view</js:security-constraint-ref>
      
-	</portlet>
-			
-	<js:services>        
-        <js:service name='ApplicationServerManager'/>
-        <js:service name='DeploymentManager'/>
-		<js:service name='EntityAccessor'/>
-        <js:service name='GroupManager'/>    
-        <js:service name='PageManager'/>    
-        <js:service name='PermissionManager'/>        
-        <js:service name='PortletFactory'/>
-        <js:service name='PortletPreferencesProvider'/>        
-        <js:service name='PortalAdministration'/>
-        <js:service name='PortletRegistryComponent'/>
-        <js:service name='PortalStatistics'/>        
-        <js:service name="Profiler" />         
-        <js:service name='RoleManager'/>
-	    <js:service name='SearchComponent'/>                
-        <js:service name="SSO" />                 
-        <js:service name='UserManager'/>     
-        <js:service name='DecorationFactory'/> 
-        <js:service name='SecurityAccessController'/>  
-        <js:service name='PortletTrackingManager'/>     
-        <js:service name='PortalConfiguration'/>
-        <js:service name='ImporterManager'/>
-        <js:service name='AuditActivity'/>
-        <js:service name='JetspeedSerializer'/>
-		<js:service name='JetspeedPrincipalManagerProvider'/>        
-		<js:service name='PAM'/>
-		<js:service name='AuthenticationProvider'/>        
-		<js:service name='CacheMonitor'/>
-		<js:service name='SpacesService'/>
-		<js:service name='PageLayoutComponent'/>
-	</js:services>
+  xmlns="http://portals.apache.org/jetspeed" xmlns:js="http://portals.apache.org/jetspeed"
+  xmlns:dc="http://www.purl.org/dc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/jetspeed-portlet.xsd">
+
+  <js:security-constraint-ref>admin</js:security-constraint-ref>
+
+  <dc:title>Jetspeed-2 Administration Portlets</dc:title>
+  <dc:title xml:lang="en">Jetspeed-2 Administration
+    Portlets</dc:title>
+  <dc:creator>J2 Team</dc:creator>
+  <js:metadata name="pa-version">2.2</js:metadata>
+
+  <portlet>
+    <portlet-name>LoginPortlet</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <dc:title>Login Portlet</dc:title>
+    <dc:creator>J2 Team</dc:creator>
+  </portlet>
+
+  <portlet>
+    <portlet-name>LoginPortletForXHTMLBasic</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <dc:title>Login XHTML Portlet</dc:title>
+    <dc:creator>J2 Team</dc:creator>
+    <js:metadata name="selector.conditional.role">admin</js:metadata>
+  </portlet>
+
+  <portlet>
+    <portlet-name>OpenIDLoginPortlet</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <dc:title>OpenID Login Portlet</dc:title>
+    <dc:creator>J2 Team</dc:creator>
+  </portlet>
+
+  <portlet>
+    <portlet-name>PortalLoginPortlet</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <dc:title>Portal Login Portlet</dc:title>
+    <dc:creator>J2 Team</dc:creator>
+    <js:metadata name="selector.conditional.role">admin</js:metadata>
+  </portlet>
+
+  <portlet>
+    <portlet-name>MFALogin</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <dc:title>Login</dc:title>
+    <dc:creator>J2 Team</dc:creator>
+  </portlet>
+
+  <portlet>
+    <portlet-name>LocaleSelector</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <dc:title>Locale Selector Portlet</dc:title>
+    <dc:creator>J2 Team</dc:creator>
+  </portlet>
+
+  <portlet>
+    <portlet-name>DateTimePortlet</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+  </portlet>
+
+  <portlet>
+    <portlet-name>ForgottenPasswordPortlet</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <js:metadata name="merge.portal.parameters.with.portlet.parameters">true</js:metadata>
+    <js:metadata name="merge.portal.parameters.before.portlet.parameters">true</js:metadata>
+  </portlet>
+
+  <portlet>
+    <portlet-name>UserRegistrationPortlet</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <js:metadata name="merge.portal.parameters.with.portlet.parameters">true</js:metadata>
+    <js:metadata name="merge.portal.parameters.before.portlet.parameters">true</js:metadata>
+  </portlet>
+
+  <portlet>
+    <portlet-name>CategoryPortletSelector</portlet-name>
+    <js:security-constraint-ref>AEUV</js:security-constraint-ref>
+    <js:metadata name="merge.portal.parameters.with.portlet.parameters">true</js:metadata>
+    <js:metadata name="merge.portal.parameters.before.portlet.parameters">true</js:metadata>
+    <js:metadata name="selector.conditional.role">admin</js:metadata>
+  </portlet>
+
+  <portlet>
+    <portlet-name>WelcomeToJetspeed</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <js:metadata name="selector.conditional.role">*</js:metadata>
+  </portlet>
+
+  <portlet>
+    <portlet-name>AboutJetspeed</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <js:metadata name="selector.conditional.role">*</js:metadata>
+  </portlet>
+
+  <portlet>
+    <portlet-name>JetspeedDeveloper</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+    <js:metadata name="selector.conditional.role">*</js:metadata>
+  </portlet>
+
+  <portlet>
+    <portlet-name>ChangePasswordPortlet</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+  </portlet>
+
+  <portlet>
+    <portlet-name>SSOIFramePortlet</portlet-name>
+    <js:security-constraint-ref>user-edit</js:security-constraint-ref>
+  </portlet>
+
+  <portlet>
+    <portlet-name>SSOWebContentPortlet</portlet-name>
+    <js:security-constraint-ref>user-edit</js:security-constraint-ref>
+  </portlet>
+
+  <portlet>
+    <portlet-name>BreadcrumbMenu</portlet-name>
+    <js:security-constraint-ref>public-view</js:security-constraint-ref>
+  </portlet>
+
+  <portlet>
+    <portlet-name>PortalSiteManager</portlet-name>
+    <js:metadata name="merge.portal.parameters.with.portlet.parameters">true</js:metadata>
+    <js:metadata name="merge.portal.parameters.before.portlet.parameters">true</js:metadata>
+  </portlet>
+
+  <js:services>
+    <js:service name='ApplicationServerManager' />
+    <js:service name='DeploymentManager' />
+    <js:service name='EntityAccessor' />
+    <js:service name='GroupManager' />
+    <js:service name='PageManager' />
+    <js:service name='PermissionManager' />
+    <js:service name='PortletFactory' />
+    <js:service name='PortletPreferencesProvider' />
+    <js:service name='PortalAdministration' />
+    <js:service name='PortletRegistryComponent' />
+    <js:service name='PortalStatistics' />
+    <js:service name="Profiler" />
+    <js:service name='RoleManager' />
+    <js:service name='SearchComponent' />
+    <js:service name="SSO" />
+    <js:service name='UserManager' />
+    <js:service name='DecorationFactory' />
+    <js:service name='SecurityAccessController' />
+    <js:service name='PortletTrackingManager' />
+    <js:service name='PortalConfiguration' />
+    <js:service name='ImporterManager' />
+    <js:service name='AuditActivity' />
+    <js:service name='JetspeedSerializer' />
+    <js:service name='JetspeedPrincipalManagerProvider' />
+    <js:service name='PAM' />
+    <js:service name='AuthenticationProvider' />
+    <js:service name='CacheMonitor' />
+    <js:service name='SpacesService' />
+    <js:service name='PageLayoutComponent' />
+  </js:services>
 
 </portlet-app>

Modified: 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=912646&r1=912645&r2=912646&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp
Mon Feb 22 16:40:10 2010
@@ -71,6 +71,7 @@
         
         out.write("<li path='" + folderUrl + "' class='expanded'>");
         out.write("<a href='#'>" + folderName + "</a>");
+        out.write("<a class='dropdown'></a>");
         out.write("\n");
         
         List<MenuElement> childElements = (List<MenuElement>) folderMenu.getElements();
@@ -95,7 +96,10 @@
     {
         MenuOption option = (MenuOption)element;
         String url = pageNavigator.getAbsoluteUrl(option.getUrl(), renderResponse, rc);
-        out.write("<li path='" + option.getUrl() +"'><a href='" + url + "'>"
+ element.getTitle(renderRequest.getLocale()) + "</a></li>");
+        out.write("<li path='" + option.getUrl() +"'>");
+        out.write("<a href='" + url + "'>" + element.getTitle(renderRequest.getLocale())
+ "</a>");
+        out.write("<a class='dropdown'></a>");
+        out.write("</li>");
         out.write("\n");
     }
 }
@@ -103,9 +107,13 @@
 
 <portlet:defineObjects/>
 <fmt:setBundle basename="org.apache.jetspeed.portlets.spaces.resources.SpacesResources"
/>
+<c:set var="authenticated" value="${not empty renderRequest.userPrincipal}"/>
+<c:set var="pageEditable" value="${authenticated}"/>
 
 <%
 RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
+String contextPath = rc.getRequest().getContextPath();
+String basePath = rc.getPortalURL().getBasePath();
 String portalPagePath = rc.getPortalURL().getPath();
 if (portalPagePath == null || "".equals(portalPagePath)) {
     portalPagePath = "/";
@@ -144,39 +152,140 @@
 }
 %>
   </div>
-<%
-if (renderRequest.getUserPrincipal() != null) {
-%>
-  <table style="border-collapse: collapse; width: 100%; margin-top: 0px; margin-bottom:
0px; float: left;">
-    <tr>
-      <th class="portlet-section-header"></th>
-    </tr>
-    <tr>
-      <td class="portlet-section-body">
-        <input type="text" name="addPage" class="portlet-form-input-field" size="15" value=""
><input type="submit" value="<fmt:message key='spaces.pages.label.add'/>" />
-      </td>
-    </tr>
-    <tr>
-      <td class="portlet-section-body">
-        <fmt:message key="spaces.pages.label.template"/>:
-        <select name="templatePage" class="portlet-form-field">
-          <c:forEach items="${templatePages}" var="templatePage">
-            <option value="${templatePage.path}">${templatePage.title}</option>
-          </c:forEach>
-        </select>
-      </td>
-    </tr>
-    <tr>
-      <th class="portlet-section-header"></th>
-    </tr>
-  </table>
-<%
-}
-%>
+  
+  <c:if test="${pageEditable}">
+    <table style="border-collapse: collapse; width: 100%; margin-top: 0px; margin-bottom:
0px; float: left;">
+      <tr>
+        <th class="portlet-section-header"></th>
+      </tr>
+      <tr>
+        <td class="portlet-section-body">
+          <input type="text" name="addPage" class="portlet-form-input-field" size="15"
value="" ><input type="submit" value="<fmt:message key='spaces.pages.label.add'/>"
/>
+        </td>
+      </tr>
+      <tr>
+        <td class="portlet-section-body">
+          <fmt:message key="spaces.pages.label.template"/>:
+          <select name="templatePage" class="portlet-form-field">
+            <c:forEach items="${templatePages}" var="templatePage">
+              <option value="${templatePage.path}">${templatePage.title}</option>
+            </c:forEach>
+          </select>
+        </td>
+      </tr>
+      <tr>
+        <th class="portlet-section-header"></th>
+      </tr>
+    </table>
+  </c:if>
+  
 </form>
 
+<div id="<portlet:namespace/>nodeEditorOverlay" style="BACKGROUND-COLOR: #eee; BORDER-LEFT:
#fff solid 2px; BORDER-TOP: #fff solid 2px; BORDER-RIGHT: #aaa solid 2px; BORDER-BOTTOM: #aaa
solid 2px; DISPLAY: none; PADDING: 10px">
+  <div class="yui-widget-hd">
+    <table border="0" width="100%" cellpadding="0" cellspacing="0">
+      <tr>
+        <td><h2><fmt:message key="spaces.pages.label.siteNodeEditor"/></h2></td>
+        <td align="right"><a id="<portlet:namespace/>nodeEditorOverlayClose"
href="#"><img border="0" alt="<fmt:message key='spaces.pages.label.close'/>" src="<%=contextPath%>/decorations/images/close.gif"/></a></td>
+      </tr>
+    </table>
+  </div>
+  <div class="yui-widget-bd"></div>
+  <div class="yui-widget-ft" align="center"><a id="<portlet:namespace/>nodeEditorOverlayCloseButton"
href="#"><fmt:message key="spaces.pages.label.close"/></a></div>
+</div>
+
 <script language="javascript">
-YUI().use('jetui-portal', 'io', 'json', 'node', 'cookie', 'overlay', 'anim', 'plugin', function(Y)
{
+YUI().use('jetui-portal', 'io', 'json', 'node', 'cookie', 'overlay', 'anim', 'plugin', 'event-mouseenter',
function(Y) {
+
+    var nodeEditorOverlay = null;
+    
+    function AnimPlugin(config) {
+        AnimPlugin.superclass.constructor.apply(this, arguments);
+    }
+    
+    AnimPlugin.NS = "fx";
+    AnimPlugin.NAME = "animPlugin";
+    AnimPlugin.ATTRS = {
+        duration : { value: 0.1 },
+        animVisible : {
+            valueFn : function() {
+                var host = this.get("host");
+                var boundingBox = host.get("boundingBox");
+                var anim = new Y.Anim({
+                    node: boundingBox,
+                    to: { opacity: 1 },
+                    duration: this.get("duration")
+                });
+                if (!host.get("visible")) {
+                    boundingBox.setStyle("opacity", 0);
+                }
+                anim.on("destroy", function() {
+                    if (Y.UA.ie) {
+                        this.get("node").setStyle("opacity", 1);
+                    } else {
+                        this.get("node").setStyle("opacity", "");
+                    }
+                });
+                return anim;
+            }
+        },
+        animHidden : {
+            valueFn : function() {
+                return new Y.Anim({
+                    node: this.get("host").get("boundingBox"),
+                    to: { opacity: 0 },
+                    duration: this.get("duration")
+                });
+            }
+        }
+    }
+    
+    Y.extend(AnimPlugin, Y.Plugin.Base, {
+        initializer : function(config) {
+            this._bindAnimVisible();
+            this._bindAnimHidden();
+            this.after("animVisibleChange", this._bindAnimVisible);
+            this.after("animHiddenChange", this._bindAnimHidden);
+            this.doBefore("_uiSetVisible", this._uiAnimSetVisible);
+        },
+        destructor : function() {
+            this.get("animVisible").destroy();
+            this.get("animHidden").destroy();
+        },
+        _uiAnimSetVisible : function(val) {
+            if (this.get("host").get("rendered")) {
+                if (val) {
+                    this.get("animHidden").stop();
+                    this.get("animVisible").run();
+                } else {
+                    this.get("animVisible").stop();
+                    this.get("animHidden").run();
+                }
+                return new Y.Do.Prevent("AnimPlugin prevented default show/hide");
+            }
+        },
+        _uiSetVisible : function(val) {
+            var host = this.get("host");
+            var hiddenClass = host.getClassName("hidden");
+            if (!val) {
+                host.get("boundingBox").addClass(hiddenClass);
+            } else {
+                host.get("boundingBox").removeClass(hiddenClass);
+            }
+        },
+        _bindAnimVisible : function() {
+            var animVisible = this.get("animVisible");
+            animVisible.on("start", Y.bind(function() {
+                this._uiSetVisible(true);
+            }, this));
+        },
+        _bindAnimHidden : function() {
+            var animHidden = this.get("animHidden");
+            animHidden.after("end", Y.bind(function() {
+                this._uiSetVisible(false);
+            }, this));
+        }
+    });
     
     var onMenuItemClick = function(e) {
         var a = e.target;
@@ -196,12 +305,80 @@
 	        e.halt();
         }
     };
+
+    var onMenuItemDropDownClick = function(e) {
+        var a = e.target;
+        var menuitem = a.get("parentNode");
+        var point = [ e.pageX, e.pageY ];
+        var nodeEditorNode = Y.Node.getDOMNode(Y.Node.one("#<portlet:namespace/>nodeEditorOverlay"));
+        var windowWidth = window.innerWidth;
+        var windowHeight = window.innerHeight;
+        
+        if (!nodeEditorOverlay) {
+            Y.Node.getDOMNode(Y.Node.one("#<portlet:namespace/>nodeEditorOverlay")).style.display
= "";
+            nodeEditorOverlay = new Y.Overlay({
+                contentBox: "#<portlet:namespace/>nodeEditorOverlay",
+                xy: [windowWidth, windowHeight],
+                visible: false,
+                plugins : [{fn:AnimPlugin, cfg:{duration:0.1}}]
+            });
+        }
+
+        var nodeType = "page";
+        var nodePath = menuitem.getAttribute("path");
+        var src = "<%=basePath%>/system/sitemanager/nodeeditor.psml?_jssmnodetype="
+ nodeType + "&_jssmnodepath=" + nodePath;
+        var offsetWidth = 700;
+        var offsetHeight = 500;
+        var nodwViewWindow = Y.Node.create("<iframe width='" + offsetWidth + "' height='"
+ offsetHeight + "' frameborder='0' scrolling='auto' align='bottom' marginwidth='0' marginheight='0'
src='" + src + "'></iframe>");
+
+        nodeEditorOverlay.set("bodyContent", nodwViewWindow);
+        nodeEditorOverlay.render();
+
+        point[0] = (windowWidth - offsetWidth) / 2;
+        point[1] = (windowHeight - offsetHeight) / 2;
+        
+        nodeEditorOverlay.move(point[0], point[1]);
+        nodeEditorOverlay.show();
+    };
+    
+    var onMenuItemMouseEnter = function(e) {
+        var li = e.target;
+        var dropDown = li.one(".dropdown");
+        if (dropDown) {
+	        dropDown.removeClass("dropdown");
+	        dropDown.addClass("dropdownActive");
+	        dropDown.on("click", onMenuItemDropDownClick);
+        }
+        e.halt();
+    };
+    
+    var onMenuItemMouseLeave = function(e) {
+        var li = e.target;
+        var dropDown = li.one(".dropdownActive");
+        if (dropDown) {
+	        dropDown.removeClass("dropdownActive");
+	        dropDown.addClass("dropdown");
+        }
+        e.halt();
+    };
+
+    var closenodeEditorOverlay = function(e) {
+        nodeEditorOverlay.hide();
+        e.halt();
+    };
     
     var pageNavMenu = Y.Node.one("#<portlet:namespace/>pageNavMenu");
     pageNavMenu.all("A").each(function(v, k) {
         v.on("click", onMenuItemClick);
     });
 
+    <c:if test="${pageEditable}">
+    pageNavMenu.all("LI").each(function(v, k) {
+        v.on("mouseenter", onMenuItemMouseEnter);
+	    v.on("mouseleave", onMenuItemMouseLeave);
+    });
+    </c:if>
+
     var portalPagePath = "<%=portalPagePath%>";
     var curMenuItem = null;
     pageNavMenu.all("LI").each(function(v, k) {
@@ -210,6 +387,8 @@
             v.addClass("active");
         }
     });
-    
+
+    Y.Node.one("#<portlet:namespace/>nodeEditorOverlayClose").on("click", closenodeEditorOverlay);
+    Y.Node.one("#<portlet:namespace/>nodeEditorOverlayCloseButton").on("click", closenodeEditorOverlay);
 });
 </script>



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