Interface IConfigurationsBC

  • All Superinterfaces:
    BusinessComponent
    All Known Implementing Classes:
    ConfigurationsBC

    public interface IConfigurationsBC
    extends BusinessComponent
    This interface has to be implemented by BCs in order to work with the configurationW widget plugin. Implementations will handle a config file that will store and provide configurations for different users, setting and programs. the key fields are -REALM: where the configuration is being used -KEYX: program name -USERID: username of the configuration owner -SETTING: name of the configuration. a user can have multiple settings
    Author:
    jcorea
    • Method Detail

      • getConfigFile

        String getConfigFile()
        Returns:
        returns the path of the config file
      • getTemplateConfigFile

        String getTemplateConfigFile()
        Returns:
        returns the string template of the config file
      • setConfigFile

        void setConfigFile​(String path)
        sets new config file path
        Parameters:
        path - new config file path
      • setUserName

        void setUserName​(String userName)
        set a new username. username will be used to determine the visible configurations and permissions. empty String "" as username enables admin mode
        Parameters:
        userName -
      • getUserName

        String getUserName()
        returns the current username
        Returns:
        the current username
      • setFieldsMinLengthAutoConvert

        void setFieldsMinLengthAutoConvert​(boolean fieldsMinLengthAutoConvert)
        if set to true, all fields will be padded with empty spaces to match the required field length in the attributes record. automatically applies to all calls to write,remove,retrieve
        Parameters:
        fieldsMinLengthAutoConvert -
        See Also:
        fillWithSpacesToMatchMinLength(com.basiscomponents.db.DataRow)
      • setTemplateConfigFile

        void setTemplateConfigFile​(String template)
        sets the string template for the config file (and resets the attributes record)
        Parameters:
        template - new string template
      • fillWithSpacesToMatchMinLength

        DataRow fillWithSpacesToMatchMinLength​(DataRow dr)
        all fields will be padded with empty spaces to match the required field length in the attributes record.
        Parameters:
        dr -
        Returns:
        See Also:
        setFieldsMinLengthAutoConvert(boolean)
      • getAdminUser

        String getAdminUser()
        returns the currently set username for the admin user. Default is "".
        Returns:
        current admin user
      • setAdminUser

        void setAdminUser​(String adminUser)
        sets the new username of the admin. default is empty string ""
        Parameters:
        new - admin username
      • getFactoryDefaultUser

        String getFactoryDefaultUser()
        returns the user which can set factory defaults. Default is "_$"
        Returns:
        current factory default user
      • setFactoryDefaultUser

        void setFactoryDefaultUser​(String factoryDefaultUser)
        returns the user which can set factory defaults. Default is "_$"
      • canModify

        Boolean canModify​(DataRow dr)
        returns true if this datarow can be modified. checks the username which is set with setUserName(). if the username does not equal the userid field in the datarow, this returns false, unless the adminuser is set. The admin user can modify all configurations.
        Parameters:
        dr -
        Returns:
      • getEffectiveConfiguration

        ResultSet getEffectiveConfiguration()
        gets the effective configuration for a user. This means, if a configuration for a given user with given settings exist (as specified by the filter), then this configuration will be returned, otherwise a default configuration will be returned.
        Returns:
        ResultSet with the effective Configuration
      • getAvailableConfigurations

        ResultSet getAvailableConfigurations()
                                      throws Exception
        returns the available configurations the user can access with the current filter. conditions are: -only filtered realm -only filtered keyx -only when match with set userid OR default userid -ignore settings filter (all settings should be shown)
        Returns:
        ResultSet with available Configurations
        Throws:
        Exception
      • getSharedConfigs

        ResultSet getSharedConfigs()
                            throws Exception
        returns the shared configurations the user can access with the current filter. conditions are: -only filtered realm -only filtered keyx -only configs NOT owned by user -shared with user via '*' -ignore settings filter (all settings should be shown)
        Returns:
        ResultSet with available Configurations
        Throws:
        Exception
      • getScopeDefault

        String getScopeDefault()
        returns the default scope
        Returns:
      • getScopeNoscope

        String getScopeNoscope()
        returns the scope which returns all fields (no scopes applied)
        Returns:
      • getFieldNameRealm

        String getFieldNameRealm()
        return the field name of the realm field
        Returns:
      • getFieldNameKeyx

        String getFieldNameKeyx()
        return the field name of the keyx field
        Returns:
      • getFieldNameUserid

        String getFieldNameUserid()
        return the field name of the userid field
        Returns:
      • getFieldNameSetting

        String getFieldNameSetting()
        return the field name of the setting field
        Returns:
      • getFieldNameCreaUser

        String getFieldNameCreaUser()
        return the field name of the creation user field
        Returns:
      • getFieldNameCreaDt

        String getFieldNameCreaDt()
        return the field name of the creation date field
        Returns:
      • getFieldNameModUser

        String getFieldNameModUser()
        return the field name of the last modification user field
        Returns:
      • getFieldNameModDt

        String getFieldNameModDt()
        return the field name of the last modification date field
        Returns:
      • getFieldNameConfig

        String getFieldNameConfig()
        return the field name of the config field
        Returns:
      • getFieldNameShared

        String getFieldNameShared()
        return the field name of the shared field
        Returns:
      • getFilter

        DataRow getFilter()
        returns the current filter of the bc
        Returns:
      • getFieldSelection

        DataRow getFieldSelection()
        returns the current fieldselection of the bc
        Returns: