2009年1月27日星期二

Re: [fw-gdata] Listing the shares for a document

Hi Mark,

Currently there is no support for ACLs in the Zend_Gdata implementation.

Basically, what you could do is do a call to the ACL feed URL manually
and parse the XML yourself.. that's probably the easiest way to do it.

Here's info on the ACL feeds:
http://code.google.com/apis/documents/docs/1.0/developers_guide_protocol.html#ACLRetrieve

Basically, you'd call the Zend_Gdata_Docs::get($url)... that would
handle the authentication and get the Zend_Http_Response object, but
you'd then have to parse the dom yourself.

You could also get the feed as normal (using
Zend_Gdata_Docs::getFeed($url, 'Zend_Gdata_Feed') and loop through the
unknown elements (extension elements), but that might be a bit more
difficult, depending on your experience with XML parsing.

Here's an example using extensionElements:
http://markmail.org/message/heekjb62yxf4skut

The goal there would be to write something like the following. (Note:
I haven't had time to test and use this code, so it has errors and
inefficiencies, but it does set the general groundwork for what this
would look like). Yes, this is ugly :(

$feed = $docs->getFeed($url, 'Zend_Gdata_Feed');
foreach ($feed as $entry) {
$extEls = $entry->getExtensionElements();
foreach ($extEls as $extEl) {
if ($extEl->rootNamespaceURI == 'http://schemas.google.com/acl/2007'
&& $extEl->rootElement == 'scope') {
$attrs = $extEl->getExtensionAttributes();
foreach ($attrs as $attrName=>$attrVal) {
if ($attrName == 'type') {
$scopeType = $attrVal;
} else if ($attrName == 'value') {
$scopeValue = $attrVal;

}
}
} else if ($extEl->rootNamespaceURI ==
'http://schemas.google.com/acl/2007' && $extEl->rootElement == 'role')
{
$attrs = $extEl->getExtensionAttributes();
foreach ($attrs as $attrName=>$attrVal) {
if ($attrName == 'value') {
$role = $attrVal;
}
}
}
}
}
On Sun, Jan 25, 2009 at 11:27 AM, MLongmire <mark@mlongmire.net> wrote:
>
> I created a Google Docs document and shared it with other people.
>
> The interface for Google Docs shows the shared people in the Folders/Sharing
> column.
>
> Is there an api call in Zend_Gdata that I can use to find out who the shares
> are for a document?
>
> I've looked through the authors, but I'm the only one listed. I thought the
> rights may contain what I'm looking for, but I get null data from
> getRights().
>
> Thanks,
> Mark
>
>
>
>
> --
> View this message in context: http://www.nabble.com/Listing-the-shares-for-a-document-tp21655676p21655676.html
> Sent from the Zend gdata mailing list archive at Nabble.com.
>

没有评论: