Fixing issue - files/images duplicated reading the section
This commit is contained in:
parent
dc439a2637
commit
8d47db8e83
|
@ -60,6 +60,7 @@ public class SectionViewer extends Composite {
|
|||
boolean displayAsGallery = false;
|
||||
for (SubDocumentView subDocumentView : subDocuments) {
|
||||
if (subDocumentView.getListImages() != null && subDocumentView.getListImages().size() > 0) {
|
||||
GWT.log("Section with images: "+subDocumentView.getListImages());
|
||||
displayAsGallery = true;
|
||||
break;
|
||||
}
|
||||
|
@ -68,6 +69,7 @@ public class SectionViewer extends Composite {
|
|||
boolean displayAsMapOfLayers = false;
|
||||
for (SubDocumentView subDocumentView : subDocuments) {
|
||||
if (subDocumentView.getListLayers() != null && subDocumentView.getListLayers().size() > 0) {
|
||||
GWT.log("Section with layers: "+subDocumentView.getListImages());
|
||||
displayAsMapOfLayers = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -271,8 +271,9 @@ public class Geoportal_JSON_Mapper {
|
|||
for (Payload payload : listPayloads) {
|
||||
PayloadDV payloadDV = ConvertToDataValueObjectModel.toPayloadDV(payload);
|
||||
filesetDV.addPayloadDV(payloadDV);
|
||||
listFiles.add(filesetDV);
|
||||
|
||||
}
|
||||
listFiles.add(filesetDV);
|
||||
|
||||
// Reading Fileset _materializations
|
||||
// listLayers = readGcubeSDILayersForFileset(filesetJSONPath,
|
||||
|
@ -529,19 +530,36 @@ public class Geoportal_JSON_Mapper {
|
|||
// Reading Fileset _payloads
|
||||
String filesetJSONPath = String.format("%s.%s", JSON_$_POINTER, filePath.getFieldName());
|
||||
List<Payload> listPayloads = readPayloadsForFileset(filesetJSONPath, fromSectionDocJSON);
|
||||
FilesetDV filesetDV = new FilesetDV();
|
||||
filesetDV.setName(filePath.getGcubeProfileFieldName());
|
||||
if(LOG.isDebugEnabled()) {
|
||||
for (Payload payload : listPayloads) {
|
||||
LOG.debug("read payload: " + payload);
|
||||
}
|
||||
}
|
||||
|
||||
FilesetDV filesetImages = new FilesetDV();
|
||||
FilesetDV filesetFiles = new FilesetDV();
|
||||
|
||||
for (Payload payload : listPayloads) {
|
||||
PayloadDV payloadDV = ConvertToDataValueObjectModel.toPayloadDV(payload);
|
||||
filesetDV.addPayloadDV(payloadDV);
|
||||
//filesetDV.addPayloadDV(payloadDV);
|
||||
boolean isImage = ImageDetector.isImage(payload.getMimetype());
|
||||
|
||||
if (isImage) {
|
||||
listImages.add(filesetDV);
|
||||
filesetImages.setName(filePath.getGcubeProfileFieldName());
|
||||
filesetImages.addPayloadDV(payloadDV);
|
||||
} else {
|
||||
listFiles.add(filesetDV);
|
||||
filesetFiles.addPayloadDV(payloadDV);
|
||||
filesetFiles.setName(filePath.getGcubeProfileFieldName());
|
||||
}
|
||||
}
|
||||
|
||||
//Setting only if one element exists
|
||||
if(filesetImages.getListPayload().size()>0) {
|
||||
listImages.add(filesetImages);
|
||||
}
|
||||
if(filesetFiles.getListPayload().size()>0) {
|
||||
listFiles.add(filesetFiles);
|
||||
}
|
||||
|
||||
// Reading Fileset _materializations
|
||||
listLayers = readGcubeSDILayersForFileset(filesetJSONPath, fromSectionDocJSON);
|
||||
|
|
Loading…
Reference in New Issue