portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r889075 [2/2] - in /portals/jetspeed-2/portal/trunk: applications/jetspeed-layouts/src/main/webapp/WEB-INF/ applications/jetspeed/src/main/webapp/ applications/jetspeed/src/main/webapp/WEB-INF/pages/ applications/jetspeed/src/main/webapp/WE...
Date Thu, 10 Dec 2009 03:39:20 GMT
Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js?rev=889075&r1=889074&r2=889075&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
(original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
Thu Dec 10 03:39:17 2009
@@ -6,13 +6,10 @@
 	//	passing in a reference to the MenuNav Node Plugin.
 
 	var menu = Y.one("#environments-menu");
-
-	menu.plug(Y.Plugin.NodeMenuNav);
-
-	//	Show the menu now that it is ready
-
-	menu.setStyle("display","inline");
-	
+	if (!Y.Lang.isNull(menu)) {
+		menu.plug(Y.Plugin.NodeMenuNav);
+		menu.setStyle("display","inline");
+	}
 	//new Y.Console().render(); 
     //Make this an Event Target so we can bubble to it
     var Portal = function() {
@@ -73,12 +70,14 @@
         "id" : { value: "0" },
         "nested" : { value : false },
         "column" : { value : 0 },
+        "locked" : { value : false },
         "row" : { value : 0 }
     };
 	Layout.prototype.info = function() {
 		Y.log("name: " + this.get("name"));
 		Y.log("id  : " + this.get("id"));		
 		Y.log("nested  : " + this.get("nested"));		
+		Y.log("locked  : " + this.get("locked"));		
 		Y.log("col, row  : " + this.get("column") + "," + this.get("row"));		
 		Y.log("---------");
     };
@@ -106,26 +105,32 @@
     var lhsToggler = Y.one('#jstbLeftToggle');
     var rhsToggler = Y.one('#jstbRightToggle');    
     // add fx plugin to docking area
-    portal.jstbLeft = Y.one('#jstbLeft').plug(Y.Plugin.NodeFX, {
-        from: { width: 1 },
-        to: {
-            width: function(node) { // dynamic in case of change
-                return 200; //node.get('scrollWidth'); // get expanded height (offsetHeight
may be zero)
-            }
-        },
-        easing: Y.Easing.easeOut,
-        duration: 0.3
-    });    
-    portal.jstbRight = Y.one('#jstbRight').plug(Y.Plugin.NodeFX, {
-        from: { width: 1 },
-        to: {
-            width: function(node) { // dynamic in case of change
-                return 200; //node.get('scrollWidth'); // get expanded height (offsetHeight
may be zero)
-            }
-        },
-        easing: Y.Easing.easeOut,
-        duration: 0.3
-    });        
+    portal.jstbLeft = Y.one('#jstbLeft');
+	if (!Y.Lang.isNull(portal.jstbLeft)) {
+       portal.jstbLeft.plug(Y.Plugin.NodeFX, {
+	        from: { width: 1 },
+	        to: {
+	            width: function(node) { // dynamic in case of change
+	                return 200; //node.get('scrollWidth'); // get expanded height (offsetHeight
may be zero)
+	            }
+	        },
+	        easing: Y.Easing.easeOut,
+	        duration: 0.3
+	       });
+	}
+    portal.jstbRight = Y.one('#jstbRight')
+	if (!Y.Lang.isNull(portal.jstbRight)) {
+	    portal.jstbRight.plug(Y.Plugin.NodeFX, {
+	        from: { width: 1 },
+	        to: {
+	            width: function(node) { // dynamic in case of change
+	                return 200; //node.get('scrollWidth'); // get expanded height (offsetHeight
may be zero)
+	            }
+	        },
+	        easing: Y.Easing.easeOut,
+	        duration: 0.3
+	    });        
+	}
     var onClickToolbar = function(e) {
 //    	nav.setStyle('z-index', '500');
     }
