12-16-2013 05:11 AM
@Override
protected void executeImpl(Action uAction, NodeRef uNodeRef) {
try {
List<String> data = new ArrayList<String>();
data.add("folderone");
data.add("foldertwo");
checkFolder(data);
} catch (Exception e) {
// TODO Auto-generated catch block
throw new AlfrescoRuntimeException("Error "+e.toString());
}
}
private boolean checkFolder(List<String> folderName) {
boolean folderCheck = false;
StringBuilder strBuilder = new StringBuilder();
StoreRef store = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
String base = "//app:company_home/st:sites/cm:folders";
for(String data : folderName) {
strBuilder.append("/cm:"+search.ISO9075Encode(data));
String query = "//app:company_home/st:sites/cm:folders"+strBuilder.toString();
ResultSet rs = searchService.query(store, SearchService.LANGUAGE_XPATH, query);
logger.error("ResultSet: "+rs.length()+" - Query: "+query+" Base: "+base);
if(rs.length()==0) {
rs = searchService.query(store, SearchService.LANGUAGE_XPATH, base);
NodeRef ref = rs.getNodeRef(0);
fileFolderService.create(ref, search.ISO9075Decode(data), ContentModel.TYPE_FOLDER);
}
base = base+strBuilder.toString();
}
return folderCheck;
}
12-16-2013 07:01 AM
12-16-2013 07:31 AM
12-16-2013 10:11 AM
12-16-2013 10:50 AM
12-19-2013 10:27 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.