1. After Client Authentication show a list of my documents ( I am able
to do this using the Google DocumentList API)
2. download the selected word processor document
( actually I tried trapping the response Atom feed and porting that to
XML using the SaveToXML() method but the <entry> node <content type >
did not contain any <xhtml> data)
3. would like to edit the downloaded doc and then maybe upload it
again (using the DocumentList Upload() method)
I am stuck with #2 , Any ideas would be great , Is this possible or
not ?
On Jul 24, 5:28 am, riba <abir.bhattacha...@gmail.com> wrote:
> Hi all,
> I have the following requirements:
> 1. After Client Authentication show a list of my documents ( I am able
> to do this using the Google DocumentList API)
> 2. download the selected word processor document
> ( actually I tried trapping the response Atom feed and porting that to
> XML using the SaveToXML() method but the <entry> node <content type >
> did not contain any <xhtml> data)
Each of the entries in the feed has a content element with the src
attribute set to the URL of the HTML version of the document contents.
So if you want to download the document content, you can use the
authenticated client to perform an HTTP GET on the src URL and the
server will send you the HTML. How is you client authenticated,
ClientLogin, AuthSub, OAuth?
> 3. would like to edit the downloaded doc and then maybe upload it
> again (using the DocumentList Upload() method)
The Document List API does not currently support the replacement of
document contents. You can add new documents, and remove documents,
but you would not be able to replace the contents of an exiting
document. So you would be able to edit the downloaded doc, but you
would have to insert as a new document rather than update.
> I am stuck with #2 , Any ideas would be great , Is this possible or
> not ?
But as you pointed out doing a HTTP GET request on the 'src' using the
authenticated client (in my case AuthServ) , but how do I do that ? .
I was trying to use the c# System.NET HttpRequest but that is a new
external request again !! , how would i go about doing a HTTP GET
using the clientlogin authenticated service which I already have ??
Regards
Riba
On Jul 25, 10:18 pm, Jeff S <j...@google.com> wrote:
> On Jul 24, 5:28 am, riba <abir.bhattacha...@gmail.com> wrote:
> > Hi all,
> > I have the following requirements:
> > 1. After Client Authentication show a list of my documents ( I am able
> > to do this using the Google DocumentList API)
> > 2. download the selected word processor document
> > ( actually I tried trapping the response Atom feed and porting that to
> > XML using the SaveToXML() method but the <entry> node <content type >
> > did not contain any <xhtml> data)
> Each of the entries in the feed has a content element with the src
> attribute set to the URL of the HTML version of the document contents.
> So if you want to download the document content, you can use the
> authenticated client to perform an HTTP GET on the src URL and the
> server will send you the HTML. How is you client authenticated,
> ClientLogin, AuthSub, OAuth?
> > 3. would like to edit the downloaded doc and then maybe upload it
> > again (using the DocumentList Upload() method)
> The Document List API does not currently support the replacement of
> document contents. You can add new documents, and remove documents,
> but you would not be able to replace the contents of an exiting
> document. So you would be able to edit the downloaded doc, but you
> would have to insert as a new document rather than update.
> > I am stuck with #2 , Any ideas would be great , Is this possible or
> > not ?
> But as you pointed out doing a HTTP GET request on the 'src' using the
> authenticated client (in my case AuthServ) , but how do I do that ? .
> I was trying to use the c# System.NET HttpRequest but that is a new
> external request again !! , how would i go about doing a HTTP GET
> using the clientlogin authenticated service which I already have ??
> Regards
> Riba
> On Jul 25, 10:18 pm, Jeff S <j...@google.com> wrote:
> > Hello riba,
> > On Jul 24, 5:28 am, riba <abir.bhattacha...@gmail.com> wrote:
> > > Hi all,
> > > I have the following requirements:
> > > 1. After Client Authentication show a list of my documents ( I am able
> > > to do this using the Google DocumentList API)
> > > 2. download the selected word processor document
> > > ( actually I tried trapping the response Atom feed and porting that to
> > > XML using the SaveToXML() method but the <entry> node <content type >
> > > did not contain any <xhtml> data)
> > Each of the entries in the feed has a content element with the src
> > attribute set to the URL of the HTML version of the document contents.
> > So if you want to download the document content, you can use the
> > authenticated client to perform an HTTP GET on the src URL and the
> > server will send you the HTML. How is you client authenticated,
> > ClientLogin, AuthSub, OAuth?
> > > 3. would like to edit the downloaded doc and then maybe upload it
> > > again (using the DocumentList Upload() method)
> > The Document List API does not currently support the replacement of
> > document contents. You can add new documents, and remove documents,
> > but you would not be able to replace the contents of an exiting
> > document. So you would be able to edit the downloaded doc, but you
> > would have to insert as a new document rather than update.
> > > I am stuck with #2 , Any ideas would be great , Is this possible or
> > > not ?
but I get a Non-seekable stream (s) and I am not being able to convert
that to byte[] or any MemoryStream object as I need the content of
it, hence I am unable to determine whether I am getting the correct
html content.
It always throws an exception like.... 'This stream does not support
seek operations.'
> On Jul 28, 8:34 am, riba <abir.bhattacha...@gmail.com> wrote:
> > Hi ,
> > Thanks for the reply and help :
> > I am doing a ClientLogin Authetication , something like
> > AuthServ=new DocumentsService("GDocPlug-in");
> > AuthServ.setUserCredentials("uid","pwd");
> > Can retreive the token using
> > string tok=AuthServ.QueryAuthenticationToken(); // which is retreiving
> > correctly I guess
> > But as you pointed out doing a HTTP GET request on the 'src' using the
> > authenticated client (in my case AuthServ) , but how do I do that ? .
> > I was trying to use the c# System.NET HttpRequest but that is a new
> > external request again !! , how would i go about doing a HTTP GET
> > using the clientlogin authenticated service which I already have ??
> > Regards
> > Riba
> > On Jul 25, 10:18 pm, Jeff S <j...@google.com> wrote:
> > > Hello riba,
> > > On Jul 24, 5:28 am, riba <abir.bhattacha...@gmail.com> wrote:
> > > > Hi all,
> > > > I have the following requirements:
> > > > 1. After Client Authentication show a list of my documents ( I am able
> > > > to do this using the Google DocumentList API)
> > > > 2. download the selected word processor document
> > > > ( actually I tried trapping the response Atom feed and porting that to
> > > > XML using the SaveToXML() method but the <entry> node <content type >
> > > > did not contain any <xhtml> data)
> > > Each of the entries in the feed has a content element with the src
> > > attribute set to the URL of the HTML version of the document contents.
> > > So if you want to download the document content, you can use the
> > > authenticated client to perform an HTTP GET on the src URL and the
> > > server will send you the HTML. How is you client authenticated,
> > > ClientLogin, AuthSub, OAuth?
> > > > 3. would like to edit the downloaded doc and then maybe upload it
> > > > again (using the DocumentList Upload() method)
> > > The Document List API does not currently support the replacement of
> > > document contents. You can add new documents, and remove documents,
> > > but you would not be able to replace the contents of an exiting
> > > document. So you would be able to edit the downloaded doc, but you
> > > would have to insert as a new document rather than update.
> > > > I am stuck with #2 , Any ideas would be great , Is this possible or
> > > > not ?
I don't use c# very much but looking at some of the MSDN docs seems to
show that you need to use a StreamReader. Here is a snippet for how to
save a documents into a file:
> but I get a Non-seekable stream (s) and I am not being able to convert
> that to byte[] or any MemoryStream object as I need the content of
> it, hence I am unable to determine whether I am getting the correct
> html content.
> It always throws an exception like.... 'This stream does not support
> seek operations.'
> Have i performed the query operation correctly ?
> > > But as you pointed out doing a HTTP GET request on the 'src' using the
> > > authenticated client (in my case AuthServ) , but how do I do that ? .
> > > I was trying to use the c# System.NET HttpRequest but that is a new
> > > external request again !! , how would i go about doing a HTTP GET
> > > using the clientlogin authenticated service which I already have ??
> > > Regards
> > > Riba
> > > On Jul 25, 10:18 pm, Jeff S <j...@google.com> wrote:
> > > > Hello riba,
> > > > On Jul 24, 5:28 am, riba <abir.bhattacha...@gmail.com> wrote:
> > > > > Hi all,
> > > > > I have the following requirements:
> > > > > 1. After Client Authentication show a list of my documents ( I am able
> > > > > to do this using the Google DocumentList API)
> > > > > 2. download the selected word processor document
> > > > > ( actually I tried trapping the response Atom feed and porting that to
> > > > > XML using the SaveToXML() method but the <entry> node <content type >
> > > > > did not contain any <xhtml> data)
> > > > Each of the entries in the feed has a content element with the src
> > > > attribute set to the URL of the HTML version of the document contents.
> > > > So if you want to download the document content, you can use the
> > > > authenticated client to perform an HTTP GET on the src URL and the
> > > > server will send you the HTML. How is you client authenticated,
> > > > ClientLogin, AuthSub, OAuth?
> > > > > 3. would like to edit the downloaded doc and then maybe upload it
> > > > > again (using the DocumentList Upload() method)
> > > > The Document List API does not currently support the replacement of
> > > > document contents. You can add new documents, and remove documents,
> > > > but you would not be able to replace the contents of an exiting
> > > > document. So you would be able to edit the downloaded doc, but you
> > > > would have to insert as a new document rather than update.
> > > > > I am stuck with #2 , Any ideas would be great , Is this possible or
> > > > > not ?
Stream s=AuthServ.Query(uri);
StreamReader sr =new StreamReader(s);
// content html
StreamWriter sw=new StreamWriter("c:\\test.html");
string ln="";
while((ln=sr.ReadLine())!=null)
{
sw.WriteLine(ln);
}
sr.Close();
sw.Close();
but "test.html" consists of the HTML for the login Page !!! I am
unable to get the raw contents here of the actual document. ?? .
Although the same "AuthServ" is able to give me a list of the
Dcouments available on the server.
Is the authorization not happening correctly ?? , I am at a loss to
why this is happening
> I don't use c# very much but looking at some of the MSDN docs seems to
> show that you need to use a StreamReader. Here is a snippet for how to
> save a documents into a file:
> > but I get a Non-seekable stream (s) and I am not being able to convert
> > that to byte[] or any MemoryStream object as I need the content of
> > it, hence I am unable to determine whether I am getting the correct
> > html content.
> > It always throws an exception like.... 'This stream does not support
> > seek operations.'
> > Have i performed the query operation correctly ?
> > Thanks Again
> > -Riba
> > On Jul 28, 8:03 pm, "Jochen Hartmann (Google)"
> > <api.jhartm...@google.com> wrote:
> > > Hi Riba,
> > > I think you can just use the .Query method to return a HTTP response.
> > > Please refer to the source code:
> > > > But as you pointed out doing a HTTP GET request on the 'src' using the
> > > > authenticated client (in my case AuthServ) , but how do I do that ? .
> > > > I was trying to use the c# System.NET HttpRequest but that is a new
> > > > external request again !! , how would i go about doing a HTTP GET
> > > > using the clientlogin authenticated service which I already have ??
> > > > Regards
> > > > Riba
> > > > On Jul 25, 10:18 pm, Jeff S <j...@google.com> wrote:
> > > > > Hello riba,
> > > > > On Jul 24, 5:28 am, riba <abir.bhattacha...@gmail.com> wrote:
> > > > > > Hi all,
> > > > > > I have the following requirements:
> > > > > > 1. After Client Authentication show a list of my documents ( I am able
> > > > > > to do this using the Google DocumentList API)
> > > > > > 2. download the selected word processor document
> > > > > > ( actually I tried trapping the response Atom feed and porting that to
> > > > > > XML using the SaveToXML() method but the <entry> node <content type >
> > > > > > did not contain any <xhtml> data)
> > > > > Each of the entries in the feed has a content element with the src
> > > > > attribute set to the URL of the HTML version of the document contents.
> > > > > So if you want to download the document content, you can use the
> > > > > authenticated client to perform an HTTP GET on the src URL and the
> > > > > server will send you the HTML. How is you client authenticated,
> > > > > ClientLogin, AuthSub, OAuth?
> > > > > > 3. would like to edit the downloaded doc and then maybe upload it
> > > > > > again (using the DocumentList Upload() method)
> > > > > The Document List API does not currently support the replacement of
> > > > > document contents. You can add new documents, and remove documents,
> > > > > but you would not be able to replace the contents of an exiting
> > > > > document. So you would be able to edit the downloaded doc, but you
> > > > > would have to insert as a new document rather than update.
> > > > > > I am stuck with #2 , Any ideas would be great , Is this possible or
> > > > > > not ?
Sorry for not noticing this earlier, but I didn't realize until now
that you are using a hosted account. There is a bug in the DocList API
and it is currently not possible to use ClientLogin or AuthSub
authentication to access the Raw document contents for Google Apps
domains. Please star the feature request starred below to vote for
this feature to be implemented and to be notified when it has been
done:
> but "test.html" consists of the HTML for the login Page !!! I am
> unable to get the raw contents here of the actual document. ?? .
> Although the same "AuthServ" is able to give me a list of the
> Dcouments available on the server.
> Is the authorization not happening correctly ?? , I am at a loss to
> why this is happening
> > I don't use c# very much but looking at some of the MSDN docs seems to
> > show that you need to use a StreamReader. Here is a snippet for how to
> > save a documents into a file:
> > > but I get a Non-seekable stream (s) and I am not being able to convert
> > > that to byte[] or any MemoryStream object as I need the content of
> > > it, hence I am unable to determine whether I am getting the correct
> > > html content.
> > > It always throws an exception like.... 'This stream does not support
> > > seek operations.'
> > > Have i performed the query operation correctly ?
> > > > > But as you pointed out doing a HTTP GET request on the 'src' using the
> > > > > authenticated client (in my case AuthServ) , but how do I do that ? .
> > > > > I was trying to use the c# System.NET HttpRequest but that is a new
> > > > > external request again !! , how would i go about doing a HTTP GET
> > > > > using the clientlogin authenticated service which I already have ??
> > > > > Regards
> > > > > Riba
> > > > > On Jul 25, 10:18 pm, Jeff S <j...@google.com> wrote:
> > > > > > Hello riba,
> > > > > > On Jul 24, 5:28 am, riba <abir.bhattacha...@gmail.com> wrote:
> > > > > > > Hi all,
> > > > > > > I have the following requirements:
> > > > > > > 1. After Client Authentication show a list of my documents ( I am able
> > > > > > > to do this using the Google DocumentList API)
> > > > > > > 2. download the selected word processor document
> > > > > > > ( actually I tried trapping the response Atom feed and porting that to
> > > > > > > XML using the SaveToXML() method but the <entry> node <content type >
> > > > > > > did not contain any <xhtml> data)
> > > > > > Each of the entries in the feed has a content element with the src
> > > > > > attribute set to the URL of the HTML version of the document contents.
> > > > > > So if you want to download the document content, you can use the
> > > > > > authenticated client to perform an HTTP GET on the src URL and the
> > > > > > server will send you the HTML. How is you client authenticated,
> > > > > > ClientLogin, AuthSub, OAuth?
> > > > > > > 3. would like to edit the downloaded doc and then maybe upload it
> > > > > > > again (using the DocumentList Upload() method)
> > > > > > The Document List API does not currently support the replacement of
> > > > > > document contents. You can add new documents, and remove documents,
> > > > > > but you would not be able to replace the contents of an exiting
> > > > > > document. So you would be able to edit the downloaded doc, but you
> > > > > > would have to insert as a new document rather than update.
> > > > > > > I am stuck with #2 , Any ideas would be great , Is this possible or
> > > > > > > not ?