MapTools.org

[Chameleon] PHP Mapscript and Chameleon

Paul Spencer spencer@dmsolutions.ca
Tue, 09 Dec 2003 20:48:36 -0500
Liz,

I don't think that it would really be possible to do this.  Tom's 
suggestion is correct, you can point the 'template' attribute at any 
valid url which could be a php script to generate the template. 
However, this script would not know about the current user's session 
(unless we came up with a way to pass the session id as part of the 
template request), and if the script was on a different url, there may 
be a security issue (cross-site-scripting-attacks).

Even if this was possible and a good idea, it may cause unexpected side 
effects due to the order in which things are done (I don't know this for 
sure, this is just a speculation), i.e. if chameleon loads the map 
before loading the template for some reason.

I am hesitant to recommend any sort of non-widget approach for what you 
want because changing state on the fly is something that is fairly 
intrinsic to the operation of the framework and widgets, and could be 
fairly brittle to this kind of outside alteration.

I will say that in Chameleon 1.1/2.0, you have much better control over 
the application if you chose not to use the service instance (which 
doesn't exist yet ;)) in that you have a main PHP file that you can use 
to alter how map files and templates are processed ... I am sure this 
would solve your issues in fact.

If you are willing to live with a few growing pains, it may be worth 
going this route ... or if you can wait about 8 weeks :)

Cheers,

Paul

Liz Godwin wrote:

> I would like to know the extent to which I can use PHP / Mapscript with
> Chameleon while avoiding making a new widget.  Has anyone done this, or
> know about it?
> 
> I talked briefly with Tom Kralidis about this, and he said that I could
> use a php file as a template if I reference it http://path/template.php,
> because the php would be interpreted by the server before being passsed
> to Chameleon.  
> 
> However, can I send this template requests stored in form variables
> much the same way I would with a normal self processing php page?  How
> does that interfere with Chameleon?
> 
> Why do I want to do this?
> 
> There are some things I want to do, or may want to do, that are not
> written into widgets, and that I may not want to write into a widget.
> I'm still exploring my options, this is just part of it.  I have some
> dynamic layers, special query templates, and HTML legends. 
> 
> Cheers,
> 
> Liz
> _______________________________________________
> Chameleon mailing list
> Chameleon@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 

-- 
  -----------------------------------------------------------------
|Paul Spencer                           spencer@dmsolutions.ca    |
|-----------------------------------------------------------------|
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
  -----------------------------------------------------------------




This archive was generated by Pipermail.