//Fetching folders and sub folders in CE
public void FetchCEFolder(Connection conn) { //FileNet CE Connection
try {
Domain domain = Factory.Domain.fetchInstance(conn, null, null);
ObjectStore objStore = Factory.ObjectStore.fetchInstance(domain,"OSNAME", null);
System.out.println("Object Store ="+ objStore.get_DisplayName() );
String folder= "/NewFolder";
// Fetching Parent folder
com.filenet.api.core.Folder folderOj= Factory.Folder.fetchInstance(objStore,folder, null);
System.out.println("del"+folderOj.get_Name());
//Fetching sub folders
FolderSet subFolders= folderOj.get_SubFolders();
Iterator it = subFolders.iterator();
while(it.hasNext()){
com.filenet.api.core.Folder subFolder= (com.filenet.api.core.Folder) it.next();
String name = ((com.filenet.api.core.Folder) subFolder).get_FolderName();
System.out.println("Subfolder = "+name);
// Fetching hidden folders
if(subFolder.getProperties().getBooleanValue("IsHiddenContainer"))
System.out.println("Folder "+ name + "is hidden");
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void FetchCEFolder(Connection conn) { //FileNet CE Connection
try {
Domain domain = Factory.Domain.fetchInstance(conn, null, null);
ObjectStore objStore = Factory.ObjectStore.fetchInstance(domain,"OSNAME", null);
System.out.println("Object Store ="+ objStore.get_DisplayName() );
String folder= "/NewFolder";
// Fetching Parent folder
com.filenet.api.core.Folder folderOj= Factory.Folder.fetchInstance(objStore,folder, null);
System.out.println("del"+folderOj.get_Name());
//Fetching sub folders
FolderSet subFolders= folderOj.get_SubFolders();
Iterator it = subFolders.iterator();
while(it.hasNext()){
com.filenet.api.core.Folder subFolder= (com.filenet.api.core.Folder) it.next();
String name = ((com.filenet.api.core.Folder) subFolder).get_FolderName();
System.out.println("Subfolder = "+name);
// Fetching hidden folders
if(subFolder.getProperties().getBooleanValue("IsHiddenContainer"))
System.out.println("Folder "+ name + "is hidden");
}
} catch (Exception e) {
e.printStackTrace();
}
}
No comments:
Post a Comment