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/jetspeed-api/src/java/org/apache/jetspeed/locator LocatorDescriptor.java TemplateLocator.java TemplateLocatorException.java TemplateDescriptor.java
Date Thu, 20 May 2004 15:58:58 GMT
weaver      2004/05/20 08:58:58

  Added:       jetspeed-api .cvsignore project.xml project.properties
                        maven.xml
               jetspeed-api/src/java/org/apache/jetspeed/idgenerator
                        IdGenerator.java
               jetspeed-api/src/java/org/apache/jetspeed/cache/file
                        FileCacheEventListener.java FileCacheEntry.java
               jetspeed-api/src/java/org/apache/jetspeed/locator
                        LocatorDescriptor.java TemplateLocator.java
                        TemplateLocatorException.java
                        TemplateDescriptor.java
  Log:
  JS2-30: Created jetspeed-api source branch
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed-2/jetspeed-api/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  target
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
  Copyright 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.
  -->
  <project>
  <extend>${basedir}/../project.xml</extend>
    <pomVersion>3</pomVersion>
    <id>jetspeed-api</id>
    <groupId>jetspeed2</groupId>
    <name>Jetspeed-2 Core API</name>
    <currentVersion>2.0-a1-dev</currentVersion>
    <package>org.apache.jetspeed</package>
    <description>
  	  Core API for implmeneting Jetspeed
    </description>
    <shortDescription>Helps locate resources on the file system.</shortDescription>
  
    <repository>                 
      <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-jetspeed-2/components/jetspeed</connection>
      <url>http://cvs.apache.org/viewcvs/jakarta-jetspeed-2/components/jetspeed/</url>
    </repository>
  
    <dependencies>
      <dependency>
        <id>jetspeed2:jetspeed-commons</id>
        <version>2.0-a1-dev</version>
      </dependency>
      <dependency>
        <id>commons-logging</id>
        <version>1.0.3</version>
      </dependency>
      <dependency>
        <id>junit</id>
        <version>3.8.1</version>
      </dependency>
      <dependency>
        <id>log4j</id>
        <version>1.2.6</version>
      </dependency>
      <dependency>
        <id>pluto</id>
        <version>1.0.1-SNAPSHOT</version>
      </dependency>   
       <dependency>      
        <id>portlet-api</id>
        <version>1.0</version>
      </dependency>
      <dependency>
        <id>servletapi</id>
        <version>2.3</version>
      </dependency>  
    </dependencies>
    <build>
      <sourceDirectory>src/java</sourceDirectory>
       <resources>
        <resource>
          <directory>${basedir}/src/java</directory>
          <excludes>
            <exclude>**/*.java</exclude>
          </excludes>
        </resource>
      </resources>
      <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
      <unitTest>
         <includes>
          <include>**/Test*.java</include>
        </includes>
        <excludes>
        </excludes>
        <resources>
          <resource>
            <directory>${basedir}/src/test</directory>
            <excludes>
             <exclude>**/*.java</exclude>
            </excludes>
          </resource>
        </resources>
      </unitTest>
      
    </build>
  
    <reports>
      <report>maven-jdepend-plugin</report>
  <!--
      <report>maven-checkstyle-plugin</report>
  -->
  <!--
      <report>maven-pmd-plugin</report>
      <report>maven-changelog-plugin</report>
      <report>maven-file-activity-plugin</report>
      <report>maven-developer-activity-plugin</report>
      <report>maven-license-plugin</report>
      <report>maven-javadoc-plugin</report>
      <report>maven-jxr-plugin</report>
      <report>maven-junit-report-plugin</report>
      <report>maven-linkcheck-plugin</report>
      <report>maven-tasklist-plugin</report>
  -->
    </reports>  
  </project>
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/project.properties
  
  Index: project.properties
  ===================================================================
  # Copyright 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.
  
  # Remote repos
  maven.repo.remote = http://www.bluesunrise.com/maven/, http://www.ibiblio.org/maven/,http://dist.codehaus.org
  
  # Display the date on the Maven web site
  maven.xdoc.date = left
  
  # Display the maven version the web site is documenting
  maven.xdoc.version = ${pom.currentVersion}
  
  maven.checkstyle.header.file=${basedir}/../../checkstyle.license
  maven.checkstyle.properties=${basedir}/../../checkstyle.xml
  
  maven.license.licenseFile=${basedir}/../../LICENSE.TXT
  
  maven.compile.deprecation=on
  
  # Include private method and field in Javadoc.
  maven.javadoc.private=true
  
  # Removed the rule ${plugin.resources}/rulesets/naming.xml from the default
  # maven.pmd.rulesetfiles.  This is because the LongVariableName rule is to
  # restrictive.  We need to increase the limit from 12 to 20
  maven.pmd.rulesetfiles=${plugin.resources}/rulesets/strings.xml,${plugin.resources}/rulesets/junit.xml,${plugin.resources}/rulesets/braces.xml,${plugin.resources}/rulesets/basic.xml,${plugin.resources}/rulesets/unusedcode.xml,${plugin.resources}/rulesets/design.xml,${plugin.resources}/rulesets/imports.xml,${plugin.resources}/rulesets/codesize.xml
  
  # Include private method and field in Javadoc.
  maven.multiproject.type=jar
  
  maven.junit.fork=true
  
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/maven.xml
  
  Index: maven.xml
  ===================================================================
  <!--
  Copyright 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.
  -->
  <project default="java:jar"
           xmlns:j="jelly:core" 
           xmlns:define="jelly:define"
           xmlns:reactor="reactor">
  
     
     <goal name="deployJar">
    	<attainGoal name="jar:install"/>
    	<copy file="${basedir}/target/${maven.final.name}.jar" todir="${deploy.war.dir}/jetspeed/WEB-INF/lib"/>
    </goal>
  
  </project>
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/idgenerator/IdGenerator.java
  
  Index: IdGenerator.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.idgenerator;
  
  
  /**
   * This service handles the generation of unique identifiers
   *
   * @author <a href="mailto:paulsp@apache.org">Paul Spencer</a>
   * @version $Id: IdGenerator.java,v 1.1 2004/05/20 15:58:58 weaver Exp $
   */
  public interface IdGenerator
  {
      /**
       * Generate a Unique Portlet Entity ID
       *
       * @return Unique Portlet Entity ID
       */    
      public String getNextPeid();
      
  }
  
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/cache/file/FileCacheEventListener.java
  
  Index: FileCacheEventListener.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.cache.file;
  
  
  /**
   * FileCacheEventListener on notifications sent when FileCache events occur
   *
   *  @author David S. Taylor <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   *  @version $Id: FileCacheEventListener.java,v 1.1 2004/05/20 15:58:58 weaver Exp $
   */
  
  public interface FileCacheEventListener
  {
  
      /**
       * Refresh event, called when the entry is being refreshed from file system.
       *
       * @param entry the entry being refreshed.
       */
      void refresh(FileCacheEntry entry);
  
      /**
       * Evict event, called when the entry is being evicted out of the cache
       *
       * @param entry the entry being refreshed.
       */
      void evict(FileCacheEntry entry);
  
  }
  
  
  
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/cache/file/FileCacheEntry.java
  
  Index: FileCacheEntry.java
  ===================================================================
  /*
   * Copyright 2000-2001,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.cache.file;
  
  import java.io.File;
  import java.util.Date;
  
  /**
   * @author <a href="weaver@apache.org">Scott T. Weaver</a>
   *
   */
  public interface FileCacheEntry
  {
      /**
       * Get the file descriptor
       *
       * @return the file descriptor
       */
      File getFile();
  
      /**
       * Set the file descriptor
       *
       * @param file the new file descriptor
       */
      void setFile( File file );
  
      /**
       * Set the cache's last accessed stamp
       *
       * @param lastAccessed the cache's last access stamp
       */
      void setLastAccessed( long lastAccessed );
  
      /**
       * Get the cache's lastAccessed stamp
       *
       * @return the cache's last accessed stamp
       */
      long getLastAccessed();
  
      /**
       * Set the cache's last modified stamp
       *
       * @param lastModified the cache's last modified stamp
       */
      void setLastModified( Date lastModified );
  
      /**
       * Get the entry's lastModified stamp (which may be stale compared to file's stamp)
       *
       * @return the last modified stamp
       */
      Date getLastModified();
  
      /**
       * Set the Document in the cache
       *
       * @param document the document being cached
       */
      void setDocument( Object document );
  
      /**
       * Get the Document
       *
       * @return the document being cached
       */
      Object getDocument();
  }
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/locator/LocatorDescriptor.java
  
  Index: LocatorDescriptor.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.locator;
  
  /**
   * LocatorDescriptor
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: LocatorDescriptor.java,v 1.1 2004/05/20 15:58:58 weaver Exp $
   */
  public interface LocatorDescriptor
  {
      public final static String PARAM_TYPE               = "type";    
      public final static String PARAM_MEDIA_TYPE         = "media-type";
      public final static String PARAM_NAME               = "name";
      public final static String PARAM_LANGUAGE           = "language";
      public final static String PARAM_COUNTRY            = "country";    
      public final static String TYPE_EMAIL               = "emails";
      public final static String TYPE_PORTLET             = "portlets";
      
    
      /*
       * Gets the unique template locator string, which is a combination of the params
       * The string must follow the one the sequences below, where bracketed items are optional:
       *
       *   template/<templateType>/[media-type/<mediaType>]/[language/<language>]/[country/<country>]]/name/<templateName
       *
       * @return The template locator as a string
       */
      String toString();
  
      /*
       * Gets the path locator string, which is a combination of the params without the name
tags.
       * The string must follow the one the sequences below, where bracketed items are optional:
       *
       *   <templateType>/[<mediaType>]/[<language>]/[<country>]]/<templateName>
       *
       * @return The template locator path
       */
      String toPath();
      
      /*
       * Gets the template type parameter for this template.
       * Any value is valid if there the service supports it.
       * Known values are email, portlet.
       *
       * @return The template type parameter for this template.
       */
      String getType();
  
      /*
       * Sets the template type parameter for this template.
       * Any value is valid if there the service supports it.
       * Known values are email, portlet.
       *
       * @param The template type parameter for this template.
       */
      void setType(String type);
  
      /*
       * Gets the resource name parameter for this template.
       *
       * @return The resource name parameter for this template.
       */
      String getName();
  
      /*
       * Sets the resource name parameter for this template.
       *
       * @param name The resource name parameter for this template.
       */
      void setName(String name);
  
      /*
       * Gets the media type parameter for this template.
       * Media types are values such as html, wml, xml ...
       * TODO: support for 2 or more media types
       * 
       * @return The media type parameter for this template.
       */
       String getMediaType();
  
      /*
       * Sets the media type parameter for this template.
       * Media types are values such as html, wml, xml ...
       * TODO: support for 2 or more media types
       *
       * @param mediaType The media type parameter for this template.
       */
       void setMediaType(String mediaType);
  
      /*
       * Gets the language parameter for this template.
       * Language values are ISO-639 standard language abbreviations
       * en, fr, de, ...
       *
       * @return The language parameter for this template.
       */
       String getLanguage();
  
      /*
       * Sets the language parameter for this template.
       * Language values are ISO-639 standard language abbreviations
       * en, fr, de, ...
       *
       * @param language The language parameter for this template.
       */
       void setLanguage(String language);
  
      /*
       * Gets the country code parameter for this template.
       * Country code values are ISO-3166 standard country code abbreviations.
       * GB, US, FR, CA, DE, ...
       *
       * @return The country code parameter for this template.
       */
       String getCountry();
  
      /*
       * Sets the country code parameter for this template.
       * Country code values are ISO-3166 standard country code abbreviations.
       * GB, US, FR, CA, DE, ...
       *
       * @param country The country code parameter for this template.
       */
       void setCountry(String country);
  
   
      /**
       * @see Object#clone
       * @return an instance copy of this object
       */
       Object clone() throws java.lang.CloneNotSupportedException;
      
  }
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/locator/TemplateLocator.java
  
  Index: TemplateLocator.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.locator;
  
  import java.util.Iterator;
  
  /**
   * TemplateLocator interface
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: TemplateLocator.java,v 1.1 2004/05/20 15:58:58 weaver Exp $
   */
  public interface TemplateLocator
  {        
      /**
       * Locate an template using Jetspeed template location algorithm
       *
       * @param locator The template locator
       * @return The template found, or null if not found.
       * @throws TemplateLocatorException
       */
      TemplateDescriptor locateTemplate(LocatorDescriptor locator)
          throws TemplateLocatorException;
  
      /**
       * Factory to create template locators of the given type.
       * Known supported locator types, but not limited to: 
       *      <code>portlet</code>
       *      <code>email</code>
       * 
       * @param The type of locator to create
       * @return a general template locator of the given type
       * @throws TemplateLocatorException if factory exception or if not valid locator type
       */
      LocatorDescriptor createLocatorDescriptor(String type)
          throws TemplateLocatorException;
  
      /**
       * Creates a locator from a string of format (where brackets are optional]:
       *
       *   template/<templateType>/[media-type/<mediaType>]/[language/<language>]/[country/<country>]]/name/<templateName
       * 
       * @param string the string representation of a template locator 
       * @throws TemplateLocatorException
       */        
      LocatorDescriptor createFromString(String string)
          throws TemplateLocatorException;
          
      /** 
       * Query for a collection of templates given template locator criteria.
       *
       * @param locator The template locator criteria.
       * @return The result list of {@link Template} objects matching the locator criteria.
       */
      public Iterator query(LocatorDescriptor locator);
      
  }
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/locator/TemplateLocatorException.java
  
  Index: TemplateLocatorException.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.locator;
  
  /**
   * TemplateLocatorException
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: TemplateLocatorException.java,v 1.1 2004/05/20 15:58:58 weaver Exp $
   */
  public class TemplateLocatorException extends Exception
  {
      public TemplateLocatorException() 
      {
          super();
      }
      
      public TemplateLocatorException(String message) 
      {
          super(message);
      }
      
      public TemplateLocatorException(Throwable nested)
      {
          super(nested);
      }
      
      public TemplateLocatorException(String msg, Throwable nested)
      {
          super(msg, nested);
      }
      
  }
  
  
  
  1.1                  jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/locator/TemplateDescriptor.java
  
  Index: TemplateDescriptor.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.locator;
  
  /**
   * TemplateDescriptor
   *
   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
   * @version $Id: TemplateDescriptor.java,v 1.1 2004/05/20 15:58:58 weaver Exp $
   */
  public interface TemplateDescriptor extends LocatorDescriptor
  {
      /**
       * The absolute file system path to the template
       *  
       * @return absolute path
       */    
      String getAbsolutePath();
      
      /**
       * The absolute file system path to the template
       *  
       * @param absolute path
       */    
      void setAbsolutePath(String path);
      
  	/**
  	 * Returns the template path relative to the applications root
  	 * @return Application-relative path
  	 */
  	public String getAppRelativePath();
  	/**
  	 * Sets the template path relative to the applications root
  	 * @param string Application-relative path
  	 */
  	public void setAppRelativePath(String string);
  }
  
  
  

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