LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
INCLUDE(SimanIOMacros)
+# Win32 specific definitions to avoid problems with std collection and iterators
+IF(WIN32)
+ ## Windows specific:
+ ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) # To disable windows warnings for strcpy, fopen, ...
+ ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) # To disable windows warnings generated by checked iterators(e.g. std::copy, std::transform, ...)
+ # Disable iterator debugging on WINDOWS to avoid runtime error during checking iterators
+ # _SECURE_SCL
+ # If defined as 1, unsafe iterator use causes a runtime error.
+ # If defined as 0, checked iterators are disabled.
+ # The default value for _SECURE_SCL is 1
+ # _SECURE_SCL_THROWS
+ # If defined as 1, an out of range iterator use causes an exception at runtime.
+ # If defined as 0, the program is terminated by calling invalid_parameter.
+ # The default value for _SECURE_SCL_THROWS is 0
+
+ ADD_DEFINITIONS(-D_SECURE_SCL=0 -D_SECURE_SCL_THROWS=0)
+
+ # The symbol _HAS_ITERATOR_DEBUGGING can be used to turn off the iterator debugging feature in a debug build
+ # If defined as 1, iterator debugging is enabled.
+ # If defined as 0, iterator debugging is disabled.
+ # The default value for _HAS_ITERATOR_DEBUGGING is 1
+
+ IF(NOT CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
+ ADD_DEFINITIONS(-D_HAS_ITERATOR_DEBUGGING=0)
+ ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
+ENDIF(WIN32)
+
+
# User options
# ============
IF(WIN32 AND NOT CYGWIN)
FIND_LIBRARY(WSO2_LIBRARY_guththila NAMES guththila)
FIND_LIBRARY(WSO2_LIBRARY_neethi NAMES neethi)
FIND_LIBRARY(WSO2_LIBRARY_axis2_parser NAMES axis2_parser)
+
+IF(WIN32)
+ FIND_LIBRARY(WSO2_LIBRARY_axis2_axiom NAMES axiom)
+ELSE()
FIND_LIBRARY(WSO2_LIBRARY_axis2_axiom NAMES axis2_axiom)
FIND_LIBRARY(WSO2_LIBRARY_axis2_http_common NAMES axis2_http_common)
+ENDIF()
+
FIND_LIBRARY(WSO2_LIBRARY_axis2_engine NAMES axis2_engine)
FIND_LIBRARY(WSO2_LIBRARY_wso2_wsf NAMES wso2_wsf)
SET(WSO2_LIBRARIES ${WSO2_LIBRARIES} ${WSO2_LIBRARY_neethi})
SET(WSO2_LIBRARIES ${WSO2_LIBRARIES} ${WSO2_LIBRARY_axis2_parser})
SET(WSO2_LIBRARIES ${WSO2_LIBRARIES} ${WSO2_LIBRARY_axis2_axiom})
+
+IF(NOT WIN32)
SET(WSO2_LIBRARIES ${WSO2_LIBRARIES} ${WSO2_LIBRARY_axis2_http_common})
+ENDIF()
+
SET(WSO2_LIBRARIES ${WSO2_LIBRARIES} ${WSO2_LIBRARY_axis2_engine})
SET(WSO2_LIBRARIES ${WSO2_LIBRARIES} ${WSO2_LIBRARY_wso2_wsf})
3. Generating Web Service Client Stubs
--------------------------------------
-It is the optional action for current version.
+This paragraph describes a procedure of the web services client stubs generating
+Note: it is an optional action for the current version of SimanIO.
SimanIO library sources include a set of web services client stubs generated
by means of WSO2 Web Services Framework for C++.
Use the following parameters to generate the Axis2/C client stub code with
ADB (Axis Data Binding) support:
- $ ./siman_stabs_code_generator.sh -uri <wsdl_location> -d adb -u
+ $ siman_stabs_code_generator.sh -uri <wsdl_location> -d adb -u
-The SIMAN stabs code generator script
-(<SIMANIO_SRC>/scripts/siman_stabs_code_generator.sh) generates the client stub
-files .h and .cpp from the given SIMAN wsdl file, path to which is specified
-via <wsdl_location> (<SIMANIO_SRC>/scripts/SimanSalomeService.wsdl)
-and puts generated files to the src sub-directory of a source tree.
+The SIMAN stabs code generator script creates the client stub files .h and
+.cpp from the given SIMAN wsdl file, path to which is specified
+via the <wsdl_location> parameter; resulting files should be put to the
+src sub-directory of a source tree.
+
+The siman_stabs_code_generator.sh script and wsdl template file
+SimanSalomeService.wsdl are located in the scripts sub-directory of a source
+tree.
-------------------------------------------------
4. Build SALOME KERNEL module with SIMAN support
5.6. Configuration of SIMAN web server and SIMAN database server
Please find all necessary details concerning the configuration and running of
-SALOME SIMAN client and SIMAN Web server with SIMAN database server in
-the SIMAN Administration Guide (SIMAN_AdminGuide_vx.y).
+SALOME SIMAN client and SIMAN Web server with SIMAN database in the SIMAN
+Administration Guide (SIMAN_AdminGuide_vX.Y).
5.7. Basic working mode of SALOME with SIMAN server
If installation and configuration of SIMAN have been performed successfully
-the SIMAN server can be accesible on SALOME client side from your browser using
-URL: "http://<server_name or server_IP>:8080/siman".
+the SIMAN server can be accesible on SALOME client side from your browser using URL:
+"http://<server_name or server_IP>:8080/siman".
Normally, this should display the SIMAN start page.
SALOME session connected to SIMAN is automatically started from the browser;
SimanIO_Configuration.hxx
SimanIO_Document.hxx
SimanIO_Link.hxx
+ SimanIO.hxx
)
# [ generated sources ]
# [ target: library ]
ADD_LIBRARY(SimanIO SHARED ${SimanIO_SOURCES})
TARGET_LINK_LIBRARIES(SimanIO ${PLATFORM_LIBS} ${WSO2_LIBRARIES})
+SET_TARGET_PROPERTIES(SimanIO PROPERTIES COMPILE_DEFINITIONS "AXIS2_DECLARE_EXPORT")
+#SET_TARGET_PROPERTIES(SimanIO PROPERTIES COMPILE_DEFINITIONS "AXIS2_SVR_MULTI_THREADED")
INSTALL(TARGETS SimanIO EXPORT ${PROJECT_NAME}Targets DESTINATION lib)
INSTALL(FILES ${SimanIO_HEADERS} DESTINATION include)
# [ target: test ]
-ADD_EXECUTABLE(TestCreateConfigFile TestCreateConfigFile.cpp)
-TARGET_LINK_LIBRARIES(TestCreateConfigFile SimanIO)
-INSTALL(TARGETS TestCreateConfigFile DESTINATION bin)
+#ADD_EXECUTABLE(TestCreateConfigFile TestCreateConfigFile.cpp)
+#TARGET_LINK_LIBRARIES(TestCreateConfigFile SimanIO)
+#SET_TARGET_PROPERTIES(SimanIO PROPERTIES COMPILE_DEFINITIONS "AXIS2_DECLARE_EXPORT")
+##SET_TARGET_PROPERTIES(SimanIO PROPERTIES COMPILE_DEFINITIONS "AXIS2_SVR_MULTI_THREADED")
+#INSTALL(TARGETS TestCreateConfigFile DESTINATION bin)
--- /dev/null
+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _SIMANIO_HXX_
+#define _SIMANIO_HXX_
+
+#ifdef WIN32
+# if defined SIMANIO_EXPORTS || defined SimanIO_EXPORTS
+# define SIMANIO_EXPORT __declspec( dllexport )
+# else
+# define SIMANIO_EXPORT __declspec( dllimport )
+# endif
+#else
+# define SIMANIO_EXPORT
+#endif
+
+#endif //_SIMANIO_HXX_
#ifndef SIMANIO_ACTIVITY_H
#define SIMANIO_ACTIVITY_H
+#include "SimanIO.hxx"
+
#include "SimanIO_Document.hxx"
#include <string>
/**
* \brief Class for storage and store CFG file activity information.
*/
-class SimanIO_Activity {
+class SIMANIO_EXPORT SimanIO_Activity {
std::string myName; ///< name of the activity
std::string myModule; ///< module of the activity
typedef std::map<int, SimanIO_Document> ActivityDocuments;
SimanIO_Document& GetOrCreateDocument(const int theId);
//! Iterator for activity documents browsing
- class DocumentsIterator {
+ class SIMANIO_EXPORT DocumentsIterator {
ActivityDocuments::iterator myIter; ///< iterator by the documents of the activity
ActivityDocuments::const_iterator myEnd; ///< end iteration indicator
public:
}
}
myActivities[anId] = theActivity;
+ return anId;
}
SimanIO_Activity& SimanIO_Configuration::GetOrCreateActivity(const int theId)
#ifndef SIMANIO_CONFIGURATION_H
#define SIMANIO_CONFIGURATION_H
+#include "SimanIO.hxx"
+
#include "SimanIO_Activity.hxx"
#include <fstream>
* \brief Class for storage and store CFG file information.
*/
-class SimanIO_Configuration {
+class SIMANIO_EXPORT SimanIO_Configuration {
std::map<int, SimanIO_Activity> myActivities; ///< map of Id of activity t othe activity instance
// fileds that are used for file parsing
/**
* Iterator for actifities.
*/
- class ActivitiesIterator {
+ class SIMANIO_EXPORT ActivitiesIterator {
std::map<int, SimanIO_Activity>::iterator myIter; // activities iterator
std::map<int, SimanIO_Activity>::iterator myEnd; // end if activities identifier
public:
#ifndef SIMANIO_DOCUMENT_H
#define SIMANIO_DOCUMENT_H
+#include "SimanIO.hxx"
+
#include <string>
#include <list>
/**
* \brief Class for storage and store CFG file document information.
*/
-class SimanIO_Document {
+class SIMANIO_EXPORT SimanIO_Document {
std::string myName; ///< name of the document
typedef std::list<SimanIO_File> DocumentFiles;
DocumentFiles myFiles; ///< files of the document
const SimanIO_File& File(const int theId) const;
//! Iterator for activity documents browsing
- class FilesIterator {
+ class SIMANIO_EXPORT FilesIterator {
DocumentFiles::iterator myIter; ///< iterator by the file of the document
DocumentFiles::const_iterator myEnd; ///< end iteration indicator
public:
#include <sstream>
#include <algorithm>
+#ifdef WIN32
+ #include <stdlib.h>
+#endif
+
using namespace org_splat_ws_server_service_salome;
using namespace wso2wsf;
//CreateConfigFile operation
CreateConfigFile* aCreateConfigFileRequest = new CreateConfigFile();
- aCreateConfigFileRequest->setArgs0(atoll(myStudy.c_str()));
- aCreateConfigFileRequest->setArgs1(atoll(myScenario.c_str()));
- aCreateConfigFileRequest->setArgs2(atoll(myUser.c_str()));
+#ifdef WIN32
+ aCreateConfigFileRequest->setArgs0(_atoi64(myStudy.c_str()));
+ aCreateConfigFileRequest->setArgs1(_atoi64(myScenario.c_str()));
+ aCreateConfigFileRequest->setArgs2(_atoi64(myUser.c_str()));
+#else
+ aCreateConfigFileRequest->setArgs0(std::atoll(myStudy.c_str()));
+ aCreateConfigFileRequest->setArgs1(std::atoll(myScenario.c_str()));
+ aCreateConfigFileRequest->setArgs2(std::atoll(myUser.c_str()));
+
+ //std::cout<<"StudyId = " << std::atoll(myStudy.c_str()) << "\n";
+ //std::cout<<"ScenarioId = " << std::atoll(myScenario.c_str()) << "\n";
+ //std::cout<<"UserId = " << std::atoll(myUser.c_str()) << "\n";
+#endif
- //std::cout<<"StudyId = " << atoll(myStudy.c_str()) << "\n";
- //std::cout<<"ScenarioId = " << atoll(myScenario.c_str()) << "\n";
- //std::cout<<"UserId = " << atoll(myUser.c_str()) << "\n";
CreateConfigFileResponse* aCreateConfigFileResponse = new CreateConfigFileResponse();
aCreateConfigFileResponse = aStub->createConfigFile(aCreateConfigFileRequest);
aGetFileResponse = aStub->getFile(aGetFileRequest);
//Parse the response and get the filename
+#ifdef WIN32
+ char* aHome = getenv("HOME");
+ std::string aTmpDir(aHome);
+ std::string aClientFileDir = aTmpDir + "\\SimanSalome\\" + myStudy + "\\" + myScenario + "\\" + myUser + "\\";
+ //std::string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/";
+ std::string aClientFilePath = aClientFileDir + aResponseFileName;
+
+ //Create the directories
+ system(("if not exist aClientFileDir).c_str() mkdir " + aClientFileDir).c_str());
+#else
std::string aTmpDir = "/tmp";
std::string aClientFileDir = aTmpDir + "/SimanSalome/" + myStudy + "/" + myScenario + "/" + myUser + "/";
//std::string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/";
//Create the directories
system(("mkdir -p " + aClientFileDir).c_str());
system(("chmod -Rf g+w " + aTmpDir + "/SimanSalome/").c_str());
+#endif
//Download the siman-salome.conf file
std::ofstream outputStream;
std::string aSourceFileName = aFileName.substr(startUnderlineIndex);
//std::cout << "aURL = " << aURL << "\n";
+ #ifdef WIN32
+ std::string aPathToVault = aResponseFilePath.substr(0, aResponseFilePath.find("download")) + "vault\\";
+ #else
std::string aPathToVault = aResponseFilePath.substr(0, aResponseFilePath.find("download")) + "vault/";
+ #endif
//only for test only for WIN
//replace(aURL.begin(),aURL.end(),'/','\\');
PutFileResponse* aPutFileResponse = new PutFileResponse();
//Prepare salome-siman.conf file
+#ifdef WIN32
+ char* aHome = getenv("HOME");
+ std::string aTmpDir(aHome);
+ std::string aClientFileDir = aTmpDir + "\\SimanSalome\\" + myStudy + "\\" + myScenario + "\\" + myUser + "\\";
+ //std::string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/";
+
+#else
std::string aTmpDir = "/tmp";
std::string aClientFileDir = aTmpDir + "/SimanSalome/" + myStudy + "/" + myScenario + "/" + myUser + "/";
//std::string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/";
+#endif
std::string aClientFilePath = aClientFileDir + "salome-siman.conf";
std::ofstream aSalomeSimanFile;
aSalomeSimanFile.open(aClientFilePath.c_str());
//Set arguments
aPutFileRequest->setArgs0(aRequestDH);
aPutFileRequest->setArgs1(aFileName);
- aPutFileRequest->setArgs2(atoll(myUser.c_str()));
+
+#ifdef WIN32
+ aPutFileRequest->setArgs2(_atoi64(myUser.c_str()));
+#else
+ aPutFileRequest->setArgs2(std::atoll(myUser.c_str()));
+#endif
aPutFileResponse = aStub->putFile(aPutFileRequest);
//Set arguments
aPutFileRequest->setArgs0(aRequestDH);
aPutFileRequest->setArgs1("salome-siman.conf");
- aPutFileRequest->setArgs2(atoll(myUser.c_str()));
+
+#ifdef WIN32
+ aPutFileRequest->setArgs2(_atoi64(myUser.c_str()));
+#else
+ aPutFileRequest->setArgs2(std::atoll(myUser.c_str()));
+#endif
aPutFileResponse = aStub->putFile(aPutFileRequest);
CheckIn* aCheckInRequest = new CheckIn();
CheckInResponse* aCheckInResponse = new CheckInResponse();
aCheckInRequest->setArgs0(aPutFileResponse->get_return());
- aCheckInRequest->setArgs1(atoll(myScenario.c_str()));
- aCheckInRequest->setArgs2(atoll(myUser.c_str()));
+
+#ifdef WIN32
+ aCheckInRequest->setArgs1(_atoi64(myScenario.c_str()));
+ aCheckInRequest->setArgs2(_atoi64(myUser.c_str()));
+#else
+ aCheckInRequest->setArgs1(std::atoll(myScenario.c_str()));
+ aCheckInRequest->setArgs2(std::atoll(myUser.c_str()));
+#endif
+
aCheckInResponse = aStub->checkIn(aCheckInRequest);
//Delete the directories
#ifndef SIMANIO_LINK_H
#define SIMANIO_LINK_H
+#include "SimanIO.hxx"
+
#include "SimanIO_Configuration.hxx"
/**
* \brief Class for creation of connection with SIMAN database.
*/
-class SimanIO_Link {
+class SIMANIO_EXPORT SimanIO_Link {
std::string myStudy; ///< identifier of the study in the SIMAN
std::string myScenario; ///< identifier of the scenario in the SIMAN
std::string myUser; ///< identifier of the user in the SIMAN