lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication DublinCore.java
Date Tue, 12 Aug 2003 10:04:28 GMT
egli        2003/08/12 03:04:28

  Modified:    src/java/org/apache/lenya/cms/publication DublinCore.java
  Log:
  Added javadoc fixes and fixed some checkstyle warnings.
  
  Revision  Changes    Path
  1.12      +141 -139  cocoon-lenya/src/java/org/apache/lenya/cms/publication/DublinCore.java
  
  Index: DublinCore.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/DublinCore.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DublinCore.java	11 Aug 2003 16:04:39 -0000	1.11
  +++ DublinCore.java	12 Aug 2003 10:04:28 -0000	1.12
  @@ -70,147 +70,149 @@
    * @author <a href="mailto:gregor@apache.org">Gregor J. Rothfuss</a>
    */
   public class DublinCore {
  -    private Document cmsdocument;
  -    private File infofile;
  -    private NodeList nodelist;
  -    private String string;
  +	private Document cmsdocument;
  +	private File infofile;
  +	private NodeList nodelist;
  +	private String string;
   
       private static final String DC_NAMESPACE = "http://purl.org/dc/elements/1.1/";
   
  -    /** 
  -     * Creates a new instance of Dublin Core
  +	/** 
  +	 * Creates a new instance of Dublin Core
        * 
  -     */
  -    protected DublinCore(Document mydocument) {
  -        this.cmsdocument = mydocument;
  -        this.infofile =
  -            cmsdocument.getPublication().getPathMapper().getFile(
  -                cmsdocument.getPublication(),
  -                cmsdocument.getPublication().AUTHORING_AREA,
  -                cmsdocument.getId(),
  -                cmsdocument.getLanguage());
  -    }
  -
  -    /**
  -     * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  -     */
  -    public String getTitle() throws PublicationException {
  -        return getDCNode("title");
  -    }
  -
  -    /**
  -     * Set the DC title
  -     * 
  -     * @param title the title
  -     */
  -    public void setTitle(String title) {
  -        setDCNode("title", title);
  -    }
  -
  -    /**
  -     * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  -     */
  -    public String getCreator() throws PublicationException {
  -        return getDCNode("creator");
  -    }
  -
  -    /**
  -     * Set the DC creator
  -     * 
  -     * @param creator the Creator
  -     */
  -    public void setCreator(String creator) {
  -        setDCNode("creator", creator);
  -    }
  -
  -    /**
  -     * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  -     */
  -    public String getSubject() throws PublicationException {
  -        return getDCNode("subject");
  -    }
  -
  -    private String getDCNode(String node) {
  -        try {
  -            nodelist =
  +     * @param mydocument the document for which the Dublin Core instance is created.
  +	 * 
  +	 */
  +	protected DublinCore(Document mydocument) {
  +		this.cmsdocument = mydocument;
  +		this.infofile =
  +			cmsdocument.getPublication().getPathMapper().getFile(
  +				cmsdocument.getPublication(),
  +				Publication.AUTHORING_AREA,
  +				cmsdocument.getId(),
  +				cmsdocument.getLanguage());
  +	}
  +
  +	/**
  +	 * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  +	 */
  +	public String getTitle() throws PublicationException {
  +		return getDCNode("title");
  +	}
  +
  +	/**
  +	 * Set the DC title
  +	 * 
  +	 * @param title the title
  +	 */
  +	public void setTitle(String title) {
  +		setDCNode("title", title);
  +	}
  +
  +	/**
  +	 * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  +	 */
  +	public String getCreator() throws PublicationException {
  +		return getDCNode("creator");
  +	}
  +
  +	/**
  +	 * Set the DC creator
  +	 * 
  +	 * @param creator the Creator
  +	 */
  +	public void setCreator(String creator) {
  +		setDCNode("creator", creator);
  +	}
  +
  +	/**
  +	 * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  +	 */
  +	public String getSubject() throws PublicationException {
  +		return getDCNode("subject");
  +	}
  +
  +	private String getDCNode(String node) {
  +		try {
  +			nodelist =
                   DocumentHelper.readDocument(infofile).getElementsByTagNameNS(DC_NAMESPACE,
node);
  -            try {
  -                string = nodelist.item(0).getFirstChild().getNodeValue();
  -            } catch (Exception e) {
  -                string = "";
  -            }
  -        } catch (Exception e) {
  -            string = e.toString();
  -        }
  -
  -        return string;
  -    }
  -
  -    private void setDCNode(String node, String text) {
  -        org.w3c.dom.Document document;
  -        try {
  -            document = DocumentHelper.readDocument(infofile);
  -            nodelist = document.getElementsByTagNameNS(DC_NAMESPACE, node);
  -            nodelist.item(0).getFirstChild().setNodeValue(text);
  -            DocumentHelper.writeDocument(document, infofile);
  -        } catch (Exception e) {
  -            string = e.toString();
  -        }
  -    }
  -
  -    /**
  -     * Set the DC Subject
  -     * 
  -     * @param subject the subject
  -     */
  -    public void setSubject(String subject) {
  -        setDCNode("subject", subject);
  -    }
  -
  -    /**
  -     * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  -     */
  -    public String getDescription() throws PublicationException {
  -        return getDCNode("description");
  -    }
  -
  -    /**
  -     * Set the DC Description
  -     * 
  -     * @param description the description
  -     */
  -    public void setDescription(String description) {
  -        setDCNode("description", description);
  -    }
  -
  -    /**
  -     * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  -     */
  -    public String getRights() throws PublicationException {
  -        return getDCNode("rights");
  -    }
  -
  -    /**
  -     * Set the DC Rights
  -     * 
  -     * @param rights the rights
  -     */
  -    public void setRights(String rights) {
  -        setDCNode("rights", rights);
  -    }
  -
  -    /**
  -     * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  -     */
  -    public String getIdentifier() throws PublicationException {
  -        return getDCNode("identifier");
  -    }
  -    /**
  -     * Set the DC Identifier
  -     * 
  -     * @param identifier The identifier
  -     */
  -    public void setIdentifier(String identifier) {
  -        setDCNode("identifier", identifier);
  -    }
  +			try {
  +				string = nodelist.item(0).getFirstChild().getNodeValue();
  +			} catch (Exception e) {
  +				string = "";
  +			}
  +		} catch (Exception e) {
  +			string = e.toString();
  +		}
  +
  +		return string;
  +	}
  +
  +	private void setDCNode(String node, String text) {
  +		org.w3c.dom.Document document;
  +		try {
  +			document = DocumentHelper.readDocument(infofile);
  +			nodelist = document.getElementsByTagNameNS(DC_NAMESPACE, node);
  +			nodelist.item(0).getFirstChild().setNodeValue(text);
  +			DocumentHelper.writeDocument(document, infofile);
  +		} catch (Exception e) {
  +			string = e.toString();
  +		}
  +	}
  +
  +	/**
  +	 * Set the DC Subject
  +	 * 
  +	 * @param subject the subject
  +	 */
  +	public void setSubject(String subject) {
  +		setDCNode("subject", subject);
  +	}
  +
  +	/**
  +	 * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  +	 */
  +	public String getDescription() throws PublicationException {
  +		return getDCNode("description");
  +	}
  +
  +	/**
  +	 * Set the DC Description
  +	 * 
  +	 * @param description the description
  +	 */
  +	public void setDescription(String description) {
  +		setDCNode("description", description);
  +	}
  +
  +	/**
  +	 * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  +	 */
  +	public String getRights() throws PublicationException {
  +		return getDCNode("rights");
  +	}
  +
  +	/**
  +	 * Set the DC Rights
  +	 * 
  +	 * @param rights the rights
  +	 */
  +	public void setRights(String rights) {
  +		setDCNode("rights", rights);
  +	}
  +
  +	/**
  +	 * @see org.apache.lenya.cms.publication.Document#getDCTitle()
  +	 */
  +	public String getIdentifier() throws PublicationException {
  +		return getDCNode("identifier");
  +	}
  +	/**
  +	 * Set the DC Identifier
  +	 * 
  +	 * @param identifier The identifier
  +	 */
  +	public void setIdentifier(String identifier) {
  +		setDCNode("identifier", identifier);
  +	}
   }
  
  
  

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


Mime
View raw message