cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get children for User Homes

naresh
Champ in-the-making
Champ in-the-making
I am trying to browse the User Homes folder using OpenCMIS. My code is as follows:


ObjectId folderId = session.createObjectId(folderIdString);
Folder folder = (Folder)session.getObject(folderId);
for (CmisObject cmisObject : folder.getChildren()) {
    // print child
}

While session.getObject() gets the User Homes object correctly, folder.getChildren() does not return any children. I know that it has my personal folder under it (and my CMIS session is logged in as me). Is there anything special about "User Homes" that I can't see the children. The same code works correctly for other folders that I have tried.

Thanks.
Naresh
8 REPLIES 8

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

That should work. You should be able to see all children of the User Homes folder if you have the permission to see them with the logged in user. This folder is not special to CMIS.

- Florian

naresh
Champ in-the-making
Champ in-the-making
Ok, I think it is some sort of permissions issue.

- If I go through share, I am able to visit User Homes and my folder underneath it.
- If I go through CMIS workbench (with the same user id) and I click on User Homes, I get a 500 - Internal Error. The log says:


org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Internal Server Error
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:450)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:552)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getObjectInternal(AbstractAtomPubService.java:777)
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getObject(ObjectServiceImpl.java:433)
   at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:393)
   at org.apache.chemistry.opencmis.workbench.model.ClientModel.loadObject(ClientModel.java:177)
   at org.apache.chemistry.opencmis.workbench.FolderTable$1.valueChanged(FolderTable.java:103)
   at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167)
   at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:147)
   at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:194)
   at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:388)
   at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:398)
   at javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:442)
   at javax.swing.JTable.changeSelectionModel(JTable.java:2351)

Wrapped Exception (with status template): 08070651 Error during processing of the template '08070650 Access Denied.  You do not have the appropriate permissions to perform this operation.'

- If I go at the same folder through my app (which uses OpenCMIS), I don't get any exception (and I don't think I am eating any) but I simply get an empty folder with no children.

Any clues as to what might be the problem?

Thanks.
Naresh

fmui
Champ in-the-making
Champ in-the-making
The Workbench error message makes kind of sense. Try connecting via the Expert tab in the login dialog and add this line to the configuration:
cmis.workbench.object.includeAcls=false
The error message should disappear.

If you are calling getObjectByPath() with a path which includes User Homes, does that work?

Which Alfresco version are you using? Have there been issues with the Lucene index? (Alfresco 3.x retrieves folder children from the Lucene index. Alfresco 4 queries the database.)


- Florian

naresh
Champ in-the-making
Champ in-the-making
  • Adding cmis.workbench.object.includeAcls=false to workbench configuration makes the error message go away. But when I traverse to User Homes, it is still empty.

  • getObjectByPath() with "/User Homes/BhatiNa/sqlj-overview.pdf" or any sub-path of this works just fine.

  • Alfresco version 3.4.0 (d 3370)

  • No idea if we have had any issues with the Lucene index.

fmui
Champ in-the-making
Champ in-the-making
I cannot reproduce it. Have you tried an other interface, WebDAV for example?
The only explanation at the moment is the Lucene index…

naresh
Champ in-the-making
Champ in-the-making
I have some more information on this issue:

  • I tried accessing User Homes on another Alfresco instance within my company - same issue - shows zero children. This makes me think it can't be the Lucene index (unless the indexes are messed up on both instances). In any case, how do I rebuild the index?

  • I also tried the same thing on an instance on Amazon - and the same scenario works just fine over there. I can see my own folder under User Homes (and nobody else's folders), I can navigate to its children. That makes me think it is a permissions issue. Does the CMIS interface use the same permissions model as Alfresco share. Is there any other place I should be setting permissions for CMIS?
Thanks.
Naresh

fmui
Champ in-the-making
Champ in-the-making
The CMIS interface does not introduce any new permission rules. Permissions are solely handled by the repository.
So you should get the same view in Alfresco Share, Alfresco Explorer and CMIS when you are logged in with the same user.

Florian

naresh
Champ in-the-making
Champ in-the-making
Ok, then may be I should rebuild the indexes. Can you please point me to the docs for that? I could only find this which is probably not what I want:

Alfresco Documentation > Administering > Backing up and restoring > Backing up and restoring Lucene indexes