You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2004/09/15 23:41:19 UTC

svn commit: rev 46134 - in incubator/lenya/trunk/src/java/org/apache/lenya: cms/cocoon/components/modules/input cms/metadata/dublincore cms/publication/task xml

Author: andreas
Date: Wed Sep 15 14:41:18 2004
New Revision: 46134

Modified:
   incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/AccessControlModule.java
   incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DublinCoreModule.java
   incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCore.java
   incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCoreImpl.java
   incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCoreProxy.java
   incubator/lenya/trunk/src/java/org/apache/lenya/cms/publication/task/PublicationTask.java
   incubator/lenya/trunk/src/java/org/apache/lenya/xml/DOMUtil.java
Log:
added javadocs, removed deprecated stuff

Modified: incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/AccessControlModule.java
==============================================================================
--- incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/AccessControlModule.java	(original)
+++ incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/AccessControlModule.java	Wed Sep 15 14:41:18 2004
@@ -15,7 +15,7 @@
  *
  */
 
-/* $Id: AccessControlModule.java,v 1.12 2004/03/01 16:18:24 gregor Exp $  */
+/* $Id$  */
 
 package org.apache.lenya.cms.cocoon.components.modules.input;
 
@@ -64,7 +64,7 @@
     /**
       * The names of the AccessControlModule parameters.
       */
