ref 18096: DataMiner - HTML file does not open in view widget but in a new browser window

https://support.d4science.org/issues/18096

Fixed Content-Type in output files

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/DataMiner@182280 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2019-11-20 15:43:27 +00:00
parent b1fcb7a96f
commit 1b1117997e
3 changed files with 159 additions and 103 deletions

View File

@ -1,24 +1,36 @@
<ReleaseNotes> <ReleaseNotes>
<Changeset component="${groupId}.${artifactId}.1-5-8" date="2019-10-01"> <Changeset component="org.gcube.dataanalysis.dataminer.1-5-9"
date="2019-11-20">
<Change>Fixed Content-Type support for files in the results of
computations[ticket #18096]</Change>
</Changeset>
<Changeset component="org.gcube.dataanalysis.dataminer.1-5-8"
date="2019-10-01">
<Change>Fixed https link for output parameter [ticket #17659]</Change> <Change>Fixed https link for output parameter [ticket #17659]</Change>
</Changeset> </Changeset>
<Changeset component="${groupId}.${artifactId}.1-5-7" date="2019-03-01"> <Changeset component="org.gcube.dataanalysis.dataminer.1-5-7"
date="2019-03-01">
<Change>Updated https support [ticket #13024]</Change> <Change>Updated https support [ticket #13024]</Change>
</Changeset> </Changeset>
<Changeset component="${groupId}.${artifactId}.1-5-6" date="2018-12-13"> <Changeset component="org.gcube.dataanalysis.dataminer.1-5-6"
date="2018-12-13">
<Change>Added https support [ticket #13024]</Change> <Change>Added https support [ticket #13024]</Change>
</Changeset> </Changeset>
<Changeset component="${groupId}.${artifactId}.1-5-2" date="2017-12-13"> <Changeset component="org.gcube.dataanalysis.dataminer.1-5-2"
date="2017-12-13">
<Change>added the right extension on output file</Change> <Change>added the right extension on output file</Change>
<Change>lock file created on execution</Change> <Change>lock file created on execution</Change>
</Changeset> </Changeset>
<Changeset component="${groupId}.${artifactId}.1-5-1" date="2017-09-14"> <Changeset component="org.gcube.dataanalysis.dataminer.1-5-1"
date="2017-09-14">
<Change>added accounting on algorithm execution</Change> <Change>added accounting on algorithm execution</Change>
</Changeset> </Changeset>
<Changeset component="${groupId}.${artifactId}.1-5-0" date="2017-07-31"> <Changeset component="org.gcube.dataanalysis.dataminer.1-5-0"
date="2017-07-31">
<Change>service interface classes moved to wps project</Change> <Change>service interface classes moved to wps project</Change>
</Changeset> </Changeset>
<Changeset component="${groupId}.${artifactId}.1-1-0" date="2016-10-03"> <Changeset component="org.gcube.dataanalysis.dataminer.1-1-0"
date="2016-10-03">
<Change>First Release</Change> <Change>First Release</Change>
</Changeset> </Changeset>
</ReleaseNotes> </ReleaseNotes>

19
pom.xml
View File

@ -8,7 +8,7 @@
</parent> </parent>
<groupId>org.gcube.dataanalysis</groupId> <groupId>org.gcube.dataanalysis</groupId>
<artifactId>dataminer</artifactId> <artifactId>dataminer</artifactId>
<version>1.5.8-SNAPSHOT</version> <version>1.5.9-SNAPSHOT</version>
<name>dataminer</name> <name>dataminer</name>
<description>An e-Infrastructure service providing state-of-the art DataMining algorithms and ecological modelling approaches under the Web Processing Service (WPS) standard.</description> <description>An e-Infrastructure service providing state-of-the art DataMining algorithms and ecological modelling approaches under the Web Processing Service (WPS) standard.</description>
<scm> <scm>
@ -125,25 +125,14 @@
<version>4.11</version> <version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- <dependency> <groupId>org.gcube.common</groupId> <artifactId>common-authorization</artifactId>
</dependency> <dependency> <groupId>org.gcube.core</groupId> <artifactId>common-scope</artifactId>
</dependency> -->
<dependency> <dependency>
<groupId>javassist</groupId> <groupId>javassist</groupId>
<artifactId>javassist</artifactId> <artifactId>javassist</artifactId>
<version>3.12.1.GA</version> <version>3.12.1.GA</version>
</dependency> </dependency>
<!-- <dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency> -->
<dependency > <dependency >
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
<artifactId>storagehub-client-library</artifactId> <artifactId>storagehub-client-library</artifactId>

View File

@ -21,7 +21,7 @@ import org.slf4j.LoggerFactory;
public class OutputsManager { public class OutputsManager {
private static Logger LOGGER = LoggerFactory.getLogger(OutputsManager.class); private static Logger LOGGER = LoggerFactory.getLogger(OutputsManager.class);
private AlgorithmConfiguration config; private AlgorithmConfiguration config;
private List<File> generatedFiles = new ArrayList<File>(); private List<File> generatedFiles = new ArrayList<File>();
@ -29,7 +29,7 @@ public class OutputsManager {
private IClient storageclient; private IClient storageclient;
private String computationsession; private String computationsession;
private List<StoredData> provenanceData = new ArrayList<StoredData>(); private List<StoredData> provenanceData = new ArrayList<StoredData>();
public List<StoredData> getProvenanceData() { public List<StoredData> getProvenanceData() {
return provenanceData; return provenanceData;
} }
@ -37,7 +37,7 @@ public class OutputsManager {
public List<File> getGeneratedData() { public List<File> getGeneratedData() {
return generatedFiles; return generatedFiles;
} }
public List<File> getGeneratedFiles() { public List<File> getGeneratedFiles() {
return generatedFiles; return generatedFiles;
} }
@ -46,12 +46,13 @@ public class OutputsManager {
return generatedTables; return generatedTables;
} }
public OutputsManager(AlgorithmConfiguration config,String computationsession) { public OutputsManager(AlgorithmConfiguration config, String computationsession) {
this.config = config; this.config = config;
this.computationsession=computationsession; this.computationsession = computationsession;
} }
public LinkedHashMap<String, Object> createOutput(StatisticalType prioroutput, StatisticalType posterioroutput) throws Exception { public LinkedHashMap<String, Object> createOutput(StatisticalType prioroutput, StatisticalType posterioroutput)
throws Exception {
LinkedHashMap<String, Object> outputs = new LinkedHashMap<String, Object>(); LinkedHashMap<String, Object> outputs = new LinkedHashMap<String, Object>();
@ -66,10 +67,10 @@ public class OutputsManager {
StatisticalTypeToWPSType postconverter = new StatisticalTypeToWPSType(); StatisticalTypeToWPSType postconverter = new StatisticalTypeToWPSType();
postconverter.convert2WPSType(posterioroutput, false, config); postconverter.convert2WPSType(posterioroutput, false, config);
generatedFiles.addAll(postconverter.getGeneratedFiles()); generatedFiles.addAll(postconverter.getGeneratedFiles());
LOGGER.debug("Generated Files "+generatedFiles); LOGGER.debug("Generated Files " + generatedFiles);
generatedTables.addAll(postconverter.getGeneratedTables()); generatedTables.addAll(postconverter.getGeneratedTables());
LOGGER.debug("Generated Tables "+generatedFiles); LOGGER.debug("Generated Tables " + generatedFiles);
LinkedHashMap<String, IOWPSInformation> postOutput = postconverter.outputSet; LinkedHashMap<String, IOWPSInformation> postOutput = postconverter.outputSet;
LinkedHashMap<String, IOWPSInformation> ndoutput = new LinkedHashMap<String, IOWPSInformation>(); LinkedHashMap<String, IOWPSInformation> ndoutput = new LinkedHashMap<String, IOWPSInformation>();
@ -102,21 +103,23 @@ public class OutputsManager {
if (ConfigurationManager.useStorage()) { if (ConfigurationManager.useStorage()) {
if (postInfo.getLocalMachineContent() != null) { if (postInfo.getLocalMachineContent() != null) {
// return the url from storage manager // return the url from storage manager
String storageurl = uploadFileOnStorage(postInfo.getLocalMachineContent(), postInfo.getMimetype()); String storageurl = uploadFileOnStorage(postInfo.getLocalMachineContent(),
postInfo.getMimetype());
postInfo.setContent(storageurl); postInfo.setContent(storageurl);
} }
} }
/* /*
else if (postInfo.getLocalMachineContent() != null) { * else if (postInfo.getLocalMachineContent() != null) { String
String url = "<wps:Reference mimeType=\""+postInfo.getMimetype()+"\" xlink:href=\""+postInfo.getContent()+"\" method=\"GET\"/>"; * url = "<wps:Reference mimeType=\""+postInfo.getMimetype()
LOGGER.debug("Reference URL: " + url); * +"\" xlink:href=\""+postInfo.getContent()
outputs.put(okey, url); * +"\" method=\"GET\"/>"; LOGGER.debug("Reference URL: " +
} * url); outputs.put(okey, url); } else
else*/ */
if (info != null) { if (info != null) {
LOGGER.debug("Found a corresponding output: " + okey); LOGGER.debug("Found a corresponding output: " + okey);
outputs.put(okey, postInfo.getContent()); outputs.put(okey, postInfo.getContent());
//add link to the file also among the non deterministic output // add link to the file also among the non deterministic
// output
if (postInfo.getLocalMachineContent() != null) { if (postInfo.getLocalMachineContent() != null) {
ndoutput.put(okey, postInfo); ndoutput.put(okey, postInfo);
} }
@ -129,23 +132,23 @@ public class OutputsManager {
System.gc(); System.gc();
} }
XmlObject ndxml = generateNonDeterministicOutput(ndoutput); XmlObject ndxml = generateNonDeterministicOutput(ndoutput);
outputs.put("non_deterministic_output", ndxml); outputs.put("non_deterministic_output", ndxml);
//safety check for declared output, i.e. a priori output // safety check for declared output, i.e. a priori output
for (String pkey:priorOutput.keySet()){ for (String pkey : priorOutput.keySet()) {
if (outputs.get(pkey)==null){ if (outputs.get(pkey) == null) {
LOGGER.debug("Safety check: adding empty string for " + pkey+ " of type "+priorOutput.get(pkey).getClassname()); LOGGER.debug("Safety check: adding empty string for " + pkey + " of type "
+ priorOutput.get(pkey).getClassname());
outputs.put(pkey, ""); outputs.put(pkey, "");
} }
} }
LOGGER.debug("OutputsManager outputs "+outputs); LOGGER.debug("OutputsManager outputs " + outputs);
return outputs; return outputs;
} }
private void saveProvenanceData(IOWPSInformation info) {
private void saveProvenanceData(IOWPSInformation info){
String name = info.getName(); String name = info.getName();
String id = info.getName(); String id = info.getName();
DataProvenance provenance = DataProvenance.COMPUTED; DataProvenance provenance = DataProvenance.COMPUTED;
@ -153,59 +156,97 @@ public class OutputsManager {
String operator = config.getAgent(); String operator = config.getAgent();
String computationId = computationsession; String computationId = computationsession;
String type = info.getMimetype(); String type = info.getMimetype();
/* if (info.getLocalMachineContent() != null) { /*
type = StoredType.DATA; * if (info.getLocalMachineContent() != null) { type = StoredType.DATA;
} * }
*/ */
String payload = info.getContent(); String payload = info.getContent();
StoredData data = new StoredData(name, info.getAbstractStr(),id, provenance, creationDate, operator, computationId, type,payload,config.getGcubeScope()); StoredData data = new StoredData(name, info.getAbstractStr(), id, provenance, creationDate, operator,
computationId, type, payload, config.getGcubeScope());
provenanceData.add(data); provenanceData.add(data);
} }
private void prepareForStoring() { private void prepareForStoring() {
LOGGER.debug("Preparing storage client"); LOGGER.debug("Preparing storage client");
//String scope = config.getGcubeScope(); // String scope = config.getGcubeScope();
//ScopeProvider.instance.set(scope); // ScopeProvider.instance.set(scope);
String serviceClass = "WPS"; String serviceClass = "WPS";
String serviceName = "wps.synch"; String serviceName = "wps.synch";
String owner = config.getParam(ConfigurationManager.serviceUserNameParameterVariable); String owner = config.getParam(ConfigurationManager.serviceUserNameParameterVariable);
storageclient = new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, MemoryType.VOLATILE).getClient(); storageclient = new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, MemoryType.VOLATILE)
.getClient();
LOGGER.debug("Storage client ready"); LOGGER.debug("Storage client ready");
} }
private String uploadFileOnStorage(String localfile, String mimetype) throws Exception { private String uploadFileOnStorage(String localfile, String mimetype) throws Exception {
LOGGER.debug("Storing->Start uploading on storage the following file: " + localfile); LOGGER.debug("Storing->Start uploading on storage the following file: " + localfile);
File localFile = new File(localfile); File localFile = new File(localfile);
String remotef = "/wps_synch_output/" +config.getAgent()+"/"+computationsession+"/"+ localFile.getName(); String remotef = "/wps_synch_output/" + config.getAgent() + "/" + computationsession + "/"
storageclient.put(true).LFile(localfile).RFile(remotef); + localFile.getName();
String contentType=retrieveContentType(localfile);
LOGGER.debug("Retrieved Content-Type: "+contentType);
if(contentType==null||contentType.isEmpty()){
storageclient.put(true).LFile(localfile).RFile(remotef);
} else {
storageclient.put(true,contentType).LFile(localfile).RFile(remotef);
}
String url = storageclient.getHttpsUrl().RFile(remotef); String url = storageclient.getHttpsUrl().RFile(remotef);
/* /*
if (config.getGcubeScope().startsWith("/gcube")) * if (config.getGcubeScope().startsWith("/gcube")) url =
url = "http://data-d.d4science.org/uri-resolver/smp?smp-uri=" + url + "&fileName=" + localFile.getName() + "&contentType=" + mimetype; * "http://data-d.d4science.org/uri-resolver/smp?smp-uri=" + url +
else * "&fileName=" + localFile.getName() + "&contentType=" + mimetype; else
url = "http://data.d4science.org/uri-resolver/smp?smp-uri=" + url+ "&fileName=" + localFile.getName() + "&contentType=" + mimetype; * url = "http://data.d4science.org/uri-resolver/smp?smp-uri=" + url+
*/ * "&fileName=" + localFile.getName() + "&contentType=" + mimetype;
*/
LOGGER.info("Storing->Uploading finished - URL: " + url); LOGGER.info("Storing->Uploading finished - URL: " + url);
return url; return url;
} }
private String retrieveContentType(String fileName) {
String contentType=null;
if (fileName != null && !fileName.isEmpty()) {
String fileNameLowerCase = fileName.toLowerCase();
if (fileNameLowerCase.endsWith(".html") || fileNameLowerCase.endsWith(".htm")) {
contentType="text/html";
} else {
if (fileNameLowerCase.endsWith(".pdf")) {
contentType="application/pdf";
} else {
if (fileNameLowerCase.endsWith(".log") || fileNameLowerCase.endsWith(".txt")) {
contentType="text/plain";
} else {
if (fileNameLowerCase.endsWith(".json")) {
contentType="application/json";
} else {
}
}
}
}
}
return contentType;
}
public String cleanTagString(String tag) { public String cleanTagString(String tag) {
return tag.replace(" ", "_").replaceAll("[\\]\\[!\"#$%&'()*+,\\./:;<=>?@\\^`{|}~-]", ""); return tag.replace(" ", "_").replaceAll("[\\]\\[!\"#$%&'()*+,\\./:;<=>?@\\^`{|}~-]", "");
} }
public XmlObject generateNonDeterministicOutputPlain(LinkedHashMap<String, IOWPSInformation> ndoutput) throws Exception { public XmlObject generateNonDeterministicOutputPlain(LinkedHashMap<String, IOWPSInformation> ndoutput)
String XMLString = "<gml:featureMember xmlns:gml=\"http://www.opengis.net/gml\" xmlns:d4science=\"http://www.d4science.org\">\n" + " <d4science:output fid=\"outputcollection\">\n"; throws Exception {
String XMLString = "<gml:featureMember xmlns:gml=\"http://www.opengis.net/gml\" xmlns:d4science=\"http://www.d4science.org\">\n"
+ " <d4science:output fid=\"outputcollection\">\n";
for (String key : ndoutput.keySet()) { for (String key : ndoutput.keySet()) {
IOWPSInformation info = ndoutput.get(key); IOWPSInformation info = ndoutput.get(key);
String payload = info.getContent(); String payload = info.getContent();
String mimetype = info.getMimetype(); String mimetype = info.getMimetype();
XMLString += " <d4science:k_" + cleanTagString(key) + ">" + " <d4science:Data><![CDATA[" + payload + "]]></d4science:Data>\n" + " <d4science:Description><![CDATA[" + (info.getAbstractStr() != null ? info.getAbstractStr() : "") + "]]></d4science:Description>\n" + " <d4science:MimeType>" + mimetype + "</d4science:MimeType>\n" + " </d4science:k_" + cleanTagString(key) + ">\n"; XMLString += " <d4science:k_" + cleanTagString(key) + ">" + " <d4science:Data><![CDATA["
+ payload + "]]></d4science:Data>\n" + " <d4science:Description><![CDATA["
+ (info.getAbstractStr() != null ? info.getAbstractStr() : "") + "]]></d4science:Description>\n"
+ " <d4science:MimeType>" + mimetype + "</d4science:MimeType>\n" + " </d4science:k_"
+ cleanTagString(key) + ">\n";
} }
XMLString += " </d4science:output>\n" + "</gml:featureMember>\n"; XMLString += " </d4science:output>\n" + "</gml:featureMember>\n";
@ -219,16 +260,21 @@ public class OutputsManager {
return xmlData; return xmlData;
} }
public XmlObject generateNonDeterministicOutputCollection(LinkedHashMap<String, IOWPSInformation> ndoutput) throws Exception { public XmlObject generateNonDeterministicOutputCollection(LinkedHashMap<String, IOWPSInformation> ndoutput)
String XMLString = "<ogr:FeatureCollection xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://ogr.maptools.org/ result_8751.xsd\" xmlns:ogr=\"http://ogr.maptools.org/\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns:d4science=\"http://www.d4science.org\">" + throws Exception {
"\n<gml:featureMember>\n" + " <ogr:Result fid=\"F0\">\n" + String XMLString = "<ogr:FeatureCollection xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://ogr.maptools.org/ result_8751.xsd\" xmlns:ogr=\"http://ogr.maptools.org/\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns:d4science=\"http://www.d4science.org\">"
" <d4science:output fid=\"outputcollection\">\n"; + "\n<gml:featureMember>\n" + " <ogr:Result fid=\"F0\">\n"
+ " <d4science:output fid=\"outputcollection\">\n";
for (String key : ndoutput.keySet()) { for (String key : ndoutput.keySet()) {
IOWPSInformation info = ndoutput.get(key); IOWPSInformation info = ndoutput.get(key);
String payload = info.getContent(); String payload = info.getContent();
String mimetype = info.getMimetype(); String mimetype = info.getMimetype();
XMLString += " <d4science:k_" + cleanTagString(key) + ">" + " <d4science:Data><![CDATA[" + payload + "]]></d4science:Data>\n" + " <d4science:Description><![CDATA[" + (info.getAbstractStr() != null ? info.getAbstractStr() : "") + "]]></d4science:Description>\n" + " <d4science:MimeType>" + mimetype + "</d4science:MimeType>\n" + " </d4science:k_" + cleanTagString(key) + ">\n"; XMLString += " <d4science:k_" + cleanTagString(key) + ">" + " <d4science:Data><![CDATA["
+ payload + "]]></d4science:Data>\n" + " <d4science:Description><![CDATA["
+ (info.getAbstractStr() != null ? info.getAbstractStr() : "") + "]]></d4science:Description>\n"
+ " <d4science:MimeType>" + mimetype + "</d4science:MimeType>\n" + " </d4science:k_"
+ cleanTagString(key) + ">\n";
} }
XMLString += " </d4science:output>\n" + " </ogr:Result>\n</gml:featureMember>\n</ogr:FeatureCollection>"; XMLString += " </d4science:output>\n" + " </ogr:Result>\n</gml:featureMember>\n</ogr:FeatureCollection>";
@ -241,37 +287,46 @@ public class OutputsManager {
return xmlData; return xmlData;
} }
public XmlObject generateNonDeterministicOutput(LinkedHashMap<String, IOWPSInformation> ndoutput) throws Exception { public XmlObject generateNonDeterministicOutput(LinkedHashMap<String, IOWPSInformation> ndoutput) throws Exception {
if (ndoutput.size()==0) if (ndoutput.size() == 0)
return null; return null;
String XMLString = "<ogr:FeatureCollection xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://ogr.maptools.org/ result_8751.xsd\" xmlns:ogr=\"http://ogr.maptools.org/\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns:d4science=\"http://www.d4science.org\">" + String XMLString = "<ogr:FeatureCollection xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://ogr.maptools.org/ result_8751.xsd\" xmlns:ogr=\"http://ogr.maptools.org/\" xmlns:gml=\"http://www.opengis.net/gml\" xmlns:d4science=\"http://www.d4science.org\">"
"\n<gml:featureMember>\n"; + "\n<gml:featureMember>\n";
int count = 0; int count = 0;
for (String key : ndoutput.keySet()) { for (String key : ndoutput.keySet()) {
IOWPSInformation info = ndoutput.get(key); IOWPSInformation info = ndoutput.get(key);
String payload = info.getContent(); String payload = info.getContent();
String mimetype = info.getMimetype(); String mimetype = info.getMimetype();
String abstractStr = info.getAbstractStr(); String abstractStr = info.getAbstractStr();
LOGGER.debug("IOWPS Information [name="+info.getName()+", abstr="+info.getAbstractStr()+", content="+info.getContent()+", def="+info.getDefaultVal()+"]"); LOGGER.debug("IOWPS Information [name=" + info.getName() + ", abstr=" + info.getAbstractStr() + ", content="
+ info.getContent() + ", def=" + info.getDefaultVal() + "]");
if ((abstractStr==null || abstractStr.trim().length()==0) && (payload!= null && payload.trim().length()>0))
if ((abstractStr == null || abstractStr.trim().length() == 0)
&& (payload != null && payload.trim().length() > 0))
abstractStr = info.getName(); abstractStr = info.getName();
else if (abstractStr == null) else if (abstractStr == null)
abstractStr = ""; abstractStr = "";
//geospatialized // geospatialized
// XMLString += " <ogr:Result fid=\"F" + count+ "\">" + "<ogr:geometryProperty><gml:Point><gml:coordinates>0,0</gml:coordinates></gml:Point></ogr:geometryProperty>"+ " <d4science:Data><![CDATA[" + payload + "]]></d4science:Data>\n" + " <d4science:Description><![CDATA[" + (info.getAbstractStr() != null ? info.getAbstractStr() : "") + "]]></d4science:Description>\n" + " <d4science:MimeType>" + mimetype + "</d4science:MimeType>\n" + " </ogr:Result>\n"; // XMLString += " <ogr:Result fid=\"F" + count+ "\">" +
XMLString += " <ogr:Result fid=\"F" + count+ "\">" + " <d4science:Data><![CDATA[" + payload + "]]></d4science:Data>\n" + " <d4science:Description><![CDATA[" + abstractStr + "]]></d4science:Description>\n" + " <d4science:MimeType>" + mimetype + "</d4science:MimeType>\n" + " </ogr:Result>\n"; // "<ogr:geometryProperty><gml:Point><gml:coordinates>0,0</gml:coordinates></gml:Point></ogr:geometryProperty>"+
// " <d4science:Data><![CDATA[" + payload + "]]></d4science:Data>\n"
// + " <d4science:Description><![CDATA[" + (info.getAbstractStr() !=
// null ? info.getAbstractStr() : "") +
// "]]></d4science:Description>\n" + " <d4science:MimeType>" +
// mimetype + "</d4science:MimeType>\n" + " </ogr:Result>\n";
XMLString += " <ogr:Result fid=\"F" + count + "\">" + " <d4science:Data><![CDATA[" + payload
+ "]]></d4science:Data>\n" + " <d4science:Description><![CDATA[" + abstractStr
+ "]]></d4science:Description>\n" + " <d4science:MimeType>" + mimetype
+ "</d4science:MimeType>\n" + " </ogr:Result>\n";
count++; count++;
} }
XMLString += " </gml:featureMember>\n</ogr:FeatureCollection>"; XMLString += " </gml:featureMember>\n</ogr:FeatureCollection>";
LOGGER.debug("Non deterministic output: " + XMLString); LOGGER.debug("Non deterministic output: " + XMLString);
XmlObject xmlData = XmlObject.Factory.newInstance(); XmlObject xmlData = XmlObject.Factory.newInstance();
@ -281,12 +336,12 @@ public class OutputsManager {
return xmlData; return xmlData;
} }
public void shutdown(){ public void shutdown() {
try{ try {
storageclient.close(); storageclient.close();
}catch(Exception e){ } catch (Exception e) {
} }
} }
} }