org.drools.repository
Class CategorisableItem

java.lang.Object
  extended by org.drools.repository.Item
      extended by org.drools.repository.VersionableItem
          extended by org.drools.repository.CategorisableItem
Direct Known Subclasses:
AssetItem

public abstract class CategorisableItem
extends VersionableItem

This contains logic for categorisable items (not all versionably items are categorisable).


Field Summary
 
Fields inherited from class org.drools.repository.VersionableItem
CATEGORY_PROPERTY_NAME, CHECKIN_COMMENT, CONTENT_PROPERTY_ARCHIVE_FLAG, COVERAGE_PROPERTY_NAME, CREATOR_PROPERTY_NAME, DEFAULT_CONTENT_FORMAT, DESCRIPTION_PROPERTY_NAME, FORMAT_PROPERTY_NAME, LAST_CONTRIBUTOR_PROPERTY_NAME, LAST_MODIFIED_PROPERTY_NAME, PUBLISHER_PROPERTY_NAME, RELATION_PROPERTY_NAME, RIGHTS_PROPERTY_NAME, SOURCE_PROPERTY_NAME, STATE_PROPERTY_NAME, SUBJECT_PROPERTY_NAME, TITLE_PROPERTY_NAME, TYPE_PROPERTY_NAME, VALID_PROPERTY_NAME, VERSION_NUMBER_PROPERTY_NAME
 
Fields inherited from class org.drools.repository.Item
node, rulesRepository
 
Constructor Summary
CategorisableItem(RulesRepository rulesRepository, javax.jcr.Node node)
           
 
Method Summary
 void addCategory(String tag)
          Adds the specified tag to this object's node.
 List<CategoryItem> getCategories()
          Gets a list of CategoryItem objects for this assets node.
 String getCategorySummary()
          This will show a summary list of categories.
static void removeCategory(javax.jcr.Node targetNode, String tag)
          Removes the specified tag from this asset node.
 void removeCategory(String tag)
          Removes the specified tag from this asset node.
 void updateCategoryList(String[] categories)
          This method sets the categories in one hit, making the ASSUMPTION that the categories were previously set up !
 
Methods inherited from class org.drools.repository.VersionableItem
archiveItem, checkin, checkIsUpdateable, checkout, checkout, getBooleanProperty, getCheckinComment, getCoverage, getCreatedDate, getCreator, getDescription, getExternalRelation, getExternalSource, getFormat, getHistory, getLastContributor, getLastModified, getLongProperty, getName, getPrecedingVersion, getPrecedingVersionNode, getPublisher, getRealContentFromVersion, getRights, getState, getStateDescription, getStringProperty, getStringPropertyArray, getSubject, getSucceedingVersion, getSucceedingVersionNode, getTitle, getType, getUUID, getValid, getVersionContentNode, getVersionManager, getVersionNumber, getVersionSnapshotUUID, isArchived, isHistoricalVersion, sameState, updateCoverage, updateDescription, updateExternalRelation, updateExternalSource, updateFormat, updatePublisher, updateRights, updateState, updateState, updateStringArrayProperty, updateStringProperty, updateStringProperty, updateSubject, updateTitle, updateType, updateValid, updateValid
 
Methods inherited from class org.drools.repository.Item
equals, getNode, getRulesRepository, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CategorisableItem

public CategorisableItem(RulesRepository rulesRepository,
                         javax.jcr.Node node)
Method Detail

addCategory

public void addCategory(String tag)
                 throws RulesRepositoryException
Adds the specified tag to this object's node. Tags are stored as nodes in a tag area of the repository. If the specified tag does not already have a corresponding node, a node is created for it. Please note that this is mainly intended for assets, not modules (packages) (although it could be used).

Parameters:
tag - the tag to add to the asset. assets can have multiple tags
Throws:
RulesRepositoryException

updateCategoryList

public void updateCategoryList(String[] categories)
This method sets the categories in one hit, making the ASSUMPTION that the categories were previously set up ! (via CategoryItem of course !).


getCategories

public List<CategoryItem> getCategories()
                                 throws RulesRepositoryException
Gets a list of CategoryItem objects for this assets node.

Returns:
a list of TagItem objects for each tag on the asset. If there are no tags, an empty list.
Throws:
RulesRepositoryException

getCategorySummary

public String getCategorySummary()
This will show a summary list of categories.


removeCategory

public void removeCategory(String tag)
                    throws RulesRepositoryException
Removes the specified tag from this asset node.

Parameters:
tag - the tag to remove from the asset
Throws:
RulesRepositoryException

removeCategory

public static void removeCategory(javax.jcr.Node targetNode,
                                  String tag)
                           throws RulesRepositoryException
Removes the specified tag from this asset node.

Parameters:
targetNode - the node from which the tag is to be removed.
tag - the tag to remove from the asset
Throws:
RulesRepositoryException


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.