@@ -143,53 +148,65 @@
     	}
     	portal.toggleToolbar(toolbar, toggler, compareStyle);    	    	
     };
-    lhsToggler.on('click', onClickToggler);
-    rhsToggler.on('click', onClickToggler);
-
+    if (!Y.Lang.isNull(lhsToggler)) {
+    	lhsToggler.on('click', onClickToggler);
+    }
+    if (!Y.Lang.isNull(rhsToggler)) {
+    	rhsToggler.on('click', onClickToggler);
+    }
     ////////////////////////////////////////////////////       
     // drag and drop
     var nav = Y.one('#jsNavigator');
-    nav.data = navigator;
-    var ddNav = new Y.DD.Drag({
-        node: nav,
-        groups: ['toolbars'],
-        dragMode: 'point'                
-    }).plug(Y.Plugin.DDProxy, { 
-      	 moveOnEnd: false         	    	
-    });    
-    ddNav.addHandle('.PTitle');
-    nav.on('click', onClickToolbar);
-
+    if (!Y.Lang.isNull(nav)) {
+	    nav.data = navigator;
+	    var ddNav = new Y.DD.Drag({
+	        node: nav,
+	        groups: ['toolbars'],
+	        dragMode: 'point'                
+	    }).plug(Y.Plugin.DDProxy, { 
+	      	 moveOnEnd: false         	    	
+	    });    
+	    ddNav.addHandle('.PTitle');
+	    nav.on('click', onClickToolbar);
+    }    
     var jetspeedZone = Y.one('#jetspeedZone');
-    var jzDrop = new Y.DD.Drop({
-        node: jetspeedZone,
-        groups: ['toolbars']        
-    });
-    
+    if (!Y.Lang.isNull(jetspeedZone)) {   
+	    var jzDrop = new Y.DD.Drop({
+	        node: jetspeedZone,
+	        groups: ['toolbars']        
+	    });
+    }    
     var tb = Y.one('#jsToolbox');
