[Cartoweb-users] retrieve layers for the mapfile

Alexandre Saunier alexandre.saunier at camptocamp.com
Fri Nov 17 09:01:05 EST 2006


Hello,

client-side:
------------
- in handleHttpPostRequest(), set a class property with the value of 
exampleSelecting

- in buildRequest(), instanciate the plugin request class (to write in 
the common/ part of the plugin - have a look for instance at the outline 
plugin common/ part) and insert your exampleSelecting value in order to 
send it to the server part

- handleResult() and initializeResult() are only useful if you want to 
handle the server part response. Else you may leave them empty.

server-side:
-------------
- $request is the plugin request object you have sent from the 
client-side with buildRequest()

- depending on the request class you wrote, retrieve you raster filename 
  in for instance $request->exampleSelecting

- in handlePreDrawing(), write for instance:
$layer->data = $request->exampleSelecting
"the_new_raster_file_path" in my previous example was just a comment on 
what to put in $layer->data

AS


Stéphane LII wrote:
> Bonjour Alexandre,
> I made a client Plugin for the choice of a raster file name. The Client
> Interface is a simple input text tag html.
> With the Gui Provider, i can retrieve in a variable named exampleSelecting
> for the name of a raster file.
> That 's fine. I can see with handleHttpPostRequest that i can access to this
> variable.
> 
> But
> 
> In your class ServerRasterfileSelector :
> 
> $request :  what's this ?
> "The_new_raster_file_path" is hard coded ? how; layer->data can contain my
> data of exampleSelecting variable written by a user ?
> How this handlePreDrawing method is called ? and by whom ?
> 
> The ServerCaller interface has 3 methods : buildRequest, handleResult and
> initialiseResult.
> What is the purpose of this 3 methods ?
> 
> i have a lack of information about all theses classes.
> 
> Merci pour ces éclaircissements.
> 
> 
> 
> 
> ----- Original Message ----- 
> From: "Alexandre Saunier" <alexandre.saunier at camptocamp.com>
> To: "Stéphane LII" <stephane.lii at informatique.gov.pf>
> Cc: <cartoweb-users at lists.maptools.org>
> Sent: Thursday, November 16, 2006 4:58 AM
> Subject: Re: [Cartoweb-users] retrieve layers for the mapfile
> 
> 
> 
>>Hello,
>>
>>write a new plugin with a client part that retrieves the user choice
>>about the raster file to use (client class must implements the
>>"GuiProvider" interface) and transmits it to the server part of the
>>plugin (client class must implements the "ServerCaller" interface).
>>
>>The server part may look like :
>>
>>class ServerRasterFileSelector  extends ClientResponderAdapter {
>>
>>     public function handlePreDrawing($request) {
>>
>>         $layer = new LayerOverlay();
>>         $layer->name = "the_name_of_the_layer_to_update";
>>         $layer->data = "the_new_raster_file_path";
>>
>>         $mapOverlay =
> 
> $this->serverContext->getPluginManager()->mapOverlay;
> 
>>         $mapOverlay->updateMap($layer);
>>     }
>>}
>>
>>AS
>>
>>Stéphane LII wrote:
>>
>>>Hello,
>>>i have also this problem. J'ai aussi un problème similaire.
>>>i would like to draw different raster file depending on the name of a
>>>file on the fly. Je voudrai qu'un utilisateur choisisse un fichier
>>>raster selon par exemple son nom et que le paramètre DATA d'une couche
>>>soit modifié en conséquence à la volée.
>>>Is it possible ? Comment effectuer cela. ?
>>>
>>>Merci d'avance pour des éclaircissements.
>>
> 

-- 
Alexandre Saunier
Camptocamp SA
PSE A
CH-1015 Lausanne

ATTENTION nous avons changé de numéros de téléphone :
PLEASE take notice of our new phone numbers:

+41 21 619 10 19 (direct)
+41 21 619 10 10 (centrale)
+41 21 619 10 00 (fax)


More information about the Cartoweb-users mailing list