portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r1088876 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets: prm/ prm/model/ prm/portlet/ selector/ util/
Date Tue, 05 Apr 2011 03:43:41 GMT
Author: woonsan
Date: Tue Apr  5 03:43:41 2011
New Revision: 1088876

URL: http://svn.apache.org/viewvc?rev=1088876&view=rev
Log:
JS2-1247: Retrieve portlet definition from clones when no original portlet def is found.

Added:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/util/
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/util/PortletApplicationUtils.java
Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/MetadataPanel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/DescriptionBeanModel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/DisplayNameBeanModel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/InitParamModel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/LanguageBeanModel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/LocalizedFieldBeanModel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/PreferenceModel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/SecurityRoleRefModel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/SupportsModel.java
    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/LanguagesPanel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/ParameterPanel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/PreferencePanel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/SecurityPanel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/SupportsPanel.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/selector/CategoryPortletSelector.java

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/MetadataPanel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/MetadataPanel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/MetadataPanel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/MetadataPanel.java Tue Apr  5 03:43:41 2011
@@ -28,6 +28,7 @@ import org.apache.jetspeed.om.portlet.Po
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.model.LocalizedFieldBeanModel;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
 import org.apache.jetspeed.portlets.wicket.component.editor.EditorTemplate;
 import org.apache.wicket.markup.html.form.Button;
@@ -72,7 +73,7 @@ public class MetadataPanel extends Edito
                     
                     if (paNodeBean.getName() != null)
                     {
-                        def = app.getPortlet(paNodeBean.getName());
+                        def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                     }
                     
                     if (newName != null && newValue != null && newLocale != null)
@@ -138,7 +139,7 @@ public class MetadataPanel extends Edito
         
         if (paNodeBean.getName() != null)
         {
-            def = app.getPortlet(paNodeBean.getName());
+            def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         }
         
         GenericMetadata metadata = (def == null ? app.getMetadata() : def.getMetadata());
@@ -183,7 +184,7 @@ public class MetadataPanel extends Edito
         
         if (paNodeBean.getName() != null)
         {
-            def = app.getPortlet(paNodeBean.getName());
+            def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         }
         
         List<IModel<LocalizedFieldBean>> list = new ArrayList<IModel<LocalizedFieldBean>>();

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/DescriptionBeanModel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/DescriptionBeanModel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/DescriptionBeanModel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/DescriptionBeanModel.java Tue Apr  5 03:43:41 2011
@@ -27,6 +27,7 @@ import org.apache.jetspeed.om.portlet.Us
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.DescriptionBean;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.wicket.model.LoadableDetachableModel;
 
 public class DescriptionBeanModel extends LoadableDetachableModel<DescriptionBean>
@@ -58,7 +59,7 @@ public class DescriptionBeanModel extend
         
         if (paNodeBean.getName() != null)
         {
-            def = app.getPortlet(paNodeBean.getName());
+            def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         }
         
         if (def != null)

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/DisplayNameBeanModel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/DisplayNameBeanModel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/DisplayNameBeanModel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/DisplayNameBeanModel.java Tue Apr  5 03:43:41 2011
@@ -24,6 +24,7 @@ import org.apache.jetspeed.om.portlet.Po
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.DisplayNameBean;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.wicket.model.LoadableDetachableModel;
 
 public class DisplayNameBeanModel extends LoadableDetachableModel<DisplayNameBean>
@@ -47,7 +48,7 @@ public class DisplayNameBeanModel extend
     protected DisplayNameBean load()
     {
         PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         DisplayName displayName = def.getDisplayName(locale);
         return new DisplayNameBean(displayName);
     }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/InitParamModel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/InitParamModel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/InitParamModel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/InitParamModel.java Tue Apr  5 03:43:41 2011
@@ -21,6 +21,7 @@ import org.apache.jetspeed.om.portlet.Po
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.wicket.model.LoadableDetachableModel;
 
 public class InitParamModel extends LoadableDetachableModel<InitParam>
