cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the RootFolderID?

wouter
Champ in-the-making
Champ in-the-making
Hi,

I am developing an iPhone app that should connect to an alfresco repository.
What I have accomplished today is that I have been able to do the following using the REST interface:
- Login
- Get repository Info

I request the repository Info using the following call:
/service/api/repository
or
/service/api/cmis

Both calls give me the same response …
The response is valid xml that contains all sorts of info about the repository.

The line that I am interested in is the following:

<cmis:rootFolderId>http://sub.mydomain.net:10265/alfresco/service/api/path/workspace/SpacesStore/Company%20Home</cmis:rootFolderId>

Is this the rootFolderId that I need to call for instance the 'descendants' Service??

If I do that … I get an error (Not Found).
If I trim the first bit off (and keep all after 'alfresco') I get a NotFound error.

I think it is kinda strange that I get a URL as the rootFolderId … while 'all' other folder-id's are generated id's like 9f6000a8-9484-11dc-90b9-7fa4aa914986

If I login on the website and view the source of the pages, I do find some id's in the html … When I use these folder id's for the descendants call, I do get a very nice response!

How do I proceed from here?

Regards,
Wouter
3 REPLIES 3

fmui
Champ in-the-making
Champ in-the-making
Hi Wouter,

There is the root folder id which is an id within the repository and there is the root folder collection which is represented by a URL.
If you want to call getDescendants() you have to use the root folder collection URL.

Look for:

<collection href="http://…">
    <atom:title>root collection</atom:title>
    <cmisra:collectionType>root</cmisra:collectionType>
</collection>

Florian

wouter
Champ in-the-making
Champ in-the-making
Hi Florian,

In the repositoryInfo I did find the xml that you mentioned:


<collection href="http://domain.com/alfresco/service/api/path/workspace/SpacesStore/Company%20Home/descendants" cmis:collectionType="root-descendants">
      <atom:title>root collection</atom:title>
    </collection>

However, we access 'everything' over https, so we rewrite the url to what we want it to be.
If I do that … I get the exact same error that I got earlier:

<tr><td>The Web Script <a href="/corporate/alfresco/alfresco/service/api/node/workspace/SpacesStore/Company Home/descendants?alf_ticket=TICKET_xxx>/alfresco/service/api/node/workspace/SpacesStore/Company Home/descendants</a> has responded with a status of 404 - Not Found.</td></tr>

When I replace the 'Company%20Home' in the url that I call with a valid identifier (like 9f6000a8-9484-11dc-90b9-7fa4aa914986) … then I get a perfect response, so (the rest of) the url seems fine!

I must be doing something wrong, but I cannot figure out what.

Perhaps Alfresco does not like the fact that we rewrite the url (which the web server should be doing, I guess) ?? But that Alfresco only objects to that when requesting the RootFolderId …

Regards,
Wouter

fmui
Champ in-the-making
Champ in-the-making
I can't reproduce the URLs you are seeing. Is it possible that you are using a fairly old Alfresco release?

Florian