Geetha
Occasional Observer

Lock a folder using workflow

Hello EveryOne ,

I am able to lock and unlock a page using script through workflow . script is below.

I need to lock  a folder so that all sub folders get locked recursively. how to do this ??? Please support.Thank you!

Lock script


text = " locked!";
try{

storeElement = context.getStoreElement();

if(storeElement instanceof PageRef)

{

context.logInfo("PageRef gelockt:: " + storeElement.isLocked() + " WriteLock: " + storeElement.getWriteLock());

page = storeElement.getPage();
if(!page.getWriteLock()){
context.logInfo("writelock gelockt");
page.setColor(java.awt.Color.YELLOW);
page.setWriteLock(true);
page.setLock(true);
page.save();


}
}
} catch(Exception e){

}
context.logInfo("dotransition" +context.getTransitionParameters());
if ( context instanceof de.espirit.firstspirit.access.store.templatestore.WorkflowScriptContext){
context.doTransition("object_locked");
}

Worklfow :

workflow.png

 

0 Kudos
1 Reply
bIT_sosswald
Returning Responder

Hi Geetha,

 

just have a look into the API documentation: https://docs.e-spirit.com/odfs/access/de/espirit/firstspirit/access/store/StoreElement.html#setLock(...

 

Greetings
Sandro