You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by sm...@apache.org on 2007/02/21 22:18:10 UTC

svn commit: r510225 [2/2] - in /portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed: ./ desktop/ widget/

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditPane.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditPane.js?view=diff&rev=510225&r1=510224&r2=510225
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditPane.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditPane.js Wed Feb 21 13:18:08 2007
@@ -12,6 +12,8 @@
  * 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.
+ *
+ * author: Steve Milek
  */
 
 dojo.provide("jetspeed.widget.PageEditPane");
@@ -36,6 +38,10 @@
 	dojo.widget.HtmlWidget,
 	{
         // template parameters
+        pageEditContainer: null,
+        pageEditLDContainer: null,
+        pageEditPDContainer: null,
+
         deletePageDialog: null,
 		deletePageDialogBg: null,
 		deletePageDialogFg: null,
@@ -44,12 +50,14 @@
 		createPageDialogBg: null,
 		createPageDialogFg: null,
 
-        detail: null,
-
+        layoutDecoratorSelect: null,
+        portletDecoratorSelect: null,
         
         // fields
 		isContainer: true,
         widgetsInTemplate: true,
+        layoutDecoratorDefinitions: null,
+        portletDecoratorDefinitions: null,
 
 
         // protocol - dojo.widget.Widget create
@@ -67,8 +75,6 @@
             var self = this;
             this.deletePageDialog = dojo.widget.createWidget( "dialog", { widgetsInTemplate: true, deletePageConfirmed: function() { this.hide(); self.deletePageConfirmed(); } }, this.deletePageDialog );
 			this.deletePageDialog.setCloseControl( this.deletePageDialog.deletePageCancel.domNode );
-			dojo.html.setOpacity( this.deletePageDialogBg, 0.8 );
-			dojo.html.setOpacity( this.deletePageDialogFg, 1 );
 
             var createPageParams = {};
             createPageParams.widgetsInTemplate = true;
@@ -82,12 +88,71 @@
             };
             this.createPageDialog = dojo.widget.createWidget( "dialog", createPageParams, this.createPageDialog );
 			this.createPageDialog.setCloseControl( this.createPageDialog.createPageCancel.domNode );
-			dojo.html.setOpacity( this.createPageDialogBg, 0.8 );
-			dojo.html.setOpacity( this.createPageDialogFg, 1 );
             
             jetspeed.widget.PageEditPane.superclass.fillInTemplate.call( this );
 		},
 
+        postCreate: function( args, fragment, parent )
+        {
+            jetspeed.widget.PageEditPane.superclass.postCreate.apply( this, arguments );
+
+            if ( ! dojo.render.html.ie || ( ! dojo.render.html.ie50 && ! dojo.render.html.ie55 && ! dojo.render.html.ie60 ) )
+            {   /* in IE6, if fieldset background color is set the fieldset will not be rendered nicely (with rounded borders) */
+                if ( this.pageEditContainer != null )
+                    this.pageEditContainer.style.backgroundColor = "#d3d3d3";
+                if ( this.pageEditLDContainer != null )
+                    this.pageEditLDContainer.style.backgroundColor = "#eeeeee";
+                if ( this.pageEditPDContainer != null )
+                    this.pageEditPDContainer.style.backgroundColor = "#eeeeee";
+            }
+
+            if ( this.layoutDecoratorSelect != null )
+            {    
+                var currentLayoutDecorator = jetspeed.page.layoutDecorator;
+    
+                var layoutDecoratorData = [];
+                if ( this.layoutDecoratorDefinitions )
+                {
+                    for ( var i = 0 ; i < this.layoutDecoratorDefinitions.length ; i++ )
+                    {
+                        var layoutDecoratorDef = this.layoutDecoratorDefinitions[i];
+                        if ( layoutDecoratorDef && layoutDecoratorDef.length == 2 )
+                        {
+                            layoutDecoratorData.push( [layoutDecoratorDef[0], layoutDecoratorDef[1]] );
+                            if ( currentLayoutDecorator == layoutDecoratorDef[1] )
+                            {
+                                this.layoutDecoratorSelect.setAllValues( layoutDecoratorDef[0], layoutDecoratorDef[1] );
+                            }
+    					}
+    				}
+                }
+                this.layoutDecoratorSelect.dataProvider.setData( layoutDecoratorData );
+            }
+
+            if ( this.portletDecoratorSelect != null )
+            {    
+                var currentPortletDecorator = jetspeed.page.portletDecorator;
+    
+                var portletDecoratorData = [];
+                if ( this.portletDecoratorDefinitions )
+                {
+                    for ( var i = 0 ; i < this.portletDecoratorDefinitions.length ; i++ )
+                    {
+                        var portletDecoratorDef = this.portletDecoratorDefinitions[i];
+                        if ( portletDecoratorDef && portletDecoratorDef.length == 2 )
+                        {
+                            portletDecoratorData.push( [portletDecoratorDef[0], portletDecoratorDef[1]] );
+                            if ( currentPortletDecorator == portletDecoratorDef[1] )
+                            {
+                                this.portletDecoratorSelect.setAllValues( portletDecoratorDef[0], portletDecoratorDef[1] );
+                            }
+    					}
+    				}
+                }
+                this.portletDecoratorSelect.dataProvider.setData( portletDecoratorData );
+            }
+        },
+
 
         // methods
 
@@ -113,9 +178,15 @@
                 addPageContentManager.getContent();
             }
         },