-    tb.data = toolbox;
-    var ddToolbox = new Y.DD.Drag({
-        node: tb,
-        groups: ['toolbars'],                 
-        dragMode: 'point'        
-    }).plug(Y.Plugin.DDProxy, { 
-      	 moveOnEnd: false         	    	
-    });    
-    ddToolbox.addHandle('.PTitle');
-    tb.on('click', onClickToolbar);
-    
-    var drop = new Y.DD.Drop({
-        node: Y.one('#jstbLeft'),
-        groups: ['toolbars']
-    });
-    var drop = new Y.DD.Drop({
-        node: Y.one('#jstbRight'),
-        groups: ['toolbars']        
-    });
-    
-    var draggablePortlets = Y.Node.all('.portal-layout-cell');    
+    if (!Y.Lang.isNull(tb)) {    
+	    tb.data = toolbox;
+	    var ddToolbox = new Y.DD.Drag({
+	        node: tb,
+	        groups: ['toolbars'],                 
+	        dragMode: 'point'        
+	    }).plug(Y.Plugin.DDProxy, { 
+	      	 moveOnEnd: false         	    	
+	    });    
+	    ddToolbox.addHandle('.PTitle');
+	    tb.on('click', onClickToolbar);
+    }
+    var jstbLeft = Y.one('#jstbLeft');
+    if (!Y.Lang.isNull(jstbLeft)) {    
+	    var drop = new Y.DD.Drop({
+	        node: jstbLeft,
+	        groups: ['toolbars']
+	    });
+    }
+    var jstbRight = Y.one('#jstbRight');
+    if (!Y.Lang.isNull(jstbRight)) {    
+	    var drop = new Y.DD.Drop({
+	        node: jstbRight,
+	        groups: ['toolbars']        
+	    });
+    }
+	var draggablePortlets = Y.Node.all('.portal-layout-cell');    
     draggablePortlets.each(function(v, k) {
         var portlet = new Portlet();
+    	Y.log("portlet = " + v.getAttribute("name") + v.getAttribute("id"));
         portlet.set("name", v.getAttribute("name"));
         portlet.set("id", v.getAttribute("id"));
         portlet.set("toolbar", false);
@@ -214,14 +231,18 @@
     
     var dropLayouts = Y.Node.all('.portal-layout-column');
     dropLayouts.each(function(v, k) {
+    	Y.log("layout = " + v.getAttribute("name") + v.getAttribute("id"));
         var layout = new Layout();
         layout.set("name", v.getAttribute("name"));
         layout.set("id", v.getAttribute("id"));
         layout.set("nested", false);
+        var locked = v.getAttribute("locked");
+        locked = (locked == null || locked == "false") ? false : true;        	
+        layout.set("locked", locked);
         layout.set("column", v.getAttribute("column"));        
         layout.set("row", 0);
         v.data = layout;
-        //layout.info();
+        layout.info();
         if (v.get('children').size() == 0)
         {
 	    	var drop = new Y.DD.Drop({
@@ -257,7 +278,7 @@
     
     var onClickRemove = function(e) {
     	var uri = document.location.href;
-    	uri = uri.replace("/ui", "/ajaxapi");
+    	uri = uri.replace("/portal", "/ajaxapi");
     	var windowId =  e.currentTarget.getAttribute('id');
     	windowId = windowId.replace("jetspeed-close-", "");
     	var uri = uri + "?action=remove&id=" + windowId;
@@ -442,7 +463,7 @@
     var persistMove = function(drag) {
         if (drag.data.get("toolbar") == false) {
         	var uri = document.location.href;
-        	uri = uri.replace("/ui", "/ajaxapi");
+        	uri = uri.replace("/portal", "/ajaxapi");
         	var windowId =  drag.getAttribute('id');
         	var oldColumn = drag.data.get('column');
         	var oldRow = drag.data.get('row');        	
@@ -463,13 +484,16 @@
 	var reallocateColumn = function(column) {
 	    var columns = Y.Node.all('.portal-layout-column');
 	    columns.each(function(v, k) {
-	    	if (v.data.get('column') == column)
+	    	if (v.data.get('locked') == false)
 	    	{
-	    		var row = 0;
-    			v.get('children').each(function(v,k) {
-	    			v.data.set('row', row);
-	    			row++;
-	    		}, row);
+		    	if (v.data.get('column') == column)
+		    	{
+		    		var row = 0;
+	    			v.get('children').each(function(v,k) {
+		    			v.data.set('row', row);
+		    			row++;
+		    		}, row);
+		    	}
 	    	}
 	    });
 	};    
@@ -576,41 +600,4 @@
     	
     });
     
-//    Y.DD.DDM.on('drag:drag', function(e) {
-//        var x = e.target.mouseXY[0];
-//    	var y = e.target.mouseXY[1];
-//        if (y < lastY) {
-//            goingUp = true;
-//        } else {
-//            goingUp = false;
-//        }
-//        if (x < lastX) {
-//            goingRight = false;
-//        } else {
-//            goingRight = true;
-//        }        
-//        lastX = x;
-//        Y.log("DRAG: x = " + x + " y " + y );
-//    });
-    
-//    Y.DD.DDM.on('drop:enter', function(e) {
-//    
-//    	//var region = e.drop.region;
-//    	var region = e.drop.get('node').get('region');     	
-//    	Y.log("region = " + region.top + "," + region.bottom + " : " + region.left + "," 
+region.right);
-    
-//        if (!e.drag || !e.drop || (e.drop !== e.target)) {
-//            return false;
-//        }
-        //var id = e.drop.get('node').data.get('id');
-        //Y.log("entering: " + p);
-        
-//        if (e.drop.get('node').get('tagName').toLowerCase() === 'li') {
-//            if (e.drop.get('node').hasClass('item')) {
-//                _moveMod(e.drag, e.drop);
-//            }
-//        }
-//    });    
-    
-    
 });
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-layout-portlets/src/main/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-layout-portlets/src/main/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java?rev=889075&r1=889074&r2=889075&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-layout-portlets/src/main/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-layout-portlets/src/main/java/org/apache/jetspeed/portlets/layout/LayoutPortlet.java
Thu Dec 10 03:39:17 2009
@@ -37,6 +37,7 @@
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.administration.PortalConfiguration;
+import org.apache.jetspeed.administration.PortalConfigurationConstants;
 import org.apache.jetspeed.capabilities.CapabilityMap;
 import org.apache.jetspeed.layout.JetspeedPowerTool;
 import org.apache.jetspeed.locator.LocatorDescriptor;
@@ -80,7 +81,10 @@
     protected TemplateLocator templateLocator;
     protected TemplateLocator decorationLocator;
     protected boolean storeViewPageInSession;
-    
+    protected boolean supportsAjax = false;
+    protected String ajaxViewLayout;
+    protected String ajaxMaxLayout;
+    protected String ajaxSoloLayout;
     private Map layoutTemplatesCache = new HashMap();
     public static final String DEFAULT_TEMPLATE_EXT = ".vm";
     public static final String TEMPLATE_EXTENSION_KEY = "template.extension";
@@ -103,6 +107,12 @@
             throw new PortletException("Failed to find the Portal Configuration on portlet
initialization");
         }        
         storeViewPageInSession = portalConfiguration.getBoolean("layout.page.storeViewPageInSession",
true);
+        // jetui configuration        
+        String jetuiMode = portalConfiguration.getString(PortalConfigurationConstants.JETUI_CUSTOMIZATION_METHOD,
PortalConfigurationConstants.JETUI_CUSTOMIZATION_SERVER);
+        this.supportsAjax = (jetuiMode.equals(PortalConfigurationConstants.JETUI_CUSTOMIZATION_AJAX));
+        this.ajaxViewLayout = portalConfiguration.getString(PortalConfigurationConstants.JETUI_LAYOUT_VIEW,
"jetui");
+        this.ajaxMaxLayout = portalConfiguration.getString(PortalConfigurationConstants.JETUI_LAYOUT_MAX,
"maximized");
+        this.ajaxSoloLayout = portalConfiguration.getString(PortalConfigurationConstants.JETUI_LAYOUT_SOLO,
"solo");
         
         templateLocator = (TemplateLocator) getPortletContext().getAttribute("TemplateLocator");
         decorationLocator = (TemplateLocator) getPortletContext().getAttribute("DecorationLocator");
@@ -205,14 +215,9 @@
                 viewPage = getCachedLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_MAX);
                      
                 if (viewPage == null)
                 {
-                    PortletPreferences prefs = request.getPreferences();
-                    viewPage = prefs.getValue(PARAM_MAX_PAGE, null);
+                    viewPage = (this.supportsAjax) ? this.ajaxMaxLayout : this.getInitParameter(PARAM_MAX_PAGE);
                     if (viewPage == null)
-                    {
-                        viewPage = this.getInitParameter(PARAM_MAX_PAGE);
-                        if (viewPage == null)
-                            viewPage = "maximized";
-                    }
+                        viewPage = "maximized";
                     cacheLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_MAX,
viewPage);
                 }
             }
@@ -221,15 +226,10 @@
                 viewPage = getCachedLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_SOLO);
                      
                 if (viewPage == null)
                 {
-                    PortletPreferences prefs = request.getPreferences();                
-                    viewPage = prefs.getValue(PARAM_SOLO_PAGE, null);
+                    viewPage = (this.supportsAjax) ? this.ajaxSoloLayout : this.getInitParameter(PARAM_SOLO_PAGE);
                     if (viewPage == null)
                     {
-                        viewPage = this.getInitParameter(PARAM_SOLO_PAGE);
-                        if (viewPage == null)
-                        {
-                            viewPage = "solo";
-                        }
+                        viewPage = "solo";
                     }
                     cacheLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_SOLO,
viewPage);                    
                 }
