portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r450362 - in /portals/jetspeed-2/trunk: applications/gems/src/java/org/apache/portals/gems/dojo/ components/portal/src/java/org/apache/jetspeed/decoration/ components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/ components/portal/sr...
Date Wed, 27 Sep 2006 07:30:29 GMT
Author: taylor
Date: Wed Sep 27 00:30:28 2006
New Revision: 450362

URL: http://svn.apache.org/viewvc?view=rev&rev=450362
Log:
add ajax support for retrieving decorations, layouts in site portlet

Added:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getfolder.vm
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getlink.vm
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getthemes.vm
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetFolderAction.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetLinkAction.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetThemesAction.java
Modified:
    portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/DojoSpringMVCPortlet.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/psml.vm
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/Constants.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/SecurityConstraintsAction.java
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/administration.xml
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/theme-engine.xml
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/folder.metadata

Modified: portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/DojoSpringMVCPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/DojoSpringMVCPortlet.java?view=diff&rev=450362&r1=450361&r2=450362
==============================================================================
--- portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/DojoSpringMVCPortlet.java
(original)
+++ portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/DojoSpringMVCPortlet.java
Wed Sep 27 00:30:28 2006
@@ -62,7 +62,7 @@
 		throws PortletException, java.io.IOException
 	{	
     	headerInfoText.append( "var djConfig = { " );
-    	headerInfoText.append( "isDebug: false, debugAtAllCosts: false" );
+    	headerInfoText.append( "isDebug: true, debugAtAllCosts: false" );
     	headerInfoText.append( ", baseScriptUri: '" );
     	headerInfoText.append( portalContextPath ).append( "/javascript/dojo/" );
     	headerInfoText.append( "'" );

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java?view=diff&rev=450362&r1=450361&r2=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationFactoryImpl.java
Wed Sep 27 00:30:28 2006
@@ -52,6 +52,7 @@
     private static final Log log = LogFactory.getLog(DecorationFactoryImpl.class);
 
     private final Path decorationsPath;
+    private final Path desktopThemesPath;
     private final ResourceValidator validator;
     private final String defaultLayoutDecorator;
     private final String defaultPortletDecorator;
@@ -61,33 +62,45 @@
     
     private Set layoutDecorationsDir = Collections.EMPTY_SET;
     private Set portletDecorationsDir = Collections.EMPTY_SET;
+    private Set desktopThemesDir = Collections.EMPTY_SET;
     
     private Set layoutDecorationsList = Collections.EMPTY_SET;
     private Set portletDecorationsList = Collections.EMPTY_SET;
+    private Set desktopThemesList = Collections.EMPTY_SET;
     
     private Map portletDecoratorProperties = new HashMap();
     private Map layoutDecoratorProperties = new HashMap();
 
-    public DecorationFactoryImpl(String decorationsPath, ResourceValidator validator, String
defaultLayoutDecorator, String defaultPortletDecorator)
+    public DecorationFactoryImpl(String decorationsPath, 
+                                 ResourceValidator validator, 
+                                 String defaultLayoutDecorator, 
+                                 String defaultPortletDecorator)
+    {
+        this(null, decorationsPath, validator, defaultLayoutDecorator, defaultPortletDecorator,
"/desktop-themes");
+    }
+
+    public DecorationFactoryImpl(PortletRegistry registry,
+                                 String decorationsPath, 
+                                 ResourceValidator validator, 
+                                 String defaultLayoutDecorator, 
+                                 String defaultPortletDecorator, 
+                                 String desktopThemesPath)
     {
-        this.registry = null;
+        this.registry =  registry;
         this.decorationsPath = new Path(decorationsPath);
         this.validator = validator;
         this.defaultLayoutDecorator = defaultLayoutDecorator;
-        this.defaultPortletDecorator = defaultPortletDecorator;
+        this.defaultPortletDecorator = defaultPortletDecorator;        
+        this.desktopThemesPath = new Path(desktopThemesPath); 
     }
-
+    
     public DecorationFactoryImpl(PortletRegistry registry,
                                  String decorationsPath,
                                  ResourceValidator validator,
                                  String defaultLayoutDecorator,
                                  String defaultPortletDecorator)
     {
-        this.registry =  registry;
-        this.decorationsPath = new Path(decorationsPath);
-        this.validator = validator;
-        this.defaultLayoutDecorator = defaultLayoutDecorator;
-        this.defaultPortletDecorator = defaultPortletDecorator;
+        this(registry, decorationsPath, validator, defaultLayoutDecorator, defaultPortletDecorator,
"/desktop-themes");
     }
 
     public Theme getTheme(Page page, RequestContext requestContext)
@@ -305,7 +318,7 @@
         Set decorations = servletContext.getResourcePaths(decorationsPath.toString()+"/layout");
         if(!layoutDecorationsDir.equals(decorations))
         {
-            layoutDecorationsList = getListing(decorations);
+            layoutDecorationsList = getListing(decorations, "decorator.properties");
             layoutDecorationsDir = decorations;
             
         }
@@ -322,7 +335,7 @@
         Set decorations = servletContext.getResourcePaths(decorationsPath.toString()+"/portlet");
         if(!portletDecorationsDir.equals(decorations))
         {
-            portletDecorationsList = getListing(decorations);
+            portletDecorationsList = getListing(decorations, "decorator.properties");
             portletDecorationsDir = decorations;
             
         }
@@ -330,6 +343,24 @@
     }
 
     /**
+     * Get the portal-wide list of available desktop skins.
+     * 
+     * @return A list of desktop skins of type <code>String</code>
+     */        
+    public Set getDesktopThemes(RequestContext request)
+    {
+        Set desktopThemes = servletContext.getResourcePaths(desktopThemesPath.toString());
+        if(!desktopThemesDir.equals(desktopThemes))
+        {
+            desktopThemesList = getListing(desktopThemes, "theme.properties");
+            desktopThemesDir = desktopThemes;
+            
+        }
+        return desktopThemesList;
+        
+    }
+    
+    /**
      * Get the portal-wide list of available layouts.
      *
      * @return A list of layout portlets of type <code>PortletDefinitionComposite</code>
@@ -357,14 +388,14 @@
         return list;
     }
     
-    protected Set getListing(Set rawList)
+    protected Set getListing(Set rawList, String propsFile)
     {
         Iterator itr = rawList.iterator();
         Set filteredList = new HashSet();
         while(itr.hasNext())
         {
             Path path = new Path((String) itr.next());
-            if(path.getFileName() == null && validator.resourceExists(path.toString()+"decorator.properties"))
+            if(path.getFileName() == null && validator.resourceExists(path.toString()
+ propsFile))
             {
                 int offset = path.length() - 1;
                 filteredList.add(path.getSegment(offset));
@@ -373,4 +404,5 @@
         return filteredList;
     }
 
+    
 }

Added: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getfolder.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getfolder.vm?view=auto&rev=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getfolder.vm
(added)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getfolder.vm
Wed Sep 27 00:30:28 2006
@@ -0,0 +1,17 @@
+<js>
+    <status>$!status</status>
+    <action>$!action</action>    
+    <folder>
+      <path>$!folder.Path</path>
+      <name>$!folder.Name</name>
+      <url>$!folder.Url</url>
+      <hidden>$!folder.isHidden()</hidden>
+      <reserved>$!folder.isReserved()</reserved>
+		      <title>$!folder.Title</title>
+		      <shortTitle>$!folder.ShortTitle</shortTitle>		      
+		      <pageDecorator>$!folder.getDefaultDecorator("layout")</pageDecorator>
+		      <portletDecorator>$!folder.getDefaultDecorator("portlet")</portletDecorator>
	      
+		      <defaultPage>$!folder.DefaultPage</defaultPage>
+		      <desktopTheme>$!folder.Skin</desktopTheme>
+    </folder>    
+</js>

Added: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getlink.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getlink.vm?view=auto&rev=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getlink.vm
(added)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getlink.vm
Wed Sep 27 00:30:28 2006
@@ -0,0 +1,9 @@
+<js>
+    <status>$status</status>
+    <action>$action</action>    
+    <link>
+      <path>$link.Path</path>
+		      <title>$link.Title</title>
+		      <shortTitle>$link.ShortTitle</shortTitle>		      
+    </link>    
+</js>

Added: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getthemes.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getthemes.vm?view=auto&rev=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getthemes.vm
(added)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getthemes.vm
Wed Sep 27 00:30:28 2006
@@ -0,0 +1,52 @@
+#if ($format == "json")
+#if ($type == "portletDecorations")
+[
+#foreach($p in $portletDecorations)    
+ ["$p", "$p"],
+#end        
+]
+#elseif ($type == "pageDecorations")
+[
+#foreach($p in $pageDecorations)    
+ ["$p", "$p"],
+#end        
+]
+#elseif ($type == "desktopThemes")
+[
+#foreach($dt in $desktopThemes)    
+ ["$dt", "$dt"],
+#end 
+]
+#elseif ($type == "layouts")
+[
+#foreach($l in $layouts)    
+ ["$l.DisplayName", "$l.Name"],
+#end        
+]
+#end
+#else    
+<js>
+    <status>$status</status>
+    <action>$action</action>    
+    <layouts>    
+#foreach($l in $layouts)    
+    <layout>$l.DisplayName</layout>    
+#end        
+    </layouts>
+    <page-decorations>
+#foreach($p in $pageDecorations)    
+    <page-decoration>$p</page-decoration>    
+#end    
+    </page-decorations>
+    <portlet-decorations>
+#foreach($p in $portletDecorations)    
+    <portlet-decoration>$p</portlet-decoration>    
+#end    
+    </portlet-decorations>
+    <desktop-themes>
+#foreach($dt in $desktopThemes)    
+    <desktop-theme>$dt</desktop-theme>    
+#end 
+    </desktop-themes>
+</js>
+#end   

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/psml.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/psml.vm?view=diff&rev=450362&r1=450361&r2=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/psml.vm
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/psml.vm
Wed Sep 27 00:30:28 2006
@@ -42,8 +42,10 @@
   #foreach ($meta in $page.Metadata.Fields)
 	<metadata name="$meta.Name" xml:lang="$meta.Locale.Language">$meta.Value</metadata>
   #end
-    
+
+#if ($fragments == "true")    
   #traverseFragments($page.RootFragment)
+#end
   
 </page>    
 

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/Constants.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/Constants.java?view=diff&rev=450362&r1=450361&r2=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/Constants.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/Constants.java
Wed Sep 27 00:30:28 2006
@@ -64,6 +64,15 @@
     public static final String MENU_CONTEXT = "menuContext";
     public static final String MENU_LOCALE = "menuLocale";
 
+    public static final String PAGE_DECORATIONS = "pageDecorations";
+    public static final String PORTLET_DECORATIONS = "portletDecorations";
+    public static final String LAYOUTS = "layouts";
+    public static final String DESKTOP_THEMES = "desktopThemes";
+    public static final String LINK = "link";
+    public static final String FRAGMENTS = "fragments";
+    public static final String TYPE = "type";
+    public static final String FORMAT = "format";
+    
 	// Move types
 	public static final int ABS = 1;
 	public static final int UP = 2;

Added: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetFolderAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetFolderAction.java?view=auto&rev=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetFolderAction.java
(added)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetFolderAction.java
Wed Sep 27 00:30:28 2006
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.layout.impl;
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.ajax.AjaxAction;
+import org.apache.jetspeed.ajax.AjaxBuilder;
+import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
+import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.page.PageManager;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * Retrieve a single page
+ *
+ * AJAX Parameters: 
+ *    folder = the path of the folder to retrieve information on 
+ *    
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class GetFolderAction 
+    extends BasePortletAction 
+    implements AjaxAction, AjaxBuilder, Constants
+{
+    protected Log log = LogFactory.getLog(GetFolderAction.class);
+    
+    public GetFolderAction(String template, 
+                             String errorTemplate,
+                             PageManager pageManager,
+                             PortletActionSecurityBehavior securityBehavior)
+    {
+        super(template, errorTemplate, pageManager, securityBehavior);
+    }
+
+    public boolean run(RequestContext requestContext, Map resultMap)
+    {
+        boolean success = true;
+        String status = "success";
+        try
+        {
+            resultMap.put(ACTION, "getfolder");
+            if (false == checkAccess(requestContext, JetspeedActions.VIEW))
+            {
+                    success = false;
+                    resultMap.put(REASON, "Insufficient access to get portlets");
+                    return success;
+            }                                    
+            Folder folder = retrieveFolder(requestContext);            
+            resultMap.put(STATUS, status);
+            resultMap.put(FOLDER, folder);
+        } 
+        catch (Exception e)
+        {
+            // Log the exception
+            log.error("exception while getting folder info", e);
+
+            // Return a failure indicator
+            success = false;
+        }
+
+        return success;
+	}
+    
+    protected Folder retrieveFolder(RequestContext requestContext)
+    throws Exception
+    {        
+        String folderName = requestContext.getRequestParameter(FOLDER);
+        if (folderName == null)
+        {
+            folderName = "/";
+        }
+        Folder folder = pageManager.getFolder(folderName);
+        return folder;
+    }
+    
+    
+}

Added: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetLinkAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetLinkAction.java?view=auto&rev=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetLinkAction.java
(added)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetLinkAction.java
Wed Sep 27 00:30:28 2006
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.layout.impl;
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.ajax.AjaxAction;
+import org.apache.jetspeed.ajax.AjaxBuilder;
+import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
+import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.om.page.Link;
+import org.apache.jetspeed.page.PageManager;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * Retrieve a single link
+ *
+ * AJAX Parameters: 
+ *    link = the path of the link to retrieve information on 
+ *    
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class GetLinkAction 
+    extends BasePortletAction 
+    implements AjaxAction, AjaxBuilder, Constants
+{
+    protected Log log = LogFactory.getLog(GetLinkAction.class);
+    
+    public GetLinkAction(String template, 
+                             String errorTemplate,
+                             PageManager pageManager,
+                             PortletActionSecurityBehavior securityBehavior)
+    {
+        super(template, errorTemplate, pageManager, securityBehavior);
+    }
+
+    public boolean run(RequestContext requestContext, Map resultMap)
+    {
+        boolean success = true;
+        String status = "success";
+        try
+        {
+            resultMap.put(ACTION, "getlink");
+            if (false == checkAccess(requestContext, JetspeedActions.VIEW))
+            {
+                    success = false;
+                    resultMap.put(REASON, "Insufficient access to get link");
+                    return success;
+            }                                    
+            Link link = retrieveLink(requestContext);            
+            resultMap.put(STATUS, status);
+            resultMap.put(LINK, link);
+        } 
+        catch (Exception e)
+        {
+            // Log the exception
+            log.error("exception while getting link info", e);
+
+            // Return a failure indicator
+            success = false;
+        }
+
+        return success;
+	}
+    
+    protected Link retrieveLink(RequestContext requestContext)
+    throws Exception
+    {        
+        String linkName = requestContext.getRequestParameter(LINK);
+        if (linkName == null)
+        {
+            linkName = "/";
+        }
+        Link link = pageManager.getLink(linkName);
+        return link;
+    }        
+}

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java?view=diff&rev=450362&r1=450361&r2=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
Wed Sep 27 00:30:28 2006
@@ -27,6 +27,7 @@
 import org.apache.jetspeed.ajax.AjaxBuilder;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
 import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
+import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.page.PageManager;
@@ -75,10 +76,32 @@
                 success = false;
                 return success;
             }            
-            //String filter = requestContext.getRequestParameter(FILTER);               
                   
-            Page page = requestContext.getPage();            
+            //String filter = requestContext.getRequestParameter(FILTER);
+            Page page = requestContext.getPage();
+            String pageName = requestContext.getRequestParameter(PAGE);
+            if (pageName != null)
+            {
+                page = retrievePage(requestContext, pageName);
+            }
             resultMap.put(STATUS, status);
             resultMap.put(PAGE, page);
+            String fragments = requestContext.getRequestParameter(FRAGMENTS);
+            if (fragments == null)
+            {
+                resultMap.put(FRAGMENTS, "true");
+            }
+            else
+            {
+                if (fragments.equalsIgnoreCase("true"))
+                {
+                    resultMap.put(FRAGMENTS, "true");
+                }
+                else
+                {
+                    resultMap.put(FRAGMENTS, "false");
+                    return success;
+                }
+            }
             Map fragSizes = new HashMap();
             retrieveLayoutFragmentSizes( page.getRootFragment(), fragSizes );
             resultMap.put( SIZES, fragSizes );
@@ -94,6 +117,18 @@
 
         return success;
 	}
+    
+    protected Page retrievePage(RequestContext requestContext, String pageName)
+    throws Exception
+    {        
+        if (pageName == null)
+        {
+            pageName = "/";
+        }
+        Page page = pageManager.getPage(pageName);
+        return page;
+    }        
+    
     
     protected void retrieveLayoutFragmentSizes( Fragment frag, Map fragSizes )
     {

Added: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetThemesAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetThemesAction.java?view=auto&rev=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetThemesAction.java
(added)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetThemesAction.java
Wed Sep 27 00:30:28 2006
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.layout.impl;
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.ajax.AjaxAction;
+import org.apache.jetspeed.ajax.AjaxBuilder;
+import org.apache.jetspeed.decoration.DecorationFactory;
+import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * Get Portal-wide themes lists 
+ * (page decorators, portlet decorators, layouts, desktop-themes (skins))
+ *
+ * AJAX Parameters: 
+ *    none 
+ *    
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class GetThemesAction 
+    extends BasePortletAction 
+    implements AjaxAction, AjaxBuilder, Constants
+{
+    protected Log log = LogFactory.getLog(GetThemesAction.class);
+    protected DecorationFactory decorationFactory;
+    
+    public GetThemesAction(String template, 
+                           String errorTemplate,
+                           DecorationFactory decorationFactory,
+                           PortletActionSecurityBehavior securityBehavior)
+    {
+        super(template, errorTemplate, securityBehavior);
+        this.decorationFactory = decorationFactory;
+    }
+
+    public boolean run(RequestContext requestContext, Map resultMap)
+    {
+        boolean success = true;
+        String status = "success";
+        try
+        {
+            resultMap.put(ACTION, "getthemes");
+            if (false == checkAccess(requestContext, JetspeedActions.VIEW))
+            {
+                    success = false;
+                    resultMap.put(REASON, "Insufficient access to get themes");
+                    return success;
+            }                     
+            String type = requestContext.getRequestParameter(TYPE);
+            String format = requestContext.getRequestParameter(FORMAT);
+            if (format == null)
+                format = "xml";
+            if (type == null || type.equals(PAGE_DECORATIONS))
+                resultMap.put(PAGE_DECORATIONS, decorationFactory.getPageDecorations(requestContext));
+            if (type == null || type.equals(PORTLET_DECORATIONS))
+                resultMap.put(PORTLET_DECORATIONS, decorationFactory.getPortletDecorations(requestContext));
+            if (type == null || type.equals(LAYOUTS))
+                resultMap.put(LAYOUTS, decorationFactory.getLayouts(requestContext));
+            if (type == null || type.equals(DESKTOP_THEMES))
+                resultMap.put(DESKTOP_THEMES, decorationFactory.getDesktopThemes(requestContext));
+            resultMap.put (TYPE, type);
+            resultMap.put(FORMAT, format);
+            resultMap.put(STATUS, status);
+        } 
+        catch (Exception e)
+        {
+            // Log the exception
+            log.error("exception while getting theme info", e);
+            // Return a failure indicator
+            success = false;
+        }
+
+        return success;
+	}
+    
+    
+}

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/SecurityConstraintsAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/SecurityConstraintsAction.java?view=diff&rev=450362&r1=450361&r2=450362
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/SecurityConstraintsAction.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/SecurityConstraintsAction.java
Wed Sep 27 00:30:28 2006
@@ -52,7 +52,7 @@
     extends BasePortletAction 
     implements AjaxAction, AjaxBuilder, Constants
 {
-    protected Log log = LogFactory.getLog(SecurityPermissionAction.class);
+    protected Log log = LogFactory.getLog(SecurityConstraintsAction.class);
     protected PageManager pm = null;
 
     public SecurityConstraintsAction(String template, 

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/administration.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/administration.xml?view=diff&rev=450362&r1=450361&r2=450362
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/administration.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/administration.xml Wed Sep 27 00:30:28
2006
@@ -20,6 +20,11 @@
     <property name="host"><value>localhost</value></property>
     <property name="username"><value></value></property>
     <property name="password"><value></value></property>
+      <property name="javaMailProperties">
+          <props>
+              <prop key="mail.smtp.auth">false</prop>
+          </props>
+      </property>
   </bean>
   
 <bean id="adminVelocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml?view=diff&rev=450362&r1=450361&r2=450362
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml Wed Sep 27 00:30:28
2006
@@ -239,6 +239,54 @@
     </constructor-arg>    		        
 </bean>
 
+<bean id="AjaxGetFolder"
+    class="org.apache.jetspeed.layout.impl.GetFolderAction">
+    <constructor-arg index="0">
+        <value>org/apache/jetspeed/layout/ajax-xml/getfolder.vm</value>
+    </constructor-arg>
+    <constructor-arg index="1">
+        <value>org/apache/jetspeed/layout/ajax-xml/error.vm</value>
+    </constructor-arg>
+    <constructor-arg index='2'>
+        <ref bean="org.apache.jetspeed.page.PageManager"/>        
+    </constructor-arg>
+    <constructor-arg index='3'>
+        <ref bean="PortletActionSecurityBehavior"/>        
+    </constructor-arg>    		        
+</bean>
+
+<bean id="AjaxGetLink"
+    class="org.apache.jetspeed.layout.impl.GetLinkAction">
+    <constructor-arg index="0">
+        <value>org/apache/jetspeed/layout/ajax-xml/getlink.vm</value>
+    </constructor-arg>
+    <constructor-arg index="1">
+        <value>org/apache/jetspeed/layout/ajax-xml/error.vm</value>
+    </constructor-arg>
+    <constructor-arg index='2'>
+        <ref bean="org.apache.jetspeed.page.PageManager"/>        
+    </constructor-arg>
+    <constructor-arg index='3'>
+        <ref bean="PortletActionSecurityBehavior"/>        
+    </constructor-arg>    		        
+</bean>
+    
+<bean id="AjaxGetThemes"
+    class="org.apache.jetspeed.layout.impl.GetThemesAction">
+    <constructor-arg index="0">
+        <value>org/apache/jetspeed/layout/ajax-xml/getthemes.vm</value>
+    </constructor-arg>
+    <constructor-arg index="1">
+        <value>org/apache/jetspeed/layout/ajax-xml/error.vm</value>
+    </constructor-arg>
+    <constructor-arg index='2'>
+        <ref bean="DecorationFactory"/>        
+    </constructor-arg>
+    <constructor-arg index='3'>
+        <ref bean="PortletActionSecurityBehavior"/>        
+    </constructor-arg>    		        
+</bean>
+        
 <bean id="AjaxChangeWindow"
     class="org.apache.jetspeed.layout.impl.ChangePortletAction">
     <constructor-arg index="0">
@@ -362,6 +410,15 @@
             <entry key="getpages">
                 <ref bean="AjaxGetPages"/>
             </entry>			
+            <entry key="getfolder">
+                <ref bean="AjaxGetFolder"/>
+            </entry>			            
+            <entry key="getlink">
+                <ref bean="AjaxGetLink"/>
+            </entry>			                        
+            <entry key="getthemes">
+                <ref bean="AjaxGetThemes"/>
+            </entry>			                        
             <entry key="window">
                 <ref bean="AjaxChangeWindow"/>
             </entry>			            

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/theme-engine.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/theme-engine.xml?view=diff&rev=450362&r1=450361&r2=450362
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/theme-engine.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/theme-engine.xml Wed Sep 27 00:30:28
2006
@@ -36,6 +36,9 @@
 	<constructor-arg index="4">
 		<value>tigris</value>
 	</constructor-arg>
+    <constructor-arg index="5">
+      <value>/desktop-themes</value>
+    </constructor-arg>      
   </bean>  
 	
 </beans>

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/folder.metadata
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/folder.metadata?view=diff&rev=450362&r1=450361&r2=450362
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/folder.metadata (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/folder.metadata Wed Sep
27 00:30:28 2006
@@ -2,10 +2,10 @@
 <folder>
   <title >Jetspeed Administrative Portlets</title>  
   <metadata name="title" xml:lang="fr">Jetspeed Portlets Administratif</metadata>
-  <metadata name="title" xml:lang="ja">Jetspeed 管理ポートレット</metadata>
+  <metadata name="title" xml:lang="ja">Jetspeed 管ç?†ãƒ?ートレット</metadata>
   <metadata name="title" xml:lang="es">Administración de Jetspeed</metadata>
-  <metadata name="title" xml:lang="zh">Jetspeed 管理Portlets</metadata>
-
+  <metadata name="title" xml:lang="zh">Jetspeed 管ç?†Portlets</metadata>
+ 
   <document-order>user-mgt.psml</document-order>
   <document-order>role-mgt.psml</document-order>
   <document-order>group-mgt.psml</document-order>
@@ -19,10 +19,10 @@
   <menu name="page-navigations">
     <separator>
       <text>Users Admin Pages</text>
-      <metadata name="text" xml:lang="ja">ユーザー管理ページ</metadata>
+      <metadata name="text" xml:lang="ja">ユーザー管ç?†ãƒšãƒ¼ã‚¸</metadata>
       <metadata name="text" xml:lang="es">Administración de usuarios</metadata>
-      <metadata name="text" xml:lang="zh">用户管理页</metadata>
-      <metadata name="text" xml:lang="zh-TW">用戶管理頁</metadata>
+      <metadata name="text" xml:lang="zh">用户管ç?†é¡µ</metadata>
+      <metadata name="text" xml:lang="zh-TW">用戶管ç?†é ?</metadata>
     </separator>
     <options>/Administrative/user-mgt.psml</options>
     <options>/Administrative/users-jsf.psml</options>
@@ -31,15 +31,15 @@
       <metadata name="text" xml:lang="ja">プロファイルページ</metadata>
       <metadata name="text" xml:lang="es">Su perfil...</metadata>
       <metadata name="text" xml:lang="zh">Profiled页</metadata>
-      <metadata name="text" xml:lang="zh-TW">Profiled頁</metadata>
+      <metadata name="text" xml:lang="zh-TW">Profiledé ?</metadata>
     </separator>
     <options regexp="true">/p[0-9][0-9][0-9].psml</options>
     <separator>
       <text>Non Java Pages</text>
       <metadata name="text" xml:lang="ja">Non-Javaページ</metadata>
       <metadata name="text" xml:lang="es">Páginas sin java</metadata>
-      <metadata name="text" xml:lang="zh">非Java Portlets页</metadata>
-      <metadata name="text" xml:lang="zh-TW">非Java Portlets頁</metadata>
+      <metadata name="text" xml:lang="zh">�Java Portlets页</metadata>
+      <metadata name="text" xml:lang="zh-TW">�Java Portlets�</metadata>
     </separator>
     <options>/non-java</options>
   </menu>



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