Package org.apache.slide.common

Examples of org.apache.slide.common.NamespaceConfig


     */
    public XMLValue computeAcl(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
       
        XMLValue xmlValue = new XMLValue();
       
        NamespaceConfig config = nsaToken.getNamespaceConfig();
        Structure structure = nsaToken.getStructureHelper();
        ObjectNode objectNode =  structure.retrieve(sToken, revisionDescriptors.getUri());
       
        // check read-acl permission
        Security security = nsaToken.getSecurityHelper();
        security.checkCredentials(sToken, objectNode, config.getReadPermissionsAction());
       
        String currentSubjectUri = "";
        boolean currentNegative = false;
        Element currentAceElm = null;
        Element currentGrantDenyElm = null;
View Full Code Here


     * @throws   ObjectNotFoundException
     * @throws   JDOMException
     */
    public XMLValue computePrincipalCollectionSet(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
        XMLValue xmlValue = new XMLValue();
        NamespaceConfig namespaceConfig = nsaToken.getNamespaceConfig();
       
        xmlValue.addHref(WebdavUtils.getAbsolutePath (namespaceConfig.getUsersPath(),
                                                      contextPath, null, sConf));
       
        if (namespaceConfig.getGroupsPath() != null) {
           
            xmlValue.addHref(WebdavUtils.getAbsolutePath (namespaceConfig.getGroupsPath(),
                                                          contextPath, null, sConf));
        }
        if (namespaceConfig.getRolesPath() != null) {
            xmlValue.addHref(WebdavUtils.getAbsolutePath (namespaceConfig.getRolesPath(),
                                                          contextPath, null, sConf));
        }
        return xmlValue;
    }
View Full Code Here

    }
   
   
    public XMLValue computePrivilegeCollectionSet(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
        XMLValue xmlValue = new XMLValue();
        NamespaceConfig namespaceConfig = nsaToken.getNamespaceConfig();
       
        String absUri = WebdavUtils.getAbsolutePath (namespaceConfig.getActionsPath(),
                                                     contextPath, servletPath, sConf);
       
        xmlValue.addHref(absUri);
        return xmlValue;
    }