@@ -239,14 +239,9 @@
                 viewPage = getCachedLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_VIEW);
                      
                 if (viewPage == null)
                 {
-                    PortletPreferences prefs = request.getPreferences();                
               
-                    viewPage = prefs.getValue(PARAM_VIEW_PAGE, null);
+                    viewPage = (this.supportsAjax) ? this.ajaxViewLayout : this.getInitParameter(PARAM_VIEW_PAGE);
                     if (viewPage == null)
-                    {
-                        viewPage = this.getInitParameter(PARAM_VIEW_PAGE);
-                        if (viewPage == null)
-                            viewPage = "columns";
-                    }
+                        viewPage = "columns";
                     cacheLayoutViewPage(request, PortalReservedParameters.PAGE_LAYOUT_VIEW,
viewPage);                    
                 }
             }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/PageTheme.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/PageTheme.java?rev=889075&r1=889074&r2=889075&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/PageTheme.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/PageTheme.java
Thu Dec 10 03:39:17 2009
@@ -76,8 +76,10 @@
         {
             portletDecorationNames.put(this.layoutDecoration.getName(), this.layoutDecoration.getName());
             Decoration decoration = decorationFactory.getPortletDecoration(this.layoutDecoration.getName(),
requestContext);
-            this.styleSheets.add(decoration.getStyleSheet());
-            this.styleSheets.add(decoration.getStyleSheetPortal());            
+            if (decoration.getStyleSheet() != null)
+                this.styleSheets.add(decoration.getStyleSheet());
+            if (decoration.getStyleSheetPortal() != null)
+                this.styleSheets.add(decoration.getStyleSheetPortal());            
         }
         this.portletDecorationNames = Collections.unmodifiableCollection( new ArrayList(
portletDecorationNames.keySet() ) );
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java?rev=889075&r1=889074&r2=889075&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedPowerToolImpl.java
Thu Dec 10 03:39:17 2009
@@ -23,6 +23,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
+import java.util.Map;
 import java.util.Set;
 
 import javax.portlet.PortletConfig;
