You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by at...@apache.org on 2008/10/16 21:44:00 UTC

svn commit: r705336 - in /portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade: components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/ jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/

Author: ate
Date: Thu Oct 16 12:43:59 2008
New Revision: 705336

URL: http://svn.apache.org/viewvc?rev=705336&view=rev
Log:
Cleanup of PortletRegistry: *all* oid/id/identifier lookup is no longer supported

Modified:
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java?rev=705336&r1=705335&r2=705336&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java Thu Oct 16 12:43:59 2008
@@ -21,23 +21,18 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 
 import org.apache.jetspeed.cache.JetspeedCache;
 import org.apache.jetspeed.cache.JetspeedCacheEventListener;
 import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
-import org.apache.jetspeed.om.common.MutableLanguage;
 import org.apache.jetspeed.om.common.Support;
 import org.apache.jetspeed.om.common.portlet.PortletApplication;
 import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
-import org.apache.jetspeed.om.impl.LanguageImpl;
 import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
 import org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl;
 import org.apache.ojb.broker.query.Criteria;
 import org.apache.ojb.broker.query.QueryFactory;
-import org.apache.pluto.om.portlet.Language;
-import org.apache.pluto.om.portlet.ObjectID;
 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
 import org.apache.pluto.om.portlet.PortletDefinition;
 import org.springframework.dao.DataAccessException;
@@ -96,24 +91,6 @@
         this.portletNameCache.addEventListener(this, false);        
     }
     
-    public Language createLanguage( Locale locale, String title, String shortTitle, String description,
-            Collection keywords ) throws RegistryException
-    {
-        try
-        {
-            MutableLanguage lc = new LanguageImpl();
-            lc.setLocale(locale);
-            lc.setTitle(title);
-            lc.setShortTitle(shortTitle);
-            lc.setKeywords(keywords);
-            return lc;
-        }
-        catch (Exception e)
-        {
-            throw new RegistryException("Unable to create language object.");
-        }
-    }
-    
     public Collection getAllPortletDefinitions()
     {
         Criteria c = new Criteria();
@@ -123,16 +100,6 @@
         return list;
     }
 
-    public PortletApplication getPortletApplicationById( String id )
-    {
-        Criteria c = new Criteria();
-        c.addEqualTo("id", new Long(id));
-        PortletApplication app = (PortletApplication) getPersistenceBrokerTemplate().getObjectByQuery(
-                QueryFactory.newQuery(PortletApplicationDefinitionImpl.class, c));
-        postLoad(app);
-        return app;
-    }
-
     public PortletApplication getPortletApplication(String name)
     {
         Criteria c = new Criteria();
@@ -143,16 +110,6 @@
         return app;
     }
 
-    public PortletApplication getPortletApplicationByIdentifier( String identifier )
-    {
-        Criteria c = new Criteria();
-        c.addEqualTo("applicationIdentifier", identifier);
-        PortletApplication app = (PortletApplication) getPersistenceBrokerTemplate().getObjectByQuery(
-            QueryFactory.newQuery(PortletApplicationDefinitionImpl.class, c));
-        postLoad(app);
-        return app;
-    }
-
     public Collection getPortletApplications()
     {
         Criteria c = new Criteria();
@@ -162,22 +119,6 @@
         return list;
     }
 
-    public PortletDefinitionComposite getPortletDefinitionByIdentifier( String identifier )
-    {
-        Criteria c = new Criteria();
-        c.addEqualTo("portletIdentifier", identifier);
-        PortletDefinitionComposite def = (PortletDefinitionComposite) getPersistenceBrokerTemplate().getObjectByQuery(
-                QueryFactory.newQuery(PortletDefinitionImpl.class, c));
-        if (def != null && def.getApplication() == null)
-        {
-            final String msg = "getPortletDefinitionByIdentifier() returned a PortletDefinition that has no parent PortletApplication.";
-            throw new IllegalStateException(msg);
-        }
-
-        postLoad(def);
-        return def;
-    }
-
     public PortletDefinitionComposite getPortletDefinitionByUniqueName( String name )
     {
         String appName = PortletRegistryHelper.parseAppName(name);
@@ -199,26 +140,16 @@
         return def;
     }
 
-    public boolean portletApplicationExists( String appIdentity )
+    public boolean portletApplicationExists( String name )
     {
-        return getPortletApplicationByIdentifier(appIdentity) != null;
+        return getPortletApplication(name) != null;
     }
     
-    public boolean namedPortletApplicationExists( String appName )
-    {
-        return getPortletApplication(appName) != null;
-    }
-
     public boolean portletDefinitionExists( String portletName, PortletApplication app )
     {
         return getPortletDefinitionByUniqueName(app.getName() + "::" + portletName) != null;
     }
 
-    public boolean portletDefinitionExists( String portletIdentity )
-    {
-        return getPortletDefinitionByIdentifier(portletIdentity) != null;
-    }
-
     public void registerPortletApplication( PortletApplicationDefinition newApp ) throws RegistryException
     {
         getPersistenceBrokerTemplate().store(newApp);
@@ -305,17 +236,6 @@
         }
     }
 
