<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Yves,<br>
<br>
there might be a problem in your ExportFile.php: the unserialize(). The
filepath prop of your ExportFileRequest is a string. So, its
unserialize() method should contain this:<br>
<pre wrap="">$this->filepath = self::unserializeValue($struct, 'filepath', 'string');</pre>
or<br>
<pre wrap="">$this->filepath = self::unserializeValue($struct, 'filepath');</pre>
as the third argument default value is 'string'.<br>
<br>
<br>
Did you try to <br>
<pre wrap="">var_dump($requ->filepath);</pre>
in ServerExportFile::initializeRequest($requ) ?<br>
<br>
<br>
Damien<br>
<br>
<br>
<pre wrap="">
</pre>
<br>
<br>
Jacolin Yves wrote:
<blockquote cite="mid200607191004.12696.yjacolin@free.fr" type="cite">
<pre wrap="">Hi,
I can not manage this. I don't understand how it works and so I can not find
the error. I follow this url :
<a class="moz-txt-link-freetext" href="http://www.cartoweb.org/cwiki/HowToDisplayOnTheMapAPointFromADatabaseQuery">http://www.cartoweb.org/cwiki/HowToDisplayOnTheMapAPointFromADatabaseQuery</a>
So, here the content of my ClientExportFile.php :
<?php
class ClientExportFile extends ClientPlugin implements ServerCaller {
/**
* Constructor
*/
public function __construct() {
$this->log =& LoggerManager::getLogger(__CLASS__);
parent::__construct();
$this->Message = "";
}
public function handleHttpPostRequest($request) {
if($request['create_validate_all'] == 3) {
$this->exportOn = 1;
}
}
public function buildRequest() {
if($this->exportOn==1){
$mydata= new ExportFile();
$mydata->filepath="/var/www/html/cartoweb3/htdocs/generated/zip/tssitespt.zip";
return $mydata;
}
}
/**
* @see ServerCaller::initializeResult()
*/
public function initializeResult($ExportFileResult) {}
/**
* @see ServerCaller::handleResult()
*/
public function handleResult($ExportFileResult) {}
}
?>
/********************************************End*****************************
Here the content of the ExportFile.php in common directory :
<?php
require_once(CARTOWEB_HOME . 'common/CwSerializable.php');
class ExportFileRequest extends CwSerializable {
/**
* filepath of the zip
* @var string
*/
public $filepath;
/**
* @see CwSerializable::unserialize()
*/
public function unserialize($struct) {
$this->filepath = self::unserializeValue($struct, 'filepath',
'ExportFile');
}
/**
* Result
* @package Plugins
*/
class ExportFileResult {}
}
?>
/********************************
And the exportFile.wsdl.inc file in common directory :
<!-- exportFile -->
<complexType name="ExportFile">
<all>
<element name="filepath" type="xsd:string"/>
</all>
</complexType>
/********************************
Finally, the ServerExportFile.php file in server dir :
<?php
class ServerExportFile extends ClientResponderAdapter {
function initializeRequest($requ) {
if ($requ)
$this->filepath = $requ->filepath;
}
?>
/*******************************
At this moment, I just want to get $filepath from the form in cartoclient, in
the client side and send it to server side.
I just obtain a not so nice white screen :-( I have no errors in
httpd/error_log nor in cartoclient.log
any ideas where the errors are ? Or how to have more informations in the
cartoclient.log ?
Thank you !
Y.
Le Mardi 18 Juillet 2006 16:44, Damien Corpataux a écrit :
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
yes indeed, this looks correct.
BUT: the $mydata variable returned by ServerPlugin::initializeRequest() HAS
TO be an object that implements the CwSerializable interface. Take a look
at /coreplugins/images/common/Images.php if you need an example.
Also, don't forget to make your ClientPlugin implement the ServerCaller
interface, and make your ServerPlugin implement ClientResponder.
Damien
----- Original Message -----
From: "Jacolin Yves" <a class="moz-txt-link-rfc2396E" href="mailto:yjacolin@free.fr"><yjacolin@free.fr></a>
To: "Oliver Christen" <a class="moz-txt-link-rfc2396E" href="mailto:oliver.christen@camptocamp.com"><oliver.christen@camptocamp.com></a>
Sent: Tuesday, July 18, 2006 4:03 PM
Subject: Re: [Cartoweb-users] Send data from client to server part in a
Plugin
with the mail of Marc Monnerat and yours, I am begining to understand.
So in the clientMyPlugin class, I use :
public function buildRequest() {
return $mydata;
}
and in the serverMyPlugin class, I use :
function initializeRequest($requ) {
if ($requ)
$this->mydatat = $requ->mydata;
}
Can you confirm ?
Thank to you and marc Monnerat
Y.
Le Mardi 18 Juillet 2006 15:44, vous avez écrit :
</pre>
<blockquote type="cite">
<pre wrap="">there is the public function handleHttpPostRequest($request) { (client
side) if you need the data on server side, you will need to transfert
them from client to server side via public function buildRequest() { and
recover
the result of your sever-side functions (if any) with public function
initializeResult($someresultobject) { or public function
handleResult($someresultobject) {
maybe there is a simpler way, I will ask around
O.
</pre>
<blockquote type="cite">
<pre wrap="">Hello,
I want to use data from a form in my interface in the server part of my
plugin. Do I need to use ServerCaller::overrideRequest and
ClientResponder::initializeRequest ?
I can not get informations about this, from the archive, and I am sure
to
read
something about this in the past.
Thanks,
Y.
--
Yves Jacolin
<a class="moz-txt-link-freetext" href="http://yjacolin.gloobe.org">http://yjacolin.gloobe.org</a>
----
Stagaire Conservatoire Régional des Espaces Naturels de la région
Centre <a class="moz-txt-link-freetext" href="http://cahiersnaturalistes.free.fr/cpnrc/">http://cahiersnaturalistes.free.fr/cpnrc/</a>
----
- Qu'est-ce que cela peut faire que je lutte pour la mauvaise cause
puisque je suis de bonne foi?
- Et qu'est-ce que ça peut faire que je sois de mauvaise foi
puisque c'est pour la bonne cause. (Jacques Prévert)
_______________________________________________
Cartoweb-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Cartoweb-users@lists.maptools.org">Cartoweb-users@lists.maptools.org</a>
<a class="moz-txt-link-freetext" href="http://lists.maptools.org/mailman/listinfo/cartoweb-users">http://lists.maptools.org/mailman/listinfo/cartoweb-users</a>
</pre>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>