Web Services API :: File Export

J

jpk236

Has anyone gotten the Export function to work from the Groove Web Services API?

I don't see where in the API you tell it which local directory to store the
File you're wanting to export.
 
M

Mark Smith

It does work. I think (from memory), that it is the URL parameter that is the
place you want the file to end up.
 
J

jpk236

This is from the API:

public void Export(string URI, bool Recursive, bool OverwriteExisting)
Member of Application.GrooveFilesBase64.GrooveFilesBase64


The URI is the URI for the specific file in the File Tool workspace you're
trying to export. For example:

GrooveFilesBase64.FileDescriptor[] files = filesSvc.Read(true, true);
GrooveFilesBase64.FileDescriptor file = files;
filesSvc.Export(file.URI, false, true);

What I don't see here is where you specify the local directory (ex:
C:\WINDOWS\Temp) where you want the file saved to.

What am I missing?
 
M

Mark Smith

"What am I missing?"

Clear documentation. The URL *is* the place where the file ends up.

--
Regards
Mark Smith
http://www.infopatterns.com



jpk236 said:
This is from the API:

public void Export(string URI, bool Recursive, bool OverwriteExisting)
Member of Application.GrooveFilesBase64.GrooveFilesBase64


The URI is the URI for the specific file in the File Tool workspace you're
trying to export. For example:

GrooveFilesBase64.FileDescriptor[] files = filesSvc.Read(true, true);
GrooveFilesBase64.FileDescriptor file = files;
filesSvc.Export(file.URI, false, true);

What I don't see here is where you specify the local directory (ex:
C:\WINDOWS\Temp) where you want the file saved to.

What am I missing?


Mark Smith said:
It does work. I think (from memory), that it is the URL parameter that is the
place you want the file to end up.
 
J

jpk236

haha @ "clear documentation"

So in my case, would the URL be "C:\WINDOWS\Temp" or maybe even
"file://C:/WINDOWS/Temp"?

Thanks for the help.

Mark Smith said:
"What am I missing?"

Clear documentation. The URL *is* the place where the file ends up.

--
Regards
Mark Smith
http://www.infopatterns.com



jpk236 said:
This is from the API:

public void Export(string URI, bool Recursive, bool OverwriteExisting)
Member of Application.GrooveFilesBase64.GrooveFilesBase64


The URI is the URI for the specific file in the File Tool workspace you're
trying to export. For example:

GrooveFilesBase64.FileDescriptor[] files = filesSvc.Read(true, true);
GrooveFilesBase64.FileDescriptor file = files;
filesSvc.Export(file.URI, false, true);

What I don't see here is where you specify the local directory (ex:
C:\WINDOWS\Temp) where you want the file saved to.

What am I missing?


Mark Smith said:
It does work. I think (from memory), that it is the URL parameter that is the
place you want the file to end up.

--
Regards
Mark Smith
http://www.infopatterns.com



:

Has anyone gotten the Export function to work from the Groove Web Services API?

I don't see where in the API you tell it which local directory to store the
File you're wanting to export.
 
J

jpk236

Okay, so thanks to Mark's help I now have it working and downloading the files.

So now my next question is, if I do have a URI for a specific file in the
File Tool workspace, is it possible for me to use that in some way to ONLY
download that one file?

What if I had a couple gigs of data in the File Tool. I obviously wouldn't
want that downloading in its entirety every time.
 
J

jpk236

Ah ha! I got it! A little persistence goes a long way.

Here was my final solution:

private void DownloadDatabase(string GrooveRequestKey, string
GrooveHostnamePort, string filesURI, string identityURI) {
string databaseURI = "";

GrooveFilesBase64.GrooveFilesBase64 filesSvc = new
GrooveFilesBase64.GrooveFilesBase64();

filesSvc.GrooveRequestHeaderValue = new
GrooveFilesBase64.GrooveRequestHeader();

filesSvc.GrooveRequestHeaderValue.GrooveIdentityURL = identityURI;
filesSvc.GrooveRequestHeaderValue.GrooveRequestKey = GrooveRequestKey;

filesSvc.Url = GrooveHostnamePort + filesURI;

GrooveFilesBase64.FileDescriptor[] files = filesSvc.Read(true, true);

for (int i = 0; i < files.Length; i++) {
GrooveFilesBase64.FileDescriptor file = files;

if (file.Name == "Database.mdb") {
databaseURI = file.URI;

break;
}
}

filesSvc.Url = GrooveHostnamePort + databaseURI;

filesSvc.Export("C:\\WINDOWS\\Temp", false, true);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top