Java Doc for PackageItem.java in  » Rule-Engine » drolls-Rule-Engine » org » drools » repository » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Rule Engine » drolls Rule Engine » org.drools.repository 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.drools.repository.Item
      org.drools.repository.VersionableItem
         org.drools.repository.PackageItem

PackageItem
public class PackageItem extends VersionableItem (Code)
A PackageItem object aggregates a set of assets (for example, rules). This is advantageous for systems using the JBoss Rules engine where the application might make use of many related rules.

A PackageItem refers to rule nodes within the RulesRepository. It contains the "master copy" of assets (which may be linked into other packages or other types of containers). This is a container "node".
author:
   btruitt



Field Summary
final public static  StringASSET_FOLDER_NAME
     This is the name of the rules "subfolder" where rules are kept for this package.
final public static  StringEXTERNAL_URI_PROPERTY_NAME
    
final public static  StringHEADER_PROPERTY_NAME
    
final public static  StringPACKAGE_FORMAT
     The dublin core format attribute.
final public static  StringRULE_PACKAGE_TYPE_NAME
    

Constructor Summary
public  PackageItem(RulesRepository rulesRepository, Node node)
    
 PackageItem()
    

Method Summary
public  AssetItemaddAsset(String assetName, String description)
     Adds a rule to the current package with no category (not recommended !).
public  AssetItemaddAsset(String assetName, String description, String initialCategory, String format)
     This adds a rule to the current physical package (you can move it later). With the given category. This will NOT check the asset in, just create the basic record.
public  voidchangeStatus(String newState)
     This will change the status of this package, and all the contained assets.
public  booleancontainsAsset(String name)
     Returns true if this package item contains an asset of the given name.
public  IteratorgetAssets()
    
public  IteratorgetAssetsWithStatus(StateItem state, StateItem ignoreState)
     This will return a list of assets for a given state. It works through the assets that belong to this package, and if they are not in the correct state, walks backwards until it finds one in the correct state.
public  IteratorgetAssetsWithStatus(StateItem state)
     This will return a list of assets for a given state. It works through the assets that belong to this package, and if they are not in the correct state, walks backwards until it finds one in the correct state.
public  byte[]getCompiledPackageBytes()
     This is a convenience method for returning the binary data as a byte array.
public  StringgetExternalURI()
     The external URI which will be used to sync this package to an external resource.Generally this will resolve to a directory in (for example) Subversion - with each assetbeing a file (with the format property as the file extension).
public  StringgetHeader()
    
public  StringgetName()
     Return the name of the package.
public  VersionableItemgetPrecedingVersion()
    
public  StringgetSnapshotName()
     returns the name of the snapshot, if this package is really a snapshot.
public  VersionableItemgetSucceedingVersion()
    
public  booleanisSnapshot()
    
public  AssetItemIteratorlistArchivedAssets()
    
public  AssetItemIteratorlistAssetsByFormat(String[] formats)
     This will load an iterator for assets of the given format type.
public  AssetItemloadAsset(String name)
     Load a specific rule asset by name.
public  AssetItemIteratorqueryAssets(String fieldPredicates, boolean seekArchived)
     This will query any assets stored under this package. For example, you can pass in "drools:format = 'drl'" to get a list of only a certain type of asset.
Parameters:
  fieldPredicates - A predicate string (SQL style).
public  AssetItemIteratorqueryAssets(String fieldPredicates)
    
public  voidremoveAsset(String name)
     Remove an asset by name After doing this, you will need to check in the package as removing an item effects the parent package.
 voidsortHistoryByVersionNumber(List fullHistory)
    
public  StringtoString()
    
public  voidupdateCheckinComment(String comment)
     Update the checkin comment.
public  PackageItemupdateCompiledPackage(InputStream data)
     If the asset is a binary asset, then use this to update the content (do NOT use text).
public  voidupdateExternalURI(String uri)
    
public  voidupdateHeader(String header)
    

Field Detail
ASSET_FOLDER_NAME
final public static String ASSET_FOLDER_NAME(Code)
This is the name of the rules "subfolder" where rules are kept for this package.



EXTERNAL_URI_PROPERTY_NAME
final public static String EXTERNAL_URI_PROPERTY_NAME(Code)



HEADER_PROPERTY_NAME
final public static String HEADER_PROPERTY_NAME(Code)



PACKAGE_FORMAT
final public static String PACKAGE_FORMAT(Code)
The dublin core format attribute.



RULE_PACKAGE_TYPE_NAME
final public static String RULE_PACKAGE_TYPE_NAME(Code)
The name of the rule package node type




Constructor Detail
PackageItem
public PackageItem(RulesRepository rulesRepository, Node node) throws RulesRepositoryException(Code)
Constructs an object of type RulePackageItem corresponding the specified node
Parameters:
  rulesRepository - the rulesRepository that instantiated this object
Parameters:
  node - the node to which this object corresponds
throws:
  RulesRepositoryException -



PackageItem
PackageItem()(Code)




