Class DataCollectionTemplateStructureMerger
java.lang.Object
overit.geocallapp.wfm.core.ux.datacollection.template.structure.merger.DataCollectionTemplateStructureMerger
- All Implemented Interfaces:
Serializable
Data collection template structure working copy detail page.
- Since:
- 20.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddMessage(String currentCode, String newCode) Adds a message that indicate the code substitution.voidChecks the codes of the template structure that we are adding and replaces the not unique ones.protected StringgetNewCode(String code, List<String> currentTemplateNodesCodes) Builds the new node code concatenating a progressive number to the original code.Gets all the codes of the nodes of the input tree.voidAdds the template release tree to the current DCS template.protected voidreplaceCode(UXTreeModel<DataCollectionNode, DataCollectionTreeProperties> node, String oldCode, String newCode) Replace the original node code with the new one.protected voidreplaceExpression(UXTreeModel<DataCollectionNode, DataCollectionTreeProperties> node, String oldCode, String newCode) Replace the original node code with the new one in all the expressions of the new sub tree.voidsetAdditionalTreeModel(UXTreeModel<DataCollectionNode, DataCollectionTreeProperties> additionalTreeModel) voidsetBaseTreeModel(UXTreeModel<DataCollectionNode, DataCollectionTreeProperties> baseTreeModel) voidvoidsetMergingMode(TemplateMergingMode mergingMode) voidsetTeacher(Teacher teacher)
-
Constructor Details
-
DataCollectionTemplateStructureMerger
public DataCollectionTemplateStructureMerger()
-
-
Method Details
-
getMergingMode
- Returns:
- the mergingMode
-
setMergingMode
- Parameters:
mergingMode- the mergingMode to set
-
getTeacher
- Returns:
- the teacher
-
setTeacher
- Parameters:
teacher- the teacher to set
-
getCurrentNode
- Returns:
- the currentNode
-
setCurrentNode
public void setCurrentNode(UXTreeModel<DataCollectionNode, DataCollectionTreeProperties> currentNode) - Parameters:
currentNode- the currentNode to set
-
getBaseTreeModel
- Returns:
- the baseTreeModel
-
setBaseTreeModel
public void setBaseTreeModel(UXTreeModel<DataCollectionNode, DataCollectionTreeProperties> baseTreeModel) - Parameters:
baseTreeModel- the baseTreeModel to set
-
getAdditionalTreeModel
- Returns:
- the additionalTreeModel
-
setAdditionalTreeModel
public void setAdditionalTreeModel(UXTreeModel<DataCollectionNode, DataCollectionTreeProperties> additionalTreeModel) - Parameters:
additionalTreeModel- the additionalTreeModel to set
-
getMessages
- Returns:
- the messages
-
checkAndReplaceCodes
public void checkAndReplaceCodes()Checks the codes of the template structure that we are adding and replaces the not unique ones. Any not unique code are replaced with a new code equals to the original concatenated with a progressive number. Each substitution is logged in the messages list. -
addMessage
Adds a message that indicate the code substitution.- Parameters:
currentCode- the current value of the code to replacenewCode- the new value of the code replaced
-
getTemplateCodes
protected List<String> getTemplateCodes(UXTreeModel<DataCollectionNode, DataCollectionTreeProperties> tree) Gets all the codes of the nodes of the input tree.- Parameters:
tree- theUXTreeModeltree- Returns:
- all the codes of the nodes of the input tree.
-
getNewCode
Builds the new node code concatenating a progressive number to the original code. The new code must haven't any space or parenthesis.- Parameters:
code- the original node codecurrentTemplateNodesCodes- the list of codes of the basic template- Returns:
- the new node code
-
replaceCode
protected void replaceCode(UXTreeModel<DataCollectionNode, DataCollectionTreeProperties> node, String oldCode, String newCode) Replace the original node code with the new one.- Parameters:
node- theUXTreeModelto elaborateoldCode- the original node codenewCode- the new node code
-
replaceExpression
protected void replaceExpression(UXTreeModel<DataCollectionNode, DataCollectionTreeProperties> node, String oldCode, String newCode) Replace the original node code with the new one in all the expressions of the new sub tree.- Parameters:
node- theUXTreeModelto elaborateoldCode- the original node codenewCode- the new node code
-
mergeTree
public void mergeTree()Adds the template release tree to the current DCS template.
-