From: <pb...@fe...> - 2012-12-16 20:05:54
|
Author: pboy Date: 2012-12-16 20:05:43 +0000 (Sun, 16 Dec 2012) New Revision: 2390 Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryItemPane.java trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationEditForm.java trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationTable.java trunk/ccm-core/src/com/arsdigita/categorization/Category.java trunk/ccm-core/src/com/arsdigita/categorization/CategoryLocalizationCollection.java trunk/ccm-navigation/src/com/arsdigita/navigation/DataCollectionDefinition.java trunk/ccm-navigation/src/com/arsdigita/navigation/ui/AbstractObjectList.java trunk/ccm-navigation/src/com/arsdigita/navigation/ui/object/ComplexObjectList.java Log: UI enhancement: category localisation now editable, contentbundle sorted by locale. (on behalf of quasimodo) Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties 2012-12-16 19:58:08 UTC (rev 2389) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties 2012-12-16 20:05:43 UTC (rev 2390) @@ -105,7 +105,7 @@ cms.contenttypes.ui.event_end_time=Event End Time: cms.contenttypes.ui.government_uid=Government UID: cms.contenttypes.ui.grade=Grade: -cms.contenttypes.ui.homepage=Homepage? +cms.contenttypes.ui.homepage=Homepage: cms.contenttypes.ui.job_description=Job Description: cms.contenttypes.ui.launch_date=Launch Date: cms.contenttypes.ui.lead=Description: Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties 2012-12-16 19:58:08 UTC (rev 2389) +++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties 2012-12-16 20:05:43 UTC (rev 2390) @@ -70,7 +70,7 @@ cms.contenttypes.shared.assign_categories.title=Kategorien zuweisen cms.contenttypes.shared.assign_categories.description=Kategorien zuweisen cms.contenttypes.shared.attach_files.title=Dateien zuordnen -cms.contenttypes.shared.attach_files.description=Dateien anh\u00c4ngen +cms.contenttypes.shared.attach_files.description=Dateien anh\u00e4ngen cms.contenttypes.shared.basic_properties.description=Basiseigenschaften editieren cms.contenttypes.shared.basic_properties.title=Basiseigenschaften cms.contenttypes.shared.body_text.title=Haupttext @@ -105,7 +105,7 @@ cms.contenttypes.ui.event_end_time=Event Ende um\: cms.contenttypes.ui.government_uid=Government UID: cms.contenttypes.ui.grade=Grad: -cms.contenttypes.ui.homepage=Homepage? +cms.contenttypes.ui.homepage=Homepage: cms.contenttypes.ui.job_description=Job Beschreibung: cms.contenttypes.ui.launch_date=Ver\u00f6ffentlichungsdatum: cms.contenttypes.ui.lead=Beschreibung (Lead Text): @@ -160,8 +160,8 @@ cms.installer.cannot_find_group_for_email=Kann email-Gruppe nicht finden cms.installer.cannot_read_line_of_data=Kann Datensatz nicht lesen cms.installer.cannot_set_template_text=Kann Template Text nicht festlegen -cms.installer.could_not_load_section=Kann die folgende ContentSection nicht laden '{0}' -cms.installer.deploy=anwenden +cms.installer.could_not_load_section=Kann die ContentSection '{0}' nicht laden +cms.installer.deploy=Anwenden cms.installer.failed_to_update_the_default_content_section=Update der Default Content Section gescheitert. cms.installer.formbuilder.form=Form cms.installer.formbuilder.form_section=Form Abschnitt @@ -187,7 +187,7 @@ cms.publishToFile.could_not_get_object_for_oid=Could not get object for oid cms.publishToFile.error_executing=Ausf\u00fchrungsfehler bei '{0}' \: cms.publishToFile.exit_value_was=Exit Code war -cms.publishToFile.interrupted_when_doing=Unterbrochen bei Ausf\u00fchren von '{0}' +cms.publishToFile.interrupted_when_doing=Unterbrochen beim Ausf\u00fchren von '{0}' cms.publishToFile.invalid_brokenlinkaction=Ung\u00fcltige BrokenLinkAction\: cms.publishToFile.invalid_reference_target_type=Ung\u00fcltige reference target type\: cms.publishToFile.malformed_url=Falsche Struktur der URL\: @@ -232,7 +232,7 @@ cms.ui.browse=Dokumente cms.ui.browse_items_by_category=Durchsicht der Elemente nach Kategorien cms.ui.cancel=Abbruch -cms.ui.cancel_hit=Abbruch dr\u00fccken +cms.ui.cancel_hit=Abbruch gedr\u00fcckt cms.ui.cancelled=abgebrochen cms.ui.cannot_assign_groups_to_owner=cannot assign groups to owner cms.ui.categories=Kategorien @@ -241,7 +241,7 @@ cms.ui.content_item=Dokument cms.ui.content_section=Content section cms.ui.content_section_configuration=<h2>Content Section Configuration</h2> -cms.ui.content_types=Dokument Typen +cms.ui.content_types=Dokumenttypen cms.ui.contents_of=Inhalt von cms.ui.create=Erstellen cms.ui.cse=Bald abgelaufen @@ -324,10 +324,10 @@ cms.ui.template=Vorlage cms.ui.Templates=Vorlagen cms.ui.the_model_is_empty=Das Modell ist leer -cms.ui.there_are_no_items=Keine elemente vorhanden. +cms.ui.there_are_no_items=Keine Elemente vorhanden. cms.ui.there_was_no_one_matching_the_search_criteria=Kein Element erf\u00fcllte die Suchkriterien. cms.ui.this_should_never_happen=Dies sollte nie passieren\! -cms.ui.types=Dokument Typen +cms.ui.types=Dokumenttypen cms.ui.unknown=unbekannt cms.ui.upload_new_content=Neuen Inhalt laden cms.ui.use_custom_permissions=Benutzerspezifische Rechte @@ -352,9 +352,9 @@ # Package com.arsdigita.cms.ui.authoring # ====================================== -cms.ui.authoring.an_item_with_this_name_already_exists=Ein Item mit diesem Namen existiert +cms.ui.authoring.an_item_with_this_name_already_exists=Ein Item mit diesem Namen existiert bereits cms.ui.authoring.bad_getblob_datatype=Ung\u00fcltiger Datentyp getBlob -cms.ui.authoring.bad_getclob_datatype=Ung\u00fcltiger Datentyp getBlob +cms.ui.authoring.bad_getclob_datatype=Ung\u00fcltiger Datentyp getClob cms.ui.authoring.body=Textbereich: cms.ui.authoring.caption=Untertitel: cms.ui.authoring.content_type=Inhaltstyp: @@ -457,7 +457,7 @@ cms.ui.category.localization_error_locale=Bitte w\u00e4hlen Sie eine Sprache aus cms.ui.category.localization_locale=Sprache cms.ui.category.localization_name=Name -cms.ui.category.localization_none=Diese Kaegorie hat keine Sprachversionen +cms.ui.category.localization_none=Diese Kategorie hat keine Sprachversionen cms.ui.category.localization_url=URL cms.ui.category.name_not_unique=Es gibt bereits eine Kategorie mit diesem Namen. cms.ui.category.no_categorized_objects=Es gibt keine kategorisierten Objekte @@ -489,8 +489,8 @@ cms.ui.cse.itemName=Name cms.ui.cse.view=Anzeigen cms.ui.cse.viewLink=anzeigen -cms.ui.cse.edit=Edit -cms.ui.cse.editLink=edit +cms.ui.cse.edit=Bearbeiten +cms.ui.cse.editLink=bearbeiten cms.ui.cse.endDateTime=aktiv bis @@ -498,7 +498,7 @@ # =================================== cms.ui.folder.cancelled=Abgebrochen cms.ui.folder.cannot_find_a_root_folder=Kein Wurzelverzeichnis gefunden. -cms.ui.folder.na=K.A. +cms.ui.folder.na=k.A. cms.ui.folder.no_source_items_specified=Kein Quelldokument angegeben. cms.ui.folder.parent=\u00dcbergeordneter Ordner cms.ui.folder.rename=Ordner umbenennen @@ -507,7 +507,7 @@ # ======================================== cms.ui.formbuilder.description=Beschreibung: cms.ui.formbuilder.name=Name: -cms.ui.formbuilder.oh_no_you_dont=Nicht, sie wollen nicht +cms.ui.formbuilder.oh_no_you_dont=Nein, das wollen sie nicht cms.ui.formbuilder.title=Titel\: Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryItemPane.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryItemPane.java 2012-12-16 19:58:08 UTC (rev 2389) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryItemPane.java 2012-12-16 20:05:43 UTC (rev 2390) @@ -22,9 +22,12 @@ import com.arsdigita.bebop.BaseLink; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Form; +import com.arsdigita.bebop.FormModel; import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Link; +import com.arsdigita.bebop.Page; import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.ParameterSingleSelectionModel; import com.arsdigita.bebop.SimpleContainer; import com.arsdigita.bebop.SingleSelectionModel; import com.arsdigita.bebop.event.ActionEvent; @@ -32,6 +35,7 @@ import com.arsdigita.bebop.event.ChangeEvent; import com.arsdigita.bebop.event.ChangeListener; import com.arsdigita.bebop.form.Submit; +import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.categorization.CategorizedCollection; import com.arsdigita.categorization.Category; import com.arsdigita.categorization.CategoryCollection; @@ -90,7 +94,6 @@ m_category = category; // Details - m_detailPane = new SimpleContainer(); add(m_detailPane); setDefault(m_detailPane); @@ -145,7 +148,8 @@ m_category.getCategory(state) .getCategoryLocalizationCollection().size(); - if (countLanguages < countSupportedLanguages) { + if (m_category.getCategory(state).canEdit() + && countLanguages < countSupportedLanguages) { return true; } else { return false; @@ -333,20 +337,30 @@ private CategoryLocalizationTable m_catLocalizationTable; private CategoryLocalizationEditForm m_editCategoryLocalizationForm; + private StringParameter m_catLocaleParam; + private ParameterSingleSelectionModel m_catLocale; CategoryLocalizationSection(ActionLink addLink) { setHeading(new Label(gz("cms.ui.category.localizations"))); + m_catLocaleParam = new StringParameter("catLocale"); + m_catLocale = new ParameterSingleSelectionModel(m_catLocaleParam); final ActionGroup group = new ActionGroup(); setBody(group); - m_catLocalizationTable = new CategoryLocalizationTable(m_category, m_model); + m_catLocalizationTable = new CategoryLocalizationTable(m_category, m_model, m_catLocale); group.setSubject(m_catLocalizationTable); group.addAction(new AdminVisible(addLink), ActionGroup.ADD); - m_editCategoryLocalizationForm = new CategoryLocalizationEditForm(m_category, "de"); + m_editCategoryLocalizationForm = new CategoryLocalizationEditForm(m_category, m_catLocale); + add(m_editCategoryLocalizationForm); connect(m_editCategoryLocalizationForm); connect(m_catLocalizationTable, 0, m_editCategoryLocalizationForm); + } + @Override + public void register(Page page) { + super.register(page); + page.addComponentStateParam(m_editCategoryLocalizationForm, m_catLocaleParam); } } @@ -529,7 +543,7 @@ super(c, s); } - // Build the preview link. This uses a standard redirect link to find + // Build the preview link. This uses a standard redirect link to find // the content. The prepareURL method is called by the printwriter @Override protected String prepareURL(final PageState state, String location) { @@ -593,6 +607,7 @@ * and the user is allowed to edit this item. * * @param state + * * @return */ @Override @@ -614,6 +629,7 @@ * * @param item * @param state + * * @return */ private boolean isItemEditable(ContentItem item, PageState state) { Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationEditForm.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationEditForm.java 2012-12-16 19:58:08 UTC (rev 2389) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationEditForm.java 2012-12-16 20:05:43 UTC (rev 2390) @@ -20,6 +20,7 @@ import com.arsdigita.bebop.FormProcessException; import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SingleSelectionModel; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; @@ -37,30 +38,27 @@ * in order to present forms for managing the multi-language categories. * * @author Sören Bernstein (quasimodo) qu...@ze... - * @version $Id: CategoryLocalizationEditForm.java $ + * @version $Id: CategoryLocalizationEditForm.java $ */ public class CategoryLocalizationEditForm extends CategoryLocalizationForm { - + private static final Logger s_log = Logger.getLogger (CategoryLocalizationEditForm.class); - - private final String m_categoryLocalizationLocale; - + + private final SingleSelectionModel m_catLocale; /** * Creates a new instance of CategoryLocalizationEditForm */ - public CategoryLocalizationEditForm(final CategoryRequestLocal category, - final String locale) { - + public CategoryLocalizationEditForm(final CategoryRequestLocal category, SingleSelectionModel catLocale) { + super("EditCategoryLocalization", gz( "cms.ui.category.localization_edit"), category); - - // Speichere Locale ab - m_categoryLocalizationLocale = locale; - + + m_catLocale = catLocale; + addInitListener(new InitListener()); addProcessListener(new ProcessListener()); - + } /** @@ -69,45 +67,46 @@ private class InitListener implements FormInitListener { public final void init(final FormSectionEvent e) throws FormProcessException { - + final PageState state = e.getPageState(); final Category category = m_category.getCategory(state); + final String categoryLocalizationLocale = (String) m_catLocale.getSelectedKey(state); + // Hide Locale-Widget and lock it (read-only) - m_locale.addOption(new Option(m_categoryLocalizationLocale, - new Locale(m_categoryLocalizationLocale).getDisplayLanguage()), state); -// m_locale.setValue(state, m_categoryLocalizationLocale); + m_locale.addOption(new Option(categoryLocalizationLocale, + new Locale(categoryLocalizationLocale).getDisplayLanguage()), state); + m_locale.setValue(state, categoryLocalizationLocale); // m_locale.setVisible(state, false); m_locale.lock(); - - m_name.setValue(state, category.getName((String) m_locale.getValue(state))); - m_description.setValue(state, category.getDescription( - (String) m_locale.getValue(state))); - m_url.setValue(state, category.getURL((String) m_locale.getValue(state))); - if (category.isEnabled((String) m_locale.getValue(state))) { + m_name.setValue(state, category.getName(categoryLocalizationLocale)); + m_description.setValue(state, category.getDescription(categoryLocalizationLocale)); + m_url.setValue(state, category.getURL(categoryLocalizationLocale)); + + if (category.isEnabled(categoryLocalizationLocale)) { m_isEnabled.setValue(state, "yes"); } else { m_isEnabled.setValue(state, "no"); } } } - + /** * ##todo: document purpose of this */ private class ProcessListener implements FormProcessListener { public final void process(final FormSectionEvent e) throws FormProcessException { - + final PageState state = e.getPageState(); final Category category = m_category.getCategory(state); - + if (s_log.isDebugEnabled()) { s_log.debug("Editing localization for locale " + m_locale + " for category " + category); } - + if (category.canEdit()) { category.setName((String) m_name.getValue(state), (String) m_locale.getValue(state)); Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationTable.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationTable.java 2012-12-16 19:58:08 UTC (rev 2389) +++ trunk/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryLocalizationTable.java 2012-12-16 20:05:43 UTC (rev 2390) @@ -21,13 +21,11 @@ import com.arsdigita.bebop.Component; import com.arsdigita.bebop.ControlLink; import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.SingleSelectionModel; import com.arsdigita.bebop.Table; import com.arsdigita.bebop.event.TableActionEvent; import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.DefaultTableCellRenderer; import com.arsdigita.bebop.table.TableCellRenderer; import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.bebop.table.TableColumnModel; @@ -36,13 +34,7 @@ import com.arsdigita.categorization.Category; import com.arsdigita.categorization.CategoryLocalization; import com.arsdigita.categorization.CategoryLocalizationCollection; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.cms.util.GlobalizationUtil; -import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.util.LockableImpl; import java.math.BigDecimal; import java.util.Locale; @@ -61,22 +53,23 @@ private final SingleSelectionModel m_model; private final String TABLE_COL_LANG = "table_col_lang"; private final String TABLE_COL_DEL = "table_col_del"; + private final SingleSelectionModel m_catLocale; /** * Creates a new instance of CategoryLocalizationTable */ - public CategoryLocalizationTable(final CategoryRequestLocal category, - final SingleSelectionModel model) { + public CategoryLocalizationTable(final CategoryRequestLocal category, final SingleSelectionModel model, SingleSelectionModel catLocale) { super(); m_category = category; m_model = model; + m_catLocale = catLocale; // if table is empty: setEmptyView(new Label(GlobalizationUtil.globalize( "cms.ui.category.localization_none"))); -TableColumnModel tab_model = getColumnModel(); + TableColumnModel tab_model = getColumnModel(); // define columns // XXX globalize @@ -196,25 +189,15 @@ private class EditCellRenderer extends LockableImpl implements TableCellRenderer { public Component getComponent(Table table, PageState state, Object value, - boolean isSelected, Object key, + boolean isSelected, final Object key, int row, int column) { -// if (canEdit) { -// CategoryLocalization cl; - -// try { -// cl = new CategoryLocalization((BigDecimal) key); -// } catch (DataObjectNotFoundException ex) { -// return new Label(value.toString()); -// } - -// ContentSection section = CMS.getContext().getContentSection(); -// ItemResolver resolver = section.getItemResolver(); - -// return new Link(value.toString(), resolver.generateItemURL(state, cl, section, cl.getVersion())); - ControlLink link = new ControlLink(value.toString()); - return link; + if (m_category.getCategory(state).canEdit()) { + return new ControlLink(value.toString()); + } else { + return new Label(value.toString()); + } } } @@ -224,10 +207,14 @@ boolean isSelected, Object key, int row, int column) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) GlobalizationUtil.globalize( - "cms.ui.category.localization_confirm_delete").localize()); - return link; + if (m_category.getCategory(state).canDelete()) { + ControlLink link = new ControlLink(value.toString()); + link.setConfirmation((String) GlobalizationUtil.globalize( + "cms.ui.category.localization_confirm_delete").localize()); + return link; + } else { + return null; + } } } @@ -252,6 +239,7 @@ // Edit if (col.getHeaderKey().toString().equals(TABLE_COL_LANG)) { + m_catLocale.setSelectedKey(state, categoryLocalization.getLocale()); } // Delete Modified: trunk/ccm-core/src/com/arsdigita/categorization/Category.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/categorization/Category.java 2012-12-16 19:58:08 UTC (rev 2389) +++ trunk/ccm-core/src/com/arsdigita/categorization/Category.java 2012-12-16 20:05:43 UTC (rev 2390) @@ -59,25 +59,25 @@ * <p>This is a persistent class backed by the data object type whose name is * specified by {@link #BASE_DATA_OBJECT_TYPE}. The attribute names of of this * data object type are exposed via the public string fields such as {@link - * #CHILD}, {@link #DEFAULT_ANCESTORS}. See below.</p> + * #CHILD}, {@link #DEFAULT_ANCESTORS}. See below.</p> * * <p>This version of the class deprecates the notion of <em>category * purposes</em> and replaces it with the notion of <em>use contexts</em>. * The following methods should no longer be used:</p> * * <ul> - * <li>{@link #getPurposes()}</li> - * <li>{@link #addPurpose(CategoryPurpose)}</li> - * <li>{@link #removePurpose(CategoryPurpose)}</li> + * <li>{@link #getPurposes()}</li> + * <li>{@link #addPurpose(CategoryPurpose)}</li> + * <li>{@link #removePurpose(CategoryPurpose)}</li> * </ul> * * <p>The following methods should be used instead:</p> * * <ul> - * <li>{@link #getRootForObject(ACSObject, String)}</li> - * <li>{@link #setRootForObject(ACSObject, Category,String)}</li> - * <li>{@link #clearRootForObject(ACSObject, String)}</li> - * <li>{@link #getRootCategories(ACSObject)}</li> + * <li>{@link #getRootForObject(ACSObject, String)}</li> + * <li>{@link #setRootForObject(ACSObject, Category,String)}</li> + * <li>{@link #clearRootForObject(ACSObject, String)}</li> + * <li>{@link #getRootCategories(ACSObject)}</li> * </ul> * * @author Randy Graebner @@ -89,10 +89,10 @@ * environment. The following attributes are localizable: * * <ul> - * <li>Name</li> - * <li>Description</li> - * <li>URL</li> - * <li>IsEnabled</li> + * <li>Name</li> + * <li>Description</li> + * <li>URL</li> + * <li>IsEnabled</li> * </ul> * * To use localized URLs I had to change NavigationFileReolver.resolveCategory() @@ -106,21 +106,24 @@ private static final Logger s_log = Logger.getLogger(Category.class); /** * @see ObjectType - **/ + * + */ public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.categorization.Category"; + "com.arsdigita.categorization.Category"; private static final String BASE_DATA_OBJECT_PACKAGE = - "com.arsdigita.categorization"; + "com.arsdigita.categorization"; /** - * The <code>PrivilegeDescriptor corresponding</code> to the privilege to + * The + * <code>PrivilegeDescriptor corresponding</code> to the privilege to * map subcategories and objects to this category - **/ + * + */ public static final PrivilegeDescriptor MAP_DESCRIPTOR = - new PrivilegeDescriptor( + new PrivilegeDescriptor( "map_to_category"); // Quasimodo: Begin private static CategorizationConfig s_config = CategorizationConfig - .getConfig(); + .getConfig(); // Quasimodo: End public static final String ROOT_CATEGORY = "rootCategory"; public static final String USE_CONTEXT = "useContext"; @@ -128,38 +131,64 @@ public static final String ROOT_USE_CONTEXT = "rootUseContext"; public static final String OWNER_USE_CONTEXT = "ownerUseContext"; // category-category mapping types - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String CHILD = "child"; - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String PARENTS = "parents"; - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String RELATED = "related"; public static final String PREFERRED = "preferred"; - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String REL_TYPE = "relationType"; - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String SORT_KEY = "sortKey"; public static final String IS_DEFAULT = "isDefault"; public static final String IS_INDEX = "isIndex"; public static final String PARENT_CATEGORY = "parentCategory"; public static final String CATEGORY_ID = "categoryID"; // these are some constants to use in the code - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String NAME = "name"; - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String DESCRIPTION = "description"; - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String URL = "url"; - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String IS_ENABLED = "isEnabled"; - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String IS_ABSTRACT = "isAbstract"; - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String DEFAULT_ANCESTORS = "defaultAncestors"; - /** An attribute name for the underlying data object. */ + /** + * An attribute name for the underlying data object. + */ public static final String IGNORE_PARENT_INDEX_ITEM = - "ignoreParentIndexItem"; - /** An attribute name for the underlying data object. */ + "ignoreParentIndexItem"; + /** + * An attribute name for the underlying data object. + */ private static final String PURPOSES = "purposes"; // this contains association names from the pdl file public final static String CHILD_OBJECTS = "childObjects"; @@ -168,7 +197,7 @@ public static final String LOCALIZATIONS = "localizations"; // some named queries in the pdl files private static final String CHILD_CATEGORY_IDS = - "com.arsdigita.categorization.childCategoryIDs"; + "com.arsdigita.categorization.childCategoryIDs"; private static final String CURRENT_SORT_KEY = "currentSortKey"; private HierarchyDenormalization m_hierarchy; // Quasimodo: Begin @@ -183,7 +212,8 @@ /** * Returns the model name of {@link #BASE_DATA_OBJECT_TYPE}. - **/ + * + */ public static String getBaseDataObjectPackage() { return BASE_DATA_OBJECT_PACKAGE; } @@ -192,7 +222,8 @@ * Initializes the category with the specified data object. * * @param categoryObjectData the data object - **/ + * + */ public Category(DataObject categoryObjectData) { super(categoryObjectData); } @@ -202,7 +233,8 @@ * Category(Category.BSE_DATA_OBJECT_TYPE)}. * * @see com.arsdigita.domain.DomainObject#DomainObject(String) - **/ + * + */ public Category() { this(BASE_DATA_OBJECT_TYPE); } @@ -216,7 +248,8 @@ * @see com.arsdigita.domain.DomainObject#DomainObject(String) * @see com.arsdigita.persistence.DataObject * @see com.arsdigita.persistence.metadata.ObjectType - **/ + * + */ public Category(String typeName) { super(typeName); } @@ -229,7 +262,8 @@ * * @see com.arsdigita.domain.DomainObject#DomainObject(ObjectType) * @see com.arsdigita.persistence.DataObject - **/ + * + */ public Category(ObjectType type) { super(type); } @@ -239,19 +273,21 @@ * storage mechanism. * * @param oid the OID for the data object to retrieve + * * @throws DataObjectNotFoundException if this OID is invalid or has been - * deleted. + * deleted. * * @see com.arsdigita.domain.DomainObject#DomainObject(OID) * @see com.arsdigita.persistence.DataObject - **/ + * + */ public Category(OID oid) { super(oid); } /** * Retrieves the data object with the specified ID from the persistence - * storage mechanism. This method is just a wrapper for the {@link + * storage mechanism. This method is just a wrapper for the {@link * #Category(OID)} constructor. * * @throws DataObjectNotFoundException @@ -263,7 +299,7 @@ /** * Creates a new category with the given name and description. * - * @param name the name for the new category + * @param name the name for the new category * @param description the description for the new category */ public Category(String name, String description) { @@ -276,9 +312,9 @@ * Creates a new category with the given name, description and URL * component. * - * @param name the name for the new category + * @param name the name for the new category * @param description the description for the new category - * @param url URL component used when browsing categories. + * @param url URL component used when browsing categories. */ public Category(String name, String description, String url) { this(); @@ -289,14 +325,15 @@ /** * Retrieves the category with the given category ID, and sets the name and - * description. For the new name and descrption to be permanent, the caller + * description. For the new name and descrption to be permanent, the caller * must call the save() method. * - * @param categoryID the category ID - * @param name the category name + * @param categoryID the category ID + * @param name the category name * @param description the category description + * * @exception DataObjectNotFoundException if this OID is - * invalid or has been deleted. + * invalid or has been deleted. * * @see com.arsdigita.domain.DomainObject#DomainObject(OID) */ @@ -308,15 +345,16 @@ /** * Retrieves the category with the given category ID, and sets the name and - * description. For the new name and descrption to be permanent, the caller + * description. For the new name and descrption to be permanent, the caller * must call the save() method. * - * @param categoryID the category ID - * @param name the category name + * @param categoryID the category ID + * @param name the category name * @param description the category description - * @param url URL component used when browsing categories. + * @param url URL component used when browsing categories. + * * @exception DataObjectNotFoundException if this OID is - * invalid or has been deleted. + * invalid or has been deleted. * * @see com.arsdigita.domain.DomainObject#DomainObject(OID) */ @@ -359,7 +397,7 @@ m_hierarchy = new HierarchyDenormalization( "com.arsdigita.categorization.updateCategoryDescendants", this, - DEFAULT_ANCESTORS) { + DEFAULT_ANCESTORS) { }; m_categoryLocalizationCollection = new CategoryLocalizationCollection( @@ -370,14 +408,15 @@ /** * Quasimodo: - * Returns the localized name or the name key if localized version don't exist + * Returns the localized name or the name key if localized version don't + * exist * * @return the category name. */ public String getName(String locale) { // Test for localized version - if (!locale.isEmpty() && m_categoryLocalizationCollection != null && m_categoryLocalizationCollection. + if (locale != null && !locale.isEmpty() && m_categoryLocalizationCollection != null && m_categoryLocalizationCollection. localizationExists(locale)) { // Return value of isEnabled from localized version, so categories could be disabled depending on locale @@ -402,8 +441,9 @@ } /** - * Returns the display name of the category. This overrides the parent + * Returns the display name of the category. This overrides the parent * implementation. + * * @return the category name. */ public String getDisplayName(String locale) { @@ -411,8 +451,9 @@ } /** - * Returns the display name of the category. This overrides the parent + * Returns the display name of the category. This overrides the parent * implementation. + * * @return the category name. */ @Override @@ -421,7 +462,7 @@ } /** - * Returns the name of the category along with its default ancestors. + * Returns the name of the category along with its default ancestors. * * <p>For example, when called on the <em>Televised Events</em> category in * <href="package-summary.html#taxonomy">this example</a>, the return value @@ -429,16 +470,16 @@ * Events". </p> * * @see #getDefaultAscendants() - * @param delimiter The string to use to seperate the parents from the - * children. For example, to obtain the above-mentioned result, you need to - * pass in <code>" >> "</code> as the delimiter. + * @param delimiter The string to use to seperate the parents from the + * children. For example, to obtain the above-mentioned result, you need to + * pass in <code>" >> "</code> as the delimiter. * * @param includeRoot This indicates whether or not the root category should - * be included in the name. + * be included in the name. * - * @return the qualified name as explained above. May return - * <code>null</code> this is the root category, and <code>includeRoot</code> - * is false. + * @return the qualified name as explained above. May return + * <code>null</code> this is the root category, and <code>includeRoot</code> + * is false. */ public String getQualifiedName(String delimiter, boolean includeRoot) { // If the collection only contains the root and the root is not desired @@ -464,16 +505,19 @@ } /** - * Returns the name of the <b>preferred</b> category along with its default ancestors. - * Equivalent to #getQualifiedName(String,boolean) if this Category is not a synonym. + * Returns the name of the <b>preferred</b> category along with its default + * ancestors. + * Equivalent to #getQualifiedName(String,boolean) if this Category is not a + * synonym. * Synonym name is appended in parentheses. * - * @param delimiter string to separate category names + * @param delimiter string to separate category names * @param includeRoot should root category be shown + * * @return category path */ public String getPreferredQualifiedName(String delimiter, - boolean includeRoot) { + boolean includeRoot) { // is this a synonym? CategoryCollection cc = new CategoryCollection(getRelatedCategories( PREFERRED)); @@ -481,7 +525,7 @@ Category preferred = cc.getCategory(); cc.close(); String preferredPath = preferred.getQualifiedName(delimiter, - includeRoot); + includeRoot); return preferredPath + " (" + getName() + ")"; } else { return getQualifiedName(delimiter, includeRoot); @@ -493,11 +537,11 @@ * * @see #getDefaultAscendants() * - * @param delimiter The string to use to seperate the parents from - * the children. - + * @param delimiter The string to use to seperate the parents from + * the children. + * * @param includeRoot This indicates whether or not the root category should - * be included in the URL. + * be included in the URL. */ public String getQualifiedURL(String delimiter, boolean includeRoot) { // If the collection only contains the root and the root is not desired @@ -549,7 +593,8 @@ * Returns the description of the category. * * Quasimodo: - * Returns localized version of description or description key if localized version don't exist + * Returns localized version of description or description key if localized + * version don't exist * * @return the category description. */ @@ -557,7 +602,7 @@ // Test for localized version // HACK - if (!locale.isEmpty() && m_categoryLocalizationCollection != null && m_categoryLocalizationCollection. + if (locale != null && !locale.isEmpty() && m_categoryLocalizationCollection != null && m_categoryLocalizationCollection. localizationExists(locale)) { // Return value of isEnabled from localized version, so categories could be disabled depending on locale @@ -576,6 +621,7 @@ /** * Returns the description of the category. + * * @return the category name. */ public String getDescription() { @@ -587,7 +633,9 @@ * Returns a string repesenting the default ancestors of the category * * It can be useful and more efficient then working with the - * CategoryCollection returned by @see getDefaultAscendants() when comparing + * CategoryCollection returned by + * + * @see getDefaultAscendants() when comparing * ids whose position in the path is known. * (Added by Chris Gilbert) */ @@ -623,18 +671,19 @@ * Returns the URL component of the category. * * Quasimodo: - * Returns the localized version of the URL or URL-key if localized version don't exist + * Returns the localized version of the URL or URL-key if localized version + * don't exist * * @return URL component used when browsing categories */ public String getURL(String locale) { // Test for localized version - if (!locale.isEmpty() && m_categoryLocalizationCollection != null && m_categoryLocalizationCollection. + if (locale != null && !locale.isEmpty() && m_categoryLocalizationCollection != null && m_categoryLocalizationCollection. localizationExists(locale)) { // Return value of isEnabled from localized version, so categories could be disabled depending on locale - String url = m_categoryLocalizationCollection.getURL(); + String url = m_categoryLocalizationCollection.getURL(); //return m_categoryLocalizationCollection.getURL(); m_categoryLocalizationCollection.rewind(); return url; @@ -684,41 +733,36 @@ * Determines the current state of the category. * * @return <code>true</code> if the category is enabled; <code>false</code> - * otherwise. + * otherwise. * * Quasimodo: * This is getting a bit more compliated: * 1. Check if category is globally disabled * 2. If not, check if localized version exists - * 2.1 If so, return isEnabled from localized version - * 2.2 If not, return Category.getConfig().getShowInternalName() + * 2.1 If so, return isEnabled from localized version + * 2.2 If not, return Category.getConfig().getShowInternalName() * */ public boolean isEnabled(String locale) { - // If locale is empty return global status - // or if globally disabled, return category as disabled - if (locale.isEmpty() || ((Boolean) get(IS_ENABLED)).booleanValue() == false) { - return ((Boolean) get(IS_ENABLED)).booleanValue(); + // If globally disabled, return category as disabled + if (((Boolean) get(IS_ENABLED)).booleanValue() == false) { + return false; } // Test for localized version - // HACK - if (!locale.isEmpty() && m_categoryLocalizationCollection != null && m_categoryLocalizationCollection. + if (locale != null && !locale.isEmpty() && m_categoryLocalizationCollection != null && m_categoryLocalizationCollection. localizationExists(locale)) { // Return value of isEnabled from localized version, so categories could be disabled depending on locale boolean isEnabled = m_categoryLocalizationCollection.isEnabled(); m_categoryLocalizationCollection.rewind(); return isEnabled; - //return m_categoryLocalizationCollection.isEnabled(); } else { - // Return value of Category.getConfig().getShowInternalName() - // This will disable all categories without selected locale, if Category.getConfig().getShowInternalName() == false - return Category.getConfig().getShowInternalName(); - + // In any other case return global status + return ((Boolean) get(IS_ENABLED)).booleanValue(); } } @@ -727,7 +771,7 @@ * Determines the current state of the category. * * @return <code>true</code> if the category is enabled; <code>false</code> - * otherwise. + * otherwise. */ public boolean isEnabled() { return isEnabled(GlobalizationHelper.getNegotiatedLocale().getLanguage()); @@ -737,7 +781,7 @@ * Sets whether the category is enabled. * * @param isEnabled <code>true</code> if the category is enabled; - * <code>false</false> otherwise. + * <code>false</false> otherwise. */ public void setEnabled(boolean isEnabled, String locale) { @@ -753,7 +797,7 @@ * Sets whether the category is enabled. * * @param isEnabled <code>true</code> if the category is enabled; - * <code>false</false> otherwise. + * <code>false</false> otherwise. */ public void setEnabled(boolean isEnabled) { set(IS_ENABLED, isEnabled); @@ -764,7 +808,7 @@ * categories. * * @return <code>true</code> if the category is abstract; <code>false</code> - * otherwise. + * otherwise. */ public boolean isAbstract() { return ((Boolean) get(IS_ABSTRACT)).booleanValue(); @@ -783,8 +827,9 @@ * Determine whether this category should have a default index item * associated with it (i.e.it's parent category). * - * @return <code>true</code> if the parent index item should be ignored (no default index item) - * <code>false</code> otherwise. + * @return <code>true</code> if the parent index item should be ignored (no + * default index item) + * <code>false</code> otherwise. */ public boolean ignoreParentIndexItem() { return ((Boolean) get(IGNORE_PARENT_INDEX_ITEM)).booleanValue(); @@ -794,8 +839,9 @@ * Set whether this category should have a default index item * associated with it (i.e.it's parent category). * - * @param ignoreParentIndexItem <code>true</code> if the parent index item should be ignored (no default index item) - * <code>false</code> otherwise + * @param ignoreParentIndexItem <code>true</code> if the parent index item + * should be ignored (no default index item) + * <code>false</code> otherwise */ public void setIgnoreParentIndexItem(boolean ignoreParentIndexItem) { set(IGNORE_PARENT_INDEX_ITEM, ignoreParentIndexItem); @@ -803,7 +849,8 @@ /** * @deprecated use the "use context" APIs instead - **/ + * + */ public Collection getPurposes() { DataAssociationCursor purposeCur = ((DataAssociation) get(PURPOSES)). cursor(); @@ -817,21 +864,25 @@ } /** - * Adds the specified purpose to this category. + * Adds the specified purpose to this category. * * @param purpose The purpose + * * @deprecated use the "use context" APIs instead - **/ + * + */ public void addPurpose(CategoryPurpose purpose) { add(PURPOSES, purpose); } /** - * Removes the specified purpose from this category. + * Removes the specified purpose from this category. * * @param purpose the purpose + * * @deprecated use the "use context" APIs instead - **/ + * + */ public void removePurpose(CategoryPurpose purpose) { remove(PURPOSES, purpose); } @@ -871,7 +922,7 @@ * Determines whether the passed in object is a category. * * @return <code>true</code> if the passed in object is a category; - * <code>false</code> otherwise. + * <code>false</code> otherwise. * * @param object the object to test */ @@ -882,13 +933,13 @@ /** * Cleans up all the mappings where this category is a child, and then - * deletes the category. This method should generally not be used. Use + * deletes the category. This method should generally not be used. Use * {@link #deleteCategoryAndRemap()}, {@link #deleteCategoryAndOrphan()}, or * {@link #deleteCategorySubtree()} instead. * * @throws CategorizationException if the category has child objects or - * subcategories mapped to it. If the object has children, the programmer - * must call {@link #deleteCategoryAndOrphan()}, {@link + * subcategories mapped to it. If the object has children, the programmer + * must call {@link #deleteCategoryAndOrphan()}, {@link * #deleteCategorySubtree()}, or {@link #deleteCategoryAndRemap()}. */ @Override @@ -899,8 +950,8 @@ try { if (children.next()) { throw new CategorizationException("This category is the default parent of another category." - + " You must explicitly delete the child categories first. " - + "Child category: " + children. + + " You must explicitly delete the child categories first. " + + "Child category: " + children. getDataObject()); } } finally { @@ -908,13 +959,13 @@ } DataAssociationCursor objects = - ((DataAssociation) get(CHILD_OBJECTS)).cursor(); + ((DataAssociation) get(CHILD_OBJECTS)).cursor(); if (objects != null) { try { if (objects.next()) { throw new CategorizationException("This category has child objects. You must delete " - + " any such objects explicitly, before deleting the " - + " category. Child object: " + objects. + + " any such objects explicitly, before deleting the " + + " category. Child object: " + objects. getDataObject()); } } finally { @@ -941,13 +992,14 @@ * * <p>If the category to be deleted is not the default parent of the child * category, this method deletes the mapping but it does not delete that - * section of the subtree (similar to the way a UNIX <code>rm -r</code> + * section of the subtree (similar to the way a UNIX + * <code>rm -r</code> * works on symbolic links). */ public void deleteCategorySubtree() { // we get the association between this category and its children DataAssociationCursor cursor = - ((DataAssociation) get(RELATED_CATEGORIES)).cursor(); + ((DataAssociation) get(RELATED_CATEGORIES)).cursor(); while (cursor.next()) { DataObject link = cursor.getLink(); @@ -962,9 +1014,9 @@ } /** - * Deletes the passed in category after remapping all the children. Adds a + * Deletes the passed in category after remapping all the children. Adds a * mapping from the children to the default parent of the passed in category - * if the mapping does not already exist. If the category that is the + * if the mapping does not already exist. If the category that is the * parent of the to-be-deleted category is abstract then any objects that * are children of that object are not remapped to anywhere */ @@ -986,7 +1038,7 @@ } DataAssociationCursor cursor = - ((DataAssociation) get(RELATED_CATEGORIES)).cursor(); + ((DataAssociation) get(RELATED_CATEGORIES)).cursor(); while (cursor.next()) { DataObject link = cursor.getLink(); @@ -1021,7 +1073,7 @@ /** * Deletes the passed in category. Does not remap any of the children - * categories or objects. Instead, it just deletes all records of the + * categories or objects. Instead, it just deletes all records of the * mappings. */ public void deleteCategoryAndOrphan() { @@ -1047,7 +1099,7 @@ * for creating subcategories with this category instance as the parent.</p> * * <p>It is important to note that a category cannot be a CHILD and a - * RELATED category at the same time. If the category is RELATED and you + * RELATED category at the same time. If the category is RELATED and you * call addChild, the category is removed from the group of RELATED * categories and becomes a CHILD category.</p> * @@ -1055,7 +1107,8 @@ * * @pre !isAbstract() * @pre canMap() - **/ + * + */ public void addChild(ACSObject object) { addMapping(object, "child"); } @@ -1070,21 +1123,24 @@ * mappings.</p> * * <p>It is important to note that a category cannot be a CHILD and a - * RELATED category at the same time. If the category is RELATED and you + * RELATED category at the same time. If the category is RELATED and you * call addChild, the category is removed from the group of RELATED * categories and becomes a CHILD category.</p> * * @param category The related category + * * @pre canMap() * - **/ + * + */ public void addRelatedCategory(Category category) { addMapping(category, RELATED); } /** * Add a preferred category, which marks the current category as a synonym. - * When a synonym category is selected, preferred category should be used instead + * When a synonym category is selected, preferred category should be used + * instead * i.e. assigned to the item. */ public void addPreferredCategory(Category preferred) { @@ -1102,12 +1158,12 @@ return; } Assert.isFalse(isAbstract(), - "You cannot categorize an object " - + "within an abstract category. If you are " - + "seeing this message then your UI is " - + "allowing you to do something that you " - + "are not allowed to do and you " - + "should email your site administrator."); + "You cannot categorize an object " + + "within an abstract category. If you are " + + "seeing this message then your UI is " + + "allowing you to do something that you " + + "are not allowed to do and you " + + "should email your site administrator."); if (RELATED.equals(relationType)) { throw new CategorizationException( @@ -1116,7 +1172,7 @@ } DataAssociationCursor cursor = - ((DataAssociation) get(CHILD_OBJECTS)).cursor(); + ((DataAssociation) get(CHILD_OBJECTS)).cursor(); cursor.addEqualsFilter(ID, acsObj.getID()); if (cursor.size() == 0) { // if the cursor.size() > 0 then the object is already @@ -1125,12 +1181,12 @@ Categorization.triggerMapEvent(this, acsObj); if (s_log.isDebugEnabled()) { s_log.debug(acsObj + " added to " + CHILD_OBJECTS + " of catID=" - + getID() + " type=" + relationType + " (ignored)"); + + getID() + " type=" + relationType + " (ignored)"); } } else { if (s_log.isDebugEnabled()) { s_log.debug(acsObj + " is already related to catID=" + getID() - + " type=" + relationType + " (ignored)"); + + " type=" + relationType + " (ignored)"); } } } @@ -1139,8 +1195,8 @@ // Let's check for loops. if ("child".equals(relationType) && category.isMemberOfSubtree(this)) { throw new CategorizationException("The object that you are " - + "trying to add as a child is already " - + "a member of the subtree."); + + "trying to add as a child is already " + + "a member of the subtree."); } @@ -1148,7 +1204,7 @@ // Otherwise, we add and then update. DataAssociationCursor cursor = - ((DataAssociation) get(RELATED_CATEGORIES)).cursor(); + ((DataAssociation) get(RELATED_CATEGORIES)).cursor(); cursor.addEqualsFilter(ID, category.getID()); DataObject link; if (cursor.next()) { @@ -1167,7 +1223,7 @@ cursor.close(); if (s_log.isDebugEnabled()) { s_log.debug("updating related catID=" + category.getID() + " type=" - + relationType + " default=false"); + + relationType + " default=false"); } link.set(REL_TYPE, relationType); @@ -1176,12 +1232,14 @@ /** * Removes a category mapping from the domain object so that an ACS object - * is no longer a child of a category. This actually deletes the mapping. + * is no longer a child of a category. This actually deletes the mapping. * * @param acsObj the domain object to uncategorize + * * @pre canMap() * @throws NullPointerException if <code>acsObj</code> is null - **/ + * + */ public void removeChild(ACSObject acsObj) { if (acsObj == null) { throw new NullPointerException("acsObj"); @@ -1198,7 +1256,8 @@ * Removes the specified child category. * * @throws NullPointerException if category is null - **/ + * + */ public void removeChild(Category category) { Assert.exists(category, Category.class); @@ -1215,7 +1274,7 @@ } /** - * This takes a category and removes its relation to this category. If the + * This takes a category and removes its relation to this category. If the * passed in category is also a child then it is still a child after this * call. * @@ -1296,7 +1355,7 @@ * objects or child categories). * * @return <code>true</code> if the category is a leaf; <code>false</code> - * otherwise. + * otherwise. */ public boolean isLeaf() { return !hasChildCategories() && !hasChildObjects(); @@ -1305,8 +1364,9 @@ /** * Determines whether the category has child objects. * - * @return <code>true</code> if the category does not have any child objects; - * <code>false</code> otherwise. + * @return <code>true</code> if the category does not have any child + * objects; + * <code>false</code> otherwise. */ public boolean hasChildObjects() { return (getNumberOfChildObjects() != 0); @@ -1316,7 +1376,7 @@ * Determines whether the category has any child categories. * * @return <code>true</code> if the category does not have any child - * categories; <code>false</code> otherwise. + * categories; <code>false</code> otherwise. */ public boolean hasChildCategories() { return (getNumberOfChildCategories() != 0); @@ -1326,21 +1386,21 @@ * Determines whether the category is a root. * * @return <code>true</code> if the category does not have - * any parents; <code>false</code> otherwise. + * any parents; <code>false</code> otherwise. */ public boolean isRoot() { return (getParentCategoryCount() == 0); } /** - * Returns the number of parent categories for this category. + * Returns the number of parent categories for this category. * - * @return the number of times has this category has been - * mapped to a new category. + * @return the number of times has this category has been + * mapped to a new category. */ public long getParentCategoryCount() { DataAssociationCursor cursor = - ((DataAssociation) get(PARENTS)).cursor(); + ((DataAssociation) get(PARENTS)).cursor(); try { return cursor.size(); } finally { @@ -1349,21 +1409,22 @@ } /** - * Sets this category's default parent category to the one that is passed - * in. + * Sets this category's default parent category to the one that is passed + * in. * - * <p><b>This clears the previous default mapping.</b> The results will be - * saved for the user when the transaction is committed. </p> + * <p><b>This clears the previous default mapping.</b> The results will be + * saved for the... [truncated message content] |