weaver      2003/10/05 17:25:22

  Modified:    commons/src/java/org/apache/jetspeed/om/common/entity
                        PortletEntityImpl.java
  Log:
  - changes due to new Pluto drop
  
  Revision  Changes    Path
  1.5       +29 -6     
jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/om/common/entity/PortletEntityImpl.java
  
  Index: PortletEntityImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/om/common/entity/PortletEntityImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PortletEntityImpl.java    6 Aug 2003 19:46:28 -0000       1.4
  +++ PortletEntityImpl.java    6 Oct 2003 00:25:22 -0000       1.5
  @@ -55,6 +55,8 @@
   
   import java.util.Locale;
   
  +import javax.portlet.PreferencesValidator;
  +
   import org.apache.pluto.om.portlet.PortletDefinition;
   import org.apache.pluto.om.entity.PortletEntity;
   import org.apache.pluto.om.entity.PortletApplicationEntity;
  @@ -64,6 +66,9 @@
   import org.apache.pluto.om.common.PreferenceSet;
   import org.apache.pluto.util.StringUtils;
   
  +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.common.preference.PreferenceSetComposite;
   import org.apache.jetspeed.om.common.preference.PreferenceSetImpl;
   
  @@ -82,9 +87,11 @@
   public class PortletEntityImpl implements InitablePortletEntity
   {
   
  +    private static final Log log = LogFactory.getLog(PortletEntityImpl.class);
  +
       private JetspeedObjectID oid;
   
  -    protected PreferenceSetComposite preferences;    
  +    protected PreferenceSetComposite preferences;
   
       private PortletApplicationEntity applicationEntity = null;
   
  @@ -92,7 +99,7 @@
   
       private PortletEntity modifiedObject = null;
   
  -    private PortletDefinition portletDefinition = null;
  +    private PortletDefinitionComposite portletDefinition = null;
   
       public ObjectID getId()
       {
  @@ -187,11 +194,27 @@
               new String[] { "portletDefinition", "instanceName" },
               "init()");
   
  -        this.portletDefinition = portletDefinition;
  +        this.portletDefinition = (PortletDefinitionComposite) portletDefinition;
           oid = JetspeedObjectID.createPortletEntityId(portletDefinition, 
instanceName);
           preferences = new PreferenceSetImpl();
  -    }
  +        if (this.portletDefinition.getPreferenceValidatorClassname() != null)
  +        {
  +            String className = 
this.portletDefinition.getPreferenceValidatorClassname();
  +            log.info("Loading PreferenceValidator " + className);
  +            try
  +            {
  +                Class clazz = Class.forName(className);
  +                preferences.setPreferenceValidator((PreferencesValidator) 
clazz.newInstance());
  +            }
  +            catch (Exception e)
  +            {
  +                log.error(
  +                    "Unable create PreferenceValidator for portlet " + 
this.getPortletDefinition().getName() + ": " + e.toString(),
  +                    e);
  +            }
   
  -    
  +        }
  +
  +    }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to