Ryan,
Thank so much for your quick reply.
This is the code where by I made it works in using insertDocument
method.

$document = "http://docs.google.com/a/domain.com/Doc?
id=ddx7wnw4_9hgns9mds&hl=en";
$docsQuery = new Zend_Gdata_Docs_Query($document);
$feed = $docs->getDocumentListEntry($docsQuery);
try {
     $copDocument = $docs->insertDocument($feed,
Zend_Gdata_Docs::DOCUMENTS_LIST_FEED_URI );

} catch (Zend_Gdata_App_Exception $e) {
     echo $e;
}

For sharing document, I wrote a method addContributor as in your
example in Doc class.
But I do not get it works yet. The error is about Fatal Error: Feed
processing was interrupted. Any idea?


$docs = new Zend_Gdata_Docs($client);
$id= "ddx7wnw4_9hgns9mds&hl=en";
$uri = "http://docs.google.com/feeds/acl/private/full/document%3A";.
$id."/batch";
$data = "<entry xmlns='http://www.w3.org/2005/Atom'
         xmlns:gAcl='http://schemas.google.com/acl/2007'>
             <category scheme='http://schemas.google.com/g/2005#kind'
             term='http://schemas.google.com/acl/2007#accessRule'/>
             <gAcl:role value='writer'/>
             <gAcl:scope type='user' value='n...@domain.com'/>
         </entry> ";

try {
    $shareDocument = $docs->addContributor($data, $uri);
} catch (Zend_Gdata_App_Exception $e) {
    echo $e;
}


On May 5, 8:22 pm, Ryan Valdron <rvald...@gmail.com> wrote:
> What method were you using? I'm not 100% sure the batch one works as I
> didn't test it.
> I also have my own domain and am using it through there as well.
>
> Either way the URI passed in should be set 
> tohttp://docs.google.com/feeds/acl/private/full/document%3A".$id; 
> orhttp://docs.google.com/feeds/acl/private/full/document%3A".$id."/batch";;
>
> remember to set $id to the ID of the documents in google docs. Maybe
> if you could echo what $uri is set to right before you make the call
> and send me what you have it set to I can help a bit more.
>
> On Tue, May 5, 2009 at 5:59 AM, Phaung <lotus...@gmail.com> wrote:
>
> > I am trying to test your code. But I have my own domain name.
> > In that case, what the $uri parameter should be??
> > I get the error "Passed parameter is not a valid HTTP URI."
> > Thanks in advance.
>
> > On Apr 29, 11:44 pm, Ryan Valdron <rvald...@gmail.com> wrote:
> >> Trav,
>
> >> If you're using the Zend php api, I wrote a method in the Docs class
>
> >> public function addContributor($data, $uri, $className='Zend_Gdata_Entry'){
> >>     return $this->insertEntry($data, $uri, $className);
>
> >> }
>
> >> that works similar to insertDocument.
> >> where $uri = 
> >> "http://docs.google.com/feeds/acl/private/full/document%3A".$id;
> >> and $id is the document's ID.
>
> >> and $data follows this layout:
> >> <entry xmlns="http://www.w3.org/2005/Atom";
> >> xmlns:gAcl='http://schemas.google.com/acl/2007'>
> >>   <category scheme='http://schemas.google.com/g/2005#kind'
> >>     term='http://schemas.google.com/acl/2007#accessRule'/>
> >>   <gAcl:role value='writer'/>
> >>   <gAcl:scope type='user' value='new_wri...@example.com'/>
> >> </entry>
> >> as given in the developer's guide
> >> (http://code.google.com/apis/documents/docs/2.0/developers_guide_proto...).
>
> >> You could also do it in a batch run using this function (untested)
>
> >> public function executeBatch($data, $uri,
> >> $className='Zend_Gdata_App_Feed', $extraHeaders=array()){
> >>         $response = $this->post($data, $uri, null, null, $extraHeaders);
>
> >>         $returnFeed = new $className($response->getBody());
> >>         $returnFeed->setHttpClient(self::getstaticHttpClient());
>
> >>         $etag = $response->getHeader('ETag');
> >>         if (!is_null($etag)) {
> >>             $returnEntry->setEtag($etag);
> >>         }
>
> >>         return $returnEntry;
> >>     }
>
> >> in the App class. Where $data is laid out according to the link above
> >> and $uri is the same as above with /batch at the end of it.
>
> >> Either way you're going to have to adjust the scope in the Docs
> >> implementation from $scope = 'http://docs.google.com/feeds/documents';
> >> to $scope = 'http://docs.google.com/feeds/';inorder for either
> >> function to work.
>
> >> -Ryan
>
> >> On Wed, Apr 29, 2009 at 12:21 PM, Trav <amazingt...@gmail.com> wrote:
>
> >> > Hi,
>
> >> > I have completed the portion of my application that uploads a document
> >> > to Google Docs with the PHP api, However, I need to invite
> >> > collaborators to the document automatically through PHP, how can I
> >> > accomplish this?
>
> >> > I am using Google docs on my own domain through Google Apps. The
> >> > collaborators that I need to invite will all be in the same domain.
>
>
--~--~---------~--~----~------------~-------~--~----~
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 Google-Docs-Data-APIs@googlegroups.com
To unsubscribe from this group, send email to 
google-docs-data-apis+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Docs-Data-APIs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to