Ignore:
Timestamp:
Mar 9, 2015, 4:46:24 PM (9 years ago)
Author:
knut
Message:

Altered the path of stored response files from [tmpPath]/[serviceProvider]_[cpid].xml to [tmpPath]/[serviceName]_[cpid].xml. Added support for a new parameter, libPath, in the [main] block of main.cfg. The libPath parameter is interpreted as the absolute path of the directory containing library files. If the libPath parameter is set, it will override the metapath parameter such that library files are loaded from [libPath]/[serviceProvider] instead of [CWD]/[metapath]/[serviceProvider]. Added the option to disable the metapath parameter (for security reasons) at compile time: If the Zoo kernel is compiled with the preprocessor directive IGNORE_METAPATH, the metapath will be set to the empty string. Note however, that the libPath and IGNORE_METAPATH options so far only work for C and PHP; the functions for loading libraries written in other languages should be modified correspondingly before the documentation is updated. See also ticket no. 112 (http://www.zoo-project.org/trac/ticket/112). Fixed some spelling errors and modified the language in some of the messages returned by the Zoo kernel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r601 r605  
    195195              char emsg[1024];
    196196              sprintf (emsg,
    197                        _("You set maximum occurences for <%s> as %i but you tried to use it more than the limit you set. Please correct your ZCFG file or your request."),
     197                       _("The maximum allowed occurrences for <%s> (%i) was exceeded."),
    198198                       mi->name, atoi (testMap->value));
    199199              errorException (m, emsg, "InternalError", NULL);
     
    227227              sprintf (emsg,
    228228                       _
    229                        ("You set maximum occurences for <%s> to one but you tried to use it more than once. Please correct your ZCFG file or your request."),
     229                       ("The maximum allowed occurrences for <%s> is one."),
    230230                       mi->name);
    231231              errorException (m, emsg, "InternalError", NULL);
     
    371371{
    372372#ifdef DEBUG
    373   fprintf (stderr, "Signal %d after the ZOO-Kernel returned result !\n", sig);
     373  fprintf (stderr, "Signal %d after the ZOO-Kernel returned result!\n", sig);
    374374#endif
    375375  exit (0);
     
    407407  sprintf (tmp,
    408408           _
    409            ("ZOO Kernel failed to process your request receiving signal %d = %s"),
     409           ("ZOO Kernel failed to process your request, receiving signal %d = %s"),
    410410           sig, ssig);
    411411  errorException (NULL, tmp, "InternalError", NULL);
     
    439439  fflush (stderr);
    440440#endif
     441
     442  map* libp = getMapFromMaps(m, "main", "libPath");
     443 
    441444  if (strlen (r_inputs->value) == 1
    442445      && strncasecmp (r_inputs->value, "C", 1) == 0)
    443     {
    444       r_inputs = getMap (request_inputs, "metapath");
    445       if (r_inputs != NULL)
    446         sprintf (tmps1, "%s/%s", ntmp, r_inputs->value);
    447       else
    448         sprintf (tmps1, "%s/", ntmp);
    449       char *altPath = zStrdup (tmps1);
    450       r_inputs = getMap (s1->content, "ServiceProvider");
    451       sprintf (tmps1, "%s/%s", altPath, r_inputs->value);
    452       free (altPath);
     446  {
     447     if (libp != NULL && libp->value != NULL) {
     448            r_inputs = getMap (s1->content, "ServiceProvider");
     449                sprintf (tmps1, "%s/%s", libp->value, r_inputs->value);
     450         }
     451     else {     
     452        r_inputs = getMap (request_inputs, "metapath");
     453        if (r_inputs != NULL)
     454          sprintf (tmps1, "%s/%s", ntmp, r_inputs->value);
     455        else
     456          sprintf (tmps1, "%s/", ntmp);
     457         
     458        char *altPath = zStrdup (tmps1);
     459        r_inputs = getMap (s1->content, "ServiceProvider");
     460        sprintf (tmps1, "%s/%s", altPath, r_inputs->value);
     461        free (altPath);
     462         }
    453463#ifdef DEBUG
    454464      fprintf (stderr, "Trying to load %s\n", tmps1);
     
    613623              errstr = dlerror ();
    614624#endif
    615           sprintf (tmps, _("C Library can't be loaded %s"), errstr);
     625          sprintf (tmps, _("Unable to load C Library %s"), errstr);
    616626          errorException(m,tmps,"InternalError",NULL);
    617627          *eres = -1;
     
    739749  map *r_inputs = getMapFromMaps (m, "main", "tmpPath");
    740750  map *r_inputs1 = getMap (request_inputs, "metapath");
     751 
    741752  int hasIn = -1;
    742753  if (r_inputs1 == NULL)
     
    883894  map *r_inputs = NULL;
    884895  map *request_inputs = *inputs;
     896#ifdef IGNORE_METAPATH
     897  addToMap(request_inputs, "metapath", "");
     898#endif 
    885899  maps *m = NULL;
    886900  char *REQUEST = NULL;
     
    901915#endif
    902916  r_inputs = getMapOrFill (&request_inputs, "metapath", "");
    903 
    904917
    905918  char conf_file[10240];
     
    10931106    }
    10941107
    1095 
    10961108  maps *request_output_real_format = NULL;
    10971109  map *tmpm = getMapFromMaps (m, "main", "serverAddress");
     
    11121124  r_inputs = NULL;
    11131125  r_inputs = getMap (request_inputs, "metapath");
     1126 
    11141127  if (r_inputs != NULL)
    11151128    snprintf (conf_dir, 1024, "%s/%s", ntmp, r_inputs->value);
     
    11601173      if (dirp == NULL)
    11611174        {
    1162           errorException (m, _("The specified path path doesn't exist."),
     1175          errorException (m, _("The specified path path does not exist."),
    11631176                          "InvalidParameterValue", conf_dir);
    11641177          freeMaps (&m);
     
    13751388          errorException (m,
    13761389                          _
    1377                           ("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."),
     1390                          ("The <request> value was not recognized. Allowed values are GetCapabilities, DescribeProcess, and Execute."),
    13781391                          "InvalidParameterValue", "request");
    13791392#ifdef DEBUG
     
    14411454      sprintf (tmpMsg,
    14421455               _
    1443                ("The value for <identifier> seems to be wrong (%s). Please, ensure that the process exist using the GetCapabilities request."),
     1456               ("The value for <identifier> seems to be wrong (%s). Please specify one of the processes in the list returned by a GetCapabilities request."),
    14441457               r_inputs->value);
    14451458      errorException (m, tmpMsg, "InvalidParameterValue", "identifier");
     
    27862799              snprintf (tmps, 1024,
    27872800                        _
    2788                         ("The <%s> parameter has a limited size (%sMB) defined in ZOO ServicesProvider configuration file but the reference you provided exceed this limitation (%fMB), please correct your query or the ZOO Configuration file."),
     2801                        ("The <%s> parameter has a size limit (%s MB) defined in the ZOO ServicesProvider configuration file, but the reference you provided exceeds this limit (%f MB)."),
    27892802                        ptr->name, tmp1->value, i);
    27902803              addToMap (tmpe, "locator", ptr->name);
     
    28302843            snprintf (tmps, 1024,
    28312844                      _
    2832                       ("The <%s> argument was not specified in DataInputs but defined as requested in ZOO ServicesProvider configuration file, please correct your query or the ZOO Configuration file."),
     2845                      ("The <%s> argument was not specified in DataInputs but is required according to the ZOO ServicesProvider configuration file."),
    28332846                      errp->value);
    28342847            setMapArray (tmpe, "locator", nb , errp->value);
     
    28562869            snprintf (tmps, 1024,
    28572870                      _
    2858                       ("The <%s> argument was specified as %s identifier but not defined in the ZOO Configuration File. Please, correct your query or the ZOO Configuration File."),
     2871                      ("The <%s> argument specified as %s identifier was not recognized (not defined in the ZOO Configuration File)."),
    28592872                      errp->value,
    28602873                      ((getMap(request_inputs,"RawDataOutput")!=NULL)?"RawDataOutput":"ResponseDocument"));
     
    30513064      errorException (m,
    30523065                      _
    3053                       ("Status cannot be set to true with storeExecuteResponse to false. Please, modify your request parameters."),
     3066                      ("The status parameter cannot be set to true if storeExecuteResponse is set to false. Please modify your request parameters."),
    30543067                      "InvalidParameterValue", "storeExecuteResponse");
    30553068      freeService (&s1);
     
    32703283          int cpid = atoi (r_inputs->value);
    32713284          r_inputs = getMapFromMaps (m, "main", "tmpPath");
    3272           map *r_inputs1 = getMap (s1->content, "ServiceProvider");
     3285          //map *r_inputs1 = getMap (s1->content, "ServiceProvider");
     3286                  map* r_inputs1 = createMap("ServiceName", s1->name);
     3287
    32733288          fbkp =
    32743289            (char *)
     
    33573372                    cpid, m, eres);
    33583373  fflush (stdout);
     3374 
    33593375  /**
    33603376   * Ensure that if error occurs when freeing memory, no signal will return
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png