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 StringadminUserprotected static DataRowattributesprotected JLibDataFileHandlerdataFileHandlerprotected booleandebugprotected static StringDEFAULT_TEMPLATE_CONFIG_FILEprotected StringfactoryDefaultUserstatic StringFIELD_NAME_CONFIGstatic StringFIELD_NAME_CREA_DTstatic StringFIELD_NAME_CREA_USERstatic StringFIELD_NAME_KEYXstatic StringFIELD_NAME_MOD_DTstatic StringFIELD_NAME_MOD_USERstatic StringFIELD_NAME_REALMstatic StringFIELD_NAME_SETTINGstatic StringFIELD_NAME_SHAREDstatic StringFIELD_NAME_USERIDprotected DataRowfieldSelectionprotected booleanfieldsMinLengthAutoConvertprotected DataRowfilterprotected StringpathConfigFileprotected DataRowscopeprotected static StringSCOPE_DEFAULTprotected static StringSCOPE_NOSCOPEprotected static StringtemplateConfigFileprotected StringuserName
-
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 BooleancanModify(DataRow dr)returns true if this datarow can be modified.protected voidcheckDataRowMustContainField(DataRow dr, ResultSet errorRS, String fieldName)checks if the field is contained in the datarow, otherwise an error is added to the resultsetprotected voidcheckDataRowMustNotContainField(DataRow dr, ResultSet errorRS, String fieldName)checks if the field is NOT contained in the datarow, otherwise an error is added to the resultsetprotected voidcheckEditableFieldsInDataRow(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 booleancontainsAllKNUMKeys(DataRow dr)returns whether or not all key fields are provided in the data rowDataRowfillWithSpacesToMatchMinLength(DataRow dr)adds spaces to the end of each field value in the given datarow, until it reaches the given minimun length.protected DataRowfind(DataRow dr)StringgetAdminUser()returns admin user.DataRowgetAttributesRecord()Returns an empty DataRow including all field attributes (like field name, editable, label etc.), which the retrieve method could return.ResultSetgetAvailableConfigurations()returns the available configurations the user can access with the current filter.StringgetConfigFile()ResultSetgetEffectiveConfiguration()gets the effective configuration for a user.StringgetFactoryDefaultUser()returns the user which can set factory defaults.StringgetFieldNameConfig()return the field name of the config fieldStringgetFieldNameCreaDt()return the field name of the creation date fieldStringgetFieldNameCreaUser()return the field name of the creation user fieldStringgetFieldNameKeyx()return the field name of the keyx fieldStringgetFieldNameModDt()return the field name of the last modification date fieldStringgetFieldNameModUser()return the field name of the last modification user fieldStringgetFieldNameRealm()return the field name of the realm fieldStringgetFieldNameSetting()return the field name of the setting fieldStringgetFieldNameShared()return the field name of the shared fieldStringgetFieldNameUserid()return the field name of the userid fieldDataRowgetFieldSelection()returns the current fieldselection of the bcDataRowgetFilter()returns the current filter of the bcprotected DataRowgetKeyFieldsOnly(DataRow dr)returns a DataRow with only the knum key fields from a given dataRow.protected StringgetKNUMString(int knumIndex, DataRow dr)concatenates the knum key and puts it in the right order.protected DataRowgetKNUMValue(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.BusinessComponentgetLookup(String fieldName, DataRow dr)returns a bc that contains data providing predefined values for a field.ResultSetgetLookupData(String fieldName, DataRow dr)like getLookup, but instead returns a resultset containg the lookup data.DataRowgetNewObjectTemplate(DataRow conditions)Returns a new (predefined) DataRow including all field attributes (like field name, editable, label etc.).DataRowgetScope()StringgetScopeDefault()returns the default scopeStringgetScopeNoscope()returns the scope which returns all fields (no scopes applied)ResultSetgetSharedConfigs()returns the shared configurations the user can access with the current filter.StringgetTemplateConfigFile()StringgetUserName()returns the current usernamestatic voidmain(String[] args)protected ResultSetmergeResultSetsOnKeys(ResultSet rs1, ResultSet rs2)merges 2 resultsetsprotected voidprintDebug(String s)voidremove(DataRow dr)removes a record from the fileResultSetretrieve()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.ResultSetretrieve(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.voidsetAdminUser(String adminUser)sets admin user.voidsetConfigFile(String path)setsvoidsetFactoryDefaultUser(String factoryDefaultUser)returns the user which can set factory defaults.protected voidsetFieldLengthAttribute(DataRow attributes)sets the field length for each attribute in a 'LENGTH' attribute.voidsetFieldSelection(DataRow fieldSelection)Set a field selection to retrieve a custom set of fields.
All fields will be returned if no field selection is set.voidsetFieldSelection(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.voidsetFieldsMinLengthAutoConvert(boolean fieldsMinLengthAutoConvert)if set to true, all fields will be padded with empty spaces to match the required field length in the attributes record.voidsetFilter(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.voidsetScope(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.voidsetTemplateConfigFile(String template)sets the string template for the config file (and resets the attributes record)voidsetUserName(String userName)set a new username.protected voidthrowValidation(ResultSet validation)throws a validation error if the validation has failed.ResultSetvalidateRemove(DataRow dr)validates datarow before removal.ResultSetvalidateWrite(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 DataRowvalidationErrorMessage(String fieldName, String type, String message)generates error message for validation methods.DataRowwrite(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:
getConfigFilein interfaceIConfigurationsBC- Returns:
- returns the path of the config file
-
getTemplateConfigFile
public String getTemplateConfigFile()
- Specified by:
getTemplateConfigFilein interfaceIConfigurationsBC- Returns:
- returns the string template of the config file
-
getScopeDefault
public String getScopeDefault()
Description copied from interface:IConfigurationsBCreturns the default scope- Specified by:
getScopeDefaultin interfaceIConfigurationsBC- Returns:
-
getScopeNoscope
public String getScopeNoscope()
Description copied from interface:IConfigurationsBCreturns the scope which returns all fields (no scopes applied)- Specified by:
getScopeNoscopein interfaceIConfigurationsBC- Returns:
-
getFieldNameRealm
public String getFieldNameRealm()
Description copied from interface:IConfigurationsBCreturn the field name of the realm field- Specified by:
getFieldNameRealmin interfaceIConfigurationsBC- Returns:
-
getFieldNameKeyx
public String getFieldNameKeyx()
Description copied from interface:IConfigurationsBCreturn the field name of the keyx field- Specified by:
getFieldNameKeyxin interfaceIConfigurationsBC- Returns:
-
getFieldNameUserid
public String getFieldNameUserid()
Description copied from interface:IConfigurationsBCreturn the field name of the userid field- Specified by:
getFieldNameUseridin interfaceIConfigurationsBC- Returns:
-
getFieldNameSetting
public String getFieldNameSetting()
Description copied from interface:IConfigurationsBCreturn the field name of the setting field- Specified by:
getFieldNameSettingin interfaceIConfigurationsBC- Returns:
-
getFieldNameCreaUser
public String getFieldNameCreaUser()
Description copied from interface:IConfigurationsBCreturn the field name of the creation user field- Specified by:
getFieldNameCreaUserin interfaceIConfigurationsBC- Returns:
-
getFieldNameCreaDt
public String getFieldNameCreaDt()
Description copied from interface:IConfigurationsBCreturn the field name of the creation date field- Specified by:
getFieldNameCreaDtin interfaceIConfigurationsBC- Returns:
-
getFieldNameModUser
public String getFieldNameModUser()
Description copied from interface:IConfigurationsBCreturn the field name of the last modification user field- Specified by:
getFieldNameModUserin interfaceIConfigurationsBC- Returns:
-
getFieldNameModDt
public String getFieldNameModDt()
Description copied from interface:IConfigurationsBCreturn the field name of the last modification date field- Specified by:
getFieldNameModDtin interfaceIConfigurationsBC- Returns:
-
getFieldNameConfig
public String getFieldNameConfig()
Description copied from interface:IConfigurationsBCreturn the field name of the config field- Specified by:
getFieldNameConfigin interfaceIConfigurationsBC- Returns:
-
getFieldNameShared
public String getFieldNameShared()
Description copied from interface:IConfigurationsBCreturn the field name of the shared field- Specified by:
getFieldNameSharedin interfaceIConfigurationsBC- Returns:
-
setConfigFile
public void setConfigFile(String path)
sets- Specified by:
setConfigFilein interfaceIConfigurationsBC- Parameters:
path-
-
setUserName
public void setUserName(String userName)
Description copied from interface:IConfigurationsBCset a new username. username will be used to determine the visible configurations and permissions. empty String "" as username enables admin mode- Specified by:
setUserNamein interfaceIConfigurationsBC
-
getUserName
public String getUserName()
Description copied from interface:IConfigurationsBCreturns the current username- Specified by:
getUserNamein interfaceIConfigurationsBC- Returns:
- the current username
-
setFieldsMinLengthAutoConvert
public void setFieldsMinLengthAutoConvert(boolean fieldsMinLengthAutoConvert)
Description copied from interface:IConfigurationsBCif 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:
setFieldsMinLengthAutoConvertin 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:
setTemplateConfigFilein interfaceIConfigurationsBC- Parameters:
template- new string template
-
getAttributesRecord
public DataRow getAttributesRecord()
Description copied from interface:BusinessComponentReturns an empty DataRow including all field attributes (like field name, editable, label etc.), which the retrieve method could return.- Specified by:
getAttributesRecordin 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:
fillWithSpacesToMatchMinLengthin interfaceIConfigurationsBC- Parameters:
dr-- Returns:
- See Also:
IConfigurationsBC.setFieldsMinLengthAutoConvert(boolean)
-
setFilter
public void setFilter(DataRow filter)
Description copied from interface:BusinessComponentSet 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:
setFilterin 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:
getAdminUserin 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:
setAdminUserin interfaceIConfigurationsBC- Parameters:
adminUser-
-
getFactoryDefaultUser
public String getFactoryDefaultUser()
Description copied from interface:IConfigurationsBCreturns the user which can set factory defaults. Default is "_$"- Specified by:
getFactoryDefaultUserin interfaceIConfigurationsBC- Returns:
- current factory default user
-
setFactoryDefaultUser
public void setFactoryDefaultUser(String factoryDefaultUser)
Description copied from interface:IConfigurationsBCreturns the user which can set factory defaults. Default is "_$"- Specified by:
setFactoryDefaultUserin interfaceIConfigurationsBC
-
setFieldSelection
public void setFieldSelection(DataRow fieldSelection)
Description copied from interface:BusinessComponentSet a field selection to retrieve a custom set of fields.
All fields will be returned if no field selection is set.- Specified by:
setFieldSelectionin 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:BusinessComponentSet a field selection to retrieve a custom set of fields.
The default scope will be used if no field selection is set.- Specified by:
setFieldSelectionin interfaceBusinessComponent- Parameters:
fieldSelection- a String Collection containing the field names for retrieving.
-
setScope
public void setScope(String scope)
Description copied from interface:BusinessComponentSet a field selection scope (A, B, C, etc.).
If no or a wrong scope is set then all fields will be returned.- Specified by:
setScopein 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:BusinessComponentRetrieves 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:
retrievein 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:BusinessComponentRetrieves 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:
retrievein 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:
validateWritein 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:BusinessComponentWrite/persist a DataRow.- Specified by:
writein 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:
validateRemovein 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:
canModifyin interfaceIConfigurationsBC- Parameters:
dr-- Returns:
-
remove
public void remove(DataRow dr) throws Exception
removes a record from the file- Specified by:
removein 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:BusinessComponentReturns a new (predefined) DataRow including all field attributes (like field name, editable, label etc.).- Specified by:
getNewObjectTemplatein 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:
getEffectiveConfigurationin interfaceIConfigurationsBC- Returns:
- ResultSet with the effective Configuration
-
getFilter
public DataRow getFilter()
Description copied from interface:IConfigurationsBCreturns the current filter of the bc- Specified by:
getFilterin interfaceIConfigurationsBC- Returns:
-
getFieldSelection
public DataRow getFieldSelection()
Description copied from interface:IConfigurationsBCreturns the current fieldselection of the bc- Specified by:
getFieldSelectionin 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:
getAvailableConfigurationsin 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:
getSharedConfigsin 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:BusinessComponentreturns 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:
getLookupin 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:BusinessComponentlike getLookup, but instead returns a resultset containg the lookup data.- Specified by:
getLookupDatain interfaceBusinessComponent- Parameters:
fieldName- the field to retrieve the Lookup fordr- current datarow- Returns:
- the retrieved resultset from the lookup
-
-