Class FormAttributeManagementService


  • public class FormAttributeManagementService
    extends Object
    The service of management for a form attribute. Any manipulations has to happen to attributes of a form through this service.
    • Constructor Detail

      • FormAttributeManagementService

        public FormAttributeManagementService()
    • Method Detail

      • isSupportingColumn

        public boolean isSupportingColumn​(PropertyInfo checked)
        Whether checks addition of a column supports this attribute.
        Parameters:
        checked - the checked object
        Returns:
        returns true if you can adds column attribute for checked attribute, false if not support.
      • isSupportingColumn

        public boolean isSupportingColumn​(TypeDescription typeDescription)
        Whether checks addition of a column supports this attribute.
        Parameters:
        typeDescription - the type description of the checked object
        Returns:
        returns true if you can adds column attribute for checked attribute, false if not support
      • addAttribute

        public void addAttribute​(Form form,
                                 FormAttribute attribute)
        Adds an attribute to the form. In time addition the unique name and id will be set to the attribute.
        Parameters:
        form - the form in which is added an new attribute
        attribute - it is the added attribute
        Throws:
        IllegalArgumentException - if attribute has not value type
      • addAttributeColumn

        public void addAttributeColumn​(IBmTransaction transaction,
                                       Form form,
                                       AbstractDataPath path,
                                       FormAttributeColumn column)
        Adds an column attribute to the form. In time addition the unique name and id will be set to the column attribute.
        Parameters:
        transaction - the transaction to perform changes in.
        form - the form in which is added an new attribute
        path - the path to an attribute in which the column will be added
        column - it is the added column attribute
        Throws:
        IllegalArgumentException - if attribute has not a value type or the path does not support addition a column.
      • replaceFormExtensionAttribute

        public void replaceFormExtensionAttribute​(IBmTransaction transaction,
                                                  FormAttribute srcAttribute,
                                                  Form form)
        Replaces borrowed attribute in extension form with base (inherited) attribute
        Parameters:
        transaction - bm transaction, cannot be null
        srcAttribute - source attribute to be replaced, cannot be null
        destAttribute - destination attribute to replace with, cannot be null
        form - model, cannot be null
      • deleteAttribute

        public void deleteAttribute​(IBmTransaction transaction,
                                    AbstractFormAttribute attribute,
                                    boolean removeItems)
        Remove the form attribute from a form which contains it.
        Parameters:
        transaction - the transaction to perform changes in
        attribute - the removal attribute
        removeItems - the flag setting rules removal of related objects. If it is true all related items will be removed, if false then at all related items the reference to this attribute will be cleared
      • attachAttributesExtInfoObjects

        public void attachAttributesExtInfoObjects​(IBmTransaction transaction,
                                                   Form form)
        Attaches all ExtInfo objects of form attributes to the given transaction.
        Parameters:
        transaction - the transaction to perform changes in, cannot be null
        form - the form which attributes' ExtInfo objects to attach, cannot be null
      • cloneAttributeExtInfo

        public void cloneAttributeExtInfo​(IBmTransaction transaction,
                                          Form form,
                                          TypeDescription type,
                                          FormAttribute sourceAttribute,
                                          FormAttribute clonedAttribute)
        Clones attribute ExtInfo.
        Parameters:
        transaction - the transaction to perform changes in, cannot be null
        form - the form in which is added a cloned attribute
        type - the attribute type
        sourceAttribute - the main attribute
        clonedAttribute - the cloned attribute