|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.student.common.assembly.dictionary.MetadataServiceImpl
public class MetadataServiceImpl
This class provides metadata lookup for service dto objects.
Nested Class Summary | |
---|---|
private static class |
MetadataServiceImpl.RecursionCounter
|
Field Summary | |
---|---|
private Map<String,DictionaryService> |
dictionaryServiceMap
|
(package private) Logger |
LOG
|
private List<UILookupConfig> |
lookupObjectStructures
|
private String |
uiLookupContext
|
Constructor Summary | |
---|---|
MetadataServiceImpl()
|
|
MetadataServiceImpl(DictionaryService... dictionaryServices)
Create a metadata service initializing it with all known dictionary services |
Method Summary | |
---|---|
private void |
addLookupstoMetadata(String objectKey,
Metadata metadata,
String type)
|
private String |
calcSimpleName(String objectKey)
|
protected Data.Value |
convertDefaultValue(Data.DataType dataType,
Object value)
Convert Object value to respective DataType. |
protected Data.Value |
convertDefaultValue(Object value)
|
protected Data.DataType |
convertDictionaryDataType(DataType dataType)
|
protected List<ConstraintMetadata> |
getConstraints(FieldDefinition fd,
String type,
String state,
String nextState,
String workflowNode,
String documentTypeName)
|
Metadata |
getMetadata(String objectKey)
This method gets the metadata for the given object key for state DRAFT. |
Metadata |
getMetadata(String objectKey,
String state)
This method gets the metadata for the given object key and state |
Metadata |
getMetadata(String objectKey,
String type,
String state)
This method gets the metadata for the given object key, type and state |
Metadata |
getMetadata(String objectKey,
String type,
String state,
String nextState,
String documentTypeName)
This method gets the metadata for the given object key, type, state and nextState |
Metadata |
getMetadataByWorkflowNode(String objectKey,
String workflowNode,
String documentTypeName)
This method gets the metadata for the given object id key, workflowNode and documentTypeName |
protected Metadata |
getMetadataFromDictionaryService(String objectKey,
String type,
String state,
String nextState,
String workflowNode,
String documentTypeName)
This invokes the appropriate dictionary service to get the object structure and then converts it to a metadata structure. |
protected ObjectStructureDefinition |
getObjectStructure(String objectKey)
This method gets the object structure for given objectKey from a dictionaryService |
private static String[] |
getPathTokens(String fieldPath)
|
private Map<String,Metadata> |
getProperties(ObjectStructureDefinition objectStructure,
String type,
String state,
String nextState,
String workflowNode,
MetadataServiceImpl.RecursionCounter counter,
String documentTypeName)
This method is used to convert a list of dictionary fields into metadata properties |
private void |
init()
|
protected boolean |
isRepeating(FieldDefinition fd)
This method determines if a field is repeating |
private boolean |
isWorkflowNodeFirstConstraintValue(String workflowNode,
List<Object> values)
|
private LookupMetadata |
mapLookupDatatoMeta(UILookupData lookupData)
|
private LookupParamMetadata |
mapLookupParamMetadata(CommonLookupParam param)
|
private boolean |
matchesObjectKey(String objectKey,
String path)
|
private boolean |
matchesType(String paramType,
String lookupType)
|
protected void |
processCaseConstraint(ConstraintMetadata constraintMetadata,
CaseConstraint caseConstraint,
String type,
String state,
String nextState,
String workflowNode)
Currently this only handles requiredness indicators for case constraints with the following field paths: type, state, and proposal/workflowNode |
private void |
processRequiredByNodeCaseConstraint(ConstraintMetadata constraintMetadata,
CaseConstraint caseConstraint,
String workflowNode)
Modifies the constraintMetadata to add required to save or required to approve constraints based on the workflow route node the proposal is currently in. |
private void |
processStateCaseConstraint(ConstraintMetadata constraintMetadata,
CaseConstraint caseConstraint,
String type,
String state,
String nextState,
String workflowNode)
Processes a case constraint with field path of state. |
private void |
processTypeCaseConstraint(ConstraintMetadata constraintMetadata,
CaseConstraint caseConstraint,
String type,
String state,
String nextState,
String workflowNode)
Process a case constraint with fieldPath of type |
void |
setDictionaryServices(List<DictionaryService> dictionaryServices)
|
void |
setUiLookupContext(String uiLookupContext)
|
protected void |
updateConstraintMetadata(ConstraintMetadata constraintMetadata,
Constraint constraint,
String type,
String state,
String nextState,
String workflowNode)
This updates the constraintMetadata with defintions from the dictionary constraint field. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
final Logger LOG
private Map<String,DictionaryService> dictionaryServiceMap
private List<UILookupConfig> lookupObjectStructures
private String uiLookupContext
Constructor Detail |
---|
public MetadataServiceImpl()
public MetadataServiceImpl(DictionaryService... dictionaryServices)
dictionaryServices
- Method Detail |
---|
public void setDictionaryServices(List<DictionaryService> dictionaryServices)
public Metadata getMetadata(String objectKey, String type, String state, String nextState, String documentTypeName)
objectKey
- type
- The type of the object (value can be null)state
- The state for which to retrieve object constraints (value can be null)nextState
- The state to to check requiredForNextState indicators (value can be null)documentTypeName
- The type of the document (value can be null)
public Metadata getMetadataByWorkflowNode(String objectKey, String workflowNode, String documentTypeName)
public Metadata getMetadata(String objectKey, String type, String state)
objectKey
- type
- The type of the object (value can be null)state
- The state for which to retrieve object constraints (value can be null)
public Metadata getMetadata(String objectKey, String state)
objectKey
- type
- The type of the object (value can be null)public Metadata getMetadata(String objectKey)
objectKey
-
getMetadata(String, String)
protected Metadata getMetadataFromDictionaryService(String objectKey, String type, String state, String nextState, String workflowNode, String documentTypeName)
objectKey
- type
- state
- documentTypeName
-
private Map<String,Metadata> getProperties(ObjectStructureDefinition objectStructure, String type, String state, String nextState, String workflowNode, MetadataServiceImpl.RecursionCounter counter, String documentTypeName)
type
- state
- documentTypeName
- TODOfields
-
protected boolean isRepeating(FieldDefinition fd)
fd
-
protected ObjectStructureDefinition getObjectStructure(String objectKey)
objectKey
-
protected List<ConstraintMetadata> getConstraints(FieldDefinition fd, String type, String state, String nextState, String workflowNode, String documentTypeName)
protected void updateConstraintMetadata(ConstraintMetadata constraintMetadata, Constraint constraint, String type, String state, String nextState, String workflowNode)
constraintMetadata
- constraint
- protected void processCaseConstraint(ConstraintMetadata constraintMetadata, CaseConstraint caseConstraint, String type, String state, String nextState, String workflowNode)
private void processRequiredByNodeCaseConstraint(ConstraintMetadata constraintMetadata, CaseConstraint caseConstraint, String workflowNode)
constraintMetadata
- The fields constraintMetadata to be modifiedcaseConstraint
- The caseConstraint defined in dictionary for fieldworkflowNode
- The current node in workflow processprivate boolean isWorkflowNodeFirstConstraintValue(String workflowNode, List<Object> values)
values
- workflowNode
-
private void processStateCaseConstraint(ConstraintMetadata constraintMetadata, CaseConstraint caseConstraint, String type, String state, String nextState, String workflowNode)
private void processTypeCaseConstraint(ConstraintMetadata constraintMetadata, CaseConstraint caseConstraint, String type, String state, String nextState, String workflowNode)
protected Data.Value convertDefaultValue(Data.DataType dataType, Object value)
dataType
- value
-
protected Data.Value convertDefaultValue(Object value)
protected Data.DataType convertDictionaryDataType(DataType dataType)
public void setUiLookupContext(String uiLookupContext)
private void init()
private String calcSimpleName(String objectKey)
private boolean matchesObjectKey(String objectKey, String path)
private boolean matchesType(String paramType, String lookupType)
private void addLookupstoMetadata(String objectKey, Metadata metadata, String type)
private LookupMetadata mapLookupDatatoMeta(UILookupData lookupData)
private LookupParamMetadata mapLookupParamMetadata(CommonLookupParam param)
private static String[] getPathTokens(String fieldPath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |