org.drools.guvnor.client.moduleeditor.drools
Class WorkingSetManager

java.lang.Object
  extended by org.drools.guvnor.client.moduleeditor.drools.WorkingSetManager

public class WorkingSetManager
extends Object


Constructor Summary
WorkingSetManager()
           
 
Method Summary
 void applyWorkingSets(String packageName, Set<Asset> wss, com.google.gwt.user.client.Command done)
          Applies the workingSets' valid facts to SCE.
 void applyWorkingSets(String packageName, String[] wsUUIDs, com.google.gwt.user.client.Command done)
          Convenient method to call applyWorkingSets(java.lang.String, java.util.Set, com.google.gwt.user.client.Command) when you have the WorkingSets' UUID instead of the WorkingSetConfigData objects
 Set<Asset> getActiveAssets(String packageName)
          Returns the active WorkingSets for a package (as RuleAsset), or null if any.
 Set<String> getActiveAssetUUIDs(String packageName)
           
 Set<WorkingSetConfigData> getActiveWorkingSets(String packageName)
          Returns the active WorkingSets for a package, or null if any.
 CustomFormConfiguration getCustomFormConfiguration(String packageName, String factType, String fieldName)
          Returns the associated CustomFormConfiguration for a given FactType and FieldName.
 Set<ConstraintConfiguration> getFieldContraints(String packageName, String factType, String fieldName)
          Returns a Set of Constraints for a Fact Type's field.
static WorkingSetManager getInstance()
           
 boolean isAutoVerifierEnabled()
          TODO: We need to store/retrieve this value from repository
 boolean isWorkingSetActive(String packageName, Asset workingSetAsset)
          Returns whether the given (WorkingSet) RuleSet is active in a package or not.
 boolean isWorkingSetActive(String packageName, String ruleAssetUUID)
          Returns whether the given (WorkingSet) RuleSet is active in a package or not.
 void setAutoVerifierEnabled(boolean autoVerifierEnabled)
          TODO: We need to store/retrieve this value from repository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkingSetManager

public WorkingSetManager()
Method Detail

getInstance

public static WorkingSetManager getInstance()

applyWorkingSets

public void applyWorkingSets(String packageName,
                             String[] wsUUIDs,
                             com.google.gwt.user.client.Command done)
Convenient method to call applyWorkingSets(java.lang.String, java.util.Set, com.google.gwt.user.client.Command) when you have the WorkingSets' UUID instead of the WorkingSetConfigData objects

Parameters:
packageName - the package name.
wsUUIDs - the set of WorkingSets' UUIDs
done - the command to execute after the SCE and internal map are refreshed.
See Also:
applyWorkingSets(java.lang.String, java.util.Set, com.google.gwt.user.client.Command)

applyWorkingSets

public void applyWorkingSets(String packageName,
                             Set<Asset> wss,
                             com.google.gwt.user.client.Command done)
Applies the workingSets' valid facts to SCE. This method updates the internal activeWorkingSets map. If no workingSet is supplied, the SCE is refreshed to remove any existing filter.

Parameters:
packageName - the package name.
wss - the WorkingSet' assets list
done - the command to execute after the SCE and internal map are refreshed.

getActiveAssets

public Set<Asset> getActiveAssets(String packageName)
Returns the active WorkingSets for a package (as RuleAsset), or null if any.

Parameters:
packageName - the package name
Returns:
the active WorkingSets for a package (as RuleAsset), or null if any.

getActiveAssetUUIDs

public Set<String> getActiveAssetUUIDs(String packageName)

getActiveWorkingSets

public Set<WorkingSetConfigData> getActiveWorkingSets(String packageName)
Returns the active WorkingSets for a package, or null if any.

Parameters:
packageName - the package name
Returns:
the active WorkingSets for a package, or null if any.

isWorkingSetActive

public boolean isWorkingSetActive(String packageName,
                                  Asset workingSetAsset)
Returns whether the given (WorkingSet) RuleSet is active in a package or not.

Parameters:
packageName - the package name.
workingSetAsset - the (WorkingSet) RuleSet
Returns:
whether the given (WorkingSet) RuleSet is active in a package or not.

isWorkingSetActive

public boolean isWorkingSetActive(String packageName,
                                  String ruleAssetUUID)
Returns whether the given (WorkingSet) RuleSet is active in a package or not.

Parameters:
packageName - the package name.
workingSetAsset - the (WorkingSet) RuleSet
Returns:
whether the given (WorkingSet) RuleSet is active in a package or not.

getFieldContraints

public Set<ConstraintConfiguration> getFieldContraints(String packageName,
                                                       String factType,
                                                       String fieldName)
Returns a Set of Constraints for a Fact Type's field. This method uses the active Working Sets of the package in order to get the Constraints.

Parameters:
packageName - the package name.
factType - the Fact Type (Short class name)
fieldName - the field name
Returns:
a Set of Constraints for a Fact Type's field.

isAutoVerifierEnabled

public boolean isAutoVerifierEnabled()
TODO: We need to store/retrieve this value from repository

Returns:

setAutoVerifierEnabled

public void setAutoVerifierEnabled(boolean autoVerifierEnabled)
TODO: We need to store/retrieve this value from repository


getCustomFormConfiguration

public CustomFormConfiguration getCustomFormConfiguration(String packageName,
                                                          String factType,
                                                          String fieldName)
Returns the associated CustomFormConfiguration for a given FactType and FieldName. Because CustomFormConfiguration is stored inside a WorkingSet, the packageName attribute is used to retrieve all the active WorkingSets. If more than one active WorkingSet contain a CustomFormConfiguration for the given FactType and FieldName the first to be found (in any specific nor deterministic order) will be returned.

Parameters:
packageName - the name of the package. Used to get the active working sets
factType - The short class name of the Fact Type
fieldName - The field name
Returns:
the associated CustomFormConfiguration for the given FactType and FieldName in the active working sets or null if any.


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