@@ -37,6 +38,7 @@
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.administration.PortalConfigurationConstants;
 import org.apache.jetspeed.aggregator.PortletRenderer;
 import org.apache.jetspeed.capabilities.CapabilityMap;
 import org.apache.jetspeed.container.PortletWindow;
@@ -50,6 +52,7 @@
 import org.apache.jetspeed.portlet.HeadElement;
 import org.apache.jetspeed.portlet.HeaderPhaseSupportConstants;
 import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.security.UserSubjectPrincipal;
 import org.apache.jetspeed.util.ArgUtil;
 import org.apache.jetspeed.util.HeadElementUtils;
 import org.apache.jetspeed.util.KeyValue;
@@ -102,7 +105,7 @@
     protected PortletConfig portletConfig;
 
     protected Writer templateWriter;
-
+    
     protected static final Logger log = LoggerFactory.getLogger(JetspeedPowerToolImpl.class);
 
     protected CapabilityMap capabilityMap;
@@ -124,6 +127,7 @@
     private BasePortalURL baseUrlAccess;
     
     private PortletRenderer renderer;
+    protected boolean ajaxCustomization = false;
     
     public JetspeedPowerToolImpl(RequestContext requestContext, PortletConfig portletConfig,
RenderRequest renderRequest, RenderResponse renderResponse, PortletRenderer renderer) throws
Exception
     {
@@ -144,6 +148,9 @@
 
         templateLocator = (TemplateLocator) getComponent("TemplateLocator");
         decorationLocator = (TemplateLocator) getComponent("DecorationLocator");
+        String jetuiMode = Jetspeed.getConfiguration().getString(PortalConfigurationConstants.JETUI_CUSTOMIZATION_METHOD,
PortalConfigurationConstants.JETUI_CUSTOMIZATION_SERVER);
+        this.ajaxCustomization = (jetuiMode.equals(PortalConfigurationConstants.JETUI_CUSTOMIZATION_AJAX));
+        
         // By using null, we create a re-useable locator
         capabilityMap = requestContext.getCapabilityMap();
         locale = requestContext.getLocale();
@@ -873,4 +880,26 @@
         return false;
     }
     
