portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity StoreablePortletEntityDelegate.java PortletEntityImpl.java PortletEntityAccessComponent.java PortletEntityAccessComponentImpl.java
Date Mon, 23 Feb 2004 00:55:04 GMT
weaver      2004/02/22 16:55:04

  Modified:    components/registry/src/java/org/apache/jetspeed/components/portletentity
                        PortletEntityImpl.java
                        PortletEntityAccessComponent.java
                        PortletEntityAccessComponentImpl.java
  Added:       components/registry/src/java/org/apache/jetspeed/components/portletentity
                        StoreablePortletEntityDelegate.java
  Log:
  Now using a StoreablePortletEntityDelegate facilitate persistence
  operations on top of a PortletEntity instance.  PortletEntityAccessComponent
  implementations must now return a this type specifically.
  
  Revision  Changes    Path
  1.2       +41 -104   jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java
  
  Index: PortletEntityImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletEntityImpl.java	22 Feb 2004 22:40:01 -0000	1.1
  +++ PortletEntityImpl.java	23 Feb 2004 00:55:04 -0000	1.2
  @@ -53,18 +53,12 @@
    */
   package org.apache.jetspeed.components.portletentity;
   
  -import java.io.IOException;
  -import java.util.ArrayList;
  -import java.util.Iterator;
   import java.util.List;
   import java.util.Locale;
   
  -import org.apache.commons.beanutils.BeanUtils;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
   import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
  -import org.apache.jetspeed.om.preference.impl.AbstractPreference;
   import org.apache.jetspeed.om.preference.impl.PreferenceSetImpl;
   import org.apache.jetspeed.om.window.impl.PortletWindowListImpl;
   import org.apache.jetspeed.util.JetspeedObjectID;
  @@ -105,12 +99,8 @@
   
       private static final Log log = LogFactory.getLog(PortletEntityImpl.class);
   
  -    protected PreferenceSetImpl mutatingPreferencesWrapper = new PreferenceSetImpl();
  -
       protected List originalPreferences;
   
  -    protected List mutatingPreferences;
  -
       private PortletApplicationEntity applicationEntity = null;
   
       private PortletWindowList portletWindows = new PortletWindowListImpl();
  @@ -118,39 +108,24 @@
       private PortletEntity modifiedObject = null;
   
       private PortletDefinitionComposite portletDefinition = null;
  -
  +	
  +	/**
  +	 *  
  +	 * <p>
  +	 * getPreferenceSet
  +	 * </p>
  +	 *  <strong>WARNING!!!<br/></strong>
  +	 * This method should not be used to alter the contents
  +	 * of the PreferenceSet directly by user calls to the portal.  
  +	 * You should be wrapping this with an instance of the
  +	 * {@link StoreablePortletEntityDelegate#store()}.
  +	 * 
  +	 * @see org.apache.pluto.om.entity.PortletEntity#getPreferenceSet()
  +	 * @return
  +	 */
       public PreferenceSet getPreferenceSet()
       {
  -        if (mutatingPreferences == null)
  -        {
  -            if (originalPreferences == null)
  -            {
  -                originalPreferences = new ArrayList();
  -                mutatingPreferences = new ArrayList();
  -            }
  -            else
  -            {
  -                initMutatingPreferences();
  -            }
  -
  -        }
  -        mutatingPreferencesWrapper.setInnerCollection(mutatingPreferences);
  -        return mutatingPreferencesWrapper;
  -    }
  -
  -    protected void initMutatingPreferences()
  -    {
  -        mutatingPreferences = new ArrayList(originalPreferences.size());
  -        if (originalPreferences != null)
  -        {
  -
  -            Iterator itr = originalPreferences.iterator();
  -            while (itr.hasNext())
  -            {
  -                AbstractPreference pref = (AbstractPreference) itr.next();
  -                mutatingPreferences.add(pref.clone());
  -            }
  -        }
  +		return new PreferenceSetImpl(originalPreferences);
       }
   
       public PortletDefinition getPortletDefinition()
  @@ -167,75 +142,37 @@
       {
           return portletWindows;
       }
  -
  +	
  +	/**
  +	 *  
  +	 * <p>
  +	 * store
  +	 * </p>
  +	 * This method is not directly supported. Use
  +	 * {@link StoreablePortletEntityDelegate#store()}
  +	 * 
  +	 */
       public void store() throws java.io.IOException
       {
  -        try
  -        {
  -
  -            if (mutatingPreferences != null && mutatingPreferences.size() >
0)
  -            {
  -                boolean originalPrefsExist = true;
  -                if (originalPreferences == null)
  -                {
  -                    originalPreferences = new ArrayList(mutatingPreferences.size());
  -                    originalPrefsExist = false;
  -                }
  -
  -                try
  -                {
  -                    for (int i = 0; i < mutatingPreferences.size(); i++)
  -                    {
  -                        AbstractPreference pref = (AbstractPreference) mutatingPreferences.get(i);
  -                        if (originalPrefsExist)
  -                        {
  -                            AbstractPreference orgPref = (AbstractPreference) originalPreferences.get(i);
  -                            if (orgPref != null)
  -                            {
  -                                BeanUtils.copyProperties(orgPref, pref);
  -                            }
  -                            else
  -                            {
  -                                originalPreferences.add(pref.clone());
  -                            }
  -
  -                        }
  -                        else
  -                        {
  -                            originalPreferences.add(pref.clone());
  -                        }
  -
  -                    }
  -                }
  -                catch (Exception e1)
  -                {
  -                    throw new IOException("Unable to map mutated preferences into the originals:
" + e1.toString());
  -                }
  -
  -            }
  -
  -            // PortletEntityAccess.storePortletEntity(this);
  -            // TODO: this is bad
  -//			PersistenceStoreContainer pContainer = (PersistenceStoreContainer) PicoBootstrapContainer.getComponentInstance(PersistenceStoreContainer.class);
  -//			PersistenceStore store = pContainer.getStore("jetspeed");
  -//			Transaction tx = store.getTransaction();
  -//			if(!tx.isOpen())
  -//			{
  -//				tx.begin();
  -//			}
  -//			store.lockForWrite(this);
  -//			tx.checkpoint();
  -        }
  -        catch (Exception e)
  -        {
  -            throw new IOException("Unable to store Portlet Entity. " + e.toString());
  -        }
  +		throw new UnsupportedOperationException("PortletEntityImpl.store() is not directly accessable.
 "+ 
  +						   "Use the StoreablePortletEntityDelegate instead.");      
   
       }
  +    
  +    /**
  +     *  
  +     * <p>
  +     * reset
  +     * </p>
  +     * 
  +	 * This method is not directly supported. Use
  +	 * {@link StoreablePortletEntityDelegate#store()}
  +     */
   
       public void reset() throws java.io.IOException
       {
  -        initMutatingPreferences();
  +        throw new UnsupportedOperationException("PortletEntityImpl.reset() is not directly
accessable.  "+ 
  +                   "Use the StoreablePortletEntityDelegate instead.");
       }
   
       // internal methods used for debugging purposes only
  
  
  
  1.2       +4 -4      jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityAccessComponent.java
  
  Index: PortletEntityAccessComponent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityAccessComponent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletEntityAccessComponent.java	22 Feb 2004 22:40:01 -0000	1.1
  +++ PortletEntityAccessComponent.java	23 Feb 2004 00:55:04 -0000	1.2
  @@ -68,13 +68,13 @@
    */
   public interface PortletEntityAccessComponent
   {
  -	PortletEntity getPortletEntity(ObjectID id);
  +	StoreablePortletEntityDelegate getPortletEntity(ObjectID id);
   
   
  -	PortletEntity getPortletEntity(PortletDefinition portletDefinition, String portletName);
  +	StoreablePortletEntityDelegate getPortletEntity(PortletDefinition portletDefinition, String
portletName);
          
   
  -	PortletEntity newPortletEntityInstance(PortletDefinition portletDefinition);
  +	StoreablePortletEntityDelegate newPortletEntityInstance(PortletDefinition portletDefinition);
   
   
   	void removePortletEntity(PortletEntity portletEntity) throws PortletEntityNotDeletedException;
  
  
  
  1.2       +50 -28    jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityAccessComponentImpl.java
  
  Index: PortletEntityAccessComponentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityAccessComponentImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PortletEntityAccessComponentImpl.java	22 Feb 2004 22:40:01 -0000	1.1
  +++ PortletEntityAccessComponentImpl.java	23 Feb 2004 00:55:04 -0000	1.2
  @@ -54,16 +54,15 @@
   package org.apache.jetspeed.components.portletentity;
   
   import java.util.HashMap;
  +import java.util.List;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
  -import org.apache.jetspeed.components.portletentity.PortletEntityNotDeletedException;
  -import org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException;
   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.Transaction;
  +import org.apache.jetspeed.om.preference.impl.PreferenceSetImpl;
   import org.apache.jetspeed.util.JetspeedObjectID;
   import org.apache.pluto.om.common.ObjectID;
   import org.apache.pluto.om.entity.PortletEntity;
  @@ -101,12 +100,13 @@
       }
       /**
        * @see org.apache.jetspeed.entity.PortletEntityAccessComponent#getPortletEntity(org.apache.pluto.om.common.ObjectID)
  +     * 
        */
  -    public PortletEntity getPortletEntity(ObjectID entityId)
  +    public StoreablePortletEntityDelegate getPortletEntity(ObjectID entityId)
       {
           if (entityCache.get(entityId) != null)
           {
  -            return (PortletEntity) entityCache.get(entityId);
  +            return wrapEntity((PortletEntityImpl) entityCache.get(entityId));
           }
           else
           {
  @@ -118,14 +118,14 @@
               PortletEntity portletEntity = (PortletEntity) store.getObjectByQuery(q);
   
               entityCache.put(entityId, portletEntity);
  -            return portletEntity;
  +            return wrapEntity((PortletEntityImpl) portletEntity);
           }
       }
   
       /**
        * @see org.apache.jetspeed.entity.PortletEntityAccessComponent#getPortletEntity(org.apache.pluto.om.portlet.PortletDefinition,
java.lang.String)
        */
  -    public PortletEntity getPortletEntity(PortletDefinition portletDefinition, String entityName)
  +    public StoreablePortletEntityDelegate getPortletEntity(PortletDefinition portletDefinition,
String entityName)
       {
           ObjectID entityId = JetspeedObjectID.createPortletEntityId(portletDefinition, entityName);
           PortletEntity portletEntity = getPortletEntity(entityId);
  @@ -134,17 +134,17 @@
               portletEntity = newPortletEntityInstance(portletDefinition);
               ((PortletEntityCtrl) portletEntity).setId(entityId.toString());
           }
  -        return portletEntity;
  +        return wrapEntity((PortletEntityImpl) portletEntity);
       }
   
       /**
        * @see org.apache.jetspeed.entity.PortletEntityAccessComponent#newPortletEntityInstance(org.apache.pluto.om.portlet.PortletDefinition)
        */
  -    public PortletEntity newPortletEntityInstance(PortletDefinition portletDefinition)
  +    public StoreablePortletEntityDelegate newPortletEntityInstance(PortletDefinition portletDefinition)
       {
  -		PortletEntityCtrl portletEntity = new PortletEntityImpl();
  -		portletEntity.setPortletDefinition(portletDefinition);
  -		return (PortletEntity) portletEntity;
  +        PortletEntityCtrl portletEntity = new PortletEntityImpl();
  +        portletEntity.setPortletDefinition(portletDefinition);
  +        return wrapEntity((PortletEntityImpl)  portletEntity);
   
       }
   
  @@ -162,7 +162,15 @@
           try
           {
               prepareTransaction(store);
  -            store.deletePersistent(this);
  +            if (portletEntity instanceof StoreablePortletEntityDelegate)
  +            {
  +				store.deletePersistent(((StoreablePortletEntityDelegate)portletEntity).getPortletEntity());
  +            }            
  +            else
  +            {
  +                store.deletePersistent(portletEntity);
  +            }
  +
               store.getTransaction().checkpoint();
           }
           catch (Exception e)
  @@ -182,21 +190,29 @@
        */
       public void storePortletEntity(PortletEntity portletEntity) throws PortletEntityNotStoredException
       {
  -		PersistenceStore store = getPersistenceStore();
  -	   try
  -	   {
  -		   prepareTransaction(store);
  -		   store.lockForWrite(portletEntity);
  -		   store.getTransaction().checkpoint();
  -	   }
  -	   catch (Exception e)
  -	   {
  -		   String msg = "Unable to store Portlet Entity.";
  -		   log.error(msg, e);
  -		   store.getTransaction().rollback();
  +        PersistenceStore store = getPersistenceStore();
  +        try
  +        {
  +            prepareTransaction(store);
  +            
  +			if (portletEntity instanceof StoreablePortletEntityDelegate)
  +			{
  +				store.lockForWrite(((StoreablePortletEntityDelegate)portletEntity).getPortletEntity());
  +			}            
  +			else
  +			{
  +				store.lockForWrite(portletEntity);
  +			}
  +            store.getTransaction().checkpoint();
  +        }
  +        catch (Exception e)
  +        {
  +            String msg = "Unable to store Portlet Entity.";
  +            log.error(msg, e);
  +            store.getTransaction().rollback();
   
  -		   throw new PortletEntityNotStoredException(msg, e);
  -	   }
  +            throw new PortletEntityNotStoredException(msg, e);
  +        }
   
       }
   
  @@ -217,6 +233,12 @@
       protected PersistenceStore getPersistenceStore()
       {
           return pContainer.getStoreForThread(storeName);
  +    }
  +    
  +    protected StoreablePortletEntityDelegate wrapEntity(PortletEntityImpl entity )
  +    {
  +		List list =(List) ((PreferenceSetImpl)entity.getPreferenceSet()).getInnerCollection();
  +		return new StoreablePortletEntityDelegate(entity, entity, list, getPersistenceStore());
       }
   
   }
  
  
  
  1.1                  jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/StoreablePortletEntityDelegate.java
  
  Index: StoreablePortletEntityDelegate.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Jetspeed" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Jetspeed", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.jetspeed.components.portletentity;
  
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Locale;
  
  import org.apache.commons.beanutils.BeanUtils;
  import org.apache.jetspeed.components.persistence.store.PersistenceStore;
  import org.apache.jetspeed.om.preference.impl.AbstractPreference;
  import org.apache.jetspeed.om.preference.impl.PreferenceSetImpl;
  import org.apache.pluto.om.common.Description;
  import org.apache.pluto.om.common.ObjectID;
  import org.apache.pluto.om.common.PreferenceSet;
  import org.apache.pluto.om.entity.PortletApplicationEntity;
  import org.apache.pluto.om.entity.PortletEntity;
  import org.apache.pluto.om.entity.PortletEntityCtrl;
  import org.apache.pluto.om.portlet.PortletDefinition;
  import org.apache.pluto.om.window.PortletWindowList;
  
  /**
   * <p>
   * StoreablePortletEntityDelegate
   * </p>
   * 
   * Use this wrapper when need to allow the portlet
   * container access to a PortletEntity.  It correctly
   * support reset() and store() methods.  It also uses
   * a cloned list of prefernce objects to user access
   * as opposed to directly manipulating the original
   * prefernces directly.
   * 
   * 
   * @
   * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
   * @version $ $
   *
   */
  public class StoreablePortletEntityDelegate implements PortletEntity, PortletEntityCtrl
  {
      private PersistenceStore store;
      private PortletEntity entity;
      private PortletEntityCtrl control;
      private List originalPreferences;
  
      protected PreferenceSetImpl mutatingPreferencesWrapper = new PreferenceSetImpl();
  
      protected List mutatingPreferences;
  
      public StoreablePortletEntityDelegate(
          PortletEntity entity,
          PortletEntityCtrl control,
          List originalPreferences,
  	    PersistenceStore store)
      {
          this.entity = entity;
          this.control = control;
          this.store = store;
  
      }
  
      /** 
       * <p>
       * getId
       * </p>
       * 
       * @see org.apache.pluto.om.entity.PortletEntity#getId()
       * @return
       */
      public ObjectID getId()
      {
          return entity.getId();
      }
  
      /** 
       * <p>
       * getPreferenceSet
       * </p>
       * 
       * @see org.apache.pluto.om.entity.PortletEntity#getPreferenceSet()
       * @return
       */
      public PreferenceSet getPreferenceSet()
      {
          return entity.getPreferenceSet();
      }
  
      /** 
       * <p>
       * getPortletDefinition
       * </p>
       * 
       * @see org.apache.pluto.om.entity.PortletEntity#getPortletDefinition()
       * @return
       */
      public PortletDefinition getPortletDefinition()
      {
          return entity.getPortletDefinition();
      }
  
      /** 
       * <p>
       * getPortletApplicationEntity
       * </p>
       * 
       * @see org.apache.pluto.om.entity.PortletEntity#getPortletApplicationEntity()
       * @return
       */
      public PortletApplicationEntity getPortletApplicationEntity()
      {
          return entity.getPortletApplicationEntity();
      }
  
      /** 
       * <p>
       * getPortletWindowList
       * </p>
       * 
       * @see org.apache.pluto.om.entity.PortletEntity#getPortletWindowList()
       * @return
       */
      public PortletWindowList getPortletWindowList()
      {
          return entity.getPortletWindowList();
      }
  
      /** 
       * <p>
       * getDescription
       * </p>
       * 
       * @see org.apache.pluto.om.entity.PortletEntity#getDescription(java.util.Locale)
       * @param locale
       * @return
       */
      public Description getDescription(Locale locale)
      {
          return getDescription(locale);
      }
  
      /** 
       * <p>
       * setId
       * </p>
       * 
       * @see org.apache.pluto.om.entity.PortletEntityCtrl#setId(java.lang.String)
       * @param id
       */
      public void setId(String id)
      {
          control.setId(id);
  
      }
  
      /** 
       * <p>
       * setPortletDefinition
       * </p>
       * 
       * @see org.apache.pluto.om.entity.PortletEntityCtrl#setPortletDefinition(org.apache.pluto.om.portlet.PortletDefinition)
       * @param portletDefinition
       */
      public void setPortletDefinition(PortletDefinition portletDefinition)
      {
          setPortletDefinition(portletDefinition);
  
      }
  
      /** 
       * <p>
       * store
       * </p>
       * 
       * @see org.apache.pluto.om.entity.PortletEntityCtrl#store()
       * @throws java.io.IOException
       */
      public void store() throws IOException
      {
          try
          {
  
              if (mutatingPreferences != null && mutatingPreferences.size() > 0)
              {
                  boolean originalPrefsExist = true;
                  if (originalPreferences == null)
                  {
                      originalPreferences = new ArrayList(mutatingPreferences.size());
                      originalPrefsExist = false;
                  }
  
                  try
                  {
                      for (int i = 0; i < mutatingPreferences.size(); i++)
                      {
                          AbstractPreference pref = (AbstractPreference) mutatingPreferences.get(i);
                          if (originalPrefsExist)
                          {
                              AbstractPreference orgPref = (AbstractPreference) originalPreferences.get(i);
                              if (orgPref != null)
                              {
                                  BeanUtils.copyProperties(orgPref, pref);
                              }
                              else
                              {
                                  originalPreferences.add(pref.clone());
                              }
  
                          }
                          else
                          {
                              originalPreferences.add(pref.clone());
                          }
  
                      }
                  }
                  catch (Exception e1)
                  {
                      throw new IOException("Unable to map mutated preferences into the originals:
" + e1.toString());
                  }
  
              }
  
              // PortletEntityAccess.storePortletEntity(this);
              // TODO: this is bad
              //		  PersistenceStoreContainer pContainer = (PersistenceStoreContainer) PicoBootstrapContainer.getComponentInstance(PersistenceStoreContainer.class);
              //		  PersistenceStore store = pContainer.getStore("jetspeed");
              //		  Transaction tx = store.getTransaction();
              //		  if(!tx.isOpen())
              //		  {
              //			  tx.begin();
              //		  }
              //		  store.lockForWrite(this);
              //		  tx.checkpoint();
          }
          catch (Exception e)
          {
              throw new IOException("Unable to store Portlet Entity. " + e.toString());
          }
  
      }
  
      /** 
       * <p>
       * reset
       * </p>
       * 
       * @see org.apache.pluto.om.entity.PortletEntityCtrl#reset()
       * @throws java.io.IOException
       */
      public void reset() throws IOException
      {
          initMutatingPreferences();
  
      }
  
      protected void initMutatingPreferences()
      {
          mutatingPreferences = new ArrayList(originalPreferences.size());
          if (originalPreferences != null)
          {
  
              Iterator itr = originalPreferences.iterator();
              while (itr.hasNext())
              {
                  AbstractPreference pref = (AbstractPreference) itr.next();
                  mutatingPreferences.add(pref.clone());
              }
          }
      }
  
      public PortletEntity getPortletEntity()
      {
          return entity;
      }
  
      public PortletEntityCtrl getPortletEntityCtrl()
      {
          return control;
      }
  
  }
  
  
  

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