当前位置: 首页>>代码示例>>Java>>正文


Java Element.removeChild方法代码示例

本文整理汇总了Java中org.jdom2.Element.removeChild方法的典型用法代码示例。如果您正苦于以下问题:Java Element.removeChild方法的具体用法?Java Element.removeChild怎么用?Java Element.removeChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdom2.Element的用法示例。


在下文中一共展示了Element.removeChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preparePublicationList

import org.jdom2.Element; //导入方法依赖的package包/类
public Element preparePublicationList() {
	Element pubList = new Element("mods:collection");
	for (Element mods : modsList) {
		if (mods.getChild("mods:extension") != null)
			mods.removeChild("mods:extension");
		pubList.addContent(mods);
	}
	return pubList;
}
 
开发者ID:ETspielberg,项目名称:bibliometrics,代码行数:10,代码来源:GeneralStatistics.java

示例2: doGetPost

import org.jdom2.Element; //导入方法依赖的package包/类
public void doGetPost(MCRServletJob job) throws Exception {
        LOGGER.info("preparing pdf report");
        Document reportXML = (Document) MCRSessionMgr.getCurrentSession().get("bibliometricReport");

        String authorName = (String) MCRSessionMgr.getCurrentSession().get("authorName");
        String hash = getHashedName(authorName);
        File reportFolder = new File(resultsDir + "/" + hash.substring(0, 6));
        if (!reportFolder.exists())
            reportFolder.mkdirs();
        File reportfile = new File(reportFolder, "report.xml");
        if (!reportfile.exists())
            reportfile.createNewFile();
        Element reportXMLToDisk = reportXML.clone().detachRootElement().clone();
        reportXMLToDisk.removeChild("navbar");
        new MCRJDOMContent(reportXMLToDisk.clone()).sendTo(reportfile);
        File latexFile = new File(reportFolder, "report.tex");
        File pubsPerTypeFile = new File(reportFolder, "pubsPerType.json");
        File pubsPerYearFile = new File(reportFolder, "pubsPerYear.json");
        
        generateFile(reportXMLToDisk.clone(),"xsl/bibliometricReport2latex.xsl",latexFile);
        generateFile(reportXMLToDisk.clone(),"xsl/pubsPerYear2JSON.xsl",pubsPerYearFile);
        generateFile(reportXMLToDisk.clone(),"xsl/pubsPerType2JSON.xsl",pubsPerTypeFile);
        
        // build the pdf by pdflatex
        ProcessBuilder pbPubsPerYear = new ProcessBuilder("cmd","/C","C:\\Users\\Eike\\AppData\\Roaming\\npm\\highcharts-export-server","-infile","pubsPerYear.json","-outfile","pubsPerYear.png");
        pbPubsPerYear.directory(reportFolder);
        pbPubsPerYear.start().waitFor();
        
        // build the pdf by pdflatex
        ProcessBuilder pbPubsPerType = new ProcessBuilder("cmd","/C","C:\\Users\\Eike\\AppData\\Roaming\\npm\\highcharts-export-server","-infile","pubsPerType.json","-outfile","pubsPerType.png");
        pbPubsPerType.directory(reportFolder);
        pbPubsPerType.start().waitFor();

        // build the pdf by pdflatex
        ProcessBuilder pbLatex = new ProcessBuilder("pdflatex","-interaction=nonstopmode","report.tex");
        pbLatex.directory(reportFolder);
        pbLatex.redirectOutput(new File(reportFolder, "shell.log"));
        pbLatex.start().waitFor();
        pbLatex.start().waitFor();
        LOGGER.info("running latex");

        String completePath = job.getRequest().getRequestURL().toString().replace("analysis/exportReport", "download/") + hash;
        String username = hash.substring(0, 6);
        String password = hash.substring(6);
        User user = UserDAO.getUser(username);
        if (user == null) {
            user = new User();
            user.setUsername(username);
            registrate(user, password, "client");
        }

        //String uriStr = String.format("mailto:%s?subject=%s&body=%s", "[email protected]", "bibliometric report", completePath + "\n" + completePath.replace("download", "display"));
        //job.getResponse().sendRedirect(uriStr);
        sendEmail(completePath);
        job.getResponse().sendRedirect("start");
}
 
开发者ID:ETspielberg,项目名称:bibliometrics,代码行数:57,代码来源:BibliometricReportExportServlet.java


注:本文中的org.jdom2.Element.removeChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。