+    public boolean isAjaxCustomizationEnabled()
+    {
+        return this.ajaxCustomization;
+    }
+
+    public Map getUserAttributes()
+    {
+        RequestContext rc = getRequestContext();
+        Map map = null;
+        Principal principal = rc.getRequest().getUserPrincipal();
+        if (principal instanceof UserSubjectPrincipal)
+        {
+            UserSubjectPrincipal jp = (UserSubjectPrincipal)principal;
+            map = jp.getUser().getInfoMap();
+            if (map.get("user.name.given") == null)
+                map.put("user.name.given", "");
+            if (map.get("user.name.family") == null)
+                map.put("user.name.family", jp.getName());            
+        }
+        return map;
+    }
+    
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java?rev=889075&r1=889074&r2=889075&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java
Thu Dec 10 03:39:17 2009
@@ -73,4 +73,11 @@
     static final String ROLES_DEFAULT_USER = "default.user.role";
     static final String ROLES_DEFAULT_GUEST = "default.guest.role";
     
+    /** Jetui */
+    static final String JETUI_CUSTOMIZATION_METHOD = "jetui.customization.method";
+    static final String JETUI_CUSTOMIZATION_SERVER = "server";
+    static final String JETUI_CUSTOMIZATION_AJAX = "ajax";
+    static final String JETUI_LAYOUT_VIEW = "jetui.layout.view";
+    static final String JETUI_LAYOUT_MAX = "jetui.layout.max";
+    static final String JETUI_LAYOUT_SOLO = "jetui.layout.solo";    
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/JetspeedPowerTool.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/JetspeedPowerTool.java?rev=889075&r1=889074&r2=889075&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/JetspeedPowerTool.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/JetspeedPowerTool.java
Thu Dec 10 03:39:17 2009
@@ -18,6 +18,7 @@
 
 import java.io.IOException;
 import java.util.List;
+import java.util.Map;
 
 import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
@@ -29,6 +30,7 @@
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.portlet.HeadElement;
+import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.util.KeyValue;
 
 /**
@@ -270,4 +272,11 @@
      */
     boolean isDojoEnabled(List<KeyValue<String, HeadElement>> headElements);
     
+    /**
+     * Determine if ajax customization is enabled
+     * @return true when ajax customization enabled
+     */
+    boolean isAjaxCustomizationEnabled();
+    
+    public Map getUserAttributes();    
 }
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?rev=889075&r1=889074&r2=889075&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
Thu Dec 10 03:39:17 2009
@@ -96,6 +96,8 @@
     /** All of the LayoutEventListeners registered to this layout */
     private final List<LayoutEventListener> eventListeners;
 
