portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1074425 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet: DetailsPanel.java ParameterPanel.java
Date Fri, 25 Feb 2011 07:51:00 GMT
Author: taylor
Date: Fri Feb 25 07:51:00 2011
New Revision: 1074425

URL: http://svn.apache.org/viewvc?rev=1074425&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-1232
Portlet Instances feature implemented with tests. Note I had to rename this feature Portlet
Clones since the concept of Portlet Instances is used (albeit at a low level) all over the
codebase. This commit is considered Phase 1 of 2, and includes the core implementation, as
well as basic integration into j2-admin PAM, and the Jetspeed Toolbox search. Phase II will
encompass improving the PAM and Toolbox to further support administration of clones. This
commit introduces an new column CLONE_PARENT to the PORTLET_DEFINITION table. Schema change
requirements will be documented in release notes and migration docs.


Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/DetailsPanel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/ParameterPanel.java

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/DetailsPanel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/DetailsPanel.java?rev=1074425&r1=1074424&r2=1074425&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/DetailsPanel.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/DetailsPanel.java
Fri Feb 25 07:51:00 2011
@@ -22,7 +22,6 @@ import java.util.List;
 import java.util.Locale;
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.components.portletregistry.FailedToStorePortletDefinitionException;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
 import org.apache.jetspeed.components.portletregistry.RegistryException;
@@ -36,7 +35,6 @@ import org.apache.jetspeed.portlets.prm.
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
 import org.apache.jetspeed.portlets.wicket.component.JavascriptEventConfirmation;
 import org.apache.jetspeed.portlets.wicket.component.editor.LocalizedDisplayNameEditor;
-import org.apache.jetspeed.search.SearchEngine;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.form.Button;
 import org.apache.wicket.markup.html.form.Form;
@@ -71,7 +69,7 @@ public class DetailsPanel extends Panel
         PortletApplication app = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry().getPortletApplication(this.paNodeBean.getApplicationName());
         PortletDefinition definition = app.getPortlet(this.paNodeBean.getName());
         setExpirationCache(new Integer(definition.getExpirationCache()));
-        
+
         Form form = new Form("form");
         form.add(new TextField<Integer>("expirationCache", new PropertyModel<Integer>(this,
"expirationCache")));
         form.add(new Label("uniqueName", definition.getUniqueName()));
@@ -89,7 +87,6 @@ public class DetailsPanel extends Panel
                 PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                 PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                 PortletDefinition def = app.getPortlet(paNodeBean.getName());
-
                 List<DisplayNameBean> list = new LinkedList<DisplayNameBean>();
 
                 for (DisplayName displayName : def.getDisplayNames())
@@ -295,9 +292,7 @@ public class DetailsPanel extends Panel
                             PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                             PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                             PortletDefinition def = app.getPortlet(paNodeBean.getName());
-                            registry.clonePortletDefinition(def, cloneName);
-                            updateSearchEngine(true, app); // TODO: move this into registry
api?                            
-                            updateSearchEngine(false, app); // TODO: move this into registry
api?                            
+                            PortletDefinition clone = registry.clonePortletDefinition(def,
cloneName);
                             StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.cloneOK",
this, null, new Object [] { paNodeBean.getName() } );
                             feed.info(resModel.getString());
                         }
@@ -325,27 +320,8 @@ public class DetailsPanel extends Panel
         public void setCloneName(String name)
         {
             this.cloneName = name;
-        }
-        
-    }
-    
-    protected void updateSearchEngine(boolean remove, PortletApplication pa)
-    {
-        SearchEngine searchEngine = (SearchEngine) Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.search.SearchEngine");
-        if (searchEngine != null)
-        {
-            if (remove)
-            {
-                searchEngine.remove(pa);
-                searchEngine.remove(pa.getPortlets());
-            }
-            else
-            {
-                searchEngine.add(pa);
-                searchEngine.add(pa.getPortlets());
-            }
-        }
+        }        
     }
-    
+        
     
 }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/ParameterPanel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/ParameterPanel.java?rev=1074425&r1=1074424&r2=1074425&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/ParameterPanel.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/ParameterPanel.java
Fri Feb 25 07:51:00 2011
@@ -123,7 +123,6 @@ public class ParameterPanel extends Edit
                         PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                         PortletDefinition def = app.getPortlet(paNodeBean.getName());
-                        
                         if (newLocale != null && newDescription != null)
                         {
                             InitParam param = def.getInitParam(initParam.getParamName());
@@ -260,6 +259,8 @@ public class ParameterPanel extends Edit
         PortletRegistry registry = locator.getPortletRegistry();
         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
         PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        if (def == null)
+            def = app.getClone(paNodeBean.getName()); // TODO: support clones here?
         
         List<IModel<InitParam>> initParamBeanModels = new ArrayList<IModel<InitParam>>();
         



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