I've got a code which auto creates a folder when I create a custom document.
I want the folder to be created at any place that I'm working on. e.g if I'm creating a document /Systems/Folder I want the folder to be created on /Systems/Folder and link the folder into the destination folder.
The problem I have now when I'm working on /Systems/Folder my code creates folder on Home Cabinet and link it into the destination folder.
I don't want the folder to be created on the Home cabinet if i'm not working on the home cabinet. I want the folder to be created on the home cabinet only if i'm working on the home cabinet.
Below is my code:
try {
// newFolder.save();
newFolder = (IDfFolder) getSession().newObject("otp_folder");
newFolder.setObjectName(super.getObjectName());
System.out.println("Folder created : " + super.getObjectName());
//writeToLog("new folder created = " + super.getObjectName());
newFolder.save();
newFolder.link(parentFolderId);
newFolder.save();
newFolderId = newFolder.getString("i_folder_id");
System.out.println(newFolderId);
// writeToLog("new folder id = " + newFolderId);
//writeToLog(strDate + strTime);
} catch (DfException dfe) {
dfe.printStackTrace();
}