Package org.apache.lenya.xml

Examples of org.apache.lenya.xml.NamespaceHelper.createElement()


        Element root = helper.getDocument().getDocumentElement();

        Iterator iter = dublinCoreParams.entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry entry = (Map.Entry)iter.next();
            root.appendChild(helper.createElement((String)entry.getKey(), (String)entry.getValue()));
        }

        String mimeType = dublinCoreParams.get("format").toString();
        if (canReadMimeType(mimeType)) {
            NamespaceHelper lenyaHelper = new NamespaceHelper("http://apache.org/cocoon/lenya/page-envelope/1.0", "lenya", helper.getDocument());


        }

        String mimeType = dublinCoreParams.get("format").toString();
        if (canReadMimeType(mimeType)) {
            NamespaceHelper lenyaHelper = new NamespaceHelper("http://apache.org/cocoon/lenya/page-envelope/1.0", "lenya", helper.getDocument());
            Element metaElement = lenyaHelper.createElement("meta");

            Iterator iterlenya = lenyaMetaParams.entrySet().iterator();
            while (iterlenya.hasNext()) {
                Map.Entry entry = (Map.Entry)iterlenya.next();
                metaElement.appendChild(lenyaHelper.createElement((String)entry.getKey(), (String)entry.getValue()));

            Element metaElement = lenyaHelper.createElement("meta");

            Iterator iterlenya = lenyaMetaParams.entrySet().iterator();
            while (iterlenya.hasNext()) {
                Map.Entry entry = (Map.Entry)iterlenya.next();
                metaElement.appendChild(lenyaHelper.createElement((String)entry.getKey(), (String)entry.getValue()));
            }
            root.appendChild(metaElement);
        }
        DocumentHelper.writeDocument(helper.getDocument(), metaDataFile);
    }

                "ERROR: " + this.getClass().getName() + ".checkOutIn(): No such type");
        }

        NamespaceHelper helper = new NamespaceHelper(null, "", document);

        Element identityElement = helper.createElement("Identity", identity);
        Element timeElement = helper.createElement("Time", "" + time);

        String elementName = (String) ELEMENTS.get(new Short(type));
        Element checkOutElement = helper.createElement(elementName);

        }

        NamespaceHelper helper = new NamespaceHelper(null, "", document);

        Element identityElement = helper.createElement("Identity", identity);
        Element timeElement = helper.createElement("Time", "" + time);

        String elementName = (String) ELEMENTS.get(new Short(type));
        Element checkOutElement = helper.createElement(elementName);

        checkOutElement.appendChild(identityElement);

        Element identityElement = helper.createElement("Identity", identity);
        Element timeElement = helper.createElement("Time", "" + time);

        String elementName = (String) ELEMENTS.get(new Short(type));
        Element checkOutElement = helper.createElement(elementName);

        checkOutElement.appendChild(identityElement);
        checkOutElement.appendChild(timeElement);

        if (backup) {

        checkOutElement.appendChild(identityElement);
        checkOutElement.appendChild(timeElement);

        if (backup) {
            Element backupElement = helper.createElement(ELEMENT_BACKUP);
            checkOutElement.appendChild(backupElement);
        }

        Element root = document.getDocumentElement();
        root.insertBefore(checkOutElement, root.getFirstChild());

    public void addLabel(Label label) {
        if (getLabel(label.getLanguage()) == null) {
            // only add the label if there is no label with the same language yet.

            NamespaceHelper helper = getNamespaceHelper();
            Element labelElem = helper.createElement(SiteTreeNodeImpl.LABEL_NAME, label.getLabel());

            labelElem.setAttribute(SiteTreeNodeImpl.LANGUAGE_ATTRIBUTE_NAME, label.getLanguage());
            if (label.getHref() != null) {
                labelElem.setAttribute(SiteTreeNodeImpl.HREF_ATTRIBUTE_NAME, label.getHref());
            }

            Accreditable accreditable = credentials[i].getAccreditable();
            Element accreditableElement = save(accreditable, helper);
           
            Role[] roles = credentials[i].getRoles();
            for (int j = 0; j < roles.length; j++) {
                Element roleElement = helper.createElement(ROLE_ELEMENT);
                roleElement.setAttribute(ID_ATTRIBUTE, roles[j].getId());
                accreditableElement.appendChild(roleElement);
            }
           
            policyElement.appendChild(accreditableElement);

            String[] elementNames = arrays[type];
            for (int i = 0; i < elementNames.length; i++) {
                String[] values = (String[]) maps[type].get(elementNames[i]);
                for (int valueIndex = 0; valueIndex < values.length; valueIndex++) {
                    Element valueElement =
                        helper.createElement(elementNames[i], values[valueIndex]);
                    metaElement.appendChild(valueElement);
                }
            }
        }

TOP
Copyright © 2015 www.massapi.com. 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.