You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/02/08 19:15:31 UTC
svn commit: r152682 [4/17] - in lenya/trunk/src: java/org/apache/lenya/ac/
java/org/apache/lenya/ac/cache/ java/org/apache/lenya/ac/file/
java/org/apache/lenya/ac/impl/ java/org/apache/lenya/ac/ldap/
java/org/apache/lenya/cms/ac/ java/org/apache/lenya/cms/ac/cocoon/
java/org/apache/lenya/cms/ac/usecase/ java/org/apache/lenya/cms/ac/usecases/
java/org/apache/lenya/cms/ac/workflow/ java/org/apache/lenya/cms/ant/
java/org/apache/lenya/cms/authoring/ java/org/apache/lenya/cms/cocoon/acting/
java/org/apache/lenya/cms/cocoon/bean/
java/org/apache/lenya/cms/cocoon/components/modules/input/
java/org/apache/lenya/cms/cocoon/flow/
java/org/apache/lenya/cms/cocoon/generation/
java/org/apache/lenya/cms/cocoon/matching/
java/org/apache/lenya/cms/cocoon/scheduler/
java/org/apache/lenya/cms/cocoon/source/
java/org/apache/lenya/cms/cocoon/task/
java/org/apache/lenya/cms/cocoon/transformation/
java/org/apache/lenya/cms/cocoon/uriparameterizer/
java/org/apache/lenya/cms/metadata/dublincore/
java/org/apache/lenya/cms/metadata/usecases/
java/org/apache/lenya/cms/publication/
java/org/apache/lenya/cms/publication/file/
java/org/apache/lenya/cms/publication/task/
java/org/apache/lenya/cms/publication/templating/
java/org/apache/lenya/cms/publication/util/
java/org/apache/lenya/cms/publishing/ java/org/apache/lenya/cms/rc/
java/org/apache/lenya/cms/scheduler/ java/org/apache/lenya/cms/scheduler/xml/
java/org/apache/lenya/cms/search/usecases/ java/org/apache/lenya/cms/site/
java/org/apache/lenya/cms/site/tree/
java/org/apache/lenya/cms/site/usecases/ java/org/apache/lenya/cms/task/
java/org/apache/lenya/cms/usecase/ java/org/apache/lenya/cms/workflow/
java/org/apache/lenya/lucene/ java/org/apache/lenya/lucene/html/
java/org/apache/lenya/lucene/index/ java/org/apache/lenya/lucene/parser/
java/org/apache/lenya/net/ java/org/apache/lenya/search/
java/org/apache/lenya/search/crawler/ java/org/apache/lenya/util/
java/org/apache/lenya/workflow/ java/org/apache/lenya/workflow/impl/
java/org/apache/lenya/xml/ test/org/apache/lenya/ac/file/
test/org/apache/lenya/ac/impl/ test/org/apache/lenya/cms/
test/org/apache/lenya/cms/authoring/
test/org/apache/lenya/cms/cocoon/generation/
test/org/apache/lenya/cms/publication/
test/org/apache/lenya/cms/publication/file/ test/org/apache/lenya/cms/rc/
test/org/apache/lenya/cms/site/tree/ test/org/apache/lenya/cms/task/
test/org/apache/lenya/cms/workflow/ test/org/apache/lenya/net/
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/InsertLabelTask.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/InsertLabelTask.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/InsertLabelTask.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/InsertLabelTask.java Tue Feb 8 10:13:39 2005
@@ -21,7 +21,6 @@
import org.apache.lenya.cms.site.Label;
import org.apache.lenya.cms.site.SiteException;
-import org.apache.lenya.cms.site.tree.DefaultSiteTree;
import org.apache.lenya.cms.site.tree.SiteTree;
import org.apache.tools.ant.BuildException;
@@ -43,104 +42,95 @@
/**
* Get the area of the site tree.
- *
* @return the area of the tree.
*/
protected String getArea() {
- return area;
+ return this.area;
}
/**
* Set the area of the site tree
- *
- * @param area the area of the tree.
+ * @param _area the area of the tree.
*/
- public void setArea(String area) {
- this.area = area;
+ public void setArea(String _area) {
+ this.area = _area;
}
/**
* Return the document-id corresponding to the node to delete.
- *
* @return string The document-id.
*/
protected String getDocumentid() {
- return documentid;
+ return this.documentid;
}
/**
* Set the value of the document-id corresponding to the node to delete.
- *
* @param string The document-id.
*/
public void setDocumentid(String string) {
- documentid = string;
+ this.documentid = string;
}
/**
* Get the name of the label.
- *
* @return the labelName
*/
public String getLabelName() {
- return labelName;
+ return this.labelName;
}
/**
* Set the labelName.
- *
- * @param labelName the name of the label
+ * @param _labelName the name of the label
*/
- public void setLabelName(String labelName) {
- this.labelName = labelName;
+ public void setLabelName(String _labelName) {
+ this.labelName = _labelName;
}
/**
* Get the language.
- *
* @return the language
*/
public String getLanguage() {
- return language;
+ return this.language;
}
/**
* Set the language.
- *
- * @param language the language
+ * @param _language the language
*/
- public void setLanguage(String language) {
- this.language = language;
+ public void setLanguage(String _language) {
+ this.language = _language;
}
/**
* Insert a label in an existing node in the tree.
*
- * @param documentid the document-id of the document.
- * @param labelName the name of the label that is to be inserted.
- * @param language the language of the label that is to be inserted.
- * @param area determines in which sitetree the label is to be inserted
+ * @param _documentid the document-id of the document.
+ * @param _labelName the name of the label that is to be inserted.
+ * @param _language the language of the label that is to be inserted.
+ * @param _area determines in which sitetree the label is to be inserted
*
* @throws SiteException if an error occurs
*/
- public void insertLabel(String documentid, String labelName, String language, String area)
+ public void insertLabel(String _documentid, String _labelName, String _language, String _area)
throws SiteException {
SiteTree tree = null;
Label label = null;
try {
- tree = getSiteTree(area);
- label = new Label(labelName, language);
- tree.addLabel(documentid, label);
+ tree = getSiteTree(_area);
+ label = new Label(_labelName, _language);
+ tree.addLabel(_documentid, label);
tree.save();
} catch (Exception e) {
- throw new SiteException("Cannot insert label " + label + " into tree " + area, e);
+ throw new SiteException("Cannot insert label " + label + " into tree " + _area, e);
}
}
/**
- * (non-Javadoc)
* @see org.apache.tools.ant.Task#execute()
*/
public void execute() throws BuildException {
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/JavaFilenameFilter.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/JavaFilenameFilter.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/JavaFilenameFilter.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/JavaFilenameFilter.java Tue Feb 8 10:13:39 2005
@@ -24,12 +24,15 @@
import java.util.Arrays;
import java.util.StringTokenizer;
+/**
+ * A filename filter for .java, .properties, .xml and .xsl files
+ * FIXME this class is named badly
+ */
public class JavaFilenameFilter implements FilenameFilter {
- protected static final String[] SUFFIXES = { "java", "properties", "xml", "xsl" };
+ private static final String[] SUFFIXES = { "java", "properties", "xml", "xsl" };
/**
- * (non-Javadoc)
* @see java.io.FilenameFilter#accept(java.io.File, java.lang.String)
*/
public boolean accept(File dir, String name) {
@@ -45,7 +48,6 @@
/**
* Get the extension
- *
* @param filename the file name from which the extension is extracted
* @return the extension
*/
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/LinkRewriteTask.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/LinkRewriteTask.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/LinkRewriteTask.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/LinkRewriteTask.java Tue Feb 8 10:13:39 2005
@@ -56,83 +56,74 @@
/**
* Get the area
- *
* @return the area
*/
public String getArea() {
- return area;
+ return this.area;
}
/**
* Set the area
- *
- * @param area the area
+ * @param _area the area
*/
- public void setArea(String area) {
- this.area = area;
+ public void setArea(String _area) {
+ this.area = _area;
}
/**
* Get the new document-id.
- *
* @return the new document-id
*/
public String getNewDocumentId() {
- return newDocumentId;
+ return this.newDocumentId;
}
/**
* Set the new document-id.
- *
- * @param newDocumentId the new document-id
+ * @param _newDocumentId the new document-id
*/
- public void setNewDocumentId(String newDocumentId) {
- this.newDocumentId = newDocumentId;
+ public void setNewDocumentId(String _newDocumentId) {
+ this.newDocumentId = _newDocumentId;
}
/**
* Get the old document-id.
- *
* @return the old document-id
*/
public String getOldDocumentId() {
- return oldDocumentId;
+ return this.oldDocumentId;
}
/**
* Set the old document-id.
- *
- * @param oldDocumentId the old document-id
+ * @param _oldDocumentId the old document-id
*/
- public void setOldDocumentId(String oldDocumentId) {
- this.oldDocumentId = oldDocumentId;
+ public void setOldDocumentId(String _oldDocumentId) {
+ this.oldDocumentId = _oldDocumentId;
}
/**
* Get the stylesheet.
- *
* @return the stylesheet
*/
public String getStylesheet() {
- return stylesheet;
+ return this.stylesheet;
}
/**
* Set the stylesheet.
- *
- * @param stylesheet the stylesheet that transforms the links
+ * @param _stylesheet the stylesheet that transforms the links
*/
- public void setStylesheet(String stylesheet) {
- this.stylesheet = stylesheet;
+ public void setStylesheet(String _stylesheet) {
+ this.stylesheet = _stylesheet;
}
/**
* Set the base dir where in which the link rewrite will take place.
- *
- * @param baseDir the base dir
+ * @param _baseDir the base dir
*/
- public void setBaseDir(String baseDir) {
- this.baseDir = baseDir;
+ public void setBaseDir(String _baseDir) {
+ this.baseDir = _baseDir;
}
/**
@@ -164,8 +155,9 @@
}
/**
- * @param file
- * @param transformer
+ * Rewrites links
+ * @param file The starting point for the link rewrite
+ * @param transformer The transformer to use for the link rewrite
* @throws TransformerException
* @throws ParserConfigurationException
* @throws SAXException
@@ -177,16 +169,16 @@
FilenameFilter directoryFilter = new FilenameFilter() {
public boolean accept(File dir, String name) {
- File file = new File(dir, name);
- return file.isDirectory();
+ File _file = new File(dir, name);
+ return _file.isDirectory();
}
};
FilenameFilter xmlFileFilter = new FilenameFilter() {
public boolean accept(File dir, String name) {
- File file = new File(dir, name);
- return file.isFile() && FileUtil.getExtension(name).equals("xml");
+ File _file = new File(dir, name);
+ return _file.isFile() && FileUtil.getExtension(name).equals("xml");
}
};
@@ -221,27 +213,31 @@
}
/**
+ * Rewrites links by traversing a directory tree and applying a rewrite transformation
+ * to XML files in the directory.
+ * @param rootDirName The root directory for the rewrite
+ * @param _stylesheet The stylesheet to use for rewriting
+ * @param _area The area to use for rewriting
+ * @param _oldDocumentId The old document id
+ * @param _newDocumentId The new document id
*
- * @param rootDirName
- * @param stylesheet
- * @param oldDocumentId
- * @param newDocumentId
- *
- * @throws FileNotFoundException
* @throws TransformerException
+ * @throws ParserConfigurationException
+ * @throws SAXException
+ * @throws IOException
*/
private void replace(
String rootDirName,
- String stylesheet,
- String area,
- String oldDocumentId,
- String newDocumentId)
+ String _stylesheet,
+ String _area,
+ String _oldDocumentId,
+ String _newDocumentId)
throws TransformerException, ParserConfigurationException, SAXException, IOException {
File rootDir = new File(rootDirName);
TransformerFactory tFactory = TransformerFactory.newInstance();
- Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheet));
+ Transformer transformer = tFactory.newTransformer(new StreamSource(_stylesheet));
Publication publication = getPublication();
@@ -250,8 +246,8 @@
for (int i = 0; i < languages.length; i++) {
String language = languages[i];
- String oldURL = getUrl(area, oldDocumentId, language);
- String newURL = getUrl(area, newDocumentId, language);
+ String oldURL = getUrl(_area, _oldDocumentId, language);
+ String newURL = getUrl(_area, _newDocumentId, language);
log("Replace '" + oldURL + "' by '" + newURL + "'");
transformer.setParameter("idbefore", oldURL);
@@ -264,15 +260,15 @@
/**
* Returns the complete URL for a certain area, document ID, and language.
*
- * @param area The area.
+ * @param _area The area.
* @param documentId The document ID.
* @param language The language.
* @return A string.
*/
- protected String getUrl(String area, String documentId, String language) {
+ protected String getUrl(String _area, String documentId, String language) {
org.apache.lenya.cms.publication.Document newDocument;
try {
- newDocument = getIdentityMap().getFactory().get(area, documentId, language);
+ newDocument = getIdentityMap().getFactory().get(_area, documentId, language);
} catch (DocumentBuildException e) {
throw new RuntimeException(e);
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveDocumentTask.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveDocumentTask.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveDocumentTask.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveDocumentTask.java Tue Feb 8 10:13:39 2005
@@ -31,7 +31,7 @@
import org.apache.tools.ant.BuildException;
/**
- * Ant task, which implements the SiteTreeNodeVisitor for the operation move a document. (Visitor
+ * Ant task which implements the SiteTreeNodeVisitor for the operation move a document. (Visitor
* pattern)
*/
public class MoveDocumentTask extends PublicationTask implements SiteTreeNodeVisitor {
@@ -42,7 +42,7 @@
private String secdocumentid;
/**
- *
+ * Constructor
*/
public MoveDocumentTask() {
super();
@@ -52,28 +52,28 @@
* @return String The area of the source.
*/
public String getFirstarea() {
- return firstarea;
+ return this.firstarea;
}
/**
* @return String The document-id corresponding to the source.
*/
public String getFirstdocumentid() {
- return firstdocumentid;
+ return this.firstdocumentid;
}
/**
* @return String The area of the destination.
*/
public String getSecarea() {
- return secarea;
+ return this.secarea;
}
/**
* @return String The document-id corresponding to the destination.
*/
public String getSecdocumentid() {
- return secdocumentid;
+ return this.secdocumentid;
}
/**
@@ -81,7 +81,7 @@
* The area of the source.
*/
public void setFirstarea(String string) {
- firstarea = string;
+ this.firstarea = string;
}
/**
@@ -89,7 +89,7 @@
* The document-id corresponding to the source.
*/
public void setFirstdocumentid(String string) {
- firstdocumentid = string;
+ this.firstdocumentid = string;
}
/**
@@ -97,7 +97,7 @@
* The area of the destination.
*/
public void setSecarea(String string) {
- secarea = string;
+ this.secarea = string;
}
/**
@@ -105,7 +105,7 @@
* The document-id corresponding to the destination.
*/
public void setSecdocumentid(String string) {
- secdocumentid = string;
+ this.secdocumentid = string;
}
/**
@@ -119,7 +119,7 @@
String language = labels[i].getLanguage();
String srcDocumentid = node.getAbsoluteId();
- String destDocumentid = srcDocumentid.replaceFirst(firstdocumentid, secdocumentid);
+ String destDocumentid = srcDocumentid.replaceFirst(this.firstdocumentid, this.secdocumentid);
// TODO: content(fix the build file)
// TODO: resources (fix the build file)
@@ -134,8 +134,8 @@
log("move workflow history");
try {
- document = getIdentityMap().getFactory().get(firstarea, srcDocumentid, language);
- newDocument = getIdentityMap().getFactory().get(secarea, destDocumentid, language);
+ document = getIdentityMap().getFactory().get(this.firstarea, srcDocumentid, language);
+ newDocument = getIdentityMap().getFactory().get(this.secarea, destDocumentid, language);
} catch (DocumentBuildException e) {
throw new BuildException(e);
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveNode.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveNode.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveNode.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveNode.java Tue Feb 8 10:13:39 2005
@@ -21,7 +21,6 @@
import java.util.StringTokenizer;
-import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.site.SiteException;
import org.apache.lenya.cms.site.tree.SiteTree;
import org.apache.lenya.cms.site.tree.SiteTreeNode;
@@ -33,7 +32,7 @@
private String refdocumentid;
/**
- *
+ * Constructor
*/
public MoveNode() {
super();
@@ -41,7 +40,6 @@
/**
* Move a node.
- *
* @param firstdocumentid The document-id of the document corresponding to the source node.
* @param secdocumentid The document-id of the document corresponding to the destination node.
* @param firstarea The area of the document corresponding to the source node.
@@ -51,18 +49,19 @@
public void manipulateTree(String firstdocumentid, String secdocumentid, String firstarea,
String secarea) throws SiteException {
- Publication publication = getPublication();
SiteTree firsttree = getSiteTree(firstarea);
SiteTree sectree = getSiteTree(secarea);
String parentid = "";
+ StringBuffer buf = new StringBuffer();
StringTokenizer st = new StringTokenizer(secdocumentid, "/");
int length = st.countTokens();
for (int i = 0; i < (length - 1); i++) {
- parentid = parentid + "/" + st.nextToken();
+ buf.append("/" + st.nextToken());
}
String newid = st.nextToken();
+ parentid = buf.toString();
SiteTreeNode node = firsttree.removeNode(firstdocumentid);
if (node != null) {
@@ -90,7 +89,7 @@
* node shoul be inserted. If null, the node is inserted at the end.
*/
public String getRefdocumentid() {
- return refdocumentid;
+ return this.refdocumentid;
}
/**
@@ -98,7 +97,7 @@
* node shoul be inserted. If null, the node is inserted at the end.
*/
public void setRefdocumentid(String string) {
- refdocumentid = string;
+ this.refdocumentid = string;
}
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveSiteTreeNodeTask.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveSiteTreeNodeTask.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveSiteTreeNodeTask.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/MoveSiteTreeNodeTask.java Tue Feb 8 10:13:39 2005
@@ -20,7 +20,6 @@
package org.apache.lenya.cms.ant;
import org.apache.lenya.cms.publication.Publication;
-import org.apache.lenya.cms.site.tree.DefaultSiteTree;
import org.apache.lenya.cms.site.tree.SiteTree;
import org.apache.tools.ant.BuildException;
@@ -29,7 +28,13 @@
*/
public class MoveSiteTreeNodeTask extends PublicationTask {
+ /**
+ * <code>UP</code> Constant for up movement
+ */
public static final String UP = "up";
+ /**
+ * <code>DOWN</code> Constant for down movement
+ */
public static final String DOWN = "down";
/**
@@ -37,15 +42,15 @@
* @return A string.
*/
protected String getDocumentId() {
- return documentId;
+ return this.documentId;
}
/**
* Sets the document ID.
- * @param documentId A string.
+ * @param _documentId A string.
*/
- public void setDocumentId(String documentId) {
- this.documentId = documentId;
+ public void setDocumentId(String _documentId) {
+ this.documentId = _documentId;
}
/**
@@ -53,15 +58,15 @@
* @return A string.
*/
protected String getDirection() {
- return direction;
+ return this.direction;
}
/**
* Sets the direction.
- * @param direction A string.
+ * @param _direction A string.
*/
- public void setDirection(String direction) {
- this.direction = direction;
+ public void setDirection(String _direction) {
+ this.direction = _direction;
}
/**
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/PublicationTask.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/PublicationTask.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/PublicationTask.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/PublicationTask.java Tue Feb 8 10:13:39 2005
@@ -23,8 +23,6 @@
import java.io.IOException;
import org.apache.avalon.framework.logger.ConsoleLogger;
-import org.apache.avalon.framework.logger.Log4JLogger;
-import org.apache.avalon.framework.logger.Logger;
import org.apache.lenya.cms.publication.DocumentIdentityMap;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationException;
@@ -33,7 +31,6 @@
import org.apache.lenya.cms.site.tree.SiteTree;
import org.apache.lenya.cms.site.tree.TreeSiteManager;
import org.apache.lenya.cms.task.AntTask;
-import org.apache.log4j.Category;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
@@ -44,11 +41,11 @@
public abstract class PublicationTask extends Task {
/** Creates a new instance of PublicationTask */
public PublicationTask() {
+ // do nothing
}
/**
* Returns the publication directory.
- *
* @return a the path to the publication directory as a <code>File</code>
*/
protected File getPublicationDirectory() {
@@ -57,7 +54,6 @@
/**
* Return the context prefix.
- *
* @return the context-prefix
*/
protected String getContextPrefix() {
@@ -66,7 +62,6 @@
/**
* Returns the publication ID.
- *
* @return the publication-id
*/
protected String getPublicationId() {
@@ -75,7 +70,6 @@
/**
* Returns the servlet context (e.g., <code>tomcat/webapp/lenya</code>)
- *
* @return the servlet-context
*/
protected File getServletContext() {
@@ -106,9 +100,7 @@
/**
* Get the publication
- *
* @return the publication
- *
* @throws BuildException if the publication could not be found
*/
protected Publication getPublication() throws BuildException {
@@ -117,7 +109,6 @@
/**
* Utility method for assertion that a string is != null and != ""
- *
* @param string the string to check
*/
protected void assertString(String string) {
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/ResourcePublisher.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/ResourcePublisher.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/ResourcePublisher.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/ResourcePublisher.java Tue Feb 8 10:13:39 2005
@@ -43,10 +43,10 @@
public void execute() throws BuildException {
try {
- Document authoringDocument = getIdentityMap().getFactory().get(Publication.AUTHORING_AREA, documentId);
+ Document authoringDocument = getIdentityMap().getFactory().get(Publication.AUTHORING_AREA, this.documentId);
ResourcesManager authoringManager = authoringDocument.getResourcesManager();
- Document liveDocument = getIdentityMap().getFactory().get(Publication.LIVE_AREA, documentId);
+ Document liveDocument = getIdentityMap().getFactory().get(Publication.LIVE_AREA, this.documentId);
ResourcesManager liveManager = liveDocument.getResourcesManager();
// find all resource files and their associated meta files
@@ -76,15 +76,15 @@
* @return A document ID.
*/
public String getDocumentId() {
- return documentId;
+ return this.documentId;
}
/**
* Sets the document ID.
- * @param documentId A document ID.
+ * @param _documentId A document ID.
*/
- public void setDocumentId(String documentId) {
- this.documentId = documentId;
+ public void setDocumentId(String _documentId) {
+ this.documentId = _documentId;
}
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/SCMFilenameFilter.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/SCMFilenameFilter.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/SCMFilenameFilter.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/SCMFilenameFilter.java Tue Feb 8 10:13:39 2005
@@ -34,14 +34,13 @@
/**
* Ctor.
- * @param excludes A comma-separated list of file names, e.g. CVS,.svn
+ * @param _excludes A comma-separated list of file names, e.g. CVS,.svn
*/
- public SCMFilenameFilter(String excludes) {
- this.excludes = Arrays.asList(excludes.split(","));
+ public SCMFilenameFilter(String _excludes) {
+ this.excludes = Arrays.asList(_excludes.split(","));
}
/**
- * (non-Javadoc)
* @see java.io.FilenameFilter#accept(java.io.File, java.lang.String)
*/
public boolean accept(File dir, String name) {
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/SetAreaProperties.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/SetAreaProperties.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/SetAreaProperties.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/SetAreaProperties.java Tue Feb 8 10:13:39 2005
@@ -40,41 +40,41 @@
* @return String The area.
*/
public String getArea() {
- return area;
+ return this.area;
}
/**
- * @param area The area.
+ * @param _area The area.
*/
- public void setArea(String area) {
- this.area = area;
+ public void setArea(String _area) {
+ this.area = _area;
}
/**
* @return String The name of the property for the content directory.
*/
public String getDirpropertyname() {
- return dirpropertyname;
+ return this.dirpropertyname;
}
/**
- * @param dirpropertyname The name of the property for the content directory.
+ * @param _dirpropertyname The name of the property for the content directory.
*/
- public void setDirpropertyname(String dirpropertyname) {
- this.dirpropertyname = dirpropertyname;
+ public void setDirpropertyname(String _dirpropertyname) {
+ this.dirpropertyname = _dirpropertyname;
}
/**
* Sets the properties dependent of the area for the project
- * @param area The area.
- * @param dirpropertyname The name of the property for the content directory.
+ * @param _area The area.
+ * @param _dirpropertyname The name of the property for the content directory.
*/
- protected void setNewProperties(String area, String dirpropertyname) {
- Target target = getOwningTarget();
- Project project = target.getProject();
+ protected void setNewProperties(String _area, String _dirpropertyname) {
+ Target _target = getOwningTarget();
+ Project _project = _target.getProject();
- String dirproperty = project.getProperty(area+".dir");
- project.setProperty(dirpropertyname, dirproperty);
+ String dirproperty = _project.getProperty(_area+".dir");
+ _project.setProperty(_dirpropertyname, dirproperty);
}
/**
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/SetIdentifier.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/SetIdentifier.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/SetIdentifier.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/SetIdentifier.java Tue Feb 8 10:13:39 2005
@@ -48,41 +48,39 @@
* @return String The area.
*/
public String getArea() {
- return area;
+ return this.area;
}
/**
* @return String The document-id.
*/
public String getDocumentid() {
- return documentid;
+ return this.documentid;
}
/**
* @param string The area.
*/
public void setArea(String string) {
- area = string;
+ this.area = string;
}
/**
* @param string The document-id.
*/
public void setDocumentid(String string) {
- documentid = string;
+ this.documentid = string;
}
/**
* write the document id in the DC Identifier of a document corresponding to this url
* @param document The document.
- *
- * @throws DocumentBuildException when something went wrong when building the cms document.
* @throws DocumentException when something went wrong when getting the DublinCore.
*/
public void writeDCIdentifier(Document document)
- throws DocumentBuildException, DocumentException {
+ throws DocumentException {
DublinCore dublincore = document.getDublinCore();
- dublincore.setValue("identifier", documentid);
+ dublincore.setValue("identifier", this.documentid);
dublincore.save();
}
@@ -96,18 +94,18 @@
String language = null;
SiteTree tree;
- tree = getSiteTree(area);
- SiteTreeNode node = tree.getNode(documentid);
+ tree = getSiteTree(this.area);
+ SiteTreeNode node = tree.getNode(this.documentid);
Label[] labels = node.getLabels();
try {
if (labels.length < 1) {
log("no languages found for the node with id : " + node.getId());
- writeDCIdentifier(getIdentityMap().getFactory().get(area, documentid));
+ writeDCIdentifier(getIdentityMap().getFactory().get(this.area, this.documentid));
} else {
for (int i = 0; i < labels.length; i++) {
language = labels[i].getLanguage();
- writeDCIdentifier(getIdentityMap().getFactory().get(area, documentid, language));
+ writeDCIdentifier(getIdentityMap().getFactory().get(this.area, this.documentid, language));
}
}
} catch (DocumentException e1) {
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/SiteTreeResetTask.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/SiteTreeResetTask.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/SiteTreeResetTask.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/SiteTreeResetTask.java Tue Feb 8 10:13:39 2005
@@ -19,7 +19,6 @@
package org.apache.lenya.cms.ant;
-import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.site.tree.SiteTree;
import org.apache.lenya.cms.site.tree.SiteTreeNode;
import org.apache.tools.ant.BuildException;
@@ -41,14 +40,14 @@
* @return string The area the sitetree belongs to.
*/
public String getArea() {
- return area;
+ return this.area;
}
/**
* @param string The area the sitetree belongs to.
*/
public void setArea(String string) {
- area = string;
+ this.area = string;
}
/** (non-Javadoc)
@@ -57,7 +56,6 @@
public void execute() throws BuildException {
try {
log("area : " + this.getArea());
- Publication publication= getPublication();
SiteTree tree = getSiteTree(getArea());
SiteTreeNode node = tree.getNode("/");
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/StaticHTMLExporter.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/StaticHTMLExporter.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/StaticHTMLExporter.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/StaticHTMLExporter.java Tue Feb 8 10:13:39 2005
@@ -20,6 +20,7 @@
package org.apache.lenya.cms.ant;
import java.io.File;
+import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
@@ -33,86 +34,98 @@
public class StaticHTMLExporter extends PublicationTask {
/** Creates a new instance of StaticHTMLExporter */
public StaticHTMLExporter() {
+ // do nothing
}
private String serverURL;
/**
* Returns the server URL.
+ * @return The server URL
+ * @throws MalformedURLException if the Server URL is not valid
*/
protected URL getServer() throws MalformedURLException {
- return new URL(serverURL);
+ return new URL(this.serverURL);
}
/**
* Sets the server URL.
+ * @param _serverURL The server URL
*/
- public void setServer(String serverURL) {
- this.serverURL = serverURL;
+ public void setServer(String _serverURL) {
+ this.serverURL = _serverURL;
}
private String path;
/**
* Returns the path to the exported files.
+ * @return The path
*/
protected String getPath() {
- return path;
+ return this.path;
}
/**
* Sets the path to the exported files.
+ * @param _path The path
*/
- public void setPath(String path) {
- this.path = path;
+ public void setPath(String _path) {
+ this.path = _path;
}
private String uris;
/**
* Returns the URIs to export.
+ * @return The URIs
*/
protected String[] getUris() {
- return uris.split(",");
+ return this.uris.split(",");
}
/**
* Sets the URIs to export.
+ * @param _uris The URIs
*/
- public void setUris(String uris) {
- this.uris = uris;
+ public void setUris(String _uris) {
+ this.uris = _uris;
}
private String expression;
/**
* Returns the expression in the URI to be replaced.
+ * @return The expression
*/
protected String getExpression() {
- return expression;
+ return this.expression;
}
/**
* Sets the expression in the URI to be replaced.
+ * @param _expression The expression
*/
- public void setExpression(String expression) {
- this.expression = expression;
+ public void setExpression(String _expression) {
+ this.expression = _expression;
}
private String replacement;
/**
* Returns the string in the URI that replaces the expression.
+ * @return The replacement string
*/
protected String getReplacement() {
- return replacement;
+ return this.replacement;
}
/**
* Sets the string in the URI that replaces the expression.
+ * @param _replacement The replacement string
*/
- public void setReplacement(String replacement) {
- this.replacement = replacement;
+ public void setReplacement(String _replacement) {
+ this.replacement = _replacement;
}
/**
@@ -120,11 +133,12 @@
* @param serverURI The server to download the file from.
* @param publicationDirectory The directory of the publication.
* @param exportPath The path to export the files to (relative to publicationDirectory).
- * @param uris The URIs to export (relative to the publication URI).
+ * @param _uris The URIs to export (relative to the publication URI).
* @param substituteExpression A part of the complete URIs to be substituted.
* @param substituteReplacement A string to replace substituteExpression.
+ * @throws ExportException if an error occurs
*/
- public void export(URL serverURI, File publicationDirectory, String exportPath, String[] uris,
+ public void export(URL serverURI, File publicationDirectory, String exportPath, String[] _uris,
String substituteExpression, String substituteReplacement)
throws ExportException {
try {
@@ -145,32 +159,41 @@
String fullServerURI = serverURI.toString();
- for (int i = 0; i < uris.length; i++) {
- URL uri = new URL(fullServerURI + uris[i]);
+ for (int i = 0; i < _uris.length; i++) {
+ URL uri = new URL(fullServerURI + _uris[i]);
wget.download(uri, substituteExpression, substituteReplacement);
log("Exported URI: " + uri);
}
- } catch (Exception e) {
+ } catch (final MalformedURLException e) {
+ log("Malformed URL " +e.toString());
+ throw new ExportException(e);
+ } catch (final IOException e) {
+ log("IO error " +e.toString());
throw new ExportException(e);
}
}
/**
* Executes the task.
+ * @throws BuildException if an error occurs
*/
public void execute() throws BuildException {
+
try {
log("Server URL: " + getServer());
log("Publication Directory: " + getPublicationDirectory());
log("Export directory: " + getPath());
- log("URIs: " + uris);
+ log("URIs: " + this.uris);
log("Substitute expression: " + getExpression());
log("Substitute replacement: " + getReplacement());
export(getServer(), getPublicationDirectory(), getPath(), getUris(), getExpression(),
getReplacement());
- } catch (Exception e) {
+ } catch (final MalformedURLException e) {
+ throw new BuildException(e);
+ } catch (final ExportException e) {
throw new BuildException(e);
}
+
}
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/TreePublisher.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/TreePublisher.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/TreePublisher.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/TreePublisher.java Tue Feb 8 10:13:39 2005
@@ -39,54 +39,49 @@
* Creates a new instance of TreePublisher
*/
public TreePublisher() {
+ // do nothing
}
/**
* Returns the document id
- *
- * @return DOCUMENT ME!
+ * @return The document id
*/
protected String getDocumentid() {
- return documentid;
+ return this.documentid;
}
/**
* Sets the document id
- *
- * @param documentid DOCUMENT ME!
+ * @param _documentid The document id
*/
- public void setDocumentid(String documentid) {
- this.documentid = documentid;
+ public void setDocumentid(String _documentid) {
+ this.documentid = _documentid;
}
/**
* Get the language of the document to be published
- *
* @return a <code>String</code> containing the ISO string for this language, e.g. "de", "en"
*/
public String getLanguage() {
- return language;
+ return this.language;
}
/**
* Set the language of the document to be published
- *
* @param string the ISO string for this language, e.g. "de", "en"
*/
public void setLanguage(String string) {
- language = string;
+ this.language = string;
}
/**
* adds a node for the published document in the live tree
- *
* @param documentId The id of the published document
- * @param language the language for which this document is to be published. Can be null if all
+ * @param _language the language for which this document is to be published. Can be null if all
* languages are to be published.
- *
* @throws PublishingException if the publication failed.
*/
- public void publish(String documentId, String language) throws PublishingException {
+ public void publish(String documentId, String _language) throws PublishingException {
SiteTree authoringTree = null;
SiteTree liveTree = null;
@@ -108,7 +103,7 @@
}
}
- if (language == null) {
+ if (_language == null) {
// no language was specified. Simply publish the
// node including all languages.
try {
@@ -121,7 +116,7 @@
// a language was specified. Let's see if this
// node even has an entry for the specified
// language.
- Label label = authoringNode.getLabel(language);
+ Label label = authoringNode.getLabel(_language);
if (label != null) {
// check if this node has already been
// published
@@ -148,21 +143,21 @@
// the node that we're trying to publish
// doesn't have this language
throw new PublishingException("The node " + documentId
- + " doesn't contain a label for language " + language);
+ + " doesn't contain a label for language " + _language);
}
}
liveTree.save();
- } catch (PublishingException e) {
- throw e;
- } catch (Exception e) {
+ } catch (final ParentNodeNotFoundException e) {
+ throw new PublishingException("Couldn't publish to live tree :", e);
+ } catch (final SiteException e) {
+ throw new PublishingException("Couldn't publish to live tree :", e);
+ } catch (final PublishingException e) {
throw new PublishingException("Couldn't publish to live tree :", e);
}
}
/**
- * Executes the task
- *
- * @throws BuildException DOCUMENT ME!
+ * @see org.apache.tools.ant.Task#execute()
*/
public void execute() throws BuildException {
try {
@@ -170,7 +165,8 @@
log("language: " + getLanguage());
publish(getDocumentid(), getLanguage());
- } catch (Exception e) {
+ } catch (final PublishingException e) {
+ log("" +e.toString());
throw new BuildException(e);
}
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoDocumentsOperationTask.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoDocumentsOperationTask.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoDocumentsOperationTask.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoDocumentsOperationTask.java Tue Feb 8 10:13:39 2005
@@ -21,13 +21,16 @@
import org.apache.tools.ant.BuildException;
+/**
+ * An abstract base class for tasks operating on two documents
+ */
public abstract class TwoDocumentsOperationTask extends DocumentOperationTask {
private String secarea;
private String secdocumentid;
/**
- *
+ * Constructor
*/
public TwoDocumentsOperationTask() {
super();
@@ -37,28 +40,28 @@
* @return String The area of the destination.
*/
public String getSecarea() {
- return secarea;
+ return this.secarea;
}
/**
* @return String The document-id corresponding to the destination.
*/
public String getSecdocumentid() {
- return secdocumentid;
+ return this.secdocumentid;
}
/**
* @param string The area of the destination.
*/
public void setSecarea(String string) {
- secarea = string;
+ this.secarea = string;
}
/**
* @param string The document-id corresponding to the destination.
*/
public void setSecdocumentid(String string) {
- secdocumentid = string;
+ this.secdocumentid = string;
}
/**
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoNodesTask.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoNodesTask.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoNodesTask.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoNodesTask.java Tue Feb 8 10:13:39 2005
@@ -47,73 +47,73 @@
* @return String The area of the document of the first node.
*/
public String getFirstarea() {
- return firstarea;
+ return this.firstarea;
}
/**
* @return String The document-id corresponding to the first node.
*/
public String getFirstdocumentid() {
- return firstdocumentid;
+ return this.firstdocumentid;
}
/**
* @return String The area of the document of the second node.
*/
public String getSecarea() {
- return secarea;
+ return this.secarea;
}
/**
* @return String The document-id corresponding to the second node.
*/
public String getSecdocumentid() {
- return secdocumentid;
+ return this.secdocumentid;
}
/**
* @param string The area of the document of the first node.
*/
public void setFirstarea(String string) {
- firstarea = string;
+ this.firstarea = string;
}
/**
* @param string The document-id corresponding to the first node.
*/
public void setFirstdocumentid(String string) {
- firstdocumentid = string;
+ this.firstdocumentid = string;
}
/**
* @param string The area of the document of the second node.
*/
public void setSecarea(String string) {
- secarea = string;
+ this.secarea = string;
}
/**
* @param string The document-id corresponding to the second node.
*/
public void setSecdocumentid(String string) {
- secdocumentid = string;
+ this.secdocumentid = string;
}
/**
* To be overriden.
* Manipulation of two nodes .
- * @param firstdocumentid : id of the first document
- * @param secdocumentid : id of the second document
- * @param firstarea : area of the tree of the first node
- * @param secarea : area of the tree of the 2nd node
+ * @param _firstdocumentid : id of the first document
+ * @param _secdocumentid : id of the second document
+ * @param _firstarea : area of the tree of the first node
+ * @param _secarea : area of the tree of the 2nd node
*
* @throws SiteException if an error occurs
*/
- public abstract void manipulateTree(String firstdocumentid, String secdocumentid,
- String firstarea, String secarea)
+ public abstract void manipulateTree(String _firstdocumentid, String _secdocumentid,
+ String _firstarea, String _secarea)
throws SiteException;
- /** (non-Javadoc)
+ /**
* @see org.apache.tools.ant.Task#execute()
*/
public void execute() throws BuildException {
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoTuple.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoTuple.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoTuple.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/TwoTuple.java Tue Feb 8 10:13:39 2005
@@ -19,15 +19,27 @@
package org.apache.lenya.cms.ant;
+/**
+ * Helper class to hold two values.
+ */
public class TwoTuple {
+ /**
+ * <code>x</code> The x value
+ */
public int x;
+ /**
+ * <code>y</code> The y value
+ */
public int y;
/**
- *
+ * Constructor
+ * @param _x The x value
+ * @param _y The y value
+ *
*/
- public TwoTuple(int x, int y) {
- this.x = x;
- this.y = y;
+ public TwoTuple(int _x, int _y) {
+ this.x = _x;
+ this.y = _y;
}
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/ant/WriteDCParametersTask.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ant/WriteDCParametersTask.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/ant/WriteDCParametersTask.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ant/WriteDCParametersTask.java Tue Feb 8 10:13:39 2005
@@ -53,7 +53,7 @@
* @return the creator
*/
public String getCreator() {
- return creator;
+ return this.creator;
}
/**
@@ -62,7 +62,7 @@
* @return the description
*/
public String getDescription() {
- return description;
+ return this.description;
}
/**
@@ -71,7 +71,7 @@
* @return the publisher
*/
public String getPublisher() {
- return publisher;
+ return this.publisher;
}
/**
@@ -80,7 +80,7 @@
* @return the rights
*/
public String getRights() {
- return rights;
+ return this.rights;
}
/**
@@ -89,7 +89,7 @@
* @return the subject
*/
public String getSubject() {
- return subject;
+ return this.subject;
}
/**
@@ -98,7 +98,7 @@
* @return the title
*/
public String getTitle() {
- return title;
+ return this.title;
}
/**
@@ -107,7 +107,7 @@
* @param string the creator
*/
public void setCreator(String string) {
- creator = string;
+ this.creator = string;
}
/**
@@ -116,7 +116,7 @@
* @param string the description
*/
public void setDescription(String string) {
- description = string;
+ this.description = string;
}
/**
@@ -125,7 +125,7 @@
* @param string the publisher
*/
public void setPublisher(String string) {
- publisher = string;
+ this.publisher = string;
}
/**
@@ -134,7 +134,7 @@
* @param string the rights
*/
public void setRights(String string) {
- rights = string;
+ this.rights = string;
}
/**
@@ -143,7 +143,7 @@
* @param string the subject
*/
public void setSubject(String string) {
- subject = string;
+ this.subject = string;
}
/**
@@ -152,7 +152,7 @@
* @param string the title
*/
public void setTitle(String string) {
- title = string;
+ this.title = string;
}
/**
@@ -161,7 +161,7 @@
* @return the area
*/
public String getArea() {
- return area;
+ return this.area;
}
/**
@@ -170,7 +170,7 @@
* @param string the area
*/
public void setArea(String string) {
- area = string;
+ this.area = string;
}
/**
@@ -179,7 +179,7 @@
* @return the document-id
*/
public String getDocumentId() {
- return documentId;
+ return this.documentId;
}
/**
@@ -188,7 +188,7 @@
* @param string the document-id
*/
public void setDocumentId(String string) {
- documentId = string;
+ this.documentId = string;
}
/**
@@ -197,7 +197,7 @@
* @return the language
*/
public String getLanguage() {
- return language;
+ return this.language;
}
/**
@@ -206,50 +206,50 @@
* @param string the language
*/
public void setLanguage(String string) {
- language = string;
+ this.language = string;
}
/**
* Write the dublin core params.
*
- * @param documentId the document-id
- * @param area the area
+ * @param _documentId the document-id
+ * @param _area the area
* @param lang the language
- * @param creator the creator.
- * @param title the title
- * @param description the description
- * @param subject the subject
- * @param publisher the publisher
- * @param rights the rights
+ * @param _creator the creator.
+ * @param _title the title
+ * @param _description the description
+ * @param _subject the subject
+ * @param _publisher the publisher
+ * @param _rights the rights
*
* @throws BuildException if an error occurs
* @throws DocumentBuildException if an error occurs
* @throws DocumentException if an error occurs
*/
public void writeDublinCoreParameters(
- String documentId,
- String area,
+ String _documentId,
+ String _area,
String lang,
- String creator,
- String title,
- String description,
- String subject,
- String publisher,
- String rights)
+ String _creator,
+ String _title,
+ String _description,
+ String _subject,
+ String _publisher,
+ String _rights)
throws BuildException, DocumentBuildException, DocumentException {
- Document doc = getIdentityMap().getFactory().get(area, documentId, lang);
+ Document doc = getIdentityMap().getFactory().get(_area, _documentId, lang);
DublinCore dc = doc.getDublinCore();
- dc.setValue(DublinCore.ELEMENT_CREATOR, creator);
- dc.setValue(DublinCore.ELEMENT_TITLE, title);
- dc.setValue(DublinCore.ELEMENT_DESCRIPTION, description);
- dc.setValue(DublinCore.ELEMENT_SUBJECT, subject);
- dc.setValue(DublinCore.ELEMENT_PUBLISHER, publisher);
- dc.setValue(DublinCore.ELEMENT_RIGHTS, rights);
+ dc.setValue(DublinCore.ELEMENT_CREATOR, _creator);
+ dc.setValue(DublinCore.ELEMENT_TITLE, _title);
+ dc.setValue(DublinCore.ELEMENT_DESCRIPTION, _description);
+ dc.setValue(DublinCore.ELEMENT_SUBJECT, _subject);
+ dc.setValue(DublinCore.ELEMENT_PUBLISHER, _publisher);
+ dc.setValue(DublinCore.ELEMENT_RIGHTS, _rights);
dc.save();
}
- /** (non-Javadoc)
+ /**
* @see org.apache.tools.ant.Task#execute()
*/
public void execute() throws BuildException {
@@ -264,8 +264,11 @@
getSubject(),
getPublisher(),
getRights());
- } catch (
- Exception e) {
+ } catch (final BuildException e) {
+ throw new BuildException(e);
+ } catch (final DocumentBuildException e) {
+ throw new BuildException(e);
+ } catch (final DocumentException e) {
throw new BuildException(e);
}
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/authoring/CreatorException.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/authoring/CreatorException.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/authoring/CreatorException.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/authoring/CreatorException.java Tue Feb 8 10:13:39 2005
@@ -19,9 +19,12 @@
package org.apache.lenya.cms.authoring;
+/**
+ * The creator exception
+ */
public class CreatorException extends Exception {
/**
- *
+ * The Constructor
*/
public CreatorException() {
super();
@@ -29,7 +32,6 @@
/**
* Create an instance of <code>CreatorException</code>
- *
* @param message the exception message
*/
public CreatorException(String message) {
@@ -38,7 +40,6 @@
/**
* Create an instance of <code>CreatorException</code>
- *
* @param cause the cause of the exception
*/
public CreatorException(Throwable cause) {
@@ -47,7 +48,6 @@
/**
* Create an instance of <code>CreatorException</code>
- *
* @param message the exception message
* @param cause the cause of the exception
*/
Modified: lenya/trunk/src/java/org/apache/lenya/cms/authoring/DefaultBranchCreator.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/authoring/DefaultBranchCreator.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/authoring/DefaultBranchCreator.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/authoring/DefaultBranchCreator.java Tue Feb 8 10:13:39 2005
@@ -21,22 +21,22 @@
import java.io.File;
+/**
+ * Default creator for Documents of type branch (ie, they can have child documents)
+ */
public class DefaultBranchCreator extends DefaultCreator {
/**
* Return the child type.
- *
* @param childType a <code>short</code> value
- *
* @return a <code>short</code> value
- *
* @exception Exception if an error occurs
*/
public short getChildType(short childType) throws Exception {
return BRANCH_NODE;
}
- /** (non-Javadoc)
- * @see org.apache.lenya.cms.authoring.DefaultCreator#getChildFileName(java.io.File, java.lang.String)
+ /**
+ * @see org.apache.lenya.cms.authoring.DefaultCreator#getChildFileName(java.io.File, java.lang.String, java.lang.String)
*/
protected String getChildFileName(
File parentDir,
@@ -51,8 +51,8 @@
+ ".xml";
}
- /** (non-Javadoc)
- * @see org.apache.lenya.cms.authoring.DefaultCreator#getChildMetaFileName(java.io.File, java.lang.String)
+ /**
+ * @see org.apache.lenya.cms.authoring.DefaultCreator#getChildMetaFileName(java.io.File, java.lang.String, java.lang.String)
*/
protected String getChildMetaFileName(
File parentDir,
Modified: lenya/trunk/src/java/org/apache/lenya/cms/authoring/DefaultCreator.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/authoring/DefaultCreator.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/authoring/DefaultCreator.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/authoring/DefaultCreator.java Tue Feb 8 10:13:39 2005
@@ -25,14 +25,29 @@
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.lenya.xml.DocumentHelper;
-import org.apache.log4j.Category;
+import org.apache.log4j.Logger;
import org.w3c.dom.Document;
+/**
+ * The default creator
+ */
public class DefaultCreator implements ParentChildCreatorInterface {
- private static Category log = Category.getInstance(DefaultCreator.class);
+ private static Logger log = Logger.getLogger(DefaultCreator.class);
+ /**
+ * <code>RESOURCE_NAME</code> The resource name parameter
+ */
public static final String RESOURCE_NAME = "resource-name";
+ /**
+ * <code>RESOURCE_META_NAME</code> The resource meta name parameter
+ */
public static final String RESOURCE_META_NAME = "resource-meta-name";
+ /**
+ * <code>SAMPLE_NAME</code> The sample name parameter
+ */
public static final String SAMPLE_NAME = "sample-name";
+ /**
+ * <code>SAMPLE_META_NAME</code> The sample meta name parameter
+ */
public static final String SAMPLE_META_NAME = "sample-meta-name";
private String resourceName = null;
@@ -42,8 +57,6 @@
/**
* @see org.apache.lenya.cms.authoring.ParentChildCreatorInterface#init(Configuration)
- *
- * @param conf DOCUMENT ME!
*/
public void init(Configuration conf) {
if (conf == null) {
@@ -51,33 +64,30 @@
}
if (conf.getChild(RESOURCE_NAME, false) != null) {
- resourceName = conf.getChild(RESOURCE_NAME).getValue("index.xml");
+ this.resourceName = conf.getChild(RESOURCE_NAME).getValue("index.xml");
}
if (conf.getChild(RESOURCE_META_NAME, false) != null) {
- resourceMetaName =
+ this.resourceMetaName =
conf.getChild(RESOURCE_META_NAME).getValue("index-meta.xml");
}
if (conf.getChild(SAMPLE_NAME, false) != null) {
- sampleResourceName =
+ this.sampleResourceName =
conf.getChild(SAMPLE_NAME).getValue("sampleindex.xml");
}
if (conf.getChild(SAMPLE_META_NAME, false) != null) {
- sampleMetaName =
+ this.sampleMetaName =
conf.getChild(SAMPLE_META_NAME).getValue("samplemeta.xml");
}
}
/**
* Generate a tree id by returning the child ID.
- *
* @param childId a <code>String</code> value
* @param childType a <code>short</code> value
- *
* @return a <code>String</code> value
- *
* @exception Exception if an error occurs
*/
public String generateTreeId(String childId, short childType)
@@ -87,11 +97,8 @@
/**
* Return the child type by simply returning the child type.
- *
* @param childType a <code>short</code> value
- *
* @return a <code>short</code> value
- *
* @exception Exception if an error occurs
*/
public short getChildType(short childType) throws Exception {
@@ -100,34 +107,20 @@
/**
* Create Child Name for tree entry
- *
* @param childname a <code>String</code> value
- *
* @return a <code>String</code> for Child Name for tree entry
- *
* @exception Exception if an error occurs
*/
public String getChildName(String childname) throws Exception {
if (childname.length() != 0) {
return childname;
- } else {
- return "abstract_default";
}
+ return "abstract_default";
}
/**
- * DOCUMENT ME!
- *
- * @param samplesDir DOCUMENT ME!
- * @param parentDir DOCUMENT ME!
- * @param childId DOCUMENT ME!
- * @param childType DOCUMENT ME!
- * @param childName the name of the child
- * @param language for which the document is created
- * @param parameters additional parameters that can be considered when
- * creating the child
- *
- * @throws Exception DOCUMENT ME!
+ * @see org.apache.lenya.cms.authoring.ParentChildCreatorInterface#create(File, File,
+ * String, short, String, String, Map)
*/
public void create(
File samplesDir,
@@ -143,8 +136,8 @@
String filename = getChildFileName(parentDir, id, language);
String filenameMeta = getChildMetaFileName(parentDir, id, language);
- String doctypeSample = samplesDir + File.separator + sampleResourceName;
- String doctypeMeta = samplesDir + File.separator + sampleMetaName;
+ String doctypeSample = samplesDir + File.separator + this.sampleResourceName;
+ String doctypeMeta = samplesDir + File.separator + this.sampleMetaName;
File sampleFile = new File(doctypeSample);
if (!sampleFile.exists()) {
@@ -177,7 +170,7 @@
// now do the same thing for the meta document if the
// sampleMetaName is specified
- if (sampleMetaName != null) {
+ if (this.sampleMetaName != null) {
doc = DocumentHelper.readDocument(new File(doctypeMeta));
transformMetaXML(doc, id, childType, childName, parameters);
@@ -194,13 +187,11 @@
/**
* Apply some transformation on the newly created child.
- *
* @param doc the xml document
* @param childId the id of the child
* @param childType the type of child
* @param childName the name of the child
* @param parameters additional parameters that can be used in the transformation
- *
* @throws Exception if the transformation fails
*/
protected void transformXML(
@@ -209,17 +200,17 @@
short childType,
String childName,
Map parameters)
- throws Exception {}
+ throws Exception {
+ // do nothing
+ }
/**
* Apply some transformation on the meta file of newly created child.
- *
* @param doc the xml document
* @param childId the id of the child
* @param childType the type of child
* @param childName the name of the child
* @param parameters additional parameters that can be used in the transformation
- *
* @throws Exception if the transformation fails
*/
protected void transformMetaXML(
@@ -228,15 +219,15 @@
short childType,
String childName,
Map parameters)
- throws Exception {}
+ throws Exception {
+ // do nothing
+ }
/**
* Get the file name of the child
- *
* @param parentDir the parent directory
* @param childId the id of the child
* @param language for which the document is created
- *
* @return the file name of the child
*/
protected String getChildFileName(
@@ -248,11 +239,9 @@
/**
* Get the file name of the meta file
- *
* @param parentDir the parent directory
* @param childId the id of the child
* @param language for which the document is created
- *
* @return the name of the meta file
*/
protected String getChildMetaFileName(
@@ -264,9 +253,7 @@
/**
* Create the language suffix for a file name given a language string
- *
* @param language the language
- *
* @return the suffix for the language dependant file name
*/
protected String getLanguageSuffix(String language) {
Modified: lenya/trunk/src/java/org/apache/lenya/cms/authoring/ParentChildCreatorInterface.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/authoring/ParentChildCreatorInterface.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/authoring/ParentChildCreatorInterface.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/authoring/ParentChildCreatorInterface.java Tue Feb 8 10:13:39 2005
@@ -24,6 +24,9 @@
import org.apache.avalon.framework.configuration.Configuration;
+/**
+ * Interface for creation of hierarchial documents
+ */
public interface ParentChildCreatorInterface {
/**
* Constant for a branch node. Branch nodes are somewhat related
Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/AccessControlAction.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/AccessControlAction.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/AccessControlAction.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/AccessControlAction.java Tue Feb 8 10:13:39 2005
@@ -60,7 +60,7 @@
ServiceSelector selector = null;
AccessControllerResolver resolver = null;
- accessController = null;
+ this.accessController = null;
Request request = ObjectModelHelper.getRequest(objectModel);
@@ -68,7 +68,7 @@
try {
selector =
- (ServiceSelector) manager.lookup(AccessControllerResolver.ROLE + "Selector");
+ (ServiceSelector) this.manager.lookup(AccessControllerResolver.ROLE + "Selector");
getLogger().debug("Resolving AC resolver for type [" + AccessControllerResolver.DEFAULT_RESOLVER + "]");
resolver =
@@ -77,12 +77,12 @@
getLogger().debug("Resolved AC resolver [" + resolver + "]");
String webappUrl = ServletHelper.getWebappURI(request);
- accessController = resolver.resolveAccessController(webappUrl);
+ this.accessController = resolver.resolveAccessController(webappUrl);
- if (accessController == null) {
+ if (this.accessController == null) {
result = Collections.EMPTY_MAP;
} else {
- accessController.setupIdentity(request);
+ this.accessController.setupIdentity(request);
result = doAct(redirector, sourceResolver, objectModel, source, parameters);
}
@@ -91,7 +91,7 @@
if (resolver != null) {
selector.release(resolver);
}
- manager.release(selector);
+ this.manager.release(selector);
}
}
return result;
@@ -129,7 +129,7 @@
* @return An access controller.
*/
public AccessController getAccessController() {
- return accessController;
+ return this.accessController;
}
}
Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/DelegatingAuthorizerAction.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/DelegatingAuthorizerAction.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/DelegatingAuthorizerAction.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/DelegatingAuthorizerAction.java Tue Feb 8 10:13:39 2005
@@ -74,6 +74,9 @@
return result;
}
+ /**
+ * <code>HISTORY</code> Name of the session attribute that holds the history
+ */
public static final String HISTORY =
DelegatingAuthorizerAction.class.getPackage().getName() + ".History";
Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/DocumentIdExistsAction.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/DocumentIdExistsAction.java?view=diff&r1=152681&r2=152682
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/DocumentIdExistsAction.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/acting/DocumentIdExistsAction.java Tue Feb 8 10:13:39 2005
@@ -27,8 +27,11 @@
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.SourceResolver;
import org.apache.lenya.cms.publication.Document;
+import org.apache.lenya.cms.publication.DocumentException;
+import org.apache.lenya.cms.publication.DocumentDoesNotExistException;
import org.apache.lenya.cms.publication.DocumentIdentityMap;
import org.apache.lenya.cms.publication.PageEnvelope;
+import org.apache.lenya.cms.publication.PageEnvelopeException;
import org.apache.lenya.cms.publication.PageEnvelopeFactory;
import org.apache.lenya.cms.publication.Publication;
import org.apache.lenya.cms.publication.PublicationFactory;
@@ -40,6 +43,11 @@
public class DocumentIdExistsAction extends AbstractAction {
/**
+ * <code>DOCUMENT_ID_PARAMETER_NAME</code> the name of the parameter to pass in
+ */
+ public static final String DOCUMENT_ID_PARAMETER_NAME = "document-id";
+
+ /**
* Check if there is a doument in the site tree with the given document-id.
*
* If yes return an empty map, if not return null.
@@ -58,11 +66,6 @@
* @exception PageEnvelopeException if the PageEnvelope could not be created.
* @exception DocumentException if the language information could not be fetched from the
* document.
- */
-
- public static final String DOCUMENT_ID_PARAMETER_NAME = "document-id";
-
- /**
* @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector,
* org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String,
* org.apache.avalon.framework.parameters.Parameters)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org