This repository has been archived by the owner on Dec 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RELEASE]'release-1.4' into 'master'
- Loading branch information
Showing
14 changed files
with
142 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,5 +67,4 @@ public static SurveyItemMapping getEnumByObjectType(String objectType) { | |
|
||
return aux; | ||
} | ||
|
||
} |
27 changes: 26 additions & 1 deletion
27
survey-model/src/main/java/org/ccem/otus/survey/template/item/SurveyItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,36 @@ | ||
package org.ccem.otus.survey.template.item; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class SurveyItem { | ||
|
||
public String extents; | ||
public String objectType; | ||
public String templateID; | ||
public String customID; | ||
public String dataType; | ||
|
||
public List<String> getExtractionIDs() { | ||
List<String> ids = new ArrayList<>(); | ||
ids.add(this.customID); | ||
return ids; | ||
} | ||
|
||
public Map<String, String> mapIDS(){ | ||
Map<String, String> map = new HashMap<>(); | ||
map.put(templateID, customID); | ||
return map; | ||
} | ||
|
||
public String getTemplateID() { | ||
return templateID; | ||
} | ||
|
||
public String getCustomID() { | ||
return customID; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ public class Question extends SurveyItem { | |
public FillingRules fillingRules; | ||
|
||
} | ||
|
7 changes: 3 additions & 4 deletions
7
.../src/main/java/org/ccem/otus/survey/template/item/questions/grid/integer/GridInteger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
package org.ccem.otus.survey.template.item.questions.grid.integer; | ||
|
||
import org.ccem.otus.survey.template.item.SurveyItem; | ||
import org.ccem.otus.survey.template.item.label.Label; | ||
import org.ccem.otus.survey.template.item.questions.Question; | ||
|
||
public class GridInteger extends SurveyItem { | ||
public class GridInteger extends Question { | ||
|
||
public Label label; | ||
public LayoutGridInteger layout; | ||
public Label unit; | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...n/java/org/ccem/otus/survey/template/item/questions/grid/integer/GridIntegerQuestion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,33 @@ | ||
package org.ccem.otus.survey.template.item.questions.grid.integer; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.ccem.otus.survey.template.item.questions.Question; | ||
|
||
public class GridIntegerQuestion extends Question { | ||
|
||
public List<GridIntegerLine> lines; | ||
|
||
@Override | ||
public List<String> getExtractionIDs(){ | ||
List<String> ids = new ArrayList<>(); | ||
lines.forEach(gridIntegerLine -> gridIntegerLine.gridIntegerList.forEach(gridInteger -> ids.add(gridInteger.customID))); | ||
return ids; | ||
} | ||
|
||
@Override | ||
public Map<String, String> mapIDS(){ | ||
Map<String, String> map = new HashMap<>(); | ||
map.put(templateID, customID); | ||
for (GridIntegerLine line : lines) { | ||
for (GridInteger gridInteger : line.gridIntegerList) { | ||
map.put(gridInteger.templateID, gridInteger.customID); | ||
} | ||
} | ||
return map; | ||
} | ||
|
||
} |
5 changes: 2 additions & 3 deletions
5
...-model/src/main/java/org/ccem/otus/survey/template/item/questions/grid/text/GridText.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 26 additions & 4 deletions
30
...rc/main/java/org/ccem/otus/survey/template/item/questions/grid/text/GridTextQuestion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
package org.ccem.otus.survey.template.item.questions.grid.text; | ||
|
||
import java.util.List; | ||
|
||
import org.ccem.otus.survey.template.item.questions.Question; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class GridTextQuestion extends Question { | ||
|
||
public List<GridTextLine> lines; | ||
public List<GridTextLine> lines; | ||
|
||
@Override | ||
public List<String> getExtractionIDs(){ | ||
List<String> ids = new ArrayList<>(); | ||
lines.forEach(gridTextLine -> gridTextLine.gridTextList.forEach(gridText -> ids.add(gridText.customID))); | ||
return ids; | ||
} | ||
|
||
@Override | ||
public Map<String, String> mapIDS(){ | ||
Map<String, String> map = new HashMap<>(); | ||
map.put(templateID, customID); | ||
for (GridTextLine line : lines) { | ||
for (GridText gridText : line.gridTextList) { | ||
map.put(gridText.templateID, gridText.customID); | ||
} | ||
} | ||
return map; | ||
} | ||
|
||
} | ||
|
5 changes: 5 additions & 0 deletions
5
...el/src/main/java/org/ccem/otus/survey/template/item/questions/metadata/MetadataGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
package org.ccem.otus.survey.template.item.questions.metadata; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public class MetadataGroup { | ||
|
||
public String extents; | ||
public String objectType; | ||
public List<MetadataOption> options; | ||
|
||
public Optional<MetadataOption> getMetadataByValue(Integer value){ | ||
return options.stream().filter(metadata -> metadata.value.equals(value)).findFirst(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,5 @@ | |
public class NumericQuestion extends Question { | ||
|
||
public Unit unit; | ||
|
||
} |
24 changes: 23 additions & 1 deletion
24
...c/main/java/org/ccem/otus/survey/template/item/questions/selectable/CheckboxQuestion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
package org.ccem.otus.survey.template.item.questions.selectable; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.ccem.otus.survey.template.item.questions.Question; | ||
import org.ccem.otus.survey.template.item.questions.selectable.options.CheckboxOption; | ||
|
||
public class CheckboxQuestion extends Question { | ||
|
||
public List<CheckboxOption> options; | ||
|
||
|
||
@Override | ||
public List<String> getExtractionIDs(){ | ||
List<String> ids = new ArrayList<>(); | ||
options.forEach(checkboxOption -> ids.add(checkboxOption.customOptionID)); | ||
return ids; | ||
} | ||
|
||
|
||
@Override | ||
public Map<String, String> mapIDS(){ | ||
Map<String, String> map = new HashMap<>(); | ||
map.put(templateID, customID); | ||
for (CheckboxOption option : options) { | ||
map.put(option.optionID, option.customOptionID); | ||
} | ||
return map; | ||
} | ||
|
||
|
||
} |