lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication DublinCore.java
Date Mon, 11 Aug 2003 16:04:39 GMT
andreas     2003/08/11 09:04:39

  Modified:    src/java/org/apache/lenya/cms/publication DublinCore.java
  Log:
  formatting (tabs to spaces)
  
  Revision  Changes    Path
  1.11      +144 -147  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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DublinCore.java	8 Aug 2003 09:50:09 -0000	1.10
  +++ DublinCore.java	11 Aug 2003 16:04:39 -0000	1.11
  @@ -70,150 +70,147 @@
    * @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 static final String DC_NAMESPACE =
  -		"http://purl.org/dc/elements/1.1/";
  -
  -	/** 
  -	 * 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 =
  -				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);
  -	}
  +    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
  +     * 
  +     */
  +    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 =
  +                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);
  +    }
   }
  
  
  

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