portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry TestRegistry.java TestRegistryDirect.java TestRegistryDirectPart2.java
Date Tue, 09 Mar 2004 19:35:28 GMT
taylor      2004/03/09 11:35:28

  Modified:    components/registry/src/java/org/apache/jetspeed/containers
                        registry.container.groovy
               components/registry/src/test/org/apache/jetspeed/components/portletregistry
                        TestRegistry.java TestRegistryDirect.java
                        TestRegistryDirectPart2.java
  Added:       components/registry/src/java/org/apache/jetspeed/components/portletregistry
                        PortletRegistryComponent.java
                        PortletRegistryComponentImpl.bsh
                        PortletRegistryComponentImpl.java
                        RegistryException.java
  Log:
  fixed spelling
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletRegistryComponent.java
  
  Index: PortletRegistryComponent.java
  ===================================================================
  /*
   * Copyright 2000-2004 The Apache Software Foundation.
   * 
   * Licensed 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.components.portletregistry;
  
  import java.util.Collection;
  import java.util.List;
  import java.util.Locale;
  
  import org.apache.jetspeed.components.persistence.store.PersistenceStore;
  import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
  import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
  import org.apache.pluto.om.common.Language;
  import org.apache.pluto.om.common.ObjectID;
  import org.apache.pluto.om.portlet.PortletApplicationDefinition;
  
  /**
   * <p>
   * PortletRegistryComponentImpl
   * </p>
   * 
   * 
   * @
   * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
   * @version $ $
   *
   */
  public interface PortletRegistryComponent
  {
      Language createLanguage(
          Locale locale,
          String title,
          String shortTitle,
          String description,
          Collection keywords)  throws RegistryException;
      
      List getAllPortletDefinitions();
      
      /**
       * Retreives a PortletApplication by it's unique ObjectID.
       * The unqiue ObjectID is generally a function of the native
       * storage mechanism of the container whether it be auto-generated
       * by an RDBMS, O/R tool or some other mechanism.
       * This is different than the portlet applaiction's unique indentfier
       * which is specified within the portlet.xml
       * @param id 
       * @return
       */
      MutablePortletApplication getPortletApplication(ObjectID id);
      
      /**
          * Retreives a PortletApplication by it's unique name.  We use
          * PortletApplicationComposite interface which extends the PortletApplication
          * and adds additional functionallity to it.
          * @param id 
          * @return PortletApplicationComposite
          */
      MutablePortletApplication 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.
      */
      MutablePortletApplication getPortletApplicationByIdentifier(String identifier);    
      
      List 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);
      
      /**
       * 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. 
       * <br/>
       * <strong>FORMAT: </strong> <i>application name</i>::<i>portlet
name</i>
       * <br/>
       * <strong>EXAMPLE: </strong> com.myapp.portletApp1::weather-portlet
       * <br/>
       * This methos automatically calls {@link getStoreableInstance(PortletDefinitionComposite
portlet)}
       * on the returned <code>PortletEntityInstance</code> 
       * @param name portlets unique name.  
       * @return Portlet that matches the unique name 
       * @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 getPortletDefinitionByUniqueName(String name);
   
      /**
        * Checks whether or not a portlet application with this identity 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
        * is alreay registered, <code>false</code> if it has not.
        */
      boolean portletApplicationExists(String appIentity);
      /**
       * 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.
          * @param app PortletApplication to check .
          * @return boolean <code>true</code> if a portlet with this identity
          * is alreay registered, <code>false</code> if it has not.
          */
      boolean portletDefinitionExists(String portletName, MutablePortletApplication app);
      /**
          * Creates a new <code>PortletApplicationDefinition</code> 
          * within the Portal.          
          * @param newApp
          */
      void registerPortletApplication(PortletApplicationDefinition newApp) throws RegistryException;
      void removeApplication(PortletApplicationDefinition app) throws RegistryException;
      /**
          * Makes any changes to the <code>PortletApplicationDefinition</code>
          * persistent.
          * @param app
          */
      void updatePortletApplication(PortletApplicationDefinition app) throws RegistryException;
      
      /**
       * 
       * <p>
       * getStoreableInstance
       * </p>
       * Wraps the <code>PortletDefinitionComposite</code>
       * in an instance that correctly implements the 
       * <code>store()</code> method;
       * 
       * @param portlet
       * @return
       *
       */
  	PortletDefinitionComposite getStoreableInstance(PortletDefinitionComposite portlet);
  	
  	/**
  	 * 
  	 * <p>
  	 * getPersistenceStore
  	 * </p>
  	 * 
  	 * @return the PersistenceStore sued to persist registry
  	 * information.
  	 *
  	 */
  	PersistenceStore getPersistenceStore();
  
  }
  
  
  
  1.1                  jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletRegistryComponentImpl.bsh
  
  Index: PortletRegistryComponentImpl.bsh
  ===================================================================
  import org.apache.commons.configuration.Configuration;
  import org.apache.jetspeed.persistence.store.PersistenceStoreContainer;
  
  
  
  instance = new PortletRegistryComponentImpl(
                               picoContainer.getComponentInstance(PersistenceStoreContainer.class),
                               "jetspeed",
                                picoContainer.getComponentInstance("pluto.om")
                               );
  
  
  
  
  1.1                  jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletRegistryComponentImpl.java
  
  Index: PortletRegistryComponentImpl.java
  ===================================================================
  /*
   * Copyright 2000-2004 The Apache Software Foundation.
   * 
   * Licensed 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.components.portletregistry;
  
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Locale;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.jetspeed.components.persistence.store.Filter;
  import org.apache.jetspeed.components.persistence.store.PersistenceStore;
  import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer;
  import org.apache.jetspeed.components.persistence.store.impl.LockFailedException;
  import org.apache.jetspeed.om.common.MutableLanguage;
  import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
  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.jetspeed.om.portlet.impl.StoreablePortletDefinitionDelegate;
  import org.apache.pluto.om.common.Language;
  import org.apache.pluto.om.common.ObjectID;
  import org.apache.pluto.om.portlet.PortletApplicationDefinition;
  
  /**
   * <p>
   * PortletRegistryComponentImpl
   * </p>
   * <p>
   * Component for accessing the Portlet registry.
   * </p>
   * 
   * <table border="1">
   * <tr>
   * <th>Configuration Key</th>
   * <th>Optional?</th>
   * <th>Default</th>
   * <th>Description</th>
   * </tr>
   * <tr>
   * <td>persistence.store.name</td>
   * <td>true</td>
   * <td>jetspeed</td>
   * <td>Name of the persistence store that will be used for persistence operations.</td>
   * </tr>
   * </table>
   * 
   * @author <a href="mailto:weaver@apache.org">Scott T. Weaver </a>
   * @version $ $
   *  
   */
  public class PortletRegistryComponentImpl implements PortletRegistryComponent
  {
      private static final Log log = LogFactory.getLog(PortletRegistryComponentImpl.class);
      protected static final String KEY_STORE_NAME = "persistence.store.name";
      private PersistenceStoreContainer storeContainer;
      private String jetspeedStoreName;
      private Class portletDefClass;
      private Class portletAppClass;
  
  
      /**
       *  
       */
      public PortletRegistryComponentImpl(PersistenceStoreContainer storeContainer, String
keyStoreName) throws RegistryException
      {
          if (storeContainer == null)
          {
              throw new IllegalArgumentException("storeContainer cannot be null for PortletRegistryComponentImpl");
          }
          this.storeContainer = storeContainer;
          jetspeedStoreName = keyStoreName;
          portletDefClass = PortletDefinitionImpl.class;
          portletAppClass = PortletApplicationDefinitionImpl.class;
      }
  
      /**
       * <p>
       * createLanguage
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#createLanguage(java.util.Locale,
java.lang.String,
       *      java.lang.String, java.lang.String, java.util.Collection)
       * @param locale
       * @param title
       * @param shortTitle
       * @param description
       * @param keywords
       * @return @throws
       *         RegistryException
       */
      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.");
          }
      }
  
      /**
       * <p>
       * getAllPortletDefinitions
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#getAllPortletDefinitions()
       * @return
       */
      public List getAllPortletDefinitions()
      {
          PersistenceStore store = getPersistenceStore();
          prepareTransaction(store);
          return new ArrayList(store.getExtent(portletDefClass));
      }
  
      public PersistenceStore getPersistenceStore()
      {
          return storeContainer.getStoreForThread(jetspeedStoreName);
      }
  
      /**
       * <p>
       * getPortletApplication
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#getPortletApplication(org.apache.pluto.om.common.ObjectID)
       * @param id
       * @return
       */
      public MutablePortletApplication getPortletApplication(ObjectID id)
      {
          PersistenceStore store = getPersistenceStore();
          prepareTransaction(store);
          Filter filter = store.newFilter();
          filter.addEqualTo("id", id);
          Object query = store.newQuery(portletAppClass, filter);
          return (MutablePortletApplication) store.getObjectByQuery(query);
      }
  
      private void prepareTransaction(PersistenceStore store)
      {
          if (store.getTransaction() == null || !store.getTransaction().isOpen())
          {
              store.getTransaction().begin();
          }
      }
  
      /**
       * <p>
       * getPortletApplication
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#getPortletApplication(java.lang.String)
       * @param name
       * @return
       */
      public MutablePortletApplication getPortletApplication(String name)
      {
          PersistenceStore store = getPersistenceStore();
          prepareTransaction(store);
          Filter filter = store.newFilter();
          filter.addEqualTo("name", name);
          Object query = store.newQuery(portletAppClass, filter);
          return (MutablePortletApplication) store.getObjectByQuery(query);
      }
  
      /**
       * <p>
       * getPortletApplicationByIdentifier
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#getPortletApplicationByIdentifier(java.lang.String)
       * @param ident
       * @return
       */
      public MutablePortletApplication getPortletApplicationByIdentifier(String ident)
      {
          PersistenceStore store = getPersistenceStore();
          prepareTransaction(store);
          Filter filter = store.newFilter();
          filter.addEqualTo("applicationIdentifier", ident);
          Object query = store.newQuery(portletAppClass, filter);
          return (MutablePortletApplication) store.getObjectByQuery(query);
      }
  
      /**
       * <p>
       * getPortletApplications
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#getPortletApplications()
       * @return
       */
      public List getPortletApplications()
      {
          PersistenceStore store = getPersistenceStore();
          prepareTransaction(store);
          return new ArrayList(store.getExtent(portletAppClass));
      }
  
      /**
       * <p>
       * getPortletDefinitionByIndetifier
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#getPortletDefinitionByIdentifier(java.lang.String)
       * @param ident
       * @return
       */
      public PortletDefinitionComposite getPortletDefinitionByIdentifier(String ident)
      {
          PersistenceStore store = getPersistenceStore();
          prepareTransaction(store);
          Filter filter = store.newFilter();
          filter.addEqualTo("portletIdentifier", ident);
          Object query = store.newQuery(portletDefClass, filter);
          PortletDefinitionComposite portlet = (PortletDefinitionComposite) store.getObjectByQuery(query);
          if (portlet != null)
          {
              if (portlet.getPortletApplicationDefinition() == null)
              {
                  final String msg = "getPortletDefinitionByIdentifier() returned a PortletDefinition
that has no parent PortletApplication.";
                  log.error(msg);
                  throw new IllegalStateException(msg);
              }
              return getStoreableInstance(portlet);
          }
          else
          {
              return null;
          }
      }
  
      /**
       * <p>
       * getPortletDefinitionByUniqueName
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#getPortletDefinitionByUniqueName(java.lang.String)
       * @param name
       * @return
       */
      public PortletDefinitionComposite getPortletDefinitionByUniqueName(String name)
      {
          PersistenceStore store = getPersistenceStore();
          prepareTransaction(store);
  
          //parse out names
          int split = name.indexOf("::");
          if (split < 1)
          {
              throw new IllegalArgumentException(
              "The unique portlet name, \"" + name + "\";  is not well formed.  No \"::\"
delimiter was found.");
          }
          String appName = name.substring(0, split);
          String portletName = name.substring((split + 2), name.length());
  
          // build filter
          Filter filter = store.newFilter();
          filter.addEqualTo("app.name", appName);
          filter.addEqualTo("name", portletName);
          Object query = store.newQuery(portletDefClass, filter);
          PortletDefinitionComposite portlet = (PortletDefinitionComposite) store.getObjectByQuery(query);
          if (portlet != null)
          {
              if (portlet.getPortletApplicationDefinition() == null)
              {
                  final String msg = "getPortletDefinitionByUniqueName() returned a PortletDefinition
that has no parent PortletApplication.";
                  log.error(msg);
                  throw new IllegalStateException(msg);
              }
              return getStoreableInstance(portlet);
          }
          else
          {
              return null;
          }
      }
  
      /**
       * <p>
       * portletApplicationExists
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#portletApplicationExists(java.lang.String)
       * @param appIdentity
       * @return
       */
      public boolean portletApplicationExists(String appIdentity)
      {
          return getPortletApplicationByIdentifier(appIdentity) != null;
      }
  
      /**
       * <p>
       * portletDefinitionExists
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#portletDefinitionExists(java.lang.String)
       * @param portletIndentity
       * @return
       */
      public boolean portletDefinitionExists(String portletIdentity)
      {
          return getPortletDefinitionByIdentifier(portletIdentity) != null;
      }
  
      /**
       * <p>
       * portletDefinitionExists
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#portletDefinitionExists(java.lang.String,
       *      org.apache.jetspeed.om.common.portlet.MutablePortletApplication)
       * @param portletName
       * @param app
       * @return
       */
      public boolean portletDefinitionExists(String portletName, MutablePortletApplication
app)
      {
          return getPortletDefinitionByUniqueName(app.getName() + "::" + portletName) != null;
      }
  
      /**
       * <p>
       * registerPortletApplication
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#registerPortletApplication(org.apache.pluto.om.portlet.PortletApplicationDefinition)
       * @param newApp
       * @throws RegistryException
       */
      public void registerPortletApplication(PortletApplicationDefinition newApp) throws RegistryException
      {
          PersistenceStore store = getPersistenceStore();
          prepareTransaction(store);
          try
          {
              store.makePersistent(newApp);
              store.getTransaction().checkpoint();
          }
          catch (LockFailedException e)
          {
              throw new RegistryException("Unable to lock PortletApplicaiton for makePersistent:
" + e.toString(), e);
          }
      }
  
      /**
       * <p>
       * removeApplication
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#removeApplication(org.apache.pluto.om.portlet.PortletApplicationDefinition)
       * @param app
       * @throws TransactionStateException
       */
      public void removeApplication(PortletApplicationDefinition app) throws RegistryException
      {
          PersistenceStore store = getPersistenceStore();
          prepareTransaction(store);
          try
          {
              Iterator portlets = app.getPortletDefinitionList().iterator();
              while (portlets.hasNext())
              {
                  // portlets are getting cascade deleted but
                  // content type and langs asocciated are not
                  store.deletePersistent(portlets.next());
              }
              store.deletePersistent(app);
              store.getTransaction().checkpoint();
          }
          catch (LockFailedException e)
          {
              throw new RegistryException("Unable to lock PortletApplication for deletion:
" + e.toString(), e);
          }
      }
  
      /**
       * <p>
       * updatePortletApplication
       * </p>
       * 
       * @see org.apache.jetspeed.registry.PortletRegistryComponentImpl#updatePortletApplication(org.apache.pluto.om.portlet.PortletApplicationDefinition)
       * @param app
       * @throws RegistryException
       */
      public void updatePortletApplication(PortletApplicationDefinition app) throws RegistryException
      {
          try
          {
              PersistenceStore store = getPersistenceStore();
              prepareTransaction(store);
              store.lockForWrite(app);
              store.getTransaction().checkpoint();
          }
          catch (LockFailedException e)
          {
              throw new RegistryException("Unable to lock PortletApplicaiton for update: "
+ e.toString(), e);
          }
      }
  
      public PortletDefinitionComposite getStoreableInstance(PortletDefinitionComposite portlet)
      {
          if (portlet != null)
          {
              return new StoreablePortletDefinitionDelegate(portlet, getPersistenceStore());
          }
          else
          {
              return null;
          }
      }
  }
  
  
  
  1.1                  jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryException.java
  
  Index: RegistryException.java
  ===================================================================
  /*
   * Copyright 2000-2004 The Apache Software Foundation.
   * 
   * Licensed 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.components.portletregistry;
  
  import org.apache.jetspeed.exception.JetspeedException;
  
  
  /**
  Occurs when anything unexpected happens within Jetspeed and its Registry.  Any 
  
  @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  @version $Id: RegistryException.java,v 1.1 2004/03/09 19:35:27 taylor Exp $
  */
  
  public class RegistryException extends JetspeedException
   {
  
      public static final String REGISTRY_NOT_FOUND
          = "The specified registry does not exist.";
  
      public RegistryException() 
      {
          super();
      }
  
      public RegistryException( String message )
      {
          super( message );
      }
  
      public RegistryException(Throwable nested)
      {
          super(nested);
      }
      
      public RegistryException(String msg, Throwable nested)
      {
          super(msg, nested);
      }
  
  
  }
  
  
  
  
  1.7       +2 -2      jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/containers/registry.container.groovy
  
  Index: registry.container.groovy
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/containers/registry.container.groovy,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- registry.container.groovy	9 Mar 2004 16:18:47 -0000	1.6
  +++ registry.container.groovy	9 Mar 2004 19:35:27 -0000	1.7
  @@ -7,8 +7,8 @@
   import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer
   import org.apache.jetspeed.components.util.system.FSSystemResourceUtilImpl
   
  -import org.apache.jetspeed.components.portletregsitry.PortletRegistryComponentImpl
  -import org.apache.jetspeed.components.portletregsitry.PortletRegistryComponent
  +import org.apache.jetspeed.components.portletregistry.PortletRegistryComponentImpl
  +import org.apache.jetspeed.components.portletregistry.PortletRegistryComponent
   import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent
   import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponentImpl
   
  
  
  
  1.9       +6 -6      jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistry.java
  
  Index: TestRegistry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistry.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TestRegistry.java	8 Mar 2004 16:45:55 -0000	1.8
  +++ TestRegistry.java	9 Mar 2004 19:35:28 -0000	1.9
  @@ -29,7 +29,7 @@
   import org.apache.jetspeed.components.persistence.store.PersistenceStore;
   import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer;
   import org.apache.jetspeed.components.persistence.store.impl.LockFailedException;
  -import org.apache.jetspeed.components.portletregsitry.PortletRegistryComponent;
  +import org.apache.jetspeed.components.portletregistry.PortletRegistryComponent;
   import org.apache.jetspeed.om.common.DublinCore;
   import org.apache.jetspeed.om.common.GenericMetadata;
   import org.apache.jetspeed.om.common.impl.DublinCoreImpl;
  @@ -233,7 +233,7 @@
               // registry.clearCache();
   
               PortletDefinitionComposite pdc0 = 
  -            (PortletDefinitionComposite) registry.getPortletDefinitionByIndetifier(PORTLET_0_UID);
  +            (PortletDefinitionComposite) registry.getPortletDefinitionByIdentifier(PORTLET_0_UID);
               PortletDefinitionComposite pdc2 = 
               (PortletDefinitionComposite) registry.getPortletDefinitionByUniqueName(
               APP_1_NAME + "::" + PORTLET_0_NAME);
  @@ -354,7 +354,7 @@
               assertEquals(2, count);
               PortletDefinitionComposite portlet1 = (PortletDefinitionComposite) app
               .getPortletDefinitionByName(PORTLET_1_NAME);
  -            PortletDefinitionComposite portlet1_2 = registry.getPortletDefinitionByIndetifier(PORTLET_1_UID);
  +            PortletDefinitionComposite portlet1_2 = registry.getPortletDefinitionByIdentifier(PORTLET_1_UID);
               assertNotNull(portlet1);
               Description desc = portlet1.getDescription(JetspeedLocale.getDefaultLocale());
               assertNotNull("Description for portlet definition was null.", desc);
  @@ -491,7 +491,7 @@
           {
               PortletDefinitionComposite pdc = null;
               PortletDefinitionComposite pdc1 = 
  -            (PortletDefinitionComposite) registry.getPortletDefinitionByIndetifier(PORTLET_0_UID);
  +            (PortletDefinitionComposite) registry.getPortletDefinitionByIdentifier(PORTLET_0_UID);
   
               // registry.clearCache();
   
  @@ -507,7 +507,7 @@
               pc.addDescription(JetspeedLocale.getDefaultLocale(), "Preference Description");
               pdc.addPreference(pc);
               store.getTransaction().commit();
  -            pdc = (PortletDefinitionComposite) registry.getPortletDefinitionByIndetifier(PORTLET_0_UID);
  +            pdc = (PortletDefinitionComposite) registry.getPortletDefinitionByIdentifier(PORTLET_0_UID);
               assertNotNull("Portlet definition \"com.portlet.MyClass0.Portlet 0\" does not
exist.", pdc);
               assertNotNull("PreferenceSet for \"com.portlet.MyClass0.Portlet 0\" should
not be null", pdc
               .getPreferenceSet());
  
  
  
  1.4       +2 -2      jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistryDirect.java
  
  Index: TestRegistryDirect.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistryDirect.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestRegistryDirect.java	9 Mar 2004 16:20:07 -0000	1.3
  +++ TestRegistryDirect.java	9 Mar 2004 19:35:28 -0000	1.4
  @@ -27,7 +27,7 @@
   import org.apache.jetspeed.components.persistence.store.PersistenceStore;
   import org.apache.jetspeed.components.persistence.store.impl.LockFailedException;
   import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
  -import org.apache.jetspeed.components.portletregsitry.PortletRegistryComponent;
  +import org.apache.jetspeed.components.portletregistry.PortletRegistryComponent;
   import org.apache.jetspeed.om.common.portlet.ContentTypeComposite;
   import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
   import org.apache.jetspeed.om.common.preference.PreferenceComposite;
  
  
  
  1.4       +2 -2      jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistryDirectPart2.java
  
  Index: TestRegistryDirectPart2.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistryDirectPart2.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestRegistryDirectPart2.java	9 Mar 2004 16:20:07 -0000	1.3
  +++ TestRegistryDirectPart2.java	9 Mar 2004 19:35:28 -0000	1.4
  @@ -24,7 +24,7 @@
   import org.apache.jetspeed.components.persistence.store.Filter;
   import org.apache.jetspeed.components.persistence.store.PersistenceStore;
   import org.apache.jetspeed.components.persistence.store.impl.LockFailedException;
  -import org.apache.jetspeed.components.portletregsitry.PortletRegistryComponent;
  +import org.apache.jetspeed.components.portletregistry.PortletRegistryComponent;
   import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
   import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
   import org.apache.jetspeed.om.servlet.impl.WebApplicationDefinitionImpl;
  
  
  

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


Mime
View raw message