-        addPortlet: function()
+        changeLayoutDecorator: function()
+        {
+            var updatePageInfoContentManager = new jetspeed.widget.UpdatePageInfoContentManager( this.layoutDecoratorSelect.getValue(), null, this.pageEditorWidget );
+            updatePageInfoContentManager.getContent();
+        },
+        changePortletDecorator: function()
         {
-            jetspeed.page.addPortletInitiate();
+            var updatePageInfoContentManager = new jetspeed.widget.UpdatePageInfoContentManager( null, this.portletDecoratorSelect.getValue(), this.pageEditorWidget );
+            updatePageInfoContentManager.getContent();
         }
 	}
 );

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.css?view=diff&rev=510225&r1=510224&r2=510225
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.css (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.css Wed Feb 21 13:18:08 2007
@@ -14,56 +14,19 @@
 limitations under the License.
 */
 
-.pageEditorPane { }
-
-.pageEditorPane .container { }
-
-
-.pageEditorPane
-{
-  width: 100%;
-  padding-top: 5px;
-  font-size: 8pt;
-  color: blue;
-  overflow: hidden;
-  clip: auto;
-}
-
-.pageEditorPane label, 
-.pageEditorPane input, 
-.pageEditorPane select 
-{
-  font-size: 8pt;
-  color: blue;
-}
-
-.pageEditorPane input
-{
-  font-size: 8pt;
-}
-
-.pageEditorPaneLeft
-{
-  display:inline;
-  float:left;
-}
-
-.pageEditorPaneRight
-{
-  display:inline;
-  float:right;
-  padding-right: 5px;
-}
-
-
 .dojoDialog .container { padding: 0.5em; background: #fff; border: 2px solid #333; -moz-border-radius : 5px; }
 
-.dojoDialog .deletePortletDialog { background: transparent; width: 20em; }
+.dojoDialog .deletePortletDialog { background: #eee; width: 20em; border: 1px solid #999; padding : 4px; -moz-border-radius: 5px; }
 .dojoDialog .deletePortletDialog h2 { margin-top: 0; padding-top: 0; }
 .dojoDialog .deletePortletDialog p { clear: both; }
 .dojoDialog .deletePortletDialog .dojoButton { float: right; margin-right: 5px }
 
-.dojoDialog .columnSizeDialog { background: transparent; width: 20em; }
+.dojoDialog .deleteLayoutDialog { background: #eee; width: 20em; border: 1px solid #999; padding : 4px; -moz-border-radius: 5px; }
+.dojoDialog .deleteLayoutDialog h2 { margin-top: 0; padding-top: 0; }
+.dojoDialog .deleteLayoutDialog p { clear: both; }
+.dojoDialog .deleteLayoutDialog .dojoButton { float: right; margin-right: 5px }
+
+.dojoDialog .columnSizeDialog { background: #eee; width: 20em; border: 1px solid #999; padding : 4px; -moz-border-radius: 5px; }
 .dojoDialog .columnSizeDialog h2{ margin-top: 0; padding-top: 0; }
 .dojoDialog .columnSizeDialog p{ clear: both; }
 .dojoDialog .columnSizeDialog .dojoButton { float: right; margin-right: 5px }
@@ -72,5 +35,29 @@
 .dojoDialog .columnSizeDialog .columnSizeField .missing { font-size: 8pt; color: red }
 .dojoDialog .columnSizeDialog .columnSizeField .invalid { font-size: 8pt; color: red }
 
-.pageEditorPane .detail { }
+.pageEditorPaneContainer {
+    padding: 0.35em 0.625em 0.75em 0.625em;
+    /*background-color: #d3d3d3;*/
+    /*  ^^ set conditionally in code - in IE6, if fieldset background-color is set, fieldset is rendered poorly */
+    -moz-border-radius: 5px;
+    -moz-border-top-colors: ThreeDLightShadow ThreeDHighlight;
+    -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
+    -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow;
+    -moz-border-left-colors: ThreeDLightShadow ThreeDHighlight;
+}
+
+.pageEditorDetailContainer {
+    padding: 0.35em 0.625em 0.75em 0.625em;
+    /*background-color: #eeeeee;*/
+    /*  ^^ set conditionally in code - in IE6, if fieldset background-color is set, fieldset is rendered poorly */
+    -moz-border-radius: 5px;
+    -moz-border-top-colors: ThreeDLightShadow ThreeDHighlight;
+    -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
+    -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow;
+    -moz-border-left-colors: ThreeDLightShadow ThreeDHighlight;
+
+    float: left;
+    margin-right: 10px;
+    margin-bottom: 10px;
+}
 

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.html?view=diff&rev=510225&r1=510224&r2=510225
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.html (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.html Wed Feb 21 13:18:08 2007
@@ -1,11 +1,6 @@
 <div class="pageEditorPane">
     <div dojoAttachPoint="containerNode" class="container"></div>
 
-    <fieldset>
-        <div class="pageEditorPaneLeft"><b>Jetspeed Customizer</b></div>
-        <div class="pageEditorPaneRight"></div>
-    </fieldset>
-
     <div dojoAttachPoint="deletePortletDialog">
 		<div class="container" dojoAttachPoint="deletePortletDialogBg">
 			<div class="deletePortletDialog" dojoAttachPoint="deletePortletDialogFg">
@@ -13,6 +8,18 @@
                 <div dojoAttachPoint="deletePortletTitle">&nbsp;</div>
                 <button dojoType="Button" dojoAttachEvent="onClick:deletePortletConfirmed">OK</button>
                 <button dojoType="Button" dojoAttachPoint="deletePortletCancel">Cancel</button>
+				<p></p>
+			</div>
+		</div>
+	</div>
+
+    <div dojoAttachPoint="deleteLayoutDialog">
+		<div class="container" dojoAttachPoint="deleteLayoutDialogBg">
+			<div class="deleteLayoutDialog" dojoAttachPoint="deleteLayoutDialogFg">
+				<h2>Are you sure you want to delete this layout?</h2>
+                <div dojoAttachPoint="deleteLayoutTitle">&nbsp;</div>
+                <button dojoType="Button" dojoAttachEvent="onClick:deleteLayoutConfirmed">OK</button>
+                <button dojoType="Button" dojoAttachPoint="deleteLayoutCancel">Cancel</button>
 				<p></p>
 			</div>
 		</div>

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.js?view=diff&rev=510225&r1=510224&r2=510225
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.js Wed Feb 21 13:18:08 2007
@@ -12,6 +12,8 @@
  * 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.
+ *
+ * author: Steve Milek
  */
 
 dojo.provide("jetspeed.widget.PageEditor");
@@ -42,6 +44,10 @@
 		deletePortletDialogBg: null,
 		deletePortletDialogFg: null,
 
+        deleteLayoutDialog: null,
+		deleteLayoutDialogBg: null,
+		deleteLayoutDialogFg: null,
+
         columnSizeDialog: null,
 		columnSizeDialogBg: null,
 		columnSizeDialogFg: null,
@@ -51,6 +57,8 @@
 
         
         // fields
+        editorInitiatedFromDesktop: false,
+
 		isContainer: true,
         widgetsInTemplate: true,
 
@@ -71,8 +79,9 @@
 
             this.deletePortletDialog = dojo.widget.createWidget( "dialog", { widgetsInTemplate: true, deletePortletConfirmed: function() { this.hide(); self.deletePortletConfirmed( this.portletEntityId ); } }, this.deletePortletDialog );
 			this.deletePortletDialog.setCloseControl( this.deletePortletDialog.deletePortletCancel.domNode );
-			dojo.html.setOpacity( this.deletePortletDialogBg, 0.8 );
-			dojo.html.setOpacity( this.deletePortletDialogFg, 1 );
+
+            this.deleteLayoutDialog = dojo.widget.createWidget( "dialog", { widgetsInTemplate: true, deleteLayoutConfirmed: function() { this.hide(); self.deleteLayoutConfirmed( this.portletEntityId ); } }, this.deleteLayoutDialog );
+			this.deleteLayoutDialog.setCloseControl( this.deleteLayoutDialog.deleteLayoutCancel.domNode );
 
             var columnSizeParams = {};
             columnSizeParams.widgetsInTemplate = true;
@@ -101,8 +110,6 @@
 
             this.columnSizeDialog = dojo.widget.createWidget( "dialog", columnSizeParams, this.columnSizeDialog );
             this.columnSizeDialog.setCloseControl( this.columnSizeDialog.columnSizeCancel.domNode );
-			dojo.html.setOpacity(this.columnSizeDialogBg, 0.8);
-			dojo.html.setOpacity(this.columnSizeDialogFg, 1);
 
             jetspeed.widget.PageEditor.superclass.fillInTemplate.call( this );
 		},
@@ -115,21 +122,30 @@
         // initialization
         editPageInitiate: function()
         {
-            var themesContentManager = new jetspeed.widget.EditPageGetThemesContentManager( this, true, true, true, true );
+            var themesContentManager = null;
+            if ( this.editorInitiatedFromDesktop )
+                themesContentManager = new jetspeed.widget.EditPageGetThemesContentManager( this, false, false, true, true, true );
+            else
+                themesContentManager = new jetspeed.widget.EditPageGetThemesContentManager( this, true, true, true, false, false );
             themesContentManager.getContent();
         },
         editPageBuild: function()
         {
+            //actionButton.style.backgroundImage = "url(" + jetspeed.prefs.getLayoutRootUrl() + "/images/desktop/" + actionName + ".gif)";
+            var layoutImagesUrl = jetspeed.prefs.getLayoutRootUrl() + "/images/desktop/"; 
+
             var pageEditorWidgets = new Array();
-            var pageEditPaneWidget = dojo.widget.createWidget( "jetspeed:PageEditPane" );
+            var layoutEditPaneWidgets = new Array();
+            var pageEditPaneWidget = dojo.widget.createWidget( "jetspeed:PageEditPane", { layoutDecoratorDefinitions: jetspeed.page.themeDefinitions.pageDecorations, portletDecoratorDefinitions: jetspeed.page.themeDefinitions.portletDecorations, layoutImagesRoot: layoutImagesUrl } );
             pageEditPaneWidget.pageEditorWidget = this;
             dojo.dom.insertAfter( pageEditPaneWidget.domNode, this.domNode );
             pageEditorWidgets.push( pageEditPaneWidget );
 
-            var rootLayoutEditPaneWidget = dojo.widget.createWidget( "jetspeed:LayoutRootEditPane", { layoutId: jetspeed.page.rootFragmentId, layoutDefinitions: jetspeed.page.themeDefinitions.layouts, layoutDecoratorDefinitions: jetspeed.page.themeDefinitions.pageDecorations, portletDecoratorDefinitions: jetspeed.page.themeDefinitions.portletDecorations, desktopThemeDefinitions: jetspeed.page.themeDefinitions.desktopThemes } );
+            var rootLayoutEditPaneWidget = dojo.widget.createWidget( "jetspeed:LayoutEditPane", { widgetId: "layoutEdit_root", layoutId: jetspeed.page.rootFragmentId, isRootLayout: true, layoutDefinitions: jetspeed.page.themeDefinitions.layouts, layoutImagesRoot: layoutImagesUrl } );
             rootLayoutEditPaneWidget.pageEditorWidget = this;
             dojo.dom.insertAfter( rootLayoutEditPaneWidget.domNode, pageEditPaneWidget.domNode );
             pageEditorWidgets.push( rootLayoutEditPaneWidget );
+            layoutEditPaneWidgets.push( rootLayoutEditPaneWidget );
             
             if ( jetspeed.prefs.windowTiling )
             {
@@ -138,14 +154,20 @@
                     var col = jetspeed.page.columns[i];
                     if ( col.layoutHeader )
                     {
-                        var layoutEditPaneWidget = dojo.widget.createWidget( "jetspeed:LayoutEditPane", { layoutId: col.layoutId, layoutDefinitions: jetspeed.page.themeDefinitions.layouts } );
+                        var layoutEditPaneWidget = dojo.widget.createWidget( "jetspeed:LayoutEditPane", { widgetId: "layoutEdit_" + i, layoutId: col.layoutId, layoutDefinitions: jetspeed.page.themeDefinitions.layouts, layoutImagesRoot: layoutImagesUrl } );
                         layoutEditPaneWidget.pageEditorWidget = this;
-                        col.domNode.appendChild( layoutEditPaneWidget.domNode );
+                        if ( col.domNode.firstChild != null )
+                            col.domNode.insertBefore( layoutEditPaneWidget.domNode, col.domNode.firstChild );
+                        else
+                            col.domNode.appendChild( layoutEditPaneWidget.domNode );
+                        layoutEditPaneWidget.initializeDrag();
                         pageEditorWidgets.push( layoutEditPaneWidget );
+                        layoutEditPaneWidgets.push( layoutEditPaneWidget );
                     }
                 }
             }
             this.pageEditorWidgets = pageEditorWidgets;
+            this.layoutEditPaneWidgets = layoutEditPaneWidgets;
             this.editPageSyncPortletActions();
         },
         editPageSyncPortletActions: function()
@@ -199,6 +221,18 @@
             var removePortletContentManager = new jetspeed.widget.RemovePortletContentManager( portletEntityId, this );
             removePortletContentManager.getContent();
         },
+        deleteLayout: function( layoutId )
+        {
+            this.deleteLayoutDialog.layoutId = layoutId;
+            this.deleteLayoutDialog.layoutTitle = layoutId;
+            this.deleteLayoutTitle.innerHTML = layoutId;
+            this.deleteLayoutDialog.show();
+        },
+        deleteLayoutConfirmed: function()
+        {
+            var removePortletContentManager = new jetspeed.widget.RemoveLayoutContentManager( this.deleteLayoutDialog.layoutId, this );
+            removePortletContentManager.getContent();
+        },
         openColumnSizesEditor: function( layoutId )
         {
             var currentLayout = null;
@@ -263,26 +297,74 @@
         _doRefreshPage: function()
         {
             var pageUrl = jetspeed.page.getPageUrl();
-            pageUrl += "?" + jetspeed.id.PAGE_EDITOR_INITIATE_PARAMETER + "=true";
-            window.location.href = pageUrl;
+            pageUrl = jetspeed.url.addQueryParameter( pageUrl, "editPage", "true", true );
+            window.location.href = pageUrl.toString();
+        },
+
+        editModeNormal: function()
+        {
+            // restore all portlets (that were not previously minimized)
+            var portletArray = jetspeed.page.getPortletArray();
+            for ( var i = 0; i < portletArray.length; i++ )
+            {
+                var portletWindow = portletArray[i].getPortletWindow();
+                if ( portletWindow != null )
+                {
+                    portletWindow.restoreFromMinimizeWindowTemporarily();
+                }
+            }
+            if ( this.layoutEditPaneWidgets != null )
+            {
+                for ( var i = 0 ; i < this.layoutEditPaneWidgets.length ; i++ )
+                {
+                    var lepWidget = this.layoutEditPaneWidgets[i];
+                    if ( lepWidget.layoutMoveContainer != null )
+                        lepWidget.layoutMoveContainer.domNode.style.display = "none";
+                }
+            }           
+        },
+        editModeLayoutMove: function()
+        {
+            // minimize all portlets
+            var portletArray = jetspeed.page.getPortletArray();
+            for ( var i = 0; i < portletArray.length; i++ )
+            {
+                var portletWindow = portletArray[i].getPortletWindow();
+                if ( portletWindow != null )
+                {
+                    portletWindow.minimizeWindowTemporarily();
+                }
+            }
+            // display layout-move-handle widget
+            if ( this.layoutEditPaneWidgets != null )
+            {
+                for ( var i = 0 ; i < this.layoutEditPaneWidgets.length ; i++ )
+                {
+                    var lepWidget = this.layoutEditPaneWidgets[i];
+                    if ( ! lepWidget.isRootLayout && lepWidget.layoutMoveContainer != null )
+                        lepWidget.layoutMoveContainer.domNode.style.display = "block"
+                }
+            }
         }
 	}
 );
 
 
 // ... jetspeed.widget.EditPageGetThemesContentManager
-jetspeed.widget.EditPageGetThemesContentManager = function( pageEditorWidget, pageDecorations, portletDecorations, layouts, desktopThemes )
+jetspeed.widget.EditPageGetThemesContentManager = function( pageEditorWidget, pageDecorations, portletDecorations, layouts, desktopPageDecorations, desktopPortletDecorations )
 {
     this.pageEditorWidget = pageEditorWidget;
     var getThemeTypes = new Array();
     if ( pageDecorations )
-        getThemeTypes.push( "pageDecorations" );
+        getThemeTypes.push( [ "pageDecorations" ] );
     if ( portletDecorations )
-        getThemeTypes.push( "portletDecorations" );
+        getThemeTypes.push( [ "portletDecorations" ] );
     if ( layouts )
-        getThemeTypes.push( "layouts" );
-    if ( desktopThemes )
-        getThemeTypes.push( "desktopThemes" );
+        getThemeTypes.push( [ "layouts" ] );
+    if ( desktopPageDecorations )
+        getThemeTypes.push( [ "desktopPageDecorations", "pageDecorations" ] );
+    if ( desktopPortletDecorations )
+        getThemeTypes.push( [ "desktopPortletDecorations", "portletDecorations" ] );
     this.getThemeTypes = getThemeTypes;
     this.getThemeTypeNextIndex = 0;
 };
@@ -292,7 +374,7 @@
     {
         if ( this.getThemeTypes != null && this.getThemeTypes.length > this.getThemeTypeNextIndex )
         {
-            var queryString = "?action=getthemes&type=" + this.getThemeTypes[ this.getThemeTypeNextIndex ] + "&format=json";
+            var queryString = "?action=getthemes&type=" + this.getThemeTypes[ this.getThemeTypeNextIndex ][0] + "&format=json";
             var getThemesUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + queryString ;
             var ajaxApiContext = new jetspeed.om.Id( "getthemes", { } );
             var bindArgs = {};
@@ -309,7 +391,8 @@
     {
         if ( jetspeed.page.themeDefinitions == null )
             jetspeed.page.themeDefinitions = {};
-        jetspeed.page.themeDefinitions[ this.getThemeTypes[ this.getThemeTypeNextIndex ] ] = getThemesData;
+        var themeDefKey = ( ( this.getThemeTypes[ this.getThemeTypeNextIndex ].length > 1 ) ? this.getThemeTypes[ this.getThemeTypeNextIndex ][1] : this.getThemeTypes[ this.getThemeTypeNextIndex ][0]);
+        jetspeed.page.themeDefinitions[ themeDefKey ] = getThemesData;
         this.getThemeTypeNextIndex++;
         this.getContent();
     },
@@ -404,6 +487,48 @@
     }
 };
 
+
+// ... jetspeed.widget.MoveLayoutContentManager
+jetspeed.widget.MoveLayoutContentManager = function( layoutId, moveToLayoutId, column, row, pageEditorWidget )
+{
+    this.layoutId = layoutId;
+    this.moveToLayoutId = moveToLayoutId;
+    this.column = column;
+    this.row = row;
+    this.pageEditorWidget = pageEditorWidget;
+};
+jetspeed.widget.MoveLayoutContentManager.prototype =
+{
+    getContent: function()
+    {
+        if ( this.layoutId != null && this.moveToLayoutId != null )
+        {
+            var queryString = "?action=moveabs&id=" + this.layoutId + "&layoutid=" + this.moveToLayoutId;
+            if ( this.column != null )
+                queryString += "&col=" + this.column;
+            if ( this.row != null )
+                queryString += "&row=" + this.row;
+            var psmlMoveActionUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
+            var ajaxApiContext = new jetspeed.om.Id( "moveabs-layout", this.layoutId );
+            var bindArgs = {};
+            bindArgs.url = psmlMoveActionUrl;
+            bindArgs.mimetype = "text/xml";
+            jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
+        }
+    },
+    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
+    {
+        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "moveabs-layout" ) )
+        {
+            
+        }
+    },
+    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
+    {
+        dojo.raise( "MoveLayoutContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
+    }
+};
+
 // ... jetspeed.widget.UpdateFragmentContentManager
 jetspeed.widget.UpdateFragmentContentManager = function( layoutId, layoutName, layoutSizes, pageEditorWidget )
 {
@@ -445,12 +570,11 @@
 };
 
 // ... jetspeed.widget.UpdateFragmentContentManager
-jetspeed.widget.UpdatePageInfoContentManager = function( layoutDecorator, portletDecorator, desktopTheme, pageEditorWidget )
+jetspeed.widget.UpdatePageInfoContentManager = function( layoutDecorator, portletDecorator, pageEditorWidget )
 {
-    this.refreshPage = false;
+    this.refreshPage = ( ( pageEditorWidget.editorInitiatedFromDesktop ) ? true : false ) ;
     this.layoutDecorator = layoutDecorator;
     this.portletDecorator = portletDecorator;
-    this.desktopTheme = desktopTheme;
     this.pageEditorWidget = pageEditorWidget;
 };
 jetspeed.widget.UpdatePageInfoContentManager.prototype =
@@ -462,11 +586,6 @@
             queryString += "&layout-decorator=" + escape( this.layoutDecorator );
         if ( this.portletDecorator != null )
             queryString += "&portlet-decorator=" + escape( this.portletDecorator );
-        if ( this.desktopTheme != null )
-        {
-            queryString += "&theme=" + escape( this.desktopTheme );
-            this.refreshPage = true;
-        }
         var updatePageUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
         var ajaxApiContext = new jetspeed.om.Id( "updatepage-info", { } );
         var bindArgs = {};
@@ -519,5 +638,74 @@
     notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
     {
         dojo.raise( "RemovePortletContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
+    }
+};
+
+// ... jetspeed.widget.RemoveLayoutContentManager
+jetspeed.widget.RemoveLayoutContentManager = function( layoutId, pageEditorWidget )
+{
+    this.layoutId = layoutId;
+    this.pageEditorWidget = pageEditorWidget;
+};
+jetspeed.widget.RemoveLayoutContentManager.prototype =
+{
+    getContent: function()
+    {
+        if ( this.layoutId != null )
+        {
+            var queryString = "?action=updatepage&method=remove-fragment&id=" + this.layoutId;
+            var removeLayoutUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
+            var ajaxApiContext = new jetspeed.om.Id( "removelayout", { } );
+            var bindArgs = {};
+            bindArgs.url = removeLayoutUrl;
+            bindArgs.mimetype = "text/xml";
+            jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
+        }
+    },
+    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
+    {
+        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "removeportlet" ) )
+        {
+            this.pageEditorWidget.refreshPage();
+        }
+    },
+    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
+    {
+        dojo.raise( "RemoveLayoutContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
+    }
+};
+
+// ... jetspeed.widget.AddLayoutContentManager
+jetspeed.widget.AddLayoutContentManager = function( parentLayoutId, layoutName, pageEditorWidget )
+{
+    this.parentLayoutId = parentLayoutId;
+    this.layoutName = layoutName;
+    this.pageEditorWidget = pageEditorWidget;
+};
+jetspeed.widget.AddLayoutContentManager.prototype =
+{
+    getContent: function()
+    {
+        if ( this.parentLayoutId != null )
+        {
+            var queryString = "?action=updatepage&method=add-fragment&layoutid=" + this.parentLayoutId + ( this.layoutName != null ? ( "&layout=" + this.layoutName ) : "" );
+            var addLayoutUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
+            var ajaxApiContext = new jetspeed.om.Id( "addlayout", { } );
+            var bindArgs = {};
+            bindArgs.url = addLayoutUrl;
+            bindArgs.mimetype = "text/xml";
+            jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
+        }
+    },
+    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
+    {
+        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "addportlet" ) )
+        {
+            this.pageEditorWidget.refreshPage();
+        }
+    },
+    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
+    {
+        dojo.raise( "AddLayoutContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
     }
 };

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js?view=diff&rev=510225&r1=510224&r2=510225
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js Wed Feb 21 13:18:08 2007
@@ -12,6 +12,8 @@
  * 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.
