Added projectId to DocumentDV
This commit is contained in:
parent
e8a52bcf7e
commit
40eb373fa7
|
@ -509,7 +509,7 @@ public class ConvertToDataValueObjectModel {
|
|||
project.getProfileVersion() != null ? project.getProfileVersion().getValue() : "");
|
||||
theProject.setVersion(project.getVersion() != null ? project.getVersion().getValue() : "");
|
||||
|
||||
theProject.setTheDocument(toGenericDocumentDV(project.getTheDocument(), DocumentDV.class,
|
||||
theProject.setTheDocument(toGenericDocumentDV(project.getId(), project.getTheDocument(), DocumentDV.class,
|
||||
projectReader.getListDocumentKeys(), projectReader.isIncludeFullDocumentMap()));
|
||||
|
||||
List<Relationship> relations = project.getRelationships();
|
||||
|
@ -531,8 +531,9 @@ public class ConvertToDataValueObjectModel {
|
|||
identificationReferences.size());
|
||||
|
||||
for (IdentificationReference identificationReference : identificationReferences) {
|
||||
IdentificationReferenceDV idv = toIdentificationReferenceDV(identificationReference,
|
||||
projectReader.getListDocumentKeys(), projectReader.isIncludeFullDocumentMap());
|
||||
IdentificationReferenceDV idv = toIdentificationReferenceDV(project.getId(),
|
||||
identificationReference, projectReader.getListDocumentKeys(),
|
||||
projectReader.isIncludeFullDocumentMap());
|
||||
|
||||
mapIdentReferenceDV.put(idv.getType(), idv);
|
||||
}
|
||||
|
@ -588,7 +589,7 @@ public class ConvertToDataValueObjectModel {
|
|||
|
||||
try {
|
||||
|
||||
ResultDocumentDV rd = (ResultDocumentDV) toGenericDocumentDV(project.getTheDocument(),
|
||||
ResultDocumentDV rd = (ResultDocumentDV) toGenericDocumentDV(project.getId(), project.getTheDocument(),
|
||||
ResultDocumentDV.class, null, true);
|
||||
rd.setId(project.getId());
|
||||
rd.setProfileID(project.getProfileID());
|
||||
|
@ -684,18 +685,19 @@ public class ConvertToDataValueObjectModel {
|
|||
/**
|
||||
* To identification reference DV.
|
||||
*
|
||||
* @param projectID the project ID
|
||||
* @param identificationReference the identification reference
|
||||
* @param listDocumentKeys the list document keys
|
||||
* @param getFullMap the get full map
|
||||
* @return the identification reference DV
|
||||
*/
|
||||
private static IdentificationReferenceDV toIdentificationReferenceDV(
|
||||
private static IdentificationReferenceDV toIdentificationReferenceDV(String projectID,
|
||||
IdentificationReference identificationReference, List<String> listDocumentKeys, boolean getFullMap) {
|
||||
if (identificationReference == null)
|
||||
return null;
|
||||
|
||||
IdentificationReferenceDV idv = (IdentificationReferenceDV) toGenericDocumentDV(identificationReference,
|
||||
IdentificationReferenceDV.class, listDocumentKeys, getFullMap);
|
||||
IdentificationReferenceDV idv = (IdentificationReferenceDV) toGenericDocumentDV(projectID,
|
||||
identificationReference, IdentificationReferenceDV.class, listDocumentKeys, getFullMap);
|
||||
idv.setType(identificationReference.getType());
|
||||
|
||||
return idv;
|
||||
|
@ -771,14 +773,15 @@ public class ConvertToDataValueObjectModel {
|
|||
* To generic document DV.
|
||||
*
|
||||
* @param <T> the generic type
|
||||
* @param projectID the project ID
|
||||
* @param document the document
|
||||
* @param targetClass the target class
|
||||
* @param listDocumentKeys the list document keys
|
||||
* @param getFullMap the get full map
|
||||
* @return the document DV
|
||||
*/
|
||||
public static <T extends DocumentDV> DocumentDV toGenericDocumentDV(Document document, Class<T> targetClass,
|
||||
List<String> listDocumentKeys, boolean getFullMap) {
|
||||
public static <T extends DocumentDV> DocumentDV toGenericDocumentDV(String projectID, Document document,
|
||||
Class<T> targetClass, List<String> listDocumentKeys, boolean getFullMap) {
|
||||
if (document == null)
|
||||
return null;
|
||||
|
||||
|
@ -819,6 +822,7 @@ public class ConvertToDataValueObjectModel {
|
|||
}
|
||||
|
||||
documentDV.setDocumentAsJSON(document.toJson());
|
||||
documentDV.setProjectID(projectID);
|
||||
|
||||
return documentDV;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ public class DocumentDV implements Serializable {
|
|||
private String documentAsJSON;
|
||||
private ConfigurationDV<?> configuration;
|
||||
|
||||
private String projectID;
|
||||
|
||||
public DocumentDV() {
|
||||
}
|
||||
|
||||
|
@ -22,13 +24,21 @@ public class DocumentDV implements Serializable {
|
|||
}
|
||||
|
||||
public Entry<String, Object> getFirstEntryOfMap() {
|
||||
if(documentAsMap!=null && documentAsMap.size()>1) {
|
||||
if (documentAsMap != null && documentAsMap.size() > 1) {
|
||||
return documentAsMap.entrySet().iterator().next();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getProjectID() {
|
||||
return projectID;
|
||||
}
|
||||
|
||||
public void setProjectID(String projectID) {
|
||||
this.projectID = projectID;
|
||||
}
|
||||
|
||||
public String getDocumentAsJSON() {
|
||||
return documentAsJSON;
|
||||
}
|
||||
|
@ -58,6 +68,8 @@ public class DocumentDV implements Serializable {
|
|||
builder.append(documentAsJSON);
|
||||
builder.append(", configuration=");
|
||||
builder.append(configuration);
|
||||
builder.append(", projectID=");
|
||||
builder.append(projectID);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue