Author: taylor
Date: Wed Dec 30 01:46:07 2009
New Revision: 894531

URL: http://svn.apache.org/viewvc?rev=894531&view=rev
Log:
JS2-1084
persisting the state of left and right docking toolbars (open or closed) per 
user

Modified:
    
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp
    
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
    
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/pages/default-page.psml
    
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/pages/template.tpsml
    
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/jetui-portal.js
    
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css
    
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
    
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java

Modified: 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp?rev=894531&r1=894530&r2=894531&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp
 (original)
+++ 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui-portlet.jsp
 Wed Dec 30 01:46:07 2009
@@ -32,14 +32,27 @@
 <%
     String content = (String)request.getAttribute("content");
     String decorator = (String)request.getAttribute("decorator");
+    Boolean detached = (Boolean)request.getAttribute("detached");    
     ContentFragment fragment = 
(ContentFragment)request.getAttribute("fragment");
     LayoutCoordinate coordinate = 
(LayoutCoordinate)request.getAttribute("coordinate");
     String title = "";
     boolean showTitle = fragment.getDecoration().getTitleOption() == 
Decoration.TitleOption.SHOW;   
     if (showTitle && fragment.getPortletContent() != null)
         title = fragment.getPortletContent().getTitle();
+    if (detached != null)
+    {
+       String x = fragment.getProperty(ContentFragment.X_PROPERTY_NAME);
+       String y = fragment.getProperty(ContentFragment.Y_PROPERTY_NAME);
+        
 %>
-    <div class="portal-layout-cell" id="<%=fragment.getId()%>" 
name="<%=fragment.getName()%>" column="<%=coordinate.getX()%>" 
row="<%=coordinate.getY()%>">
+    <div class="portal-layout-cell" x='<%=x%>' y='<%=y%>' 
id="<%=fragment.getId()%>" name="<%=fragment.getName()%>" column="0" row="0" 
style='position: absolute; top: <%=x%>px; left: <%=y%>px;' detached='true' 
locked='<%=fragment.isLocked()%>'>
+<%
+    }
+    else
+    {
+%>
+    <div class="portal-layout-cell" id="<%=fragment.getId()%>" 
name="<%=fragment.getName()%>" column="<%=coordinate.getX()%>" 
row="<%=coordinate.getY()%>" detached='false' locked='<%=fragment.isLocked()%>'>
+<%  }  %>
         <div class="portlet <%=decorator%>">
             <div class="PTitle" >
               <div class="PTitleContent"><%=title%></div>
@@ -55,7 +68,7 @@
                                 target = "";
  %>             
                  <a href="<%=action.getAction()%>" 
title="<%=action.getName()%>" class="action portlet-action" <%=target%>><img 
src="<%=request.getContextPath()%>/<%=action.getLink()%>" 
alt="<%=action.getAlt()%>" border="0" /></a>
-<%                  } // for loop               
+<%                       } // for loop               
 // FIXME: integrate close into standard actions, use security constraints on 