-    public PortletDefinitionComposite getPortletDefinition(ObjectID id)
-    {
-        Criteria c = new Criteria();
-        c.addEqualTo("id", new Long(id.toString()));
-        PortletDefinitionComposite portlet = (PortletDefinitionComposite) getPersistenceBrokerTemplate().getObjectByQuery(
-                QueryFactory.newQuery(PortletDefinitionImpl.class, c));
-        
-        postLoad(portlet);
-        return portlet;
-    }
-    
     public void notifyElementAdded(JetspeedCache cache, boolean local, Object key, Object element)
     {
     }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java?rev=705336&r1=705335&r2=705336&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/components/portletregistry/PortletRegistry.java Thu Oct 16 12:43:59 2008
@@ -17,12 +17,9 @@
 package org.apache.jetspeed.components.portletregistry;
 
 import java.util.Collection;
-import java.util.Locale;
 
 import org.apache.jetspeed.om.common.portlet.PortletApplication;
 import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
-import org.apache.pluto.om.portlet.Language;
-import org.apache.pluto.om.portlet.ObjectID;
 import org.apache.pluto.om.portlet.PortletApplicationDefinition;
 import org.apache.pluto.om.portlet.PortletDefinition;
 
@@ -39,20 +36,9 @@
  */
 public interface PortletRegistry
 {
-
-    Language createLanguage( Locale locale, String title, String shortTitle, String description, Collection keywords )
-    throws RegistryException;
-
     Collection getAllPortletDefinitions();
 
     /**
-     * Retreives a PortletApplication by it's id.
-     * @param id 
-     * @return
-     */
-    PortletApplication getPortletApplicationById( String id );
-
-    /**
      * Retreives a PortletApplication by it's unique name.  We use
      * PortletApplicationComposite interface which extends the PortletApplication
      * and adds additional functionallity to it.
@@ -61,44 +47,9 @@
      */
     PortletApplication getPortletApplication( String name );
 
-    /**
-     * Locates a portlet application using it's unique <code>identifier</code> 
-     * field.
-     * @param identifier Unique id for this portlet application
-     * @return portlet application matching this unique id.
-     */
-    PortletApplication getPortletApplicationByIdentifier( String identifier );
-
     Collection getPortletApplications();
 
     /**
-     * Locates a portlet using it's unique <code>identifier</code> 
-     * field.
-     * <br/>
-     * This method automatically calls {@link getStoreableInstance(PortletDefinitionComposite portlet)}
-     * on the returned <code>PortletEntityInstance</code>
-     * @param identifier Unique id for this portlet
-     * @return Portlet matching this unique id.
-     * @throws java.lang.IllegalStateException If <code>PortletDefinitionComposite != null</code> AND
-     *  <code>PortletDefinitionComposite.getPortletApplicationDefinition() ==  null</code>.
-     * The reason for this is that every PortletDefinition is required to
-     * have a parent PortletApplicationDefinition
-     */
-    PortletDefinitionComposite getPortletDefinitionByIdentifier( String identifier );
-    
-    
-    /**
-     * Locates the portlet defintion by its unique <code>ObjectID</code>.
-     * The ObjectID is generated internally by the portal when the portlet
-     * definition is first registered and has no connection to the information
-     * stored within the <code>portlet.xml</code>.
-     * @param id
-     * @return PortletDefinitionComposite
-     */
-    PortletDefinitionComposite getPortletDefinition(ObjectID id);
-    
-
-    /**
      * unique name is a string formed by the combination of a portlet's
      * unique within it's parent application plus the parent application's
      * unique name within the portlet container using ":" as a delimiter. 
@@ -120,35 +71,15 @@
     PortletDefinitionComposite getPortletDefinitionByUniqueName( String name );
 
     /**
-     * Checks whether or not a portlet application with this identity has all ready
+     * Checks whether or not a portlet application with this name has all ready
      * been registered to the container.
-     * @param appIdentity portlet application indetity to check for.
-     * @return boolean <code>true</code> if a portlet application with this identity
+     * @param name portlet application name to check for.
+     * @return boolean <code>true</code> if a portlet application with this name
      * is alreay registered, <code>false</code> if it has not.
      */
-    boolean portletApplicationExists( String appIentity );
+    boolean portletApplicationExists( String name );
     
     /**
-     * 
-     * <p>
-     * namedPortletApplicationExists
-     * </p>
-     *
-     * @param appName
-     * @return
-     */
-    boolean namedPortletApplicationExists( String appName );
-
-    /**
-     * Checks whether or not a portlet with this identity has all ready
-     * been registered to the container.
-     * @param portletIndentity portlet indetity to check for.
-     * @return boolean <code>true</code> if a portlet with this identity
-     * is alreay registered, <code>false</code> if it has not.
-     */
-    boolean portletDefinitionExists( String portletIndentity );
-
-    /**
      * Checks whether or not a portlet with this identity has all ready
      * been registered to the PortletApplication.
      * @param portletIndentity portlet indetity to check for.



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org