Folder Create Macro
PostPosted:Wed Jan 15, 2014 6:50 pm
I was able to locate the example for file moves using the macro extension. What is the syntax to create a folder in macros.actions?
What I would like to do is every time some one creates a new project folder in OpenKM 3 folders are generated beneath the new folder. I tried to use automation, but I am having an issue stopping it looping into the folder set. I tried to use the event of the Property Group add, but it was not working. I used the Folder Create event, but that creates a looping issue. I tried putting a conditional in the script not to create the folder if it had one of the 3 subfolders created by the script, but I am unsure which API to use to return the folder name (not UUID) of the current folder.
I am not sure what would be the best method to execute the folder creation; Automation and script or Macros.
Details Below.
Thank you for your time.
OpenKM Community Edition 6.2.5
Oracle Enterprise Linux x64
Working script for automated folder create:
What I would like to do is every time some one creates a new project folder in OpenKM 3 folders are generated beneath the new folder. I tried to use automation, but I am having an issue stopping it looping into the folder set. I tried to use the event of the Property Group add, but it was not working. I used the Folder Create event, but that creates a looping issue. I tried putting a conditional in the script not to create the folder if it had one of the 3 subfolders created by the script, but I am unsure which API to use to return the folder name (not UUID) of the current folder.
I am not sure what would be the best method to execute the folder creation; Automation and script or Macros.
Details Below.
Thank you for your time.
OpenKM Community Edition 6.2.5
Oracle Enterprise Linux x64
Working script for automated folder create:
Code: Select all
import com.openkm.api.OKMFolder;
import com.openkm.api.OKMRepository;
String path = OKMRepository.getInstance().getNodePath(null, uuid);
String subpathfun = path + "/Functional";
OKMFolder.getInstance().createSimple(null, subpathfun);
String subpathtech = path + "/Technical";
OKMFolder.getInstance().createSimple(null, subpathtech);
String subpathimp = path + "/Implementation";
OKMFolder.getInstance().createSimple(null, subpathimp);