Wiki-Quellcode von BPE_4
                  Version 10.1 von Holger Engels am 2024/02/02 14:22
              
      Zeige letzte Bearbeiter
| author | version | line-number | content | 
|---|---|---|---|
| 1 | {{groovy}} | ||
| 2 | import org.xwiki.context.* | ||
| 3 | def context = services.component.getInstance(Execution.class).getContext() | ||
| 4 | def printing = context.getProperty("printing") | ||
| 5 | println("lala " + printing); | ||
| 6 | println("lolo " + xcontext.get("printing")) | ||
| 7 | |||
| 8 | // xwiki:XWiki.BPE Print Template.WebHome | ||
| 9 | def expectedTemplateReference = services.model.resolveDocument('XWiki.BPE Print Template') | ||
| 10 | if (services.job.getCurrentJobStatus(['export', 'pdf'])) { | ||
| 11 | def actualTemplateReference = services.job.getCurrentJobStatus(['export', 'pdf']).request.template | ||
| 12 | println(services.job.getCurrentJobStatus(['export', 'pdf'])?.request.template) | ||
| 13 | if (("" + actualTemplateReference)).contains("Print")) | ||
| 14 | println("Print export") | ||
| 15 | else | ||
| 16 | println("Non-print export") | ||
| 17 | } | ||
| 18 | else | ||
| 19 | println("Not exporting") | ||
| 20 | {{/groovy}} |