+ *
+ * author: Steve Milek
  */
 
 dojo.provide("jetspeed.widget.PortalAccordionContainer");
@@ -37,7 +39,7 @@
     // dojo.widget.Widget create protocol
     postMixInProperties: function( args, fragment, parentComp )
     {
-        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getDesktopThemeRootUrl() + "/css/PortalAccordionContainer.css" ) ;
+        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getLayoutRootUrl() + "/css/PortalAccordionContainer.css" ) ;
         jetspeed.widget.PortalAccordionContainer.superclass.postMixInProperties.call( this, args, fragment, parentComp );
     },
     createAndAddPane: function( /* jetspeed.om.MenuOption */ labelMenuOption, accordionPaneProps )

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js?view=diff&rev=510225&r1=510224&r2=510225
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js Wed Feb 21 13:18:08 2007
@@ -12,6 +12,8 @@
  * 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.
+ *
+ * author: Steve Milek
  */
 
 dojo.provide("jetspeed.widget.PortalBreadcrumbContainer");
@@ -39,8 +41,8 @@
     // dojo.widget.Widget create protocol
     postMixInProperties: function( args, fragment, parentComp )
     {
-        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getDesktopThemeRootUrl() + "/css/PortalBreadcrumbContainer.css" ) ;
-        this.templatePath = new dojo.uri.dojoUri( jetspeed.prefs.getDesktopThemeRootUrl() + "/templates/PortalBreadcrumbContainer.html");
+        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getLayoutRootUrl() + "/css/PortalBreadcrumbContainer.css" ) ;
+        this.templatePath = new dojo.uri.dojoUri( jetspeed.prefs.getLayoutRootUrl() + "/templates/PortalBreadcrumbContainer.html");
         jetspeed.widget.PortalBreadcrumbContainer.superclass.postMixInProperties.call( this, args, fragment, parentComp );
     },
 