@@ -43,7 +44,7 @@ public class InitParamModel extends Load
     protected InitParam load()
     {
         PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         InitParam initParam = def.getInitParam(paramName);
         return initParam;
     }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/LanguageBeanModel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/LanguageBeanModel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/LanguageBeanModel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/LanguageBeanModel.java Tue Apr  5 03:43:41 2011
@@ -24,6 +24,7 @@ import org.apache.jetspeed.om.portlet.Po
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.LanguageBean;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.wicket.model.LoadableDetachableModel;
 
 public class LanguageBeanModel extends LoadableDetachableModel<LanguageBean>
@@ -46,7 +47,7 @@ public class LanguageBeanModel extends L
     protected LanguageBean load()
     {
         PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         Language language = def.getLanguage(locale);
         return new LanguageBean(language);
     }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/LocalizedFieldBeanModel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/LocalizedFieldBeanModel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/LocalizedFieldBeanModel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/LocalizedFieldBeanModel.java Tue Apr  5 03:43:41 2011
@@ -23,6 +23,7 @@ import org.apache.jetspeed.om.portlet.Po
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.LocalizedFieldBean;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.wicket.model.LoadableDetachableModel;
 
 public class LocalizedFieldBeanModel extends LoadableDetachableModel<LocalizedFieldBean>
@@ -52,7 +53,7 @@ public class LocalizedFieldBeanModel ext
         
         if (paNodeBean.getName() != null)
         {
-            def = app.getPortlet(paNodeBean.getName());
+            def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         }
 
         GenericMetadata metadata = (def == null ? app.getMetadata() : def.getMetadata());

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/PreferenceModel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/PreferenceModel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/PreferenceModel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/PreferenceModel.java Tue Apr  5 03:43:41 2011
@@ -20,6 +20,7 @@ import org.apache.jetspeed.om.portlet.Po
 import org.apache.jetspeed.om.portlet.Preference;
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.pluto.container.om.portlet.PortletDefinition;
 import org.apache.wicket.model.LoadableDetachableModel;
 
@@ -44,7 +45,7 @@ public class PreferenceModel extends Loa
     protected Preference load()
     {
         PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         Preference preference = (Preference) def.getPortletPreferences().getPortletPreference(name);
         return preference;
     }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/SecurityRoleRefModel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/SecurityRoleRefModel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/SecurityRoleRefModel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/SecurityRoleRefModel.java Tue Apr  5 03:43:41 2011
@@ -21,6 +21,7 @@ import org.apache.jetspeed.om.portlet.Po
 import org.apache.jetspeed.om.portlet.SecurityRoleRef;
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.wicket.model.LoadableDetachableModel;
 
 public class SecurityRoleRefModel extends LoadableDetachableModel<SecurityRoleRef>
@@ -43,7 +44,7 @@ public class SecurityRoleRefModel extend
     protected SecurityRoleRef load()
     {
         PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         SecurityRoleRef securityRoleRef = def.getSecurityRoleRef(roleName);
         return securityRoleRef;
     }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/SupportsModel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/SupportsModel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/SupportsModel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/model/SupportsModel.java Tue Apr  5 03:43:41 2011
@@ -21,6 +21,7 @@ import org.apache.jetspeed.om.portlet.Po
 import org.apache.jetspeed.om.portlet.Supports;
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.wicket.model.LoadableDetachableModel;
 
 public class SupportsModel extends LoadableDetachableModel<Supports>
@@ -44,7 +45,7 @@ public class SupportsModel extends Loada
     protected Supports load()
     {
         PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         Supports supports = def.getSupports(mimeType);
         return supports;
     }

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=1088876&r1=1088875&r2=1088876&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 Tue Apr  5 03:43:41 2011
@@ -32,6 +32,7 @@ import org.apache.jetspeed.om.portlet.Po
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.DisplayNameBean;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
 import org.apache.jetspeed.portlets.wicket.component.JavascriptEventConfirmation;
 import org.apache.jetspeed.portlets.wicket.component.editor.LocalizedDisplayNameEditor;
@@ -67,7 +68,7 @@ public class DetailsPanel extends Panel
         this.paNodeBean = paNodeBeanParam;
         
         PortletApplication app = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry().getPortletApplication(this.paNodeBean.getApplicationName());
