站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

RepositoryService (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.brms.client.rpc
Interface RepositoryService

All Superinterfaces:
com.google.gwt.user.client.rpc.RemoteService
All Known Implementing Classes:
ServiceImplementation

public interface RepositoryService
extends com.google.gwt.user.client.rpc.RemoteService

This is what the remote service will implement, as a servlet. (in hosted/debug mode, you could also use an implementation that was in-process).


Method Summary
 BuilderResult[] buildAsset(RuleAsset asset)
          This will build the asset and return any build results (errors).
 String buildAssetSource(RuleAsset asset)
          This will return the effective source for an asset (in DRL).
 BuilderResult[] buildPackage(String packageUUID)
          Build the package (may be a snapshot) and return the result.
 String buildPackageSource(String packageUUID)
          This will return the effective DRL for a package.
 void changeAssetPackage(String uuid, String newPackage, String comment)
          This moves an asset to the given target package.
 void changeState(String uuid, String newState, boolean wholePackage)
          This will change the state of an asset or package.
 String checkinVersion(RuleAsset asset)
          This checks in a new version of an asset.
 void clearRulesRepository()
          Clear the rules repositoty, Use at your own risk.
 String copyAsset(String assetUUID, String newPackage, String newName)
          Copies an asset into a new destination package.
 void copyOrRemoveSnapshot(String packageName, String snapshotName, boolean delete, String newSnapshotName)
          This alters an existing snapshot, it can be used to copy or delete it.
 Boolean createCategory(String path, String name, String description)
          This will create a new category at the specified path.
 String createNewRule(String ruleName, String description, String initialCategory, String initialPackage, String format)
          Creates a brand new rule with the initial category.
 String createPackage(String name, String description)
          This creates a package of the given name, and checks it in.
 void createPackageSnapshot(String packageName, String snapshotName, boolean replaceExisting, String comment)
          Create a package snapshot for deployment.
 String createState(String name)
          Create a state (status).
 void deleteUncheckedRule(String ruleName, String initialPackage)
          Delete un checked in Asset
 byte[] exportRepository()
          Export rules repository to a compressed array of bytes
 TableDataResult listAssets(String packageUUID, String[] formats, int numRows, int startRow)
          Given a format, this will return assets that match.
 PackageConfigData[] listPackages()
          This returns a list of packages where rules may be added.
 SnapshotInfo[] listSnapshots(String packageName)
          This will load a list of snapshots for the given package.
 String[] listStates()
          Returns a list of valid states.
 TableDataResult loadAssetHistory(String uuid)
          This will load the history of the given asset, in a summary format suitable for display in a table.
 String[] loadChildCategories(String categoryPath)
           
 PackageConfigData loadPackageConfig(String uuid)
          Loads a package by its uuid.
 RuleAsset loadRuleAsset(String UUID)
          This loads up all the stuff for a rule asset based on the UUID (always latest and editable version).
 TableDataResult loadRuleListForCategories(String categoryPath)
          Return a a 2d array/grid of results for rules.
 SuggestionCompletionEngine loadSuggestionCompletionEngine(String packageName)
          Loads up the SuggestionCompletionEngine for the given package.
 TableConfig loadTableConfig(String listName)
          This will return a TableConfig of header names.
 TableDataResult quickFindAsset(String searchText, int maxMatches, boolean searchArchived)
          This will quickly return a list of asset names/descriptions.
 void removeCategory(String categoryPath)
          This will remove a category.
 void restoreVersion(String versionUUID, String assetUUID, String comment)
          This will restore the specified version in the repository, saving, and creating a new version (with all the restored content).
 ValidatedResponse savePackage(PackageConfigData data)
          Saves the package config data in place (does not create a new version of anything).
 

Method Detail

loadChildCategories

String[] loadChildCategories(String categoryPath)
Parameters:
categoryPath - A "/" delimited path to a category.
callback -

loadRuleListForCategories

TableDataResult loadRuleListForCategories(String categoryPath)
                                          throws com.google.gwt.user.client.rpc.SerializableException
Return a a 2d array/grid of results for rules.

Parameters:
A - "/" delimited path to a category.
Throws:
com.google.gwt.user.client.rpc.SerializableException

loadTableConfig

TableConfig loadTableConfig(String listName)
This will return a TableConfig of header names.

Parameters:
listName - The name of the list that we are going to render.

createCategory

Boolean createCategory(String path,
                       String name,
                       String description)
This will create a new category at the specified path.


createNewRule

String createNewRule(String ruleName,
                     String description,
                     String initialCategory,
                     String initialPackage,
                     String format)
                     throws com.google.gwt.user.client.rpc.SerializableException
Creates a brand new rule with the initial category. Return the UUID of the item created. This will not check in the rule, but just leave it as saved in the repo.

Throws:
com.google.gwt.user.client.rpc.SerializableException

deleteUncheckedRule

void deleteUncheckedRule(String ruleName,
                         String initialPackage)
Delete un checked in Asset


exportRepository

byte[] exportRepository()
                        throws com.google.gwt.user.client.rpc.SerializableException
Export rules repository to a compressed array of bytes

Throws:
com.google.gwt.user.client.rpc.SerializableException

clearRulesRepository

void clearRulesRepository()
Clear the rules repositoty, Use at your own risk.


listPackages

PackageConfigData[] listPackages()
This returns a list of packages where rules may be added. Only the UUID and the name need to be populated.


loadRuleAsset

RuleAsset loadRuleAsset(String UUID)
                        throws com.google.gwt.user.client.rpc.SerializableException
This loads up all the stuff for a rule asset based on the UUID (always latest and editable version).

Throws:
com.google.gwt.user.client.rpc.SerializableException

loadAssetHistory

TableDataResult loadAssetHistory(String uuid)
                                 throws com.google.gwt.user.client.rpc.SerializableException
This will load the history of the given asset, in a summary format suitable for display in a table.

Throws:
com.google.gwt.user.client.rpc.SerializableException

checkinVersion

String checkinVersion(RuleAsset asset)
                      throws com.google.gwt.user.client.rpc.SerializableException
This checks in a new version of an asset.

Returns:
the UUID of the asset you are checking in, null if there was some problem (and an exception was not thrown).
Throws:
com.google.gwt.user.client.rpc.SerializableException

restoreVersion

void restoreVersion(String versionUUID,
                    String assetUUID,
                    String comment)
This will restore the specified version in the repository, saving, and creating a new version (with all the restored content).


createPackage

String createPackage(String name,
                     String description)
                     throws com.google.gwt.user.client.rpc.SerializableException
This creates a package of the given name, and checks it in.

Returns:
UUID of the created item.
Throws:
com.google.gwt.user.client.rpc.SerializableException

loadPackageConfig

PackageConfigData loadPackageConfig(String uuid)
Loads a package by its uuid.

Returns:
Well, its pretty obvious if you think about it for a minute. Really.

savePackage

ValidatedResponse savePackage(PackageConfigData data)
                              throws com.google.gwt.user.client.rpc.SerializableException
Saves the package config data in place (does not create a new version of anything).

Returns:
A ValidatedReponse, with any errors to be reported. No payload is in the response. If there are any errors, the user should be given the option to review them, and correct them if needed (but a save will not be prevented this way - as its not an exception).
Throws:
com.google.gwt.user.client.rpc.SerializableException

listAssets

TableDataResult listAssets(String packageUUID,
                           String[] formats,
                           int numRows,
                           int startRow)
                           throws com.google.gwt.user.client.rpc.SerializableException
Given a format, this will return assets that match. It can also be used for "pagination" by passing in start and finish row numbers.

Parameters:
packageUUID - The package uuid to search inside.
format - The format to filter on.
numRows - The number of rows to return. -1 means all.
startRow - The starting row number if paging - if numRows is -1 then this is ignored.
Throws:
com.google.gwt.user.client.rpc.SerializableException

listStates

String[] listStates()
                    throws com.google.gwt.user.client.rpc.SerializableException
Returns a list of valid states.

Throws:
com.google.gwt.user.client.rpc.SerializableException

createState

String createState(String name)
                   throws com.google.gwt.user.client.rpc.SerializableException
Create a state (status).

Returns:
the UUID of the created StateItem.
Throws:
com.google.gwt.user.client.rpc.SerializableException

changeState

void changeState(String uuid,
                 String newState,
                 boolean wholePackage)
This will change the state of an asset or package.

Parameters:
uuid - The UUID of the asset we are tweaking.
newState - The new state to set. It must be valid in the repo.
wholePackage - true if it is a package we are setting the state of. If this is true, UUID must be the status of a package, if false, it must be an asset.

changeAssetPackage

void changeAssetPackage(String uuid,
                        String newPackage,
                        String comment)
This moves an asset to the given target package.


copyAsset

String copyAsset(String assetUUID,
                 String newPackage,
                 String newName)
Copies an asset into a new destination package.

Parameters:
assetUUID - The source assetID.
newPackage - The destination package (may be the same as the current source package, but in that case the asset has to have a different name).
newName - The new name of the asset.

listSnapshots

SnapshotInfo[] listSnapshots(String packageName)
This will load a list of snapshots for the given package. Snapshots are created by taking a labelled copy of a package, at a point in time, for instance for deployment.


createPackageSnapshot

void createPackageSnapshot(String packageName,
                           String snapshotName,
                           boolean replaceExisting,
                           String comment)
Create a package snapshot for deployment.

Parameters:
packageName - THe name of the package to copy.
snapshotName - The name of the snapshot. Has to be unique unless existing one is to be replaced.
replaceExisting - Replace the existing one (must be true to replace an existing snapshot of the same name).
comment - A comment to be added to the copied one.

copyOrRemoveSnapshot

void copyOrRemoveSnapshot(String packageName,
                          String snapshotName,
                          boolean delete,
                          String newSnapshotName)
                          throws com.google.gwt.user.client.rpc.SerializableException
This alters an existing snapshot, it can be used to copy or delete it.

Parameters:
packageName - The package name that we are dealing with.
snapshotName - The snapshot name (this must exist)
delete - true if the snapshotName is to be removed.
newSnapshotName - The name of the target snapshot that the contents will be copied to.
Throws:
com.google.gwt.user.client.rpc.SerializableException

quickFindAsset

TableDataResult quickFindAsset(String searchText,
                               int maxMatches,
                               boolean searchArchived)
This will quickly return a list of asset names/descriptions. This list will be limited, and it will be flagged if more are found then can be shown. Returning an extra empty row means there are more to come... The id of a row is the UUID, the first value is the name, the next the description. Finally, if there is "more" rows, a row will be returned which has "MORE" as its ID.


removeCategory

void removeCategory(String categoryPath)
                    throws com.google.gwt.user.client.rpc.SerializableException
This will remove a category. A category must have no current assets linked to it, or else it will not be able to be removed.

Parameters:
categoryPath - The full path to the category. Any sub categories will also be removed.
Throws:
com.google.gwt.user.client.rpc.SerializableException - For when it all goes horribly wrong.

loadSuggestionCompletionEngine

SuggestionCompletionEngine loadSuggestionCompletionEngine(String packageName)
                                                          throws com.google.gwt.user.client.rpc.SerializableException
Loads up the SuggestionCompletionEngine for the given package. As this doesn't change that often, its safe to cache. However, if a change is made to a package, should blow away the cache.

Throws:
com.google.gwt.user.client.rpc.SerializableException

buildPackage

BuilderResult[] buildPackage(String packageUUID)
                             throws com.google.gwt.user.client.rpc.SerializableException
Build the package (may be a snapshot) and return the result. This will then store the result in the package as an attachment.

Throws:
com.google.gwt.user.client.rpc.SerializableException

buildPackageSource

String buildPackageSource(String packageUUID)
                          throws com.google.gwt.user.client.rpc.SerializableException
This will return the effective DRL for a package. This would be the equivalent if all the rules were written by hand in the one file. It may not actually be compiled this way in the implementation, so this is for display and debugging assistance only. It should still generate

Throws:
com.google.gwt.user.client.rpc.SerializableException

buildAssetSource

String buildAssetSource(RuleAsset asset)
                        throws com.google.gwt.user.client.rpc.SerializableException
This will return the effective source for an asset (in DRL). Used as an aid for debugging.

Throws:
com.google.gwt.user.client.rpc.SerializableException

buildAsset

BuilderResult[] buildAsset(RuleAsset asset)
                           throws com.google.gwt.user.client.rpc.SerializableException
This will build the asset and return any build results (errors).

Throws:
com.google.gwt.user.client.rpc.SerializableException


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.