Package com.basiscomponents.bc
Class ConfigurationsBC
- java.lang.Object
-
- com.basiscomponents.bc.ConfigurationsBC
-
- All Implemented Interfaces:
BusinessComponent
,IConfigurationsBC
public class ConfigurationsBC extends Object implements BusinessComponent, IConfigurationsBC
Will handle a VKEYED config file that will store and provide configurations. This is currently used in the configuration widget plugin. It ill handle a config file that will store and provide configurations for different users, setting and programs. The BC will not create the VKEYED config file. 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
-
-
Field Summary
Fields Modifier and Type Field Description protected String
adminUser
protected static DataRow
attributes
protected JLibDataFileHandler
dataFileHandler
protected boolean
debug
protected static String
DEFAULT_TEMPLATE_CONFIG_FILE
protected String
factoryDefaultUser
static String
FIELD_NAME_CONFIG
static String
FIELD_NAME_CREA_DT
static String
FIELD_NAME_CREA_USER
static String
FIELD_NAME_KEYX
static String
FIELD_NAME_MOD_DT
static String
FIELD_NAME_MOD_USER
static String
FIELD_NAME_REALM
static String
FIELD_NAME_SETTING
static String
FIELD_NAME_SHARED
static String
FIELD_NAME_USERID
protected DataRow
fieldSelection
protected boolean
fieldsMinLengthAutoConvert
protected DataRow
filter
protected String
pathConfigFile
protected DataRow
scope
protected static String
SCOPE_DEFAULT
protected static String
SCOPE_NOSCOPE
protected static String
templateConfigFile
protected String
userName
-
Constructor Summary
Constructors Constructor Description ConfigurationsBC()
ConfigurationsBC(String pathConfigFile)
ConfigurationsBC(String pathConfigFile, String userName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
canModify(DataRow dr)
returns true if this datarow can be modified.protected void
checkDataRowMustContainField(DataRow dr, ResultSet errorRS, String fieldName)
checks if the field is contained in the datarow, otherwise an error is added to the resultsetprotected void
checkDataRowMustNotContainField(DataRow dr, ResultSet errorRS, String fieldName)
checks if the field is NOT contained in the datarow, otherwise an error is added to the resultsetprotected void
checkEditableFieldsInDataRow(DataRow dr, ResultSet errorRS, boolean checkKeysOnly)
checks a data row if it violates the requirements as defined in the attributesRecord.
For example if a field is a key, the dataRow must contain it.
If it is read only, the dataRow must not contain it (That is, if 'checkKeysOnly' is false.protected boolean
containsAllKNUMKeys(DataRow dr)
returns whether or not all key fields are provided in the data rowDataRow
fillWithSpacesToMatchMinLength(DataRow dr)
adds spaces to the end of each field value in the given datarow, until it reaches the given minimun length.protected DataRow
find(DataRow dr)
String
getAdminUser()
returns admin user.DataRow
getAttributesRecord()
Returns an empty DataRow including all field attributes (like field name, editable, label etc.), which the retrieve method could return.ResultSet
getAvailableConfigurations()
returns the available configurations the user can access with the current filter.String
getConfigFile()
ResultSet
getEffectiveConfiguration()
gets the effective configuration for a user.String
getFactoryDefaultUser()
returns the user which can set factory defaults.String
getFieldNameConfig()
return the field name of the config fieldString
getFieldNameCreaDt()
return the field name of the creation date fieldString
getFieldNameCreaUser()
return the field name of the creation user fieldString
getFieldNameKeyx()
return the field name of the keyx fieldString
getFieldNameModDt()
return the field name of the last modification date fieldString
getFieldNameModUser()
return the field name of the last modification user fieldString
getFieldNameRealm()
return the field name of the realm fieldString
getFieldNameSetting()
return the field name of the setting fieldString
getFieldNameShared()
return the field name of the shared fieldString
getFieldNameUserid()
return the field name of the userid fieldDataRow
getFieldSelection()
returns the current fieldselection of the bcDataRow
getFilter()
returns the current filter of the bcprotected DataRow
getKeyFieldsOnly(DataRow dr)
returns a DataRow with only the knum key fields from a given dataRow.protected String
getKNUMString(int knumIndex, DataRow dr)
concatenates the knum key and puts it in the right order.protected DataRow
getKNUMValue(int knumIndex)
returns the modified filter where all key fields are removed and instead 2 fields are added
-FILTER_VALUE
-FILTER_KNUM
FILTER_VALUE is the concatination of the key fields in the knum order, so the DataFileHandler can use it to query the file
All key fields must be provided in the filter, otherwise an unmodified filter is returned.BusinessComponent
getLookup(String fieldName, DataRow dr)
returns a bc that contains data providing predefined values for a field.ResultSet
getLookupData(String fieldName, DataRow dr)
like getLookup, but instead returns a resultset containg the lookup data.DataRow
getNewObjectTemplate(DataRow conditions)
Returns a new (predefined) DataRow including all field attributes (like field name, editable, label etc.).DataRow
getScope()
String
getScopeDefault()
returns the default scopeString
getScopeNoscope()
returns the scope which returns all fields (no scopes applied)ResultSet
getSharedConfigs()
returns the shared configurations the user can access with the current filter.String
getTemplateConfigFile()
String
getUserName()
returns the current usernamestatic void
main(String[] args)
protected ResultSet
mergeResultSetsOnKeys(ResultSet rs1, ResultSet rs2)
merges 2 resultsetsprotected void
printDebug(String s)
void
remove(DataRow dr)
removes a record from the fileResultSet
retrieve()
Retrieves a ResultSet with DataRow's.
If a filter is set, this will be applied to filter the result.
If a scope and/or a field selection is set, it will be used to retrieve the desired fields.ResultSet
retrieve(int first, int last)
Retrieves a ResultSet containing a subset of DataRow's (for pagination f.g.).
If a filter is set, this will be applied to filter the result.
If a scope and/or a field selection is set, it will be used to retrieve the desired fields.void
setAdminUser(String adminUser)
sets admin user.void
setConfigFile(String path)
setsvoid
setFactoryDefaultUser(String factoryDefaultUser)
returns the user which can set factory defaults.protected void
setFieldLengthAttribute(DataRow attributes)
sets the field length for each attribute in a 'LENGTH' attribute.void
setFieldSelection(DataRow fieldSelection)
Set a field selection to retrieve a custom set of fields.
All fields will be returned if no field selection is set.void
setFieldSelection(Collection<String> fieldSelection)
Set a field selection to retrieve a custom set of fields.
The default scope will be used if no field selection is set.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.void
setFilter(DataRow filter)
Set a filter for the search result.
If the filter is set it will be used in the retrieve method.
If no filter is set, the retrieve method will return all data.void
setScope(String scope)
Set a field selection scope (A, B, C, etc.).
If no or a wrong scope is set then all fields will be returned.void
setTemplateConfigFile(String template)
sets the string template for the config file (and resets the attributes record)void
setUserName(String userName)
set a new username.protected void
throwValidation(ResultSet validation)
throws a validation error if the validation has failed.ResultSet
validateRemove(DataRow dr)
validates datarow before removal.ResultSet
validateWrite(DataRow dr)
Validates a DataRow object before it can be written.
This method is internally used by the write method.
But it can also be called from the frontend to check for required or missing data.protected DataRow
validationErrorMessage(String fieldName, String type, String message)
generates error message for validation methods.DataRow
write(DataRow dr)
Write/persist a DataRow.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.basiscomponents.bc.BusinessComponent
getAllowedFilter
-
-
-
-
Field Detail
-
DEFAULT_TEMPLATE_CONFIG_FILE
protected static final String DEFAULT_TEMPLATE_CONFIG_FILE
- See Also:
- Constant Field Values
-
SCOPE_DEFAULT
protected static final String SCOPE_DEFAULT
- See Also:
- Constant Field Values
-
SCOPE_NOSCOPE
protected static final String SCOPE_NOSCOPE
- See Also:
- Constant Field Values
-
FIELD_NAME_REALM
public static final String FIELD_NAME_REALM
- See Also:
- Constant Field Values
-
FIELD_NAME_KEYX
public static final String FIELD_NAME_KEYX
- See Also:
- Constant Field Values
-
FIELD_NAME_USERID
public static final String FIELD_NAME_USERID
- See Also:
- Constant Field Values
-
FIELD_NAME_SETTING
public static final String FIELD_NAME_SETTING
- See Also:
- Constant Field Values
-
FIELD_NAME_CREA_USER
public static final String FIELD_NAME_CREA_USER
- See Also:
- Constant Field Values
-
FIELD_NAME_CREA_DT
public static final String FIELD_NAME_CREA_DT
- See Also:
- Constant Field Values
-
FIELD_NAME_MOD_USER
public static final String FIELD_NAME_MOD_USER
- See Also:
- Constant Field Values
-
FIELD_NAME_MOD_DT
public static final String FIELD_NAME_MOD_DT
- See Also:
- Constant Field Values
-
FIELD_NAME_CONFIG
public static final String FIELD_NAME_CONFIG
- See Also:
- Constant Field Values
-
FIELD_NAME_SHARED
public static final String FIELD_NAME_SHARED
- See Also:
- Constant Field Values
-
templateConfigFile
protected static String templateConfigFile
-
pathConfigFile
protected String pathConfigFile
-
userName
protected String userName
-
scope
protected DataRow scope
-
filter
protected DataRow filter
-
fieldSelection
protected DataRow fieldSelection
-
attributes
protected static DataRow attributes
-
dataFileHandler
protected JLibDataFileHandler dataFileHandler
-
fieldsMinLengthAutoConvert
protected boolean fieldsMinLengthAutoConvert
-
debug
protected boolean debug
-
adminUser
protected String adminUser
-
factoryDefaultUser
protected String factoryDefaultUser
-
-
Method Detail
-
getConfigFile
public String getConfigFile()
- Specified by:
getConfigFile
in interfaceIConfigurationsBC
- Returns:
- returns the path of the config file
-
getTemplateConfigFile
public String getTemplateConfigFile()
- Specified by:
getTemplateConfigFile
in interfaceIConfigurationsBC
- Returns:
- returns the string template of the config file
-
getScopeDefault
public String getScopeDefault()
Description copied from interface:IConfigurationsBC
returns the default scope- Specified by:
getScopeDefault
in interfaceIConfigurationsBC
- Returns:
-
getScopeNoscope
public String getScopeNoscope()
Description copied from interface:IConfigurationsBC
returns the scope which returns all fields (no scopes applied)- Specified by:
getScopeNoscope
in interfaceIConfigurationsBC
- Returns:
-
getFieldNameRealm
public String getFieldNameRealm()
Description copied from interface:IConfigurationsBC
return the field name of the realm field- Specified by:
getFieldNameRealm
in interfaceIConfigurationsBC
- Returns:
-
getFieldNameKeyx
public String getFieldNameKeyx()
Description copied from interface:IConfigurationsBC
return the field name of the keyx field- Specified by:
getFieldNameKeyx
in interfaceIConfigurationsBC
- Returns:
-
getFieldNameUserid
public String getFieldNameUserid()
Description copied from interface:IConfigurationsBC
return the field name of the userid field- Specified by:
getFieldNameUserid
in interfaceIConfigurationsBC
- Returns:
-
getFieldNameSetting
public String getFieldNameSetting()
Description copied from interface:IConfigurationsBC
return the field name of the setting field- Specified by:
getFieldNameSetting
in interfaceIConfigurationsBC
- Returns:
-
getFieldNameCreaUser
public String getFieldNameCreaUser()
Description copied from interface:IConfigurationsBC
return the field name of the creation user field- Specified by:
getFieldNameCreaUser
in interfaceIConfigurationsBC
- Returns:
-
getFieldNameCreaDt
public String getFieldNameCreaDt()
Description copied from interface:IConfigurationsBC
return the field name of the creation date field- Specified by:
getFieldNameCreaDt
in interfaceIConfigurationsBC
- Returns:
-
getFieldNameModUser
public String getFieldNameModUser()
Description copied from interface:IConfigurationsBC
return the field name of the last modification user field- Specified by:
getFieldNameModUser
in interfaceIConfigurationsBC
- Returns:
-
getFieldNameModDt
public String getFieldNameModDt()
Description copied from interface:IConfigurationsBC
return the field name of the last modification date field- Specified by:
getFieldNameModDt
in interfaceIConfigurationsBC
- Returns:
-
getFieldNameConfig
public String getFieldNameConfig()
Description copied from interface:IConfigurationsBC
return the field name of the config field- Specified by:
getFieldNameConfig
in interfaceIConfigurationsBC
- Returns:
-
getFieldNameShared
public String getFieldNameShared()
Description copied from interface:IConfigurationsBC
return the field name of the shared field- Specified by:
getFieldNameShared
in interfaceIConfigurationsBC
- Returns:
-
setConfigFile
public void setConfigFile(String path)
sets- Specified by:
setConfigFile
in interfaceIConfigurationsBC
- Parameters:
path
-
-
setUserName
public void setUserName(String userName)
Description copied from interface:IConfigurationsBC
set a new username. username will be used to determine the visible configurations and permissions. empty String "" as username enables admin mode- Specified by:
setUserName
in interfaceIConfigurationsBC
-
getUserName
public String getUserName()
Description copied from interface:IConfigurationsBC
returns the current username- Specified by:
getUserName
in interfaceIConfigurationsBC
- Returns:
- the current username
-
setFieldsMinLengthAutoConvert
public void setFieldsMinLengthAutoConvert(boolean fieldsMinLengthAutoConvert)
Description copied from interface:IConfigurationsBC
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- Specified by:
setFieldsMinLengthAutoConvert
in interfaceIConfigurationsBC
- See Also:
IConfigurationsBC.fillWithSpacesToMatchMinLength(com.basiscomponents.db.DataRow)
-
setTemplateConfigFile
public void setTemplateConfigFile(String template)
sets the string template for the config file (and resets the attributes record)- Specified by:
setTemplateConfigFile
in interfaceIConfigurationsBC
- Parameters:
template
- new string template
-
getAttributesRecord
public DataRow getAttributesRecord()
Description copied from interface:BusinessComponent
Returns an empty DataRow including all field attributes (like field name, editable, label etc.), which the retrieve method could return.- Specified by:
getAttributesRecord
in interfaceBusinessComponent
- Returns:
- an empty DataRow with field attributes.
-
setFieldLengthAttribute
protected void setFieldLengthAttribute(DataRow attributes)
sets the field length for each attribute in a 'LENGTH' attribute. length is defined in the templated string.- Parameters:
attributes
-
-
fillWithSpacesToMatchMinLength
public DataRow fillWithSpacesToMatchMinLength(DataRow dr)
adds spaces to the end of each field value in the given datarow, until it reaches the given minimun length. No effekt for fields when field value is already at or above minimum length- Specified by:
fillWithSpacesToMatchMinLength
in interfaceIConfigurationsBC
- Parameters:
dr
-- Returns:
- See Also:
IConfigurationsBC.setFieldsMinLengthAutoConvert(boolean)
-
setFilter
public void setFilter(DataRow filter)
Description copied from interface:BusinessComponent
Set a filter for the search result.
If the filter is set it will be used in the retrieve method.
If no filter is set, the retrieve method will return all data.- Specified by:
setFilter
in interfaceBusinessComponent
- Parameters:
filter
- a DataRow including field names and values to filter for. Filters are AND combined.- See Also:
BusinessComponent.retrieve()
-
getAdminUser
public String getAdminUser()
returns admin user. user with permission to edit all entries. other users can only modify their configuration- Specified by:
getAdminUser
in interfaceIConfigurationsBC
- Returns:
-
setAdminUser
public void setAdminUser(String adminUser)
sets admin user. user with permission to edit all entries. other users can only modify their configuration- Specified by:
setAdminUser
in interfaceIConfigurationsBC
- Parameters:
adminUser
-
-
getFactoryDefaultUser
public String getFactoryDefaultUser()
Description copied from interface:IConfigurationsBC
returns the user which can set factory defaults. Default is "_$"- Specified by:
getFactoryDefaultUser
in interfaceIConfigurationsBC
- Returns:
- current factory default user
-
setFactoryDefaultUser
public void setFactoryDefaultUser(String factoryDefaultUser)
Description copied from interface:IConfigurationsBC
returns the user which can set factory defaults. Default is "_$"- Specified by:
setFactoryDefaultUser
in interfaceIConfigurationsBC
-
setFieldSelection
public void setFieldSelection(DataRow fieldSelection)
Description copied from interface:BusinessComponent
Set a field selection to retrieve a custom set of fields.
All fields will be returned if no field selection is set.- Specified by:
setFieldSelection
in interfaceBusinessComponent
- Parameters:
fieldSelection
- a DataRow containing the field names for retrieving. Only the field names in the DataRow are used.
-
setFieldSelection
public void setFieldSelection(Collection<String> fieldSelection)
Description copied from interface:BusinessComponent
Set a field selection to retrieve a custom set of fields.
The default scope will be used if no field selection is set.- Specified by:
setFieldSelection
in interfaceBusinessComponent
- Parameters:
fieldSelection
- a String Collection containing the field names for retrieving.
-
setScope
public void setScope(String scope)
Description copied from interface:BusinessComponent
Set a field selection scope (A, B, C, etc.).
If no or a wrong scope is set then all fields will be returned.- Specified by:
setScope
in interfaceBusinessComponent
- Parameters:
scope
- the scope to set.
-
getKNUMValue
protected DataRow getKNUMValue(int knumIndex) throws ParseException
returns the modified filter where all key fields are removed and instead 2 fields are added
-FILTER_VALUE
-FILTER_KNUM
FILTER_VALUE is the concatination of the key fields in the knum order, so the DataFileHandler can use it to query the file
All key fields must be provided in the filter, otherwise an unmodified filter is returned.- Parameters:
knumIndex
-- Returns:
- Throws:
ParseException
-
getKNUMString
protected String getKNUMString(int knumIndex, DataRow dr)
concatenates the knum key and puts it in the right order. Used by getKNUMValue().- Parameters:
knumIndex
-dr
-- Returns:
- See Also:
getKNUMValue()
-
containsAllKNUMKeys
protected boolean containsAllKNUMKeys(DataRow dr)
returns whether or not all key fields are provided in the data row- Parameters:
dr
-- Returns:
-
retrieve
public ResultSet retrieve() throws Exception
Description copied from interface:BusinessComponent
Retrieves a ResultSet with DataRow's.
If a filter is set, this will be applied to filter the result.
If a scope and/or a field selection is set, it will be used to retrieve the desired fields.- Specified by:
retrieve
in interfaceBusinessComponent
- Returns:
- a ResultSet with DataRow's (may be empty).
- Throws:
Exception
- may occur during reading.
-
retrieve
public ResultSet retrieve(int first, int last) throws Exception
Description copied from interface:BusinessComponent
Retrieves a ResultSet containing a subset of DataRow's (for pagination f.g.).
If a filter is set, this will be applied to filter the result.
If a scope and/or a field selection is set, it will be used to retrieve the desired fields.- Specified by:
retrieve
in interfaceBusinessComponent
- Parameters:
first
- the index to start from (0 based).last
- the index of the last element in the subset.- Returns:
- a ResultSet with DataRow's (may be empty).
- Throws:
Exception
- may occur during reading.
-
validationErrorMessage
protected DataRow validationErrorMessage(String fieldName, String type, String message)
generates error message for validation methods.- Parameters:
fieldName
-type
-message
-- Returns:
-
checkDataRowMustContainField
protected void checkDataRowMustContainField(DataRow dr, ResultSet errorRS, String fieldName)
checks if the field is contained in the datarow, otherwise an error is added to the resultset- Parameters:
dr
-errorRS
-fieldName
-- See Also:
checkEditableFieldsInDataRow()
-
checkDataRowMustNotContainField
protected void checkDataRowMustNotContainField(DataRow dr, ResultSet errorRS, String fieldName)
checks if the field is NOT contained in the datarow, otherwise an error is added to the resultset- Parameters:
dr
-errorRS
-fieldName
-- See Also:
checkEditableFieldsInDataRow()
-
checkEditableFieldsInDataRow
protected void checkEditableFieldsInDataRow(DataRow dr, ResultSet errorRS, boolean checkKeysOnly) throws Exception
checks a data row if it violates the requirements as defined in the attributesRecord.
For example if a field is a key, the dataRow must contain it.
If it is read only, the dataRow must not contain it (That is, if 'checkKeysOnly' is false. In case of violation, an error is added in the error result set.- Parameters:
dr
-errorRS
-checkKeysOnly
-- Throws:
Exception
-
validateWrite
public ResultSet validateWrite(DataRow dr)
Validates a DataRow object before it can be written.
This method is internally used by the write method.
But it can also be called from the frontend to check for required or missing data.- Specified by:
validateWrite
in interfaceBusinessComponent
- Parameters:
dr
- a DataRow to validated.- Returns:
- a ResultSet with validation messages (empty ResultSet means no validation errors).
Each DataRow in the ResultSet should have following fields: FIELD_NAME, TYPE and MESSAGE.
FIELD_NAME: the name of the validated field
TYPE: INFO, WARNING or ERROR
MESSAGE: the validation message
-
throwValidation
protected void throwValidation(ResultSet validation) throws Exception
throws a validation error if the validation has failed. Does only affect methods where validation is called (e.g. write(), remove() etc.). The validate methods will instead return Boolean.FALSE- Parameters:
validation
-- Throws:
Exception
-
write
public DataRow write(DataRow dr) throws Exception
Description copied from interface:BusinessComponent
Write/persist a DataRow.- Specified by:
write
in interfaceBusinessComponent
- Parameters:
dr
- the DataRow to write.- Returns:
- the updated DataRow (may contain auto generated values/ID's).
- Throws:
Exception
- when writing failed.- See Also:
BusinessComponent.validateWrite(DataRow dr)
-
find
protected DataRow find(DataRow dr) throws ParseException
- Parameters:
dr
- dataRow containing knum fields- Returns:
- returns empty dataRow if entry was not found, or the entry as dataRow if found
- Throws:
ParseException
-
validateRemove
public ResultSet validateRemove(DataRow dr)
validates datarow before removal. Does only check if main keys are provided, and NOT if record exists in the file.- Specified by:
validateRemove
in interfaceBusinessComponent
- Parameters:
dr
- the DataRow that should be removed.- Returns:
- a ResultSet with validation messages (empty ResultSet means no validation errors).
Each DataRow in the ResultSet should have following fields: FIELD_NAME, TYPE and MESSAGE.
FIELD_NAME: the name of the validated field
TYPE: INFO, WARNING or ERROR
MESSAGE: the validation message
-
canModify
public 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.- Specified by:
canModify
in interfaceIConfigurationsBC
- Parameters:
dr
-- Returns:
-
remove
public void remove(DataRow dr) throws Exception
removes a record from the file- Specified by:
remove
in interfaceBusinessComponent
- Parameters:
dr
- dataRow that contains the key of the record to be removed. should contain following fields: - REALM - KEYX - USERID - SETTING fields not part of the key are being ignored.- Throws:
Exception
- if deleting failed.- See Also:
BusinessComponent.validateRemove(DataRow dr)
-
getNewObjectTemplate
public DataRow getNewObjectTemplate(DataRow conditions)
Description copied from interface:BusinessComponent
Returns a new (predefined) DataRow including all field attributes (like field name, editable, label etc.).- Specified by:
getNewObjectTemplate
in interfaceBusinessComponent
- Parameters:
conditions
- a DataRow with predefined fields.- Returns:
- a new predefined DataRow with the field attributes.
-
getKeyFieldsOnly
protected DataRow getKeyFieldsOnly(DataRow dr) throws ParseException
returns a DataRow with only the knum key fields from a given dataRow. if not all keys are present, adds them with empty value- Parameters:
dr
-- Returns:
- Throws:
ParseException
-
getEffectiveConfiguration
public 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.- Specified by:
getEffectiveConfiguration
in interfaceIConfigurationsBC
- Returns:
- ResultSet with the effective Configuration
-
getFilter
public DataRow getFilter()
Description copied from interface:IConfigurationsBC
returns the current filter of the bc- Specified by:
getFilter
in interfaceIConfigurationsBC
- Returns:
-
getFieldSelection
public DataRow getFieldSelection()
Description copied from interface:IConfigurationsBC
returns the current fieldselection of the bc- Specified by:
getFieldSelection
in interfaceIConfigurationsBC
- Returns:
-
printDebug
protected void printDebug(String s)
-
getAvailableConfigurations
public 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)- Specified by:
getAvailableConfigurations
in interfaceIConfigurationsBC
- Returns:
- ResultSet with available Configurations
- Throws:
Exception
-
getSharedConfigs
public 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)- Specified by:
getSharedConfigs
in interfaceIConfigurationsBC
- Returns:
- ResultSet with available Configurations
- Throws:
Exception
-
mergeResultSetsOnKeys
protected ResultSet mergeResultSetsOnKeys(ResultSet rs1, ResultSet rs2)
merges 2 resultsets- Parameters:
rs1
-rs2
-- Returns:
-
main
public static void main(String[] args)
-
getScope
public DataRow getScope()
-
getLookup
public BusinessComponent getLookup(String fieldName, DataRow dr)
Description copied from interface:BusinessComponent
returns a bc that contains data providing predefined values for a field. for example a lookup for a field "country" could return a countryBC which can retrieve values to fill a ListButton with. other fields are ignored.- Specified by:
getLookup
in interfaceBusinessComponent
- Parameters:
fieldName
- the field to retrieve the Lookup fordr
- current datarow- Returns:
- the lookup BC
-
getLookupData
public ResultSet getLookupData(String fieldName, DataRow dr)
Description copied from interface:BusinessComponent
like getLookup, but instead returns a resultset containg the lookup data.- Specified by:
getLookupData
in interfaceBusinessComponent
- Parameters:
fieldName
- the field to retrieve the Lookup fordr
- current datarow- Returns:
- the retrieved resultset from the lookup
-
-