Method Detail
addAsset
public AssetItem addAsset(String assetName, String description)(Code)
Adds a rule to the current package with no category (not recommended !). Without categories, its going to be hard to find rules later on (unless packages are enough for you).



addAsset
public AssetItem addAsset(String assetName, String description, String initialCategory, String format)(Code)
This adds a rule to the current physical package (you can move it later). With the given category. This will NOT check the asset in, just create the basic record.
Parameters:
  assetName - The name of the asset (the file name minus the extension)
Parameters:
  description - A description of the asset.
Parameters:
  initialCategory - The initial category the asset is placed in (can belong to multiple ones later).
Parameters:
  format - The dublin core format (which also determines what editor is used) - this is effectively the file extension.



changeStatus
public void changeStatus(String newState)(Code)
This will change the status of this package, and all the contained assets. No new versions are created of anything.
Parameters:
  newState - The status tag to change it to.



containsAsset
public boolean containsAsset(String name)(Code)
Returns true if this package item contains an asset of the given name.



getAssets
public Iterator getAssets()(Code)
Return an iterator for the rules in this package



getAssetsWithStatus
public Iterator getAssetsWithStatus(StateItem state, StateItem ignoreState)(Code)
This will return a list of assets for a given state. It works through the assets that belong to this package, and if they are not in the correct state, walks backwards until it finds one in the correct state. If it walks all the way back up the versions looking for the "latest" version with the appropriate state, and can't find one, that asset is not included in the result. This will exclude any items that have the "ignoreState" set (so for example, retired items, invalid items etc).
Parameters:
  state - The state of assets to retrieve.
Parameters:
  ignoreState - The statuses to not include in the results (it will lookat the status of the latest one).



getAssetsWithStatus
public Iterator getAssetsWithStatus(StateItem state)(Code)
This will return a list of assets for a given state. It works through the assets that belong to this package, and if they are not in the correct state, walks backwards until it finds one in the correct state. If it walks all the way back up the versions looking for the "latest" version with the appropriate state, and can't find one, that asset is not included in the result.



getCompiledPackageBytes
public byte[] getCompiledPackageBytes()(Code)
This is a convenience method for returning the binary data as a byte array.



getExternalURI
public String getExternalURI()(Code)
The external URI which will be used to sync this package to an external resource.Generally this will resolve to a directory in (for example) Subversion - with each assetbeing a file (with the format property as the file extension).



getHeader
public String getHeader()(Code)
The header contents as pertains to a package of rule assets.



getName
public String getName()(Code)
Return the name of the package.



getPrecedingVersion
public VersionableItem getPrecedingVersion() throws RulesRepositoryException(Code)



getSnapshotName
public String getSnapshotName()(Code)
returns the name of the snapshot, if this package is really a snapshot. If it is not, it will just return the name of the package, so use wisely !



getSucceedingVersion
public VersionableItem getSucceedingVersion() throws RulesRepositoryException(Code)



isSnapshot
public boolean isSnapshot()(Code)
true if this package is actually a snapshot.



listArchivedAssets
public AssetItemIterator listArchivedAssets()(Code)



listAssetsByFormat
public AssetItemIterator listAssetsByFormat(String[] formats)(Code)
This will load an iterator for assets of the given format type.



loadAsset
public AssetItem loadAsset(String name)(Code)
Load a specific rule asset by name.



queryAssets
public AssetItemIterator queryAssets(String fieldPredicates, boolean seekArchived)(Code)
This will query any assets stored under this package. For example, you can pass in "drools:format = 'drl'" to get a list of only a certain type of asset.
Parameters:
  fieldPredicates - A predicate string (SQL style). A list of matches.



queryAssets
public AssetItemIterator queryAssets(String fieldPredicates)(Code)



removeAsset
public void removeAsset(String name)(Code)
Remove an asset by name After doing this, you will need to check in the package as removing an item effects the parent package.



sortHistoryByVersionNumber
void sortHistoryByVersionNumber(List fullHistory)(Code)



toString
public String toString()(Code)
Nicely formats the information contained by the node that this object encapsulates



updateCheckinComment
public void updateCheckinComment(String comment)(Code)
Update the checkin comment.



updateCompiledPackage
public PackageItem updateCompiledPackage(InputStream data)(Code)
If the asset is a binary asset, then use this to update the content (do NOT use text).



updateExternalURI
public void updateExternalURI(String uri)(Code)



updateHeader
public void updateHeader(String header)(Code)



