git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/data-miner-manager-cl@179802 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
924ecdbdb9
commit
54dacbf31c
|
@ -15,23 +15,6 @@ import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import net.opengis.ows.x11.OperationDocument.Operation;
|
|
||||||
import net.opengis.wps.x100.CapabilitiesDocument;
|
|
||||||
import net.opengis.wps.x100.ComplexDataType;
|
|
||||||
import net.opengis.wps.x100.ExecuteDocument;
|
|
||||||
import net.opengis.wps.x100.ExecuteResponseDocument;
|
|
||||||
import net.opengis.wps.x100.ExecuteResponseDocument.ExecuteResponse.ProcessOutputs;
|
|
||||||
import net.opengis.wps.x100.InputDescriptionType;
|
|
||||||
import net.opengis.wps.x100.InputType;
|
|
||||||
import net.opengis.wps.x100.OutputDataType;
|
|
||||||
import net.opengis.wps.x100.OutputDescriptionType;
|
|
||||||
import net.opengis.wps.x100.ProcessBriefType;
|
|
||||||
import net.opengis.wps.x100.ProcessDescriptionType;
|
|
||||||
import net.opengis.wps.x100.ResponseDocumentType;
|
|
||||||
import net.opengis.wps.x100.StatusType;
|
|
||||||
import net.opengis.wps.x100.SupportedComplexDataInputType;
|
|
||||||
import net.opengis.wps.x100.impl.ExecuteResponseDocumentImpl;
|
|
||||||
|
|
||||||
import org.apache.xmlbeans.XmlString;
|
import org.apache.xmlbeans.XmlString;
|
||||||
import org.gcube.data.analysis.dataminermanagercl.server.dmservice.wps.ProcessInformations;
|
import org.gcube.data.analysis.dataminermanagercl.server.dmservice.wps.ProcessInformations;
|
||||||
import org.gcube.data.analysis.dataminermanagercl.server.dmservice.wps.ResponseWPS;
|
import org.gcube.data.analysis.dataminermanagercl.server.dmservice.wps.ResponseWPS;
|
||||||
|
@ -70,6 +53,23 @@ import org.w3c.dom.NamedNodeMap;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
|
|
||||||
|
import net.opengis.ows.x11.OperationDocument.Operation;
|
||||||
|
import net.opengis.wps.x100.CapabilitiesDocument;
|
||||||
|
import net.opengis.wps.x100.ComplexDataType;
|
||||||
|
import net.opengis.wps.x100.ExecuteDocument;
|
||||||
|
import net.opengis.wps.x100.ExecuteResponseDocument;
|
||||||
|
import net.opengis.wps.x100.ExecuteResponseDocument.ExecuteResponse.ProcessOutputs;
|
||||||
|
import net.opengis.wps.x100.InputDescriptionType;
|
||||||
|
import net.opengis.wps.x100.InputType;
|
||||||
|
import net.opengis.wps.x100.OutputDataType;
|
||||||
|
import net.opengis.wps.x100.OutputDescriptionType;
|
||||||
|
import net.opengis.wps.x100.ProcessBriefType;
|
||||||
|
import net.opengis.wps.x100.ProcessDescriptionType;
|
||||||
|
import net.opengis.wps.x100.ResponseDocumentType;
|
||||||
|
import net.opengis.wps.x100.StatusType;
|
||||||
|
import net.opengis.wps.x100.SupportedComplexDataInputType;
|
||||||
|
import net.opengis.wps.x100.impl.ExecuteResponseDocumentImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Client 4 WPS Service
|
* Client 4 WPS Service
|
||||||
*
|
*
|
||||||
|
@ -224,7 +224,6 @@ public class SClient4WPS extends SClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Operator getOperatorById(String id) throws Exception {
|
public Operator getOperatorById(String id) throws Exception {
|
||||||
return getOperatorById(id, false);
|
return getOperatorById(id, false);
|
||||||
|
@ -374,7 +373,6 @@ public class SClient4WPS extends SClient {
|
||||||
return operatorsClass;
|
return operatorsClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private ProcessInformations describeProcess(String processId) throws ServiceException {
|
private ProcessInformations describeProcess(String processId) throws ServiceException {
|
||||||
return describeProcess(processId, null);
|
return describeProcess(processId, null);
|
||||||
}
|
}
|
||||||
|
@ -483,8 +481,13 @@ public class SClient4WPS extends SClient {
|
||||||
for (OutputDescriptionType odt : odts) {
|
for (OutputDescriptionType odt : odts) {
|
||||||
// executeBuilder.setMimeTypeForOutput("text/xml",
|
// executeBuilder.setMimeTypeForOutput("text/xml",
|
||||||
// "result");
|
// "result");
|
||||||
if (odt.isSetComplexOutput())
|
|
||||||
|
if (odt.isSetComplexOutput()) {
|
||||||
executeBuilder.setMimeTypeForOutput("text/xml", odt.getIdentifier().getStringValue());
|
executeBuilder.setMimeTypeForOutput("text/xml", odt.getIdentifier().getStringValue());
|
||||||
|
if (odt.getIdentifier().getStringValue().compareTo("non_deterministic_output") != 0) {
|
||||||
|
executeBuilder.setAsReference(odt.getIdentifier().getStringValue(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.debug("Execute Process-> Warning, no xml structured objects will be provided: "
|
logger.debug("Execute Process-> Warning, no xml structured objects will be provided: "
|
||||||
|
@ -506,6 +509,14 @@ public class SClient4WPS extends SClient {
|
||||||
documentType.setStoreExecuteResponse(true);
|
documentType.setStoreExecuteResponse(true);
|
||||||
documentType.setStatus(true);
|
documentType.setStatus(true);
|
||||||
documentType.setLineage(false);
|
documentType.setLineage(false);
|
||||||
|
/*
|
||||||
|
* DocumentOutputDefinitionType[]
|
||||||
|
* documentOutputDefinitionType=documentType.getOutputArray();
|
||||||
|
* for(DocumentOutputDefinitionType
|
||||||
|
* dodt:documentOutputDefinitionType){
|
||||||
|
* dodt.getIdentifier().getStringValue()
|
||||||
|
* dodt.setAsReference(true); }
|
||||||
|
*/
|
||||||
execute.getExecute().getResponseForm().setResponseDocument(documentType);
|
execute.getExecute().getResponseForm().setResponseDocument(documentType);
|
||||||
}
|
}
|
||||||
Object responseObject = wpsClient.execute(wpsProcessingServlet, execute);
|
Object responseObject = wpsClient.execute(wpsProcessingServlet, execute);
|
||||||
|
@ -1109,8 +1120,28 @@ public class SClient4WPS extends SClient {
|
||||||
|
|
||||||
for (OutputDataType out : outputData) {
|
for (OutputDataType out : outputData) {
|
||||||
String outputID = out.getIdentifier().getStringValue();
|
String outputID = out.getIdentifier().getStringValue();
|
||||||
|
logger.debug("Output Identifier: " + outputID);
|
||||||
|
if (out.isSetData()) {
|
||||||
|
logger.debug("Is Data");
|
||||||
|
readOutputOfTypeData(outputParameters, outputResource, out, outputID);
|
||||||
|
} else {
|
||||||
|
if(out.isSetReference()){
|
||||||
|
logger.debug("Is Reference: "+out.getReference());
|
||||||
|
logger.debug("This parameter is not recovered");
|
||||||
|
} else {
|
||||||
|
logger.debug("Unknow type, this parameter is not recovered");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void readOutputOfTypeData(Map<String, Parameter> outputParameters, Map<String, Resource> outputResource,
|
||||||
|
OutputDataType out, String outputID) {
|
||||||
String value = "";
|
String value = "";
|
||||||
if (out.getData().isSetLiteralData()) {
|
if (out.getData().isSetLiteralData()) {
|
||||||
|
logger.debug("Is Literal Data");
|
||||||
value = out.getData().getLiteralData().getStringValue();
|
value = out.getData().getLiteralData().getStringValue();
|
||||||
Parameter paramLiteral = outputParameters.get(outputID);
|
Parameter paramLiteral = outputParameters.get(outputID);
|
||||||
if (paramLiteral != null) {
|
if (paramLiteral != null) {
|
||||||
|
@ -1122,6 +1153,7 @@ public class SClient4WPS extends SClient {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (out.getData().isSetComplexData()) {
|
if (out.getData().isSetComplexData()) {
|
||||||
|
logger.debug("Is Complex Data");
|
||||||
if (out.getReference() != null) {
|
if (out.getReference() != null) {
|
||||||
value = out.getReference().getHref();
|
value = out.getReference().getHref();
|
||||||
Parameter paramComplexData = outputParameters.get(outputID);
|
Parameter paramComplexData = outputParameters.get(outputID);
|
||||||
|
@ -1234,13 +1266,12 @@ public class SClient4WPS extends SClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
logger.debug("Not is Literal or Complex");
|
||||||
value = out.getData().getLiteralData().getStringValue();
|
value = out.getData().getLiteralData().getStringValue();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String cancelComputation(ComputationId computationId) throws ServiceException {
|
public String cancelComputation(ComputationId computationId) throws ServiceException {
|
||||||
|
|
Loading…
Reference in New Issue