Package org.apache.slide.util

Examples of org.apache.slide.util.XMLValue


        if (!PropertyHelper.removeHrefFromProperty(coutNrd, P_CHECKOUT_SET, rUri)) {
            StringBuffer b = new StringBuffer("Invalid path");
            PropertyHelper propertyHelper = PropertyHelper.getPropertyHelper(sToken, nsaToken, sConf);
            NodeProperty checkoutSetProp = propertyHelper.getProperty(P_CHECKOUT_SET, coutNrds, coutNrd, slideContextPath);
            if( checkoutSetProp != null && checkoutSetProp.getValue() != null ) {
                XMLValue checkoutSetValue = new XMLValue( checkoutSetProp.getValue().toString() );
                if (checkoutSetValue.iterator().hasNext()) {
                    b.append(" - please use "+checkoutSetValue.getTextValue()+" instead");
                }
            }
            throw new ConflictException(
                rUri, new SlideException(b.toString()));
        }
View Full Code Here


            if (!PropertyHelper.removeHrefFromProperty(vrNrdOld, P_CHECKOUT_SET, rUri)) {
                StringBuffer b = new StringBuffer("Invalid path");
                PropertyHelper propertyHelper = PropertyHelper.getPropertyHelper(sToken, nsaToken, sConf);
                NodeProperty checkoutSetProp = propertyHelper.getProperty(P_CHECKOUT_SET, vhrNrds, vrNrdOld, slideContextPath);
                if( checkoutSetProp != null && checkoutSetProp.getValue() != null ) {
                    XMLValue checkoutSetValue = new XMLValue( checkoutSetProp.getValue().toString() );
                    if (checkoutSetValue.iterator().hasNext()) {
                        b.append(" - please use "+checkoutSetValue.getTextValue()+" instead");
                    }
                }
                throw new ConflictException(
                    rUri, new SlideException(b.toString()));
            }
