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 ta...@apache.org on 2001/07/09 09:37:13 UTC

cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile BaseProfileLocator.java ProfileLocator.java BaseProfile.java Profile.java

taylor      01/07/09 00:37:13

  Modified:    src/java/org/apache/jetspeed/om/profile BaseProfile.java
                        Profile.java
  Added:       src/java/org/apache/jetspeed/om/profile
                        BaseProfileLocator.java ProfileLocator.java
  Log:
  - added new interface ProfileLocator for specifying criteria to the Profiler
  - added base implementation of ProfileLocator
  
  Revision  Changes    Path
  1.7       +5 -44     jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/BaseProfile.java
  
  Index: BaseProfile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/BaseProfile.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BaseProfile.java	2001/06/25 10:50:17	1.6
  +++ BaseProfile.java	2001/07/09 07:37:12	1.7
  @@ -55,7 +55,6 @@
   package org.apache.jetspeed.om.profile;
   
   import org.apache.turbine.util.RunData;
  -import org.apache.turbine.services.BaseInitable;
   
   import org.apache.jetspeed.portal.PortletSet;
   import org.apache.jetspeed.services.PortalToolkit;
  @@ -64,26 +63,23 @@
   /**
   Provides base functionality within a Registry.
   
  -@author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  -@version $Id: BaseProfile.java,v 1.6 2001/06/25 10:50:17 raphael Exp $
  +@author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  +@version $Id: BaseProfile.java,v 1.7 2001/07/09 07:37:12 taylor Exp $
   */
   
  -public class BaseProfile extends BaseInitable implements Profile
  +public class BaseProfile  extends BaseProfileLocator implements Profile
   {
   
       private String url;
   
  -    private String page = null;
  -    private String group = null;
  -    private String role = null;
       private PSMLDocument doc = null;
   
       public BaseProfile()
       {}
   
       /**
  -       Gets the URL for this profile, a path and resource name
  -
  +      * Gets the URL for this profile, a path and resource name
  +      * @deprecated
          @return The URL of the profile
        */
       public String getURL()
  @@ -91,11 +87,6 @@
           return this.url;
       }
   
  -    public void init()
  -    {
  -        setInit(true);
  -    }
  -
       public void setURL(String url)
       {
           this.url = url;
  @@ -140,36 +131,6 @@
           {
               PsmlManager.saveDocument(doc);
           }
  -    }
  -
  -    public void setGroup( String group )
  -    {
  -        this.group = group;
  -    }
  -
  -    public void setRole( String role )
  -    {
  -        this.role = role;
  -    }
  -
  -    public void setPage( String page )
  -    {
  -        this.page = page;
  -    }
  -
  -    public String getGroup()
  -    {
  -        return group;
  -    }
  -
  -    public String getRole()
  -    {
  -        return role;
  -    }
  -
  -    public String getPage()
  -    {
  -        return page;
       }
   
   }
  
  
  
  1.6       +21 -21    jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/Profile.java
  
  Index: Profile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/Profile.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Profile.java	2001/06/04 17:43:13	1.5
  +++ Profile.java	2001/07/09 07:37:12	1.6
  @@ -54,7 +54,6 @@
   
   package org.apache.jetspeed.om.profile;
   
  -import org.apache.turbine.services.Initable;
   import org.apache.jetspeed.portal.PortletSet;
   import java.util.Enumeration;
   import org.apache.turbine.util.RunData;
  @@ -63,39 +62,40 @@
   Represents a profile, the interface to a PSML resource.
   
   @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
  -@version $Id: Profile.java,v 1.5 2001/06/04 17:43:13 raphael Exp $
  +@version $Id: Profile.java,v 1.6 2001/07/09 07:37:12 taylor Exp $
   */
   
  -public interface Profile extends Initable
  +public interface Profile extends ProfileLocator
   {
  -    /**
  -       Gets the root set of portlets for this profile object.
  -
  -       @return The root portlet set for this profile.
  +    /*
  +     *  Gets the root set of portlets for this profile object.
  +     *
  +     *  @deprecated Will be removed with refactoring of profiler service.
  +     *  @return The root portlet set for this profile.
        */
       public PortletSet getRootSet();
  -
  -    /**
  -       Gets the psml document attached to this profile
   
  -       @return The PSML document for this profile.
  +    /*
  +     * Gets the psml document attached to this profile
  +     *
  +     * @return The PSML document for this profile.
        */
       public PSMLDocument getDocument();
  -
  -    /**
  -       Gets the URL for this profile, a fully qualified local path and resource name
   
  -       @return The URL of the profile
  +    /*
  +     * Gets the URL for this profile, a fully qualified local path and resource name
  +     *
  +     * @deprecated Will be removed with refactoring of profiler service.
  +     * @return The URL of the profile
        */
       public String getURL();
  -
       public void setURL(String url);
  -
  -    /**
  -       stores the resource by merging and rewriting the psml file
   
  -       @throws ProfileException if an error occurs storing the profile
  -    */
  +    /*
  +     * stores the resource by merging and rewriting the psml file
  +     *
  +     * @throws ProfileException if an error occurs storing the profile
  +     */
       public void store() throws ProfileException;
   
   }
  
  
  
  1.1                  jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/BaseProfileLocator.java
  
  Index: BaseProfileLocator.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2001 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" or
   *    "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.om.profile;
  
  
  /**
   * Interface definition for a Profile Locator.
   * Locators are used by the profiler to describe the parameters used to locate
   * a resource in the persistent configuration store.
   *
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: BaseProfileLocator.java,v 1.1 2001/07/09 07:37:12 taylor Exp $
  */
  
  public class BaseProfileLocator implements ProfileLocator
  {
      // instance state
      private String name;
      private String mediaType;
      private String language;
      private String country;
      private String user;
      private String role;
      private String group;
  
      /*
       * Gets the resource name parameter for this profile.
       *
       * @return The resource name parameter for this profile.
       */
      public String getName()
      {
          return name;
      }
  
      /*
       * Sets the resource name parameter for this profile.
       *
       * @param The resource name parameter for this profile.
       */
      public void setName(String name)
      {
          this.name = name;
      }
  
      /*
       * Gets the media type parameter for this profile.
       * Media types are values such as html, wml, xml ...
       *
       * @return The media type parameter for this profile.
       */
      public String getMediaType()
      {
          return mediaType;
      }
  
      /*
       * Sets the media type parameter for this profile.
       * Media types are values such as html, wml, xml ...
       *
       * @param The media type parameter for this profile.
       */
      public void setMediaType(String mediaType)
      {
          this.mediaType = mediaType;
      }
  
      /*
       * Gets the language parameter for this profile.
       * Language values are ISO-639 standard language abbreviations
       * en, fr, de, ...
       *
       * @return The language parameter for this profile.
       */
      public String getLanguage()
      {
          return language;
      }
  
      /*
       * Sets the language parameter for this profile.
       * Language values are ISO-639 standard language abbreviations
       * en, fr, de, ...
       *
       * @param The language parameter for this profile.
       */
      public void setLanguage(String language)
      {
          this.language = language;
      }
  
      /*
       * Gets the country code parameter for this profile.
       * Country code values are ISO-3166 standard country code abbreviations.
       * GB, US, FR, CA, DE, ...
       *
       * @return The country code parameter for this profile.
       */
      public String getCountry()
      {
          return country;
      }
  
      /*
       * Sets the country code parameter for this profile.
       * Country code values are ISO-3166 standard country code abbreviations.
       * GB, US, FR, CA, DE, ...
       *
       * @param The country code parameter for this profile.
       */
      public void setCountry(String country)
      {
          this.country = country;
      }
  
      /*
       * Gets the user parameter for this profile.
       *
       * @return The user parameter for this profile.
       */
      public String getUser()
      {
          return user;
      }
  
      /*
       * Sets the user parameter for this profile.
       *
       * @param The user parameter for this profile.
       */
      public void setUser(String user)
      {
          this.user = user;
      }
  
      /*
       * Gets the role parameter for this profile.
       *
       * @return The role parameter for this profile.
       */
      public String getRole()
      {
          return role;
      }
  
      /*
       * Sets the role parameter for this profile.
       *
       * @param The role parameter for this profile.
       */
      public void setRole( String role )
      {
          this.role = role;
      }
  
      /*
       * Gets the group parameter for this profile.
       *
       * @return The group parameter for this profile.
       */
      public String getGroup()
      {
          return group;
      }
  
      /*
       * Sets the group parameter for this profile.
       *
       * @param The group parameter for this profile.
       */
      public void setGroup( String group )
      {
          this.group = group;
      }
  
  }
  
  
  
  1.1                  jakarta-jetspeed/src/java/org/apache/jetspeed/om/profile/ProfileLocator.java
  
  Index: ProfileLocator.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2000-2001 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" or
   *    "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.om.profile;
  
  
  /**
   * Interface definition for a Profile Locator.
   * Locators are used by the profiler to describe the parameters used to locate
   * a resource in the persistent configuration store.
   *
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: ProfileLocator.java,v 1.1 2001/07/09 07:37:13 taylor Exp $
  */
  
  public interface ProfileLocator
  {
      /*
       * Gets the resource name parameter for this profile.
       *
       * @return The resource name parameter for this profile.
       */
      String getName();
  
      /*
       * Sets the resource name parameter for this profile.
       *
       * @param The resource name parameter for this profile.
       */
      void setName(String name);
  
      /*
       * Gets the media type parameter for this profile.
       * Media types are values such as html, wml, xml ...
       *
       * @return The media type parameter for this profile.
       */
      String getMediaType();
  
      /*
       * Sets the media type parameter for this profile.
       * Media types are values such as html, wml, xml ...
       *
       * @param The media type parameter for this profile.
       */
      void setMediaType(String mediaType);
  
      /*
       * Gets the language parameter for this profile.
       * Language values are ISO-639 standard language abbreviations
       * en, fr, de, ...
       *
       * @return The language parameter for this profile.
       */
      String getLanguage();
  
      /*
       * Sets the language parameter for this profile.
       * Language values are ISO-639 standard language abbreviations
       * en, fr, de, ...
       *
       * @param The language parameter for this profile.
       */
      void setLanguage(String language);
  
      /*
       * Gets the country code parameter for this profile.
       * Country code values are ISO-3166 standard country code abbreviations.
       * GB, US, FR, CA, DE, ...
       *
       * @return The country code parameter for this profile.
       */
      String getCountry();
  
      /*
       * Sets the country code parameter for this profile.
       * Country code values are ISO-3166 standard country code abbreviations.
       * GB, US, FR, CA, DE, ...
       *
       * @param The country code parameter for this profile.
       */
      void setCountry(String country);
  
      /*
       * Gets the user parameter for this profile.
       *
       * @return The user parameter for this profile.
       */
      String getUser();
  
      /*
       * Sets the user parameter for this profile.
       *
       * @param The user parameter for this profile.
       */
      void setUser(String user);
  
      /*
       * Gets the role parameter for this profile.
       *
       * @return The role parameter for this profile.
       */
      String getRole();
  
      /*
       * Sets the role parameter for this profile.
       *
       * @param The role parameter for this profile.
       */
      void setRole( String role );
  
      /*
       * Gets the group parameter for this profile.
       *
       * @return The group parameter for this profile.
       */
      String getGroup();
  
      /*
       * Sets the group parameter for this profile.
       *
       * @param The group parameter for this profile.
       */
      void setGroup( String group );
  
  }
  
  
  

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