Hi Lasse,

Glad that you got it working so far. Here are some answers to your
questions:

1. Proxy adapter: At first glance this looks like correct usage. You
may want to consult the Zend reference guide for more details on it:
http://framework.zend.com/manual/en/zend.http.client.adapters.html#zend.http.client.adapters.proxy

2. You need the link to the spreadsheet? Is this for a public
spreadsheet? If it is public you should be able to access it using the
spreadsheet ID that you have used to create your new worksheets. You
should probably set the spreadsheet to auto-republish on any changes.

3. Batch account: I am not sure how you would do this. The account
would need a valid email to be validated.

4. The includes are normal. The framework is very object oriented and
requires all the includes. If you notice, we always list the required
files in our developer guides. The PHP Spreadsheet guide shows what
you need to require for that API:
http://code.google.com/apis/spreadsheets/developers_guide_php.html#GettingStarted

5. Your code: The upload code that you included in your last post
looks fine to me.

Thanks
- Jochen

On Sep 13, 9:34 pm, Lasse <[EMAIL PROTECTED]> wrote:
> Hi, I can sure do with some help :-|
> I need to go through a proxy. To do that I had to modify
> Zend_Gdata_Doc
> -----------------------------------------------
>     public function __construct($client = null, $applicationId =
> 'MyCompany-MyApp-1.0')
>     {
>         $this->registerPackage('Zend_Gdata_Docs');
>         parent::__construct($client, $applicationId);
>         $this->_httpClient->setParameterPost('service',
> self::AUTH_SERVICE_NAME);
> // my proxy code BEGINs here
> $config = array(
>     'adapter'    => 'Zend_Http_Client_Adapter_Proxy',
>     'proxy_host' => '10.40.5.232',
>     'proxy_port' => 80
> );
> $this->_httpClient->setConfig($config);
> // my proxy code ENDs here
>     }
> -----------------------------------------------
> Then my PHP script
>
> <?php
> ini_set('include_path', ini_get('include-path').'/home/tooljn/PHPZF/
> ZendFramework-1.6.0/library');
> include ('Zend/Http/Client.php');
> include ('Zend/Gdata.php');
> include ('Zend/Gdata/Docs.php');
> include ('Zend/Gdata/ClientLogin.php');
>
> //Proxy definition Note! I also had to modify the Zend_Gdata_Doc
> __construct
> $config = array(
>     'adapter'    => 'Zend_Http_Client_Adapter_Proxy',
>     'proxy_host' => '10.40.5.232',
>     'proxy_port' => 80
> );
> $client = new Zend_Http_Client('http://www.google.com:443', $config);
> $user = 'myAccount';
> $pass = 'myPassword';
> $service = Zend_Gdata_Docs::AUTH_SERVICE_NAME; // predefined service
> name for Google Documents
> $httpClient = Zend_Gdata_ClientLogin::getHttpClient($user, $pass,
> $service, $client);
> $gdClient = new Zend_Gdata_Docs($httpClient,'Tooltech DW');
> $fileToUpload = '/home/tooljn/dw/pgm/testspreadsheet.csv';
> $fileName = 'Daily sheet3_'.date("ymd");
> $filenameParts = explode('.', $fileToUpload);
> $fileExtension = end($filenameParts);
> $newDocumentEntry = $gdClient->uploadFile($fileToUpload, "$fileName",
>       Zend_Gdata_Docs::lookupMimeType($fileExtension),
> Zend_Gdata_Docs::DOCUMENTS_LIST_FEED_URI);
> -----------------------------------------------
> With this script I was able to create new worksheets, so far so good.
> But...
> How I'm I supposed to define my proxy? I could not find any info about
> that. My ugly hacks can't be the best way.
> The address 'http://www.google.com:443'is that correct? I just took a
> long shot.
> How do I pick up the link to the spreadsheet?
> How can someone else use that link? Do they have to be registered
> users?
>
> I also would like to use a special batch account and not my own
> personal account. How do I create 'batch account' and verify that
> account? The account do not have a valid email address.
>
> I do a lot of includes in the begining of my script. Do you know if
> that is the way you are supposed to access Zend FW code? It feels
> ackward.
>
> Any comments suggestions about my code is highly appreciated. As you
> can see I'm not an exerienced Zend FW user.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Docs Data APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Docs-Data-APIs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to