|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.drools.repository.Item org.drools.repository.VersionableItem
public abstract class VersionableItem
This is the parent class for versionable assets. Contains standard fields based on Dublin Core, and stuff required for versioning. For dublin core, refer to Here
for more attributes to do with BRMS resources.
Field Summary | |
---|---|
static String |
CATEGORY_PROPERTY_NAME
The name of the tag property on the rule node type |
static String |
CHECKIN_COMMENT
|
static String |
CONTENT_PROPERTY_ARCHIVE_FLAG
|
static String |
COVERAGE_PROPERTY_NAME
|
static String |
CREATOR_PROPERTY_NAME
|
static String |
DEFAULT_CONTENT_FORMAT
The possible formats for the format property of the node |
static String |
DESCRIPTION_PROPERTY_NAME
|
static String |
FORMAT_PROPERTY_NAME
|
static String |
LAST_CONTRIBUTOR_PROPERTY_NAME
Dublin core based fields. |
static String |
LAST_MODIFIED_PROPERTY_NAME
|
static String |
PUBLISHER_PROPERTY_NAME
|
static String |
RELATION_PROPERTY_NAME
|
static String |
RIGHTS_PROPERTY_NAME
|
static String |
SOURCE_PROPERTY_NAME
|
static String |
STATE_PROPERTY_NAME
The name of the state property on the rule node type |
static String |
SUBJECT_PROPERTY_NAME
|
static String |
TITLE_PROPERTY_NAME
Property names for this node type. |
static String |
TYPE_PROPERTY_NAME
|
static String |
VERSION_NUMBER_PROPERTY_NAME
|
Fields inherited from class org.drools.repository.Item |
---|
node, rulesRepository |
Constructor Summary | |
---|---|
VersionableItem(RulesRepository rulesRepository,
javax.jcr.Node node)
Sets this object's node attribute to the specified node |
Method Summary | |
---|---|
VersionableItem |
archiveItem(boolean data)
|
void |
checkin(String comment)
This will save the content (if it hasn't been already) and then check it in to create a new version. |
protected void |
checkIsUpdateable()
This will check to see if the node is the "head" and so can be updated (you can't update historical nodes ). |
void |
checkout()
This will check out the node prior to editing. |
String |
getCheckinComment()
This will return the checkin comment for the latest revision. |
String |
getCoverage()
Typically, Coverage will include spatial location (a place name or geographic coordinates), temporal period (a period label, date, or date range) or jurisdiction (such as a named administrative entity). |
Calendar |
getCreatedDate()
This returns the date/time on which the asset was "ORIGINALLY CREATED". |
String |
getCreator()
This is the person who initially created the resource. |
String |
getDescription()
See the Dublin Core documentation for more explanation: http://dublincore.org/documents/dces/ |
String |
getExternalRelation()
A reference to a EXTERNAL related resource. |
String |
getExternalSource()
This is the source of the asset/rule. |
String |
getFormat()
This returns the format of an item. |
String |
getLastContributor()
Returns the last contributors name. |
Calendar |
getLastModified()
|
protected long |
getLongProperty(String property)
|
String |
getName()
Need to get the name from the content node, not the version node if it is in fact a version ! |
abstract VersionableItem |
getPrecedingVersion()
Clients of this method can cast the resulting object to the type of object they are calling the method on (e.g. |
protected javax.jcr.Node |
getPrecedingVersionNode()
|
String |
getPublisher()
Examples of Publisher include a person, an organization, or a service. |
protected javax.jcr.Node |
getRealContentFromVersion(javax.jcr.Node node)
This deals with a node which *may* be a version, if it is, it grabs the frozen copy. |
String |
getRights()
Optionally contains any copyright/ownership rights for the asset. |
StateItem |
getState()
Gets StateItem object corresponding to the state property of this object's node |
String |
getStateDescription()
This will return the current state item as a displayable thing. |
protected String |
getStringProperty(String property)
|
String |
getSubject()
Typically, Subject will be expressed as keywords, key phrases or classification codes that describe a topic of the resource. |
abstract VersionableItem |
getSucceedingVersion()
Clients of this method can cast the resulting object to the type of object they are calling the method on (e.g. |
protected javax.jcr.Node |
getSucceedingVersionNode()
|
String |
getTitle()
Gets the Title of the versionable node. |
String |
getType()
This is the Dublin Core field of type (a broad classification of resource type). |
String |
getUUID()
|
javax.jcr.Node |
getVersionContentNode()
When retrieving content, if we are dealing with a version in the history, we need to get the actual content node to retrieve values. |
long |
getVersionNumber()
get this version number (default is incrementing integer, but you can provide an implementation of VersionNumberGenerator if needed). |
String |
getVersionSnapshotUUID()
This returns the id of the exact version node (as opposed to the "main" node). |
boolean |
isArchived()
Test if the VersionableItem is archived |
boolean |
isHistoricalVersion()
This will return true if the current entity is actually a historical version (which means is effectively read only). |
boolean |
sameState(StateItem other)
Compare this rules state with some other state |
void |
updateCoverage(String cov)
|
void |
updateDescription(String newDescriptionContent)
Creates a new version of this object's node, updating the description content for the node. |
void |
updateExternalRelation(String rel)
|
void |
updateExternalSource(String source)
|
void |
updateFormat(String newFormat)
This sets the format (or "file extension" of the resource). |
void |
updatePublisher(String pub)
|
void |
updateRights(String rights)
|
void |
updateState(StateItem stateItem)
Sets this object's rule node's state property to refer to the specified StateItem's node |
void |
updateState(String stateName)
Sets this object's rule node's state property to refer to the specified state node |
protected void |
updateStringProperty(String value,
String prop)
update a text field. |
void |
updateSubject(String sub)
|
void |
updateTitle(String title)
Creates a new version of this object's node, updating the title content for the node. |
void |
updateType(String type)
|
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 |
Field Detail |
---|
public static final String TITLE_PROPERTY_NAME
public static final String DESCRIPTION_PROPERTY_NAME
public static final String LAST_MODIFIED_PROPERTY_NAME
public static final String FORMAT_PROPERTY_NAME
public static final String CHECKIN_COMMENT
public static final String VERSION_NUMBER_PROPERTY_NAME
public static final String CONTENT_PROPERTY_ARCHIVE_FLAG
public static final String LAST_CONTRIBUTOR_PROPERTY_NAME
public static final String CREATOR_PROPERTY_NAME
public static final String TYPE_PROPERTY_NAME
public static final String SOURCE_PROPERTY_NAME
public static final String SUBJECT_PROPERTY_NAME
public static final String RELATION_PROPERTY_NAME
public static final String RIGHTS_PROPERTY_NAME
public static final String COVERAGE_PROPERTY_NAME
public static final String PUBLISHER_PROPERTY_NAME
public static final String STATE_PROPERTY_NAME
public static final String CATEGORY_PROPERTY_NAME
public static final String DEFAULT_CONTENT_FORMAT
Constructor Detail |
---|
public VersionableItem(RulesRepository rulesRepository, javax.jcr.Node node)
rulesRepository
- the RulesRepository object that this object is being created fromnode
- the node in the repository that this item corresponds toMethod Detail |
---|
public String getUUID()
public boolean isHistoricalVersion() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected javax.jcr.Node getPrecedingVersionNode() throws RulesRepositoryException
RulesRepositoryException
protected javax.jcr.Node getSucceedingVersionNode() throws RulesRepositoryException
RulesRepositoryException
public abstract VersionableItem getPrecedingVersion() throws RulesRepositoryException
RuleItem item; ... RuleItem predcessor = (RuleItem) item.getPrecedingVersion();
RulesRepositoryException
public abstract VersionableItem getSucceedingVersion() throws RulesRepositoryException
RuleItem item; ... RuleItem successor = (RuleItem) item.getSucceedingVersion();
RulesRepositoryException
public String getTitle() throws RulesRepositoryException
RulesRepositoryException
public void updateTitle(String title) throws RulesRepositoryException
title
- the new title for the node
RulesRepositoryException
public void updateType(String type)
public void updateExternalSource(String source)
public void updateSubject(String sub)
public void updateExternalRelation(String rel)
public void updateRights(String rights)
public void updateCoverage(String cov)
public void updatePublisher(String pub)
protected void updateStringProperty(String value, String prop)
public String getDescription() throws RulesRepositoryException
RulesRepositoryException
public long getVersionNumber()
public String getCheckinComment() throws RulesRepositoryException
RulesRepositoryException
public Calendar getLastModified() throws RulesRepositoryException
RulesRepositoryException
public void updateDescription(String newDescriptionContent) throws RulesRepositoryException
newDescriptionContent
- the new description content for the rule
RulesRepositoryException
public String getFormat() throws RulesRepositoryException
RulesRepositoryException
public void updateFormat(String newFormat)
newFormat
- public javax.jcr.Node getVersionContentNode() throws javax.jcr.RepositoryException, javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
javax.jcr.PathNotFoundException
protected javax.jcr.Node getRealContentFromVersion(javax.jcr.Node node) throws javax.jcr.RepositoryException, javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
javax.jcr.PathNotFoundException
public String getName()
public void checkout()
public void checkin(String comment)
protected void checkIsUpdateable()
RulesRepositoryException
- if it is not allowed
(means a programming error !).public void updateState(String stateName) throws RulesRepositoryException
stateName
- the name of the state to set the rule node to
RulesRepositoryException
public void updateState(StateItem stateItem) throws RulesRepositoryException
stateItem
- the StateItem encapsulating the node to refer to from this object's node's state
property
RulesRepositoryException
public StateItem getState() throws RulesRepositoryException
RulesRepositoryException
public String getStateDescription()
public boolean sameState(StateItem other)
public String getLastContributor()
public String getCreator()
public String getType()
public String getExternalSource()
public String getSubject()
public String getExternalRelation()
public String getRights()
public String getCoverage()
public String getPublisher()
public Calendar getCreatedDate()
protected String getStringProperty(String property)
protected long getLongProperty(String property)
public String getVersionSnapshotUUID()
public VersionableItem archiveItem(boolean data)
public boolean isArchived()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |