cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing the content of "mydocuments" over custom java client

Former Member
0 Kudos

I'm trying to access the content of the "My Documents" repository on my SAP Mobile Documents cloud instance over a native android app.

I downloaded the source code of this http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/900b59bd-532c-3210-e388-fcdf4e4b5... guide.

I was able to successfully create a new folder inside the myDocuments repository and uploaded a .jpg over the web interface, which I can both see when accessing the SMD over browser.

I tried to get the content of the myDocuments repository over my android app like the follwing:

RepositorySession repositorySession = RepositorySession.getInstance();
Session myDocumentsSession = repositorySession.createSession(serverUrl, userName, password);
String myDocumentsHomeFolder = repositorySession.getMyDocumentsHomeFolderId();

Folder root = myDocumentsSession.getRootFolder(); //is this the myDocuments repository at all?
ItemIterable<CmisObject> children = root.getChildren();

for (CmisObject child : children) {

  Log.d("test", "Found object: "+child.getName()+" ("+child.getType().getDisplayName()+") with ID "+child.getId());
}

I get the result:

Found object: P1941458879 (CMIS Folder) with ID QrseoVymkvOs-memRwhyrzyLuE4O7-NJ4kAzJDDLpAA

Found object: settings (CMIS Folder) with ID xoKy9btE46hmbd8pehmJhS9kjQ4h2sLe33N57F45AP4

but not the folder I manually created and not the .jpg i uploaded.

What am I missing out here? Is the result of getRootFolder() the myDocuments repository?

How would I get the content of the folder I manually created?

Any help is appreciated!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Seems like posting a question on here and finding a solution a few moments later is becoming a thing for me now..

Anyway, as I thought MyDocumentSession.getRootFolder() is not the myDocuments repository at all.

To get the content of the MyDocuments repo the following code is needed:

Folder home = (Folder) myDocumentsSession.getObject(myDocumentsHomeFolder);

ItemIterable<CmisObject> childrenHome = home.getChildren();


But there still is a question remaining for me. When I execute actions on root, like creating a folder it is created but where can I see it in the browser over the web client?

Former Member
0 Kudos

Hi Christian,

you won't be able to see the folders on root level over the usual clients as they have the myDocuments home folder as start folder.

Best regards,

Peter

Answers (1)

Answers (1)

Former Member
0 Kudos

For My Documents and Shared Documents you don't operate on the repository root folder, but under a user's home folder. These home folders are created by the system on the first user logon.

I recommend reading the Mobile Documents developer guide for a better understanding.

Developing Clients - SAP Mobile Documents - SAP Library

Here are examples how to fetch a user's home folder in Java and Javascript:

My Documents - SAP Mobile Documents - SAP Library