portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r725977 [18/48] - in /portals/jetspeed-2/portal/trunk: ./ app-servers/security/jboss/src/java/META-INF/jboss-secsvc/ app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/ applications/jetspeed/src/main/javascrip...
Date Fri, 12 Dec 2008 12:07:04 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetFolderListAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetFolderListAction.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetFolderListAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetFolderListAction.java Fri Dec 12 04:06:29 2008
@@ -1,109 +1,109 @@
-/*
+/*
  * 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.layout.impl;
-
-import java.util.Map;
-import java.util.StringTokenizer;
-
-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;
-
-/**
- * Get the immediate contents of a folder in JSON format 
- *
- * AJAX Parameters: 
- *    folder: full path to the folder 
- *    
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
- */
-public class GetFolderListAction 
-    extends BaseGetResourceAction 
-    implements AjaxAction, AjaxBuilder, Constants
-{
-    protected Log log = LogFactory.getLog(GetThemesAction.class);
-    
-    public GetFolderListAction(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, "getfolderlist");
-            if (false == checkAccess(requestContext, JetspeedActions.VIEW))
-            {
-                    success = false;
-                    resultMap.put(REASON, "Insufficient access to get folderlist");
-                    return success;
-            }                     
-            String data = getActionParameter(requestContext, "data");
-            StringTokenizer tokenizer = new StringTokenizer(data, "[{:\"");
-            String folderName = null;            
-            while (tokenizer.hasMoreTokens())
-            {
-                String token = tokenizer.nextToken();
-                if (token.equals("widgetId"))
-                {
-                    folderName = tokenizer.nextToken();
-                    break;
-                }
-            }
-            String format = getActionParameter(requestContext, FORMAT);
-            if (format == null)
-                format = "json";
-            if (folderName == null)
-            {
-                success = false;
-                resultMap.put(REASON, "Folder name not found.");
-                return success;                
-            }
-            resultMap.put(FORMAT, format);
-            Folder folder = pageManager.getFolder(folderName);
-            resultMap.put(FOLDER, folder);
-            resultMap.put("folders", folder.getFolders().iterator());
-            resultMap.put("pages", folder.getPages().iterator());
-            resultMap.put("links", folder.getLinks().iterator());
-            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;
-    }
-    
-    
-}
+ * 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 java.util.StringTokenizer;
+
+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;
+
+/**
+ * Get the immediate contents of a folder in JSON format 
+ *
+ * AJAX Parameters: 
+ *    folder: full path to the folder 
+ *    
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class GetFolderListAction 
+    extends BaseGetResourceAction 
+    implements AjaxAction, AjaxBuilder, Constants
+{
+    protected Log log = LogFactory.getLog(GetThemesAction.class);
+    
+    public GetFolderListAction(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, "getfolderlist");
+            if (false == checkAccess(requestContext, JetspeedActions.VIEW))
+            {
+                    success = false;
+                    resultMap.put(REASON, "Insufficient access to get folderlist");
+                    return success;
+            }                     
+            String data = getActionParameter(requestContext, "data");
+            StringTokenizer tokenizer = new StringTokenizer(data, "[{:\"");
+            String folderName = null;            
+            while (tokenizer.hasMoreTokens())
+            {
+                String token = tokenizer.nextToken();
+                if (token.equals("widgetId"))
+                {
+                    folderName = tokenizer.nextToken();
+                    break;
+                }
+            }
+            String format = getActionParameter(requestContext, FORMAT);
+            if (format == null)
+                format = "json";
+            if (folderName == null)
+            {
+                success = false;
+                resultMap.put(REASON, "Folder name not found.");
+                return success;                
+            }
+            resultMap.put(FORMAT, format);
+            Folder folder = pageManager.getFolder(folderName);
+            resultMap.put(FOLDER, folder);
+            resultMap.put("folders", folder.getFolders().iterator());
+            resultMap.put("pages", folder.getPages().iterator());
+            resultMap.put("links", folder.getLinks().iterator());
+            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;
+    }
+    
+    
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetFolderListAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetFoldersListAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetLinkAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetLinkAction.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetLinkAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetLinkAction.java Fri Dec 12 04:06:29 2008
@@ -1,96 +1,96 @@
-/*
+/*
  * 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.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.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 BaseGetResourceAction 
-    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);
-            // resultMap.put(METADATA, link.getMetadata().getFields());
-            putSecurityInformation(resultMap, link);            
-        } 
-        catch (Exception e)
-        {
-            // Log the exception
-            log.error("exception while getting link info", e);
-            resultMap.put(REASON, e.getMessage());
-            // Return a failure indicator
-            success = false;
-        }
-
-        return success;
-	}
-    
-    protected Link retrieveLink(RequestContext requestContext)
-    throws Exception
-    {        
-        String linkName = getActionParameter(requestContext, LINK);
-        if (linkName == null)
-        {
-            linkName = "/";
-        }
-        Link link = pageManager.getLink(linkName);
-        return link;
-    }        
-}
+ * 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.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 BaseGetResourceAction 
+    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);
+            // resultMap.put(METADATA, link.getMetadata().getFields());
+            putSecurityInformation(resultMap, link);            
+        } 
+        catch (Exception e)
+        {
+            // Log the exception
+            log.error("exception while getting link info", e);
+            resultMap.put(REASON, e.getMessage());
+            // Return a failure indicator
+            success = false;
+        }
+
+        return success;
+	}
+    
+    protected Link retrieveLink(RequestContext requestContext)
+    throws Exception
+    {        
+        String linkName = getActionParameter(requestContext, LINK);
+        if (linkName == null)
+        {
+            linkName = "/";
+        }
+        Link link = pageManager.getLink(linkName);
+        return link;
+    }        
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetLinkAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPageAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPageAction.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPageAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPageAction.java Fri Dec 12 04:06:29 2008
@@ -1,270 +1,270 @@
-/*
+/*
  * 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.layout.impl;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-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.PortalReservedParameters;
-import org.apache.jetspeed.ajax.AjaxAction;
-import org.apache.jetspeed.ajax.AjaxBuilder;
-import org.apache.jetspeed.components.portletregistry.PortletRegistry;
-import org.apache.jetspeed.decoration.DecorationValve;
-import org.apache.jetspeed.decoration.PageActionAccess;
-import org.apache.jetspeed.decoration.Theme;
-import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
-import org.apache.jetspeed.om.page.Fragment;
-import org.apache.jetspeed.om.page.Page;
-import org.apache.jetspeed.page.PageManager;
-import org.apache.jetspeed.portalsite.PortalSiteRequestContext;
-import org.apache.jetspeed.profiler.impl.ProfilerValveImpl;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.om.portlet.InitParam;
-import org.apache.jetspeed.om.portlet.PortletDefinition;
-
-/**
- * Get Page retrieves a page from the Page Manager store and PSML format
- *
- * AJAX Parameters: 
- *    page = the path and name of the page ("/_user/ronaldino/goals.psml")
- *    
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
- */
-public class GetPageAction 
-    extends BaseGetResourceAction 
-    implements AjaxAction, AjaxBuilder, Constants
-{
-    protected Log log = LogFactory.getLog( GetPageAction.class );
-    
-    private PortletRegistry registry;
-    private DecorationValve decorationValve;
-    
-    public GetPageAction( String template, 
-                          String errorTemplate, 
-                          PageManager pageManager,
-                          PortletActionSecurityBehavior securityBehavior,
-                          PortletRegistry registry,
-                          DecorationValve decorationValve )
-    {
-        super(template, errorTemplate, pageManager, securityBehavior);
-        this.registry = registry;
-        this.decorationValve = decorationValve;
-    }
-
-    public boolean run(RequestContext requestContext, Map resultMap)
-    {
-        boolean success = true;
-        String status = "success";
-        try
-        {
-            resultMap.put( ACTION, "getpage" );
-            if ( false == checkAccess( requestContext, JetspeedActions.VIEW ) )
-            {
-                resultMap.put( REASON, "Insufficient access to view page" );
-                success = false;
-                return success;
-            }            
-            
-            // Run the Decoration valve to get actions
-            decorationValve.invoke( requestContext, null );
-            
-            Page page = requestContext.getPage();
-            String pageName = getActionParameter( requestContext, PAGE );
-            if ( pageName != null )
-            {
-                page = retrievePage( requestContext, pageName );
-            }
-            resultMap.put( STATUS, status );
-            resultMap.put( PAGE, page );
-            
-            Theme theme = (Theme)requestContext.getAttribute( PortalReservedParameters.PAGE_THEME_ATTRIBUTE );
-            String pageDecoratorName = null;
-            if ( theme != null )
-            {
-                pageDecoratorName = theme.getPageLayoutDecoration().getName();
-            }
-            else
-            {
-                pageDecoratorName = page.getDefaultDecorator( LAYOUT );
-            }
-            if ( pageDecoratorName != null )
-                resultMap.put( DEFAULT_LAYOUT, pageDecoratorName );
-                    
-            PortalSiteRequestContext siteRequestContext = (PortalSiteRequestContext)requestContext.getAttribute( ProfilerValveImpl.PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY );
-            if ( siteRequestContext == null )
-            {
-                success = false;
-                resultMap.put( REASON, "Missing portal site request context from ProfilerValve" );
-                return success;
-            }
-            
-            String profiledPath = siteRequestContext.getPage().getPath();
-            resultMap.put( PROFILED_PATH, profiledPath );
-            putSecurityInformation( resultMap, page );
-     
-            PageActionAccess pageActionAccess = (PageActionAccess)requestContext.getAttribute( PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE );
-            Boolean userIsAnonymous = Boolean.TRUE;
-            if ( pageActionAccess != null )
-            	userIsAnonymous = new Boolean( pageActionAccess.isAnonymous() );
-            resultMap.put( USER_IS_ANONYMOUS, userIsAnonymous.toString() );
-     
-            Boolean isPageQualifiedForCreateNewPageOnEdit = Boolean.FALSE;
-            if ( ! userIsAnonymous.booleanValue() )
-            	isPageQualifiedForCreateNewPageOnEdit = new Boolean( isPageQualifiedForCreateNewPageOnEdit( requestContext ) );
-            resultMap.put( PAGE_QUALIFIED_CREATE_ON_EDIT, isPageQualifiedForCreateNewPageOnEdit.toString() );
-            
-            String fragments = getActionParameter( requestContext, 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();
-            Map portletIcons = new HashMap();
-            
-            String singleLayoutId = getActionParameter( requestContext, LAYOUTID );
-            if ( singleLayoutId != null )
-            {   // build page representation with single layout
-                Fragment currentLayoutFragment = page.getFragmentById( singleLayoutId );
-                if ( currentLayoutFragment == null )
-                {
-                    throw new Exception( "layout id not found: " + singleLayoutId );
-                }
-                Fragment currentPortletFragment = null;
-                
-                String singlePortletId = getActionParameter( requestContext, PORTLETENTITY );
-                if ( singlePortletId != null )
-                {
-                    Iterator layoutChildIter = currentLayoutFragment.getFragments().iterator();
-                    while ( layoutChildIter.hasNext() )
-                    {
-                        Fragment childFrag = (Fragment)layoutChildIter.next();
-                        if ( childFrag != null )
-                        {
-                            if ( singlePortletId.equals( childFrag.getId() ) )
-                            {
-                                currentPortletFragment = childFrag;
-                                break;
-                            }
-                        }
-                    }
-                    if ( currentPortletFragment == null )
-                    {
-                        throw new Exception( "portlet id " + singlePortletId + " not found in layout " + singleLayoutId );
-                    }
-                    resultMap.put( "portletsingleId", currentPortletFragment.getId() );
-                }
-                
-                retrieveFragmentSpecialProperties( requestContext, currentLayoutFragment, fragSizes, portletIcons );
-                resultMap.put( "layoutsingle", currentLayoutFragment );
-            }
-            else
-            {
-                retrieveFragmentSpecialProperties( requestContext, page.getRootFragment(), fragSizes, portletIcons );
-            }
-            resultMap.put( SIZES, fragSizes );
-            resultMap.put( "portletIcons", portletIcons );
-        }
-        catch ( Exception e )
-        {
-            // Log the exception
-            log.error( "exception while getting page", e );
-
-            // Return a failure indicator
-            success = false;
-        }
-
-        return success;
-	}
-    
-    protected Page retrievePage( RequestContext requestContext, String pageName )
-        throws Exception
-    {        
-        if ( pageName == null )
-        {
-            pageName = "/";
-        }
-        Page page = pageManager.getPage( pageName );
-        return page;
-    }        
-    
-    
-    protected void retrieveFragmentSpecialProperties( RequestContext requestContext, Fragment frag, Map fragSizes, Map portletIcons )
-    {
-        if ( frag == null )
-        {
-            return;
-        }
-        
-    	if ( "layout".equals( frag.getType() ) )
-    	{   // get layout fragment sizes
-    		if ( fragSizes != null )
-    			PortletPlacementContextImpl.getColumnCountAndSizes( frag, registry, fragSizes );
-    		
-    		List childFragments = frag.getFragments();
-    		if ( childFragments != null )
-    		{
-    			Iterator childFragIter = childFragments.iterator();
-    			while ( childFragIter.hasNext() )
-    			{
-    				Fragment childFrag = (Fragment)childFragIter.next();
-                    retrieveFragmentSpecialProperties( requestContext, childFrag, fragSizes, portletIcons );
-    			}
-    		}
-    	}
-        else if ( portletIcons != null && "portlet".equals( frag.getType() ) )
-        {   // get portlet icon and locale specific portlet display name
-            String portletName = frag.getName();
-            if ( portletName != null && portletName.length() > 0 )
-            {
-                PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( portletName );
-                
-                if ( portletDef != null && portletIcons != null )
-                {
-                    InitParam iconParam = portletDef.getInitParam("portlet-icon");
-                    String iconParamVal = ( iconParam == null ) ? null : iconParam.getParamValue();
-                    if ( iconParamVal != null && iconParamVal.length() > 0 )
-                    {
-                        portletIcons.put( frag.getId(), iconParamVal );
-                    }
-                }
-                else if ( portletDef == null )
-                {
-                    log.error( "GetPageAction could not obtain PortletDefinition for portlet " + portletName );
-                }
-            }
-        }
-    }
-}
+ * 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.HashMap;
+import java.util.Iterator;
+import java.util.List;
+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.PortalReservedParameters;
+import org.apache.jetspeed.ajax.AjaxAction;
+import org.apache.jetspeed.ajax.AjaxBuilder;
+import org.apache.jetspeed.components.portletregistry.PortletRegistry;
+import org.apache.jetspeed.decoration.DecorationValve;
+import org.apache.jetspeed.decoration.PageActionAccess;
+import org.apache.jetspeed.decoration.Theme;
+import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
+import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.page.PageManager;
+import org.apache.jetspeed.portalsite.PortalSiteRequestContext;
+import org.apache.jetspeed.profiler.impl.ProfilerValveImpl;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.om.portlet.InitParam;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+
+/**
+ * Get Page retrieves a page from the Page Manager store and PSML format
+ *
+ * AJAX Parameters: 
+ *    page = the path and name of the page ("/_user/ronaldino/goals.psml")
+ *    
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class GetPageAction 
+    extends BaseGetResourceAction 
+    implements AjaxAction, AjaxBuilder, Constants
+{
+    protected Log log = LogFactory.getLog( GetPageAction.class );
+    
+    private PortletRegistry registry;
+    private DecorationValve decorationValve;
+    
+    public GetPageAction( String template, 
+                          String errorTemplate, 
+                          PageManager pageManager,
+                          PortletActionSecurityBehavior securityBehavior,
+                          PortletRegistry registry,
+                          DecorationValve decorationValve )
+    {
+        super(template, errorTemplate, pageManager, securityBehavior);
+        this.registry = registry;
+        this.decorationValve = decorationValve;
+    }
+
+    public boolean run(RequestContext requestContext, Map resultMap)
+    {
+        boolean success = true;
+        String status = "success";
+        try
+        {
+            resultMap.put( ACTION, "getpage" );
+            if ( false == checkAccess( requestContext, JetspeedActions.VIEW ) )
+            {
+                resultMap.put( REASON, "Insufficient access to view page" );
+                success = false;
+                return success;
+            }            
+            
+            // Run the Decoration valve to get actions
+            decorationValve.invoke( requestContext, null );
+            
+            Page page = requestContext.getPage();
+            String pageName = getActionParameter( requestContext, PAGE );
+            if ( pageName != null )
+            {
+                page = retrievePage( requestContext, pageName );
+            }
+            resultMap.put( STATUS, status );
+            resultMap.put( PAGE, page );
+            
+            Theme theme = (Theme)requestContext.getAttribute( PortalReservedParameters.PAGE_THEME_ATTRIBUTE );
+            String pageDecoratorName = null;
+            if ( theme != null )
+            {
+                pageDecoratorName = theme.getPageLayoutDecoration().getName();
+            }
+            else
+            {
+                pageDecoratorName = page.getDefaultDecorator( LAYOUT );
+            }
+            if ( pageDecoratorName != null )
+                resultMap.put( DEFAULT_LAYOUT, pageDecoratorName );
+                    
+            PortalSiteRequestContext siteRequestContext = (PortalSiteRequestContext)requestContext.getAttribute( ProfilerValveImpl.PORTAL_SITE_REQUEST_CONTEXT_ATTR_KEY );
+            if ( siteRequestContext == null )
+            {
+                success = false;
+                resultMap.put( REASON, "Missing portal site request context from ProfilerValve" );
+                return success;
+            }
+            
+            String profiledPath = siteRequestContext.getPage().getPath();
+            resultMap.put( PROFILED_PATH, profiledPath );
+            putSecurityInformation( resultMap, page );
+     
+            PageActionAccess pageActionAccess = (PageActionAccess)requestContext.getAttribute( PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE );
+            Boolean userIsAnonymous = Boolean.TRUE;
+            if ( pageActionAccess != null )
+            	userIsAnonymous = new Boolean( pageActionAccess.isAnonymous() );
+            resultMap.put( USER_IS_ANONYMOUS, userIsAnonymous.toString() );
+     
+            Boolean isPageQualifiedForCreateNewPageOnEdit = Boolean.FALSE;
+            if ( ! userIsAnonymous.booleanValue() )
+            	isPageQualifiedForCreateNewPageOnEdit = new Boolean( isPageQualifiedForCreateNewPageOnEdit( requestContext ) );
+            resultMap.put( PAGE_QUALIFIED_CREATE_ON_EDIT, isPageQualifiedForCreateNewPageOnEdit.toString() );
+            
+            String fragments = getActionParameter( requestContext, 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();
+            Map portletIcons = new HashMap();
+            
+            String singleLayoutId = getActionParameter( requestContext, LAYOUTID );
+            if ( singleLayoutId != null )
+            {   // build page representation with single layout
+                Fragment currentLayoutFragment = page.getFragmentById( singleLayoutId );
+                if ( currentLayoutFragment == null )
+                {
+                    throw new Exception( "layout id not found: " + singleLayoutId );
+                }
+                Fragment currentPortletFragment = null;
+                
+                String singlePortletId = getActionParameter( requestContext, PORTLETENTITY );
+                if ( singlePortletId != null )
+                {
+                    Iterator layoutChildIter = currentLayoutFragment.getFragments().iterator();
+                    while ( layoutChildIter.hasNext() )
+                    {
+                        Fragment childFrag = (Fragment)layoutChildIter.next();
+                        if ( childFrag != null )
+                        {
+                            if ( singlePortletId.equals( childFrag.getId() ) )
+                            {
+                                currentPortletFragment = childFrag;
+                                break;
+                            }
+                        }
+                    }
+                    if ( currentPortletFragment == null )
+                    {
+                        throw new Exception( "portlet id " + singlePortletId + " not found in layout " + singleLayoutId );
+                    }
+                    resultMap.put( "portletsingleId", currentPortletFragment.getId() );
+                }
+                
+                retrieveFragmentSpecialProperties( requestContext, currentLayoutFragment, fragSizes, portletIcons );
+                resultMap.put( "layoutsingle", currentLayoutFragment );
+            }
+            else
+            {
+                retrieveFragmentSpecialProperties( requestContext, page.getRootFragment(), fragSizes, portletIcons );
+            }
+            resultMap.put( SIZES, fragSizes );
+            resultMap.put( "portletIcons", portletIcons );
+        }
+        catch ( Exception e )
+        {
+            // Log the exception
+            log.error( "exception while getting page", e );
+
+            // Return a failure indicator
+            success = false;
+        }
+
+        return success;
+	}
+    
+    protected Page retrievePage( RequestContext requestContext, String pageName )
+        throws Exception
+    {        
+        if ( pageName == null )
+        {
+            pageName = "/";
+        }
+        Page page = pageManager.getPage( pageName );
+        return page;
+    }        
+    
+    
+    protected void retrieveFragmentSpecialProperties( RequestContext requestContext, Fragment frag, Map fragSizes, Map portletIcons )
+    {
+        if ( frag == null )
+        {
+            return;
+        }
+        
+    	if ( "layout".equals( frag.getType() ) )
+    	{   // get layout fragment sizes
+    		if ( fragSizes != null )
+    			PortletPlacementContextImpl.getColumnCountAndSizes( frag, registry, fragSizes );
+    		
+    		List childFragments = frag.getFragments();
+    		if ( childFragments != null )
+    		{
+    			Iterator childFragIter = childFragments.iterator();
+    			while ( childFragIter.hasNext() )
+    			{
+    				Fragment childFrag = (Fragment)childFragIter.next();
+                    retrieveFragmentSpecialProperties( requestContext, childFrag, fragSizes, portletIcons );
+    			}
+    		}
+    	}
+        else if ( portletIcons != null && "portlet".equals( frag.getType() ) )
+        {   // get portlet icon and locale specific portlet display name
+            String portletName = frag.getName();
+            if ( portletName != null && portletName.length() > 0 )
+            {
+                PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( portletName );
+                
+                if ( portletDef != null && portletIcons != null )
+                {
+                    InitParam iconParam = portletDef.getInitParam("portlet-icon");
+                    String iconParamVal = ( iconParam == null ) ? null : iconParam.getParamValue();
+                    if ( iconParamVal != null && iconParamVal.length() > 0 )
+                    {
+                        portletIcons.put( frag.getId(), iconParamVal );
+                    }
+                }
+                else if ( portletDef == null )
+                {
+                    log.error( "GetPageAction could not obtain PortletDefinition for portlet " + portletName );
+                }
+            }
+        }
+    }
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPageAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPagesAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPagesAction.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPagesAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPagesAction.java Fri Dec 12 04:06:29 2008
@@ -1,130 +1,130 @@
-/*
+/*
  * 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.layout.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-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.Page;
-import org.apache.jetspeed.page.PageManager;
-import org.apache.jetspeed.request.RequestContext;
-
-/**
- * Get Pages retrieves all pages for the given folder
- *
- * AJAX Parameters: 
- *    folder = the path of folder containing the pages 
- *    
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
- */
-public class GetPagesAction 
-    extends BasePortletAction 
-    implements AjaxAction, AjaxBuilder, Constants, Comparator
-{
-    protected static final Log log = LogFactory.getLog(GetPortletsAction.class);
-    
-    public GetPagesAction(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, "getpages");
-            if (false == checkAccess(requestContext, JetspeedActions.VIEW))
-            {
-//                if (!createNewPageOnEdit(requestContext))                
-//                {
-                    success = false;
-                    resultMap.put(REASON, "Insufficient access to get portlets");
-                    return success;
-//                }
-//                status = "refresh";
-            }                                    
-            List pages = retrievePages(requestContext);            
-            resultMap.put(STATUS, status);
-            resultMap.put(PAGES, pages);
-        } 
-        catch (Exception e)
-        {
-            // Log the exception
-            log.error("exception while getting portlet info", e);
-
-            // Return a failure indicator
-            success = false;
-        }
-
-        return success;
-	}
-    
-    protected List retrievePages(RequestContext requestContext)
-    {        
-        List list = new ArrayList();
- 
-        String folderName = getActionParameter(requestContext, FOLDER);
-        if (folderName == null)
-        {
-            return list;
-        }
-        try
-        {
-            Folder folder = pageManager.getFolder(folderName);
-            Iterator it = folder.getPages().iterator();
-            while (it.hasNext())
-            {
-                Page page = (Page)it.next();
-                list.add(page);
-            }
-            Collections.sort(list, this);
-        }
-        catch (Exception e)
-        {            
-        }
-        return list;
-    }
-    
-    
-    public int compare(Object obj1, Object obj2)
-    {
-        Page page1 = (Page)obj1;
-        Page page2 = (Page)obj2;
-        String name1 = page1.getName();
-        String name2 = page2.getName();
-        name1 = (name1 == null) ? "unknown" : name1;
-        name2 = (name2 == null) ? "unknown" : name2;
-        return name1.compareTo(name2);
-    }
-}
+ * 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.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+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.Page;
+import org.apache.jetspeed.page.PageManager;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * Get Pages retrieves all pages for the given folder
+ *
+ * AJAX Parameters: 
+ *    folder = the path of folder containing the pages 
+ *    
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class GetPagesAction 
+    extends BasePortletAction 
+    implements AjaxAction, AjaxBuilder, Constants, Comparator
+{
+    protected static final Log log = LogFactory.getLog(GetPortletsAction.class);
+    
+    public GetPagesAction(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, "getpages");
+            if (false == checkAccess(requestContext, JetspeedActions.VIEW))
+            {
+//                if (!createNewPageOnEdit(requestContext))                
+//                {
+                    success = false;
+                    resultMap.put(REASON, "Insufficient access to get portlets");
+                    return success;
+//                }
+//                status = "refresh";
+            }                                    
+            List pages = retrievePages(requestContext);            
+            resultMap.put(STATUS, status);
+            resultMap.put(PAGES, pages);
+        } 
+        catch (Exception e)
+        {
+            // Log the exception
+            log.error("exception while getting portlet info", e);
+
+            // Return a failure indicator
+            success = false;
+        }
+
+        return success;
+	}
+    
+    protected List retrievePages(RequestContext requestContext)
+    {        
+        List list = new ArrayList();
+ 
+        String folderName = getActionParameter(requestContext, FOLDER);
+        if (folderName == null)
+        {
+            return list;
+        }
+        try
+        {
+            Folder folder = pageManager.getFolder(folderName);
+            Iterator it = folder.getPages().iterator();
+            while (it.hasNext())
+            {
+                Page page = (Page)it.next();
+                list.add(page);
+            }
+            Collections.sort(list, this);
+        }
+        catch (Exception e)
+        {            
+        }
+        return list;
+    }
+    
+    
+    public int compare(Object obj1, Object obj2)
+    {
+        Page page1 = (Page)obj1;
+        Page page2 = (Page)obj2;
+        String name1 = page1.getName();
+        String name2 = page2.getName();
+        name1 = (name1 == null) ? "unknown" : name1;
+        name2 = (name2 == null) ? "unknown" : name2;
+        return name1.compareTo(name2);
+    }
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPagesAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletActionsAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletActionsAction.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletActionsAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletActionsAction.java Fri Dec 12 04:06:29 2008
@@ -1,139 +1,139 @@
-/*
+/*
  * 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.layout.impl;
-
-import java.util.ArrayList;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.ajax.AJAXException;
-import org.apache.jetspeed.ajax.AjaxAction;
-import org.apache.jetspeed.ajax.AjaxBuilder;
-import org.apache.jetspeed.decoration.DecorationValve;
-import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
-import org.apache.jetspeed.om.page.ContentFragment;
-import org.apache.jetspeed.om.page.ContentPage;
-import org.apache.jetspeed.om.page.Fragment;
-import org.apache.jetspeed.page.PageManager;
-import org.apache.jetspeed.request.RequestContext;
-
-/**
- * Get Portlet Actions retrieves the current set of valid actions for one or more portlet windows
- *
- * AJAX Parameters: 
- *    id = the fragment id of the portlet for which to retrieve the action list
- *         multiple id parameters are supported
- *    page = (implied in the URL)
- *    
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
- */
-public class GetPortletActionsAction
-    extends BasePortletAction 
-    implements AjaxAction, AjaxBuilder, Constants
-{
-    protected static final Log log = LogFactory.getLog(GetPortletActionsAction.class);
-    protected String action;
-    private DecorationValve decorationValve;
-    
-    public GetPortletActionsAction(String template,
-                                   String errorTemplate,
-                                   String action,
-                                   DecorationValve decorationValve)            
-    throws AJAXException
-    {
-        this(template, errorTemplate, action, decorationValve, null, null);
-    }
-    
-    public GetPortletActionsAction(String template,
-                                   String errorTemplate,
-                                   String action,
-                                   DecorationValve decorationValve,
-                                   PageManager pageManager,
-                                   PortletActionSecurityBehavior securityBehavior)
-    throws AJAXException
-    {
-        super(template, errorTemplate, pageManager, securityBehavior);
-        this.action = action;
-        this.decorationValve = decorationValve;
-    }
-
-    public boolean runBatch(RequestContext requestContext, Map resultMap) throws AJAXException
-    {
-        return runAction(requestContext, resultMap, true);
-    }    
-    
-    public boolean run(RequestContext requestContext, Map resultMap)
-            throws AJAXException
-    {
-        return runAction(requestContext, resultMap, false);
-    }
-    
-    public boolean runAction( RequestContext requestContext, Map resultMap, boolean batch )
-    {
-        boolean success = true;
-        String status = "success";
-        try
-        {
-            resultMap.put( ACTION, action );
-            
-            ContentPage page = requestContext.getPage();
-            
-            // Get the necessary parameters off of the request
-            ArrayList getActionsForFragments = new ArrayList();
-            String[] portletIds = requestContext.getRequest().getParameterValues( PORTLETID );
-            if ( portletIds != null && portletIds.length > 0 ) 
-            {
-                for ( int i = 0 ; i < portletIds.length ; i++ )
-                {
-                    String portletId = portletIds[ i ];
-                    ContentFragment fragment = (ContentFragment)page.getFragmentById( portletId );
-                    if ( fragment == null )
-                    {
-                        throw new Exception("fragment not found for specified portlet id: " + portletId); 
-                    }
-                    getActionsForFragments.add( fragment );
-                }
-                getActionsForFragments.add( page.getRootContentFragment() );
-            }
-
-            // Run the Decoration valve to get actions
-            decorationValve.initFragments( requestContext, true, getActionsForFragments );
-            
-            if ( getActionsForFragments.size() > 0 )
-            {
-                Fragment rootFragment = (Fragment)getActionsForFragments.remove( getActionsForFragments.size()-1 );
-                resultMap.put( PAGE, rootFragment );
-            }
-            
-            resultMap.put( PORTLETS, getActionsForFragments );
-            
-            resultMap.put( STATUS, status );
-        } 
-        catch (Exception e)
-        {
-            // Log the exception
-            log.error( "exception while getting actions for a fragment", e );
-            resultMap.put( REASON, e.toString() );
-            // Return a failure indicator
-            success = false;
-        }
-
-        return success;
-    }
-}
+ * 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.ArrayList;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.ajax.AJAXException;
+import org.apache.jetspeed.ajax.AjaxAction;
+import org.apache.jetspeed.ajax.AjaxBuilder;
+import org.apache.jetspeed.decoration.DecorationValve;
+import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
+import org.apache.jetspeed.om.page.ContentFragment;
+import org.apache.jetspeed.om.page.ContentPage;
+import org.apache.jetspeed.om.page.Fragment;
+import org.apache.jetspeed.page.PageManager;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * Get Portlet Actions retrieves the current set of valid actions for one or more portlet windows
+ *
+ * AJAX Parameters: 
+ *    id = the fragment id of the portlet for which to retrieve the action list
+ *         multiple id parameters are supported
+ *    page = (implied in the URL)
+ *    
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class GetPortletActionsAction
+    extends BasePortletAction 
+    implements AjaxAction, AjaxBuilder, Constants
+{
+    protected static final Log log = LogFactory.getLog(GetPortletActionsAction.class);
+    protected String action;
+    private DecorationValve decorationValve;
+    
+    public GetPortletActionsAction(String template,
+                                   String errorTemplate,
+                                   String action,
+                                   DecorationValve decorationValve)            
+    throws AJAXException
+    {
+        this(template, errorTemplate, action, decorationValve, null, null);
+    }
+    
+    public GetPortletActionsAction(String template,
+                                   String errorTemplate,
+                                   String action,
+                                   DecorationValve decorationValve,
+                                   PageManager pageManager,
+                                   PortletActionSecurityBehavior securityBehavior)
+    throws AJAXException
+    {
+        super(template, errorTemplate, pageManager, securityBehavior);
+        this.action = action;
+        this.decorationValve = decorationValve;
+    }
+
+    public boolean runBatch(RequestContext requestContext, Map resultMap) throws AJAXException
+    {
+        return runAction(requestContext, resultMap, true);
+    }    
+    
+    public boolean run(RequestContext requestContext, Map resultMap)
+            throws AJAXException
+    {
+        return runAction(requestContext, resultMap, false);
+    }
+    
+    public boolean runAction( RequestContext requestContext, Map resultMap, boolean batch )
+    {
+        boolean success = true;
+        String status = "success";
+        try
+        {
+            resultMap.put( ACTION, action );
+            
+            ContentPage page = requestContext.getPage();
+            
+            // Get the necessary parameters off of the request
+            ArrayList getActionsForFragments = new ArrayList();
+            String[] portletIds = requestContext.getRequest().getParameterValues( PORTLETID );
+            if ( portletIds != null && portletIds.length > 0 ) 
+            {
+                for ( int i = 0 ; i < portletIds.length ; i++ )
+                {
+                    String portletId = portletIds[ i ];
+                    ContentFragment fragment = (ContentFragment)page.getFragmentById( portletId );
+                    if ( fragment == null )
+                    {
+                        throw new Exception("fragment not found for specified portlet id: " + portletId); 
+                    }
+                    getActionsForFragments.add( fragment );
+                }
+                getActionsForFragments.add( page.getRootContentFragment() );
+            }
+
+            // Run the Decoration valve to get actions
+            decorationValve.initFragments( requestContext, true, getActionsForFragments );
+            
+            if ( getActionsForFragments.size() > 0 )
+            {
+                Fragment rootFragment = (Fragment)getActionsForFragments.remove( getActionsForFragments.size()-1 );
+                resultMap.put( PAGE, rootFragment );
+            }
+            
+            resultMap.put( PORTLETS, getActionsForFragments );
+            
+            resultMap.put( STATUS, status );
+        } 
+        catch (Exception e)
+        {
+            // Log the exception
+            log.error( "exception while getting actions for a fragment", e );
+            resultMap.put( REASON, e.toString() );
+            // Return a failure indicator
+            success = false;
+        }
+
+        return success;
+    }
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletActionsAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java Fri Dec 12 04:06:29 2008
@@ -1,227 +1,227 @@
-/*
+/*
  * 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.layout.impl;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import 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.components.portletregistry.PortletRegistry;
-import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
-import org.apache.jetspeed.om.portlet.InitParam;
-import org.apache.jetspeed.om.portlet.PortletApplication;
-import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.jetspeed.page.PageManager;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.search.ParsedObject;
-import org.apache.jetspeed.search.SearchEngine;
-import org.apache.jetspeed.security.SecurityAccessController;
-
-/**
- * Get Portlets retrieves the portlet list available to the current subject
- *
- * AJAX Parameters: 
- *    filter = (optional)filter to lookup portlets using fulltext search
- *    
- * @author <a>David Gurney</a>
- * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
- * @version $Id: $
- */
-public class GetPortletsAction 
-    extends BasePortletAction 
-    implements AjaxAction, AjaxBuilder, Constants, Comparator
-{
-    protected static final Log log = LogFactory.getLog(GetPortletsAction.class);
-    private PortletRegistry registry = null;
-    private SearchEngine searchEngine = null;
-    private SecurityAccessController securityAccessController;
-    
-    public final static String PORTLET_ICON = "portlet-icon";
-    
-    public GetPortletsAction(String template, String errorTemplate)
-    {
-        this(template, errorTemplate, null, null, null, null, null);
-    }
-    
-    public GetPortletsAction(String template, 
-                             String errorTemplate,
-                             PageManager pageManager,
-                             PortletRegistry registry,
-                             SearchEngine searchEngine,
-                             SecurityAccessController securityAccessController,
-                             PortletActionSecurityBehavior securityBehavior)
-    {
-        super(template, errorTemplate, pageManager, securityBehavior);
-        this.registry = registry;
-        this.searchEngine = searchEngine;
-        this.securityAccessController = securityAccessController;
-    }
-
-    public boolean run(RequestContext requestContext, Map resultMap)
-    {
-        boolean success = true;
-        String status = "success";
-        try
-        {
-            resultMap.put(ACTION, "getportlets");
-            if (false == checkAccess(requestContext, JetspeedActions.VIEW))
-            {
-//                if (!createNewPageOnEdit(requestContext))
-//                {
-                    success = false;
-                    resultMap.put(REASON, "Insufficient access to edit page");
-                    return success;
-//                }
-//                status = "refresh";
-            }            
-            String filter = getActionParameter(requestContext, FILTER);                                    
-            List portlets = retrievePortlets(requestContext, filter);            
-            resultMap.put(STATUS, status);
-            resultMap.put(PORTLETS, portlets);
-        } 
-        catch (Exception e)
-        {
-            // Log the exception
-            log.error("exception while getting portlet info", e);
-
-            // Return a failure indicator
-            success = false;
-        }
-
-        return success;
-	}
-    
-    public List retrievePortlets(RequestContext requestContext, String filter)
-    {
-        Iterator portlets = null;
-        List list = new ArrayList();
-        Locale locale = requestContext.getLocale();
-        
-        if (filter == null)
-            portlets = registry.getAllPortletDefinitions().iterator();
-        else
-            portlets = searchEngine.search(filter).getResults().iterator();
-        
-        while (portlets.hasNext())
-        {
-            PortletDefinition portlet = null;
-            if (filter == null)
-                portlet = (PortletDefinition)portlets.next();
-            else
-                portlet = this.getPortletFromParsedObject((ParsedObject)portlets.next());
-            
-            if (portlet == null)
-                continue;
-            
-            // Do not display Jetspeed Layout Applications
-            PortletApplication pa = (PortletApplication)portlet.getApplication();
-            if (pa.isLayoutApplication())
-                continue;
-                 
-            // SECURITY filtering
-            String uniqueName = pa.getName() + "::" + portlet.getPortletName();
-            if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
-            {
-                InitParam param = portlet.getInitParam(PORTLET_ICON);
-                String image;
-                if (param != null)
-                {
-                    //String relativeImagePath = param.getValue();
-                    //String context = muta.getWebApplicationDefinition().getContextRoot();
-                    // Have to use a supported icon in jetspeed, otherwise image can be out of skew
-                    image = "images/portlets/" + param.getParamValue();
-                }
-                else
-                {                                        
-                    image = "images/portlets/applications-internet.png";
-                }                
-                list.add(new PortletInfo(uniqueName, portlet.getDisplayNameText(locale), portlet.getDescriptionText(locale), image));
-            }
-        }            
-        Collections.sort(list, this);
-        return list;
-    }
-    
-    protected PortletDefinition getPortletFromParsedObject(ParsedObject po)
-    {
-        boolean found = false;
-        String name = "";
-        Map fields = po.getFields();
-        if(fields != null)
-        {
-            Object id = fields.get("ID");
-    
-            if(id != null)
-            {
-                if(id instanceof Collection)
-                {
-                    Collection coll = (Collection)id;
-                    name = (String) coll.iterator().next();
-                }
-                else
-                {
-                    name = (String)id;
-                }
-            }
-            
-            if(po.getType().equals("portlet"))
-            {
-                Object pa = fields.get("portlet_application");
-                String paName = "";
-                if(pa != null)
-                {
-                    if(id instanceof Collection)
-                    {
-                        Collection coll = (Collection)pa;
-                        paName = (String) coll.iterator().next();
-                    }
-                    else
-                    {
-                        paName = (String)pa;
-                    }
-                }
-                name = paName + "::" + name;
-                found = true;
-            }
-        }
-        if (found == false)
-            return null;
-        
-        return registry.getPortletDefinitionByUniqueName(name);
-    }
-    
-    public int compare(Object obj1, Object obj2)
-    {
-        PortletInfo portlet1 = (PortletInfo)obj1;
-        PortletInfo portlet2 = (PortletInfo)obj2;
-        String name1 = portlet1.getName();
-        String name2 = portlet2.getName();
-        name1 = (name1 == null) ? "unknown" : name1;
-        name2 = (name2 == null) ? "unknown" : name2;
-        return name1.compareTo(name2);
-    }
-}
+ * 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.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import 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.components.portletregistry.PortletRegistry;
+import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
+import org.apache.jetspeed.om.portlet.InitParam;
+import org.apache.jetspeed.om.portlet.PortletApplication;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+import org.apache.jetspeed.page.PageManager;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.search.ParsedObject;
+import org.apache.jetspeed.search.SearchEngine;
+import org.apache.jetspeed.security.SecurityAccessController;
+
+/**
+ * Get Portlets retrieves the portlet list available to the current subject
+ *
+ * AJAX Parameters: 
+ *    filter = (optional)filter to lookup portlets using fulltext search
+ *    
+ * @author <a>David Gurney</a>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class GetPortletsAction 
+    extends BasePortletAction 
+    implements AjaxAction, AjaxBuilder, Constants, Comparator
+{
+    protected static final Log log = LogFactory.getLog(GetPortletsAction.class);
+    private PortletRegistry registry = null;
+    private SearchEngine searchEngine = null;
+    private SecurityAccessController securityAccessController;
+    
+    public final static String PORTLET_ICON = "portlet-icon";
+    
+    public GetPortletsAction(String template, String errorTemplate)
+    {
+        this(template, errorTemplate, null, null, null, null, null);
+    }
+    
+    public GetPortletsAction(String template, 
+                             String errorTemplate,
+                             PageManager pageManager,
+                             PortletRegistry registry,
+                             SearchEngine searchEngine,
+                             SecurityAccessController securityAccessController,
+                             PortletActionSecurityBehavior securityBehavior)
+    {
+        super(template, errorTemplate, pageManager, securityBehavior);
+        this.registry = registry;
+        this.searchEngine = searchEngine;
+        this.securityAccessController = securityAccessController;
+    }
+
+    public boolean run(RequestContext requestContext, Map resultMap)
+    {
+        boolean success = true;
+        String status = "success";
+        try
+        {
+            resultMap.put(ACTION, "getportlets");
+            if (false == checkAccess(requestContext, JetspeedActions.VIEW))
+            {
+//                if (!createNewPageOnEdit(requestContext))
+//                {
+                    success = false;
+                    resultMap.put(REASON, "Insufficient access to edit page");
+                    return success;
+//                }
+//                status = "refresh";
+            }            
+            String filter = getActionParameter(requestContext, FILTER);                                    
+            List portlets = retrievePortlets(requestContext, filter);            
+            resultMap.put(STATUS, status);
+            resultMap.put(PORTLETS, portlets);
+        } 
+        catch (Exception e)
+        {
+            // Log the exception
+            log.error("exception while getting portlet info", e);
+
+            // Return a failure indicator
+            success = false;
+        }
+
+        return success;
+	}
+    
+    public List retrievePortlets(RequestContext requestContext, String filter)
+    {
+        Iterator portlets = null;
+        List list = new ArrayList();
+        Locale locale = requestContext.getLocale();
+        
+        if (filter == null)
+            portlets = registry.getAllPortletDefinitions().iterator();
+        else
+            portlets = searchEngine.search(filter).getResults().iterator();
+        
+        while (portlets.hasNext())
+        {
+            PortletDefinition portlet = null;
+            if (filter == null)
+                portlet = (PortletDefinition)portlets.next();
+            else
+                portlet = this.getPortletFromParsedObject((ParsedObject)portlets.next());
+            
+            if (portlet == null)
+                continue;
+            
+            // Do not display Jetspeed Layout Applications
+            PortletApplication pa = (PortletApplication)portlet.getApplication();
+            if (pa.isLayoutApplication())
+                continue;
+                 
+            // SECURITY filtering
+            String uniqueName = pa.getName() + "::" + portlet.getPortletName();
+            if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
+            {
+                InitParam param = portlet.getInitParam(PORTLET_ICON);
+                String image;
+                if (param != null)
+                {
+                    //String relativeImagePath = param.getValue();
+                    //String context = muta.getWebApplicationDefinition().getContextRoot();
+                    // Have to use a supported icon in jetspeed, otherwise image can be out of skew
+                    image = "images/portlets/" + param.getParamValue();
+                }
+                else
+                {                                        
+                    image = "images/portlets/applications-internet.png";
+                }                
+                list.add(new PortletInfo(uniqueName, portlet.getDisplayNameText(locale), portlet.getDescriptionText(locale), image));
+            }
+        }            
+        Collections.sort(list, this);
+        return list;
+    }
+    
+    protected PortletDefinition getPortletFromParsedObject(ParsedObject po)
+    {
+        boolean found = false;
+        String name = "";
+        Map fields = po.getFields();
+        if(fields != null)
+        {
+            Object id = fields.get("ID");
+    
+            if(id != null)
+            {
+                if(id instanceof Collection)
+                {
+                    Collection coll = (Collection)id;
+                    name = (String) coll.iterator().next();
+                }
+                else
+                {
+                    name = (String)id;
+                }
+            }
+            
+            if(po.getType().equals("portlet"))
+            {
+                Object pa = fields.get("portlet_application");
+                String paName = "";
+                if(pa != null)
+                {
+                    if(id instanceof Collection)
+                    {
+                        Collection coll = (Collection)pa;
+                        paName = (String) coll.iterator().next();
+                    }
+                    else
+                    {
+                        paName = (String)pa;
+                    }
+                }
+                name = paName + "::" + name;
+                found = true;
+            }
+        }
+        if (found == false)
+            return null;
+        
+        return registry.getPortletDefinitionByUniqueName(name);
+    }
+    
+    public int compare(Object obj1, Object obj2)
+    {
+        PortletInfo portlet1 = (PortletInfo)obj1;
+        PortletInfo portlet2 = (PortletInfo)obj2;
+        String name1 = portlet1.getName();
+        String name2 = portlet2.getName();
+        name1 = (name1 == null) ? "unknown" : name1;
+        name2 = (name2 == null) ? "unknown" : name2;
+        return name1.compareTo(name2);
+    }
+}

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetThemesAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetThemesAction.java?rev=725977&r1=725976&r2=725977&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetThemesAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/GetThemesAction.java Fri Dec 12 04:06:29 2008
@@ -1,99 +1,99 @@
-/*
+/*
  * 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.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-page-decorators, desktop-portlet-decorators)
- *
- * 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 static final 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 = getActionParameter(requestContext, TYPE );
-            String format = getActionParameter(requestContext, 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_PAGE_DECORATIONS) )
-                resultMap.put( DESKTOP_PAGE_DECORATIONS, decorationFactory.getDesktopPageDecorations( requestContext ) );
-            if (type == null || type.equals( DESKTOP_PORTLET_DECORATIONS ) )
-                resultMap.put( DESKTOP_PORTLET_DECORATIONS, decorationFactory.getDesktopPortletDecorations( 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;
-	}
-    
-    
-}
+ * 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-page-decorators, desktop-portlet-decorators)
+ *
+ * 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 static final 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 = getActionParameter(requestContext, TYPE );
+            String format = getActionParameter(requestContext, 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_PAGE_DECORATIONS) )
+                resultMap.put( DESKTOP_PAGE_DECORATIONS, decorationFactory.getDesktopPageDecorations( requestContext ) );
+            if (type == null || type.equals( DESKTOP_PORTLET_DECORATIONS ) )
+                resultMap.put( DESKTOP_PORTLET_DECORATIONS, decorationFactory.getDesktopPortletDecorations( 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;
+	}
+    
+    
+}



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