View Full Code Here

        SlideToken stok = sToken;
       
        ViolatedPrecondition violatedPrecondition = null;
       
        if ( (predSetProp != null) && (predSetProp.getValue() != null) ) {
            XMLValue predecessors = new XMLValue( (String)predSetProp.getValue() );
           
            Iterator iterator = predecessors.iterator();
            while (iterator.hasNext()) {
                String href = ((Element)iterator.next()).getTextTrim();
                if (href != null) {
                   
                    UriHandler predecessorUriHandler = UriHandler.getUriHandler( href);
View Full Code Here

    protected String getForkBranch(NodeProperty predSetProp, NodeRevisionDescriptors vhrNrds, boolean isForkOk) throws LinkedObjectNotFoundException, ServiceAccessException, ObjectLockedException, RevisionDescriptorNotFoundException, JDOMException, IllegalArgumentException, ObjectNotFoundException, AccessDeniedException, IOException, VetoException {
       
        String forkBranch = null;
       
        if ( (predSetProp != null) && (predSetProp.getValue() != null) ) {
            XMLValue predecessors = new XMLValue( (String)predSetProp.getValue() );
           
            Iterator iterator = predecessors.iterator();
            if (iterator.hasNext()) {
                String href = ((Element)iterator.next()).getTextTrim();
                if (href != null) {
                   
                    UriHandler predecessorUriHandler = UriHandler.getUriHandler( href);
View Full Code Here

            NodeRevisionDescriptors historyNrds = content.retrieve(sToken, historyUri);
            NodeRevisionDescriptor historyNrd =
                content.retrieve(sToken, historyNrds, NodeRevisionNumber.HIDDEN_0_0);
            NodeProperty versionSet = historyNrd.getProperty(P_VERSION_SET);
            try {
                XMLValue versionSetValue = new XMLValue(versionSet.getValue().toString());
                NodeRevisionDescriptor vrNrd = null;
                NodeProperty labelNameSetProperty = null;
                String labelNameSetString = null;
                Iterator versionSetIterator = versionSetValue.iterator();
                String vrUri = null;
                UriHandler vrUriHandler = null;
                boolean found = false;
                while ( !found && versionSetIterator.hasNext() ) {
                    vrUri = ((Element)versionSetIterator.next()).getText();
                    vrUriHandler = UriHandler.getUriHandler(vrUri);
                    NodeRevisionNumber vrRevisionNumber = new NodeRevisionNumber(vrUriHandler.getVersionName());
                    vrNrd = content.retrieve(sToken, historyNrds, vrRevisionNumber);
                    labelNameSetProperty = vrNrd.getProperty(P_LABEL_NAME_SET);
                    if ( (labelNameSetProperty != null) && (labelNameSetProperty.getValue() != null) ) {
                        labelNameSetString = labelNameSetProperty.getValue().toString();
                        if (labelNameSetString != null) {
                            XMLValue labelNameSet = new XMLValue(labelNameSetString);
                            Iterator labelNameSetIterator = labelNameSet.iterator();
                            while ( !found && labelNameSetIterator.hasNext() ) {
                                found = label.equals(((Element)labelNameSetIterator.next()).getText());
                            }
                        }
                    }
View Full Code Here

                property = revisionDescriptor.getProperty(P_CHECKED_IN);
            }
            if ( (property != null) && (property.getValue() != null) ) {
               
                try {
                    XMLValue xmlValue = new XMLValue(property.getValue().toString());
                    Iterator iterator = xmlValue.iterator();
                    if (iterator.hasNext()) {
                        Element element = (Element)iterator.next();
                        vrUri = element.getText();
                    }
                }
View Full Code Here

            try {
                NodeRevisionDescriptor nrd =
                    groupUri.getStore().retrieveRevisionDescriptor(groupUri, new NodeRevisionNumber());
                NodeProperty membersetProp = nrd.getProperty("group-member-set");
                if (membersetProp != null && membersetProp.getValue() != null) {
                    XMLValue xmlVal = new XMLValue((String)membersetProp.getValue());
                    List memberNodes = xmlVal.getHrefNodes();
                    if (memberNodes.contains(checkSubject)) {
                        return true;
                    }
                    else if (level > 0) {
                        int nextLevel = level - 1;
View Full Code Here

        // if objectNode is the root of a store, parent-uuri.equals(""),
        // thus we cannot call getFirstMapping because
        // we cannot resolve the uuri
        boolean useBinding = Configuration.useBinding(this) && !resourceId.isStoreRoot();
       
        XMLValue result = new XMLValue();
        Enumeration parentBindings = objectNode.enumerateParentBindings();
        while (parentBindings.hasMoreElements()) {
            ObjectNode.Binding parentBinding = (ObjectNode.Binding) parentBindings.nextElement();
            Element parentElm = new Element("parent", NodeProperty.NamespaceCache.DEFAULT_NAMESPACE);
            Element hrefElm = new Element("href", NodeProperty.NamespaceCache.DEFAULT_NAMESPACE);
            String parentUriStr = new UriPath(objectNode.getUri()).parent().toString();
            Uri parentUri = new Uri(uri.getToken(), uri.getNamespace(), parentUriStr);
            String uriStr;
            if (useBinding) {
                ResourceId parentResourceId = ResourceId.create(parentUri, parentBinding.getUuri());
                uriStr = getFirstMapping(parentResourceId);
            }
            else {
                uriStr = parentUriStr;
            }
            hrefElm.setText(uriStr);
            parentElm.addContent(hrefElm);
            Element segmentElm = new Element("segment", NodeProperty.NamespaceCache.DEFAULT_NAMESPACE);
            segmentElm.setText(parentBinding.getName());
            parentElm.addContent(segmentElm);
            result.add(parentElm);
        }
       
        return result.toString();
    }
View Full Code Here

            String value = "";
            if (content.size() == 1 && content.get(0) instanceof Text) {
                value = ((Text)content.get(0)).getText();
            }
            else if (content.size() > 0) {
                XMLValue xmlVal = new XMLValue(content);
                if (P_GROUP_MEMBER_SET.equals(name) && S_DAV.equals(namespaceUri)) {
                    xmlVal.stripServletContext(getSlideContextPath());
                }
                value = xmlVal.toString();
            }
            // register prefix/URI at NamespaceCache
            NamespaceCache.getNamespace(namespacePrefix, namespaceUri);
           
            return new PropPatchProperty(name, namespaceUri, value);
View Full Code Here

                    Element property = new Element(currentProperty.getName(), currentProperty.getNamespace());
                    String propertyValue = currentProperty.getValue();
                    if ( (propertyValue != null) && (propertyValue.toString().length() > 0)) {
                        if( propertyValue.toString().indexOf('<') >= 0 ) {
                            try {
                                XMLValue xmlValue = new XMLValue(propertyValue.toString(), Namespace.getNamespace(currentProperty.getNamespace()));
                                if (AbstractResourceKind.isLiveProperty(currentProperty.getName())) {
                                    convertHrefValueToRelativeURL (xmlValue, getSlideContextPath(), config);
                                }
                                Iterator iterator = xmlValue.iterator();
                                while (iterator.hasNext()) {
                                    Object o = iterator.next();
                                    if( o instanceof Element )
                                        property.addContent((Element)o);
                                    else if( o instanceof Text )
View Full Code Here

TOP

Related Classes of org.apache.slide.util.XMLValue

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.