on 06-17-2015 10:20 AM
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!
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.