本文整理匯總了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;
}
示例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");
}