509 lines
20 KiB
Java
509 lines
20 KiB
Java
package org.gcube.portlets.user.geoportaldataviewer.server;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
|
|
import org.bson.Document;
|
|
import org.gcube.application.geoportal.client.utils.Serialization;
|
|
import org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel;
|
|
import org.gcube.application.geoportalcommon.geoportal.access.GeportalCheckAccessPolicy;
|
|
import org.gcube.application.geoportalcommon.geoportal.serdes.Payload;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.FilePathDV;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.GCubeSDIViewerLayerDV;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.BBOXDV;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.PayloadDV;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_CONFIGURATION_TYPE;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.SectionView;
|
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.SubDocumentView;
|
|
import org.gcube.portlets.user.geoportaldataviewer.server.GeoportalDataViewerServiceImpl.ImageDetector;
|
|
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
|
|
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetadataFieldWrapper;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONObject;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.GsonBuilder;
|
|
import com.google.gson.JsonObject;
|
|
import com.google.gson.JsonParser;
|
|
import com.jayway.jsonpath.JsonPath;
|
|
import com.jayway.jsonpath.spi.json.JsonOrgJsonProvider;
|
|
|
|
public class Geoportal_JSON_Mapper {
|
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(Geoportal_JSON_Mapper.class);
|
|
|
|
public static final String FILESET = "fileset";
|
|
|
|
public static final String _OGC_LINKS_WMS = "_ogcLinks.wms";
|
|
|
|
public static final String _BBOX = "_bbox";
|
|
|
|
public static final String _TYPE = "_type";
|
|
|
|
public static final String JSON_$_POINTER = "$";
|
|
|
|
public static ProjectView loadProjectView(ProjectDV theProjectDV, String scope, String username) throws Exception {
|
|
|
|
String theWholeProjectAsJSON = theProjectDV.getTheDocument().getDocumentAsJSON();
|
|
|
|
LOG.debug("theProjectDV as JSON: " + theWholeProjectAsJSON);
|
|
LOG.debug("theProjectDV as MAP: " + theProjectDV.getTheDocument().getDocumentAsMap());
|
|
|
|
ProjectView projectView = new ProjectView();
|
|
projectView.setTheProjectDV(theProjectDV);
|
|
|
|
LinkedHashMap<String, List<GcubeProfilesMetadataForUCD>> linkedMap_UCDId_gCubeProfiles = GcubeProfilesPerUCDIdCache
|
|
.get(scope);
|
|
|
|
// NO UCD defined, applying default
|
|
if (linkedMap_UCDId_gCubeProfiles.size() == 0) {
|
|
LOG.warn("No " + GEOPORTAL_CONFIGURATION_TYPE.gcube_profiles + " found in the UCD");
|
|
LOG.info("Applying default business logic to display the project");
|
|
SectionView sectionView = new SectionView();
|
|
sectionView.setSectionTitle("Document");
|
|
SubDocumentView subDocumentView = new SubDocumentView();
|
|
|
|
Document sectionDoc = Document.parse(theProjectDV.getTheDocument().getDocumentAsJSON());
|
|
boolean isAccessibleSection = isAccessibleSectionAccordingToPolicy(sectionDoc, JSON_$_POINTER, username);
|
|
|
|
// If is accessible
|
|
if (isAccessibleSection) {
|
|
|
|
// Creating one Project with one SectionView and SubDocumentView
|
|
String wholeSectionDoc = sectionDoc.toJson();
|
|
subDocumentView.setMetadataAsJSON(wholeSectionDoc);
|
|
|
|
List<FilesetDV> listFiles = new ArrayList<FilesetDV>();
|
|
List<FilesetDV> listImages = new ArrayList<FilesetDV>();
|
|
List<GCubeSDIViewerLayerDV> listLayers = new ArrayList<GCubeSDIViewerLayerDV>();
|
|
|
|
// Reading Fileset _payloads
|
|
String filesetJSONPath = String.format("%s.%s", JSON_$_POINTER, FILESET);
|
|
List<Payload> listPayloads = readPayloadsForFileset(filesetJSONPath, wholeSectionDoc);
|
|
FilesetDV filesetDV = new FilesetDV();
|
|
filesetDV.setName(FILESET);
|
|
for (Payload payload : listPayloads) {
|
|
PayloadDV payloadDV = ConvertToDataValueObjectModel.toPayloadDV(payload);
|
|
filesetDV.addPayloadDV(payloadDV);
|
|
boolean isImage = ImageDetector.isImage(payload.getMimetype());
|
|
|
|
if (isImage) {
|
|
listImages.add(filesetDV);
|
|
} else {
|
|
listFiles.add(filesetDV);
|
|
}
|
|
}
|
|
|
|
subDocumentView.setListImages(listImages);
|
|
subDocumentView.setListFiles(listFiles);
|
|
|
|
// Reading Fileset _materializations / layers
|
|
listLayers = readGcubeSDILayersForFileset(filesetJSONPath, wholeSectionDoc);
|
|
|
|
subDocumentView.setListLayers(listLayers);
|
|
sectionView.addSubDocument(subDocumentView);
|
|
projectView.addSectionView(sectionView);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<GcubeProfilesMetadataForUCD> listProfilesBean = linkedMap_UCDId_gCubeProfiles
|
|
.get(theProjectDV.getProfileID());
|
|
|
|
com.jayway.jsonpath.Configuration configuration = com.jayway.jsonpath.Configuration.builder()
|
|
.jsonProvider(new JsonOrgJsonProvider()).build();
|
|
|
|
// Reading the Project according to list of Profile defined in the UCD
|
|
for (GcubeProfilesMetadataForUCD gcubeProfileMetaForUCD : listProfilesBean) {
|
|
|
|
GcubeProfileDV gcubeProfileDV = gcubeProfileMetaForUCD.getGcubeProfile();
|
|
SectionView sectionView = new SectionView();
|
|
sectionView.setSectionTitle(gcubeProfileDV.getSectionTitle());
|
|
LOG.debug("\n\nThe profile is: " + gcubeProfileDV);
|
|
// Building JSON/section full PATH and section name
|
|
String sectionJSONPath = "";
|
|
String parentPathFromProfile = gcubeProfileDV.getParentName() == null ? "" : gcubeProfileDV.getParentName();
|
|
String theSectionName = gcubeProfileDV.getSectionName();
|
|
|
|
if (theSectionName.compareTo(JSON_$_POINTER) == 0 || theSectionName.compareTo(JSON_$_POINTER + ".") == 0) {
|
|
sectionJSONPath = JSON_$_POINTER;
|
|
theSectionName = "";
|
|
} else {
|
|
sectionJSONPath = String.format("%s%s",
|
|
parentPathFromProfile.endsWith(".") ? parentPathFromProfile : parentPathFromProfile + ".",
|
|
theSectionName);
|
|
}
|
|
|
|
LOG.debug("The sectionJSONPath is: " + sectionJSONPath);
|
|
|
|
JsonPath theSectionJsonPath = null;
|
|
Object data = null;
|
|
try {
|
|
theSectionJsonPath = JsonPath.compile(sectionJSONPath);
|
|
data = theSectionJsonPath.read(theWholeProjectAsJSON, configuration);
|
|
} catch (Exception e) {
|
|
LOG.warn("Error on searching the section " + sectionJSONPath + " in the JSON Project: "
|
|
+ theWholeProjectAsJSON);
|
|
continue;
|
|
}
|
|
|
|
LOG.debug("Data is instace of: " + data.getClass());
|
|
LOG.debug("data to string: " + data.toString());
|
|
|
|
// Splitting the General Document in bson.Document according to list of
|
|
// GcubeProfiles
|
|
List<Document> listBSONDocument = new ArrayList<Document>();
|
|
if (data instanceof org.json.JSONObject) {
|
|
String jsonString = data.toString();
|
|
LOG.debug("the JSON to string: " + jsonString);
|
|
Document sectionDoc = Document.parse(jsonString);
|
|
boolean isAccessibleSection = isAccessibleSectionAccordingToPolicy(sectionDoc, sectionJSONPath,
|
|
username);
|
|
if (isAccessibleSection) {
|
|
listBSONDocument.add(sectionDoc);
|
|
}
|
|
|
|
} else if (data instanceof org.json.JSONArray) {
|
|
org.json.JSONArray dataArray = (org.json.JSONArray) data;
|
|
for (int i = 0; i < dataArray.length(); i++) {
|
|
String jsonString = dataArray.get(i).toString();
|
|
LOG.debug("the array " + i + " JSON to string: " + jsonString);
|
|
Document sectionDoc = Document.parse(jsonString);
|
|
boolean isAccessibleSection = isAccessibleSectionAccordingToPolicy(sectionDoc, sectionJSONPath,
|
|
username);
|
|
if (isAccessibleSection) {
|
|
listBSONDocument.add(sectionDoc);
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
LOG.debug("Result for " + gcubeProfileDV.getSectionName() + " is: " + listBSONDocument);
|
|
List<MetaDataProfileBean> theProfileBeans = gcubeProfileMetaForUCD.getListMetadataProfileBean();
|
|
MetaDataProfileBean theProfileBean = theProfileBeans.get(0);
|
|
|
|
// For each bson.Document creating the SubDocumentView
|
|
for (int i = 0; i < listBSONDocument.size(); i++) {
|
|
Document fromSectionDoc = listBSONDocument.get(i);
|
|
SubDocumentView subDocumentView = new SubDocumentView();
|
|
Document toSectionDoc = new Document();
|
|
// Filling the SubDocumentView metadata with the metadataField.getFieldName()
|
|
// read from the Profile
|
|
for (MetadataFieldWrapper metadataField : theProfileBean.getMetadataFields()) {
|
|
|
|
String theFieldName = metadataField.getFieldId() != null ? metadataField.getFieldId()
|
|
: metadataField.getFieldName();
|
|
LOG.debug("reading theFieldName: " + theFieldName);
|
|
Object theOBJFieldValue = fromSectionDoc.get(theFieldName);
|
|
|
|
// NB: Using ALWAYS THE metadataField.getFieldName() as LABEL
|
|
toSectionDoc = sanitizeDocumentValue(toSectionDoc, metadataField.getFieldName(), theOBJFieldValue);
|
|
|
|
}
|
|
String subToJSON = toSectionDoc.toJson();
|
|
LOG.debug("theSubSetionDoc is: " + subToJSON);
|
|
subDocumentView.setMetadataAsJSON(toSectionDoc.toJson());
|
|
|
|
// Reading filePaths
|
|
List<FilePathDV> filePaths = gcubeProfileDV.getFilePaths();
|
|
|
|
// READING fileset* field ACCORDING TO filePaths OF THE 'gcubeProfiles' CONFIG
|
|
if (filePaths != null) {
|
|
String fromSectionDocJSON = fromSectionDoc.toJson();
|
|
List<FilesetDV> listFiles = new ArrayList<FilesetDV>();
|
|
List<FilesetDV> listImages = new ArrayList<FilesetDV>();
|
|
List<GCubeSDIViewerLayerDV> listLayers = new ArrayList<GCubeSDIViewerLayerDV>();
|
|
for (FilePathDV filePath : filePaths) {
|
|
|
|
// 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());
|
|
for (Payload payload : listPayloads) {
|
|
PayloadDV payloadDV = ConvertToDataValueObjectModel.toPayloadDV(payload);
|
|
filesetDV.addPayloadDV(payloadDV);
|
|
boolean isImage = ImageDetector.isImage(payload.getMimetype());
|
|
|
|
if (isImage) {
|
|
listImages.add(filesetDV);
|
|
} else {
|
|
listFiles.add(filesetDV);
|
|
}
|
|
}
|
|
|
|
// Reading Fileset _materializations
|
|
listLayers = readGcubeSDILayersForFileset(filesetJSONPath, fromSectionDocJSON);
|
|
|
|
}
|
|
subDocumentView.setListFiles(listFiles);
|
|
subDocumentView.setListImages(listImages);
|
|
subDocumentView.setListLayers(listLayers);
|
|
}
|
|
|
|
sectionView.addSubDocument(subDocumentView);
|
|
|
|
}
|
|
|
|
projectView.addSectionView(sectionView);
|
|
}
|
|
|
|
return projectView;
|
|
}
|
|
|
|
/**
|
|
* Read payloads for fileset.
|
|
*
|
|
* @param filesetJSONPath the fileset JSON path
|
|
* @param sectionJSONDocument the section JSON document
|
|
* @return the list
|
|
*/
|
|
private static List<Payload> readPayloadsForFileset(String filesetJSONPath, String sectionJSONDocument) {
|
|
LOG.debug("readPayloadsForFileset called");
|
|
|
|
List<Payload> listPayloads = new ArrayList<Payload>();
|
|
String _payloadsJSONPath = String.format("%s.%s", filesetJSONPath, "_payloads");
|
|
try {
|
|
com.jayway.jsonpath.Configuration configuration = com.jayway.jsonpath.Configuration.builder()
|
|
.jsonProvider(new JsonOrgJsonProvider()).build();
|
|
|
|
LOG.info("Reading sectionPath at {} into section document {}", _payloadsJSONPath, sectionJSONDocument);
|
|
JsonPath theSectionPolycJsonPath = JsonPath.compile(_payloadsJSONPath);
|
|
Object _payloads = theSectionPolycJsonPath.read(sectionJSONDocument, configuration).toString();
|
|
|
|
if (_payloads instanceof String) {
|
|
String toStringPayloads = (String) _payloads;
|
|
LOG.trace("The _payloads is a String {}", toStringPayloads);
|
|
JSONArray jsonArray = new JSONArray(toStringPayloads);
|
|
for (int i = 0; i < jsonArray.length(); i++) {
|
|
Payload payloadDV = Serialization.read(jsonArray.getJSONObject(i).toString(), Payload.class);
|
|
listPayloads.add(payloadDV);
|
|
}
|
|
}
|
|
|
|
LOG.info("returning list of payloads {}", listPayloads);
|
|
} catch (Exception e) {
|
|
LOG.warn("Error on reading the JSON Path " + _payloadsJSONPath + " in the doc " + sectionJSONDocument, e);
|
|
}
|
|
|
|
return listPayloads;
|
|
|
|
}
|
|
|
|
private static List<GCubeSDIViewerLayerDV> readGcubeSDILayersForFileset(String materializationJSONPath,
|
|
String sectionJSONDocument) {
|
|
LOG.debug("readGcubeSDILayersForFileset called");
|
|
|
|
List<GCubeSDIViewerLayerDV> listSDILayers = new ArrayList<GCubeSDIViewerLayerDV>();
|
|
String _materializationsJSONPath = String.format("%s.%s", materializationJSONPath, "_materializations");
|
|
|
|
try {
|
|
com.jayway.jsonpath.Configuration configurationJSONSmart = com.jayway.jsonpath.Configuration.builder()
|
|
.jsonProvider(new JsonOrgJsonProvider()).build();
|
|
|
|
LOG.info("Reading sectionPath at {} into section document {}", _materializationsJSONPath,
|
|
sectionJSONDocument);
|
|
JsonPath theSectionPolycJsonPath = JsonPath.compile(_materializationsJSONPath);
|
|
Object _materializations = theSectionPolycJsonPath.read(sectionJSONDocument, configurationJSONSmart)
|
|
.toString();
|
|
|
|
if (_materializations instanceof String) {
|
|
String toStringMater = (String) _materializations;
|
|
LOG.trace("The _materializations is a String {}", toStringMater);
|
|
JSONArray jsonArray = new JSONArray(toStringMater);
|
|
for (int i = 0; i < jsonArray.length(); i++) {
|
|
// TODO THIS PART SHOULD BE REVISITED/OPTIMIZED
|
|
|
|
GCubeSDIViewerLayerDV gsdiLayer = new GCubeSDIViewerLayerDV();
|
|
JSONObject thJsonObject = jsonArray.getJSONObject(i);
|
|
try {
|
|
gsdiLayer.setType(thJsonObject.getString(_TYPE));
|
|
} catch (Exception e) {
|
|
LOG.warn("No " + _TYPE + " found", e);
|
|
}
|
|
String toSerializeJSONOBJ = jsonArray.getJSONObject(i).toString();
|
|
String jsonPath = null;
|
|
try {
|
|
jsonPath = String.format("%s.%s", JSON_$_POINTER, _BBOX);
|
|
BBOXDV bbox = JsonPath.using(configurationJSONSmart).parse(toSerializeJSONOBJ).read(jsonPath,
|
|
BBOXDV.class);
|
|
gsdiLayer.setBbox(bbox);
|
|
LOG.trace("bbox " + i + " is: " + bbox);
|
|
} catch (Exception e) {
|
|
LOG.warn(jsonPath + " error: ", e);
|
|
}
|
|
try {
|
|
jsonPath = String.format("%s.%s", JSON_$_POINTER, _OGC_LINKS_WMS);
|
|
String jsonString = JsonPath.using(configurationJSONSmart).parse(toSerializeJSONOBJ)
|
|
.read(jsonPath).toString();
|
|
Gson gson = new Gson();
|
|
HashMap map = gson.fromJson(jsonString, HashMap.class);
|
|
gsdiLayer.setOgcLinks(map);
|
|
LOG.trace("ogcLinks " + i + " is: " + map);
|
|
} catch (Exception e) {
|
|
LOG.warn(jsonPath + " error: ", e);
|
|
}
|
|
|
|
LOG.trace("gsdiLayer " + i + " is: " + gsdiLayer);
|
|
listSDILayers.add(gsdiLayer);
|
|
}
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
LOG.warn("Error on reading the JSON Path " + _materializationsJSONPath + " in the doc "
|
|
+ sectionJSONDocument, e);
|
|
}
|
|
LOG.info("returning list of layers {}", listSDILayers);
|
|
return listSDILayers;
|
|
|
|
}
|
|
|
|
/**
|
|
* Checks if is accessible section according to policy.
|
|
*
|
|
* @param section the section
|
|
* @param sectionJSONPath the section JSON path
|
|
* @param myLogin the my login
|
|
* @return true, if is accessible section according to policy
|
|
*/
|
|
private static boolean isAccessibleSectionAccordingToPolicy(Document section, String sectionJSONPath,
|
|
String myLogin) {
|
|
LOG.debug("isAccessibleSectionAccordingToPolicy called");
|
|
boolean isAccessible = true;
|
|
|
|
// Skipping the root, going to check the access_policy of subsections
|
|
if (sectionJSONPath.compareTo(JSON_$_POINTER) != 0) {
|
|
isAccessible = checkAccessPolicy(section.toJson(), myLogin);
|
|
}
|
|
|
|
return isAccessible;
|
|
}
|
|
|
|
/**
|
|
* Check access policy.
|
|
*
|
|
* @param sectionDocumentJSON the section document JSON
|
|
* @param myLogin the my login
|
|
* @return true, if successful
|
|
*/
|
|
private static boolean checkAccessPolicy(String sectionDocumentJSON, String myLogin) {
|
|
LOG.debug("checkAccessPolicy called");
|
|
// CHECKING THE POLICY
|
|
String accessPolicyPath = JSON_$_POINTER + "._access._policy";
|
|
boolean isAccessible = true;
|
|
try {
|
|
com.jayway.jsonpath.Configuration configuration = com.jayway.jsonpath.Configuration.builder()
|
|
.jsonProvider(new JsonOrgJsonProvider()).build();
|
|
|
|
LOG.info("Reading access policy at {} into section document {}", accessPolicyPath, sectionDocumentJSON);
|
|
JsonPath theSectionPolycJsonPath = JsonPath.compile(accessPolicyPath);
|
|
String _policy = theSectionPolycJsonPath.read(sectionDocumentJSON, configuration).toString();
|
|
LOG.info("The section {} has policy {}", accessPolicyPath, _policy);
|
|
isAccessible = GeportalCheckAccessPolicy.isAccessible(_policy, myLogin);
|
|
} catch (Exception e) {
|
|
LOG.error(accessPolicyPath + " not found. Check OK");
|
|
}
|
|
LOG.info("Is the section {} accessible? {}", sectionDocumentJSON, isAccessible);
|
|
return isAccessible;
|
|
}
|
|
|
|
/**
|
|
* Sanitize document value.
|
|
*
|
|
* @param toDoc the to doc
|
|
* @param fieldLabel the field label
|
|
* @param theObjectFieldValue the the object field value
|
|
* @return the document
|
|
*/
|
|
private static Document sanitizeDocumentValue(Document toDoc, String fieldLabel, Object theObjectFieldValue) {
|
|
|
|
if (theObjectFieldValue != null) {
|
|
if (theObjectFieldValue instanceof String) {
|
|
String toString = (String) theObjectFieldValue;
|
|
if (toString != null && !toString.isEmpty()) {
|
|
toDoc.append(fieldLabel, theObjectFieldValue);
|
|
} else {
|
|
LOG.debug("Skipping String field " + fieldLabel + " its value is null or empty");
|
|
}
|
|
|
|
} else if (theObjectFieldValue instanceof ArrayList) {
|
|
ArrayList toArrayList = (ArrayList) theObjectFieldValue;
|
|
if (toArrayList != null && !toArrayList.isEmpty()) {
|
|
toDoc.append(fieldLabel, theObjectFieldValue);
|
|
} else {
|
|
LOG.debug("Skipping ArrayList field " + fieldLabel + " its value is null or empty");
|
|
}
|
|
} else {
|
|
toDoc.append(fieldLabel, theObjectFieldValue);
|
|
}
|
|
} else {
|
|
LOG.debug("Skipping field " + fieldLabel + " its value is null or empty");
|
|
}
|
|
|
|
return toDoc;
|
|
}
|
|
|
|
/**
|
|
* Pretty print JSON.
|
|
*
|
|
* @param jsonString the json string
|
|
* @return the string
|
|
*/
|
|
private static String prettyPrintJSON(String jsonString) {
|
|
|
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
|
JsonObject jsonObject = new JsonParser().parse(jsonString).getAsJsonObject();
|
|
return gson.toJson(jsonObject);
|
|
}
|
|
|
|
public static void prettyPrintProjectView(ProjectView projectView) {
|
|
|
|
for (SectionView section : projectView.getListSections()) {
|
|
System.out.println("\n\n###### Section Title: " + section.getSectionTitle() + " ######");
|
|
int i = 1;
|
|
for (SubDocumentView subDocument : section.getListSubDocuments()) {
|
|
System.out.println("## " + SubDocumentView.class.getSimpleName() + " n." + i);
|
|
System.out.println("***** Metadata");
|
|
System.out.println(prettyPrintJSON(subDocument.getMetadataAsJSON()));
|
|
System.out.println("***** Files");
|
|
if (subDocument.getListFiles() != null) {
|
|
for (FilesetDV filesetDV : subDocument.getListFiles()) {
|
|
System.out.println("******* File Fileset name: " + filesetDV.getName());
|
|
for (PayloadDV payload : filesetDV.getListPayload()) {
|
|
System.out.println("********* Payload: " + payload);
|
|
}
|
|
}
|
|
}
|
|
System.out.println("***** Images");
|
|
if (subDocument.getListImages() != null) {
|
|
for (FilesetDV filesetDV : subDocument.getListImages()) {
|
|
System.out.println("******* Image Fileset name: " + filesetDV.getName());
|
|
for (PayloadDV payload : filesetDV.getListPayload()) {
|
|
System.out.println("********* Payload: " + payload);
|
|
}
|
|
}
|
|
}
|
|
System.out.println("***** Layers");
|
|
if (subDocument.getListLayers() != null) {
|
|
for (GCubeSDIViewerLayerDV layer : subDocument.getListLayers()) {
|
|
System.out.println("******* Layer type: " + layer.getType());
|
|
System.out.println("******* Layer: " + layer);
|
|
}
|
|
}
|
|
i++;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
}
|