|
||||||||||
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 org.drools.repository.CategorisableItem org.drools.repository.AssetItem
public class AssetItem
The RuleItem class is used to abstract away the details of the underlying JCR repository. It is used to pass information about rules stored in the repository.
Field Summary | |
---|---|
static String |
CONTENT_PROPERTY_ATTACHMENT_FILENAME
|
static String |
CONTENT_PROPERTY_BINARY_NAME
|
static String |
CONTENT_PROPERTY_NAME
|
static String |
DATE_EFFECTIVE_PROPERTY_NAME
The name of the date effective property on the rule node type |
static String |
DATE_EXPIRED_PROPERTY_NAME
The name of the date expired property on the rule node type |
static String |
PACKAGE_NAME_PROPERTY
|
static String |
RULE_NODE_TYPE_NAME
The name of the rule node type |
Fields inherited from class org.drools.repository.Item |
---|
node, rulesRepository |
Constructor Summary | |
---|---|
AssetItem()
|
|
AssetItem(RulesRepository rulesRepository,
javax.jcr.Node node)
Constructs a RuleItem object, setting its node attribute to the specified node. |
Method Summary | |
---|---|
byte[] |
getBinaryContentAsBytes()
This is a convenience method for returning the binary data as a byte array. |
InputStream |
getBinaryContentAttachment()
If this asset contains binary data, this is how you return it. |
String |
getBinaryContentAttachmentFileName()
Get the name of the "file" attachment, if one is set. |
String |
getContent()
returns the string contents of the rule node. |
Calendar |
getDateEffective()
|
Calendar |
getDateExpired()
|
AssetHistoryIterator |
getHistory()
|
PackageItem |
getPackage()
This will get the package an asset item belongs to. |
String |
getPackageName()
Get the name of the enclosing package. |
VersionableItem |
getPrecedingVersion()
Clients of this method can cast the resulting object to the type of object they are calling the method on (e.g. |
VersionableItem |
getSucceedingVersion()
Clients of this method can cast the resulting object to the type of object they are calling the method on (e.g. |
String |
getUserProperty(String property)
|
void |
remove()
This will remove the item. |
String |
toString()
Nicely formats the information contained by the node that this object encapsulates |
AssetItem |
updateBinaryContentAttachment(InputStream data)
If the asset is a binary asset, then use this to update the content (do NOT use text). |
void |
updateBinaryContentAttachmentFileName(String name)
Optionally set the filename to be associated with the binary content. |
AssetItem |
updateContent(String newRuleContent)
This will update the asset's content (checking it out if it is not already). |
void |
updateDateEffective(Calendar newDateEffective)
Creates a new version of this object's rule node, updating the effective date for the rule node. |
void |
updateDateExpired(Calendar newDateExpired)
Creates a new version of this object's rule node, updating the expired date for the rule node. |
void |
updateUserProperty(String propertyName,
String value)
This updates a user defined property (not one of the intrinsic ones). |
Methods inherited from class org.drools.repository.CategorisableItem |
---|
addCategory, getCategories, removeCategory, updateCategoryList |
Methods inherited from class org.drools.repository.Item |
---|
equals, getNode, getRulesRepository, hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String RULE_NODE_TYPE_NAME
public static final String CONTENT_PROPERTY_NAME
public static final String CONTENT_PROPERTY_BINARY_NAME
public static final String CONTENT_PROPERTY_ATTACHMENT_FILENAME
public static final String DATE_EFFECTIVE_PROPERTY_NAME
public static final String DATE_EXPIRED_PROPERTY_NAME
public static final String PACKAGE_NAME_PROPERTY
Constructor Detail |
---|
public AssetItem(RulesRepository rulesRepository, javax.jcr.Node node) throws RulesRepositoryException
rulesRepository
- the rulesRepository that instantiated this objectnode
- the node in the repository that this RuleItem corresponds to
RulesRepositoryException
public AssetItem()
Method Detail |
---|
public String getContent() throws RulesRepositoryException
RulesRepositoryException
public InputStream getBinaryContentAttachment()
public String getBinaryContentAttachmentFileName()
public byte[] getBinaryContentAsBytes()
public Calendar getDateEffective() throws RulesRepositoryException
RulesRepositoryException
public void updateDateEffective(Calendar newDateEffective) throws RulesRepositoryException
newDateEffective
- the new effective date for the rule
RulesRepositoryException
public Calendar getDateExpired() throws RulesRepositoryException
RulesRepositoryException
public void updateDateExpired(Calendar newDateExpired) throws RulesRepositoryException
newDateExpired
- the new expired date for the rule
RulesRepositoryException
public AssetItem updateContent(String newRuleContent) throws RulesRepositoryException
RulesRepositoryException
public AssetItem updateBinaryContentAttachment(InputStream data)
public void updateBinaryContentAttachmentFileName(String name)
public void updateUserProperty(String propertyName, String value)
public String toString()
public VersionableItem getPrecedingVersion() throws RulesRepositoryException
VersionableItem
RuleItem item; ... RuleItem predcessor = (RuleItem) item.getPrecedingVersion();
getPrecedingVersion
in class VersionableItem
RulesRepositoryException
public VersionableItem getSucceedingVersion() throws RulesRepositoryException
VersionableItem
RuleItem item; ... RuleItem successor = (RuleItem) item.getSucceedingVersion();
getSucceedingVersion
in class VersionableItem
RulesRepositoryException
public String getPackageName()
public String getUserProperty(String property)
public void remove()
public AssetHistoryIterator getHistory()
public PackageItem getPackage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |