integrated with new dataminer-invocation-model
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@176038 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8f808293fd
commit
ef5e8b2c90
|
@ -4,6 +4,9 @@
|
|||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<dependent-module archiveName="dataminer-invocation-model-0.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/dataminer-invocation-model/dataminer-invocation-model">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="context-root" value="uri-resolver"/>
|
||||
<property name="java-output-path" value="/uri-resolver/target/classes"/>
|
||||
</wb-module>
|
||||
|
|
|
@ -7,7 +7,6 @@ import static org.gcube.common.authorization.client.Constants.authorizationServi
|
|||
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
||||
import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -99,7 +98,7 @@ public class AnalyticsCreateResolver {
|
|||
DataMinerInvocation jsonRequest = null;
|
||||
try {
|
||||
|
||||
jsonRequest = DataMinerInvocationManager.getInstance().unmarshaling(IOUtils.toInputStream(body), org.gcube.data.analysis.dminvocation.MediaType.ApplicationJSON, true);
|
||||
jsonRequest = DataMinerInvocationManager.getInstance().unmarshalingJSON(IOUtils.toInputStream(body), true);
|
||||
}
|
||||
catch (IOException | JAXBException | SAXException e1) {
|
||||
logger.error("The body is not a valid DataMinerInvocation JSON request",e1);
|
||||
|
@ -147,9 +146,9 @@ public class AnalyticsCreateResolver {
|
|||
File tempInvocationFile = null;
|
||||
try {
|
||||
|
||||
ByteArrayOutputStream xmlByteArray = DataMinerInvocationManager.getInstance().marshaling(jsonRequest, org.gcube.data.analysis.dminvocation.MediaType.ApplicationXML, true);
|
||||
String xmlRequest = DataMinerInvocationManager.getInstance().marshalingXML(jsonRequest, true, true);
|
||||
String uniqueName = createDMInvocationFileName(jsonRequest.getOperatorId());
|
||||
tempInvocationFile = createTempFile(uniqueName, ".xml", xmlByteArray.toByteArray());
|
||||
tempInvocationFile = createTempFile(uniqueName, ".xml", xmlRequest.getBytes());
|
||||
logger.info("Created StorageHubClient Instance, uploading file: "+tempInvocationFile.getName());
|
||||
|
||||
AuthorizationEntry entry = authorizationService().get(contextToken);
|
||||
|
@ -338,10 +337,10 @@ public class AnalyticsCreateResolver {
|
|||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
System.out.println(readApplicationTokenFromSE(null, "/gcube"));
|
||||
|
||||
}
|
||||
// public static void main(String[] args) {
|
||||
//
|
||||
// System.out.println(readApplicationTokenFromSE(null, "/gcube"));
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue