portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r475515 - in /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout: ajax-xml/getportlets.vm impl/ChangePortletAction.java impl/GetPortletsAction.java
Date Thu, 16 Nov 2006 01:10:06 GMT
Author: taylor
Date: Wed Nov 15 17:10:05 2006
New Revision: 475515

URL: http://svn.apache.org/viewvc?view=rev&rev=475515
Log:
change portlet action always needs to grant access to window state changes, even if guest
user

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getportlets.vm
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getportlets.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getportlets.vm?view=diff&rev=475515&r1=475514&r2=475515
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getportlets.vm
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/ajax-xml/getportlets.vm
Wed Nov 15 17:10:05 2006
@@ -4,7 +4,7 @@
     
     <portlets>
 #foreach ($portlet in $portlets)    
-        <portlet name="$portlet.Name" displayName="$!portlet.DisplayName" description="$!portlet.Description"/>
+        <portlet name="$portlet.Name" displayName="$!portlet.DisplayName" description="$!portlet.Description"
image="$portlet.Image"/>
 #end        
     </portlets>
     

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java?view=diff&rev=475515&r1=475514&r2=475515
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
Wed Nov 15 17:10:05 2006
@@ -148,49 +148,12 @@
             {
                 throw new Exception("portlet mode " + portletMode + " is not supported");
             }
-                        
-            if (false == checkAccess(requestContext, JetspeedActions.EDIT))
-            {
-                ContentPage page = requestContext.getPage();
-                ContentFragment fragment = page.getContentFragmentById(portletId);
-                if (fragment == null)
-                {
-                    success = false;
-                    resultMap.put(REASON, "Fragment not found");
-                    return success;                    
-                }
-                int column = fragment.getLayoutColumn();
-                int row = fragment.getLayoutRow();                
-                if (!createNewPageOnEdit(requestContext))
-                {
-                    success = false;
-                    resultMap.put(REASON, "Insufficient access to edit page");
-                    return success;
-                }
-                status = "refresh";
-                // translate old portlet id to new portlet id
-                Fragment newFragment = getFragmentIdFromLocation(row, column, requestContext.getPage());
-                if (newFragment == null)
-                {
-                    success = false;
-                    resultMap.put(REASON, "Failed to find new fragment");
-                    return success;                    
-                }                
-                portletId = newFragment.getId();
-            }            
+
             ContentPage page = requestContext.getPage();            
             ContentFragment fragment = page.getContentFragmentById(portletId);
+            
             String oldState = fragment.getState();
             String oldMode = fragment.getMode();
-            if (windowState != null)
-                fragment.setState(windowState);
-            if (portletMode != null)
-                fragment.setMode(portletMode);
-            
-            if (pageManager != null && !batch)
-            {
-                pageManager.updatePage(page);
-            }
             
             // Now Change the transient navigational state
             MutableNavigationalState navState = (MutableNavigationalState)requestContext.getPortalURL().getNavigationalState();
@@ -208,6 +171,20 @@
                     navState.setMode(portletWindow, new PortletMode(portletMode));
                 }
                 navState.sync(requestContext);                                
+            }
+            
+
+            if (checkAccess(requestContext, JetspeedActions.EDIT))
+            {
+                if (windowState != null)
+                    fragment.setState(windowState);
+                if (portletMode != null)
+                    fragment.setMode(portletMode);
+                
+                if (pageManager != null && !batch)
+                {
+                    pageManager.updatePage(page);
+                }
             }
             
             //requestContext.getPortalURL().getNavigationalState().

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java?view=diff&rev=475515&r1=475514&r2=475515
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPortletsAction.java
Wed Nov 15 17:10:05 2006
@@ -151,14 +151,14 @@
                 String image;
                 if (param != null)
                 {
-                    String relativeImagePath = param.getValue();
-                    String context = muta.getWebApplicationDefinition().getContextRoot();
-                    image = context + relativeImagePath;
+                    //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.getValue();
                 }
                 else
-                {
-                    // default TODO: assign image by category
-                    image = "images/portlets/office-calendar.png";
+                {                                        
+                    image = "images/portlets/applications-internet.png";
                 }                
                 list.add(new PortletInfo(uniqueName, portlet.getDisplayNameText(locale),
portlet.getDescriptionText(locale), image));
             }



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