<xs:sequence>
<xs:element minOccurs="0" name="args0" nillable="true" type="xs:base64Binary"/>
<xs:element minOccurs="0" name="args1" nillable="true" type="xs:string"/>
+ <xs:element minOccurs="0" name="args2" type="xs:long"/>
</xs:sequence>
</xs:complexType>
</xs:element>
}
+ /**
+ * field for Args2
+ */
+
+
+ protected long localArgs2 ;
+
+ /* This tracker boolean wil be used to detect whether the user called the set method
+ * for this attribute. It will be used to determine whether to include this field
+ * in the serialized XML
+ */
+ protected boolean localArgs2Tracker = false ;
+
+ public boolean isArgs2Specified(){
+ return localArgs2Tracker;
+ }
+
+
+
+ /**
+ * Auto generated getter method
+ * @return long
+ */
+ public long getArgs2(){
+ return localArgs2;
+ }
+
+
+
+ /**
+ * Auto generated setter method
+ * @param param Args2
+ */
+ public void setArgs2(long param){
+
+ // setting primitive attribute tracker to true
+ localArgs2Tracker =
+ param != java.lang.Long.MIN_VALUE;
+
+ this.localArgs2=param;
+
+
+ }
+
+
/**
}
+ xmlWriter.writeEndElement();
+ } if (localArgs2Tracker){
+ namespace = "http://salome.service.ws_server.splat.org";
+ writeStartElement(null, namespace, "args2", xmlWriter);
+
+ if (localArgs2==java.lang.Long.MIN_VALUE) {
+
+ throw new org.apache.axis2.databinding.ADBException("args2 cannot be null!!");
+
+ } else {
+ xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localArgs2));
+ }
+
xmlWriter.writeEndElement();
}
xmlWriter.writeEndElement();
elementList.add(localArgs1==null?null:
org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localArgs1));
- }
+ } if (localArgs2Tracker){
+ elementList.add(new javax.xml.namespace.QName("http://salome.service.ws_server.splat.org",
+ "args2"));
+
+ elementList.add(
+ org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localArgs2));
+ }
return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray());
else {
}
+
+
+ while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
+
+ if (reader.isStartElement() && new javax.xml.namespace.QName("http://salome.service.ws_server.splat.org","args2").equals(reader.getName())){
+
+ nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","nil");
+ if ("true".equals(nillableValue) || "1".equals(nillableValue)){
+ throw new org.apache.axis2.databinding.ADBException("The element: "+"args2" +" cannot be null");
+ }
+
+
+ java.lang.String content = reader.getElementText();
+
+ object.setArgs2(
+ org.apache.axis2.databinding.utils.ConverterUtil.convertToLong(content));
+
+ reader.next();
+
+ } // End of if for expected property start element
+
+ else {
+
+ object.setArgs2(java.lang.Long.MIN_VALUE);
+
+ }
while (!reader.isStartElement() && !reader.isEndElement())
reader.next();
org.splat.ws_client.service.salome.SimanSalomeServiceStub.GetFile request = new org.splat.ws_client.service.salome.SimanSalomeServiceStub.GetFile();
//request.setArgs0("W:/Eclipse workspace/SIMAN/Repository/vault/SimanSalome/100010018/siman-salome.conf");
- request.setArgs0("W:/testvideo/IMG_5792.JPG");
+ request.setArgs0("W:\\testvideo\\IMG_5792.JPG");
org.splat.ws_client.service.salome.SimanSalomeServiceStub.GetFileResponse response;
response = stub.getFile(request);
- File clientFile = new File("W:/client_temp2/IMG_5792_out.JPG");
+ File clientFile = new File("W:\\client_temp2\\IMG_5792_out.JPG");
//File clientFile = new File("W:/client_temp2/siman-salome.conf");
- File clientFilePath = new File("W:/client_temp2");
+ File clientFilePath = new File("W:\\client_temp2");
clientFilePath.mkdirs();
clientFile.createNewFile();
options.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_TRUE);
options.setProperty(Constants.Configuration.CACHE_ATTACHMENTS, Constants.VALUE_TRUE);
- options.setProperty(Constants.Configuration.ATTACHMENT_TEMP_DIR, "w:/temp");
+ options.setProperty(Constants.Configuration.ATTACHMENT_TEMP_DIR, "w:\\temp");
options.setProperty(Constants.Configuration.FILE_SIZE_THRESHOLD, "4000");
// Increase the time out when sending large attachments
org.splat.ws_client.service.salome.SimanSalomeServiceStub.PutFileResponse response;
- String clientFile = "w:/client_temp2/MKA_test.txt";
+ String clientFile = "w:\\client_temp2\\MKA_test.txt";
DataSource dataSource = new FileDataSource(clientFile);
DataHandler requestDH = new DataHandler(dataSource);
- String requestFilePath = "W:/Eclipse workspace/SIMAN/Repository/vault/SimanSalome/100010018/MKA_test.txt";
+ String requestFilePath = "MKA_test.txt";
request.setArgs0(requestDH);
request.setArgs1(requestFilePath);
+ request.setArgs2(8);
response = stub.putFile(request);
/**
* Put the file from client to server.
* @param dataHandler the data handler
- * @param vaultURL the target URL in vault
+ * @param fileName the name of the uploaded file
+ * @param userId the user ID
* @return the result URL in vault
**/
- String /*DataHandler*/ putFile(final DataHandler dataHandler, final String vaultURL);
+ String /*DataHandler*/ putFile(final DataHandler dataHandler, final String fileName, final Long userId);
}
try {
//_projectSettingsService.configure("WebContent/conf/som.xml");
- _projectSettingsService.configure("W:/Eclipse workspace/SIMAN/SIMAN_SRC/Workspace/Siman-WS/WebContent/conf/som.xml");
+ _projectSettingsService.configure("W:\\Eclipse workspace\\SIMAN\\SIMAN_SRC\\Workspace\\Siman-WS\\WebContent\\conf\\som.xml");
//ClassLoader loader = ClassLoader.getSystemClassLoader();
//URL pathToSOM = loader.getResource("WebContent/conf/som.xml");
List<StepDTO> listSteps = _scenarioService.getScenarioInfo(scenarioId);
- File configFilePath = new File(_repositoryService.getRepositoryVaultPath() + "/SimanSalome/" + studyId.toString() + scenarioId.toString() + userId.toString());
+ File configFilePath = new File(_repositoryService.getRepositoryVaultPath() + "\\SimanSalome\\" + studyId.toString() + scenarioId.toString() + userId.toString());
configFilePath.mkdirs();
- File configFile = new File(configFilePath + "/siman-salome.conf");
+ File configFile = new File(configFilePath + "\\siman-salome.conf");
//build the result file.
FileWriter fstream;
* @see org.splat.ws_server.service.salome.SimanSalomeService#putFile(javax.activation.DataHandler, java.io.File)
*/
@Override
- public String /*DataHandler*/ putFile(final DataHandler dataHandler, final String vaultURL) {
+ public String /*DataHandler*/ putFile(final DataHandler dataHandler, final String fileName, final Long userId) {
- File vaultURLFile = new File(vaultURL);
- File serverFilePath = vaultURLFile.getParentFile();
- serverFilePath.mkdirs();
+ //will be removed in future
+ try {
+ _projectSettingsService.configure("W:\\Eclipse workspace\\SIMAN\\SIMAN_SRC\\Workspace\\Siman-WS\\WebContent\\conf\\som.xml");
+
+ } catch (IOException ioException) {
+ LOG.debug("Sorry, IOException is throws", ioException);
+ } catch (SQLException sqlException) {
+ LOG.debug("Sorry, impossible to populate the database", sqlException);
+ }
+
+ File pathToDownloadDirectory = new File(_repositoryService.getDownloadDirectory(userId).getPath());
+ File vaultURLFile = new File(pathToDownloadDirectory + "\\" + fileName);
+
+ pathToDownloadDirectory.mkdirs();
try {
vaultURLFile.createNewFile();
e.printStackTrace();
}
- return vaultURL;
+ return vaultURLFile.getPath();
/*FileDataSource fileDataSource = new FileDataSource(vaultURL);
DataHandler fileDataHandler = new DataHandler(fileDataSource);
return fileDataHandler;*/