@@ -132,6 +134,6 @@
 	dojo.widget.HtmlWidget.call(this);
     
     this.widgetType = "PortalBreadcrumbLinkSeparator";
-    this.templatePath = new dojo.uri.dojoUri( jetspeed.prefs.getDesktopThemeRootUrl() + "/templates/PortalBreadcrumbLinkSeparator.html");
+    this.templatePath = new dojo.uri.dojoUri( jetspeed.prefs.getLayoutRootUrl() + "/templates/PortalBreadcrumbLinkSeparator.html");
 };
 dojo.inherits(jetspeed.widget.PortalBreadcrumbLinkSeparator, dojo.widget.HtmlWidget);

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js?view=diff&rev=510225&r1=510224&r2=510225
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js Wed Feb 21 13:18:08 2007
@@ -12,6 +12,8 @@
  * 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.
+ *
+ * author: Steve Milek
  */
 
 dojo.provide("jetspeed.widget.PortalTabContainer");
@@ -37,7 +39,7 @@
     // dojo.widget.Widget create protocol
     postMixInProperties: function( args, fragment, parentComp )
     {
-        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getDesktopThemeRootUrl() + "/css/PortalTabContainer.css" ) ;
+        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getLayoutRootUrl() + "/css/PortalTabContainer.css" ) ;
         jetspeed.widget.PortalTabContainer.superclass.postMixInProperties.call( this, args, fragment, parentComp );
     },
     // dojo.widget.Widget create protocol

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTaskBar.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTaskBar.js?view=diff&rev=510225&r1=510224&r2=510225
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTaskBar.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTaskBar.js Wed Feb 21 13:18:08 2007
@@ -46,7 +46,7 @@
         //    this.widgetId = jetspeed.id.TASKBAR;
 
         var tbProps = {};
