07-03-2009 04:09 AM
(Global) :
private Random random = new Random();
(in the method) :
…
newName += System.currentTimeMillis() + random.nextInt();
fileFolderService.move(nodeToMove, parentNodeRef, newName);
…
07-09-2009 05:52 AM
07-09-2009 09:08 AM
(Global) :
private Random random = new Random();
…
public void executeImpl(Action action, NodeRef actionedUponNodeRef) {
if (logger.isDebugEnabled()) {
logger.debug("Action : OrganiseFileInDirectory");
}
// Check that the node still exists
if (this.nodeService.exists(actionedUponNodeRef) == true) {
try {
if (logger.isDebugEnabled()) {
logger.debug("Begin");
}
// Create tool to manage nodes
NodeManager nodeManager = new NodeManager(nodeService,
fileFolderService, mimetypeService, contentService);
// Get the name of the node
String nameDocument = nodeManager
.getNameOfNodeRef(actionedUponNodeRef);
// Directory to create
String newRep = "newRep";
// Test that it is not newRep coming (the action is not generate by the creation of this directory)
if (nameDocument.equals(newRep)){
return;
}
// Get infos on the present directory
NodeRef parentNodeRef = nodeService.getPrimaryParent(
actionedUponNodeRef).getParentRef();
// Creation of a directory
NodeRef nodeNewRep = nodeService.getChildByName(parentNodeRef,
ContentModel.ASSOC_CONTAINS, newRep);
if (nodeNewRep == null) {
// Create the newRep
FileInfo fileInfo = fileFolderService.create(parentNodeRef,
newRep, ContentModel.TYPE_FOLDER);
nodeNewRep=fileInfo.getNodeRef();
}
// Move the file in the directory
nameDocument += System.currentTimeMillis() + random.nextInt();
fileFolderService.move(actionedUponNodeRef, nodeNewRep, nameDocument);
} catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.debug(e.getMessage());
logger.debug(e.toString());
}
}
if (logger.isDebugEnabled()) {
logger.debug("End");
}
}
}
07-10-2009 03:45 AM
…
// Move the file in the directory
nameDocument += System.currentTimeMillis() + random.nextInt();
fileFolderService.move(actionedUponNodeRef, parentNodeRef,
nameDocument);
…
// Move the file in the directory
nameDocument += System.currentTimeMillis() + random.nextInt();
fileFolderService.move(actionedUponNodeRef, parentNodeRef, nameDocument);
fileFolderService.move(actionedUponNodeRef, nodeNewRep,null);
07-10-2009 05:25 AM
07-10-2009 07:23 AM
07-10-2009 07:59 AM
07-10-2009 08:40 AM
…
fileFolderService.move(actionedUponNodeRef, parentNodeRef,nameDocument);
fileFolderService.copy(actionedUponNodeRef, nodeNewRep,null);
07-23-2009 10:55 AM
08-17-2009 10:40 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.