06-20-2013 09:59 AM
private boolean create(String nodePath, String parentPath)
{
try {
NodeRef parentNode = getRepository().findNodeRef("path", parentPath.split("/"));
} catch(Exception e) {
System.out.println("create folder - erreur de création sur " + parentPath );
return true;
}
if (parentNode!=null)
{
FileInfo fi=null;
try {
fi = getServiceRegistry().getFileFolderService().create(parentNode,nodePath.replaceAll("/", ""),ContentModel.TYPE_FOLDER);
} catch (Exception e) {
System.out.println("create folder - erreur sur create folder - ");
}
System.out.println("create folder faite - nodeParent=" + parentNode
+ " - nodePath=" + nodePath + "___"
+ "\n name=" + fi.getName() + " - nodeRef=" +fi.getNodeRef() + " - properties=" +fi.getProperties()
);
}
return false;
}
06-21-2013 08:12 AM
06-21-2013 12:53 PM
private FolderBase creatFold3bis(String parent, String folder, boolean debug)
{
System.out.println("create folder ———————debut ");
FileInfo fi=null;
NodeRef parentNode=null;
if (parentPath.equals("Espace racine"))
{
try {
parentNode = getRepository().getCompanyHome();
} catch (Exception e) {
if (debug) System.out.println(" findNodeRef no company home ");
e.printStackTrace();
}
}
else
{
try {
parentNode = getRepository().findNodeRef("path", parentPath.split("/"));
} catch(Exception e) {
System.out.println("create folder - erreur de création sur " + parentPath );
return null;
}
}
if (parentNode!=null)
{
try {
fi = getServiceRegistry().getFileFolderService().create(parentNode,nodePath.replaceAll("/", ""),ContentModel.TYPE_FOLDER);
System.out.println("create folder faite - nodeParent=" + parentNode
+ " - nodePath=" + nodePath + "___"
+ "\n name=" + fi.getName() + " - nodeRef=" +fi.getNodeRef() + " - properties=" +fi.getProperties()
);
} catch (Exception e) {
System.out.println("create folder - erreur sur create folder - ");
}
}
System.out.println("create folder ———————fin ");
return new FolderBase(fi.getName(), "workspace/SpacesStore/" + parentPath + nodePath, fi.getNodeRef(), debug );
}
06-22-2013 03:58 PM
06-24-2013 04:28 AM
06-24-2013 08:14 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.