06-02-2016 10:50 AM
06-02-2016 01:31 PM
public HomeSpaceNodeRef getHomeFolder(HomeFolderProvider2 provider, NodeRef person, boolean referenceRootNode)
{
HomeSpaceNodeRef homeSpaceNodeRef = null;
NodeRef existingHomeFolder = DefaultTypeConverter.INSTANCE.convert(
NodeRef.class, nodeService.getProperty(
person, ContentModel.PROP_HOMEFOLDER));
if (existingHomeFolder != null)
{
homeSpaceNodeRef = new HomeSpaceNodeRef(existingHomeFolder,
HomeSpaceNodeRef.Status.VALID);
}
else if (referenceRootNode)
{
homeSpaceNodeRef = new HomeSpaceNodeRef(getRootPathNodeRef(provider),
HomeSpaceNodeRef.Status.REFERENCED);
}
else
{
// If the preferred home folder already exists, append "-N"
NodeRef root = getRootPathNodeRef(provider);
List<String> homeFolderPath = provider.getHomeFolderPath(person);
modifyHomeFolderNameIfItExists(root, homeFolderPath);
// Create folder
FileInfo fileInfo = createTree(provider, getRootPathNodeRef(provider), homeFolderPath,
provider.getTemplateNodeRef(), fileFolderService);
NodeRef homeFolderNodeRef = fileInfo.getNodeRef();
return new HomeSpaceNodeRef(homeFolderNodeRef, HomeSpaceNodeRef.Status.CREATED);
}
return homeSpaceNodeRef;
}
06-02-2016 04:41 PM
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.