07-23-2012 09:49 PM
07-29-2012 06:03 PM
07-29-2012 06:07 PM
07-29-2012 06:31 PM
01-31-2016 12:56 PM
05-05-2017 04:22 PM
Hi all,
Code below should help you. I use it to hide working copy nodes for cifs/nfs/ftp clients using custom behaviours:
This code set sys:clientVisibilityMask to 166440
<code>
import org.alfresco.repo.model.filefolder.HiddenAspect;
import org.alfresco.repo.model.filefolder.HiddenAspect.Visibility;
.......
private HiddenAspect hiddenAspect = new HiddenAspect();
.....
int mask = 0;
// mask |= hiddenAspect.getClientVisibilityMask(Client.cifs, Visibility.HiddenAttribute);
mask |= hiddenAspect.getClientVisibilityMask(Client.cifs, Visibility.NotVisible);
mask |= hiddenAspect.getClientVisibilityMask(Client.imap, Visibility.Visible);
mask |= hiddenAspect.getClientVisibilityMask(Client.webdav, Visibility.Visible);
mask |= hiddenAspect.getClientVisibilityMask(Client.nfs, Visibility.NotVisible);
mask |= hiddenAspect.getClientVisibilityMask(Client.script, Visibility.Visible);
mask |= hiddenAspect.getClientVisibilityMask(Client.webclient, Visibility.Visible);
mask |= hiddenAspect.getClientVisibilityMask(Client.ftp, Visibility.NotVisible);
mask |= hiddenAspect.getClientVisibilityMask(Client.cmis, Visibility.Visible);
mask |= hiddenAspect.getClientVisibilityMask(Client.admin, Visibility.Visible);
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
props.put(ContentModel.PROP_VISIBILITY_MASK, mask);
props.put(ContentModel.PROP_HIDDEN_FLAG, true); // hidden regardless of file name patterns
this.services.getNodeService().addAspect(nodeRef, ContentModel.ASPECT_HIDDEN, props);
</code>
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.