Class WorkingSetManager


  • @ApplicationScoped
    public class WorkingSetManager
    extends Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.guvnor.common.services.workingset.client.model.WorkingSetSettings getActiveSettings​(org.uberfire.backend.vfs.Path resource)  
      Collection<org.guvnor.common.services.workingset.client.model.WorkingSetConfigData> getActiveWorkingSets​(org.uberfire.backend.vfs.Path resource)
      Returns the active WorkingSets for a package, or null if any.
      org.guvnor.common.services.workingset.client.factconstraints.customform.CustomFormConfiguration getCustomFormConfiguration​(org.uberfire.backend.vfs.Path resource, String factType, String fieldName)
      Returns the associated CustomFormConfiguration for a given FactType and FieldName.
      Set<org.guvnor.common.services.workingset.client.factconstraints.ConstraintConfiguration> getFieldContraints​(org.uberfire.backend.vfs.Path resource, String factType, String fieldName)
      Returns a Set of Constraints for a Fact Type's field.
      boolean isAutoVerifierEnabled()
      TODO: We need to store/retrieve this value from repository
      boolean isWorkingSetActive​(org.uberfire.backend.vfs.Path resource, org.uberfire.backend.vfs.Path workingSet)
      Returns whether the given (WorkingSet) RuleSet is active in a project or not.
      void onWorkingSetApplied​(org.guvnor.common.services.workingset.client.events.OnWorkingSetApplied event)  
      void onWorkingSetDisabled​(org.guvnor.common.services.workingset.client.events.OnWorkingSetDisabled event)  
      void removeWorkingSets​(org.uberfire.backend.vfs.Path resource)  
      void setAutoVerifierEnabled​(boolean autoVerifierEnabled)
      TODO: We need to store/retrieve this value from repository
    • Constructor Detail

      • WorkingSetManager

        public WorkingSetManager()
    • Method Detail

      • onWorkingSetApplied

        public void onWorkingSetApplied​(@Observes
                                        org.guvnor.common.services.workingset.client.events.OnWorkingSetApplied event)
      • onWorkingSetDisabled

        public void onWorkingSetDisabled​(@Observes
                                         org.guvnor.common.services.workingset.client.events.OnWorkingSetDisabled event)
      • getActiveWorkingSets

        public Collection<org.guvnor.common.services.workingset.client.model.WorkingSetConfigData> getActiveWorkingSets​(org.uberfire.backend.vfs.Path resource)
        Returns the active WorkingSets for a package, or null if any.
        Parameters:
        resource - the resource - part of a project
        Returns:
        the active WorkingSets for a package, or null if any.
      • getActiveSettings

        public org.guvnor.common.services.workingset.client.model.WorkingSetSettings getActiveSettings​(org.uberfire.backend.vfs.Path resource)
      • removeWorkingSets

        public void removeWorkingSets​(org.uberfire.backend.vfs.Path resource)
      • isWorkingSetActive

        public boolean isWorkingSetActive​(org.uberfire.backend.vfs.Path resource,
                                          org.uberfire.backend.vfs.Path workingSet)
        Returns whether the given (WorkingSet) RuleSet is active in a project or not.
        Parameters:
        resource - the resource.
        workingSet - the (WorkingSet) RuleSet
        Returns:
        whether the given (WorkingSet) RuleSet is active in a project or not.
      • getFieldContraints

        public Set<org.guvnor.common.services.workingset.client.factconstraints.ConstraintConfiguration> getFieldContraints​(org.uberfire.backend.vfs.Path resource,
                                                                                                                            String factType,
                                                                                                                            String fieldName)
        Returns a Set of Constraints for a Fact Type's field. This method uses the active Working Sets of the project in order to get the Constraints.
        Parameters:
        resource - the resource.
        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 org.guvnor.common.services.workingset.client.factconstraints.customform.CustomFormConfiguration getCustomFormConfiguration​(org.uberfire.backend.vfs.Path resource,
                                                                                                                                          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:
        resource - the resource (part of of a project). Used to get the active working sets of the active resource project
        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.