Common Attribute Framework Application Class Reference

This section discusses the application classes that you can use for accessing and manipulation of attributes through PeopleCode.

class SCC_COMMON_ATTRIBUTE_FW:AttributeManager

This class provides a set of utility methods that can be used to fetch relevant attributes. This class behaves as a sort of object factory that provides attribute objects.

Summary

Constructor Summary

Access Control

Details

public

AttributeManager ()

Method Summary

Access Control

Details

public boolean

deleteAllAttributes (Record p_parentRec)

Deletes all attributes associated with a record

public array of Attribute

getActiveRecordAttributes (Record p_parentRec)

Returns all active attributes associated with a record

public Attribute

getAttributeFromChildRecord (Record p_childRec)

Returns an Attribute object based on the attribute record

public any

getAttributeValue (Record p_rec, string p_AttributeName)

Returns the value of an attribute from the child record based on the name of the attribute provided

public array of Attribute

getFilteredRecordAttributes(Record p_parentRec, string p_EntityID)

Returns all attributes associated with a record filtered by Entity ID

public Attribute

getRecordAttribute (Record p_parentRec, string p_AttributeName)

Returns attribute associated with a record

public array of Attribute

getRecordAttributes (Record p_parentRec)

Returns all attributes associated with a record

public array of Attribute

getRecordAttributesV2 (Record p_parentRec)

Returns all attributes associated with a record

public void

setAttributeToChildRecord (Record p_childRec out, Attribute p_Attribute)

Sets the correct field in the record with value in the Attribute Object

public void

setAttributeValue (Record p_rec out, string p_AttributeName, any p_AttributeValue)

Sets the value of an attribute from the child record based on the name of the attribute provided

Detail

Constructor Detail

Access Control

Details

public

AttributeManager ()

Method Detail

Method

Details

deleteAllAttributes

public boolean deleteAllAttributes (Record p_parentRec)

Deletes all attributes associated with a record.

Parameters:

p_parentRec - The record which has been extended with attributes.

Returns:

boolean

getActiveRecordAttributes

public boolean deleteAllAttributes (Record p_parentRec)

Returns all active attributes associated with a record

Parameters:

p_parentRec - The record which has been extended with attributes.

Returns:

Array of Attribute

getAttributeFromChildRecord

public Attribute getAttributeFromChildRecord (Record p_childRec)

Returns an Attribute object based on the attribute record.

Parameters:

p_childRec - The record populated with data from a row in the attribute child record containing the subrecord SCC_CAF_SBR.

Returns:

Attribute

getAttributeValue

public any getAttributeValue (Record p_rec, string p_AttributeName)

Returns the value of an attribute from the child record based on the name of the attribute provided.

Parameters:

  • p_rec - The record populated with data from a row in the attribute child record containing the subrecord SCC_CAF_SBR.

  • p_AttributeName - Name of the attribute as string.

Returns:

any

getFilteredRecordAttributes

public boolean deleteAllAttributes (Record p_parentRec)

Returns all attributes associated with a record filtered by entity ID.

Parameters:

  • p_parentRec - The record which has been extended with attributes.

  • string p_EntityID

Returns:

Array of Attribute

getRecordAttribute

public Attribute getRecordAttribute (Record p_parentRec, string p_AttributeName)

Returns attribute associated with a record.

Parameters:

  • p_parentRec - The record which has been extended with attributes.

  • p_AttributeName - Name of the attribute as string.

Returns:

Attribute

getRecordAttributes

public array of Attribute getRecordAttributes (Record p_parentRec)

Returns all attributes associated with a record.

Parameters:

p_parentRec - The record which has been extended with attributes.

Returns:

array of Attribute

getRecordAttributesV2

public array of Attribute getRecordAttributesV2 (Record p_parentRec)

Returns all attributes associated with a record.

Parameters:

p_parentRec - The record which has been extended with attributes.

Returns:

array of Attribute

setAttributeToChildRecord

public void setAttributeToChildRecord (Record p_childRec out, Attribute p_Attribute)

Sets the correct field in the record with value in the Attribute Object.

Parameters:

  • p_childRec - The record populated with data from a row in the attribute child record containing the subrecord SCC_CAF_SBR.

  • p_Attribute - Instantiated Attribute Object.

setAttributeValue

public void setAttributeValue (Record p_rec out, string p_AttributeName, any p_AttributeValue)

Sets the value of an attribute from the child record based on the name of the attribute provided.

Parameters:

  • p_rec - The record populated with data from a row in the attribute child record containing the subrecord SCC_CAF_SBR.

  • p_AttributeName - Name of the attribute as string.

  • p_AttributeValue - Value of the attribute; data type depends on the attribute type.

class SCC_COMMON_ATTRIBUTE_FW:Attribute

This class encapsulates all the basic properties and behavior of an attribute. It is possible to manipulate an attribute using its various methods.

Summary

Property Summary

Access Control

Property

public Array of string

arrRequestKeyField

public iAttributeModifier

AttributeModifier

public iAttributeType

AttributeType

public Record

DataRecord

public string

DataType readonly

public string

DESCR

public string

FIELDNAME

public string

FormattedValue

public Boolean

HasLOV

public Boolean

isRepeatable

public Boolean

isRequired

public StringHashMap

LOVKeys

public string

RECNAME

public string

SCC_APPCLASSNAME

public string

