use of org.alfresco.repo.model.filefolder.HiddenAspect.Visibility in project alfresco-repository by Alfresco.
the class AbstractEventsService method getNodeInfo.
protected NodeInfo getNodeInfo(final NodeRef nodeRef, final String eventType) {
NodeInfo nodeInfo = AuthenticationUtil.runAsSystem(new RunAsWork<NodeInfo>() {
public NodeInfo doWork() throws Exception {
NodeInfo nodeInfo = null;
String txnId = AlfrescoTransactionSupport.getTransactionId();
if (!includeEventType(eventType)) {
nodeInfo = new NodeInfo(eventType, null, null, nodeRef, null, null, null, null, null, null, null, null, false, null, null);
} else if (nodeRef == null || !nodeService.exists(nodeRef)) {
nodeInfo = new NodeInfo(eventType, txnId, null, nodeRef, null, null, null, null, null, null, null, false, true, false, null);
} else {
FileFilterMode.Client filterclient = FileFilterMode.getClient();
Visibility visibility = hiddenAspect.getVisibility(filterclient, nodeRef);
QName type = nodeService.getType(nodeRef);
if (!typeMatches(type)) {
nodeInfo = new NodeInfo(eventType, txnId, null, nodeRef, null, null, null, null, null, null, null, true, true, false, false);
} else if (!visibility.equals(Visibility.Visible)) {
nodeInfo = new NodeInfo(eventType, txnId, null, nodeRef, null, null, null, null, null, null, null, true, true, true, true);
} else {
SiteInfo siteInfo = siteService.getSite(nodeRef);
String siteId = (siteInfo != null ? siteInfo.getShortName() : null);
Set<QName> aspects = nodeService.getAspects(nodeRef);
final String name = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
List<Path> nodePaths = Collections.singletonList(nodeService.getPath(nodeRef));
Date modifiedTime = (Date) nodeService.getProperty(nodeRef, ContentModel.PROP_MODIFIED);
Long modificationTimestamp = (modifiedTime != null ? modifiedTime.getTime() : null);
Status status = nodeService.getNodeStatus(nodeRef);
Client client = ClientUtil.from(filterclient);
nodeInfo = new NodeInfo(eventType, txnId, name, nodeRef, status, nodePaths, modificationTimestamp, type, aspects, siteId, client, true, true, true, true);
}
}
return nodeInfo;
}
});
return nodeInfo;
}
use of org.alfresco.repo.model.filefolder.HiddenAspect.Visibility in project alfresco-repository by Alfresco.
the class FileFolderServiceImpl method setHidden.
@Override
public void setHidden(NodeRef nodeRef, boolean isHidden) {
int mask = 0;
boolean allVisible = true;
Visibility webDavVisibility = isHidden ? Visibility.NotVisible : Visibility.Visible;
for (Client client : hiddenAspect.getClients()) {
Visibility clientVisibility = client == FileFilterMode.getClient() ? webDavVisibility : hiddenAspect.getVisibility(client, nodeRef);
if (clientVisibility != Visibility.Visible) {
allVisible = false;
}
mask |= hiddenAspect.getClientVisibilityMask(client, clientVisibility);
}
if (allVisible) {
hiddenAspect.showNode(nodeRef, true);
} else {
hiddenAspect.hideNode(nodeRef, mask, true, true, false);
}
}
Aggregations