portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r1089672 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main: java/org/apache/jetspeed/portlets/prm/ resources/org/apache/jetspeed/portlets/prm/ webapp/WEB-INF/ webapp/WEB-INF/view/prm/
Date Wed, 06 Apr 2011 23:27:39 GMT
Author: woonsan
Date: Wed Apr  6 23:27:39 2011
New Revision: 1089672

URL: http://svn.apache.org/viewvc?rev=1089672&view=rev
Log:
JS2-1247: Adding portlet clone creator portlet and show it in ajax popup

Added:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/prm/
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/prm/portlet-clone-manager-view.jsp
Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/ApplicationsListHome.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/prm/ApplicationsListHome.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/ApplicationsListHome.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/ApplicationsListHome.java?rev=1089672&r1=1089671&r2=1089672&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/ApplicationsListHome.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/ApplicationsListHome.java
Wed Apr  6 23:27:39 2011
@@ -28,11 +28,16 @@ import org.apache.jetspeed.portlets.Jets
 import org.apache.jetspeed.portlets.prm.ApplicationDataProvider.AppOrderBy;
 import org.apache.jetspeed.portlets.prm.PortletDataProvider.PortletOrderBy;
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
+import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.tools.pamanager.PortletApplicationManagement;
 import org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManager;
 import org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManagerResult;
 import org.apache.portals.messaging.PortletMessaging;
+import org.apache.wicket.Page;
 import org.apache.wicket.ResourceReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
 import org.apache.wicket.extensions.markup.html.repeater.data.sort.OrderByBorder;
 import org.apache.wicket.extensions.markup.html.repeater.data.sort.OrderByLink;
 import org.apache.wicket.extensions.markup.html.repeater.data.sort.OrderByLink.VoidCssProvider;
@@ -44,6 +49,7 @@ import org.apache.wicket.markup.html.for
 import org.apache.wicket.markup.html.image.Image;
 import org.apache.wicket.markup.html.link.Link;
 import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;
+import org.apache.wicket.markup.html.pages.RedirectPage;
 import org.apache.wicket.markup.html.panel.FeedbackPanel;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.markup.repeater.Item;
@@ -273,6 +279,9 @@ public class ApplicationsListHome extend
 
         add(portletListView);
         add(new PagingNavigator("plNavigator", portletListView));
+        
+        ModalWindow modalWindow = new ModalWindow("modalwindow");
+        add(modalWindow);
     }
 
     class RunningPanel extends Panel
@@ -593,11 +602,11 @@ public class ApplicationsListHome extend
         {
             super(id, model);
             
-            Link<String> clone = new Link<String>("clone")
+            AjaxLink<String> clone = new AjaxLink<String>("clone")
             {
                 private static final long serialVersionUID = 1L;
 
-                public void onClick()
+                public void onClick(AjaxRequestTarget target)
                 {
                     PortletDefinitionBean pdb = (PortletDefinitionBean) model.getObject();
                     FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
@@ -607,7 +616,20 @@ public class ApplicationsListHome extend
                         JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
                         PortletRegistry registry = locator.getPortletRegistry();
                         PortletDefinition def = registry.getPortletDefinitionByUniqueName(pdb.getUniqueName());
-                        // TODO: pop up window to clone a portlet
+
+                        ModalWindow modalWindow = (ModalWindow) getPage().get("modalwindow");
+                        RequestContext rc = ((AbstractAdminWebApplication) getApplication()).getPortalRequestContext();
+                        final String pagePath = rc.getPortalURL().getBasePath() + "/system/prm/cloneportlet.psml?portlet="
+ def.getUniqueName();
+                        modalWindow.setPageCreator(new ModalWindow.PageCreator() 
+                        {
+                            private static final long serialVersionUID = 1L;
+
+                            public Page createPage()
+                            {
+                                return new RedirectPage(pagePath);
+                            }
+                        });
+                        modalWindow.show(target);
                     }
                     catch (Exception e) 
                     {

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/prm/ApplicationsListHome.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/prm/ApplicationsListHome.html?rev=1089672&r1=1089671&r2=1089672&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/prm/ApplicationsListHome.html
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/prm/ApplicationsListHome.html
Wed Apr  6 23:27:39 2011
@@ -93,5 +93,8 @@
 		<td colspan="3"><span wicket:id="plNavigator">[dataview navigator]</span></td>
 	</tr>
 </table>
+
+<div wicket:id="modalwindow"></div>
+
 </body>
 </html>
\ No newline at end of file

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml?rev=1089672&r1=1089671&r2=1089672&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/portlet.xml Wed
Apr  6 23:27:39 2011
@@ -2701,6 +2701,30 @@
     </portlet-preferences>
   </portlet>
   
+  <portlet id="PortletCloneManager">
+    <description>Create Portlet Clone</description>
+    <portlet-name>PortletCloneManager</portlet-name>
+    <display-name>Portlet Clone Manager</display-name>
+    <portlet-class>org.apache.portals.bridges.common.GenericServletPortlet</portlet-class>
+    <init-param>
+      <name>ViewPage</name>
+      <value>/WEB-INF/view/prm/portlet-clone-manager-view.jsp</value>
+    </init-param>
+    <expiration-cache>0</expiration-cache>
+    <supports>
+      <mime-type>text/html</mime-type>
+      <portlet-mode>VIEW</portlet-mode>
+    </supports>
+    <supported-locale>en</supported-locale>
+    <supported-locale>ja</supported-locale>
+    <resource-bundle>org.apache.jetspeed.portlets.prm.resources.PRMResources</resource-bundle>
+    <portlet-info>
+      <title>Create Portlet Clone</title>
+      <short-title>Portlet Clone Manager</short-title>
+      <keywords>clone,portlet,management,admin</keywords>
+    </portlet-info>
+  </portlet>
+  
   <custom-portlet-mode>
     <description>Custom About Mode</description>
     <portlet-mode>about</portlet-mode>

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/prm/portlet-clone-manager-view.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/prm/portlet-clone-manager-view.jsp?rev=1089672&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/prm/portlet-clone-manager-view.jsp
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/prm/portlet-clone-manager-view.jsp
Wed Apr  6 23:27:39 2011
@@ -0,0 +1,30 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+--%>
+<%@page import="java.util.List"%>
+<%@page import="org.apache.jetspeed.page.document.Node"%>
+<%@page import="org.apache.jetspeed.portlets.spaces.BreadcrumbMenu.BreadcrumbMenuItem"
%>
+<%@ page contentType="text/html" %>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<portlet:defineObjects/>
+<fmt:setBundle basename="org.apache.jetspeed.portlets.prm.resources.PRMResources" />
+
+<h2>Portlet Clone Manager</h2>
+<hr/>
+TODO
\ No newline at end of file



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