Package org.jdom

Examples of org.jdom.Element.clone()


                    if (me.getFault() != null) {
                        JDOMResult result = new JDOMResult();
                        String str = getTransformer().contentToString(me.getFault());
                        getTransformer().toResult(new StringSource(str), result);
                        Element e = result.getDocument().getRootElement();
                        e = (Element) e.clone();
                        me.setStatus(ExchangeStatus.DONE);
                        channel.send(me);
                        XFireFault xfireFault = new XFireFault(str, XFireFault.RECEIVER);
                        xfireFault.getDetail().addContent(e);
                        throw xfireFault;
View Full Code Here


        Enumeration successorEnum = revisionDescriptors.getSuccessors(revisionDescriptor.getRevisionNumber());
       
        if (successorEnum != null) {
            while (successorEnum.hasMoreElements()) {
                successorRevisionNumber = (NodeRevisionNumber)successorEnum.nextElement();
                hrefElement = (Element)hrefElement.clone();
                StringBuffer buffer = new StringBuffer(revisionDescriptors.getUri());
                if ( ! revisionDescriptors.getUri().endsWith("/") ) {
                    buffer.append("/");
                }
                buffer.append(successorRevisionNumber.toString());
View Full Code Here

        Enumeration successorEnum = revisionDescriptors.getSuccessors(revisionDescriptor.getRevisionNumber());
       
        if (successorEnum != null) {
            while (successorEnum.hasMoreElements()) {
                successorRevisionNumber = (NodeRevisionNumber)successorEnum.nextElement();
                hrefElement = (Element)hrefElement.clone();
                StringBuffer buffer = new StringBuffer(revisionDescriptors.getUri());
                if ( ! revisionDescriptors.getUri().endsWith("/") ) {
                    buffer.append("/");
                }
                buffer.append(successorRevisionNumber.toString());
View Full Code Here

            throw new CommandException(ErrorCode.E1005, ioe);
        }
        String jobXml = coordJob.getJobXml();
        Element eJob = XmlUtils.parseXml(jobXml);
        Date actualTime = new Date();
        String actionXml = CoordCommandUtils.materializeOneInstance(jobId, dryrun, (Element) eJob.clone(), coordAction
                .getNominalTime(), actualTime, coordAction.getActionNumber(), jobConf, coordAction);
        LOG.debug("Refresh Action actionId=" + coordAction.getId() + ", actionXml="
                + XmlUtils.prettyPrint(actionXml).toString());
        coordAction.setActionXml(actionXml);
    }
View Full Code Here

        if (key == null || key.equals("")) return result;
       
        if (rootElement.getName().equals(key)) {
            Element e = rootElement;
            if (key.equals("href")) {
                e = (Element)e.clone();
                try {e.setText(URIUtil.decode(e.getText(), defaultUrlEncoding));} catch (Exception ex) { }
            }
            result.add(e);
            return result;
        }
View Full Code Here

        ProcessingInstruction instruction = new ProcessingInstruction("xml-stylesheet", "type='text/xsl' href='" + getXsltPath() + "suite.xsl'");
        suiteResultsDocument = new Document();
        suiteResultsDocument.addContent(instruction);
        suiteResultsDocument.setRootElement(root);
        writeSuiteFile();
        runResultsDocument.getRootElement().addContent((Content) root.clone());
        writeIndexFile();
        return suiteResultsDocument.getRootElement();
    }

    public Element addNewElement(Element parentElement, String tagName) throws IOException {
View Full Code Here

            int timeout = coordJob.getTimeout();
            LOG.debug("Materializing action for time=" + effStart.getTime() + ", lastactionnumber=" + lastActionNumber
                    + " timeout=" + timeout + " minutes");
            Date actualTime = new Date();
            action = CoordCommandUtils.materializeOneInstance(jobId, dryrun, (Element) eJob.clone(),
                    effStart.getTime(), actualTime, lastActionNumber, jobConf, actionBean);
            actionBean.setTimeOut(timeout);

            if (!dryrun) {
                storeToDB(actionBean, action); // Storing to table
View Full Code Here

            int timeout = jobBean.getTimeout();
            log.debug(origStart.getTime() + " Materializing action for time=" + effStart.getTime()
                    + ", lastactionnumber=" + lastActionNumber);
            Date actualTime = new Date();
            action = CoordCommandUtils.materializeOneInstance(jobId, dryrun, (Element) eJob.clone(),
                    effStart.getTime(), actualTime, lastActionNumber, conf, actionBean);
            int catchUpTOMultiplier = 1; // This value might be could be changed in future
            if (actionBean.getNominalTimestamp().before(jobBean.getCreatedTimestamp())) {
                // Catchup action
                timeout = catchUpTOMultiplier * timeout;
 
View Full Code Here

     */
    private Element overridePluginConfig(final String pluginName, final String pluginClass, Element pluginConfig) {
        Element pluginElement = (Element) this.pluginConfigs.get(pluginName);
        // clone the first found plugin config
        if (pluginElement != null && pluginConfig == null) {
            pluginElement = (Element) pluginElement.clone();
        }
        if (pluginConfig == null) {
            pluginConfig = pluginElement;
        } else {
            // do not override if class names do not match
View Full Code Here

                }
                // combine child elements
                List children = pluginElement.getChildren();
                for (int i = 0; i < children.size(); i++) {
                    Element child = (Element) children.get(i);
                    pluginConfig.addContent((Element) child.clone());
                }
            }
        }
        if (this.parentRegistry != null) {
            pluginConfig = this.parentRegistry.overridePluginConfig(pluginName, pluginClass, pluginConfig);
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.