Package org.apache.slide.structure

Examples of org.apache.slide.structure.ActionNode


    protected void recursiveLockCheck(Uri uri) throws SlideException,
            ObjectLockedException
    {
        try {
            ObjectNode node = uri.getStore().retrieveObject(uri);
            ActionNode action = namespaceConfig.getCreateObjectAction();
            lockHelper.checkLock(uri.getToken(), node, action);
            Iterator i = node.getChildren().iterator();
            while (i.hasNext()) {
                String child = (String) i.next();
                Uri childUri = namespace.getUri(uri.getToken(), child);
View Full Code Here


            Enumeration actions = actionsPathNode.enumerateChildren();
            addActionLeafsToActionAggregation(security, token, cache, actions);

            Iterator keys = cache.aggregationClosure.keySet().iterator();
            while (keys.hasNext()) {
                ActionNode aNode = (ActionNode)keys.next();
                Set aClosure = (Set)cache.aggregationClosure.get(aNode);
                cache.aggregationClosure.put(aNode, buildClosure(cache, aClosure));
            }
            // log success
            if (security.logger.isEnabled(LOG_CHANNEL, Logger.DEBUG)) {
View Full Code Here

                if (security.logger.isEnabled(Logger.DEBUG)) {
                    security.logger.log("Adding action " + oNode.getUri() + " to action aggregation", LOG_CHANNEL, Logger.DEBUG);
                }
                NodeRevisionNumber latestRevisionNumber = security.namespace.getStore(aNodeUri.getScope()).retrieveRevisionDescriptors(aNodeUri).getLatestRevision();
                NodeProperty privilegeNamespace = security.namespace.getStore(aNodeUri.getScope()).retrieveRevisionDescriptor(aNodeUri, latestRevisionNumber).getProperty(PRIVILEGE_NAMESPACE, "DAV:");
                ActionNode aNode;
                org.jdom.Namespace actionNamespace;
                if (privilegeNamespace != null && privilegeNamespace.getValue() instanceof String) {
                    actionNamespace = org.jdom.Namespace.getNamespace((String) privilegeNamespace.getValue());
                } else {
                    actionNamespace = org.jdom.Namespace.getNamespace("DAV:");
View Full Code Here

        SubjectNode matchSubject = SubjectNode.getSubjectNode(matchToken.getSubjectUri());
        boolean condition2 =
            securityHelper.matchPrincipal(slideToken, checkSubject, matchSubject);
       
        // lock-types-are-equal OR lock-type-of-matchToken-is-parent
        ActionNode checkAction = ActionNode.getActionNode(checkToken.getTypeUri());
        ActionNode matchAction = ActionNode.getActionNode(matchToken.getTypeUri());
        boolean condition3 =
            securityHelper.matchAction(slideToken, checkAction, matchAction);
       
        // checkToken-is-exclusive
        boolean condition4 = checkToken.isExclusive();
View Full Code Here

    public XMLValue computeSupportedPrivilegeSet(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String slideContextPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
        Map actionAggregation = ((SecurityImpl)nsaToken.getSecurityHelper()).getActionAggregation(sToken);
        Set rootSet = new HashSet(actionAggregation.keySet());
        Iterator actions = actionAggregation.keySet().iterator();
        while (actions.hasNext()) {
            ActionNode a = (ActionNode)actions.next();
            Iterator aggregates = ((Set)actionAggregation.get(a)).iterator();
            while (aggregates.hasNext()) {
                ActionNode c = (ActionNode)aggregates.next();
                rootSet.remove(c);
            }
        }
        Element rootSp = new Element(E_SUPPORTED_PRIVILEGE, DNSP);
        Element p = new Element(E_PRIVILEGE, DNSP);
View Full Code Here

     * @param actionAggregation A map from an action to its direct aggregated
     *                          actions.
     */
    private void addElementsForAggregatedActions(Element parentActionElement, Iterator aggregatedActions, Map actionAggregation) {
        while (aggregatedActions.hasNext()) {
            ActionNode a = (ActionNode)aggregatedActions.next();
            Element sp = new Element(E_SUPPORTED_PRIVILEGE, DNSP);
            Element p = new Element(E_PRIVILEGE, DNSP);
            Namespace actionNamespace = a.getNamespace();
            if (actionNamespace == null) {
                actionNamespace = DNSP;
            }
            p.addContent(new Element(a.getPath().lastSegment(), actionNamespace));
            addElementsForAggregatedActions(p, ((Set)actionAggregation.get(a)).iterator(), actionAggregation);
            sp.addContent(p);
            parentActionElement.addContent(sp);
        }
    }
View Full Code Here

            Uri aNodeUri = nsaToken.getUri(sToken, (String)actions.nextElement());
            ObjectNode oNode = aNodeUri.getStore().retrieveObject(aNodeUri);
            if (oNode.hasChildren()) {
                addGrantedActionsToPrivilegeSet(xmlValue, object, oNode.enumerateChildren());
            } else {
                ActionNode aNode = ActionNode.getActionNode(oNode.getUri());
                if (nsaToken.getSecurityHelper().hasPermission(sToken, object, aNode)) {
                    xmlValue.add(createPrivilege(aNode, aNodeUri));
                }
            }
        }
View Full Code Here

        Map actionAggregation = ((SecurityImpl)nsaToken.getSecurityHelper()).getActionAggregation();
        Set rootSet = new HashSet(actionAggregation.keySet());
        Map work = new HashMap();
        Iterator actions = actionAggregation.keySet().iterator();
        while (actions.hasNext()) {
            ActionNode a = (ActionNode)actions.next();
            Element sp = new Element(E_SUPPORTED_PRIVILEGE, DNSP);
            Element p = new Element(E_PRIVILEGE, DNSP);
            p.addContent(new Element(a.getPath().lastSegment(), DNSP));
            sp.addContent(p);
            work.put(a, sp);
        }
        actions = actionAggregation.keySet().iterator();
        while (actions.hasNext()) {
            ActionNode a = (ActionNode)actions.next();
            Iterator aggregates = ((Set)actionAggregation.get(a)).iterator();
            while (aggregates.hasNext()) {
                ActionNode c = (ActionNode)aggregates.next();
                ((Element)work.get(a)).addContent((Element)work.get(c));
                rootSet.remove(c);
            }
        }
        Element rootSp = new Element(E_SUPPORTED_PRIVILEGE, DNSP);
View Full Code Here

            String actionsPath = config.getActionsPath();
            Uri actionsPathUri = nsaToken.getUri(sToken, actionsPath);
            ObjectNode actionsPathNode = actionsPathUri.getStore().retrieveObject(actionsPathUri);
            Enumeration actions = actionsPathNode.enumerateChildren();
            while (actions.hasMoreElements()) {
                ActionNode aNode = ActionNode.getActionNode((String)actions.nextElement());
                if (security.hasPermission(sToken, object, aNode)) {
                    xmlValue.add(createPrivilege(aNode.getPath().lastSegment()));
                }
            }
        }
        catch (ServiceAccessException e) {
            throw e;
View Full Code Here

        this.content = nsaToken.getContentHelper();
        this.structure = nsaToken.getStructureHelper();
        this.macro = nsaToken.getMacroHelper();
        this.lock = nsaToken.getLockHelper();
        this.pHelp = PropertyHelper.getPropertyHelper( sToken, nsaToken, sConf );
        ActionNode actionNode = nsaToken.getNamespaceConfig().getModifyRevisionMetadataAction();
        if (actionNode != null) {
            modifyMetadataUri = actionNode.getUri();
        }
        else {
            modifyMetadataUri = "";
        }
        actionNode = nsaToken.getNamespaceConfig().getModifyRevisionContentAction();
        if (actionNode != null) {
            modifyContentUri = actionNode.getUri();
        }
        else {
            modifyContentUri = "";
        }
        serverURL = "http://" + req.getServerName()+ ":" + req.getServerPort();
View Full Code Here

TOP

Related Classes of org.apache.slide.structure.ActionNode

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.