Wiki-Quellcode von BPE_4
                  Version 8.1 von Holger Engels am 2024/02/02 14:13
              
      Verstecke letzte Bearbeiter
| author | version | line-number | content | 
|---|---|---|---|
                                                          ![]()  | 
      1.1 | 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); | ||
      ![]()  | 
      4.1 | 6 | println("lolo " + xcontext.get("printing")) | 
      ![]()  | 
      6.1 | 7 | |
      ![]()  | 
      8.1 | 8 | println(services.job.getCurrentJobStatus(['export', 'pdf'])?.request) | 
      ![]()  | 
      7.1 | 9 | |
      ![]()  | 
      6.1 | 10 | def expectedTemplateReference = services.model.resolveDocument('XWiki.BPE Print Template') | 
| 11 | def actualTemplateReference = services.job.getCurrentJobStatus(['export', 'pdf'])?.request?.template | ||
| 12 | if (expectedTemplateReference.equals(actualTemplateReference)) | ||
| 13 | println("Printing") | ||
| 14 | else | ||
| 15 | println("Not printing") | ||
      ![]()  | 
      1.1 | 16 | {{/groovy}} | 
      ![]()  | 
      6.1 | 17 | 
  