-        PortletDefinition definition = app.getPortlet(this.paNodeBean.getName());
+        PortletDefinition definition = PortletApplicationUtils.getPortletOrClone(app, this.paNodeBean.getName());
         setExpirationCache(new Integer(definition.getExpirationCache()));
 
         Form form = new Form("form");
@@ -86,7 +87,7 @@ public class DetailsPanel extends Panel
             {
                 PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                 PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                 List<DisplayNameBean> list = new LinkedList<DisplayNameBean>();
 
                 for (DisplayName displayName : def.getDisplayNames())
@@ -106,7 +107,7 @@ public class DetailsPanel extends Panel
                 {
                     PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                     PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                     
                     for (Iterator<DisplayName> it = def.getDisplayNames().iterator(); it.hasNext(); )
                     {
@@ -145,7 +146,7 @@ public class DetailsPanel extends Panel
                     {
                         PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                         
                         if (newLocale != null && newDisplayName != null)
                         {
@@ -203,7 +204,7 @@ public class DetailsPanel extends Panel
                 {
                     PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                     PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                     def.setExpirationCache(getExpirationCache().intValue());
                     registry.savePortletDefinition(def);
                     StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveOK", this, null, new Object [] { paNodeBean.getName() } );
@@ -231,7 +232,7 @@ public class DetailsPanel extends Panel
                 {
                     PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                     PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                     PortletFactory factory = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletFactory();
                     factory.reloadResourceBundles(def);
                 }
@@ -291,7 +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());
+                            PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                             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());

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/LanguagesPanel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/LanguagesPanel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/LanguagesPanel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/LanguagesPanel.java Tue Apr  5 03:43:41 2011
@@ -30,6 +30,7 @@ import org.apache.jetspeed.portlets.Jets
 import org.apache.jetspeed.portlets.prm.LanguageBean;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
 import org.apache.jetspeed.portlets.prm.model.LanguageBeanModel;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
 import org.apache.jetspeed.portlets.wicket.component.editor.EditorTemplate;
 import org.apache.wicket.markup.html.form.Button;
@@ -74,7 +75,7 @@ public class LanguagesPanel extends Edit
                 {
                     PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                     PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                     
                     if (newTitle != null && newShortTitle != null && newKeywords != null && newLocale != null)
                     {
@@ -134,7 +135,7 @@ public class LanguagesPanel extends Edit
     {
         PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         
         for (Iterator<Language> it = def.getLanguages().iterator(); it.hasNext(); )
         {
@@ -171,7 +172,7 @@ public class LanguagesPanel extends Edit
     {
         JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
         PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         List<IModel<LanguageBean>> list = new LinkedList<IModel<LanguageBean>>();
         
         for (Language field : def.getLanguages())

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=1088876&r1=1088875&r2=1088876&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 Tue Apr  5 03:43:41 2011
@@ -32,6 +32,7 @@ import org.apache.jetspeed.portlets.Jets
 import org.apache.jetspeed.portlets.prm.DescriptionBean;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
 import org.apache.jetspeed.portlets.prm.model.InitParamModel;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
 import org.apache.jetspeed.portlets.wicket.component.editor.EditorTemplate;
 import org.apache.jetspeed.portlets.wicket.component.editor.LocalizedDescriptionEditor;
@@ -97,7 +98,7 @@ public class ParameterPanel extends Edit
             {
                 PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                 PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
 
                 final InitParam param = def.getInitParam(initParam.getParamName());
 
@@ -122,7 +123,7 @@ public class ParameterPanel extends Edit
                     {
                         PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                         if (newLocale != null && newDescription != null)
                         {
                             InitParam param = def.getInitParam(initParam.getParamName());
@@ -176,7 +177,7 @@ public class ParameterPanel extends Edit
                 {
                     PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                     PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                     InitParam initParam = def.getInitParam(name);
                     
                     if (initParam != null)
@@ -217,7 +218,7 @@ public class ParameterPanel extends Edit
     {
         PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
 
         Iterator<InitParam> it = def.getInitParams().iterator();
         while (it.hasNext())
@@ -258,7 +259,7 @@ public class ParameterPanel extends Edit
         JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
         PortletRegistry registry = locator.getPortletRegistry();
         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         if (def == null)
             def = app.getClone(paNodeBean.getName()); // TODO: support clones here?
         
@@ -289,7 +290,7 @@ public class ParameterPanel extends Edit
             {
                 PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                 PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
 
                 if (newName != null && newValue != null)
                 {

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/PreferencePanel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/PreferencePanel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/PreferencePanel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/PreferencePanel.java Tue Apr  5 03:43:41 2011
@@ -29,6 +29,7 @@ import org.apache.jetspeed.om.portlet.Pr
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
 import org.apache.jetspeed.portlets.prm.model.PreferenceModel;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
 import org.apache.jetspeed.portlets.wicket.component.editor.EditorTemplate;
 import org.apache.wicket.markup.html.form.Button;
@@ -80,7 +81,7 @@ public class PreferencePanel extends Edi
                 {
                     PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                     PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                     PortletPreferencesProvider prefProvider = (PortletPreferencesProvider) 
                         ((AbstractAdminWebApplication) getApplication()).getServiceLocator()
                         .getService(CommonPortletServices.CPS_PORTLET_PREFERENCES_PROVIDER);
@@ -169,7 +170,7 @@ public class PreferencePanel extends Edi
         {
             PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
             PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-            PortletDefinition def = app.getPortlet(paNodeBean.getName());
+            PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
             PortletPreferencesProvider prefProvider = (PortletPreferencesProvider) 
                 ((AbstractAdminWebApplication) getApplication()).getServiceLocator()
                 .getService(CommonPortletServices.CPS_PORTLET_PREFERENCES_PROVIDER);
@@ -196,7 +197,7 @@ public class PreferencePanel extends Edi
         final JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
         PortletRegistry registry = locator.getPortletRegistry();
         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
 
         curPrefs = def.getPortletPreferences().getPortletPreferences();
         

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/SecurityPanel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/SecurityPanel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/SecurityPanel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/SecurityPanel.java Tue Apr  5 03:43:41 2011
@@ -35,6 +35,7 @@ import org.apache.jetspeed.portlets.Jets
 import org.apache.jetspeed.portlets.prm.DescriptionBean;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
 import org.apache.jetspeed.portlets.prm.model.SecurityRoleRefModel;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
 import org.apache.jetspeed.portlets.wicket.component.editor.EditorTemplate;
 import org.apache.jetspeed.portlets.wicket.component.editor.LocalizedDescriptionEditor;
@@ -91,7 +92,7 @@ public class SecurityPanel extends Edito
         
         PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         jetspeedSecurityConstraint = def.getJetspeedSecurityConstraint();
         
         Form form = (Form) panel.get("form");
@@ -107,7 +108,7 @@ public class SecurityPanel extends Edito
                 {
                     PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                     PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                     def.setJetspeedSecurityConstraint("".equals(jetspeedSecurityConstraint) ? null : jetspeedSecurityConstraint);
                     registry.savePortletDefinition(def);
                     StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveOK", this, null, new Object [] { paNodeBean.getName() } );
@@ -164,7 +165,7 @@ public class SecurityPanel extends Edito
             {
                 PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                 PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
 
                 final SecurityRoleRef secRoleRef = def.getSecurityRoleRef(securityRoleRef.getRoleName());
 
@@ -189,7 +190,7 @@ public class SecurityPanel extends Edito
                     {
                         PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                         
                         if (newLocale != null && newDescription != null)
                         {
@@ -244,7 +245,7 @@ public class SecurityPanel extends Edito
                 {
                     PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                     PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                     SecurityRoleRef secRoleRef = def.getSecurityRoleRef(securityRoleRef.getRoleName());
                     
                     if (secRoleRef != null)
@@ -285,7 +286,7 @@ public class SecurityPanel extends Edito
     {
         PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
 
         Iterator<SecurityRoleRef> it = def.getSecurityRoleRefs().iterator();
         while (it.hasNext())
@@ -326,7 +327,7 @@ public class SecurityPanel extends Edito
         JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
         PortletRegistry registry = locator.getPortletRegistry();
         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         
         List<IModel<SecurityRoleRef>> securityRoleRefModels = new ArrayList<IModel<SecurityRoleRef>>();
         
@@ -355,7 +356,7 @@ public class SecurityPanel extends Edito
             {
                 PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                 PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
 
                 if (newRoleName != null && newRoleLink != null)
                 {

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/SupportsPanel.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/SupportsPanel.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/SupportsPanel.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/prm/portlet/SupportsPanel.java Tue Apr  5 03:43:41 2011
@@ -31,6 +31,7 @@ import org.apache.jetspeed.om.portlet.Su
 import org.apache.jetspeed.portlets.JetspeedServiceLocator;
 import org.apache.jetspeed.portlets.prm.PortletApplicationNodeBean;
 import org.apache.jetspeed.portlets.prm.model.SupportsModel;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
 import org.apache.jetspeed.portlets.wicket.component.editor.EditorTemplate;
 import org.apache.wicket.markup.html.form.Button;
@@ -90,7 +91,7 @@ public class SupportsPanel extends Edito
                 {
                     PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                     PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
+                    PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
                     
                     if (newMimeType != null && !newPortletModes.isEmpty())
                     {
@@ -145,7 +146,7 @@ public class SupportsPanel extends Edito
     {
         PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
         PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         
         for (Iterator<Supports> it = def.getSupports().iterator(); it.hasNext(); )
         {
@@ -182,7 +183,7 @@ public class SupportsPanel extends Edito
     {
         JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
         PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
-        PortletDefinition def = app.getPortlet(paNodeBean.getName());
+        PortletDefinition def = PortletApplicationUtils.getPortletOrClone(app, paNodeBean.getName());
         List<IModel<Supports>> list = new LinkedList<IModel<Supports>>();
         
         for (Supports field : def.getSupports())

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/selector/CategoryPortletSelector.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/selector/CategoryPortletSelector.java?rev=1088876&r1=1088875&r2=1088876&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/selector/CategoryPortletSelector.java (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/selector/CategoryPortletSelector.java Tue Apr  5 03:43:41 2011
@@ -60,6 +60,7 @@ import org.apache.jetspeed.page.PageMana
 import org.apache.jetspeed.portlets.CategoryInfo;
 import org.apache.jetspeed.portlets.PortletInfo;
 import org.apache.jetspeed.portlets.dojo.AbstractAdminDojoVelocityPortlet;
+import org.apache.jetspeed.portlets.util.PortletApplicationUtils;
 import org.apache.jetspeed.profiler.Profiler;
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.search.ParsedObject;
@@ -484,7 +485,7 @@ public class CategoryPortletSelector ext
             String page = request.getParameter(JSPAGE);
             PortletApplication pa = registry.getPortletApplication("j2-admin");
             String portletName = this.getPortletName();
-            PortletDefinition portlet = (PortletDefinition) pa.getPortlet(portletName);
+            PortletDefinition portlet = (PortletDefinition) PortletApplicationUtils.getPortletOrClone(pa, portletName);
             Preferences prefs = portlet.getPortletPreferences();
             boolean updated = updateNumericPref("Columns", columns, 10, prefs);
             updated = updated | updateNumericPref("Rows", rows, 100, prefs);

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/util/PortletApplicationUtils.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/util/PortletApplicationUtils.java?rev=1088876&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/util/PortletApplicationUtils.java (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/util/PortletApplicationUtils.java Tue Apr  5 03:43:41 2011
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+package org.apache.jetspeed.portlets.util;
+
+import org.apache.jetspeed.om.portlet.PortletApplication;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+
+public class PortletApplicationUtils
+{
+    private PortletApplicationUtils()
+    {
+        
+    }
+    
+    public static PortletDefinition getPortletOrClone(PortletApplication app, String portletName)
+    {
+        PortletDefinition definition = app.getPortlet(portletName);
+        
+        if (definition == null)
+        {
+            definition = app.getClone(portletName);
+        }
+        
+        return definition;
+    }
+    
+}



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