- Timestamp:
- Jun 29, 2016, 3:40:46 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/install/installation.rst
r725 r784 87 87 ZOO-Kernel will be deployed in the specified directory (so, 88 88 `/Lbrary/WebServer/CGI-Executables`` in this example). 89 90 Specific main.cfg location (Optional) 91 ************************************** 92 93 Per default, the ZOO-Kernel search for the ``main.cfg`` file from its 94 installation directory but, in case you want to store this file in 95 another place, then you can use the ``--with-etc-dir`` option so it 96 will search for the ``main.cfg``file in the ``sysconfdir`` directory. 97 98 For instance, you can define that the directory to store the 99 ``main.cfg`` file is the ``/etc/zoo-project`` directory, by using the 100 following command: 101 102 .. code:: 103 104 ./configure --with-etc-dir=yes --sysconfdir=/etc/zoo-project 105 89 106 90 107 .. _zoo_install_db_backend: -
trunk/docs/kernel/configuration.rst
r772 r784 87 87 Resource Sharing <https://www.w3.org/TR/cors/>`__. If this 88 88 paramater is not defined, then the ZOO-Kernel won't support CORS. 89 * ``servicePath``: Define a specific location to search for services 90 rather than using the ZOO-Kernel directory. If this parameter is 91 not defined, then the ZOO-Kernel will search for services using its 92 directory. 89 93 90 94 In case you have activated the MapServer support, please refer to -
trunk/zoo-project/HISTORY.txt
r781 r784 1 1 Version 1.6.0-dev 2 * Add servicePath special key to specify the service location 3 * Add --with-etc-dir option to specify the location of the main.cfg file 2 4 * Support GDAL version 2.1.0. 3 5 * Add the MapServer 7.0.1 internal support. -
trunk/zoo-project/zoo-kernel/Makefile.in
r780 r784 3 3 all: version.h zoo_loader.cgi ${YAML_FILE1} 4 4 5 version.h: 5 version.h: Makefile 6 6 echo "#define ZOO_VERSION \"`svnversion`\"" > version.h 7 echo "@ETC_DEF@" >> version.h 8 echo "#define LOCALEDIR \"@localedir@\"" >> version.h 7 9 8 10 service.o: service.c service.h … … 90 92 g++ -c ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} service_loader.c 91 93 92 zoo_service_loader.o: zoo_service_loader.c service.h 94 zoo_service_loader.o: zoo_service_loader.c service.h version.h ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} 93 95 g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${SAGA_CFLAGS} ${OTBCFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${SAGA_ENABLED} ${OTB_ENABLED} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} -c zoo_service_loader.c -fno-common -DPIC -o zoo_service_loader.o 94 96 -
trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in
r753 r784 99 99 LDFLAGS=-lzoo_service @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ -luuid ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} 100 100 101 DATAROOTDIR=@datarootdir@/zoo-project -
trunk/zoo-project/zoo-kernel/configure.ac
r775 r784 67 67 fi 68 68 AC_SUBST([DEB_DEF]) 69 70 AC_ARG_WITH([etc-dir], 71 [AS_HELP_STRING([--with-etc-dir=PATH], [Specifies an alternative path to store the main.cfg file ( default: ZOO-Kernel location) ])], 72 [ETC_DEF="#define ETC_DIR \\\"${sysconfdir}\\\""], [ETC_DEF=""]) 73 AC_SUBST([ETC_DEF]) 69 74 70 75 AC_ARG_WITH([cgi-dir], -
trunk/zoo-project/zoo-kernel/locale/po/messages.po
r781 r784 305 305 msgstr "Unable to load the main.cfg file." 306 306 307 #: zoo_service_loader.c:895 308 msgid "%s The following file: %s cannot be found." 309 msgstr "%s The following file: %s cannot be found." 310 307 311 #: zoo_service_loader.c:940 308 312 #, c-format -
trunk/zoo-project/zoo-kernel/main_conf_read.l
r771 r784 36 36 attname [a-zA-Z0-9_\-:.]+ 37 37 38 attvalue1 [%\*,;@a-zA-Z0-9_\-.:" "\"\'/\\\(\)\+\x41-\xff?&= ]+38 attvalue1 [%\*,;@a-zA-Z0-9_\-.:" "\"\'/\\\(\)\+\x41-\xff?&=\!$]+ 39 39 40 40 whitesp [ ] -
trunk/zoo-project/zoo-kernel/response_print.c
r781 r784 1546 1546 * Else fallback to the initial method using the xml file to write in ... 1547 1547 */ 1548 char ntmp[1024]; 1549 #ifndef WIN32 1550 getcwd(ntmp,1024); 1551 #else 1552 _getcwd(ntmp,1024); 1553 #endif 1548 map* cwdMap=getMapFromMaps(m,"main","servicePath"); 1554 1549 struct stat myFileInfo; 1555 1550 int statRes; 1556 1551 char file_path[1024]; 1557 sprintf(file_path,"%s/GetStatus.zcfg",ntmp); 1552 if(cwdMap!=NULL){ 1553 sprintf(file_path,"%s/GetStatus.zcfg",cwdMap->value); 1554 }else{ 1555 char ntmp[1024]; 1556 #ifndef WIN32 1557 getcwd(ntmp,1024); 1558 #else 1559 _getcwd(ntmp,1024); 1560 #endif 1561 sprintf(file_path,"%s/GetStatus.zcfg",ntmp); 1562 } 1563 fprintf(stderr,"%s \n",file_path); 1558 1564 statRes=stat(file_path,&myFileInfo); 1559 1565 if(statRes==0){ -
trunk/zoo-project/zoo-kernel/service_internal_js.c
r781 r784 70 70 JS_MaybeGC(cx); 71 71 72 char ntmp[1024];73 getcwd(ntmp,1024);74 75 72 jsval *argv = JS_ARGV(cx,argv1); 76 73 int i=0; … … 78 75 for(i=0;i<argc;i++){ 79 76 char *filename = JSValToChar(cx,&argv[i]); 80 char *api0=(char*)malloc((strlen(ntmp)+strlen(filename)+2)*sizeof(char));81 sprintf(api0,"%s/%s",ntmp,filename);82 77 #ifdef JS_DEBUG 83 78 fprintf(stderr,"Trying to load %s\n",api0); 84 79 fflush(stderr); 85 80 #endif 86 JSObject *api_script1=loadZooApiFile(cx,JS_GetGlobalObject(cx),api0); 87 free(api0); 81 JSObject *api_script1=loadZooApiFile(cx,JS_GetGlobalObject(cx),filename); 88 82 } 89 83 JS_MaybeGC(cx); … … 175 169 map* tmpm1=getMap(request,"metapath"); 176 170 char ntmp[1024]; 177 getcwd(ntmp,1024); 171 map* cwdMap=getMapFromMaps(*main_conf,"main","servicePath"); 172 if(cwdMap!=NULL) 173 sprintf(ntmp,"%s",cwdMap->value); 174 else 175 getcwd(ntmp,1024); 178 176 179 177 /** -
trunk/zoo-project/zoo-kernel/service_internal_php.c
r738 r784 185 185 maps* inputs=*real_inputs; 186 186 maps* outputs=*real_outputs; 187 char ntmp[1024];188 getcwd(ntmp,1024);189 187 190 188 map* libp = getMapFromMaps(m, "main", "libPath"); -
trunk/zoo-project/zoo-kernel/service_internal_python.c
r781 r784 168 168 } 169 169 else{ 170 python_path=(char*)"."; 170 map* cwdMap=getMapFromMaps(*main_conf,"main","servicePath"); 171 if(cwdMap!=NULL) 172 python_path=cwdMap->value; 173 else 174 python_path=(char*)"."; 171 175 } 172 176 tmp=NULL; -
trunk/zoo-project/zoo-kernel/sqlapi.c
r734 r784 27 27 #include "ogrsf_frmts.h" 28 28 #include "ogr_p.h" 29 #if GDAL_VERSION_MAJOR >= 2 30 #include <gdal_priv.h> 31 #endif 29 32 30 33 #include "sqlapi.h" … … 35 38 * Global GDALDataset pointer 36 39 */ 37 OGRDataSource *zoo_DS = NULL; 40 #if GDAL_VERSION_MAJOR >=2 41 GDALDataset 42 #else 43 OGRDataSource 44 #endif 45 *zoo_DS = NULL; 38 46 39 47 /** … … 98 106 OGRSFDriver *poDriver = NULL; 99 107 OGRRegisterAll(); 108 109 #if GDAL_VERSION_MAJOR >= 2 110 zoo_DS = (GDALDataset*) GDALOpenEx( sqlInitString, 111 GDAL_OF_UPDATE | GDAL_OF_VECTOR, 112 NULL, NULL, NULL ); 113 #else 100 114 zoo_DS = OGRSFDriverRegistrar::Open(sqlInitString,false,&poDriver); 115 #endif 101 116 if( zoo_DS == NULL ){ 102 117 #ifdef DEBUG … … 124 139 zoo_DS->ReleaseResultSet( zoo_ResultSet ); 125 140 if(zoo_DS!=NULL){ 141 #if GDAL_VERSION_MAJOR >= 2 142 GDALClose(zoo_DS); 143 #else 126 144 OGRDataSource::DestroyDataSource( zoo_DS ); 145 #endif 127 146 zoo_DS=NULL; 128 147 } -
trunk/zoo-project/zoo-kernel/sqlapi.h
r680 r784 25 25 #ifndef ZOO_SQLAPI_H 26 26 #define ZOO_SQLAPI_H 1 27 #ifdef RELY_ON_DB 28 #include "service.h" 29 #include "service_internal.h" 27 30 28 31 #ifdef __cplusplus 29 32 extern "C" { 30 33 #endif 31 32 #ifdef RELY_ON_DB33 #include "service.h"34 #include "service_internal.h"35 34 ZOO_DLL_EXPORT void init_sql(maps*); 36 35 ZOO_DLL_EXPORT void close_sql(maps*); … … 43 42 ZOO_DLL_EXPORT char* getStatusId(maps*,char*); 44 43 ZOO_DLL_EXPORT void removeService(maps*,char*); 45 #endif46 44 47 45 #ifdef __cplusplus … … 50 48 51 49 #endif 50 #endif -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r781 r784 415 415 */ 416 416 map *r_inputs = NULL; 417 map* cwdMap=getMapFromMaps(m,"main","servicePath"); 418 if(cwdMap!=NULL){ 419 sprintf(ntmp,"%s",cwdMap->value); 420 }else{ 417 421 #ifndef WIN32 418 getcwd (ntmp, 1024);422 getcwd (ntmp, 1024); 419 423 #else 420 _getcwd (ntmp, 1024); 421 #endif 424 _getcwd (ntmp, 1024); 425 #endif 426 } 422 427 r_inputs = getMap (s1->content, "serviceType"); 423 428 #ifdef DEBUG … … 915 920 } 916 921 char ntmp[1024]; 922 #ifndef ETC_DIR 917 923 #ifndef WIN32 918 924 getcwd (ntmp, 1024); … … 920 926 _getcwd (ntmp, 1024); 921 927 #endif 928 #else 929 sprintf(ntmp,"%s",ETC_DIR); 930 #endif 922 931 r_inputs = getMapOrFill (&request_inputs, "metapath", ""); 923 932 924 933 char conf_file[10240]; 925 934 snprintf (conf_file, 10240, "%s/%s/main.cfg", ntmp, r_inputs->value); 935 #ifdef ETC_DIR 936 #ifndef WIN32 937 getcwd (ntmp, 1024); 938 #else 939 _getcwd (ntmp, 1024); 940 #endif 941 #endif 926 942 if (conf_read (conf_file, m) == 2) 927 943 { … … 945 961 else 946 962 { 947 bindtextdomain ("zoo-kernel", "/usr/share/locale/");948 bindtextdomain ("zoo-services", "/usr/share/locale/");963 bindtextdomain ("zoo-kernel", LOCALEDIR); 964 bindtextdomain ("zoo-services", LOCALEDIR); 949 965 } 950 966 … … 1186 1202 r_inputs = NULL; 1187 1203 r_inputs = getMap (request_inputs, "metapath"); 1188 1204 map* cwdMap0=getMapFromMaps(m,"main","servicePath"); 1189 1205 if (r_inputs != NULL) 1190 snprintf (conf_dir, 1024, "%s/%s", ntmp, r_inputs->value); 1206 if(cwdMap0!=NULL) 1207 snprintf (conf_dir, 1024, "%s/%s", cwdMap0->value, r_inputs->value); 1208 else 1209 snprintf (conf_dir, 1024, "%s/%s", ntmp, r_inputs->value); 1191 1210 else 1192 snprintf (conf_dir, 1024, "%s", ntmp); 1193 1211 if(cwdMap0!=NULL) 1212 snprintf (conf_dir, 1024, "%s", cwdMap0->value); 1213 else 1214 snprintf (conf_dir, 1024, "%s", ntmp); 1194 1215 map* reg = getMapFromMaps (m, "main", "registry"); 1195 1216 registry* zooRegistry=NULL; … … 1292 1313 { 1293 1314 errorException (m, _("The specified path does not exist."), 1294 "In validParameterValue", conf_dir);1315 "InternalError", NULL); 1295 1316 freeMaps (&m); 1296 1317 free (m); … … 1617 1638 } 1618 1639 1619 r_inputs = getMap (request_inputs, "MetaPath");1620 if (r_inputs != NULL)1621 snprintf (tmps1, 1024, "%s/%s", ntmp, r_inputs->value);1622 else1623 snprintf (tmps1, 1024, "%s/", ntmp);1624 1640 r_inputs = getMap (request_inputs, "Identifier"); 1625 char *ttmp = zStrdup (tmps1); 1626 snprintf (tmps1, 1024, "%s/%s.zcfg", ttmp, r_inputs->value); 1627 free (ttmp); 1641 snprintf (tmps1, 1024, "%s/%s.zcfg", conf_dir, r_inputs->value); 1628 1642 #ifdef DEBUG 1629 1643 fprintf (stderr, "Trying to load %s\n", tmps1); … … 1862 1876 * - message : is a string where you can store error messages, in case 1863 1877 * service is failing, or o provide details on the ongoing operation. 1864 * - cwd : is the current working directory1878 * - cwd : the current working directory or servicePath if defined 1865 1879 * - soap : is a boolean value, true if the request was contained in a SOAP 1866 1880 * Envelop … … 1888 1902 free(tmpUuid); 1889 1903 addToMap (_tmpMaps->content, "status", "0"); 1890 addToMap (_tmpMaps->content, "cwd", ntmp); 1904 if(cwdMap0!=NULL){ 1905 addToMap (_tmpMaps->content, "cwd", cwdMap0->value); 1906 addToMap (_tmpMaps->content, "rcwd", ntmp); 1907 } 1908 else 1909 addToMap (_tmpMaps->content, "cwd", ntmp); 1891 1910 addToMap (_tmpMaps->content, "message", _("No message provided")); 1892 1911 map *ltmp = getMap (request_inputs, "soap");
Note: See TracChangeset
for help on using the changeset viewer.