cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to know a node is locked?

andywong
Champ in-the-making
Champ in-the-making
Hi,

  I used the CMIS API for manage the alfresco files. Is there have a ways to know a document is locked?


Thanks in advance
3 REPLIES 3

kaynezhang
World-Class Innovator
World-Class Innovator
A node that is locked would have a cm:lockable aspect applied to it. You can check whether a node is locked by checking whether it has cm:lockable aspect.
Like following

AlfrescoDocument doc = (AlfrescoDocument) session.getObjectByPath("/***/***");
if(doc.hasAspect("P:cm:lockable")){
   //locked
}

andywong
Champ in-the-making
Champ in-the-making
kaynezhang, Thank you very much . It works.

kaynezhang
World-Class Innovator
World-Class Innovator
OK,Goold luck.