portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r921928 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main: resources/org/apache/jetspeed/portlets/spaces/resources/ webapp/WEB-INF/view/spaces/
Date Thu, 11 Mar 2010 16:42:53 GMT
Author: woonsan
Date: Thu Mar 11 16:42:52 2010
New Revision: 921928

URL: http://svn.apache.org/viewvc?rev=921928&view=rev
Log:
JS2-1057: Allowing to change url of link in page navigator.

Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources_en.properties
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources_ko.properties
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties?rev=921928&r1=921927&r2=921928&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
Thu Mar 11 16:42:52 2010
@@ -32,6 +32,7 @@ spaces.label.cancel = Cancel
 
 spaces.pages.label.add = Add Page
 spaces.pages.label.rename = Rename
+spaces.pages.label.changeUrl = Change URL
 spaces.pages.label.delete = Delete
 spaces.pages.label.move = Move
 spaces.pages.label.copy = Copy
@@ -40,6 +41,8 @@ spaces.pages.label.template = Template
 spaces.pages.label.close = Close
 spaces.pages.label.ok = OK
 spaces.pages.label.cancel = Cancel
+spaces.pages.message.prompt.title = Please enter the title.
+spaces.pages.message.prompt.url = Please enter the URL.
 spaces.pages.message.confirm.delete = Are you sure to delete this item?
 spaces.pages.message.confirm.choosefolder = Choose a target folder.
 spaces.pages.message.confirm.move = Are you sure to move this item?

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources_en.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources_en.properties?rev=921928&r1=921927&r2=921928&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources_en.properties
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources_en.properties
Thu Mar 11 16:42:52 2010
@@ -32,6 +32,7 @@ spaces.label.cancel = Cancel
 
 spaces.pages.label.add = Add Page
 spaces.pages.label.rename = Rename
+spaces.pages.label.changeUrl = Change URL
 spaces.pages.label.delete = Delete
 spaces.pages.label.move = Move
 spaces.pages.label.copy = Copy
@@ -40,6 +41,8 @@ spaces.pages.label.template = Template
 spaces.pages.label.close = Close
 spaces.pages.label.ok = OK
 spaces.pages.label.cancel = Cancel
+spaces.pages.message.prompt.title = Please enter the title.
+spaces.pages.message.prompt.url = Please enter the URL.
 spaces.pages.message.confirm.delete = Are you sure to delete this item?
 spaces.pages.message.confirm.choosefolder = Choose a target folder.
 spaces.pages.message.confirm.move = Are you sure to move this item?

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources_ko.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources_ko.properties?rev=921928&r1=921927&r2=921928&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources_ko.properties
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources_ko.properties
Thu Mar 11 16:42:52 2010
@@ -32,6 +32,7 @@ spaces.label.cancel = \ucde8\uc18c
 
 spaces.pages.label.add = \ud398\uc774\uc9c0 \ucd94\uac00
 spaces.pages.label.rename = \uc774\ub984\ubc14\uafb8\uae30
+spaces.pages.label.changeUrl = URL \ubcc0\uacbd
 spaces.pages.label.delete = \uc0ad\uc81c
 spaces.pages.label.move = \uc774\ub3d9
 spaces.pages.label.copy = \ubcf5\uc0ac
@@ -40,6 +41,8 @@ spaces.pages.label.template = \ud15c\ud5
 spaces.pages.label.close = \ub2eb\uae30
 spaces.pages.label.ok = \ud655\uc778
 spaces.pages.label.cancel = \ucde8\uc18c
+spaces.pages.message.prompt.title = \ud0c0\uc774\ud2c0\uc744 \uc785\ub825\ud558\uc2ed\uc2dc\uc624.
+spaces.pages.message.prompt.url = URL\uc744 \uc785\ub825\ud558\uc2ed\uc2dc\uc624.
 spaces.pages.message.confirm.delete = \uc774 \ud56d\ubaa9\uc744 \uc0ad\uc81c\ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?
 spaces.pages.message.confirm.choosefolder = \ub300\uc0c1 \ud3f4\ub354\ub97c \uc120\ud0dd\ud558\uc2ed\uc2dc\uc624.
 spaces.pages.message.confirm.move = \uc774 \ud56d\ubaa9\uc744 \uc774\ub3d9\ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp?rev=921928&r1=921927&r2=921928&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/page-navigator.jsp
Thu Mar 11 16:42:52 2010
@@ -195,6 +195,7 @@ for (MenuElement element : linkElements)
             <div class="yui-menu-content">
               <ul>
                 <li class="yui-menuitem"><a id="<portlet:namespace/>nodePopupMenu_rename"
class="yui-menuitem-content" href="#"><fmt:message key='spaces.pages.label.rename'/></a></li>
+                <li class="yui-menuitem"><a id="<portlet:namespace/>nodePopupMenu_changeUrl"
class="yui-menuitem-content" href="#"><fmt:message key='spaces.pages.label.changeUrl'/></a></li>
                 <li class="yui-menuitem"><a id="<portlet:namespace/>nodePopupMenu_delete"
