Class RelationshipManagementRegistry


  • @Service
    public class RelationshipManagementRegistry
    extends Object
    All actions aimed to relate two or more inventory objects or to release the relationships between them should be registered in the respective registries offered by this service. The actions will be placed in separate categories in menus and toolbars. Actions registered here do not need to also be registered in the advanced or core actions registries.
    Author:
    Charles Edward Bedon Cortazar <charles.bedon@kuwaiba.org>
    • Constructor Detail

      • RelationshipManagementRegistry

        public RelationshipManagementRegistry()
    • Method Detail

      • getRelateToActionsApplicableTo

        public List<AbstractVisualAdvancedAction> getRelateToActionsApplicableTo​(String filter,
                                                                                 boolean includeNonReusable)
        Checks what actions are associated to a given inventory class.For example, NewCustomer and DeleteCustomer are part of the returned list if filter is GenericCustomer. Note that the difference between this method and #getActionsApplicableToRecursive(java.lang.String) is that this method will return the actions whose appliesTo matches exactly with the provided filter, while the latter might match even subclasses of the appliesTo return value.
        Parameters:
        filter - The class to be evaluated.
        includeNonReusable - Should the method include the reusable actions? See AbstractVisualAdvancedAction.isReusable(). for more details on reusable actions.
        Returns:
        The actions that can be executed from an instance of the given class or superclass.
      • getRelateToActionsApplicableToRecursive

        public List<AbstractVisualAdvancedAction> getRelateToActionsApplicableToRecursive​(String filter,
                                                                                          boolean includeNonReusable)
        Checks what actions are associated to a given inventory class. For example, NewCustomer and DeleteCustomer are part of the returned list if filter is CorporateCustomer.
        Parameters:
        filter - The class to be evaluated.
        includeNonReusable - Should the method include the reusable actions? See AbstractVisualAdvancedAction.isReusable().
        Returns:
        The actions that can be executed from an instance of the given class or superclass.
      • registerRelateToAction

        public void registerRelateToAction​(String moduleId,
                                           AbstractVisualAdvancedAction action)
        Adds an action to the registry.This method also feeds the action map cache structure, which is a hash map whose keys are all the possible super classes the actions are applicable to and the keys are the corresponding actions.
        Parameters:
        moduleId - The id of the module this action is provided by. The id is returned by AbstractModule.getId().
        action - The action to be added. Duplicated action ids are allowed, as long as the duplicate can be used to overwrite default behaviors, for example, if an object (say a connection) has a specific delete routine that should be executed instead of the general purpose delete action, both actions should have the same id, and the renderer should override the default action with the specific one.