Package org.apache.jackrabbit.webdav.xml

Examples of org.apache.jackrabbit.webdav.xml.XmlSerializable


        CompactNodeTypeDefWriter writer = new CompactNodeTypeDefWriter(sw, new NamespaceResolverImpl(sessionInfo), true);
        writer.write(Arrays.asList(nodeTypeDefinitions));
        writer.close();

        final String cnd = sw.toString();
        val.add(new XmlSerializable() {
            public Element toXml(Document document) {
                Element cndElem = document.createElementNS(JcrRemotingConstants.NS_URI, JcrRemotingConstants.NS_PREFIX +  ":" + JcrRemotingConstants.XML_CND);
                DomUtil.setText(cndElem, cnd);
                return cndElem;
            }
        });
        val.add(new XmlSerializable() {
            public Element toXml(Document document) {
                Element allowElem = document.createElementNS(JcrRemotingConstants.NS_URI, JcrRemotingConstants.NS_PREFIX  + ":" + JcrRemotingConstants.XML_ALLOWUPDATE);
                DomUtil.setText(allowElem, Boolean.toString(allowUpdate));
                return allowElem;
            }
View Full Code Here


    private DavProperty<List<XmlSerializable>> createUnRegisterNodeTypesProperty(SessionInfo sessionInfo, Name[] nodeTypeNames) throws IOException, RepositoryException {
        NamePathResolver resolver = getNamePathResolver(sessionInfo);
        List<XmlSerializable> val = new ArrayList<XmlSerializable>();
        for (Name ntName : nodeTypeNames) {
            final String jcrName = resolver.getJCRName(ntName);
            val.add(new XmlSerializable() {
                public Element toXml(Document document) {
                    Element ntNameElem = document.createElementNS(JcrRemotingConstants.NS_URI, JcrRemotingConstants.NS_PREFIX + ":" + JcrRemotingConstants.XML_NODETYPENAME);
                    org.w3c.dom.Text txt = document.createTextNode(jcrName);
                    ntNameElem.appendChild(txt);
                    return ntNameElem;
View Full Code Here

    private static DavProperty<List<XmlSerializable>> createValuesProperty(Value[] jcrValues) {
        // convert the specified jcr values to a xml-serializable value
        List<XmlSerializable> val = new ArrayList<XmlSerializable>();
        for (final Value jcrValue : jcrValues) {
            val.add(new XmlSerializable() {
                public Element toXml(Document document) {
                    try {
                        return ValueUtil.valueToXml(jcrValue, document);
                    } catch (RepositoryException e) {
                        throw new RuntimeException(e);
View Full Code Here

    private static DavProperty<List<XmlSerializable>> createNamespaceProperty(final Map<String, String> namespaces) {
        // convert the specified namespace to a xml-serializable value
        List<XmlSerializable> val = new ArrayList<XmlSerializable>();
        for (final String prefix : namespaces.keySet()) {
            val.add(new XmlSerializable() {

                public Element toXml(Document document) {
                    Element nsElem = document.createElementNS(JcrRemotingConstants.NS_URI, JcrRemotingConstants.NS_PREFIX + ":" + JcrRemotingConstants.XML_NAMESPACE);
                    Element prefixElem = document.createElementNS(JcrRemotingConstants.NS_URI, JcrRemotingConstants.NS_PREFIX + ":" + JcrRemotingConstants.XML_PREFIX);
                    org.w3c.dom.Text txt = document.createTextNode(prefix);
View Full Code Here

    private static DavProperty<List<XmlSerializable>> createNodeTypeProperty(String localName, String[] ntNames) {
        // convert the specified node type names to a xml-serializable value
        List<XmlSerializable> val = new ArrayList<XmlSerializable>();
        for (final String ntName : ntNames) {
            val.add(new XmlSerializable() {
                public Element toXml(Document document) {
                    return NodeTypeUtil.ntNameToXml(ntName, document);
                }
            });
        }
View Full Code Here

    private static DavProperty<List<XmlSerializable>> createValuesProperty(Value[] jcrValues) {
        // convert the specified jcr values to a xml-serializable value
        List<XmlSerializable> val = new ArrayList<XmlSerializable>();
        for (final Value jcrValue : jcrValues) {
            val.add(new XmlSerializable() {
                public Element toXml(Document document) {
                    try {
                        return ValueUtil.valueToXml(jcrValue, document);
                    } catch (RepositoryException e) {
                        throw new RuntimeException(e);
View Full Code Here

    private static DavProperty<List<XmlSerializable>> createNamespaceProperty(final Map<String, String> namespaces) {
        // convert the specified namespace to a xml-serializable value
        List<XmlSerializable> val = new ArrayList<XmlSerializable>();
        for (final String prefix : namespaces.keySet()) {
            val.add(new XmlSerializable() {

                public Element toXml(Document document) {
                    Element nsElem = document.createElementNS(JcrRemotingConstants.NS_URI, JcrRemotingConstants.NS_PREFIX + ":" + JcrRemotingConstants.XML_NAMESPACE);
                    Element prefixElem = document.createElementNS(JcrRemotingConstants.NS_URI, JcrRemotingConstants.NS_PREFIX + ":" + JcrRemotingConstants.XML_PREFIX);
                    org.w3c.dom.Text txt = document.createTextNode(prefix);
View Full Code Here

    private static DavProperty<List<XmlSerializable>> createNodeTypeProperty(String localName, String[] ntNames) {
        // convert the specified node type names to a xml-serializable value
        List<XmlSerializable> val = new ArrayList<XmlSerializable>();
        for (final String ntName : ntNames) {
            val.add(new XmlSerializable() {
                public Element toXml(Document document) {
                    return NodeTypeUtil.ntNameToXml(ntName, document);
                }
            });
        }
View Full Code Here

        CompactNodeTypeDefWriter writer = new CompactNodeTypeDefWriter(sw, new NamespaceResolverImpl(sessionInfo), true);
        writer.write(Arrays.asList(nodeTypeDefinitions));
        writer.close();

        final String cnd = sw.toString();
        val.add(new XmlSerializable() {
            public Element toXml(Document document) {
                Element cndElem = document.createElementNS(JcrRemotingConstants.NS_URI, JcrRemotingConstants.NS_PREFIX +  ":" + JcrRemotingConstants.XML_CND);
                DomUtil.setText(cndElem, cnd);
                return cndElem;
            }
        });
        val.add(new XmlSerializable() {
            public Element toXml(Document document) {
                Element allowElem = document.createElementNS(JcrRemotingConstants.NS_URI, JcrRemotingConstants.NS_PREFIX  + ":" + JcrRemotingConstants.XML_ALLOWUPDATE);
                DomUtil.setText(allowElem, Boolean.toString(allowUpdate));
                return allowElem;
            }
View Full Code Here

    private DavProperty<List<XmlSerializable>> createUnRegisterNodeTypesProperty(SessionInfo sessionInfo, Name[] nodeTypeNames) throws IOException, RepositoryException {
        NamePathResolver resolver = getNamePathResolver(sessionInfo);
        List<XmlSerializable> val = new ArrayList<XmlSerializable>();
        for (Name ntName : nodeTypeNames) {
            final String jcrName = resolver.getJCRName(ntName);
            val.add(new XmlSerializable() {
                public Element toXml(Document document) {
                    Element ntNameElem = document.createElementNS(JcrRemotingConstants.NS_URI, JcrRemotingConstants.NS_PREFIX + ":" + JcrRemotingConstants.XML_NODETYPENAME);
                    org.w3c.dom.Text txt = document.createTextNode(jcrName);
                    ntNameElem.appendChild(txt);
                    return ntNameElem;
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.webdav.xml.XmlSerializable

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.