-project(SimanIO)
-cmake_minimum_required(VERSION 2.4)
-add_subdirectory(src lib)
+# 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
+#
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
+PROJECT(SimanIO C CXX)
+# Versioning
+# ===========
+# Project name, upper case
+STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
+
+SET(${PROJECT_NAME_UC}_MAJOR_VERSION 0)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 1)
+SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
+SET(${PROJECT_NAME_UC}_VERSION
+ ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
+
+# Our own set of macros:
+LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
+INCLUDE(SimanIOMacros)
+
+# User options
+# ============
+IF(WIN32 AND NOT CYGWIN)
+ SET(INSTALL_CMAKE_CONFIG_DIR cmake)
+ELSE()
+ SET(INSTALL_CMAKE_CONFIG_DIR share/cmake/simanio)
+ENDIF()
+SET(INSTALL_INCLUDE_DIR include)
+
+# Prerequisites detection:
+# ========================
+FIND_PACKAGE(SimanIOWSO2 REQUIRED)
+
+# Configure
+# =========
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/SimanIO_Version.hxx.in ${CMAKE_CURRENT_BINARY_DIR}/src/SimanIO_Version.hxx @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/SimanIO_Version.hxx DESTINATION include)
+
+ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(scripts)
+
+# Export logic
+# ============
+INCLUDE(CMakePackageConfigHelpers)
+
+# Add all targets to the build-tree export set
+EXPORT(TARGETS SimanIO FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
+
+# Create the configuration files:
+# - in the build tree:
+
+# Ensure the variables are always defined for the configure:
+SET(WSO2_ROOT_DIR "${WSO2_ROOT_DIR}")
+
+SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
+CONFIGURE_PACKAGE_CONFIG_FILE(misc/${PROJECT_NAME}Config.cmake.in
+ ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+ INSTALL_DESTINATION "${INSTALL_CMAKE_CONFIG_DIR}"
+ PATH_VARS CONF_INCLUDE_DIRS INSTALL_CMAKE_CONFIG_DIR CMAKE_INSTALL_PREFIX WSO2_ROOT_DIR)
+
+# - in the install tree:
+# Get the relative path of the include directory so
+# we can register it in the generated configuration files:
+SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
+CONFIGURE_PACKAGE_CONFIG_FILE(misc/${PROJECT_NAME}Config.cmake.in
+ ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
+ INSTALL_DESTINATION "${INSTALL_CMAKE_CONFIG_DIR}"
+ PATH_VARS CONF_INCLUDE_DIRS INSTALL_CMAKE_CONFIG_DIR CMAKE_INSTALL_PREFIX WSO2_ROOT_DIR)
+
+WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+ VERSION ${${PROJECT_NAME_UC}_VERSION}
+ COMPATIBILITY AnyNewerVersion)
+
+# Install the CMake configuration files:
+INSTALL(FILES
+ "${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake"
+ "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
+ DESTINATION "${INSTALL_CMAKE_CONFIG_DIR}")
+
+# Install the export set for use with the install-tree
+INSTALL(EXPORT ${PROJECT_NAME}Targets DESTINATION "${INSTALL_CMAKE_CONFIG_DIR}")
--- /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
+#
+
+# WSO2 WSF/C++ cpp detection for SimanIO
+#
+# !! Please read the generic detection procedure in SimanIOMacros.cmake !!
+#
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(WSO2 WSO2_INCLUDE_DIR 1)
+MARK_AS_ADVANCED(WSO2_LIBRARIES WSO2_INCLUDES WSO2_INCLUDE_DIR)
--- /dev/null
+# - Find WSO2 WSF/C++
+# This module finds an installed WSO2 WSF/C++ using the variable WSO2_ROOT_DIR
+# as a lookup path.
+# It sets the following variables:
+# WSO2_FOUND - set to true if WSO2 WSF/C++ is found
+# WSO2_INCLUDE_DIR - the directories where the main include files are located
+# WSO2_INCLUDES - the list of directories for headers search path
+# WSO2_LIBRARIES - WSO2 WSF/C++ libraries to be linked against
+
+#############################################################
+# 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
+#
+#############################################################
+
+IF (NOT WSO2_FIND_QUIETLY)
+ MESSAGE(STATUS "Looking for WSO2 WSF/C++...")
+ENDIF ()
+
+SET(WSO2_ROOT_DIR $ENV{WSO2_ROOT_DIR})
+
+IF(WSO2_ROOT_DIR)
+ LIST(APPEND CMAKE_PREFIX_PATH "${WSO2_ROOT_DIR}")
+ENDIF(WSO2_ROOT_DIR)
+
+FIND_PATH(WSO2_INCLUDE_DIR WSFDefines.h PATH_SUFFIXES include)
+# TODO: detect axis includes automatically, without below hardcoded search path
+FIND_PATH(WSO2_INCLUDE_DIR_axis2 axutil_version.h PATH_SUFFIXES include include/axis2-1.6.0)
+
+SET(WSO2_INCLUDES ${WSO2_INCLUDE_DIR})
+IF(WSO2_INCLUDE_DIR_axis2)
+ LIST(APPEND WSO2_INCLUDES ${WSO2_INCLUDE_DIR_axis2} ${WSO2_INCLUDE_DIR_axis2}/platforms)
+ENDIF()
+
+FIND_LIBRARY(WSO2_LIBRARY_axis2_axiom NAMES axis2_axiom)
+FIND_LIBRARY(WSO2_LIBRARY_axis2_engine NAMES axis2_engine)
+FIND_LIBRARY(WSO2_LIBRARY_wso2_wsf NAMES wso2_wsf)
+
+SET(WSO2_LIBRARIES)
+SET(WSO2_LIBRARIES ${WSO2_LIBRARIES} ${WSO2_LIBRARY_axis2_axiom})
+SET(WSO2_LIBRARIES ${WSO2_LIBRARIES} ${WSO2_LIBRARY_axis2_engine})
+SET(WSO2_LIBRARIES ${WSO2_LIBRARIES} ${WSO2_LIBRARY_wso2_wsf})
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(WSO2 REQUIRED_VARS WSO2_INCLUDE_DIR WSO2_INCLUDES WSO2_LIBRARIES)
--- /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
+#
+
+###
+# SALOME_CHECK_EQUAL_PATHS(result path1 path2)
+# Check if two paths are identical, resolving links. If the paths do not exist a simple
+# text comparison is performed.
+# result is a boolean.
+###
+MACRO(SALOME_CHECK_EQUAL_PATHS varRes path1 path2)
+ SET("${varRes}" OFF)
+ IF(EXISTS "${path1}")
+ GET_FILENAME_COMPONENT(_tmp1 "${path1}" REALPATH)
+ ELSE()
+ SET(_tmp1 "${path1}")
+ ENDIF()
+
+ IF(EXISTS "${path2}")
+ GET_FILENAME_COMPONENT(_tmp2 "${path2}" REALPATH)
+ ELSE()
+ SET(_tmp2 "${path2}")
+ ENDIF()
+
+ IF("${_tmp1}" STREQUAL "${_tmp2}")
+ SET("${varRes}" ON)
+ ENDIF()
+# MESSAGE(${${varRes}})
+ENDMACRO()
+
+####
+# SALOME_FIND_PACKAGE(englobingPackageName standardPackageName modus [onlyTryQuietly])
+#
+# example: SALOME_FIND_PACKAGE(SalomeVTK VTK CONFIG)
+#
+# Encapsulate the call to the standard FIND_PACKAGE(standardPackageName) passing all the options
+# given when calling the command FIND_PACKAGE(SimanIOXyz). Those options are stored implicitly in
+# CMake variables: Xyz_FIND_QUIETLY, Xyz_FIND_REQUIRED, etc ...
+#
+# If a list of components was specified when invoking the initial FIND_PACKAGE(SimanIOXyz ...) this is
+# also handled properly.
+#
+# Modus is either MODULE or CONFIG (cf standard FIND_PACKAGE() documentation).
+# The last argument is optional and if set to TRUE will force the search to be OPTIONAL and QUIET.
+# If the package is looked for in CONFIG mode, the standard system paths are skipped. If you still want a
+# system installation to be found in this mode, you have to set the ROOT_DIR variable explicitly to /usr (for
+# example).
+#
+# This macro is to be called from within the FindSimanIOXyz.cmake files (where Xyz is some package to be detected).
+#
+####
+MACRO(SALOME_FIND_PACKAGE englobPkg stdPkg mode)
+ SET(_OPT_ARG ${ARGV3})
+ # Only bother if the package was not already found:
+ # Some old packages use the lower case version - standard should be to always use
+ # upper case:
+ STRING(TOUPPER ${stdPkg} stdPkgUC)
+ IF(NOT (${stdPkg}_FOUND OR ${stdPkgUC}_FOUND))
+ IF(${englobPkg}_FIND_QUIETLY OR _OPT_ARG)
+ SET(_tmp_quiet "QUIET")
+ ELSE()
+ SET(_tmp_quiet)
+ ENDIF()
+ IF(${englobPkg}_FIND_REQUIRED AND NOT _OPT_ARG)
+ SET(_tmp_req "REQUIRED")
+ ELSE()
+ SET(_tmp_req)
+ ENDIF()
+ IF(${englobPkg}_FIND_VERSION_EXACT)
+ SET(_tmp_exact "EXACT")
+ ELSE()
+ SET(_tmp_exact)
+ ENDIF()
+
+ # Call the CMake FIND_PACKAGE() command:
+ STRING(TOLOWER ${stdPkg} _pkg_lc)
+ IF(("${mode}" STREQUAL "NO_MODULE") OR ("${mode}" STREQUAL "CONFIG"))
+ # Hope to find direclty a CMake config file, indicating the SALOME CMake file
+ # paths (the command already looks in places like "share/cmake", etc ... by default)
+ # Note the options NO_CMAKE_BUILDS_PATH, NO_CMAKE_PACKAGE_REGISTRY to avoid (under Windows)
+ # looking into a previous CMake build done via a GUI, or into the Win registry.
+ # NO_CMAKE_SYSTEM_PATH and NO_SYSTEM_ENVIRONMENT_PATH ensure any _system_ files like 'xyz-config.cmake'
+ # don't get loaded (typically Boost). To force their loading, set the XYZ_ROOT_DIR variable to '/usr'.
+ # See documentation of FIND_PACKAGE() for full details.
+
+ # Do we need to call the signature using components?
+ IF(${englobPkg}_FIND_COMPONENTS)
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
+ NO_MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS}
+ NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH)
+ ELSE()
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
+ NO_MODULE ${_tmp_quiet} ${_tmp_req}
+ NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH)
+ ENDIF()
+ MARK_AS_ADVANCED(${stdPkg}_DIR)
+
+ ELSEIF("${mode}" STREQUAL "MODULE")
+
+ # Do we need to call the signature using components?
+ IF(${englobPkg}_FIND_COMPONENTS)
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
+ MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS})
+ ELSE()
+ FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
+ MODULE ${_tmp_quiet} ${_tmp_req})
+ ENDIF()
+
+ ELSE()
+
+ MESSAGE(FATAL_ERROR "Invalid mode argument in the call to the macro SALOME_FIND_PACKAGE. Should be CONFIG or MODULE.")
+
+ ENDIF()
+
+ ENDIF()
+ENDMACRO()
+
+
+####################################################################
+# SALOME_FIND_PACKAGE_DETECT_CONFLICTS(pkg referenceVariable upCount)
+# pkg : name of the system package to be detected
+# referenceVariable: variable containing a path that can be browsed up to
+# retrieve the package root directory (xxx_ROOT_DIR)
+# upCount : number of times we have to go up from the path <referenceVariable>
+# to obtain the package root directory.
+#
+# For example: SALOME_FIND_PACKAGE_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2)
+#
+# Generic detection (and conflict check) procedure for package XYZ:
+# 1. Load a potential env variable XYZ_ROOT_DIR as a default choice for the cache entry XYZ_ROOT_DIR
+# If empty, load a potential XYZ_ROOT_DIR_EXP as default value (path exposed by another package depending
+# directly on XYZ)
+# 2. Invoke FIND_PACKAGE() in this order:
+# * in CONFIG mode first (if possible): priority is given to a potential
+# "XYZ-config.cmake" file
+# * then switch to the standard MODULE mode, appending on CMAKE_PREFIX_PATH
+# the above XYZ_ROOT_DIR variable
+# 3. Extract the path actually found into a temp variable _XYZ_TMP_DIR
+# 4. Warn if XYZ_ROOT_DIR is set and doesn't match what was found (e.g. when CMake found the system installation
+# instead of what is pointed to by XYZ_ROOT_DIR - happens when a typo in the content of XYZ_ROOT_DIR).
+# 5. Conflict detection:
+# * check the temp variable against a potentially existing XYZ_ROOT_DIR_EXP
+# 6. Finally expose what was *actually* found in XYZ_ROOT_DIR.
+# 7. Specific stuff: for example exposing a prerequisite of XYZ to the rest of the world for future
+# conflict detection. This is added after the call to the macro by the callee.
+#
+MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount)
+ ##
+ ## 0. Initialization
+ ##
+
+ # Package name, upper case
+ STRING(TOUPPER ${pkg} pkg_UC)
+
+ ##
+ ## 1. Load environment or any previously detected root dir for the package
+ ##
+ IF(DEFINED ENV{${pkg_UC}_ROOT_DIR})
+ FILE(TO_CMAKE_PATH "$ENV{${pkg_UC}_ROOT_DIR}" _${pkg_UC}_ROOT_DIR_ENV)
+ SET(_dflt_value "${_${pkg_UC}_ROOT_DIR_ENV}")
+ ELSE()
+ # will be blank if no package was previously loaded:
+ SET(_dflt_value "${${pkg_UC}_ROOT_DIR_EXP}")
+ ENDIF()
+
+ # Detect if the variable has been set on the command line or elsewhere:
+ IF(DEFINED ${pkg_UC}_ROOT_DIR)
+ SET(_var_already_there TRUE)
+ ELSE()
+ SET(_var_already_there FALSE)
+ ENDIF()
+ # Make cache entry
+ SET(${pkg_UC}_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory")
+
+ ##
+ ## 2. Find package - try CONFIG mode first (i.e. looking for XYZ-config.cmake)
+ ##
+
+ # Override the variable - don't append to it, as it would give precedence
+ # to what was stored there before!
+ SET(CMAKE_PREFIX_PATH "${${pkg_UC}_ROOT_DIR}")
+
+ # Try find_package in config mode. This has the priority, but is
+ # performed QUIET and not REQUIRED:
+ SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} NO_MODULE TRUE)
+
+ IF (${pkg_UC}_FOUND OR ${pkg}_FOUND)
+ MESSAGE(STATUS "Found ${pkg} in CONFIG mode!")
+ ENDIF()
+
+ # Otherwise try the standard way (module mode, with the standard CMake Find*** macro):
+ # We do it quietly to produce our own error message, except if we are in debug mode:
+ IF(SALOME_CMAKE_DEBUG)
+ SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE FALSE)
+ ELSE()
+ SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE TRUE)
+ ENDIF()
+
+ # Set the "FOUND" variable for the SALOME wrapper:
+ IF(${pkg_UC}_FOUND OR ${pkg}_FOUND)
+ SET(SALOME${pkg_UC}_FOUND TRUE)
+ ELSE()
+ SET(SALOME${pkg_UC}_FOUND FALSE)
+ IF(NOT Salome${pkg}_FIND_QUIETLY)
+ IF(Salome${pkg}_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "
+ "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR} "
+ "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")
+ ELSE()
+ MESSAGE(WARNING "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "
+ "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR} "
+ "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")
+ ENDIF()
+ ENDIF()
+ ENDIF()
+
+ IF (${pkg_UC}_FOUND OR ${pkg}_FOUND)
+ ## 3. Set the root dir which was finally retained by going up "upDir" times
+ ## from the given reference path. The variable "referenceVariable" may be a list.
+ ## In this case we take its first element.
+
+ # First test if the variable exists, warn otherwise:
+ IF(NOT DEFINED ${referenceVariable})
+ MESSAGE(WARNING "${pkg}: the reference variable '${referenceVariable}' used when calling the macro "
+ "SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() is not defined.")
+ ENDIF()
+
+ LIST(LENGTH ${referenceVariable} _tmp_len)
+ IF(_tmp_len)
+ LIST(GET ${referenceVariable} 0 _tmp_ROOT_DIR)
+ ELSE()
+ # Note the double de-reference of "referenceVariable":
+ SET(_tmp_ROOT_DIR "${${referenceVariable}}")
+ ENDIF()
+ IF(${upCount})
+ FOREACH(_unused RANGE 1 ${upCount})
+ GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
+ ENDFOREACH()
+ ENDIF()
+
+ ##
+ ## 4. Warn if CMake found something not located under ENV(XYZ_ROOT_DIR)
+ ##
+ IF(DEFINED ENV{${pkg_UC}_ROOT_DIR})
+ SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${_${pkg_UC}_ROOT_DIR_ENV}")
+ IF(NOT _res)
+ MESSAGE(WARNING "${pkg} was found, but not at the path given by the "
+ "environment ${pkg_UC}_ROOT_DIR! Is the variable correctly set? "
+ "The two paths are: ${_tmp_ROOT_DIR} and: ${_${pkg_UC}_ROOT_DIR_ENV}")
+
+ ELSE()
+ MESSAGE(STATUS "${pkg} found directory matches what was specified in the ${pkg_UC}_ROOT_DIR variable, all good!")
+ ENDIF()
+ ELSE()
+ IF(NOT _var_already_there)
+ MESSAGE(STATUS "Variable ${pkg_UC}_ROOT_DIR was not explicitly defined. "
+ "An installation was found anyway: ${_tmp_ROOT_DIR}")
+ ENDIF()
+ ENDIF()
+
+ ##
+ ## 5. Conflict detection
+ ## From another prerequisite using the package:
+ ##
+ IF(${pkg_UC}_ROOT_DIR_EXP)
+ SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${${pkg_UC}_ROOT_DIR_EXP}")
+ IF(NOT _res)
+ MESSAGE(WARNING "Warning: ${pkg}: detected version conflicts with a previously found ${pkg}!"
+ " The two paths are " ${_tmp_ROOT_DIR} " vs " ${${pkg_UC}_ROOT_DIR_EXP})
+ ELSE()
+ MESSAGE(STATUS "${pkg} directory matches what was previously exposed by another prereq, all good!")
+ ENDIF()
+ ENDIF()
+
+ ##
+ ## 6. Save the detected installation
+ ##
+ SET(${pkg_UC}_ROOT_DIR "${_tmp_ROOT_DIR}")
+
+ ELSE()
+ MESSAGE(STATUS "${pkg} was not found.")
+ ENDIF()
+
+ SET(Salome${pkg}_FOUND "${pkg}_FOUND")
+ENDMACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS)
--- /dev/null
+# - Config file for the @PROJECT_NAME@ package
+# It defines the following variables.
+# Specific to the package @PROJECT_NAME@ itself:
+# @PROJECT_NAME_UC@_INCLUDE_DIRS - include directories
+# @PROJECT_NAME_UC@_LIBRARIES - libraries to link against
+# @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
+#
+###############################################################
+# 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
+###############################################################
+
+### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE:
+@PACKAGE_INIT@
+
+### First the generic stuff for a standard module:
+SET(SIMANIO_INCLUDE_DIRS "@PACKAGE_CONF_INCLUDE_DIRS@")
+
+# Load the dependencies for the libraries of @PROJECT_NAME@
+# (contains definitions for IMPORTED targets). This is only
+# imported if we are not built as a subproject (in this case targets are already there)
+IF(NOT SimanIO AND NOT @PROJECT_NAME@_BINARY_DIR)
+ INCLUDE("@PACKAGE_INSTALL_CMAKE_CONFIG_DIR@/@PROJECT_NAME@Targets.cmake")
+ENDIF()
+
+# These are IMPORTED targets created by @PROJECT_NAME@Targets.cmake
+SET(SIMANIO_LIBRARIES SimanIO)
+
+# Package root dir:
+SET_AND_CHECK(SIMANIO_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@")
+
+#### Now the specificities
+
+# Options exported by the package:
+
+SET_AND_CHECK(WSO2_ROOT_DIR_EXP "@PACKAGE_WSO2_ROOT_DIR@")
--- /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
+#
+
+# [ files to be installed ]
+FILE(GLOB _install_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.sh")
+
+LIST(APPEND _install_FILES INSTALL_Applications.txt README)
+INSTALL(FILES ${_install_FILES} DESTINATION share/simanio/misc)
-project(SimanSrc CXX)
+# 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
+#
-set(SimanSrc_SRCS SimanIO_Activity.cxx SimanIO_Configuration.cxx SimanIO_Document.cxx SimanIO_Link.cxx CheckIn.cpp CheckInResponse.cpp CreateConfigFile.cpp CreateConfigFileResponse.cpp GetFile.cpp GetFileResponse.cpp PutFile.cpp PutFileResponse.cpp SimanSalomeServiceStub.cpp)
-set(SimanSrc_HEADERS SimanIO_Activity.hxx SimanIO_Configuration.hxx SimanIO_Document.hxx SimanIO_Link.hxx CheckIn.h CheckInResponse.h CreateConfigFile.h CreateConfigFileResponse.h GetFile.h GetFileResponse.h ISimanSalomeServiceCallback.h PutFile.h PutFileResponse.h SimanSalomeServiceStub.h)
-include_directories($(PROJECT_SOURCE_DIR) $ENV{WSFCPP_HOME}/include $ENV{WSFCPP_HOME}/include/axis2-1.6.0 $ENV{WSFCPP_HOME}/include/axis2-1.6.0/platforms)
+# [ additional include dirs ]
+INCLUDE_DIRECTORIES(
+ ${WSO2_INCLUDES}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
-add_library(SimanIO SHARED ${SimanSrc_SRCS} ${SimanSrc_HEADERS} $ENV{WSFCPP_HOME}/lib)
-target_link_libraries(SimanIO $ENV{WSFCPP_HOME}/lib $ENV{WSFCPP_HOME}/lib/libaxis2_axiom.so $ENV{WSFCPP_HOME}/lib/libaxis2_engine.so $ENV{WSFCPP_HOME}/lib/libwso2_wsf.so)
+# [ headers to be installed ]
+SET(SimanIO_HEADERS
+ SimanIO_Activity.hxx
+ SimanIO_Configuration.hxx
+ SimanIO_Document.hxx
+ SimanIO_Link.hxx
+)
-install(TARGETS SimanIO DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
-install(FILES ${SimanSrc_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
-
-# add_executable(TestCreateConfigFile TestCreateConfigFile.cpp)
-# target_link_libraries(TestCreateConfigFile ${CMAKE_INSTALL_PREFIX}/lib/libSimanIO.so $ENV{WSFCPP_HOME}/lib/libaxis2_axiom.so $ENV{WSFCPP_HOME}/lib/libaxis2_engine.so $ENV{WSFCPP_HOME}/lib/libwso2_wsf.so)
-# install(TARGETS TestCreateConfigFile DESTINATION bin)
+# [ generated sources ]
+# TODO: add procedure of automatic generation of the sources from the skeleton
+# TODO: this will raise dependency of SimanIO on SIMAN (where skeleton file is)
+# and Apache Axis2/Java (which is used to generate wrappings)
+SET(_generated_SOURCES
+ CheckIn.cpp
+ CheckInResponse.cpp
+ CreateConfigFile.cpp
+ CreateConfigFileResponse.cpp
+ GetFile.cpp
+ GetFileResponse.cpp
+ PutFile.cpp
+ PutFileResponse.cpp
+ SimanSalomeServiceStub.cpp
+)
+# [ static sources ]
+SET(_other_SOURCES
+ SimanIO_Activity.cxx
+ SimanIO_Configuration.cxx
+ SimanIO_Document.cxx
+ SimanIO_Link.cxx
+)
+# [ all sources to be compiled ]
+SET(SimanIO_SOURCES
+ ${_generated_SOURCES}
+ ${_other_SOURCES}
+)
+# [ target: library ]
+ADD_LIBRARY(SimanIO SHARED ${SimanIO_SOURCES})
+TARGET_LINK_LIBRARIES(SimanIO ${PLATFORM_LIBS} ${WSO2_LIBRARIES})
+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)
-#include <SimanIO_Activity.hxx>
+// 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
+//
-using namespace std;
+#include "SimanIO_Activity.hxx"
SimanIO_Activity::SimanIO_Activity()
{
+// 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_ACTIVITY_H
#define SIMANIO_ACTIVITY_H
-#include <SimanIO_Document.hxx>
+#include "SimanIO_Document.hxx"
+#include <string>
#include <map>
/**
-#include <SimanIO_Configuration.hxx>
+// 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
+//
+
+#include "SimanIO_Configuration.hxx"
#include <stdlib.h>
+// 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_CONFIGURATION_H
#define SIMANIO_CONFIGURATION_H
-#include <SimanIO_Activity.hxx>
+#include "SimanIO_Activity.hxx"
+
#include <fstream>
#include <iostream>
-#include <SimanIO_Document.hxx>
+// 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
+//
-using namespace std;
+#include "SimanIO_Document.hxx"
SimanIO_Document::SimanIO_Document()
{
+// 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_DOCUMENT_H
#define SIMANIO_DOCUMENT_H
+// 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
+//
+
#include "CreateConfigFile.h"
#include "CreateConfigFileResponse.h"
#include "GetFile.h"
#include "PutFileResponse.h"
#include "SimanSalomeServiceStub.h"
+#include "SimanIO_Link.hxx"
+
#include <Environment.h>
+#include <ServiceClient.h>
+
#include <iostream>
#include <fstream>
#include <sstream>
-#include <ServiceClient.h>
-#include <SimanIO_Link.hxx>
-
-
#include <algorithm>
-
-using namespace std;
using namespace org_splat_ws_server_service_salome;
using namespace wso2wsf;
}
// unification of the error handling in the RetrieveConf and StoreConf methods
-#define CONFIGURSION_ERROR(message) {cerr<<message<<endl;}
+#define CONFIGURSION_ERROR(message) {std::cerr<<message<<std::endl;}
SimanIO_Configuration SimanIO_Link::RetrieveConf()
{
return aResult;
}
- string aSimanWSHost(aSimanHost);
- string anEndpointUri = "http://" + aSimanWSHost + "/Siman-WS/services/SimanSalomeService";
+ std::string aSimanWSHost(aSimanHost);
+ std::string anEndpointUri = "http://" + aSimanWSHost + "/Siman-WS/services/SimanSalomeService";
Environment::initialize("SimanSalomeService.log",AXIS2_LOG_LEVEL_DEBUG);
char* aClientHomeEnv = getenv("WSFCPP_HOME");
return aResult;
}
- string aClientHome = AXIS2_GETENV("WSFCPP_HOME");
+ std::string aClientHome = AXIS2_GETENV("WSFCPP_HOME");
SimanSalomeServiceStub* aStub = new SimanSalomeServiceStub(aClientHome, anEndpointUri);
ServiceClient *client = aStub->getServiceClient();
aCreateConfigFileRequest->setArgs1(atoll(myScenario.c_str()));
aCreateConfigFileRequest->setArgs2(atoll(myUser.c_str()));
- //cout<<"StudyId = " << atoll(myStudy.c_str()) << "\n";
- //cout<<"ScenarioId = " << atoll(myScenario.c_str()) << "\n";
- //cout<<"UserId = " << atoll(myUser.c_str()) << "\n";
+ //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);
+ std::string aResponseFilePath = aCreateConfigFileResponse->get_return();
- string aResponseFilePath = aCreateConfigFileResponse->get_return();
-
- string aResponseFileName = aResponseFilePath.substr(aResponseFilePath.find_last_of("/\\")+1);
+ std::string aResponseFileName = aResponseFilePath.substr(aResponseFilePath.find_last_of("/\\")+1);
//Get the created config file to client
aGetFileResponse = aStub->getFile(aGetFileRequest);
//Parse the response and get the filename
- string aTmpDir = "/tmp";
- string aClientFileDir = aTmpDir + "/SimanSalome/" + myStudy + "/" + myScenario + "/" + myUser + "/";
- //string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/";
- string aClientFilePath = aClientFileDir + aResponseFileName;
+ std::string aTmpDir = "/tmp";
+ std::string aClientFileDir = aTmpDir + "/SimanSalome/" + myStudy + "/" + myScenario + "/" + myUser + "/";
+ //std::string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/";
+ std::string aClientFilePath = aClientFileDir + aResponseFileName;
//Create the directories
system(("mkdir -p " + aClientFileDir).c_str());
system(("chmod -Rf g+w " + aTmpDir + "/SimanSalome/").c_str());
//Download the siman-salome.conf file
- ofstream outputStream;
- outputStream.open(aClientFilePath.c_str(), ofstream::binary);
+ std::ofstream outputStream;
+ outputStream.open(aClientFilePath.c_str(), std::ofstream::binary);
int aBufferSize = axutil_base64_binary_get_decoded_binary_len(aGetFileResponse->get_return(), Environment::getEnv());
int* aBufSize = new int[aBufferSize];
unsigned char* aCopyBuffer = axutil_base64_binary_get_plain_binary(aGetFileResponse->get_return(), Environment::getEnv(), aBufSize);
/*const*/ SimanIO_Document& aDoc = aDocIter.Document();
SimanIO_Document::FilesIterator aFileIter(aDoc);
for(; aFileIter.More(); aFileIter.Next()) {
- string aURL = aFileIter.URL();
- string aFileName = aURL.substr(aURL.find_last_of("/\\")+1);
+ std::string aURL = aFileIter.URL();
+ std::string aFileName = aURL.substr(aURL.find_last_of("/\\")+1);
int startUnderlineIndex = aFileName.find_first_of("_") + 1;
- string aSourceFileName = aFileName.substr(startUnderlineIndex);
+ std::string aSourceFileName = aFileName.substr(startUnderlineIndex);
- //cout << "aURL = " << aURL << "\n";
- string aPathToVault = aResponseFilePath.substr(0, aResponseFilePath.find("download")) + "vault/";
+ //std::cout << "aURL = " << aURL << "\n";
+ std::string aPathToVault = aResponseFilePath.substr(0, aResponseFilePath.find("download")) + "vault/";
//only for test only for WIN
//replace(aURL.begin(),aURL.end(),'/','\\');
aGetFileRequest->setArgs0(aPathToVault + aURL);
aGetFileResponse = aStub->getFile(aGetFileRequest);
- outputStream.open((aClientFileDir + aSourceFileName).c_str(), ofstream::binary);
+ outputStream.open((aClientFileDir + aSourceFileName).c_str(), std::ofstream::binary);
int aBufferSize = axutil_base64_binary_get_decoded_binary_len(aGetFileResponse->get_return(), Environment::getEnv());
int* aBufSize = new int[aBufferSize];
unsigned char* aCopyBuffer = axutil_base64_binary_get_plain_binary(aGetFileResponse->get_return(), Environment::getEnv(), aBufSize);
//Set new URLs
aFileIter.SetURL((aClientFileDir + aSourceFileName).c_str());
- //cout << "New location of the files " << aClientFileDir + aFileName << "\n";
+ //std::cout << "New location of the files " << aClientFileDir + aFileName << "\n";
}//aFileIter
}//aDocIter
}//actIter
void SimanIO_Link::StoreConf(/*const*/ SimanIO_Configuration& theConf)
{
- cout << "StoreConf method is started\n";
+ std::cout << "StoreConf method is started\n";
char* aSimanHost = getenv("SIMAN_WS_HOST");
if (aSimanHost == NULL)
{
CONFIGURSION_ERROR("The SIMAN_WS_HOST variable does not exist. Please set it.\n");
}
- string aSimanWSHost(aSimanHost);
- string anEndpointUri = "http://" + aSimanWSHost + "/Siman-WS/services/SimanSalomeService";
+ std::string aSimanWSHost(aSimanHost);
+ std::string anEndpointUri = "http://" + aSimanWSHost + "/Siman-WS/services/SimanSalomeService";
Environment::initialize("SimanSalomeService.log",AXIS2_LOG_LEVEL_DEBUG);
char* aClientHomeEnv = getenv("WSFCPP_HOME");
CONFIGURSION_ERROR("The WSFCPP_HOME variable does not exist. Please set it.\n");
}
- string aClientHome = AXIS2_GETENV("WSFCPP_HOME");
+ std::string aClientHome = AXIS2_GETENV("WSFCPP_HOME");
SimanSalomeServiceStub* aStub = new SimanSalomeServiceStub(aClientHome, anEndpointUri);
ServiceClient *client = aStub->getServiceClient();
PutFileResponse* aPutFileResponse = new PutFileResponse();
//Prepare salome-siman.conf file
- string aTmpDir = "/tmp";
- string aClientFileDir = aTmpDir + "/SimanSalome/" + myStudy + "/" + myScenario + "/" + myUser + "/";
- //string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/";
- string aClientFilePath = aClientFileDir + "salome-siman.conf";
- ofstream aSalomeSimanFile;
+ std::string aTmpDir = "/tmp";
+ std::string aClientFileDir = aTmpDir + "/SimanSalome/" + myStudy + "/" + myScenario + "/" + myUser + "/";
+ //std::string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/";
+ std::string aClientFilePath = aClientFileDir + "salome-siman.conf";
+ std::ofstream aSalomeSimanFile;
aSalomeSimanFile.open(aClientFilePath.c_str());
//Get the actual file URLs and put these files onto server.
/*const*/ SimanIO_Document& aDoc = aDocIter.Document();
SimanIO_Document::FilesIterator aFileIter(aDoc);
for(; aFileIter.More(); aFileIter.Next()) {
- string aURL = aFileIter.URL();
- string aFileName = aURL.substr(aURL.find_last_of("/\\")+1);
- cout << "aURL = " << aURL << "\n";
- cout << " aFileName= " << aFileName << "\n";
+ std::string aURL = aFileIter.URL();
+ std::string aFileName = aURL.substr(aURL.find_last_of("/\\")+1);
+ std::cout << "aURL = " << aURL << "\n";
+ std::cout << "aFileName= " << aFileName << "\n";
//get size of the input file
- ifstream inputStream (aURL.c_str(), ifstream::binary);
- inputStream.seekg(0,ifstream::end);
+ std::ifstream inputStream (aURL.c_str(), std::ifstream::binary);
+ inputStream.seekg(0,std::ifstream::end);
int aSize = inputStream.tellg();
inputStream.seekg(0);
char* aCopyBuffer;
aCopyBuffer = new char [aSize];
inputStream.read(aCopyBuffer,aSize);
+ std::cout << "Upload a file with the size" << aSize << "\n";
axutil_base64_binary_t* aRequestDH = axutil_base64_binary_create_with_plain_binary(Environment::getEnv(), reinterpret_cast<unsigned char*>(aCopyBuffer), aSize);
inputStream.close();
delete[] aCopyBuffer;
aPutFileResponse = aStub->putFile(aPutFileRequest);
+ std::cout << "End of upload. New file locaton is: " << aPutFileResponse->get_return() << "\n";
+
//Write information into salome-siman.conf file
- ostringstream activityId;
- ostringstream documentId;
+ std::ostringstream activityId;
+ std::ostringstream documentId;
activityId << actIter.ActivityId();
documentId << aDocIter.DocId();
aSalomeSimanFile << myScenario + "," + myUser + "," + activityId.str() + "," + documentId.str() + "," + aPutFileResponse->get_return() + "\n";
+ std::cout << "Line in the SalomeSimanFile " << myScenario + "," + myUser + "," + activityId.str() + "," + documentId.str() + "," + aPutFileResponse->get_return() <<"\n";
+ std::cout <<"==========\n";
}//aFileIter
}//aDocIter
aSalomeSimanFile.close();
//Put the salome-siman.conf file onto server
- ifstream inputStream (aClientFilePath.c_str(), ifstream::binary);
- inputStream.seekg(0,ifstream::end);
+ std::ifstream inputStream (aClientFilePath.c_str(), std::ifstream::binary);
+ inputStream.seekg(0,std::ifstream::end);
int aSize = inputStream.tellg();
inputStream.seekg(0);
+// 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_LINK_H
#define SIMANIO_LINK_H
-#include <SimanIO_Configuration.hxx>
+#include "SimanIO_Configuration.hxx"
/**
* \brief Class for creation of connection with SIMAN database.
--- /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
+//
+
+#if !defined(SIMANIO_VERSION_H)
+#define SIMANIO_VERSION_H
+
+/*!
+ Specify version of SimanIO library, as follows
+
+ SIMANIO_VERSION_MAJOR : (integer) number identifying major version
+ SIMANIO_VERSION_MINOR : (integer) number identifying minor version
+ SIMANIO_VERSION_PATCH : (integer) number identifying patch version
+ SIMANIO_VERSION_STR : (string) complete version number "major.minor.patch"
+ SIMANIO_VERSION : (hex) complete version number (major << 16) + (minor << 8) + patch
+*/
+
+#define SIMANIO_VERSION_MAJOR @SIMANIO_MAJOR_VERSION@
+#define SIMANIO_VERSION_MINOR @SIMANIO_MINOR_VERSION@
+#define SIMANIO_VERSION_PATCH @SIMANIO_PATCH_VERSION@
+#define SIMANIO_VERSION_STR "@SIMANIO_VERSION@"
+#define SIMANIO_VERSION (SIMANIO_VERSION_MAJOR << 16 | SIMANIO_VERSION_MINOR << 8 | SIMANIO_VERSION_PATCH)
+
+#endif // SIMANIO_VERSION_H
+// 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
+//
+
#include "CreateConfigFile.h"
#include "CreateConfigFileResponse.h"
#include "GetFile.h"
#include "PutFileResponse.h"
#include "SimanSalomeServiceStub.h"
#include <Environment.h>
+#include <ServiceClient.h>
#include <iostream>
#include <fstream>
-#include <ServiceClient.h>
#include <axiom.h>
#include <axis2_util.h>
#include <axis2_client.h>
#include <axutil_uuid_gen.h>
-
-using namespace std;
using namespace org_splat_ws_server_service_salome;
using namespace wso2wsf;
char * ttest = getenv("SIMAN_WS_HOS");
if (ttest == NULL)
- cout<<"expected\n";
+ std::cout<<"expected\n";
else
- cout<<"unexpected\n";
+ std::cout<<"unexpected\n";
- string aSimanWSHost(getenv("SIMAN_WS_HOST"));
- string endpointUriTT = "http://" + aSimanWSHost + "/Siman-WS/services/SimanSalomeService";
+ std::string aSimanWSHost(getenv("SIMAN_WS_HOST"));
+ std::string endpointUriTT = "http://" + aSimanWSHost + "/Siman-WS/services/SimanSalomeService";
- cout<<"enpoint uri" << endpointUriTT << "\n";
+ std::cout<<"enpoint uri" << endpointUriTT << "\n";
Environment::initialize("SimanSalomeService.log",AXIS2_LOG_LEVEL_DEBUG);
long long studyId = 1000;
long long scenarioId = 1001;
long long userId = 8;
- string newUserId = "8";
+ std::string newUserId = "8";
aRequest->setArgs0(studyId);
aRequest->setArgs1(scenarioId);
aResponse = aStub->createConfigFile(aRequest);
- cout<< "Response:: "<<aResponse->get_return()<<endl;
+ std::cout<< "Response:: "<<aResponse->get_return()<<std::endl;
//Parse the response and get the filename
std::string aResponseFilePath = aResponse->get_return();
std::string aResponseFileName = aResponseFilePath.substr(aResponseFilePath.find_last_of("/\\")+1);
- cout << aResponseFileName << "\n";
+ std::cout << aResponseFileName << "\n";
//Set options
axis2_options_set_action(axis2options, Environment::getEnv(), "urn:getFile");
std::ofstream outputStream;
std::string aClientFilePath = "/dn24/SIMAN/siman_temp/download/" + aResponseFileName;
- outputStream.open(aClientFilePath.c_str(), ofstream::binary);
+ outputStream.open(aClientFilePath.c_str(), std::ofstream::binary);
int aBufferSize = axutil_base64_binary_get_decoded_binary_len(aGetFileResponse->get_return(), Environment::getEnv());
- cout<<aBufferSize<<"\n";
+ std::cout<<aBufferSize<<"\n";
int* aBufSize = new int[aBufferSize];
unsigned char* aCopyBuffer = axutil_base64_binary_get_plain_binary(aGetFileResponse->get_return(), Environment::getEnv(), aBufSize);
//char* aCopyBuf = aCopyBuf;
outputStream.close();
//Second test
- /*string aSourceLoc = "W:\\testvideo\\Darvin.avi";
+ /*std::string aSourceLoc = "W:\\testvideo\\Darvin.avi";
aGetFileRequest->setArgs0(aSourceLoc);
aGetFileResponse = aStub->getFile(aGetFileRequest);
- outputStream.open("/dn24/SIMAN/siman_temp/download/Darvin.avi", ofstream::binary);
+ outputStream.open("/dn24/SIMAN/siman_temp/download/Darvin.avi", std::ofstream::binary);
aBufferSize = axutil_base64_binary_get_decoded_binary_len(aGetFileResponse->get_return(), Environment::getEnv());
- cout<<aBufferSize<<"\n";
+ std::cout<<aBufferSize<<"\n";
aBufSize = new int[aBufferSize];
aCopyBuffer = axutil_base64_binary_get_plain_binary(aGetFileResponse->get_return(), Environment::getEnv(), aBufSize);
outputStream.close();
*/
//End second test
- cout << "See file on path" << aClientFilePath << "\n";
+ std::cout << "See file on path" << aClientFilePath << "\n";
//Upload test
axis2_options_set_action(axis2options, Environment::getEnv(), "urn:putFile");
//char* aSourceFile = "/dn24/SIMAN/siman_temp/download/Mesh_1.med";
//get size of the input file
- ifstream infile ("/dn24/SIMAN/siman_temp/download/Mesh_1.med",ifstream::binary);
- infile.seekg(0,ifstream::end);
+ std::ifstream infile ("/dn24/SIMAN/siman_temp/download/Mesh_1.med",std::ifstream::binary);
+ infile.seekg(0,std::ifstream::end);
int aSize = infile.tellg();
- cout << "Size of the input file is: " << aSize << "\n";
+ std::cout << "Size of the input file is: " << aSize << "\n";
infile.seekg(0);
char * inBuffer;
aPutFileRequest->setArgs1("Mesh_1.med");
aPutFileRequest->setArgs2(userId);
- cout << "test" <<"\n";
+ std::cout << "test" <<"\n";
PutFileResponse* aPutFileResponse = new PutFileResponse();
aPutFileResponse = aStub->putFile(aPutFileRequest);
- cout<< "Response:: "<<aPutFileResponse->get_return()<<endl;
+ std::cout<< "Response:: "<<aPutFileResponse->get_return()<<std::endl;
delete aResponse;
delete aRequest;
delete aPutFileResponse;
delete aPutFileRequest;
delete aStub;
-}
\ No newline at end of file
+}