1 39 package org.apache.slide.webdav.util.properties; 40 41 import org.apache.slide.common.NamespaceAccessToken; 42 import org.apache.slide.common.NamespaceConfig; 43 import org.apache.slide.common.PropertyName; 44 import org.apache.slide.common.SlideException; 45 import org.apache.slide.content.NodeRevisionDescriptor; 46 import org.apache.slide.content.NodeRevisionDescriptors; 47 import org.apache.slide.util.XMLValue; 48 import org.apache.slide.webdav.util.AclConstants; 49 import org.apache.slide.webdav.util.WebdavContext; 50 import org.apache.slide.webdav.util.WebdavUtils; 51 import org.apache.slide.webdav.util.resourcekind.ResourceKind; 52 53 54 57 public class PrincipalCollectionSetProperty extends 58 AbstractComputedProperty 59 { 60 public PropertyName getPropertyName() { 61 return AclConstants.PN_PRINCIPAL_COLLECTION_SET; 62 } 63 64 public Object computeValue(NamespaceAccessToken nsaToken, 65 NodeRevisionDescriptors revisionDescriptors, 66 NodeRevisionDescriptor revisionDescriptor, ResourceKind resourceKind, WebdavContext context) 67 throws SlideException 68 { 69 XMLValue xmlValue = new XMLValue(); 70 NamespaceConfig namespaceConfig = nsaToken.getNamespaceConfig(); 71 72 xmlValue.addHref(WebdavUtils.getAbsolutePath( 73 namespaceConfig.getUsersPath(), context)); 74 75 if (namespaceConfig.getGroupsPath() != null && namespaceConfig.getGroupsPath().length() != 0) { 76 77 xmlValue.addHref(WebdavUtils.getAbsolutePath( 78 namespaceConfig.getGroupsPath(), context)); 79 } 80 if (namespaceConfig.getRolesPath() != null && namespaceConfig.getRolesPath().length() != 0) { 81 xmlValue.addHref(WebdavUtils.getAbsolutePath( 82 namespaceConfig.getRolesPath(), context)); 83 } 84 return xmlValue; 85 } 86 } 87 | Popular Tags |