-        tbProps.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getDesktopThemeRootUrl() + "/css/PortalTaskBar.css" ) ;
+        tbProps.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getLayoutRootUrl() + "/css/PortalTaskBar.css" ) ;
         tbProps.templatePath = new dojo.uri.Uri( jetspeed.url.basePortalDesktopUrl() + "/javascript/jetspeed/widget/HtmlTaskBarItemTemplate.html" ) ;
         // BOZO: improve this junk ^^^ 
 

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletDefContainer.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletDefContainer.js?view=diff&rev=510225&r1=510224&r2=510225
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletDefContainer.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletDefContainer.js Wed Feb 21 13:18:08 2007
@@ -12,6 +12,8 @@
  * 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.
+ *
+ * author: Steve Milek
  */
 
 dojo.provide("jetspeed.widget.PortletDefContainer");
@@ -34,14 +36,14 @@
     // dojo.widget.Widget create protocol
     postMixInProperties: function( args, fragment, parentComp )
     {
-        this.templatePath = new dojo.uri.dojoUri( jetspeed.url.basePortalWindowThemeUrl( jetspeed.page.getWindowThemeDefault() ) + "/templates/PortletDefContainer.html");
-        this.templateCssPath = new dojo.uri.Uri( jetspeed.url.basePortalWindowThemeUrl( jetspeed.page.getWindowThemeDefault() ) + "/css/PortletDefContainer.css" );
+        this.templatePath = new dojo.uri.dojoUri( jetspeed.prefs.getPortletDecorationBaseUrl( jetspeed.page.getPortletDecorationDefault() ) + "/templates/PortletDefContainer.html");
+        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getPortletDecorationBaseUrl( jetspeed.page.getPortletDecorationDefault() ) + "/css/PortletDefContainer.css" );
 
         jetspeed.widget.PortletDefContainer.superclass.postMixInProperties.call( this );
 
         var pdcProps = {};
-        pdcProps.templateCssPath = new dojo.uri.Uri( jetspeed.url.basePortalWindowThemeUrl( jetspeed.page.getWindowThemeDefault() ) + "/css/PortletDefContainer.css" ) ;
-        pdcProps.templatePath = new dojo.uri.Uri( jetspeed.url.basePortalWindowThemeUrl( jetspeed.page.getWindowThemeDefault() ) + "/templates/PortletDefContainerItemTemplate.html" ) ;
+        pdcProps.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getPortletDecorationBaseUrl( jetspeed.page.getPortletDecorationDefault() ) + "/css/PortletDefContainer.css" ) ;
+        pdcProps.templatePath = new dojo.uri.Uri( jetspeed.prefs.getPortletDecorationBaseUrl( jetspeed.page.getPortletDecorationDefault() ) + "/templates/PortletDefContainerItemTemplate.html" ) ;
 
         this.portletDefContainerProps = pdcProps ;
     },
@@ -159,7 +161,7 @@
 
         var windowParams = {};
         windowParams[ jetspeed.id.PORTLET_PROP_WINDOW_POSITION_STATIC ] = true;
-        windowParams[ jetspeed.id.PORTLET_PROP_WINDOW_THEME ] = jetspeed.page.getWindowThemeDefault();
+        windowParams[ jetspeed.id.PORTLET_PROP_WINDOW_DECORATION ] = jetspeed.page.getPortletDecorationDefault();
         windowParams[ jetspeed.id.PORTLET_PROP_WINDOW_TITLE ] = this.portletDef.getPortletDisplayName();
         windowParams[ jetspeed.id.PORTLET_PROP_WIDGET_ID ] = widgetId;
         windowParams[ jetspeed.id.PORTLET_PROP_WIDTH ] = jetspeed.prefs.windowWidth;
