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