Package org.jdom

Examples of org.jdom.Element.detach()


                                    ServiceContext context, String fname, String type, String dir)
      throws Exception {

    Element tsXml = null;
    Element xml = Xml.loadFile(rdfFile);
    xml.detach();

    if (!style.equals("_none_")) {
      tsXml = Xml.transform(xml, stylePath + "/" + style);
      tsXml.detach();
    } else
View Full Code Here


        if (info != null) {
            if (asXml != null) {
                info.removeContent();
                info.addContent(asXml);
            } else {
                info.detach();
            }
        }
    }
}
View Full Code Here

        final List<Element> criteriaRecords = element.getChildren();
        if (!includeGroup) {
            for (Element criteriaRecord : criteriaRecords) {
                final Element groupEl = criteriaRecord.getChild("group");
                Element idEl = groupEl.getChild("id");
                idEl.detach();
                groupEl.setContent(idEl);
            }
        } else {
            for (Element criteriaRecord : criteriaRecords) {
                @SuppressWarnings("unchecked")
View Full Code Here

            int index = children.indexOf(pattern) + 1;
            while(index < children.size() && !children.get(index).getName().equals(EL_ACTIVE_PATTERN)) {
                Element next = children.get(index);
                if (EL_FIRED_RULE.equals(next.getName())) {
                    currentRule = next;
                    next.detach();
                    pattern.addContent(next);
                } else {
                    if (currentRule == null) {
                        // odd but could happen I suppose
                        currentRule = new Element(EL_FIRED_RULE, Geonet.Namespaces.SVRL).
View Full Code Here

                        currentRule = new Element(EL_FIRED_RULE, Geonet.Namespaces.SVRL).
                                setAttribute(ATT_CONTEXT, DEFAULT_CONTEXT);
                        pattern.addContent(currentRule);
                    }

                    next.detach();
                    currentRule.addContent(next);

                }
            }
            if (pattern.getChildren().isEmpty()) {
View Full Code Here

     * @throws Exception
     */
    public Element getMetadata(String id) throws Exception {
        Element md = xmlSerializer.selectNoXLinkResolver(id, false);
        if (md == null) return null;
        md.detach();
        return md;
    }

    /**
     * Retrieves a metadata (in xml) given its id; adds editing information if requested and validation errors if
View Full Code Here

        Element sessionReport = (Element)session.getProperty(Geonet.Session.VALIDATION_REPORT + metadataId);
        if (sessionReport != null && !forEditing) {
            if(Log.isDebugEnabled(Geonet.DATA_MANAGER))
                Log.debug(Geonet.DATA_MANAGER, "  Validation report available in session.");
            sessionReport.detach();
            return Pair.read(sessionReport, version);
        }

        Map<String, Integer[]> valTypeAndStatus = new HashMap<String, Integer[]>();
        Element errorReport = new Element("report", Edit.NAMESPACE);
View Full Code Here

        Element md = xmlSerializer.select(context, metadataId);

        if (md == null)
            return null;

        md.detach();

        String schema = getMetadataSchema(metadataId);

        //--- do an XSL  transformation
        String styleSheet = getSchemaDir(schema) + Geonet.File.EXTRACT_THUMBNAILS;
View Full Code Here

        Element md = getMetadata(context, id, forEditing, withValidationErrors, keepXlinkAttributes);

        if (md == null)
            return;

        md.detach();

        String schema = getMetadataSchema(id);

        //--- setup environment
        String type = small ? "thumbnail" : "large_thumbnail";
View Full Code Here

        Lib.resource.checkEditPrivilege(context, id);
        Element md = xmlSerializer.select(context, id);

        if (md == null) return;

        md.detach();

        String schema = getMetadataSchema(id);
        transformMd(context, id, md, env, schema, styleSheet, true);
    }
View Full Code Here

TOP
Copyright © 2018 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.