[Chameleon] Remote Template/context document question, and potential code con tributions

Paul Spencer pspencer at dmsolutions.ca
Thu Dec 16 12:53:35 EST 2004


Chris, templates and contexts should be able to be referenced by URL as 
well as by local path on the server.

The documentation distributed with the current release version (1.99 
beta 4) does include a reasonably complete description of how to use 
remote files with contexts and templates, including a description of 
common problems.  The pertinent part is:

  TEMPLATES

A list of application template paths or URLs separated by commas. A 
template is identified either by a relative (to the template root 
directory specified in the Service Instance configuration) path on the 
server or by a URL to a Web-accessible template. The templates are 
listed in the same order as their related language specifiers in the 
LANGUAGES parameter, with one template required for each supported 
language (even if the same template supports every language). URLs must 
be in the standard http://{server}/path/template.html format and must be 
URL-encoded.

Example URL

The following URL could be used to support a bilingual application using 
remote template files:

http://localhost/chameleon/cwc2/cwc2.php?request=GetApplication&version=
0.1.0&LANGUAGES=en-CA,fr-CA&TEMPLATES=
http://localhost/chameleon/cwc2/templates/sample_cwc2_en.html,http://localhost/
chameleon/cwc2/templates/sample_cwc2_fr.html


This parameter is optional unless LANGUAGES is set, in which case it 
becomes mandatory. The Service Instance defines a default template in 
its configuration file.

CONTEXTS

A list of Web map context paths or URLs separated by commas. A context 
is identified either by a relative (to a directory specified in the 
Service Instance configuration) path on the server or a URL to a 
Web-accessible context. The contexts are loaded in the order in which 
they appear in this list, and the projection and spatial extents are 
taken from the last context loaded (see Common Problems below). The 
order of these contexts determines the order in which the layers of each 
context are drawn. Layers from the first context in the list are drawn 
first, layers from later contexts are drawn 'on top' of earlier ones. 
URLs must be in the standard http://{server}/path/template.html format 
and must be URL-encoded.

Example URL

The following URL could be used to get multiple remote contexts while 
using the default template and language:

http://localhost/chameleon/cwc2/cwc2.php?request=GetApplication&version=
0.1.0&LANGUAGES=en-CA,fr-CA&TEMPLATES=
http://localhost/chameleon/cwc2/templates/sample_cwc2_en.html,http://localhost/
chameleon/cwc2/templates/sample_cwc2_fr.html


This parameter is optional. The Service Instance defines a default value 
context in its configuration file.

This document (ServiceInstance.html) is also available on the Chameleon 
docs page at:

http://www.maptools.org/chameleon/index.phtml?page=ServiceInstance.html

The URL you are using does not look valid because the second template 
appears to be truncated?

_Demo.html,http://localhost/&contexts=http:
                             ^
Also (as noted in the documentation) the urls you use must be resolvable 
on the SERVER that you are using.  In general, if you are using 
localhost then it's okay, but if you use http://nfis.org/... and then 
refer to a template on localhost, it won't work (unless the template is 
on nfis.org I guess ;)

Cheers,

Paul


West, Chris wrote:
> Hi everyone,
>  
> I am wondering if it is possible to get the CWC2 service instance to work
> with template and context files that are not on the same web server as the
> Chameleon/CWC2 instance. 
> An example URL that I'm trying is:
> http://localhost/chameleon/cwc2/cwc2.php?request=GetApplication&SERVICE=VCG&
> version=0.1.0&LANGUAGES=en-CA,fr-CA&TEMPLATES=http://nfis.org/chameleon/nfis
> _portal_Demo.html,http://localhost/&contexts=http://nfis.org/chameleon/local
> host_provinces.cml.
> 
> I recall that in an earlier version of CWC2 this was possible, but I
> couldn't find any examples of this in the ServiceInstance documentation for
> Version 1.99
> (http://www.maptools.org/chameleon/index.phtml?page=ServiceInstance.html). 
> The main problem that I am running into is that a blank map is returned
> anytime one of the Navigation widgets is used.
> 
> 
> On a different subject. We have made some slight bug fixes for a few of the
> widgets, as well as creating some new widgets. Is there a procedure for
> Chameleon users to submit potential code/documentation contributions to the
> Chameleon project?
> 
> Thanks
> 
> Chris West 
>                                                            
> Natural Resources Canada, Ressources naturelles Canada     
> Canadian Forest Service,  Service Canadien des forêts      
> Pacific Forestry Centre,  Centre de foresterie du Pacifique 
> 506 West Burnside Road,   506, chemin Burnside ouest       
> Victoria, BC              Victoria, (C.-B.),               
> CANADA V8Z 1M5            CANADA V8Z 1M5      
>              
> Tel: (250) 363-3212       Facs: (250) 363-0775 
> 
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 

-- 
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+


More information about the Chameleon mailing list