You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by eg...@apache.org on 2003/10/22 18:19:55 UTC

cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ant DocumentIdToPath.java

egli        2003/10/22 09:19:55

  Modified:    src/java/org/apache/lenya/cms/ant DocumentIdToPath.java
  Log:
  Documentation fixes.
  
  Revision  Changes    Path
  1.8       +89 -90    cocoon-lenya/src/java/org/apache/lenya/cms/ant/DocumentIdToPath.java
  
  Index: DocumentIdToPath.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ant/DocumentIdToPath.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DocumentIdToPath.java	28 Aug 2003 14:08:12 -0000	1.7
  +++ DocumentIdToPath.java	22 Oct 2003 16:19:55 -0000	1.8
  @@ -49,99 +49,98 @@
   import org.apache.tools.ant.Target;
   
   /**
  - * ant task to get the file path from the document id
  + * Ant task to get the file path from the document id.
  + * 
    * @author edith
    */
   public class DocumentIdToPath extends PublicationTask {
  -	private String area;
  -	private String documentid;
  -	private String propertyname;
  -	/**
  -	 * Creates a new instance of DocumentIdToPath
  -	 */
  -	public DocumentIdToPath() {
  -		super();
  -	}
  +    private String area;
  +    private String documentid;
  +    private String propertyname;
  +
  +    /**
  +     * Creates a new instance of DocumentIdToPath
  +     */
  +    public DocumentIdToPath() {
  +        super();
  +    }
  +
  +    /**
  +     * @return Sting The directory for the area in the publication.
  +     */
  +    public String getArea() {
  +        return area;
  +    }
  +
  +    /**
  +     * @return string The document id 
  +     */
  +    protected String getDocumentid() {
  +        return documentid;
  +    }
  +
  +    /**
  +     * @return propertyname. The name of the property for the path.
  +     */
  +    public String getPropertyname() {
  +        return propertyname;
  +    }
  +
  +    /**
  +     * @param string The area.
  +     */
  +    public void setArea(String string) {
  +        area = string;
  +    }
  +
  +    /**
  +     * @param string The name of the property.
  +     */
  +    public void setPropertyname(String string) {
  +        propertyname = string;
  +    }
  +
  +    /**
  +     * Set the value of the document id.
  +     *   
  +     * @param string The document id. 
  +     */
  +    public void setDocumentid(String string) {
  +        documentid = string;
  +    }
  +
  +    /**
  +     * Gets the path from the document id and sets this value in the 
  +     * property of the project with the name propertyname.   
       
  -	/**
  -	 * @return Sting The directory for the area in the publication.
  -	 */
  -	public String getArea() {
  -		return area;
  -	}
  -
  -	/**
  -	 * @return string The document id 
  -	 */
  -	protected String getDocumentid() {
  -		return documentid;
  -	}
  -
  -	/**
  -	 * @return propertyname. The name of the property for the path.
  -	 */
  -	public String getPropertyname() {
  -		return propertyname;
  -	}
  -
  -	/**
  -	 * @param string The area.
  -	 */
  -	public void setArea(String string) {
  -		area = string;
  -	}
  -
  -	/**
  -	 * @param string The name of the property.
  -	 */
  -	public void setPropertyname(String string) {
  -		propertyname = string;
  -	}
  -
  -	/**
  -	 * set the value of the document id  
  -	 * @param string The document id. 
  -	 */
  -	public void setDocumentid(String string) {
  -		documentid = string;
  -	}
  -
  -	/**
  -	 * Gets the path from the document id and sets this value in the 
  -	 * property of the project with the name propertyname.   
  -
  -	 * @param area The area (ex authoring)
  -	 * @param documentid  The document id.
  -	 * @param propertyname The name of the property
  -	 */
  -	public void compute(String area, String documentid, String propertyname) { 
  -
  -	  Publication publication= getPublication();
  -	  DocumentIdToPathMapper pathMapper=publication.getPathMapper();
  -      String path = pathMapper.getPath(documentid, ""); 
  -	  log("path " + path);
  -
  -	  int index = path.lastIndexOf("/");
  -	  String dir = path.substring(0, index);
  -	  log("dir " + dir);
  -	  
  -	  Target target=getOwningTarget();
  -	  Project project=target.getProject();
  -	  project.setProperty(propertyname, dir);
  -	}
  -
  -	/** 
  -	 * @see org.apache.tools.ant.Task#execute()
  -	 **/
  -	public void execute() throws BuildException {
  -		try {
  -			log("document-id " + getDocumentid());
  -			log("area " + getArea());
  -			log("property: " +getPropertyname());
  -			compute(getArea(), getDocumentid(), getPropertyname());
  -		} catch (Exception e) {
  -			throw new BuildException(e);
  -		}
  -	}
  +     * @param area The area (ex authoring)
  +     * @param documentid  The document id.
  +     * @param propertyname The name of the property
  +     */
  +    public void compute(String area, String documentid, String propertyname) {
  +
  +        Publication publication = getPublication();
  +        DocumentIdToPathMapper pathMapper = publication.getPathMapper();
  +        String path = pathMapper.getPath(documentid, "");
  +        log("path " + path);
  +
  +        int index = path.lastIndexOf("/");
  +        String dir = path.substring(0, index);
  +        log("dir " + dir);
  +
  +        Target target = getOwningTarget();
  +        Project project = target.getProject();
  +        project.setProperty(propertyname, dir);
  +    }
  +
  +    /** 
  +     * @see org.apache.tools.ant.Task#execute()
  +     **/
  +    public void execute() throws BuildException {
  +        log("document-id " + getDocumentid());
  +        log("area " + getArea());
  +        log("property: " + getPropertyname());
  +        compute(getArea(), getDocumentid(), getPropertyname());
  +    }
   
   }
  
  
  

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