class="yui-menuitem-content" href="#"><fmt:message key='spaces.pages.label.delete'/></a></li>
                 <li class="yui-menuitem"><a id="<portlet:namespace/>nodePopupMenu_move"
class="yui-menuitem-content" href="#"><fmt:message key='spaces.pages.label.move'/></a></li>
                 <li class="yui-menuitem"><a id="<portlet:namespace/>nodePopupMenu_copy"
class="yui-menuitem-content" href="#"><fmt:message key='spaces.pages.label.copy'/></a></li>
@@ -254,7 +255,7 @@ YUI().use('jetui-portal', 'io', 'json', 
 	        e.halt();
         }
     };
-
+    
     var nodePopupMenu = null;
     var curNodeListItem = null;
     
@@ -266,6 +267,8 @@ YUI().use('jetui-portal', 'io', 'json', 
         }
         var li = e.target;
         if ("true" == li.getAttribute("editable")) {
+            var nodeType = li.getAttribute("nodeType");
+            Y.Node.one("#<portlet:namespace/>nodePopupMenu_changeUrl").setStyle("display",
".link" == nodeType ? "" : "none");
             var liElem = Y.Node.getDOMNode(li);
             var xy = li.getXY();
             nodePopupMenu.setStyle("display", "block");
@@ -275,7 +278,7 @@ YUI().use('jetui-portal', 'io', 'json', 
         }
         e.halt();
     };
-
+    
     var onRenameComplete = function(id, o, args) {
         var id = id; // Transaction ID. 
         var data = o.responseText;
@@ -307,7 +310,7 @@ YUI().use('jetui-portal', 'io', 'json', 
     	var path = curNodeListItem.getAttribute("path");
         var nodeType = curNodeListItem.getAttribute("nodeType");
         var currentTitle = curNodeListItem.one("A").get("text");
-        var title = prompt("Please enter the title.", currentTitle);
+        var title = prompt("<fmt:message key='spaces.pages.message.prompt.title'/>",
currentTitle);
         if (title && title != currentTitle) {
             var uri = "<%=contextPath%>/services/pagemanagement/info/" + nodeType +
path + "?_type=json";
             var config = {
@@ -320,7 +323,7 @@ YUI().use('jetui-portal', 'io', 'json', 
         }
         e.halt();
     };
-
+    
     var onDeleteComplete = function(id, o, args) {
         var listItem = args.complete[0];
         if (listItem) {
@@ -481,6 +484,51 @@ YUI().use('jetui-portal', 'io', 'json', 
         }
         e.halt();
     };
+    
+    var onChangeUrlComplete = function(id, o, args) {
+        var id = id; // Transaction ID. 
+        var data = o.responseText;
+        var dataOut = null;
+        
+        try {
+            dataOut = Y.JSON.parse(data);
+            if (!dataOut) {
+                Y.log("Error: no data found.");
+                return;
+            }
+        } catch (e) {
+            Y.log("Error: " + e.message);
+            return;
+        }
+        
+        var listItem = args.complete[0];
+        var url = args.complete[1]; 
+        var urlElem = listItem.one("A");
+        if (urlElem && url) {
+            urlElem.set("href", url);
+        }
+    };
+    
+    var onChangeUrlClick = function(e) {
+        if (!curNodeListItem) {
+            return;
+        }
+        var path = curNodeListItem.getAttribute("path");
+        var nodeType = curNodeListItem.getAttribute("nodeType");
+        var currentUrl = curNodeListItem.one("A").get("href");
+        var url = prompt("<fmt:message key='spaces.pages.message.prompt.url'/>", currentUrl);
+        if (url && url != currentUrl) {
+            var uri = "<%=contextPath%>/services/pagemanagement/info/" + nodeType +
path + "?_type=json";
+            var config = {
+                    on: { complete: onChangeUrlComplete },
+                    method: "POST",
+                    data: "url=" + url,
+                    arguments: { complete: [ curNodeListItem, url ] }
+                };
+            var request = Y.io(uri, config);
+        }
+        e.halt();
+    };
 
     var menuItemEventHandles = [];
     var resetMenuItemEventHandlers = function() {
@@ -516,6 +564,8 @@ YUI().use('jetui-portal', 'io', 'json', 
         Y.Node.one("#<portlet:namespace/>nodePopupMenu_move").on("click", onMoveClick);
         Y.detach("click", onCopyClick, "#<portlet:namespace/>nodePopupMenu_copy");
         Y.Node.one("#<portlet:namespace/>nodePopupMenu_copy").on("click", onCopyClick);
+        Y.detach("click", onChangeUrlClick, "#<portlet:namespace/>nodePopupMenu_changeUrl");
+        Y.Node.one("#<portlet:namespace/>nodePopupMenu_changeUrl").on("click", onChangeUrlClick);
     };
     
     var modalPanelEventHandles = [];



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