@@ -192,7 +194,7 @@
 
         var windowParams = {};
         windowParams[ jetspeed.id.PORTLET_PROP_WINDOW_POSITION_STATIC ] = false;
-        windowParams[ jetspeed.id.PORTLET_PROP_WINDOW_THEME ] = "tigris";
+        windowParams[ jetspeed.id.PORTLET_PROP_WINDOW_DECORATION ] = "tigris";
         windowParams[ jetspeed.id.PORTLET_PROP_WINDOW_TITLE ] = this.portletDef.getPortletDisplayName();
         windowParams[ jetspeed.id.PORTLET_PROP_WIDGET_ID ] = jetspeed.id.PORTLET_WINDOW_ID_PREFIX + "bleep";
         windowParams[ jetspeed.id.PORTLET_PROP_WIDTH ] = jetspeed.prefs.windowWidth;

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js?view=diff&rev=510225&r1=510224&r2=510225
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js Wed Feb 21 13:18:08 2007
@@ -12,6 +12,8 @@
  * 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.
+ *
+ * author: Steve Milek
  */
 
 dojo.provide("jetspeed.widget.PortletWindow");
@@ -42,8 +44,8 @@
     hasShadow: false,
     nextIndex: 1,
 
-    windowTheme: null,
-    windowThemeConfig: null,
+    windowDecorationName: null,
+    windowDecorationConfig: null,
 
     windowPositionStatic: false,
     windowHeightToFit: false,
@@ -61,6 +63,8 @@
     lastUntiledPositionInfo: null,
     lastTiledPositionInfo: null,
 
+    minimizeWindowTemporarilyRestoreTo: null,
+
     // see setPortletContent for info on these ContentPane settings:
     executeScripts: false,
     scriptSeparation: false,
@@ -139,27 +143,21 @@
         }
     },
 
-    initWindowTheme: function( fragment )
+    initWindowDecoration: function( fragment )
     {
-        var windowtheme = this.getInitProperty( jetspeed.id.PORTLET_PROP_WINDOW_THEME );
-        if ( ! windowtheme )
+        var decorationName = this.getInitProperty( jetspeed.id.PORTLET_PROP_WINDOW_DECORATION );
+        if ( ! decorationName )
         {
-            if ( this.portletWindowTheme )
-                windowtheme = this.portletWindowTheme;
+            if ( this.portletDecorationName )
+                decorationName = this.portletDecorationName;
             else
-                windowtheme = jetspeed.page.getWindowThemeDefault();
+                decorationName = jetspeed.page.getPortletDecorationDefault();
         }
-        this.windowTheme = windowtheme ;
-        this.windowThemeConfig = jetspeed.prefs.getWindowThemeConfig( windowtheme );
-
-        var prevCssPath = ( this.templateCssPath == null ? null : this.templateCssPath.toString() );
-        this.templateCssPath = new dojo.uri.Uri( jetspeed.url.basePortalWindowThemeUrl( windowtheme ) + "/css/styles.css" );
+        this.windowDecorationName = decorationName ;
+        var pdConfig = jetspeed.loadPortletDecorationStyles( decorationName );
+        this.windowDecorationConfig = pdConfig;
 
-        if ( this.portletInitialized )
-        {   // load new stylesheet    // BOZO: it would be nice to check if this were necessary
-            if ( prevCssPath == null || prevCssPath != this.templateCssPath.toString() )
-                dojo.html.insertCssFile( this.templateCssPath, null, true );
-        }
+        this.templateCssPath = "";   // clear this so dojo default will not be loaded
     },
     initWindowTitle: function( fragment )
     {
@@ -168,7 +166,8 @@
     },
     initWindowIcon: function( fragment )
     {
-        if ( this.windowThemeConfig != null && this.windowThemeConfig.windowIconEnabled && this.windowThemeConfig.windowIconPath != null )
+
+        if ( this.windowDecorationConfig != null && this.windowDecorationConfig.windowIconEnabled && this.windowDecorationConfig.windowIconPath != null )
         {
             var windowicon = this.getInitProperty( jetspeed.id.PORTLET_PROP_WINDOW_ICON );
             if ( ! windowicon )
@@ -182,7 +181,7 @@
                     windowicon = "document.gif";
                 }
             }
