portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r481211 - in /portals/jetspeed-2/trunk: components/portal/src/java/org/apache/jetspeed/aggregator/impl/ components/portal/src/java/org/apache/jetspeed/layout/impl/ jetspeed-api/src/java/org/apache/jetspeed/headerresource/
Date Fri, 01 Dec 2006 10:02:21 GMT
Author: smilek
Date: Fri Dec  1 02:02:19 2006
New Revision: 481211

URL: http://svn.apache.org/viewvc?view=rev&rev=481211
Log:
added support for including value of portlet-icon init-param in ajaxapi psml response for
use by desktop

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
    portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/headerresource/HeaderResource.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java?view=diff&rev=481211&r1=481210&r2=481211
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/aggregator/impl/HeaderAggregatorImpl.java
Fri Dec  1 02:02:19 2006
@@ -674,6 +674,26 @@
             desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME
).append( ".windowActionButtonMax = " ).append( windowActionButtonMax ).append( ";" ).append(
EOL );
         }
         
+        String windowIconEnabledName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_ICON_ENABLED;
+        String iconEnabledContent = makeJSONBoolean( desktopConfigMap.get( windowIconEnabledName
) );
+        if ( iconEnabledContent != null && iconEnabledContent.length() > 0 )
+        {
+            if ( canAddHeaderNamedResourceFragment( windowIconEnabledName, namedResourcesAddedFragmentsDefault,
null ) )
+            {
+                desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME
).append( ".windowIconEnabled = " ).append( iconEnabledContent ).append( ";" ).append( EOL
);
+            }
+        }
+        
+        String windowIconPathName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_ICON_PATH;
+        String iconPathContent = (String)desktopConfigMap.get( windowIconPathName );
+        if ( iconPathContent != null && iconPathContent.length() > 0 )
+        {
+            if ( canAddHeaderNamedResourceFragment( windowIconPathName, namedResourcesAddedFragmentsDefault,
null ) )
+            {
+                desktopDojoConfigContent.append( "    " ).append( HeaderResource.HEADER_INTERNAL_DOJO_CONFIG_JETSPEED_VAR_NAME
).append( ".windowIconPath = \"" ).append( iconPathContent ).append( "\";" ).append( EOL );
+            }
+        }
+        
         String windowThemeName = HeaderResource.HEADER_CONFIG_DESKTOP_WINDOW_THEME;
         String windowTheme = (String)desktopConfigMap.get( windowThemeName );
         if ( windowTheme != null && windowTheme.length() > 0 && canAddHeaderNamedResourceFragment(
windowThemeName, namedResourcesAddedFragmentsDefault, null ) )

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java?view=diff&rev=481211&r1=481210&r2=481211
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/GetPageAction.java
Fri Dec  1 02:02:19 2006
@@ -35,6 +35,7 @@
 import org.apache.pluto.om.common.Parameter;
 import org.apache.pluto.om.common.ParameterSet;
 import org.apache.pluto.om.portlet.PortletDefinition;
+import org.apache.pluto.om.common.DisplayName;
 
 /**
  * Get Page retrieves a page from the Page Manager store and PSML format
@@ -110,8 +111,10 @@
                 }
             }
             Map fragSizes = new HashMap();
-            retrieveLayoutFragmentSizes( page.getRootFragment(), fragSizes );
+            Map portletIcons = new HashMap();
+            retrieveFragmentSpecialProperties( requestContext, page.getRootFragment(), fragSizes,
portletIcons );
             resultMap.put( SIZES, fragSizes );
+            resultMap.put( "portletIcons", portletIcons );
         } 
         catch (Exception e)
         {
@@ -137,10 +140,14 @@
     }        
     
     
-    protected void retrieveLayoutFragmentSizes( Fragment frag, Map fragSizes )
+    protected void retrieveFragmentSpecialProperties( RequestContext requestContext, Fragment
frag, Map fragSizes, Map portletIcons )
     {
-    	if ( frag != null && "layout".equals( frag.getType() ) )
-    	{
+        if ( frag == null )
+        {
+            return;
+        }
+    	if ( fragSizes != null && "layout".equals( frag.getType() ) )
+    	{   // get layout fragment sizes
     		String sizesVal = frag.getProperty( "sizes" );
     		if ( sizesVal == null || sizesVal.length() == 0 )
     		{
@@ -148,7 +155,8 @@
     			if ( layoutName != null && layoutName.length() > 0 )
     			{
     				// logic below is copied from org.apache.jetspeed.portlets.MultiColumnPortlet
-    				PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName(frag.getName());
+    				PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( layoutName
);
+                    
     				ParameterSet paramSet = portletDef.getInitParameterSet();
     				Parameter sizesParam = paramSet.get( "sizes" );
     				String sizesParamVal = ( sizesParam == null ) ? null : sizesParam.getValue();
@@ -195,9 +203,29 @@
     			while ( childFragIter.hasNext() )
     			{
     				Fragment childFrag = (Fragment)childFragIter.next();
-    				retrieveLayoutFragmentSizes( childFrag, fragSizes );
+                    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 ( portletIcons != null )
+                {
+                    ParameterSet paramSet = portletDef.getInitParameterSet();
+                    Parameter iconParam = paramSet.get( "portlet-icon" );
+                    String iconParamVal = ( iconParam == null ) ? null : iconParam.getValue();
+                    if ( iconParamVal != null && iconParamVal.length() > 0 )
+                    {
+                        portletIcons.put( frag.getId(), iconParamVal );
+                    }
+                }
+            }
+        }
+    }
+    
 }

Modified: portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/headerresource/HeaderResource.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/headerresource/HeaderResource.java?view=diff&rev=481211&r1=481210&r2=481211
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/headerresource/HeaderResource.java
(original)
+++ portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/headerresource/HeaderResource.java
Fri Dec  1 02:02:19 2006
@@ -98,6 +98,8 @@
     public final static String HEADER_CONFIG_DESKTOP_WINDOW_ACTION_BUTTON_HIDE = "desktop.window.action.button.hide";
     public final static String HEADER_CONFIG_DESKTOP_WINDOW_ACTION_BUTTON_TOOLTIP = "desktop.window.action.button.tooltip";
     public final static String HEADER_CONFIG_DESKTOP_WINDOW_ACTION_BUTTON_MAX = "desktop.window.action.button.maximum";
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_ICON_ENABLED = "desktop.window.icon.enabled";
+    public final static String HEADER_CONFIG_DESKTOP_WINDOW_ICON_PATH = "desktop.window.icon.path";
     public final static String HEADER_CONFIG_DESKTOP_WINDOW_THEME = "desktop.window.theme";
     public final static String HEADER_CONFIG_DESKTOP_WINDOW_THEME_ALLOWED = "desktop.window.theme.allowed";
     public final static String HEADER_CONFIG_DESKTOP_PAGE_ACTION_BUTTON_TOOLTIP = "desktop.page.action.button.tooltip";



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