-    public static final String[] PARAMETER_NAMES =
+    static final String[] PARAMETER_NAMES =
         {
             IP_ADDRESS,
             USER_ID,
@@ -166,7 +166,7 @@
      * Returns the item manager for a certain name.
      * @param request The request.
      * @param name The name of the manager ({@link #USER_MANAGER},
-     * {@link #ROLE_MANAGER}, {@link #GROUP_MANAGER}, or {@link IP_RANGE_MANAGER}
+     * {@link #ROLE_MANAGER}, {@link #GROUP_MANAGER}, or {@link #IP_RANGE_MANAGER}
      * @return An item manager.
      * @throws ConfigurationException when something went wrong.
      */

Modified: incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DublinCoreModule.java
==============================================================================
--- incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DublinCoreModule.java	(original)
+++ incubator/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/DublinCoreModule.java	Wed Sep 15 14:41:18 2004
@@ -37,13 +37,13 @@
 public class DublinCoreModule extends AbstractPageEnvelopeModule {
 
     /**
-     * @see org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String, org.apache.avalon.framework.configuration.Configuration, java.util.Map)
+     * @see org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String,
+     *      org.apache.avalon.framework.configuration.Configuration, java.util.Map)
      */
     public Object getAttribute(String name, Configuration modeConf, Map objectModel)
-        throws ConfigurationException {
+            throws ConfigurationException {
 
-        if (!Arrays.asList(DublinCoreImpl.ELEMENTS).contains(name)
-            && !Arrays.asList(DublinCoreImpl.TERMS).contains(name)) {
+        if (!DublinCoreImpl.isValidElement(name) && !DublinCoreImpl.isValidTerm(name)) {
             throw new ConfigurationException("The attribute [" + name + "] is not supported!");
         }
 
@@ -56,33 +56,34 @@
         try {
             value = document.getDublinCore().getFirstValue(name);
         } catch (DocumentException e) {
-            throw new ConfigurationException(
-                "Obtaining dublin core value for [" + name + "] failed: ",
-                e);
+            throw new ConfigurationException("Obtaining dublin core value for [" + name
+                    + "] failed: ", e);
         }
 
         return value;
     }
 
     /**
-     * @see org.apache.cocoon.components.modules.input.InputModule#getAttributeNames(org.apache.avalon.framework.configuration.Configuration, java.util.Map)
+     * @see org.apache.cocoon.components.modules.input.InputModule#getAttributeNames(org.apache.avalon.framework.configuration.Configuration,
+     *      java.util.Map)
      */
     public Iterator getAttributeNames(Configuration modeConf, Map objectModel)
-        throws ConfigurationException {
+            throws ConfigurationException {
 
         List names = new ArrayList();
-        names.addAll(Arrays.asList(DublinCoreImpl.ELEMENTS));
-        names.addAll(Arrays.asList(DublinCoreImpl.TERMS));
+        names.addAll(Arrays.asList(DublinCoreImpl.getElements()));
+        names.addAll(Arrays.asList(DublinCoreImpl.getTerms()));
         return names.iterator();
     }
 
     /**
-     * @see org.apache.cocoon.components.modules.input.InputModule#getAttributeValues(java.lang.String, org.apache.avalon.framework.configuration.Configuration, java.util.Map)
+     * @see org.apache.cocoon.components.modules.input.InputModule#getAttributeValues(java.lang.String,
+     *      org.apache.avalon.framework.configuration.Configuration, java.util.Map)
      */
     public Object[] getAttributeValues(String name, Configuration modeConf, Map objectModel)
-        throws ConfigurationException {
-        Object[] objects = { getAttribute(name, modeConf, objectModel)};
+            throws ConfigurationException {
+        Object[] objects = { getAttribute(name, modeConf, objectModel) };
         return objects;
     }
 
-}
+}
\ No newline at end of file

Modified: incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCore.java
==============================================================================
--- incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCore.java	(original)
+++ incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCore.java	Wed Sep 15 14:41:18 2004
@@ -15,67 +15,340 @@
  *
  */
 
-/* $Id$  */
-
 package org.apache.lenya.cms.metadata.dublincore;
 
 import org.apache.lenya.cms.publication.DocumentException;
 
+/**
+ * <p>
+ * Dublin core metadata interface.
+ * </p>
+ * <p>
+ * The descriptions are citing the <a href="http://www.dublincore.org">Dublin Core website </a>.
+ * </p>
+ * 
+ * @version $Id:$
+ */
 public interface DublinCore {
 
+    /**
+     * A name given to the resource. Typically, Title will be a name by which the resource is
+     * formally known.
+     */
     String ELEMENT_TITLE = "title";
+
+    /**
+     * An entity primarily responsible for making the content of the resource. Examples of Creator
+     * include a person, an organization, or a service. Typically, the name of a Creator should be
+     * used to indicate the entity.
+     */
     String ELEMENT_CREATOR = "creator";
+
+    /**
+     * A topic of the content of the resource. Typically, Subject will be expressed as keywords, key
+     * phrases or classification codes that describe a topic of the resource. Recommended best
+     * practice is to select a value from a controlled vocabulary or formal classification scheme.
+     */
     String ELEMENT_SUBJECT = "subject";
+
+    /**
+     * An account of the content of the resource. Examples of Description include, but is not
+     * limited to: an abstract, table of contents, reference to a graphical representation of
+     * content or a free-text account of the content.
+     */
     String ELEMENT_DESCRIPTION = "description";
+
+    /**
+     * An entity responsible for making the resource available. Examples of Publisher include a
+     * person, an organization, or a service. Typically, the name of a Publisher should be used to
+     * indicate the entity.
+     */
     String ELEMENT_PUBLISHER = "publisher";
+
+    /**
+     * An entity responsible for making contributions to the content of the resource. Examples of
+     * Contributor include a person, an organization, or a service. Typically, the name of a
+     * Contributor should be used to indicate the entity.
+     */
     String ELEMENT_CONTRIBUTOR = "contributor";
+
+    /**
+     * A date of an event in the lifecycle of the resource. Typically, Date will be associated with
+     * the creation or availability of the resource. Recommended best practice for encoding the date
+     * value is defined in a profile of ISO 8601 [W3CDTF] and includes (among others) dates of the
+     * form YYYY-MM-DD.
+     */
     String ELEMENT_DATE = "date";
+
+    /**
+     * The nature or genre of the content of the resource. Type includes terms describing general
+     * categories, functions, genres, or aggregation levels for content. Recommended best practice
+     * is to select a value from a controlled vocabulary (for example, the DCMI Type Vocabulary
+     * [DCT1]). To describe the physical or digital manifestation of the resource, use the FORMAT
+     * element.
+     */
     String ELEMENT_TYPE = "type";
+
+    /**
+     * The physical or digital manifestation of the resource. Typically, Format may include the
+     * media-type or dimensions of the resource. Format may be used to identify the software,
+     * hardware, or other equipment needed to display or operate the resource. Examples of
+     * dimensions include size and duration. Recommended best practice is to select a value from a
+     * controlled vocabulary (for example, the list of Internet Media Types [MIME] defining computer
+     * media formats).
+     */
     String ELEMENT_FORMAT = "format";
+
+    /**
+     * An unambiguous reference to the resource within a given context. Recommended best practice is
+     * to identify the resource by means of a string or number conforming to a formal identification
+     * system. Formal identification systems include but are not limited to the Uniform Resource
+     * Identifier (URI) (including the Uniform Resource Locator (URL)), the Digital Object
+     * Identifier (DOI) and the International Standard Book Number (ISBN).
+     */
     String ELEMENT_IDENTIFIER = "identifier";
+
+    /**
+     * A Reference to a resource from which the present resource is derived. The present resource
+     * may be derived from the Source resource in whole or in part. Recommended best practice is to
+     * identify the referenced resource by means of a string or number conforming to a formal
+     * identification system.
+     */
     String ELEMENT_SOURCE = "source";
+
+    /**
+     * A language of the intellectual content of the resource. Recommended best practice is to use
+     * RFC 3066 [RFC3066] which, in conjunction with ISO639 [ISO639]), defines two- and three-letter
+     * primary language tags with optional subtags. Examples include "en" or "eng" for English,
+     * "akk" for Akkadian", and "en-GB" for English used in the United Kingdom.
+     */
     String ELEMENT_LANGUAGE = "language";
+
+    /**
+     * A reference to a related resource. Recommended best practice is to identify the referenced
+     * resource by means of a string or number conforming to a formal identification system.
+     */
     String ELEMENT_RELATION = "relation";
+
+    /**
+     * The extent or scope of the content of the resource. Typically, Coverage will include spatial
+     * location (a place name or geographic coordinates), temporal period (a period label, date, or
+     * date range) or jurisdiction (such as a named administrative entity). Recommended best
+     * practice is to select a value from a controlled vocabulary (for example, the Thesaurus of
+     * Geographic Names [TGN]) and to use, where appropriate, named places or time periods in
+     * preference to numeric identifiers such as sets of coordinates or date ranges.
+     */
     String ELEMENT_COVERAGE = "coverage";
+
+    /**
+     * Information about rights held in and over the resource. Typically, Rights will contain a
+     * rights management statement for the resource, or reference a service providing such
+     * information. Rights information often encompasses Intellectual Property Rights (IPR),
+     * Copyright, and various Property Rights. If the Rights element is absent, no assumptions may
+     * be made about any rights held in or over the resource.
+     */
     String ELEMENT_RIGHTS = "rights";
 
-    String TERM_AUDIENCE = "audience";
-    String TERM_ALTERNATIVE = "alternative";
-    String TERM_TABLEOFCONTENTS = "tableOfContents";
+    /**
+     * A summary of the content of the resource.
+     */
     String TERM_ABSTRACT = "abstract";
-    String TERM_CREATED = "created";
-    String TERM_VALID = "valid";
+
+    /**
+     * Information about who can access the resource or an indication of its security status. Access
+     * Rights may include information regarding access or restrictions based on privacy, security or
+     * other regulations.
+     */
+    String TERM_ACCESSRIGHTS = "accessRights";
+
+    /**
+     * Any form of the title used as a substitute or alternative to the formal title of the
+     * resource. This qualifier can include Title abbreviations as well as translations.
+     */
+    String TERM_ALTERNATIVE = "alternative";
+
+    /**
+     * A class of entity for whom the resource is intended or useful. A class of entity may be
+     * determined by the creator or the publisher or by a third party.
+     */
+    String TERM_AUDIENCE = "audience";
+
+    /**
+     * Date (often a range) that the resource will become or did become available.
+     */
     String TERM_AVAILABLE = "available";
-    String TERM_ISSUED = "issued";
-    String TERM_MODIFIED = "modified";
+
+    /**
+     * A bibliographic reference for the resource. Recommended practice is to include sufficient
+     * bibliographic detail to identify the resource as unambiguously as possible, whether or not
+     * the citation is in a standard form.
+     */
+    String TERM_BIBLIOGRAPHICCITATION = "bibliographicCitation";
+
+    /**
+     * A reference to an established standard to which the resource conforms.
+     */
+    String TERM_CONFORMSTO = "conformsTo";
+
+    /**
+     * Date of creation of the resource.
+     */
+    String TERM_CREATED = "created";
+
+    /**
+     * Date of acceptance of the resource (e.g. of thesis by university department, of article by
+     * journal, etc.).
+     */
+    String TERM_DATEACCEPTED = "dateAccepted";
+
+    /**
+     * Date of a statement of copyright.
+     */
+    String TERM_DATECOPYRIGHTED = "dateCopyrighted";
+
+    /**
+     * Date of submission of the resource (e.g. thesis, articles, etc.).
+     */
+    String TERM_DATESUBMITTED = "dateSubmitted";
+
+    /**
+     * A general statement describing the education or training context. Alternatively, a more
+     * specific statement of the location of the audience in terms of its progression through an
+     * education or training context.
+     */
+    String TERM_EDUCATIONLEVEL = "educationLevel";
+
+    /**
+     * The size or duration of the resource.
+     */
     String TERM_EXTENT = "extent";
-    String TERM_MEDIUM = "medium";
-    String TERM_ISVERSIONOF = "isVersionOf";
+
+    /**
+     * The described resource pre-existed the referenced resource, which is essentially the same
+     * intellectual content presented in another format.
+     */
+    String TERM_HASFORMAT = "hasFormat";
+
+    /**
+     * The described resource includes the referenced resource either physically or logically.
+     */
+    String TERM_HASPART = "hasPart";
+
+    /**
+     * The described resource has a version, edition, or adaptation, namely, the referenced
+     * resource.
+     */
     String TERM_HASVERSION = "hasVersion";
-    String TERM_ISREPLACEDBY = "isReplacedBy";
-    String TERM_REPLACES = "replaces";
-    String TERM_ISREQUIREDBY = "isRequiredBy";
-    String TERM_REQUIRES = "requires";
+
+    /**
+     * The described resource is the same intellectual content of the referenced resource, but
+     * presented in another format.
+     */
+    String TERM_ISFORMATOF = "isFormatOf";
+
+    /**
+     * The described resource is a physical or logical part of the referenced resource.
+     */
     String TERM_ISPARTOF = "isPartOf";
-    String TERM_HASPART = "hasPart";
+
+    /**
+     * The described resource is referenced, cited, or otherwise pointed to by the referenced
+     * resource.
+     */
     String TERM_ISREFERENCEDBY = "isReferencedBy";
+
+    /**
+     * The described resource is supplanted, displaced, or superseded by the referenced resource.
+     */
+    String TERM_ISREPLACEDBY = "isReplacedBy";
+
+    /**
+     * The described resource is required by the referenced resource, either physically or
+     * logically.
+     */
+    String TERM_ISREQUIREDBY = "isRequiredBy";
+
+    /**
+     * Date of formal issuance (e.g., publication) of the resource.
+     */
+    String TERM_ISSUED = "issued";
+
+    /**
+     * The described resource is a version, edition, or adaptation of the referenced resource.
+     * Changes in version imply substantive changes in content rather than differences in format.
+     */
+    String TERM_ISVERSIONOF = "isVersionOf";
+
+    /**
+     * A legal document giving official permission to do something with the resource. Recommended
+     * best practice is to identify the license using a URI. Examples of such licenses can be found
+     * at http://creativecommons.org/licenses/.
+     */
+    String TERM_LICENSE = "license";
+
+    /**
+     * A class of entity that mediates access to the resource and for whom the resource is intended
+     * or useful. The audiences for a resource are of two basic classes: (1) an ultimate beneficiary
+     * of the resource, and (2) frequently, an entity that mediates access to the resource. The
+     * mediator element refinement represents the second of these two classes.
+     */
+    String TERM_MEDIATOR = "mediator";
+
+    /**
+     * The material or physical carrier of the resource.
+     */
+    String TERM_MEDIUM = "medium";
+
+    /**
+     * Date on which the resource was changed.
+     */
+    String TERM_MODIFIED = "modified";
+
+    /**
+     * The described resource references, cites, or otherwise points to the referenced resource.
+     */
     String TERM_REFERENCES = "references";
-    String TERM_ISFORMATOF = "isFormatOf";
-    String TERM_HASFORMAT = "hasFormat";
-    String TERM_CONFORMSTO = "conformsTo";
+
+    /**
+     * The described resource supplants, displaces, or supersedes the referenced resource.
+     */
+    String TERM_REPLACES = "replaces";
+
+    /**
+     * The described resource requires the referenced resource to support its function, delivery, or
+     * coherence of content.
+     */
+    String TERM_REQUIRES = "requires";
+
+    /**
+     * A person or organization owning or managing rights over the resource. Recommended best
+     * practice is to use the URI or name of the Rights Holder to indicate the entity.
+     */
+    String TERM_RIGHTSHOLDER = "rightsHolder";
+
+    /**
+     * Spatial characteristics of the intellectual content of the resource.
+     */
     String TERM_SPATIAL = "spatial";
+
+    /**
+     * A list of subunits of the content of the resource.
+     */
+    String TERM_TABLEOFCONTENTS = "tableOfContents";
+
+    /**
+     * Temporal characteristics of the intellectual content of the resource.
+     */
     String TERM_TEMPORAL = "temporal";
-    String TERM_MEDIATOR = "mediator";
-    String TERM_DATEACCEPTED = "dateAccepted";
-    String TERM_DATECOPYRIGHTED = "dateCopyrighted";
-    String TERM_DATESUBMITTED = "dateSubmitted";
-    String TERM_EDUCATIONLEVEL = "educationLevel";
-    String TERM_ACCESSRIGHTS = "accessRights";
-    String TERM_BIBLIOGRAPHICCITATION = "bibliographicCitation";
+
+    /**
+     * Date (often a range) of validity of a resource.
+     */
+    String TERM_VALID = "valid";
 
     /**
      * Save the meta data.
-     *
+     * 
      * @throws DocumentException if the meta data could not be made persistent.
      */
     void save() throws DocumentException;
@@ -112,14 +385,14 @@
      */
     void addValue(String key, String value) throws DocumentException;
 
-	/**
-	 * Add all values for a certain key.
-	 * 
-	 * @param key The key
-	 * @param values The value to add
-	 * @throws DocumentException if something went wrong
-	 */
-	void addValues(String key, String[] values) throws DocumentException;
+    /**
+     * Add all values for a certain key.
+     * 
+     * @param key The key
+     * @param values The value to add
+     * @throws DocumentException if something went wrong
+     */
+    void addValues(String key, String[] values) throws DocumentException;
 
     /**
      * Removes a specific value for a certain key.
@@ -135,13 +408,12 @@
      * @throws DocumentException when something went wrong.
      */
     void removeAllValues(String key) throws DocumentException;
-    
-	/**
-	 * Replace the contents of the current dublin core by the 
-	 * contents of other.
-	 * @param other The other dublin core object.
-	 * @throws DocumentException if an error occurs.
-	 */
+
+    /**
+     * Replace the contents of the current dublin core by the contents of other.
+     * @param other The other dublin core object.
+     * @throws DocumentException if an error occurs.
+     */
     void replaceBy(DublinCore other) throws DocumentException;
 
-}
+}
\ No newline at end of file

Modified: incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCoreImpl.java
==============================================================================
--- incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCoreImpl.java	(original)
+++ incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCoreImpl.java	Wed Sep 15 14:41:18 2004
@@ -40,8 +40,8 @@
 import org.xml.sax.SAXException;
 
 /**
- * Access dublin core meta data in documents.
- * This class uses the dublin core specification from 2003-03-04.
+ * Access dublin core meta data in documents. This class uses the dublin core specification from
+ * 2003-03-04.
  */
 public class DublinCoreImpl {
     private Document cmsdocument;
@@ -58,23 +58,12 @@
     /**
      * The dublin core elements.
      */
-    public static final String[] ELEMENTS =
-        {
-            DublinCore.ELEMENT_TITLE,
-            DublinCore.ELEMENT_CREATOR,
-            DublinCore.ELEMENT_SUBJECT,
-            DublinCore.ELEMENT_DESCRIPTION,
-            DublinCore.ELEMENT_PUBLISHER,
-            DublinCore.ELEMENT_CONTRIBUTOR,
-            DublinCore.ELEMENT_DATE,
-            DublinCore.ELEMENT_TYPE,
-            DublinCore.ELEMENT_FORMAT,
-            DublinCore.ELEMENT_IDENTIFIER,
-            DublinCore.ELEMENT_SOURCE,
-            DublinCore.ELEMENT_LANGUAGE,
-            DublinCore.ELEMENT_RELATION,
-            DublinCore.ELEMENT_COVERAGE,
-            DublinCore.ELEMENT_RIGHTS };
+    static final String[] ELEMENTS = { DublinCore.ELEMENT_TITLE, DublinCore.ELEMENT_CREATOR,
+            DublinCore.ELEMENT_SUBJECT, DublinCore.ELEMENT_DESCRIPTION,
+            DublinCore.ELEMENT_PUBLISHER, DublinCore.ELEMENT_CONTRIBUTOR, DublinCore.ELEMENT_DATE,
+            DublinCore.ELEMENT_TYPE, DublinCore.ELEMENT_FORMAT, DublinCore.ELEMENT_IDENTIFIER,
+            DublinCore.ELEMENT_SOURCE, DublinCore.ELEMENT_LANGUAGE, DublinCore.ELEMENT_RELATION,
+            DublinCore.ELEMENT_COVERAGE, DublinCore.ELEMENT_RIGHTS };
 
     private static final String DCTERMS_NAMESPACE = "http://purl.org/dc/terms/";
     private static final String DCTERMS_PREFIX = "dcterms";
@@ -82,44 +71,22 @@
     /**
      * The dublin core terms.
      */
-    public static final String[] TERMS =
-        {
-            DublinCore.TERM_AUDIENCE,
-            DublinCore.TERM_ALTERNATIVE,
-            DublinCore.TERM_TABLEOFCONTENTS,
-            DublinCore.TERM_ABSTRACT,
-            DublinCore.TERM_CREATED,
-            DublinCore.TERM_VALID,
-            DublinCore.TERM_EXTENT,
-            DublinCore.TERM_AVAILABLE,
-            DublinCore.TERM_ISSUED,
-            DublinCore.TERM_MODIFIED,
-            DublinCore.TERM_EXTENT,
-            DublinCore.TERM_MEDIUM,
-            DublinCore.TERM_ISVERSIONOF,
-            DublinCore.TERM_HASVERSION,
-            DublinCore.TERM_ISREPLACEDBY,
-            DublinCore.TERM_REPLACES,
-            DublinCore.TERM_ISREQUIREDBY,
-            DublinCore.TERM_REQUIRES,
-            DublinCore.TERM_ISPARTOF,
-            DublinCore.TERM_HASPART,
-            DublinCore.TERM_ISREFERENCEDBY,
-            DublinCore.TERM_REFERENCES,
-            DublinCore.TERM_ISFORMATOF,
-            DublinCore.TERM_HASFORMAT,
-            DublinCore.TERM_CONFORMSTO,
-            DublinCore.TERM_SPATIAL,
-            DublinCore.TERM_TEMPORAL,
-            DublinCore.TERM_MEDIATOR,
-            DublinCore.TERM_DATEACCEPTED,
-            DublinCore.TERM_DATECOPYRIGHTED,
-            DublinCore.TERM_DATESUBMITTED,
-            DublinCore.TERM_EDUCATIONLEVEL,
-            DublinCore.TERM_ACCESSRIGHTS,
+    static final String[] TERMS = { DublinCore.TERM_AUDIENCE, DublinCore.TERM_ALTERNATIVE,
+            DublinCore.TERM_TABLEOFCONTENTS, DublinCore.TERM_ABSTRACT, DublinCore.TERM_CREATED,
+            DublinCore.TERM_VALID, DublinCore.TERM_EXTENT, DublinCore.TERM_AVAILABLE,
+            DublinCore.TERM_ISSUED, DublinCore.TERM_MODIFIED, DublinCore.TERM_EXTENT,
+            DublinCore.TERM_LICENSE, DublinCore.TERM_MEDIUM, DublinCore.TERM_ISVERSIONOF,
+            DublinCore.TERM_HASVERSION, DublinCore.TERM_ISREPLACEDBY, DublinCore.TERM_REPLACES,
+            DublinCore.TERM_ISREQUIREDBY, DublinCore.TERM_REQUIRES, DublinCore.TERM_ISPARTOF,
+            DublinCore.TERM_HASPART, DublinCore.TERM_ISREFERENCEDBY, DublinCore.TERM_REFERENCES,
+            DublinCore.TERM_RIGHTSHOLDER, DublinCore.TERM_ISFORMATOF, DublinCore.TERM_HASFORMAT,
+            DublinCore.TERM_CONFORMSTO, DublinCore.TERM_SPATIAL, DublinCore.TERM_TEMPORAL,
+            DublinCore.TERM_MEDIATOR, DublinCore.TERM_DATEACCEPTED,
+            DublinCore.TERM_DATECOPYRIGHTED, DublinCore.TERM_DATESUBMITTED,
+            DublinCore.TERM_EDUCATIONLEVEL, DublinCore.TERM_ACCESSRIGHTS,
             DublinCore.TERM_BIBLIOGRAPHICCITATION };
 
-    /** 
+    /**
      * Creates a new instance of Dublin Core
      * 
      * @param aDocument the document for which the Dublin Core instance is created.
@@ -128,11 +95,8 @@
      */
     protected DublinCoreImpl(Document aDocument) throws DocumentException {
         this.cmsdocument = aDocument;
-        infofile =
-            cmsdocument.getPublication().getPathMapper().getFile(
-                cmsdocument.getPublication(),
-                cmsdocument.getArea(),
-                cmsdocument.getId(),
+        infofile = cmsdocument.getPublication().getPathMapper().getFile(
+                cmsdocument.getPublication(), cmsdocument.getArea(), cmsdocument.getId(),
                 cmsdocument.getLanguage());
         loadValues();
     }
@@ -167,8 +131,8 @@
                     Element[] children = helper.getChildren(metaElement, elementNames[i]);
                     String[] values = new String[children.length];
                     for (int valueIndex = 0; valueIndex < children.length; valueIndex++) {
-                        values[valueIndex] =
-                            DocumentHelper.getSimpleElementText(children[valueIndex]);
+                        values[valueIndex] = DocumentHelper
+                                .getSimpleElementText(children[valueIndex]);
                     }
                     maps[type].put(elementNames[i], values);
                 }
@@ -179,7 +143,7 @@
 
     /**
      * Save the meta data.
-     *
+     * 
      * @throws DocumentException if the meta data could not be made persistent.
      */
     public void save() throws DocumentException {
@@ -211,8 +175,8 @@
                 }
                 String[] values = (String[]) maps[type].get(elementNames[i]);
                 for (int valueIndex = 0; valueIndex < values.length; valueIndex++) {
-                    Element valueElement =
-                        helper.createElement(elementNames[i], values[valueIndex]);
+                    Element valueElement = helper
+                            .createElement(elementNames[i], values[valueIndex]);
                     metaElement.appendChild(valueElement);
                 }
             }
@@ -237,8 +201,8 @@
      * @throws DocumentException if an error occurs.
      */
     protected Element getMetaElement(org.w3c.dom.Document doc) throws DocumentException {
-        NamespaceHelper namespaceHelper =
-            new NamespaceHelper(PageEnvelope.NAMESPACE, PageEnvelope.DEFAULT_PREFIX, doc);
+        NamespaceHelper namespaceHelper = new NamespaceHelper(PageEnvelope.NAMESPACE,
+                PageEnvelope.DEFAULT_PREFIX, doc);
         Element documentElement = doc.getDocumentElement();
         Element metaElement = namespaceHelper.getFirstChild(documentElement, META);
 
@@ -271,7 +235,7 @@
     }
 
     /**
-     * Returns the element or term values, resp.,  for a certain key.
+     * Returns the element or term values, resp., for a certain key.
      * @param key The key.
      * @return An array of strings.
      * @throws DocumentException if an error occurs.
@@ -286,8 +250,8 @@
         } else if (termList.contains(key)) {
             values = (String[]) terms.get(key);
         } else {
-            throw new DocumentException(
-                "The key [" + key + "] does not refer to a dublin core element or term!");
+            throw new DocumentException("The key [" + key
+                    + "] does not refer to a dublin core element or term!");
         }
         if (values == null) {
             values = new String[0];
@@ -326,17 +290,21 @@
         } else if (termList.contains(key)) {
             terms.put(key, newValues);
         } else {
-            throw new DocumentException(
-                "The key [" + key + "] does not refer to a dublin core element or term!");
+            throw new DocumentException("The key [" + key
+                    + "] does not refer to a dublin core element or term!");
         }
     }
-	
+
     /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setValue(java.lang.String, java.lang.String)
+     * @param key The key.
+     * @param value The value.
+     * @throws DocumentException if an error occurs.
+     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setValue(java.lang.String,
+     *      java.lang.String)
      */
     public void setValue(String key, String value) throws DocumentException {
         String[] newValues = { value };
-        
+
         List elementList = Arrays.asList(ELEMENTS);
         List termList = Arrays.asList(TERMS);
         if (elementList.contains(key)) {
@@ -344,30 +312,38 @@
         } else if (termList.contains(key)) {
             terms.put(key, newValues);
         } else {
-            throw new DocumentException(
-                "The key [" + key + "] does not refer to a dublin core element or term!");
+            throw new DocumentException("The key [" + key
+                    + "] does not refer to a dublin core element or term!");
         }
     }
-    
-	/**
-	 * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#addValues(java.lang.String, java.lang.String[])
-	 */
-	public void addValues(String key, String[] values) throws DocumentException {
-		for (int i = 0; i < values.length; i++) {
-            addValue(key,values[i]);
+
+    /**
+     * @param key The key.
+     * @param values The values.
+     * @throws DocumentException if an error occurs.
+     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#addValues(java.lang.String,
+     *      java.lang.String[])
+     */
+    public void addValues(String key, String[] values) throws DocumentException {
+        for (int i = 0; i < values.length; i++) {
+            addValue(key, values[i]);
         }
-	}
-	
+    }
+
     /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#removeValue(java.lang.String, java.lang.String)
+     * @param key The key.
+     * @param value The value.
+     * @throws DocumentException if an error occurs.
+     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#removeValue(java.lang.String,
+     *      java.lang.String)
      */
     public void removeValue(String key, String value) throws DocumentException {
         String[] existingValues = getElementOrTerm(key);
         List list = new ArrayList(Arrays.asList(existingValues));
 
         if (!list.contains(value)) {
-            throw new DocumentException(
-                "The key [" + key + "] does not contain the value [" + value + "]!");
+            throw new DocumentException("The key [" + key + "] does not contain the value ["
+                    + value + "]!");
         }
 
         list.remove(value);
@@ -380,12 +356,14 @@
         } else if (termList.contains(key)) {
             terms.put(key, newValues);
         } else {
-            throw new DocumentException(
-                "The key [" + key + "] does not refer to a dublin core element or term!");
+            throw new DocumentException("The key [" + key
+                    + "] does not refer to a dublin core element or term!");
         }
     }
 
     /**
+     * @param key The key.
+     * @throws DocumentException if an error occurs.
      * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#removeAllValues(java.lang.String)
      */
     public void removeAllValues(String key) throws DocumentException {
@@ -396,16 +374,18 @@
         } else if (termList.contains(key)) {
             terms.put(key, new String[0]);
         } else {
-            throw new DocumentException(
-                "The key [" + key + "] does not refer to a dublin core element or term!");
+            throw new DocumentException("The key [" + key
+                    + "] does not refer to a dublin core element or term!");
         }
     }
-    
-	/**
-	 * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#replaceBy(org.apache.lenya.cms.publication.DublinCore)
-	 */
-	public void replaceBy(DublinCore other) throws DocumentException {
-		for (int i = 0; i < ELEMENTS.length; i++) {
+
+    /**
+     * @param other The other dublin core.
+     * @throws DocumentException if an error occurs.
+     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#replaceBy(org.apache.lenya.cms.metadata.dublincore.DublinCore)
+     */
+    public void replaceBy(DublinCore other) throws DocumentException {
+        for (int i = 0; i < ELEMENTS.length; i++) {
             String key = ELEMENTS[i];
             removeAllValues(key);
             addValues(key, other.getValues(key));
@@ -415,6 +395,40 @@
             removeAllValues(key);
             addValues(key, other.getValues(key));
         }
-	}
+    }
+
+    /**
+     * Returns the term keys.
+     * @return An array of strings.
+     */
+    public static String[] getTerms() {
+        return (String[]) Arrays.asList(TERMS).toArray(new String[TERMS.length]);
+    }
+
+    /**
+     * Returns the element keys.
+     * @return An array of strings.
+     */
+    public static String[] getElements() {
+        return (String[]) Arrays.asList(ELEMENTS).toArray(new String[ELEMENTS.length]);
+    }
+
+    /**
+     * Checks if a key represents a valid dublin core term.
+     * @param key The key.
+     * @return A boolean value.
+     */
+    public static boolean isValidTerm(String key) {
+        return Arrays.asList(DublinCoreImpl.TERMS).contains(key);
+    }
+
+    /**
+     * Checks if a key represents a valid dublin core element.
+     * @param key The key.
+     * @return A boolean value.
+     */
+    public static boolean isValidElement(String key) {
+        return Arrays.asList(DublinCoreImpl.ELEMENTS).contains(key);
+    }
 
-}
+}
\ No newline at end of file

Modified: incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCoreProxy.java
==============================================================================
--- incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCoreProxy.java	(original)
+++ incubator/lenya/trunk/src/java/org/apache/lenya/cms/metadata/dublincore/DublinCoreProxy.java	Wed Sep 15 14:41:18 2004
@@ -55,146 +55,6 @@
     }
 
     /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#getCreator()
-     */
-    public String getCreator() throws DocumentException {
-        return instance().getFirstValue(DublinCore.ELEMENT_CREATOR);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#getDateCreated()
-     */
-    public String getDateCreated() throws DocumentException {
-        return instance().getFirstValue(DublinCore.TERM_CREATED);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#getDateIssued()
-     */
-    public String getDateIssued() throws DocumentException {
-        return instance().getFirstValue(DublinCore.TERM_ISSUED);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#getDescription()
-     */
-    public String getDescription() throws DocumentException {
-        return instance().getFirstValue(DublinCore.ELEMENT_DESCRIPTION);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#getIdentifier()
-     */
-    public String getIdentifier() throws DocumentException {
-        return instance().getFirstValue(DublinCore.ELEMENT_IDENTIFIER);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#getPublisher()
-     */
-    public String getPublisher() throws DocumentException {
-        return instance().getFirstValue(DublinCore.ELEMENT_PUBLISHER);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#getRights()
-     */
-    public String getRights() throws DocumentException {
-        return instance().getFirstValue(DublinCore.ELEMENT_RIGHTS);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#getIsReferencedBy()
-     */
-    public String getIsReferencedBy() throws DocumentException {
-        return instance().getFirstValue(DublinCore.TERM_ISREFERENCEDBY);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#getSubject()
-     */
-    public String getSubject() throws DocumentException {
-        return instance().getFirstValue(DublinCore.ELEMENT_SUBJECT);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#getTitle()
-     */
-    public String getTitle() throws DocumentException {
-        return instance().getFirstValue(DublinCore.ELEMENT_TITLE);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setCreator(java.lang.String)
-     */
-    public void setCreator(String creator) throws DocumentException {
-        instance().setValue(DublinCore.ELEMENT_CREATOR, creator);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setDateCreated(java.lang.String)
-     */
-    public void setDateCreated(String dateCreated) throws DocumentException {
-        instance().setValue(DublinCore.TERM_CREATED, dateCreated);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setDateIssued(java.lang.String)
-     */
-    public void setDateIssued(String dateIssued) throws DocumentException {
-        instance().setValue(DublinCore.TERM_ISSUED, dateIssued);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setDescription(java.lang.String)
-     */
-    public void setDescription(String description) throws DocumentException {
-        instance().setValue(DublinCore.ELEMENT_DESCRIPTION, description);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setIdentifier(java.lang.String)
-     */
-    public void setIdentifier(String identifier) throws DocumentException {
-        instance().setValue(DublinCore.ELEMENT_IDENTIFIER, identifier);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setPublisher(java.lang.String)
-     */
-    public void setPublisher(String publisher) throws DocumentException {
-        instance().setValue(DublinCore.ELEMENT_PUBLISHER, publisher);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setRights(java.lang.String)
-     */
-    public void setRights(String rights) throws DocumentException {
-        instance().setValue(DublinCore.ELEMENT_RIGHTS, rights);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setIsReferencedBy(java.lang.String)
-     */
-    public void setIsReferencedBy(String isReferencedBy) throws DocumentException {
-        instance().setValue(DublinCore.TERM_ISREFERENCEDBY, isReferencedBy);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setSubject(java.lang.String)
-     */
-    public void setSubject(String subject) throws DocumentException {
-        instance().setValue(DublinCore.ELEMENT_SUBJECT, subject);
-    }
-
-    /**
-     * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#setTitle(java.lang.String)
-     */
-    public void setTitle(String title) throws DocumentException {
-        instance().setValue(DublinCore.ELEMENT_TITLE, title);
-    }
-
-    /**
      * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#save()
      */
     public void save() throws DocumentException {
@@ -238,7 +98,7 @@
     }
     
 	/**
-	 * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#replaceBy(org.apache.lenya.cms.publication.DublinCore)
+	 * @see org.apache.lenya.cms.metadata.dublincore.DublinCore#replaceBy(org.apache.lenya.cms.metadata.dublincore.DublinCore)
 	 */
 	public void replaceBy(DublinCore other) throws DocumentException {
 		instance().replaceBy(other);

Modified: incubator/lenya/trunk/src/java/org/apache/lenya/cms/publication/task/PublicationTask.java
==============================================================================
--- incubator/lenya/trunk/src/java/org/apache/lenya/cms/publication/task/PublicationTask.java	(original)
+++ incubator/lenya/trunk/src/java/org/apache/lenya/cms/publication/task/PublicationTask.java	Wed Sep 15 14:41:18 2004
@@ -15,7 +15,7 @@
  *
  */
 
-/* $Id: PublicationTask.java,v 1.7 2004/03/01 16:18:27 gregor Exp $  */
+/* $Id$  */
 
 package org.apache.lenya.cms.publication.task;
 
@@ -73,9 +73,7 @@
      * Copies the resources of a document to another document.
      * @param sourceDocument The source document.
      * @param destinationDocument The destination document.
-     * @throws PublicationException when something went wrong.
      * @throws ExecutionException when something went wrong.
-     * @throws IOException when something went wrong.
      */
     protected void copyResources(Document sourceDocument, Document destinationDocument)
         throws ExecutionException {
@@ -172,8 +170,7 @@
     /**
      * Invokes the workflow on a document.
      * @param document The document.
-     * @throws ParameterException when something went wrong.
-     * @throws WorkflowException when something went wrong.
+     * @throws ExecutionException when something went wrong.
      */
     protected void triggerWorkflow(Document document) throws ExecutionException {
 
@@ -268,6 +265,7 @@
     /**
      * Returns the role IDs.
      * @return An array of strings.
+     * @throws ParameterException when the parameter does not exist.
      */
     protected String[] getRoleIDs() throws ParameterException {
         String rolesString = getParameters().getParameter(PARAMETER_ROLE_IDS);

Modified: incubator/lenya/trunk/src/java/org/apache/lenya/xml/DOMUtil.java
==============================================================================
--- incubator/lenya/trunk/src/java/org/apache/lenya/xml/DOMUtil.java	(original)
+++ incubator/lenya/trunk/src/java/org/apache/lenya/xml/DOMUtil.java	Wed Sep 15 14:41:18 2004
@@ -15,7 +15,7 @@
  *
  */
 
-/* $Id: DOMUtil.java,v 1.18 2004/07/16 15:01:08 andreas Exp $  */
+/* $Id$  */
 
 package org.apache.lenya.xml;
 

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org