-            this.iconSrc = new dojo.uri.Uri(jetspeed.url.basePortalDesktopUrl() + this.windowThemeConfig.windowIconPath + windowicon ) ;
+            this.iconSrc = new dojo.uri.Uri(jetspeed.url.basePortalDesktopUrl() + this.windowDecorationConfig.windowIconPath + windowicon ) ;
             if ( this.portletInitialized && this.titleBarIcon )
             {
                 this.titleBarIcon.src = this.iconSrc.toString();
@@ -304,7 +303,7 @@
 
     portletMixinProperties: function( fragment )
     {
-        this.initWindowTheme( fragment );
+        this.initWindowDecoration( fragment );
         this.initWindowTitle( fragment );
         this.initWindowIcon( fragment );
 
@@ -406,7 +405,7 @@
 		}
 
 		// <img src=""> can hang IE!  better get rid of it
-		if ( this.iconSrc == "" )
+		if ( this.iconSrc == null || this.iconSrc == "" )
         {
 			dojo.dom.removeNode( this.titleBarIcon );
 		}
@@ -424,20 +423,20 @@
 
             var windowTitleBarButtons = null;
 
-            if ( this.windowThemeConfig != null )
+            if ( this.windowDecorationConfig != null )
             {
                 var menuActionNames = new Array();
                 var menuActionNoImage = false;
-                if ( this.windowThemeConfig.windowActionButtonOrder != null )
+                if ( this.windowDecorationConfig.windowActionButtonOrder != null )
                 {
                     // all possible button actions must be added here (no support for adding action buttons after init)
                     // this including buttons for the current mode and state (which will be initially hidden)
                     var btnActionNames = new Array();
                     if ( this.portlet )
                     {
-                        for ( var actionIdx = (this.windowThemeConfig.windowActionButtonOrder.length-1) ; actionIdx >= 0 ; actionIdx-- )
+                        for ( var actionIdx = (this.windowDecorationConfig.windowActionButtonOrder.length-1) ; actionIdx >= 0 ; actionIdx-- )
                         {
-                            var actionName = this.windowThemeConfig.windowActionButtonOrder[ actionIdx ];
+                            var actionName = this.windowDecorationConfig.windowActionButtonOrder[ actionIdx ];
                             var includeAction = false;
                             if ( this.portlet.getAction( actionName ) != null || jetspeed.prefs.windowActionDesktop[ actionName ] != null )
                             {
@@ -455,9 +454,9 @@
                     }
                     else
                     {
-                        for ( var actionIdx = (this.windowThemeConfig.windowActionButtonOrder.length-1) ; actionIdx >= 0 ; actionIdx-- )
+                        for ( var actionIdx = (this.windowDecorationConfig.windowActionButtonOrder.length-1) ; actionIdx >= 0 ; actionIdx-- )
                         {
-                            var actionName = this.windowThemeConfig.windowActionButtonOrder[ actionIdx ];
+                            var actionName = this.windowDecorationConfig.windowActionButtonOrder[ actionIdx ];
                             var includeAction = false;
                             if ( actionName == jetspeed.id.ACTION_NAME_MINIMIZE || actionName == jetspeed.id.ACTION_NAME_MAXIMIZE || actionName == jetspeed.id.ACTION_NAME_RESTORE || actionName == jetspeed.id.ACTION_NAME_MENU || jetspeed.prefs.windowActionDesktop[ actionName ] != null )
                             {
@@ -469,7 +468,7 @@
                             }
                         }
                     }   // if ( this.portlet )
-                    var btnMax = ( this.windowThemeConfig.windowActionButtonMax == null ? -1 : this.windowThemeConfig.windowActionButtonMax );
+                    var btnMax = ( this.windowDecorationConfig.windowActionButtonMax == null ? -1 : this.windowDecorationConfig.windowActionButtonMax );
                     if ( btnMax != -1 && btnActionNames.length >= btnMax )
                     {
                         var removedBtns = 0;
@@ -484,11 +483,11 @@
                             }
                         }
                     }
-                    if ( this.windowThemeConfig.windowActionNoImage != null )
+                    if ( this.windowDecorationConfig.windowActionNoImage != null )
                     {
                         for ( var i = 0 ; i < btnActionNames.length ; i++ )
                         {
-                            if ( this.windowThemeConfig.windowActionNoImage[ btnActionNames[ i ] ] != null )
+                            if ( this.windowDecorationConfig.windowActionNoImage[ btnActionNames[ i ] ] != null )
                             {
                                 if ( btnActionNames[ i ] == jetspeed.id.ACTION_NAME_MENU )
                                 {
@@ -509,15 +508,15 @@
                             this._createActionButtonNode( btnActionNames[i] );
                         }
                     }
-                }   // if ( this.windowThemeConfig.windowActionButtonOrder != null )
+                }   // if ( this.windowDecorationConfig.windowActionButtonOrder != null )
     
-                if ( this.windowThemeConfig.windowActionMenuOrder != null )
+                if ( this.windowDecorationConfig.windowActionMenuOrder != null )
                 {
                     if ( this.portlet )
                     {
-                        for ( var actionIdx = 0 ; actionIdx < this.windowThemeConfig.windowActionMenuOrder.length ; actionIdx++ )
+                        for ( var actionIdx = 0 ; actionIdx < this.windowDecorationConfig.windowActionMenuOrder.length ; actionIdx++ )
                         {
-                            var actionName = this.windowThemeConfig.windowActionMenuOrder[ actionIdx ];
+                            var actionName = this.windowDecorationConfig.windowActionMenuOrder[ actionIdx ];
                             var includeAction = false;
                             if ( this.portlet.getAction( actionName ) != null || jetspeed.prefs.windowActionDesktop[ actionName ] != null )
                             {
@@ -531,16 +530,16 @@
                     }
                     else
                     {
-                        for ( var actionIdx = 0 ; actionIdx < this.windowThemeConfig.windowActionMenuOrder.length ; actionIdx++ )
+                        for ( var actionIdx = 0 ; actionIdx < this.windowDecorationConfig.windowActionMenuOrder.length ; actionIdx++ )
                         {
-                            var actionName = this.windowThemeConfig.windowActionMenuOrder[ actionIdx ];
+                            var actionName = this.windowDecorationConfig.windowActionMenuOrder[ actionIdx ];
                             if ( jetspeed.prefs.windowActionDesktop[ actionName ] != null )
                             {
                                 menuActionNames.push( actionName );
                             }
                         }
                     }   // if ( this.portlet )
-                }   // if ( this.windowThemeConfig.windowActionMenuOrder != null )
+                }   // if ( this.windowDecorationConfig.windowActionMenuOrder != null )
                 
                 if ( menuActionNames.length > 0 )
                 {
@@ -618,7 +617,7 @@
         {
             var actionButton = document.createElement( "div" );
             actionButton.className = "portletWindowActionButton";
-            actionButton.style.backgroundImage = "url(" + jetspeed.url.basePortalWindowThemeUrl( this.windowTheme ) + "/images/desktop/" + actionName + ".gif)";
+            actionButton.style.backgroundImage = "url(" + jetspeed.prefs.getPortletDecorationBaseUrl( this.windowDecorationName ) + "/images/desktop/" + actionName + ".gif)";
             actionButton.actionName = actionName;
 
             this.actionButtons[ actionName ] = actionButton;
@@ -626,7 +625,7 @@
 
             dojo.event.connect( actionButton, "onclick", this, "windowActionButtonClick" );
 
-            if ( this.windowThemeConfig != null && this.windowThemeConfig.windowActionButtonTooltip )
+            if ( this.windowDecorationConfig != null && this.windowDecorationConfig.windowActionButtonTooltip )
             {   // setting isContainer=false and fastMixIn=true to avoid recursion hell when connectId is a node (could give each an id instead)
                 var tooltip = dojo.widget.createWidget( "Tooltip", { isContainer: false, fastMixIn: true, caption: this._getActionLabel( actionName ), connectId: actionButton, delay: "100" } );
                 document.body.appendChild( tooltip.domNode );
@@ -805,7 +804,21 @@
     _isWindowActionEnabled: function( actionName, currentPortletActionState, currentPortletActionMode )
     {
         var enabled = false;
-        if ( actionName == jetspeed.id.ACTION_NAME_MENU )
+        if ( this.minimizeWindowTemporarilyRestoreTo != null )
+        {
+            if ( this.portlet )
+            {
+                var actionDef = this.portlet.getAction( actionName );
+                if ( actionDef != null )
+                {
+                    if ( actionDef.id == jetspeed.id.ACTION_NAME_REMOVEPORTLET )
+                    {
+                        enabled = true;
+                    }
+                }
+            }
+        }
+        else if ( actionName == jetspeed.id.ACTION_NAME_MENU )
         {
             enabled = true;
         }
@@ -862,7 +875,7 @@
         {   // adjust visible action buttons - BOZO:NOW: this non-portlet case needs more attention
             if ( actionName == jetspeed.id.ACTION_NAME_MAXIMIZE )
             {
-                if ( actionName != this.windowState )
+                if ( actionName != this.windowState && this.minimizeWindowTemporarilyRestoreTo == null )
                 {
                     enabled = true;
                 }
@@ -887,7 +900,7 @@
 
     windowActionButtonSync: function()
     {
-        var hideButtons = this.windowThemeConfig.windowActionButtonHide;
+        var hideButtons = this.windowDecorationConfig.windowActionButtonHide;
         var currentPortletActionState = null;
         var currentPortletActionMode = null;
         if ( this.portlet )
@@ -915,9 +928,9 @@
         if ( ! this.templateDomNodeClassName )
             this.templateDomNodeClassName = this.domNode.className;
         var domNodeClassName = this.templateDomNodeClassName;
-        if ( this.windowTheme )
+        if ( this.windowDecorationName )
         {
-            domNodeClassName = this.windowTheme + ( domNodeClassName ? ( " " + domNodeClassName ) : "" );
+            domNodeClassName = this.windowDecorationName + ( domNodeClassName ? ( " " + domNodeClassName ) : "" );
         }
         this.domNode.className = jetspeed.id.PORTLET_STYLE_CLASS + ( domNodeClassName ? ( " " + domNodeClassName ) : "" );
         
@@ -926,9 +939,9 @@
             if ( ! this.templateContainerNodeClassName )
                 this.templateContainerNodeClassName = this.containerNode.className;
             var containerNodeClassName = this.templateContainerNodeClassName;
-            if ( this.windowTheme )
+            if ( this.windowDecorationName )
             {
-                containerNodeClassName = this.windowTheme + ( containerNodeClassName ? ( " " + containerNodeClassName ) : "" );
+                containerNodeClassName = this.windowDecorationName + ( containerNodeClassName ? ( " " + containerNodeClassName ) : "" );
             }
             this.containerNode.className = jetspeed.id.PORTLET_STYLE_CLASS + ( containerNodeClassName ? ( " " + containerNodeClassName ) : "" );
         }
@@ -986,6 +999,32 @@
         return this.portletInitialized;
     },
 
+    minimizeWindowTemporarily: function()
+    {
+        if ( this.minimizeWindowTemporarilyRestoreTo == null )
+        {
+            this.minimizeWindowTemporarilyRestoreTo = this.windowState;
+            if ( this.windowState != jetspeed.id.ACTION_NAME_MINIMIZE )
+            {
+                this.minimizeWindow();
+            }
+            this.windowActionButtonSync();
+        }
+    },
+    restoreFromMinimizeWindowTemporarily: function()
+    {
+        var restoreToWindowState = this.minimizeWindowTemporarilyRestoreTo;
+        this.minimizeWindowTemporarilyRestoreTo = null;
+        if ( restoreToWindowState )
+        {
+            if ( restoreToWindowState != jetspeed.id.ACTION_NAME_MINIMIZE )
+            {
+                this.restoreWindow();
+            }
+            this.windowActionButtonSync();
+        }
+    },
+    
     minimizeWindow: function( evt )
     {
         this._setLastPositionInfo();
@@ -1047,14 +1086,7 @@
         this.containerNode.style.display = "";
         this.resizeBar.style.display = "";
 
-        if ( this.windowPositionStatic )
-        {
-            lastPositionInfo = this.lastTiledPositionInfo;
-        }
-        else
-        {
-            lastPositionInfo = this.lastUntiledPositionInfo;
-        }
+        var lastPositionInfo = this.getLastPositionInfo();
 
         var lpiWidth = null;
         var lpiHeight = null;
@@ -1095,7 +1127,12 @@
 
 		this.windowState = jetspeed.id.ACTION_NAME_RESTORE;  // "normal"
 	},
-
+    getLastPositionInfo: function()
+    {
+        if ( this.windowPositionStatic )
+            return this.lastTiledPositionInfo;
+        return this.lastUntiledPositionInfo;
+    },
     _setLastPositionInfo: function( tiledStateIsChanging, changingToMaximized )
     {
         if ( changingToMaximized )
@@ -1466,17 +1503,7 @@
     
     getPageColumnIndex: function()
     {
-        var inColIndex = null;
-        if ( ! jetspeed.page.columns ) return inColIndex;
-        for ( var i = 0 ; i < jetspeed.page.columns.length ; i++ )
-        {
-            if ( jetspeed.page.columns[i].containsNode( this.domNode ) )
-            {
-                inColIndex = i;
-                break;
-            }
-        }
-        return inColIndex;
+        return jetspeed.page.getColumnIndexContainingNode( this.domNode );
     },
     getResizeHandleWidget: function()
     {
@@ -1561,7 +1588,7 @@
     },
     titleMouseOver: function( evt )
     {
-        if ( this.windowThemeConfig.windowActionButtonHide )
+        if ( this.windowDecorationConfig.windowActionButtonHide )
         {
             var self = this ;
             this.titleMouseIn = 1 ;   // was ++
@@ -1571,7 +1598,7 @@
     },
     titleMouseOut: function( evt )
     {
-        if ( this.windowThemeConfig.windowActionButtonHide )
+        if ( this.windowDecorationConfig.windowActionButtonHide )
         {
             var self = this ;
             var nTitleMouseIn = this.titleMouseIn ;
@@ -1734,7 +1761,7 @@
 				var regexDojoJs = /.*(\bdojo\b\.js(?:\.uncompressed\.js)?)$/;
 				var regexInvalid = /(?:var )?\bdjConfig\b(?:[\s]*=[\s]*\{[^}]+\}|\.[\w]*[\s]*=[\s]*[^;\n]*)?;?|dojo\.hostenv\.writeIncludes\(\s*\);?/g;
 				var regexRequires = /dojo\.(?:(?:require(?:After)?(?:If)?)|(?:widget\.(?:manager\.)?registerWidgetPackage)|(?:(?:hostenv\.)?setModulePrefix|registerModulePath)|defineNamespace)\((['"]).*?\1\)\s*;?/;
-
+                // " - trick emacs here after regex
 				while(match = regex.exec(s)){
 					if(forcingExecuteScripts && match[1]){
 						if(attr = regexSrc.exec(match[1])){
@@ -1851,7 +1878,7 @@
 	onDragStart: function()
     {
         // BOZO: code copied from dojo.dnd.HtmlDragMoveSource.onDragStart to change dragObject
-        var dragObj = new jetspeed.widget.PortletWindowDragMoveObject( this.portletWindow, this.dragObject, this.type );
+        var dragObj = new jetspeed.widget.PortletWindowDragMoveObject( this.dragObject, this.type, this.portletWindow );
 
 		if ( this.constrainToContainer )
         {
@@ -1865,16 +1892,11 @@
     }
 });
 
-jetspeed.widget.PortletWindowDragMoveObject = function( portletWindow, node, type )
-{
-    this.portletWindow = portletWindow;
-    this.windowPositionStatic = this.portletWindow.windowPositionStatic;
-	dojo.dnd.HtmlDragMoveObject.call( this, node, type );
-}
-
-dojo.inherits( jetspeed.widget.PortletWindowDragMoveObject, dojo.dnd.HtmlDragMoveObject );
-
-dojo.lang.extend( jetspeed.widget.PortletWindowDragMoveObject, {
+dojo.declare( "jetspeed.widget.PortletWindowDragMoveObject", dojo.dnd.HtmlDragMoveObject, {
+    qualifyTargetColumn: function( /* jetspeed.om.Column */ column )
+    {
+        return true;
+    },
     onDragStart: function( e )
     {
         this.portletWindow.isDragging = true;
@@ -1931,9 +1953,12 @@
                 var col = jetspeed.page.columns[i];
                 if ( ! col.columnContainer && ! col.layoutHeader )
                 {
-                    var colAbsPos = dojo.html.getAbsolutePosition( col.domNode, true );
-                    var marginBox = dojo.html.getMarginBox( col.domNode );
-                    this.columnDimensions[ i ] = { left: (colAbsPos.x), right: (colAbsPos.x + marginBox.width), top: (colAbsPos.y), bottom: (colAbsPos.y + marginBox.height) };
+                    if ( this.qualifyTargetColumn( col ) )
+                    {
+                        var colAbsPos = dojo.html.getAbsolutePosition( col.domNode, true );
+                        var marginBox = dojo.html.getMarginBox( col.domNode );
+                        this.columnDimensions[ i ] = { left: (colAbsPos.x), right: (colAbsPos.x + marginBox.width), top: (colAbsPos.y), bottom: (colAbsPos.y + marginBox.height) };
+                    }
                 }
             }
             
@@ -2113,4 +2138,11 @@
         this.portletWindow.endDragging();
         //dojo.debug( "jetspeed.widget.PortletWindowDragMoveSource.onDragEnd" );
 	}
-});
+    },
+    function( node, type, portletWindow )
+    {
+        this.portletWindow = portletWindow;
+        this.windowPositionStatic = ( (this.portletWindow != null) ? this.portletWindow.windowPositionStatic : false );
+        //dojo.dnd.HtmlDragMoveObject.call( this, node, type );        
+    }
+);



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org