close action
 if (request.getUserPrincipal() != null && 
fragment.getDecoration().getActions().size() > 0)
 {

Modified: 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp?rev=894531&r1=894530&r2=894531&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
 (original)
+++ 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
 Wed Dec 30 01:46:07 2009
@@ -28,6 +28,7 @@
 <%@ page import="org.apache.jetspeed.PortalReservedParameters" %>
 <%@ page import="org.apache.jetspeed.administration.PortalConfiguration" %>
 <%@ page 
import="org.apache.jetspeed.administration.PortalConfigurationConstants" %>
+<%@ page import="org.apache.jetspeed.decoration.Decoration" %>
 
 <%
   Jetui jetui = (Jetui)request.getAttribute("jetui");
@@ -43,6 +44,8 @@
   
   ContentFragment pageNav = jetui.getContentFragment("jsPageNavigator",  rc);
   ContentFragment toolbox = jetui.getContentFragment("jsToolbox",  rc);
+  ContentFragment jstbLeft = jetui.getContentFragment("jstbLeft",  rc);
+  ContentFragment jstbRight = jetui.getContentFragment("jstbRight",  rc);
   
   if (maximized != null)
   {
@@ -71,6 +74,22 @@
   if (portalPagePath == null || "".equals(portalPagePath)) {
       portalPagePath = "/";
   }
+  String leftState = jstbLeft.getState();
+  String leftDisplayState = "display: block";
+  String leftToggleClass = "jstbToggle1";
+  if (leftState != null && leftState.equals("closed"))
+  {
+      leftDisplayState = "display: none";
+      leftToggleClass = "jstbToggle2";
+  }
+  String rightState = jstbRight.getState();
+  String rightDisplayState = "display: block";
+  String rightToggleClass = "jstbToggle2";
+  if (rightState != null && rightState.equals("closed"))
+  {
+      rightDisplayState = "display: none";
+      rightToggleClass = "jstbToggle1";
+  }
 %>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>
 <html>
@@ -123,7 +142,7 @@
 <div class="header">
 <h1 class="logo">Jetspeed 2</h1>
 <div class="menu">
-&nbsp;<span style='position: absolute; left: 0px; top: 50px;' 
id='jstbLeftToggle' class='jstbToggle1'></span><span id='jstbRightToggle' 
class='jstbToggle2' style='position: absolute; right: 0px; top: 50px;'></span>
+&nbsp;<span style='position: absolute; left: 0px; top: 42px;' 
id='jstbLeftToggle' class='<%=leftToggleClass%>'></span><span 
id='jstbRightToggle' class='<%=rightToggleClass%>' style='position: absolute; 
right: 0px; top: 42px;'></span>
 </div>
 <%if (request.getUserPrincipal() != null) {%>
 <span class="layout-statusarea"><b><%=userInfo.get("user.name.given")%> 
<%=userInfo.get("user.name.family")%></b> | Profile | Tasks (5) | Notifications 
(2) | <a 
href="<%=request.getContextPath()%>/login/logout?org.apache.jetspeed.login.destination=<%=request.getContextPath()%>/ui">Log
 out</a></span>
@@ -135,7 +154,7 @@
 <table cellpadding="0" cellspacing="0" border="0" width="100%" id="main">
 <tr>         
 <td>
-<div id='jstbLeft' class='jsLeftToolbar'>
+<div id='jstbLeft' class='jsLeftToolbar' style='<%=leftDisplayState%>'>
 <div id='template-top2.jsPageNavigator' class='xportal-layout-cell'>
 <div id="jsNavigator2" class="portlet <%=pageDec%>">
     <div class="PTitle" >
@@ -144,7 +163,7 @@
     <div class="PContentBorder">
       <div class="PContent"><div id="nav-main"><%=navContent %></div></div>
     </div>
-<a class="addthis_button" 
href="http://www.addthis.com/bookmark.php?v=250&amp;pub=xa-4b0265f81058c137";><img
 src="http://s7.addthis.com/static/btn/sm-share-en.gif"; width="83" height="16" 
alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" 
src="http://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4b0265f81058c137";></script>
+<!--   <a class="addthis_button" 
href="http://www.addthis.com/bookmark.php?v=250&amp;pub=xa-4b0265f81058c137";><img
 src="http://s7.addthis.com/static/btn/sm-share-en.gif"; width="83" height="16" 
alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" 
src="http://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4b0265f81058c137";></script>
 -->
 </div>
 </div>
 </div>
@@ -190,6 +209,9 @@
             int subindex = 0;
             for (ContentFragment fragment : collections)
             {
+                String state = fragment.getState();
+                if (state == null || !state.equals("detach"))
+                {
                    //String content = 
jetui.renderPortletWindow(fragment.getId(), fragment.getName(), rc);
                    String content = 
jetui.getRenderedContent((ContentFragment)fragment, rc);
                    request.setAttribute("content", content);                   
 
@@ -203,6 +225,7 @@
 <jsp:include page="jetui-portlet.jsp"/>
 <%          
                     subindex++;
+                }
             }
             index++;
 %>
@@ -214,7 +237,7 @@
 </div>
 </td>
 <td>
-<div id='jstbRight' class='jsRightToolbar'>
+<div id='jstbRight' class='jsRightToolbar' style='<%=rightDisplayState%>'>
 <div id='jsToolbox' class='xportal-layout-cell'>
 <div id="jsToolbox2" class="portlet <%=pageDec%>">
     <div class="PTitle" >
@@ -239,11 +262,27 @@
        String x = fragment.getProperty(ContentFragment.X_PROPERTY_NAME);
        String y = fragment.getProperty(ContentFragment.Y_PROPERTY_NAME);
     String content = jetui.getRenderedContent((ContentFragment)fragment, rc);
+    Decoration.ActionsOption option = 
fragment.getDecoration().getActionsOption();  
+    if (option == Decoration.ActionsOption.HIDE) // TODO: HOVER, DROP DOWN not 
yet implemented
+    {
 %>
    <div id='<%=fragment.getId()%>' detached='true' 
locked='<%=fragment.isLocked()%>' name='<%=fragment.getName()%>' column='0' 
row='0' x='<%=x%>' y='<%=y%>' style='position: absolute; top: <%=x%>px; left: 
<%=y%>px;'>
 <%=content%>
    </div>                          
-<% } %>
+<% } else {   
+    request.setAttribute("content", content);                    
+    String decorator = fragment.getDecorator(); 
+    if (decorator == null)
+                   decorator = pageDec;
+    request.setAttribute("decorator", decorator);                    
+    request.setAttribute("fragment", fragment); 
+    request.setAttribute("detached", new Boolean(true));
+    %>
+<jsp:include page="jetui-portlet.jsp"/>
+<% 
+   }
+}
+%>
 
 <script src="<%=request.getContextPath()%>/jetui/engine/portal.js"></script>
 

Modified: 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/pages/default-page.psml
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/pages/default-page.psml?rev=894531&r1=894530&r2=894531&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/pages/default-page.psml
 (original)
+++ 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/pages/default-page.psml
 Wed Dec 30 01:46:07 2009
@@ -18,8 +18,7 @@
 <page id="default-page"
     xmlns="http://portals.apache.org/jetspeed";
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
-    xsi:schemaLocation="http://portals.apache.org/jetspeed 
http://portals.apache.org/jetspeed-2/2.1/schemas/psml.xsd";>
- 
+    xsi:schemaLocation="http://portals.apache.org/jetspeed 
http://portals.apache.org/jetspeed-2/2.1/schemas/psml.xsd";> 
   <title>Welcome to Jetspeed 2</title>
   <metadata name="title" xml:lang="fr">Bienvenue a Jetspeed</metadata>
   <metadata name="title" xml:lang="ja">Jetspeed 2 へようこそ</metadata>

Modified: 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/pages/template.tpsml
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/pages/template.tpsml?rev=894531&r1=894530&r2=894531&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/pages/template.tpsml
 (original)
+++ 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/pages/template.tpsml
 Wed Dec 30 01:46:07 2009
@@ -14,31 +14,32 @@
             <property name="state" value="detach"></property>                  
      
     </fragment>
 
-    <fragment id="jsPageNavigator" type="portlet" 
name="j2-admin::PageNavigator">
-               <property name="z" value="201.0"></property>
-            <property name="row" value="0"></property>
-            <property name="width" value="40"></property>
-            <property name="height" value="388.0"></property>
-            <property name="column" value="0"></property>
-            <property name="y" value="104.0"></property>
-            <property name="x" value="1.0"></property>            
-            <property name="state" value="normal"></property>                  
      
-    </fragment>
+   <fragment id="jstbLeft" type="layout" 
name="jetspeed-layouts::VelocityOneColumn">
+        <property name="row" value="0"></property>
+        <property name="column" value="0"></property>
+           <property name="state" value="normal"></property>                   
             
+           <fragment id="jsPageNavigator" type="portlet" 
name="j2-admin::PageNavigator">
+                       <property name="row" value="0"></property>
+                   <property name="column" value="0"></property>
+                   <property name="state" value="leftdock"></property>         
               
+           </fragment>
+       </fragment>
+    
     <page-fragment id="page-template">
       <property name="column" value="1"/>
       <property name="row" value="0"/>
     </page-fragment>
-    
-    <fragment id="jsToolbox" type="portlet" name="j2-admin::JetspeedToolbox">
-               <property name="z" value="201.0"></property>
-            <property name="row" value="0"></property>
-            <property name="width" value="40"></property>
-            <property name="height" value="388.0"></property>
-            <property name="column" value="2"></property>
-            <property name="y" value="500.0"></property>
-            <property name="x" value="1.0"></property>
-            <property name="state" value="normal"></property>                  
      
-    </fragment>
+
+   <fragment id="jstbRight" type="layout" 
name="jetspeed-layouts::VelocityOneColumn">
+        <property name="row" value="0"></property>
+        <property name="column" value="2"></property>    
+           <property name="state" value="normal"></property>                   
             
+           <fragment id="jsToolbox" type="portlet" 
name="j2-admin::JetspeedToolbox">
+                   <property name="row" value="0"></property>
+                   <property name="column" value="0"></property>
+                   <property name="state" value="rightdock"></property>        
                
+           </fragment>
+   </fragment>
     
 <!--    
     <fragment-reference id="page-template-wp-reference" refid="wp-definition">

Modified: 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/jetui-portal.js
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/jetui-portal.js?rev=894531&r1=894530&r2=894531&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/jetui-portal.js
 (original)
+++ 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/jetui-portal.js
 Wed Dec 30 01:46:07 2009
@@ -169,17 +169,32 @@
          * @method toggleToolbar
          */
         toggleToolbar : function(toolbar, toggler, compareStyle) {
+            var portal = JETUI_YUI.getPortalInstance();                
             toggler.toggleClass('jstbToggle1');
             toggler.toggleClass('jstbToggle2');
             var currentStyle = toggler.getAttribute('class');
             var nodelist = toolbar.get('children');
+            var state = 'normal';
+            var reverse = false;
             if (currentStyle == compareStyle) {
-                nodelist.setStyle('display', 'block');          
+               toolbar.setStyle('display', 'block');
+               nodelist.setStyle('display', 'block');
+               reverse = true;
             } else {
-                nodelist.setStyle('display', 'none');           
-            }
-            toolbar.fx.set('reverse', !toolbar.fx.get('reverse')); // toggle 
reverse 
-            toolbar.fx.run();
+                nodelist.setStyle('display', 'none');
+                toolbar.setStyle('display', 'none');
+                state = 'closed';
+            }
+            var windowId = (toolbar == portal.jstbLeft) ? 
'template-top2.jstbLeft' : 'template-top2.jstbRight';
+            var uri = portal.portalContextPath + 
"/services/pagelayout/fragment/" + windowId + "/mod/?_type=json";
+            uri += "&state=" + state;
+            var config = {
+                    on: { complete: portal.onStateComplete },
+                    method: "PUT",
+                    headers: { "X-Portal-Path" : portal.portalPagePath },
+                    arguments: { complete: [ windowId ] }
+                };
+            var request = Y.io(uri, config);            
         },
         
         /**
@@ -318,6 +333,13 @@
             Y.log("move result = " + data);
             var windowId = args.complete[0];
         },             
+
+        onStateComplete : function(id, o, args) { 
+            var id = id; // Transaction ID. 
+            var data = o.responseText; // Response data.
+            Y.log("move result = " + data);
+            var windowId = args.complete[0];
+        },             
         
         /**
          * @method movePortlet persist the move operation to the persistent 
store over restful put request
@@ -638,6 +660,7 @@
             Y.log("name: " + this.get("name"));
             Y.log("id  : " + this.get("id"));       
             Y.log("toolbar  : " + this.get("toolbar"));     
+            Y.log("detached  : " + this.get("detached"));     
             Y.log("col, row  : " + this.get("column") + "," + 
this.get("row"));     
             Y.log("x, y  : " + this.get("x") + "," + this.get("y"));     
             Y.log("---------");
@@ -652,7 +675,7 @@
         var portlet = new Y.JetUI.Portlet();
         portlet.set("name", node.getAttribute("name"));
         portlet.set("id", node.getAttribute("id"));
-        portlet.set("toolbar", 
Boolean(node.getAttribute("locked").toLowerCase() === 'true'));
+        portlet.set("toolbar", 
Boolean(node.getAttribute("locked").toLowerCase() === 'true' || 
node.getAttribute("detached").toLowerCase() === 'true'));
         portlet.set("detached", 
Boolean(node.getAttribute("detached").toLowerCase() === 'true'));
         portlet.set("column", node.getAttribute("column"));
         portlet.set("row", node.getAttribute("row"));

Modified: 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css?rev=894531&r1=894530&r2=894531&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css
 (original)
+++ 
portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/css/portal.css
 Wed Dec 30 01:46:07 2009
@@ -14,16 +14,15 @@
     background-color: #bebcbc;
     border: 1px dotted black;
 }
-
 .jstbToggle1 {
-    background:transparent url("layout_sprite.png") no-repeat -0px -4px;
-    height: 17px;
-    width: 5px;
+    background:transparent url("/jetspeed/jetui/css/layout_sprite.png") 
no-repeat -20px -120px;
+       height: 14px;
+    width: 18px;
 }
 .jstbToggle2 {
-    background:transparent url("layout_sprite.png") no-repeat -0px -4px;
-    height: 17px;
-    width: 5px;    
+    background:transparent url("/jetspeed/jetui/css/layout_sprite.png") 
no-repeat -20px -140px;
+       height: 14px;
+    width: 18px;    
 }
 #jsNavigator   {
        z-index: 100;

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=894531&r1=894530&r2=894531&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
 Wed Dec 30 01:46:07 2009
@@ -1,18 +1,10 @@
 //Use loader to grab the modules needed
-YUI(JETUI_YUI).use('jetui-portal', 'console', 'dd', 'anim', 'io', 
'datatype-xml', 'dataschema-xml', 'dataschema-json', 'node', 'node-menunav', 
function(Y) {
+YUI(JETUI_YUI).use('jetui-portal', 'console', 'dd', 'io', 'datatype-xml', 
'dataschema-xml', 'dataschema-json', 'node', 'node-menunav', function(Y) {
 
     var portal = JETUI_YUI.getPortalInstance();
        var config = JETUI_YUI.config;
-    Y.log("Starting up JETUI " +  config.engine + " engine...");
-        
-    if (config.engine == Y.JetUI.Portal.CSRE)
-    {
-       Y.log("Initializing " + Y.JetUI.Portal.CSRE + " ...");
-    }    
-    else
-    {
-       Y.log("Initializing " + Y.JetUI.Portal.SSRE + " ...");
-    }
+    Y.log("Starting up JETUI " +  config.engine + " engine...");        
+    //if (config.engine == Y.JetUI.Portal.CSRE)
        
     ////////////////////////////////////////////////////    
     // Create Navigator Portlet
@@ -26,44 +18,25 @@
     toolbox.set("id", "_JetspeedToolbox");
     toolbox.set("toolbar", true);
     toolbox.set("detached", false);
-
-//    var toggleMoveMode = function(e) { 
-//         window.location = window.location + "?toggle=move";
-//    }       
-//    Y.on("click", toggleMoveMode, "#jstbMoveMode");
     
     ////////////////////////////////////////////////////    
     // setup toolbar docking area and togglers    
     var lhsToggler = Y.one('#jstbLeftToggle');
     var rhsToggler = Y.one('#jstbRightToggle');    
-    // add fx plugin to docking area
     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
-              });
+          var currentStyle = portal.jstbLeft.getStyle('display');
+       var nodelist = portal.jstbLeft.get('children');
+       nodelist.setStyle('display', currentStyle);          
        }
     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 currentStyle = portal.jstbRight.getStyle('display');
+       var nodelist = portal.jstbRight.get('children');
+       nodelist.setStyle('display', currentStyle);          
        }
     var onClickToolbar = function(e) {
+//     Y.log("clickd on e.target = " + e.target);
 //     nav.setStyle('z-index', '500');
     }
 
@@ -142,7 +115,7 @@
         var dragGroups = ['portlets'];
         var dragMode = 'intersect';
         var dropGroups  = ['portlets', 'toolbars'];
-        if (portlet.get("toolbar") == true) {
+        if (portlet.get("toolbar") == true || portlet.get("detached") == true) 
{
                dragGroups = ['toolbars'],              
                dragMode = 'point';
                dropGroups = [];
@@ -159,7 +132,7 @@
             node: v,
             groups: dropGroups            
         });
-       //portlet.info();
+       // portlet.info();
     });
     
     var dropLayouts = Y.Node.all(config.layoutStyle); 

Modified: 
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java?rev=894531&r1=894530&r2=894531&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java
 (original)
+++ 
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/services/rest/PageLayoutService.java
 Wed Dec 30 01:46:07 2009
@@ -478,6 +478,33 @@
         return new ContentFragmentBean(contentFragment);
     }
 
+    @PUT
+    @Path("/fragment/{id}/mod/")
+    public ContentFragmentBean modifyContentFragment(@Context 
HttpServletRequest servletRequest,
+                                                   @Context UriInfo uriInfo,
+                                                   @PathParam("id") String 
fragmentId,
+                                                   @QueryParam("state") String 
state,
+                                                   @QueryParam("mode") String 
mode)
+    {
+        if (StringUtils.isBlank(fragmentId))
+        {
+            throw new WebApplicationException(new 
IllegalArgumentException("Fragment id not specified"));
+        }
+        
+        RequestContext requestContext = (RequestContext) 
servletRequest.getAttribute(RequestContext.REQUEST_PORTALENV);
+        ContentPage contentPage = getContentPage(requestContext, 
JetspeedActions.EDIT);
+        ContentFragment contentFragment = 
contentPage.getFragmentById(fragmentId);        
+        if (contentFragment == null)
+        {
+            throw new WebApplicationException(new 
IllegalArgumentException("Fragment not found with the specified id: " + 
fragmentId));
+        }
+        if (!StringUtils.isBlank(state) || !StringUtils.isBlank(state))
+        {
+            pageLayoutComponent.updateStateMode(contentFragment, state, mode, 
PageLayoutComponent.USER_PROPERTY_SCOPE, null);            
+        }        
+        return new ContentFragmentBean(contentFragment);
+    }
+    
     @GET
     @Path("/decoration/fragment/{id}/")
     public DecorationBean getDecorationOfContentFragment(@Context 
HttpServletRequest servletRequest,
@@ -507,7 +534,7 @@
         
         return new DecorationBean(decoration);
     }
-    
+        
     /**
      * Returns the content page of the current portal request context with 
security check.
      * 
@@ -780,5 +807,4 @@
         }        
         return set;
     }
-    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to