SCC_CAF_ALLOW_BLNK

public string

SCC_CAF_ALLOW_MULT

public string

SCC_CAF_ATR_FORMAT

public number

SCC_CAF_ATTR_DEC

public string

SCC_CAF_ATTR_DEF

public number

SCC_CAF_ATTR_INT

public string

SCC_CAF_ATTR_TYPE

public string

SCC_CAF_ATTRIB_NM

public string

SCC_CAF_FIELDNAME

public string

SCC_SL_LOV_CONTEXT

public Boolean

SelfServiceMode

public any

Value

Constructor Summary

Access Control

Details

public

Attribute (string p_SCC_CAF_ATTRIB_NM, Record p_rec)

Constructor

Method Summary

Access Control, Type

Details

public void

close ( )

public boolean

delete (MessageLogBase p_msg out)

Deletes the attribute from the backend table.

public string

format (any p_value)

This method contains logic related to formatting of the attribute data. This is driven by the attribute type associated with the attribute. If a modifier or validator class is associated with this attribute then the format method in that class is invoked instead. Value passed in as parameter is validated in this method. This is useful for validating data in a field in the component buffer.

public StringHashMap

getListOfValues ( )

Returns the list of values (code and description pair) associated with this attribute.

public void

init (Record p_rec)

This methods contains logic to initialize properties and variables. This is called by the framework after the object is created.

public boolean

save (MessageLogBase p_msg out)

Saves the attribute to the backend table.

public void

setDefault ( )

This methods contains logic to initialize attribute data with default values.

public boolean

validate (MessageLogBase p_msg out)

This method contains validation logic. Validations are driven by the attribute type associated with the attribute. If a modifier or validator class is associated with this attribute then the validate method in that class is invoked instead. Value of the attribute is validated in this method.

public boolean

validateValue (any p_value, MessageLogBase p_msg out)

This method contains validation logic. Validations are driven by the attribute type associated with the attribute. If a modifier or validator class is associated with this attribute then the validate method in that class is invoked instead. Value passed in as parameter is validated in this method. This is useful for validating data in a field in the component buffer.

Detail

Property Detail

Property

Details

arrRequestKeyField

public Array of string

AttributeModifier

public iAttributeModifier

AttributeType

public iAttributeType

DataRecord

public Record

DataType

readonly public string

DESCR

public string

FIELDNAME

public string

FormattedValue

public string

HasLOV

public boolean

isRepeatable

public boolean

isRequired

public boolean

LOVKeys

public StringHashMap

RECNAME

public string

SCC_APPCLASSNAME

public string

SCC_CAF_ALLOW_BLNK

public string

SCC_CAF_ALLOW_MULT

public string

SCC_CAF_ATR_FORMAT

public string

SCC_CAF_ATTR_DEC

public number

SCC_CAF_ATTR_DEF

public string

SCC_CAF_ATTR_INT

public number

SCC_CAF_ATTR_TYPE

public string

SCC_CAF_ATTRIB_NM

public string

SCC_CAF_FIELDNAME

public string

SCC_SL_LOV_CONTEXT

public string

SelfServiceMode

public boolean

Value

public any

Constructor Detail

Attribute

public Attribute (string p_SCC_CAF_ATTRIB_NM, Record p_rec)

Constructor

Parameters:

  • p_SCC_CAF_ATTRIB_NM - Name of the attribute.

  • p_rec - Data record of the attribute containing the SCC_CAF_SBR subrecord.

Method Detail

Method

Details

delete

public boolean delete (MessageLogBase p_msg out)

Deletes the attribute from the backend table.

Parameters:

p_msg

Returns:

boolean

format

public string format (any p_value)

This method contains logic related to formatting of the attribute data. This is driven by the attribute type associated with the attribute. If a modifier or validator class is associated with this attribute then the format method in that class is invoked instead. Value passed in as parameter is validated in this method. This is useful for validating data in a field in the component buffer.

Parameters:

p_value - The value to be formatted.

Returns:

string

getListOfValues

public StringHashMap getListOfValues ( )

Returns the list of values (code and description pair) associated with this attribute.

Returns:

StringHashMap

init

public void init (Record p_rec)

This method contains logic to initialize properties and variables. This is called by the framework after the object is created.

Parameters:

p_rec - Record containing the SCC_CAF_SBR subrecord.

save

public boolean save (MessageLogBase p_msg out)

Saves the attribute to the backend table.

Parameters:

p_msg

Returns:

boolean

setDefault

public void setDefault ( )

This method contains logic to initialize attribute data with default values.

validate

public boolean validate (MessageLogBase p_msg out)

This method contains validation logic. Validations are driven by the attribute type associated with the attribute. If a modifier or validator class is associated with this attribute then the validate method in that class is invoked instead. Value of the attribute is validated in this method.

Parameters:

p_msg - This object is populated with any validation messages generated in the method.

Returns:

boolean

validateValue

public boolean validateValue (any p_value, MessageLogBase p_msg out)

This method contains validation logic. Validations are driven by the attribute type associated with the attribute. If a modifier or validator class is associated with this attribute then the validate method in that class is invoked instead. Value passed in as parameter is validated in this method. This is useful for validating data in a field in the component buffer.

Parameters:

  • p_value - The value to be validated.

  • p_msg - This object is populated with any validation messages generated in the method.

Returns:

boolean