Opened 12 years ago

Closed 12 years ago

#464 closed enhancement (fixed)

Variable substitution for service source URLs

Reported by: etdube Owned by: etdube
Priority: major Milestone: 1.6.0
Component: server Version: trunk
Keywords: bis-1.6.0 Cc: adube

Description

A GeoPrisma configuration (be it an XML file or DB config) currently contains project-specific (i.e. layers, datasources, widget definitions, etc.) and instance-specific (i.e. service URLs) settings. To make the deployment of a GeoPrisma project to a specific environment (e.g. development, test and production systems), that can be setup with different service URLs, we wish to make the service URLs configurable by a mechanism external to the XML file or DB config.

This ticket proposes a new feature for service sources, which would provide variable substitution in the service URLs. The variable values are to be retrieved from the PHP session variables. It is proposed that variable placeholders will follow this syntax ${GP_VARIABLE_NAME} (the GP_ prefix is mandatory, and VARIABLE_NAME can be substituted by any: valid alphanumeric identifier, with underscores being an accepted character as well). GeoPrisma will then try to match any placeholder following this pattern within the <source> elements in service definitions, and lookup a PHP session variable with the exact same name (e.g. GP_VARIABLE_NAME), then if the match is found, substitute the placeholder with the variable value when constructing the Service objects. If no session variable matching the same name is found, the placeholder is left as is.

Change History (5)

comment:1 by etdube, 12 years ago

Owner: set to etdube

comment:2 by etdube, 12 years ago

Change committed in r1400

comment:3 by adube, 12 years ago

Cc: adube added
Component: documentationserver
Keywords: bis-1.6.0 added
Version: unspecifiedtrunk

etdube,

Thanks for the fix. Could you please make the according updates :

  • run the site/php/service/test/test_sniffer.php script and make the according changes to follow the coding standards
  • document this now feature in docs/source/concepts/index.rst, under 'services'
  • add an entry to HISTORY.txt with this ticket number.
  • it would be nice to have an new sample added showing this in action. Users often rely on samples to see how things work.

After all that, you can close the ticket. Thanks again for your work.

comment:4 by adube, 12 years ago

It appears that r1400 broke the server part. All samples on www.geoprisma.org return errors 500. There must be a small typo in the provided fix.

Please, make the according changes to make it work again. Thanks.

comment:5 by etdube, 12 years ago

Resolution: fixed
Status: newclosed

Fixed and updates (coding standards, documentation, HISTORY.txt and sample) done.

Note: See TracTickets for help on using tickets.