View Full Code Here

   
    // FIXME wihtout servletPath??
    private XMLValue createUserPath(NodeProperty userProperty, String contextPath) throws IllegalArgumentException {
        XMLValue xmlValue = new XMLValue();
        String userHref = "";
        NamespaceConfig config = nsaToken.getNamespaceConfig();
        if ((userProperty != null) && (userProperty.getValue()!=null) &&
                (!"".equals(userProperty.getValue().toString()))) {
           
            userHref = contextPath + config.getUsersPath() + "/" + userProperty.getValue().toString();
            xmlValue.addHref(userHref);
        }
        else {
            xmlValue.add(new Element(E_UNAUTHENTICATED, DNSP));
        }
View Full Code Here

                                         "This report is only defined for depth=0."),
                resourcePath
            );
        }
        UriPath resourcepath = new UriPath(resourcePath);
        NamespaceConfig namespaceConfig = token.getNamespaceConfig();
        UriPath userspath = namespaceConfig.getUsersPath() != null
            ? new UriPath(namespaceConfig.getUsersPath())
            : null;
        UriPath groupspath = namespaceConfig.getGroupsPath() != null
            ? new UriPath(namespaceConfig.getGroupsPath())
            : null;
        UriPath rolespath = namespaceConfig.getRolesPath() != null
            ? new UriPath(namespaceConfig.getRolesPath())
            : null;
        if (!resourcepath.equals(userspath) &&
            !resourcepath.equals(groupspath) &&
            !resourcepath.equals(rolespath)) {
            throw new PreconditionViolationException(
View Full Code Here

    /**
     * Factory method.
     */
    static public ResourceKind determineResourceKind( NamespaceAccessToken nsaToken, String resourcePath, NodeRevisionDescriptor nrd ) {
        UriHandler uh = UriHandler.getUriHandler( resourcePath );
        NamespaceConfig config = nsaToken.getNamespaceConfig();
       
        if( nrd == null ) {
            return DeltavCompliantUnmappedUrlImpl.getInstance();
        }
        else if( uh.isHistoryUri() ) {
            return VersionHistoryImpl.getInstance();
        }
        else if( uh.isVersionUri() ) {
            return VersionImpl.getInstance();
        }
        else if( uh.isWorkspaceUri() ) {
            return WorkspaceImpl.getInstance();
        }
        else if( uh.isWorkingresourceUri() ) {
            return WorkingImpl.getInstance();
        }
        else if( nrd.exists(P_CHECKED_IN) ) {
            return CheckedInVersionControlledImpl.getInstance();
        }
        else if( nrd.exists(P_CHECKED_OUT) ) {
            return CheckedOutVersionControlledImpl.getInstance();
        }
        else if( config.isPrincipal(resourcePath) ) {
            return PrincipalImpl.getInstance();
        }
        else if( nrd.propertyValueContains(P_RESOURCETYPE, E_COLLECTION) ) {
            return DeltavCompliantCollectionImpl.getInstance();
        }
View Full Code Here

           
            case LOCK_CREATION:
               
                try {
                   
                    NamespaceConfig namespaceConfig = token.getNamespaceConfig();
                   
                    try {
                        toLockSubject = (SubjectNode) structure
                            .retrieve(slideToken, lockInfo_lockSubject);
                    } catch (ObjectNotFoundException ex) {
                       
                        // Creating a lock null resource
                        toLockSubject = new SubjectNode();
                       
                        // Creating new subject
                        structure.create(slideToken, toLockSubject,
                                         lockInfo_lockSubject);
                       
                        NodeRevisionDescriptor revisionDescriptor =
                            new NodeRevisionDescriptor(0);
                       
                        // Resource type
                        XMLValue lockNull =
                            new XMLValue(new Element(E_LOCKNULL, DNSP));
                        revisionDescriptor.setResourceType(lockNull.toString());
                       
                        // Creating the revision descriptor
                        content.create(slideToken, lockInfo_lockSubject,
                                       revisionDescriptor, null);
                    }
                   
                    NodeLock lockToken = null;
                   
                    inheritance = (depth != 0);
                    boolean exclusive =
                        !(lockInfo_lockScope.equals(E_SHARED));
                   
                    if (lockDate == null)
                        lockDate = new Date((new Date()).getTime()
                                                + ((long)lockDuration * 1000L));
                   
                    lockToken =
                        new NodeLock(toLockSubject, (SubjectNode)security.getPrincipal(slideToken),
                                     namespaceConfig.getCreateObjectAction(),
                                     lockDate, inheritance, exclusive, lockInfo_lockOwner);
                    lock.lock(slideToken, lockToken);
                   
                    // Set the lock-token header
                    // [RFC 2518, 9.5] " The Lock-Token response header is used
View Full Code Here

     * @return a String containing the files path
     */
    public String getFilesPath() {
       
        String filesPath = "";
        NamespaceConfig config = nat.getNamespaceConfig();
        if (config != null) {
            filesPath = config.getFilesPath();
        }
       
        return filesPath;
    }
View Full Code Here

     * @return a String containing the guest path
     */
    public String getGuestPath() {
       
        String guestPath = "";
        NamespaceConfig config = nat.getNamespaceConfig();
        if (config != null) {
            guestPath = config.getGuestPath();
        }
       
        return guestPath;
    }
View Full Code Here

     * @return a String containing the users path
     */
    public String getUsersPath() {
       
        String usersPath = "";
        NamespaceConfig config = nat.getNamespaceConfig();
        if (config != null) {
            usersPath = config.getUsersPath();
        }
       
        return usersPath;
    }
View Full Code Here

TOP

Related Classes of org.apache.slide.common.NamespaceConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.