/** * Performs the XSLT transformation to generate the HTML report. * * @throws BuildException thrown if something goes wrong with the transformation. */ @Override public void transform() throws BuildException { checkOptions(); TempFile tempFileTask = tempFileTask(); XSLTProcess xsltTask = xsltTask(); File outputFile = outputFile(tempFileTask); xsltTask.setOut(outputFile); createNewParams(xsltTask); createOutputDirParam(xsltTask); long startingTime = System.currentTimeMillis(); try { xsltTask.execute(); } catch (Exception e) { throw new BuildException(concat("Errors while applying transformations: ", e.getMessage()), e); } long transformTime = System.currentTimeMillis() - startingTime; task.log(concat("Transform time: ", String.valueOf(transformTime), " ms")); delete(outputFile); }
/** * Performs the XSLT transformation to generate the HTML report. * * @throws BuildException thrown if something goes wrong with the transformation. */ @Override public void transform() throws BuildException { checkOptions(); TempFile tempFileTask = tempFileTask(); XSLTProcess xsltTask = xsltTask(); File outputFile = outputFile(tempFileTask); xsltTask.setOut(outputFile); createNewParams(xsltTask); createOutputDirParam(xsltTask); long startingTime = System.currentTimeMillis(); try { xsltTask.execute(); } catch (Exception e) { throw new BuildException(concat("Errors while applying transformations: ", e.getMessage()), e); } long transformTime = System.currentTimeMillis() - startingTime; task.log(concat("Transform time: ", String.valueOf(transformTime), " ms")); delete(outputFile); }
final long t0 = System.currentTimeMillis(); try { xsltTask.execute(); } catch (Exception e) { throw new BuildException("Errors while applying transformations: " + e.getMessage(), e);
private void genreport(ResolutionCacheManager cache, String organisation, String module) throws IOException { // first process the report with xslt XSLTProcess xslt = new XSLTProcess(); xslt.setTaskName(getTaskName()); xslt.setProject(getProject()); xslt.init(); String resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(organisation, module)); xslt.setIn(cache.getConfigurationResolveReportInCache(resolveId, "default")); xslt.setOut(new File(getTodir(), outputname + "." + xslext)); xslt.setStyle(xslFile); XSLTProcess.Param param = xslt.createParam(); param.setName("extension"); param.setExpression(xslext); // add the provided XSLT parameters for (Iterator it = params.iterator(); it.hasNext();) { param = (XSLTProcess.Param) it.next(); XSLTProcess.Param realParam = xslt.createParam(); realParam.setName(param.getName()); realParam.setExpression(param.getExpression()); } xslt.execute(); }
private void gen(ResolutionCacheManager cache, String organisation, String module, String style, String ext) throws IOException { XSLTProcess xslt = new XSLTProcess(); xslt.setTaskName(getTaskName()); xslt.setProject(getProject()); xslt.init(); String resolveId = ResolveOptions.getDefaultResolveId(new ModuleId(organisation, module)); xslt.setIn(cache.getConfigurationResolveReportInCache(resolveId, "default")); xslt.setOut(new File(getTodir(), outputname + "." + ext)); xslt.setBasedir(cache.getResolutionCacheRoot()); xslt.setStyle(style); xslt.execute(); }