portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r387410 - in /portals/jetspeed-2/trunk/src/webapp/javascript: desktop/ desktop/windowicons/ desktop/windowthemes/ desktop/windowthemes/theme1/ desktop/windowthemes/theme1/images/ desktop/windowthemes/theme2/ desktop/windowthemes/theme2/imag...
Date Tue, 21 Mar 2006 04:46:06 GMT
Author: taylor
Date: Mon Mar 20 20:46:04 2006
New Revision: 387410

URL: http://svn.apache.org/viewcvs?rev=387410&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-514

Added:
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowicons/
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowicons/applications-internet.png
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowicons/document.gif   (with
props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/HtmlFloatingPane.css
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/HtmlFloatingPane.html
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/close.gif
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/maximize.gif
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/minimize.gif
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/refresh.gif
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/restore.gif
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/theme1.css
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/close.gif
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/maximize.gif
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/minimize.gif
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/refresh.gif
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/restore.gif
  (with props)
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/theme2.css
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/jetspeed-ajax-api.js

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowicons/applications-internet.png
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowicons/applications-internet.png?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowicons/applications-internet.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowicons/document.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowicons/document.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowicons/document.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/HtmlFloatingPane.css
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/HtmlFloatingPane.css?rev=387410&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/HtmlFloatingPane.css
(added)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/HtmlFloatingPane.css
Mon Mar 20 20:46:04 2006
@@ -0,0 +1,89 @@
+
+.dojoFloatingPane {
+	/* essential css */
+	position: absolute;
+	overflow: visible;		/* so drop shadow is displayed */
+	z-index: 5;
+	-moz-box-sizing: border-box;
+	-khtml-box-sizing: border-box;
+	
+	/* styling css */
+	border: 1px solid;
+	border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;
+	background-color: ThreeDFace;
+}
+
+.dojoFloatingPaneTitleBar {
+	/* essential css */
+	z-index: 2;
+	position: absolute;
+	top: 0px;
+	left: 0px;
+	width: 100%;
+
+	/* styling css */
+	vertical-align: middle;
+	height: 22px;
+	color: CaptionText;
+	font: small-caption;
+	background-color: #7596c6;
+	cursor: default;
+}
+.dojoFloatingPaneTitleText {
+	padding: 2px 4px 2px 2px;
+}
+
+/* minimize/maximize icons are specified by CSS only */
+.dojoFloatingPaneMinimizeIcon,
+.dojoFloatingPaneMaximizeIcon,
+.dojoFloatingPaneRestoreIcon,
+.dojoFloatingPaneCloseIcon {
+	vertical-align: middle;
+	height: 22px;
+	width: 22px;
+	float: right;
+}
+.dojoFloatingPaneMinimizeIcon {
+	background-image: url(images/floatingPaneMinimize.gif);
+}
+.dojoFloatingPaneMaximizeIcon {
+	background-image: url(images/floatingPaneMaximize.gif);
+}
+.dojoFloatingPaneRestoreIcon {
+	background-image: url(images/floatingPaneRestore.gif);
+}
+.dojoFloatingPaneCloseIcon {
+	background-image: url(images/floatingPaneClose.gif);
+}
+
+/* bar at bottom of window that holds resize handle */
+.dojoFloatingPaneResizebar {
+	/* essential css */
+	position: absolute;
+	left: 0;
+	bottom: 0;
+	width: 100%;
+	height: 13px;
+	z-index: 2;
+	
+	/* styling css */
+	background-color: ThreeDFace;
+}
+
+/* the part that holds the actual content of the floating pane (text or whatever) */
+.dojoFloatingPaneClient {
+	/* essential css */
+	position: relative;
+	width: 100%;
+	height: 100%;
+	-moz-box-sizing: border-box;
+	-khtml-box-sizing: border-box;
+	z-index: 2;
+	overflow: auto;
+	
+	/* styling css */
+	background-color: ThreeDFace;
+	padding: 8px;
+	font-family: Verdana, Helvetica, Garamond, sans-serif;
+	font-size: 12px;
+}

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/HtmlFloatingPane.html
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/HtmlFloatingPane.html?rev=387410&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/HtmlFloatingPane.html
(added)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/HtmlFloatingPane.html
Mon Mar 20 20:46:04 2006
@@ -0,0 +1,21 @@
+<div id="${this.widgetId}" class="dojoFloatingPane" dojoAttachEvent="onMouseDown">
+	<div dojoAttachPoint="titleBar" class="dojoFloatingPaneTitleBar" style="display:none">
+	  	<img dojoAttachPoint="titleBarIcon" src="${this.iconSrc}" class="dojoTitleBarIcon">
+		<div dojoAttachPoint="closeAction" dojoAttachEvent="onClick:closeWindow"
+   	  		class="dojoFloatingPaneCloseIcon"></div>
+		<div dojoAttachPoint="restoreAction" dojoAttachEvent="onClick:restoreWindow"
+   	  		class="dojoFloatingPaneRestoreIcon"></div>
+		<div dojoAttachPoint="maximizeAction" dojoAttachEvent="onClick:maximizeWindow"
+   	  		class="dojoFloatingPaneMaximizeIcon"></div>
+		<div dojoAttachPoint="minimizeAction" dojoAttachEvent="onClick:minimizeWindow"
+   	  		class="dojoFloatingPaneMinimizeIcon"></div>
+	  	<div dojoAttachPoint="titleBarText" class="dojoFloatingPaneTitleText">${this.title}</div>
+	</div>
+
+	<div dojoAttachPoint="containerNode" class="dojoFloatingPaneClient">
+	</div>
+
+	<div dojoAttachPoint="resizeBar" class="dojoFloatingPaneResizebar">
+	</div>
+
+</div>
\ No newline at end of file

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/close.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/close.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/close.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/maximize.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/maximize.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/maximize.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/minimize.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/minimize.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/minimize.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/refresh.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/refresh.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/refresh.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/restore.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/restore.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/images/restore.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/theme1.css
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/theme1.css?rev=387410&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/theme1.css
(added)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme1/theme1.css
Mon Mar 20 20:46:04 2006
@@ -0,0 +1,37 @@
+
+.theme1 .dojoFloatingPaneTitleBar {
+    background: #98FB98;    /* palegreen */ 
+    line-height: 1.4em;
+	color: #4682B4;  /* steelblue */
+}
+
+/* minimize/maximize icons are specified by CSS only */
+.theme1 .dojoFloatingPaneMinimizeIcon,
+.theme1 .dojoFloatingPaneMaximizeIcon,
+.theme1 .dojoFloatingPaneRestoreIcon,
+.theme1 .dojoFloatingPaneCloseIcon {
+	vertical-align: middle;
+	height: 22px;
+	width: 22px;
+	float: right;
+}
+.theme1 .dojoFloatingPaneMinimizeIcon {
+	background-image: url(images/minimize.gif);
+    background-repeat: no-repeat;
+    background-position: center center;
+}
+.theme1 .dojoFloatingPaneMaximizeIcon {
+    background-image: url(images/maximize.gif);
+    background-repeat: no-repeat;
+    background-position: center center;
+}
+.theme1 .dojoFloatingPaneRestoreIcon {
+    background-image: url(images/restore.gif);
+    background-repeat: no-repeat;
+    background-position: center center;
+}
+.theme1 .dojoFloatingPaneCloseIcon {
+	background-image: url(images/close.gif);
+    background-repeat: no-repeat;
+    background-position: center center;
+}

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/close.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/close.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/close.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/maximize.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/maximize.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/maximize.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/minimize.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/minimize.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/minimize.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/refresh.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/refresh.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/refresh.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/restore.gif
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/restore.gif?rev=387410&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/images/restore.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/theme2.css
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/theme2.css?rev=387410&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/theme2.css
(added)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/theme2/theme2.css
Mon Mar 20 20:46:04 2006
@@ -0,0 +1,37 @@
+
+.theme2 .dojoFloatingPaneTitleBar {
+    background: #B0C4DE;  /* lightsteelblue */
+    line-height: 1.4em;
+	color: #00368F;
+}
+
+/* minimize/maximize icons are specified by CSS only */
+.theme2 .dojoFloatingPaneMinimizeIcon,
+.theme2 .dojoFloatingPaneMaximizeIcon,
+.theme2 .dojoFloatingPaneRestoreIcon,
+.theme2 .dojoFloatingPaneCloseIcon {
+	vertical-align: middle;
+	height: 22px;
+	width: 22px;
+	float: right;
+}
+.theme2 .dojoFloatingPaneMinimizeIcon {
+	background-image: url(images/minimize.gif);
+    background-repeat: no-repeat;
+    background-position: center center;
+}
+.theme2 .dojoFloatingPaneMaximizeIcon {
+    background-image: url(images/maximize.gif);
+    background-repeat: no-repeat;
+    background-position: center center;
+}
+.theme2 .dojoFloatingPaneRestoreIcon {
+    background-image: url(images/restore.gif);
+    background-repeat: no-repeat;
+    background-position: center center;
+}
+.theme2 .dojoFloatingPaneCloseIcon {
+	background-image: url(images/close.gif);
+    background-repeat: no-repeat;
+    background-position: center center;
+}

Added: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/jetspeed-ajax-api.js
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/jetspeed-ajax-api.js?rev=387410&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/jetspeed-ajax-api.js (added)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/jetspeed-ajax-api.js Mon Mar 20
20:46:04 2006
@@ -0,0 +1,602 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.
+ */
+
+
+/**
+ * jetspeed is the root variable of (almost all) our public symbols.
+ */
+
+// ... base objects
+jetspeed = {} ;
+jetspeed.om = {} ;
+jetspeed.ui = {} ;
+
+jetspeed.version = 
+{
+    major: 2, minor: 1, patch: 0, flag: "dev",
+    revision: "",
+	toString: function() 
+	{
+		with (jetspeed.version) 
+		{
+			return major + "." + minor + "." + patch + flag + " (" + revision + ")";
+		}
+	}
+};
+
+jetspeed.basePortalUrl = function()
+{
+    return document.location.protocol + "//" + document.location.host ;
+}
+
+jetspeed.basePortalDesktopUrl = function()
+{
+    return jetspeed.basePortalUrl() + "/jetspeed" ;
+}
+
+jetspeed.testLoadPageCreateWidgetPortlets = function()
+{
+    var page = new jetspeed.om.Page() ;
+    page.retrievePsml( new jetspeed.om.PageContentListenerCreateWidget() ) ;
+}
+
+jetspeed.testLoadPageCreateDivPortlets = function()
+{
+    var page = new jetspeed.om.Page() ;
+    page.retrievePsml( new jetspeed.om.PageContentListenerCreateDiv() ) ;
+}
+
+jetspeed.testCreatePortletWindows = function( /* Portlet[] */ portlets, portletWindowFactory
)
+{
+    //if ( ! dojo.lang.isArray(portlets) && ! dojo.lang.isObject(portlets) )
+    //{
+    //    if ( portlets && dojo.lang.isSubOf(portlets, jetspeed.om.Portlet))
+    //        portlets = [portlets];
+    //    else
+    //        portlets = null;
+    //}
+    if ( portlets )
+    {
+        for (var portletIndex in portlets)
+        {
+            var portlet = portlets[portletIndex];
+            portlet.createPortletWindow(portletWindowFactory);
+        }
+    }
+}
+
+// ... jetspeed.om.PageContentListenerCreateWidget
+jetspeed.om.PageContentListenerCreateWidget = function()
+{
+}
+jetspeed.om.PageContentListenerCreateWidget.prototype =
+{
+    notifySuccess: function( /* Page */ page )
+    {
+        jetspeed.testCreatePortletWindows(page.getPortlets());
+    },
+    notifyFailure: function( /* String */ type, /* String */ error, /* Page */ page )
+    {
+        alert( "PageContentListenerCreateWidget notifyFailure type=" + type + " error=" +
error ) ;
+    }
+}
+
+// ... jetspeed.om.PageContentListenerCreateDiv
+jetspeed.om.PageContentListenerCreateDiv = function()
+{
+}
+jetspeed.om.PageContentListenerCreateDiv.prototype =
+{
+    notifySuccess: function( /* Page */ page )
+    {
+        jetspeed.testCreatePortletWindows(page.getPortlets(), new jetspeed.om.PortletDivWindowFactory());
+    },
+    notifyFailure: function( /* String */ type, /* String */ error, /* Page */ page )
+    {
+        alert( "PageContentListenerCreateDiv notifyFailure type=" + type + " error=" + error
) ;
+    }
+}
+
+// ... jetspeed.om.Page
+jetspeed.om.Page = function(pagePsmlPath, pageName, pageTitle)
+{
+    this.psmlPath = pagePsmlPath ;
+    if ( this.psmlPath == null )
+        this.setPsmlPathFromDocumentUrl() ;
+    this.name = pageName ;
+    this.title = pageTitle ;
+    this.portlets = [] ;
+}
+jetspeed.om.Page.prototype =
+{
+    psmlPath: null,
+    name: null,
+    title: null,
+    portlets: null,
+
+    setPsmlPathFromDocumentUrl: function()
+    {
+        var psmlPath = "/jetspeed/ajaxapi" ;
+        var docPath = document.location.pathname ;
+        
+        var contextAndServletPath = "/jetspeed/desktop" ;
+        var contextAndServletPathPos = docPath.indexOf( contextAndServletPath ) ;
+        if ( contextAndServletPathPos != -1 && docPath.length > ( contextAndServletPathPos
+ contextAndServletPath.length ) )
+        {
+            psmlPath = psmlPath + docPath.substring( contextAndServletPathPos + contextAndServletPath.length
) ;
+        }
+        this.psmlPath = psmlPath ;
+    },
+
+    retrievePsml: function( pageContentListener )
+    {
+        var psmlUrl = null ;
+        if ( this.psmlPath == null )
+            this.setPsmlPathFromDocumentUrl() ;
+
+        var psmlUrl = jetspeed.basePortalUrl() + this.psmlPath ;   // BOZO: is it appropriate
to fix the baseUrl as done here?
+
+        if ( djConfig.isDebug )
+            dojo.debug( "psml url: " + psmlUrl ) ;
+
+        var page = this ;  // NOTE: bind calls like this cannot generally be further encapsulated
due to need for a closure
+        dojo.io.bind({     //       (in this case page and pageContentListener locals create
a closure due to their use in load/error functions)
+            url: psmlUrl,
+            load: function(type, data, evt)
+            {
+                //dojo.debug( "r e t r i e v e P s m l . l o a d" ) ;
+                //dojo.debug( "  type:" );
+                //dojo.debugShallow( type ) ;
+                //dojo.debug( "  evt:" );
+                //dojo.debugShallow( evt ) ;
+                page.getPortletsFromPSML(data);
+                if ( pageContentListener && dojo.lang.isFunction( pageContentListener.notifySuccess
) )
+                {
+                    pageContentListener.notifySuccess(page);
+                }
+            },
+            error: function(type, error)
+            {
+                //dojo.debug( "r e t r i e v e P s m l . e r r o r" ) ;
+                //dojo.debug( "  type:" );
+                //dojo.debugShallow( type ) ;
+                //dojo.debug( "  error:" );
+                //dojo.debugShallow( error ) ;
+                if ( pageContentListener && dojo.lang.isFunction( pageContentListener.notifyFailure
) )
+                {
+                    pageContentListener.notifyFailure(type, error, page);
+                }
+            },
+            mimetype: "text/xml"
+        });            
+    },
+
+    getPortletsFromPSML: function(psml)
+    {
+        var lis = psml.getElementsByTagName("fragment");
+        for( var x=0; x < lis.length; x++ )
+        {
+            var fragType = lis[x].getAttribute("type");
+            if ( fragType == "portlet" )
+            {
+                var portletName = lis[x].getAttribute("name");
+                var portletEntityId = lis[x].getAttribute("id");
+                var portlet = new jetspeed.om.Portlet( portletName, portletEntityId ) ;
+
+                var props = lis[x].getElementsByTagName("property");
+                for( var propsIdx=0; propsIdx < props.length; propsIdx++ )
+                {
+                    var propName = props[propsIdx].getAttribute("name") ;
+                    var propValue = props[propsIdx].getAttribute("value") ;
+                    portlet.putProperty( propName, propValue ) ;
+                }
+                this.putPortlet( portlet ) ;
+            }
+        }
+    },
+
+    getPortlets: function()
+    {
+        if (this.portlets)
+            return dojo.lang.shallowCopy(this.portlets) ;
+        return null ;
+    },
+    getPortlet: function( /* String */ portletEntityId )
+    {
+        if (this.portlets && portletEntityId)
+            return this.portlets[portletEntityId];
+        return null;
+    },
+    putPortlet: function( /* Portlet */ portlet )
+    {
+        if (!portlet) return ;
+        if (! this.portlets) this.portlets = [] ;
+        this.portlets[ portlet.entityId ] = portlet ;
+    },
+    removePortlet: function( /* Portlet */ portlet )
+    {
+        if (! portlet || ! this.portlets) return ;
+        delete this.portlets[ portlet.entityId ] ;
+    }
+}
+
+// ... jetspeed.om.PortletContentListener
+jetspeed.om.PortletContentListener = function()
+{
+}
+jetspeed.om.PortletContentListener.prototype =
+{
+    notifySuccess: function( /* String */ portletContent, /* Portlet */ portlet )
+    {
+        portlet.setPortletContent( portletContent );
+    },
+    notifyFailure: function( /* String */ type, /* String */ error, /* Portlet */ portlet
)
+    {
+        alert( "PortletContentListener notifyFailure type=" + type + " error=" + error )
;
+    }
+}
+
+
+// ... jetspeed.om.PortletWidgetWindowFactory
+jetspeed.om.PortletWidgetWindowFactory = function()
+{
+}
+jetspeed.om.PortletWidgetWindowFactory.prototype =
+{
+    create: function( /* Portlet */ portlet )
+    {
+        return new jetspeed.ui.PortletWidgetWindow(portlet);
+    }
+}
+
+// ... jetspeed.om.PortletDivWindowFactory
+jetspeed.om.PortletDivWindowFactory = function()
+{
+}
+jetspeed.om.PortletDivWindowFactory.prototype =
+{
+    create: function( /* Portlet */ portlet )
+    {
+        return new jetspeed.ui.PortletDivWindow(portlet);
+    }
+}
+
+// ... jetspeed.om.Portlet
+jetspeed.om.Portlet = function( /* String */ portletName, /* String */ portletEntityId, /*
String */ portletTitle )
+{
+    this.name = portletName;
+    this.entityId = portletEntityId;
+    if (portletTitle == null && portletName)
+    {
+        var re = (/^[^:]*:*/);
+        portletTitle = portletName.replace( re, "" );
+    }
+    this.title = portletTitle;
+    this.properties = {};
+}
+jetspeed.om.Portlet.prototype =   /* defining prototypes like this is not cool if the object
uses dojo.inherits (this would replace pt)*/
+{                                 /* dojo.lang.extend would allow this syntax instead of
[<type>.prototype.<propname> = <propval>]* */
+    name: null,
+    entityId: null,
+    title: null,
+    
+    windowFactory: null,
+    windowObj: null,
+    
+    createPortletWindow: function(portletWindowFactory, portletContentListener)
+    {
+        if ( portletWindowFactory == null )
+            portletWindowFactory = new jetspeed.om.PortletWidgetWindowFactory() ;
+        
+        this.windowFactory = portletWindowFactory ;
+        this.windowObj = portletWindowFactory.create( this ) ;
+
+        this.retrievePortletContent(portletContentListener) ;
+    },
+
+    getPortletUrl: function()
+    {
+        return jetspeed.basePortalUrl() + "/jetspeed/portlet?entity=" + this.entityId + "&portlet="
+ this.name + "&encoder=desktop";
+    },
+
+    retrievePortletContent: function(portletContentListener)
+    {
+        if ( portletContentListener == null )
+            portletContentListener = new jetspeed.om.PortletContentListener() ;
+
+        var portlet = this ;
+        dojo.io.bind({
+            url: portlet.getPortletUrl(),
+            load: function(type, data, evt)
+            {
+                //dojo.debug( "r e t r i e v e P o r t l e t C o n t e n t . l o a d" ) ;
+                //dojo.debug( "  type:" );
+                //dojo.debugShallow( type ) ;
+                //dojo.debug( "  evt:" );
+                //dojo.debugShallow( evt ) ;
+                if ( portletContentListener && dojo.lang.isFunction( portletContentListener.notifySuccess
) )
+                {
+                    portletContentListener.notifySuccess(data, portlet);
+                }
+            },
+            error: function(type, error)
+            {
+                //dojo.debug( "r e t r i e v e P o r t l e t C o n t e n t . e r r o r" )
;
+                //dojo.debug( "  type:" );
+                //dojo.debugShallow( type ) ;
+                //dojo.debug( "  error:" );
+                //dojo.debugShallow( error ) ;
+                if ( portletContentListener && dojo.lang.isFunction( portletContentListener.notifyFailure
) )
+                {
+                    portletContentListener.notifyFailure(type, error, portlet);
+                }
+            },
+            mimetype: "text/html"
+        });     
+
+    },
+    setPortletContent: function( portletContent )
+    {
+        if ( this.windowObj )
+        {
+            this.windowObj.setPortletContent(portletContent);
+        }
+    },
+
+    putProperty: function(name, value)
+    {
+        this.properties[name] = value;
+    },
+    getProperty: function(name)
+    {
+        return this.properties[name];
+    },
+    removeProperty: function(name)
+    {
+        delete properties[name];
+    }
+}
+
+// ... jetspeed.ui.PortletWidgetWindow
+jetspeed.ui.PortletWidgetWindow = function(/* Portlet */ portletObj)
+{
+    this.portlet = portletObj;
+
+    this.title = portletObj.title;
+    
+    var windowid = portletObj.getProperty("window-id");
+    if ( windowid )
+        this.widgetId = windowid;
+    else
+        this.widgetId = "portletWindow_" + portletObj.entityId ;   // this.incrementNextIndex();
+    this.incrementNextIndex();
+
+    this.blee = "fred" ;
+
+    var windowtheme = portletObj.getProperty("window-theme");
+    if ( windowtheme )
+    {
+        this.portletWindowTheme = windowtheme ;
+        this.templateCssPath = new dojo.uri.Uri(jetspeed.basePortalDesktopUrl(), "jetspeed/javascript/desktop/windowthemes/"
+ windowtheme + "/" + windowtheme + ".css");   // BOZO: improve this junk
+    }
+
+    var windowicon = portletObj.getProperty("window-icon");
+    if ( windowicon )
+        this.iconSrc =  new dojo.uri.Uri(jetspeed.basePortalDesktopUrl(), "jetspeed/javascript/desktop/windowicons/"
+ windowicon ) ;
+    else
+        this.iconSrc =  new dojo.uri.Uri(jetspeed.basePortalDesktopUrl(), "jetspeed/javascript/desktop/windowicons/document.gif"
) ;
+
+    dojo.debug("PortletWidgetWindow  widgetId=" + this.widgetId + "  windowtheme=" + windowtheme
+ "  templateCssPath=" + this.templateCssPath);
+
+
+    this.createWindow();
+}
+jetspeed.ui.PortletWidgetWindow.prototype.title = "Unknown Portlet";
+jetspeed.ui.PortletWidgetWindow.prototype.constrainToContainer = "1";
+jetspeed.ui.PortletWidgetWindow.prototype.contentWrapper = "layout";
+jetspeed.ui.PortletWidgetWindow.prototype.displayCloseAction = true;
+jetspeed.ui.PortletWidgetWindow.prototype.displayMinimizeAction = true;
+jetspeed.ui.PortletWidgetWindow.prototype.displayMaximizeAction = true;
+jetspeed.ui.PortletWidgetWindow.prototype.taskBarId = "jetspeedTaskbar";
+jetspeed.ui.PortletWidgetWindow.prototype.nextIndex = 1;
+jetspeed.ui.PortletWidgetWindow.prototype.titleMouseOver = function(evt)
+{
+    this.titleLight( this ) ;  // NOTE: setup in template HtmlFloatingPane.html: dojoAttachEvent="onMouseOver:titleMouseOver;onMouseOut:titleMouseOut"
+}
+jetspeed.ui.PortletWidgetWindow.prototype.titleLight = function(fpWidget)
+{
+    fpWidget.minimizeAction.style.display = (fpWidget.displayMinimizeAction ? "" : "none");
+    fpWidget.maximizeAction.style.display = (fpWidget.displayMaximizeAction && fpWidget.windowState!="maximized"
? "" : "none");
+    fpWidget.restoreAction.style.display = (fpWidget.displayMaximizeAction && fpWidget.windowState!="normal"
? "" : "none");
+    fpWidget.closeAction.style.display = (fpWidget.displayCloseAction ? "" : "none");
+};
+jetspeed.ui.PortletWidgetWindow.prototype.titleMouseOut = function(evt)
+{
+    this.titleDim( this ) ;   // NOTE: setup in template HtmlFloatingPane.html: dojoAttachEvent="onMouseOver:titleMouseOver;onMouseOut:titleMouseOut"
+}
+jetspeed.ui.PortletWidgetWindow.prototype.titleDim = function(fpWidget)
+{
+    fpWidget.restoreAction.style.display="none";
+    fpWidget.maximizeAction.style.display="none";
+    fpWidget.minimizeAction.style.display="none";
+    fpWidget.closeAction.style.display="none";
+};
+
+jetspeed.ui.PortletWidgetWindow.prototype.incrementNextIndex = function()
+{
+    var nextI = jetspeed.ui.PortletWidgetWindow.prototype.nextIndex;
+    jetspeed.ui.PortletWidgetWindow.prototype.nextIndex++;
+    return nextI;
+}
+jetspeed.ui.PortletWidgetWindow.prototype.getNextIndex = function()
+{
+    return jetspeed.ui.PortletWidgetWindow.prototype.nextIndex;
+}
+jetspeed.ui.PortletWidgetWindow.prototype.createWindow = function()
+{
+    var nWidget = dojo.widget.createWidget('FloatingPane', this);
+
+    nWidget.domNode.id = this.widgetId;  // BOZO: must set the id here - it gets defensively
cleared by dojo
+    if ( this.portletWindowTheme )
+        nWidget.domNode.className = this.portletWindowTheme + " " + nWidget.domNode.className
;
+    nWidget.domNode.style.width = "280px";
+    nWidget.domNode.style.height = "200px";
+    // NOTE: the width/height specified get updated when the size is changed by the user
+    nWidget.domNode.style.left = (((this.getNextIndex() -2) * 30 ) + 100) + "px";
+    nWidget.domNode.style.top = (((this.getNextIndex() -2) * 30 ) + 100) + "px";
+    
+    this.titleDim(nWidget);
+
+    var addToElmt = document.getElementById("jetspeedDesktop");
+    addToElmt.appendChild(nWidget.domNode);
+    
+    //dojo.debug( this.portlet.title + " title-bar css: " + nWidget.titleBar.style.cssText
) ;
+
+    this.windowWidget = nWidget;
+}
+jetspeed.ui.PortletWidgetWindow.prototype.setPortletContent = function(html)
+{
+    if (this.windowWidget)
+        this.windowWidget.setContent(html);
+}
+
+
+// ... jetspeed.ui.PortletDivWindow
+jetspeed.ui.PortletDivWindow = function( /* Portlet */ portletObj )
+{
+	this.portlet = portletObj;
+	this.loaded = false;
+    this.buildPortlet();
+}
+jetspeed.ui.PortletDivWindow.prototype.buildPortlet = function()
+{
+    var self = this;
+	var divPortlet = document.createElement("div");
+    this.portlet_element = divPortlet;
+	divPortlet.className = "portletBody";
+	divPortlet.dataObj = this;
+
+	var divPortletFrame = document.createElement("div");
+	this.child_portletFrame = divPortletFrame;
+	divPortletFrame.className = "portletFrame";
+
+	var divPortletHeader = document.createElement("div");
+	this.child_portletHeader = divPortletHeader;
+	divPortletHeader.className = "portletHeader";
+	
+	divPortletHeader.onmouseover = function(){
+		self.highlight();
+	}
+	divPortletHeader.onmouseout = function(){
+		self.unHighlight();
+	}
+
+	var divShowHide = document.createElement("div");
+	this.child_showHide = divShowHide;
+	divShowHide.className = "showHide";
+	divShowHide.innerHTML = (this.portlet.status==0) ? '<img src="/jetspeed/themes/blue/images/showMod.gif"/>'
: '<img src="/jetspeed/themes/blue/images/hideMod.gif"/>';
+	divShowHide.style.visibility = "hidden";		
+    dojo.event.connect( divShowHide, "onmousedown", showHide ) ;
+
+	var divTitle = document.createElement("div");
+	this.child_title = divTitle;
+	divTitle.className = "title";
+	divTitle.appendChild(document.createTextNode(this.portlet.name));
+
+	var divClose = document.createElement("div");
+	this.child_close = divClose;
+	divClose.className = "close";
+	divClose.innerHTML = '<img src="/jetspeed/themes/blue/images/closeMod.gif"/>';
+	divClose.style.display = "none";
+    dojo.event.connect( divClose, "onmousedown", close ) ;
+	
+	var divEditContent = document.createElement("div");
+	this.child_editContent = divEditContent;
+	divEditContent.className = "editContent";
+
+	var divPortletContent = document.createElement("div");
+	this.child_moduleContent = divPortletContent;
+	divPortletContent.className = "moduleContent";
+	divPortletContent.innerHTML = "Loading ...";
+	if (this.portlet.status==0) divPortletContent.style.display = "none";
+
+	divPortletHeader.appendChild(divShowHide);
+	divPortletHeader.appendChild(divClose);
+	divPortletHeader.appendChild(divTitle);
+
+	divPortletFrame.appendChild(divPortletHeader);
+	divPortletFrame.appendChild(divEditContent);
+	divPortletFrame.appendChild(divPortletContent);
+
+	divPortlet.appendChild(divPortletFrame);
+
+	function showHide(e) {
+		e.cancelBubble = true;
+		self.showHideModule();
+	}
+	function close(e) {
+		e.cancelBubble = true;
+		self.close();
+		delete self;
+	}
+	
+    var addtoElmt = document.getElementById( "jetspeedDesktop" ) ;
+    addtoElmt.appendChild(divPortlet);
+
+    var dragSource = new dojo.dnd.HtmlDragMoveSource(divPortlet) ;
+    dragSource.setDragHandle( divPortletHeader ) ;
+    
+    //Drag.init(divPortletHeader, divPortlet);
+    
+}
+jetspeed.ui.PortletDivWindow.prototype.setPortletContent = function( html )
+{
+    this.child_moduleContent.innerHTML = html ;
+}
+jetspeed.ui.PortletDivWindow.prototype.highlight = function() {
+    this.child_showHide.style.visibility = "visible";
+    this.child_close.style.display = "block";
+}
+jetspeed.ui.PortletDivWindow.prototype.unHighlight = function() {
+    this.child_portletFrame.style.border = "1px solid #79A7E2";
+    this.child_showHide.style.visibility = "hidden";
+    this.child_close.style.display = "none";
+}
+jetspeed.ui.PortletDivWindow.prototype.showHideModule = function() {
+	if (arguments[0] != undefined) {
+		arguments[0] ? this.show() : this.hide();
+	} else {
+		this.child_moduleContent.style.display=='none' ? this.show() : this.hide();
+	}
+}
+jetspeed.ui.PortletDivWindow.prototype.close = function()
+{
+    this.portlet_element.parentNode.removeChild(this.portlet_element);
+}
+jetspeed.ui.PortletDivWindow.prototype.show = function()
+{
+	this.child_moduleContent.style.display = 'block';
+	this.child_showHide.firstChild.setAttribute("src", "/jetspeed/themes/blue/images/hideMod.gif");
+	this.portlet.status = 1;
+}
+jetspeed.ui.PortletDivWindow.prototype.hide = function()
+{
+	this.child_moduleContent.style.display = 'none';
+	this.child_showHide.firstChild.setAttribute("src", "/jetspeed/themes/blue/images/showMod.gif");
+	this.child_editContent.style.display = "none";
+	this.portlet.status = 0;
+}
+



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