I'm getting my hands on the SBT Toolkit with Java. Works great but having some difficulties with folders:
I need to create a folder in a community and put some files into it. Unfortunately, the class CommunityService
has no such method.
I could use the FileService.createFolder(name, description, shareWith)
method and share it with the community, but actually i only want the files in the community, because otherwise they're visible in the files application (public, warning message: "Sharing with the public community 'COMMUNITY NAME' will make this folder public.")
How can I achieve this?
I checked out the button in the community / files widget and found out that it is doing a POST to the communities feed:
Target URL: https://connections.host.ch/files/form/api/communitycollection/{community-uuid}/feed
POST content:
<entry xmlns="http://www.w3.org/2005/Atom">
<category term="collection" label="collection" scheme="tag:ibm.com,2006:td/type"></category>
<label xmlns="urn:ibm.com/td" makeUnique="true">TEST Folder</label>
<title>TEST Folder</title>
<summary type="text">teset set e</summary>
</entry>
So, could I use the communityService.createData
method to invoke this REST service? If yes, whats the syntax? I haven't found any documentation or examples for it.
Also, I need to get the ID of the folder after it is created, but I this i can parse from the response..
Adding files to the newly created folder should be easy (SBT provides corresponding classes and methods), but i didn't work with this yet :-)
I've found a solution .. altough i would rather use JSON, and maybe the handle of the Xerces XML Document is not really elegant since i have not experience with it.. but it works..