+    private final List<ContentFragment> detachedPortlets;
+    
     /**
      * 
      * @param numberOfColumns
@@ -119,7 +121,8 @@
 
         columns = new TreeMap<Integer, SortedMap<Integer, ContentFragment>>();
         coordinates = new HashMap<ContentFragment, LayoutCoordinate>();
-
+        detachedPortlets = new ArrayList<ContentFragment>();
+        
         for (int i = 0; i < numberOfColumns; i++)
         {
             columns.put(new Integer(i), new TreeMap<Integer, ContentFragment>());
@@ -163,6 +166,20 @@
             while (fragmentsItr.hasNext())
             {
                 ContentFragment fragment = (ContentFragment) fragmentsItr.next();
+                String jsdesktop = fragment.getProperty(NameValueProperty.NAME_VALUE_PROPERTY);
+                if (jsdesktop != null)
+                {
+                    NameValueProperty nvp = new NameValueProperty(jsdesktop);
+                    if (nvp.isDetached())
+                    {
+                        detachedPortlets.add(fragment);
+                        continue;
+                    }
+                    else if (nvp.isDecoratorRendered())
+                    {
+                        continue;
+                    }
+                }
                 doAdd(getColumn(fragment), getRow(getColumn(fragment), fragment), fragment);
             }
         }
@@ -814,4 +831,9 @@
         
     }
 
+    public List<ContentFragment> getDetachedPortlets()
+    {
+        return this.detachedPortlets;
+    }
+
 }

Added: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/NameValueProperty.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/NameValueProperty.java?rev=889075&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/NameValueProperty.java
(added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/NameValueProperty.java
Thu Dec 10 03:39:17 2009
@@ -0,0 +1,73 @@
+/*
+ * 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.portlets.layout;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class NameValueProperty
+{
+    public static final String NAME_VALUE_PROPERTY = "jsdesktop";
+    public static final String DETACHED = "detached";
+    public static final String DECORATOR_RENDERED = "decRendered";
+    
+    private String property;
+    private Map<String,String> nvp = null;
+    
+    public NameValueProperty(String property)
+    {        
+        this.property = property;
+        if (this.property != null)
+        {
+            String[] pairs = property.split("\\,");
+            for (String pair : pairs)
+            {
+                if (pair.indexOf('=') > -1)
+                {
+                    if (nvp == null)
+                    {
+                        nvp = new HashMap<String,String>();
+                    }
+                    String[]nameValue = pair.split("\\=");
+                    nvp.put(nameValue[0], nameValue[1]);
+                }                
+            }
+        }
+    }
+    
+    public boolean isDetached()
+    {
+        return getValue(DETACHED);
+    }
+    
+    public boolean isDecoratorRendered()
+    {
+        return getValue(DECORATOR_RENDERED);
+    }
+    
+    protected boolean getValue(String name)
+    {
+        if (nvp == null)
+            return false;
+        String result = nvp.get(name);
+        if (result == null || result.equalsIgnoreCase("false"))
+            return false;
+        return true;        
+    }
+    
+}
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/NameValueProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/NameValueProperty.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml?rev=889075&r1=889074&r2=889075&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml
Thu Dec 10 03:39:17 2009
@@ -915,7 +915,7 @@
     <constructor-arg><ref bean="org.apache.jetspeed.aggregator.PortletRenderer"/></constructor-arg>
     <constructor-arg><ref bean="org.apache.jetspeed.headerresource.HeaderResourceFactory"/></constructor-arg>
     <constructor-arg><ref bean="org.apache.jetspeed.layout.PageLayoutComponent"
/></constructor-arg>
-    <constructor-arg><value>/WEB-INF/jetui/yui/jetui.jsp</value></constructor-arg>
       
+    <constructor-arg><value>${jetui.render.template}</value></constructor-arg>
       
   </bean>
   
   <bean id="jetuiAggregator" class="org.apache.jetspeed.ui.JetuiAggregatorImpl">

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties?rev=889075&r1=889074&r2=889075&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties
Thu Dec 10 03:39:17 2009
@@ -367,7 +367,17 @@
 #-------------------------------------------------------------------------
 # J E T U I
 #-------------------------------------------------------------------------
+# customization method, only applicable when jetui.render.engine = server
+# values ( ajax | server ) 
+jetui.customization.method = ajax
 # client | server
 jetui.render.engine = server
 # xml | json
 jetui.ajax.transport = json
+# jsp render template
+jetui.render.template = /WEB-INF/jetui/yui/jetui.jsp
+# render layout view
+jetui.layout.view = jetui
+jetui.layout.max = maximized
+jetui.layout.solo = solo
+



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