[Chameleon] Query tool customisation

Paul Spencer pspencer at dmsolutions.ca
Thu Mar 31 06:36:10 EST 2005


Rhys,

a good explanation of how <cwc2 type="Query" .../> becomes a new Query() 
is beyond the scope of what I could cover in a quick email response, but 
I am (going to be) working on a document to describe how Chameleon works 
internally which would answer this question.  Unfortunately its not 
available just yet.

The basics are:

* make a copy of an existing widget ;)
* rename directory and xxx.widget.php file to match the new widget name 
(case sensitive, the new widget name becomes the type="" in the tag)
* change the name of the class and the constructor in the .widget.php file

at this point, you have a functioning widget under a new name.

The sequence that a widget goes through is:

* constructor and initdefaults are called during CWCInitialize()

* ParseURL is called at the beginning of CWCExecute()

* GetXXXXX and finally DrawPublish() are called as the last step of 
CWCExecute()

Cheers

Paul

Rhys Ickeringill wrote:
> Hi again list,
> 
> I wish to create a new chameleon tool which has similar functionality to the
> Query navigation tool - user clicks on feature on map, resulting in a new
> popup with information about that feature. I figure the most expedient way
> to do this is to subclass NavTool or possibly the Query class. Unfortunately
> there's a bit of a gulf between ambition and talent (or at least knowledge).
> 
> Having looked at the files {widgets/Query.widget.php,
> /widgets/QueryResult.phtml, /wrapper/map_query.php} there's a few things I
> don't understand. For instance I can't seem to find how Chameleon goes from
> <CWC2 type="query" ... /> to creating a Query widget in the server side
> processing. A quick grepping of the chameleon directories fails to find
> anywhere where a "new Query" is executed (only a few "new QueryResults")
> 
> But perhaps most importantly, I can't seem to find how the properties of the
> Query class get set - there are no methods in the Query class which do
> anything with the properties other than set the defaults. ie. where
> something interprets
> 
> <CWC2 type="query" ... highlightresults="true">
> 
> as
> 
> $oQuery = new Query();
> $oQuery->$mbPopupResults = true;
> 
> In essance what I'm asking is "what do I have to do to support the wiring up
> of CWC2 tags to class member variables?"
> 
> Thanks
> 
> - Rhys
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 


More information about the Chameleon mailing list