diff --git a/ccm-cms/src/com/arsdigita/cms/contentitem/ContentPageHelper.java b/ccm-cms/src/com/arsdigita/cms/contentitem/ContentPageHelper.java
index 6790b9ae1..3ebfaf961 100755
--- a/ccm-cms/src/com/arsdigita/cms/contentitem/ContentPageHelper.java
+++ b/ccm-cms/src/com/arsdigita/cms/contentitem/ContentPageHelper.java
@@ -19,59 +19,70 @@
package com.arsdigita.cms.contentitem;
import com.arsdigita.categorization.Category;
-import com.arsdigita.categorization.CategoryPurpose;
-import com.arsdigita.categorization.CategoryCollection;
+// import com.arsdigita.categorization.CategoryPurpose;
+//import com.arsdigita.categorization.CategoryCollection;
import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ContentPage;
import com.arsdigita.cms.ContentSection;
import com.arsdigita.cms.Folder;
import org.apache.log4j.Logger;
-import java.util.Iterator;
+//import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
-/** Parses and XML file definition of content items in a folder.
+/**
+ * Parses and XML file definition of content items in a folder.
* the XML configuration should look like this:
*/
-
public class ContentPageHelper extends ContentBundleHelper {
+
+ private static final Logger s_log = Logger
+ .getLogger(ContentPageHelper.class);
+
private Category m_category;
private List m_categories = new LinkedList();
private Random m_random;
- private static final Logger s_log = Logger.getLogger(ContentPageHelper.class);
-
+ /**
+ * Constructor.
+ *
+ * @param section
+ */
public ContentPageHelper(ContentSection section) {
+
super(section);
m_category = section.getRootCategory();
+
// Look for categories CategoryPurpose.NAVIGATION
- CategoryPurpose nav = CategoryPurpose
- .getPurpose(CategoryPurpose.NAVIGATION);
- if (null != nav) {
- s_log.debug("purpose key " + nav.getKey() + " name " + nav.getName());
+ // CategoryPurpose is deprecated and not used anymore
+ // CategoryPurpose nav = CategoryPurpose
+ // .getPurpose(CategoryPurpose.NAVIGATION);
+ // if (null != nav) {
+ // s_log.debug("purpose key " + nav.getKey() + " name " + nav.getName());
+ //
+ // Iterator navs = nav.getCategories().iterator();
+ //
+ // while (navs.hasNext()) {
+ // Category cat = (Category) navs.next();
+ // CategoryCollection scions = cat.getDescendants();
+ // while ( scions.next() ) {
+ // m_categories.add(scions.getCategory());
+ // }
+ // scions.close();
+ // }
+ //
+ // }
- Iterator navs = nav.getCategories().iterator();
-
- while (navs.hasNext()) {
- Category cat = (Category) navs.next();
- CategoryCollection scions = cat.getDescendants();
- while ( scions.next() ) {
- m_categories.add(scions.getCategory());
- }
- scions.close();
- }
-
- }
-
- if ( m_categories.size() == 0 ) {
+ if ( m_categories.isEmpty() ) {
s_log.debug("Category list is empty, adding root");
m_categories.add(m_category);
}
m_random = new Random();
}
+ @Override
public void setBodyText(String body) {
// do nothing
}
@@ -85,6 +96,7 @@ public class ContentPageHelper extends ContentBundleHelper {
}
}
+ @Override
public ContentItem create() {
return createContentPage();
}
@@ -104,6 +116,7 @@ public class ContentPageHelper extends ContentBundleHelper {
// }
// Save everything at the very end
+ @Override
public void save() {
super.save();
Category cat = getCategory();
@@ -112,6 +125,7 @@ public class ContentPageHelper extends ContentBundleHelper {
}
/** Assigning pages to random categories */
+ @Override
public ContentItem cloneItem ( String name, Folder parent, boolean save ) {
ContentPage page = (ContentPage)super.cloneItem(name, parent, save);
page.save();
diff --git a/ccm-cms/src/com/arsdigita/cms/contentitem/GenericArticleHelper.java b/ccm-cms/src/com/arsdigita/cms/contentitem/GenericArticleHelper.java.nolongerInUse
similarity index 84%
rename from ccm-cms/src/com/arsdigita/cms/contentitem/GenericArticleHelper.java
rename to ccm-cms/src/com/arsdigita/cms/contentitem/GenericArticleHelper.java.nolongerInUse
index 15b9f5e6d..e2da44fc8 100755
--- a/ccm-cms/src/com/arsdigita/cms/contentitem/GenericArticleHelper.java
+++ b/ccm-cms/src/com/arsdigita/cms/contentitem/GenericArticleHelper.java.nolongerInUse
@@ -30,6 +30,18 @@ import org.apache.log4j.Logger;
* @author Jon Orris
*
*/
+
+
+// ///////////////////////////////////////////////////////////
+//
+// Parent class ContentPageHelper looks for CategoryPurposes
+// to ensure that at least one category exists.
+// CategoryPurpose is no longer used so that never any
+// CategoryPurpose exists.
+//
+// //////////////////////////////////////////////////////////
+
+
public class GenericArticleHelper extends ContentPageHelper {
private static final Logger s_log = Logger.getLogger(GenericArticleHelper.class);
diff --git a/ccm-cms/src/com/arsdigita/cms/contentitem/XMLContentItemHandler.java b/ccm-cms/src/com/arsdigita/cms/contentitem/XMLContentItemHandler.java
index 6fd2d33b8..72fb59e8a 100755
--- a/ccm-cms/src/com/arsdigita/cms/contentitem/XMLContentItemHandler.java
+++ b/ccm-cms/src/com/arsdigita/cms/contentitem/XMLContentItemHandler.java
@@ -106,6 +106,7 @@ import org.xml.sax.helpers.DefaultHandler;
*
*/
public class XMLContentItemHandler extends DefaultHandler {
+
private static final Logger s_log
= Logger.getLogger(XMLContentItemHandler.class);
@@ -132,7 +133,6 @@ public class XMLContentItemHandler extends DefaultHandler {
* @param section the ContentSection where the items will be
* created
*/
-
public XMLContentItemHandler(ContentSection section) {
super();
s_log.debug(XMLContentItemHandler.class.getName());
@@ -142,6 +142,13 @@ public class XMLContentItemHandler extends DefaultHandler {
}
+ /**
+ *
+ * @param uri
+ * @param name
+ * @param qName
+ * @param atts
+ */
@Override
public void startElement( String uri, String name,
String qName, Attributes atts) {
@@ -227,6 +234,12 @@ public class XMLContentItemHandler extends DefaultHandler {
}
}
+ /**
+ *
+ * @param ch
+ * @param start
+ * @param length
+ */
@Override
public void characters(char[] ch,
int start,
@@ -235,6 +248,12 @@ public class XMLContentItemHandler extends DefaultHandler {
m_body = new String(ch, start, length);
}
+ /**
+ *
+ * @param uri
+ * @param name
+ * @param qName
+ */
@Override
public void endElement( String uri, String name,
String qName) {
@@ -314,11 +333,18 @@ public class XMLContentItemHandler extends DefaultHandler {
}
} else {
s_log.warn("Using default ContentItemHelper");
+ // Might be a typo. All in this class is about items!
+ // XXX: Check if ContentItemHelper is better.
return new ContentPageHelper(m_section);
+ // return new ContentItemHelper(m_section);
}
}
+
+ /**
+ *
+ */
public ContentType getContentType(String typeName)
throws UncheckedWrapperException {
ContentType type = null;
@@ -342,6 +368,12 @@ public class XMLContentItemHandler extends DefaultHandler {
}
// Utilities
+
+ /**
+ *
+ * @param name
+ * @return
+ */
private String validateTitle(String name) {
Perl5Util util = new Perl5Util();
String pattern = "/[^A-Za-z_0-9\\-]+ /";
@@ -468,13 +500,12 @@ public class XMLContentItemHandler extends DefaultHandler {
* @param child the xmlContentItem to clone
* @param parent the folder to attach all the new children to
*/
- private void autoCloneChild ( xmlContentItem child, Folder parent ) {
- final int numClone = child.getHelperClass().getCloneCount();
+ private void autoCloneChild ( xmlContentItem child,
+ Folder parent ) {
+ final int numClone = child.getHelperClass()
+ .getCloneCount();
for ( int i=1; icloneNumber
*/
private ContentItem cloneItem ( String name,
- int cloneNumber,
- Folder parent,
- boolean save,
- boolean replicate
- )
- {
+ int cloneNumber,
+ Folder parent,
+ boolean save,
+ boolean replicate ) {
// clone and set associations here as well
if ( replicate ) {
s_log.debug ( "About to replicate: "
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryPurposeIteratorListModel.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryPurposeIteratorListModel.java.nolongerInUse
similarity index 87%
rename from ccm-cms/src/com/arsdigita/cms/ui/category/CategoryPurposeIteratorListModel.java
rename to ccm-cms/src/com/arsdigita/cms/ui/category/CategoryPurposeIteratorListModel.java.nolongerInUse
index 8136c4c36..f20ed5218 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryPurposeIteratorListModel.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryPurposeIteratorListModel.java.nolongerInUse
@@ -23,6 +23,15 @@ import com.arsdigita.categorization.CategoryPurpose;
import java.util.Iterator;
+
+
+// /////////////////////////////////////////////////////////////
+// Construct CategoryPurpose is deprecated and no longer used.
+// Temporarly retained for easy reference until refactoring completed.
+// /////////////////////////////////////////////////////////////
+
+
+
/**
* A {@link ListModel} that iterates over categories via an iterator
*/
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/PurposeForm.java b/ccm-cms/src/com/arsdigita/cms/ui/category/PurposeForm.java.nolongerInUse
similarity index 100%
rename from ccm-cms/src/com/arsdigita/cms/ui/category/PurposeForm.java
rename to ccm-cms/src/com/arsdigita/cms/ui/category/PurposeForm.java.nolongerInUse
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/PurposesList.java b/ccm-cms/src/com/arsdigita/cms/ui/category/PurposesList.java.nolongerinUse
similarity index 100%
rename from ccm-cms/src/com/arsdigita/cms/ui/category/PurposesList.java
rename to ccm-cms/src/com/arsdigita/cms/ui/category/PurposesList.java.nolongerinUse
diff --git a/ccm-core/src/com/arsdigita/categorization/CategorizedObject.java b/ccm-core/src/com/arsdigita/categorization/CategorizedObject.java
index 88b8d30a0..212953b59 100755
--- a/ccm-core/src/com/arsdigita/categorization/CategorizedObject.java
+++ b/ccm-core/src/com/arsdigita/categorization/CategorizedObject.java
@@ -117,10 +117,12 @@ public class CategorizedObject {
* @param purposeKey the Integer key for the desired CategoryPurpose
* @return a collection of categories that this object is classified under.
* @throws DataObjectNotFoundException
- * @deprecated the notion of "category purposes" has been deprecated. Use
+ * @ deprecated the notion of "category purposes" has been deprecated. Use
* the use-context-based API, as explained in {@link Category}.
**/
- public Collection getParentCategories(String purposeKey) {
+// Construct CategoryPurpose is deprecated and no longer used.
+// Temporarly retained for easy reference until refactoring completed.
+/* public Collection getParentCategories(String purposeKey) {
Iterator parents = getParentCategories().iterator();
Collection filteredParents = new LinkedList();
while (parents.hasNext()) {
@@ -148,7 +150,7 @@ public class CategorizedObject {
}
return filteredParents;
- }
+ } */
/**
* Gets the default parent category.
diff --git a/ccm-core/src/com/arsdigita/categorization/Category.java b/ccm-core/src/com/arsdigita/categorization/Category.java
index 6b0f3c23a..151c07524 100755
--- a/ccm-core/src/com/arsdigita/categorization/Category.java
+++ b/ccm-core/src/com/arsdigita/categorization/Category.java
@@ -42,12 +42,14 @@ import com.arsdigita.util.Assert;
import com.arsdigita.util.HierarchyDenormalization;
import com.arsdigita.util.StringUtils;
import com.arsdigita.util.UncheckedWrapperException;
+
import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.StringTokenizer;
+
import org.apache.log4j.Logger;
/**
@@ -865,44 +867,55 @@ public class Category extends ACSObject {
}
/**
- * @deprecated use the "use context" APIs instead
+ * @ deprecated use the "use context" APIs instead
+ * (specifically #getRootForObject(ACSObject, String) here)
*
*/
- public Collection getPurposes() {
- DataAssociationCursor purposeCur = ((DataAssociation) get(PURPOSES)).
- cursor();
- Collection purposes = new LinkedList();
- while (purposeCur.next()) {
- CategoryPurpose cp = (CategoryPurpose) DomainObjectFactory.
- newInstance(purposeCur.getDataObject());
- purposes.add(cp);
- }
- return purposes;
- }
+ // No longer used anywhere in the Code. Temporarily retained for easy reference
+ // until the process of migrating Terms into Categorization is
+ // completed.
+ // public Collection getPurposes() {
+ // DataAssociationCursor purposeCur = ((DataAssociation) get(PURPOSES)).
+ // cursor();
+ // Collection purposes = new LinkedList();
+ // while (purposeCur.next()) {
+ // CategoryPurpose cp = (CategoryPurpose) DomainObjectFactory.
+ // newInstance(purposeCur.getDataObject());
+ // purposes.add(cp);
+ // }
+ // return purposes;
+ // }
/**
* Adds the specified purpose to this category.
*
* @param purpose The purpose
*
- * @deprecated use the "use context" APIs instead
+ * @ deprecated use the "use context" APIs instead
+ * (specifically setRootForObject(ACSObject, Category,String))
*
*/
- public void addPurpose(CategoryPurpose purpose) {
- add(PURPOSES, purpose);
- }
+ // No longer used anywhere in the Code. Temporarily retained for easy reference
+ // until the process of migrating Terms into Categorization is
+ // completed.
+ // public void addPurpose(CategoryPurpose purpose) {
+ // add(PURPOSES, purpose);
+ // }
/**
* Removes the specified purpose from this category.
*
* @param purpose the purpose
*
- * @deprecated use the "use context" APIs instead
+ * @ deprecated use the "use context" APIs instead
*
*/
- public void removePurpose(CategoryPurpose purpose) {
- remove(PURPOSES, purpose);
- }
+ // No longer used anywhere in the Code. Temporarily retained for easy reference
+ // until the process of migrating Terms into Categorization is
+ // completed.
+ // public void removePurpose(CategoryPurpose purpose) {
+ // remove(PURPOSES, purpose);
+ // }
public void setDefaultAncestors(Category defaultParent) {
String value;
@@ -2164,9 +2177,12 @@ public class Category extends ACSObject {
/**
* A shortcut for calling {@link #setRootForObject(ACSObject, Category,
- * String)} with the null context.
+ * String)} with the null context. A null context is used as default
+ * context. Currently there MUST a default context exist for each pair of
+ * ACSObject - RootCategory (i.e. with a null context).
*
* @see #setRootForObject(ACSObject, Category, String)
+ *
* @param object the object to own the root category
* @param root the root category for the object
*/
@@ -2192,11 +2208,12 @@ public class Category extends ACSObject {
* should have no parents. This method does not check if this is indeed the
* case.
true if this term has no preferred term, otherwise false.
+ * Is this term a preferred term?
+ *
+ * @return true if this term has no preferred term,
+ * otherwise false.
*/
public boolean isPreferredTerm() {
DomainCollection dc = getPreferredTerms();
diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainContextForm.java b/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainContextForm.java
index 6a506c642..35a6f377b 100755
--- a/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainContextForm.java
+++ b/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainContextForm.java
@@ -18,8 +18,6 @@
package com.arsdigita.london.terms.ui.admin;
-import java.util.TooManyListenersException;
-
import com.arsdigita.bebop.Form;
import com.arsdigita.bebop.FormProcessException;
import com.arsdigita.bebop.PageState;
@@ -43,7 +41,13 @@ import com.arsdigita.util.UncheckedWrapperException;
import com.arsdigita.web.Application;
import com.arsdigita.web.ApplicationCollection;
+import java.util.TooManyListenersException;
+
+/**
+ *
+ *
+ */
public class DomainContextForm extends Form {
private DomainObjectParameter m_domain;
diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainDetails.java b/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainDetails.java
index b2dda73ac..e2b27bcf0 100755
--- a/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainDetails.java
+++ b/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainDetails.java
@@ -19,10 +19,6 @@
package com.arsdigita.london.terms.ui.admin;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-
import com.arsdigita.bebop.PageState;
import com.arsdigita.categorization.Category;
import com.arsdigita.domain.DeleteException;
@@ -38,6 +34,15 @@ import com.arsdigita.london.util.ui.event.DomainObjectActionListener;
import com.arsdigita.london.util.ui.parameters.DomainObjectParameter;
import com.arsdigita.xml.Element;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+
+
+/**
+ *
+ *
+ */
public class DomainDetails extends AbstractDomainObjectDetails {
private static final Logger s_log =
Logger.getLogger( DomainDetails.class );
@@ -66,6 +71,7 @@ public class DomainDetails extends AbstractDomainObjectDetails {
addDomainObjectActionListener(
ACTION_DELETE,
new DomainObjectActionListener() {
+ @Override
public void actionPerformed(DomainObjectActionEvent e) {
PageState ps = e.getPageState();
@@ -105,6 +111,7 @@ public class DomainDetails extends AbstractDomainObjectDetails {
});
addDomainObjectActionListener(ACTION_TRAIN, new DomainObjectActionListener() {
+ @Override
public void actionPerformed(DomainObjectActionEvent e) {
Domain domain = (Domain) e.getObject();
Indexer indexer = Indexer.retrieve(domain);
@@ -116,6 +123,7 @@ public class DomainDetails extends AbstractDomainObjectDetails {
});
addDomainObjectActionListener(ACTION_UNTRAIN, new DomainObjectActionListener() {
+ @Override
public void actionPerformed(DomainObjectActionEvent e) {
Domain domain = (Domain) e.getObject();
Indexer indexer = Indexer.retrieve(domain);
@@ -126,10 +134,23 @@ public class DomainDetails extends AbstractDomainObjectDetails {
});
}
+ /**
+ *
+ * @param state
+ * @return
+ */
+ @Override
protected DomainObject getDomainObject(PageState state) {
return (DomainObject)state.getValue(m_domain);
}
+ /**
+ *
+ * @param ps
+ * @param parent
+ * @param dobj
+ */
+ @Override
public void generateActionXML( PageState ps, Element parent,
DomainObject dobj ) {
s_log.debug( "In generateActionXML" );
diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainEditForm.java b/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainEditForm.java
index 31099a46d..159d5bc8c 100644
--- a/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainEditForm.java
+++ b/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/DomainEditForm.java
@@ -59,7 +59,13 @@ public class DomainEditForm extends Form {
private Date released;
private SaveCancelSection saveCancel;
- public DomainEditForm(final String name, final DomainObjectParameter selected) {
+ /**
+ *
+ * @param name
+ * @param selected
+ */
+ public DomainEditForm(final String name,
+ final DomainObjectParameter selected) {
super(name, new ColumnPanel(2));
setClassAttr("domainEdit");
@@ -133,8 +139,16 @@ public class DomainEditForm extends Form {
addProcessListener(new Processlistener());
}
+ /**
+ *
+ */
private class InitListener implements FormInitListener {
+ /**
+ *
+ * @param event
+ * @throws FormProcessException
+ */
@Override
public void init(final FormSectionEvent event) throws FormProcessException {
final PageState state = event.getPageState();
@@ -159,8 +173,17 @@ public class DomainEditForm extends Form {
}
+
+ /**
+ *
+ */
private class SubmissionListener implements FormSubmissionListener {
+ /**
+ *
+ * @param event
+ * @throws FormProcessException
+ */
@Override
public void submitted(final FormSectionEvent event) throws FormProcessException {
final PageState state = event.getPageState();
@@ -180,8 +203,16 @@ public class DomainEditForm extends Form {
}
+ /**
+ *
+ */
private class Processlistener implements FormProcessListener {
+ /**
+ *
+ * @param event
+ * @throws FormProcessException
+ */
@Override
public void process(final FormSectionEvent event) throws FormProcessException {
final PageState state = event.getPageState();
diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/TermDetails.java b/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/TermDetails.java
index 7c6e76852..4f3a35c09 100755
--- a/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/TermDetails.java
+++ b/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/TermDetails.java
@@ -28,6 +28,10 @@ import com.arsdigita.london.util.ui.event.DomainObjectActionEvent;
import com.arsdigita.london.util.ui.event.DomainObjectActionListener;
import com.arsdigita.london.util.ui.parameters.DomainObjectParameter;
+/**
+ *
+ *
+ */
public class TermDetails extends AbstractDomainObjectDetails {
private DomainObjectParameter m_term;
diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/TermForm.java b/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/TermForm.java
index 72f2dc789..2461238f0 100755
--- a/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/TermForm.java
+++ b/ccm-ldn-terms/src/com/arsdigita/london/terms/ui/admin/TermForm.java
@@ -204,6 +204,7 @@ public class TermForm extends Form {
private class UniqueValidationListener implements ParameterListener {
+ @Override
public void validate(ParameterEvent e)
throws FormProcessException {
PageState state = e.getPageState();
diff --git a/ccm-rssfeed/src/com/arsdigita/rssfeed/Loader.java b/ccm-rssfeed/src/com/arsdigita/rssfeed/Loader.java
index 8f687810b..fddbd4b49 100755
--- a/ccm-rssfeed/src/com/arsdigita/rssfeed/Loader.java
+++ b/ccm-rssfeed/src/com/arsdigita/rssfeed/Loader.java
@@ -18,7 +18,6 @@
package com.arsdigita.rssfeed;
-// import com.arsdigita.categorization.CategoryPurpose;
import com.arsdigita.domain.DataObjectNotFoundException;
import com.arsdigita.kernel.Kernel;
import com.arsdigita.kernel.KernelExcursion;
diff --git a/ccm-rssfeed/src/com/arsdigita/rssfeed/category/CategoryPurposeChannel.java b/ccm-rssfeed/src/com/arsdigita/rssfeed/category/CategoryPurposeChannel.java.nolongerInUse
similarity index 100%
rename from ccm-rssfeed/src/com/arsdigita/rssfeed/category/CategoryPurposeChannel.java
rename to ccm-rssfeed/src/com/arsdigita/rssfeed/category/CategoryPurposeChannel.java.nolongerInUse