Fields inherited from org.drools.repository.VersionableItem
final public static String CATEGORY_PROPERTY_NAME(Code)(Java Doc)
final public static String CHECKIN_COMMENT(Code)(Java Doc)
final public static String CONTENT_PROPERTY_ARCHIVE_FLAG(Code)(Java Doc)
final public static String COVERAGE_PROPERTY_NAME(Code)(Java Doc)
final public static String CREATOR_PROPERTY_NAME(Code)(Java Doc)
final public static String DEFAULT_CONTENT_FORMAT(Code)(Java Doc)
final public static String DESCRIPTION_PROPERTY_NAME(Code)(Java Doc)
final public static String FORMAT_PROPERTY_NAME(Code)(Java Doc)
final public static String LAST_CONTRIBUTOR_PROPERTY_NAME(Code)(Java Doc)
final public static String LAST_MODIFIED_PROPERTY_NAME(Code)(Java Doc)
final public static String PUBLISHER_PROPERTY_NAME(Code)(Java Doc)
final public static String RELATION_PROPERTY_NAME(Code)(Java Doc)
final public static String RIGHTS_PROPERTY_NAME(Code)(Java Doc)
final public static String SOURCE_PROPERTY_NAME(Code)(Java Doc)
final public static String STATE_PROPERTY_NAME(Code)(Java Doc)
final public static String SUBJECT_PROPERTY_NAME(Code)(Java Doc)
final public static String TITLE_PROPERTY_NAME(Code)(Java Doc)
final public static String TYPE_PROPERTY_NAME(Code)(Java Doc)
final public static String VERSION_NUMBER_PROPERTY_NAME(Code)(Java Doc)

Methods inherited from org.drools.repository.VersionableItem
public VersionableItem archiveItem(boolean data)(Code)(Java Doc)
protected void checkIsUpdateable()(Code)(Java Doc)
public void checkin(String comment)(Code)(Java Doc)
public void checkout()(Code)(Java Doc)
public String getCheckinComment() throws RulesRepositoryException(Code)(Java Doc)
public String getCoverage()(Code)(Java Doc)
public Calendar getCreatedDate()(Code)(Java Doc)
public String getCreator()(Code)(Java Doc)
public String getDescription() throws RulesRepositoryException(Code)(Java Doc)
public String getExternalRelation()(Code)(Java Doc)
public String getExternalSource()(Code)(Java Doc)
public String getFormat() throws RulesRepositoryException(Code)(Java Doc)
public String getLastContributor()(Code)(Java Doc)
public Calendar getLastModified() throws RulesRepositoryException(Code)(Java Doc)
protected long getLongProperty(String property)(Code)(Java Doc)
public String getName()(Code)(Java Doc)
abstract public VersionableItem getPrecedingVersion() throws RulesRepositoryException(Code)(Java Doc)
protected Node getPrecedingVersionNode() throws RulesRepositoryException(Code)(Java Doc)
ItemVersionIterator getPredecessorVersionsIterator() throws RulesRepositoryException(Code)(Java Doc)
public String getPublisher()(Code)(Java Doc)
protected Node getRealContentFromVersion(Node node) throws RepositoryException, PathNotFoundException(Code)(Java Doc)
public String getRights()(Code)(Java Doc)
public StateItem getState() throws RulesRepositoryException(Code)(Java Doc)
public String getStateDescription()(Code)(Java Doc)
protected String getStringProperty(String property)(Code)(Java Doc)
public String getSubject()(Code)(Java Doc)
abstract public VersionableItem getSucceedingVersion() throws RulesRepositoryException(Code)(Java Doc)
protected Node getSucceedingVersionNode() throws RulesRepositoryException(Code)(Java Doc)
ItemVersionIterator getSuccessorVersionsIterator() throws RulesRepositoryException(Code)(Java Doc)
public String getTitle() throws RulesRepositoryException(Code)(Java Doc)
public String getType()(Code)(Java Doc)
public String getUUID()(Code)(Java Doc)
public Node getVersionContentNode() throws RepositoryException, PathNotFoundException(Code)(Java Doc)
public long getVersionNumber()(Code)(Java Doc)
public String getVersionSnapshotUUID()(Code)(Java Doc)
public boolean isArchived()(Code)(Java Doc)
public boolean isHistoricalVersion() throws RepositoryException(Code)(Java Doc)
public boolean sameState(StateItem other)(Code)(Java Doc)
public void updateCoverage(String cov)(Code)(Java Doc)
public void updateDescription(String newDescriptionContent) throws RulesRepositoryException(Code)(Java Doc)
public void updateExternalRelation(String rel)(Code)(Java Doc)
public void updateExternalSource(String source)(Code)(Java Doc)
public void updateFormat(String newFormat)(Code)(Java Doc)
public void updatePublisher(String pub)(Code)(Java Doc)
public void updateRights(String rights)(Code)(Java Doc)
public void updateState(String stateName) throws RulesRepositoryException(Code)(Java Doc)
public void updateState(StateItem stateItem) throws RulesRepositoryException(Code)(Java Doc)
protected void updateStringProperty(String value, String prop)(Code)(Java Doc)
public void updateSubject(String sub)(Code)(Java Doc)
public void updateTitle(String title) throws RulesRepositoryException(Code)(Java Doc)
public void updateType(String type)(Code)(Java Doc)

Fields inherited from org.drools.repository.Item
Logger log(Code)(Java Doc)
protected Node node(Code)(Java Doc)
protected RulesRepository rulesRepository(Code)(Java Doc)

Methods inherited from org.drools.repository.Item
public boolean equals(Object obj)(Code)(Java Doc)
public String getName() throws RulesRepositoryException(Code)(Java Doc)
public Node getNode()(Code)(Java Doc)
public RulesRepository getRulesRepository()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.