camptocamp / cgxp

22 stars 22 forks source link

Print V3 table request not matching #1091

Open marionb opened 8 years ago

marionb commented 8 years ago

When printing a table that is configured as follows (in GMF version 1.6.7, using CGXP version 1.6.7):

attributes:
    ...
    tableData: !table {}
    ...
processors:
...
- !prepareTable
      excludeColumns:
        - "signal_id"
      maxColumns: 10
      dynamic: true
      jasperTemplate: table_a4_portrait.jrxml
      firstDetailStyle: column_style_1
      detailStyle: column_style_2
      lastDetailStyle: column_style_3
      firstHeaderStyle: header_style_1
      headerStyle: header_style_2
      lastHeaderStyle: header_style_3
      columns:
        Signal: !urlImage
          urlExtractor: .*<img src="([^"]+)".*
          urlGroup: 1
      inputMapper: {tableData: table}
      outputMapper: {table: tableDataSource}
...

cgxp does not map table to tataData correctly and instead sends the attribute table inside a datasource attribute :

… comment":"","datasource":[{"title":"Statische Waldgrenzen","table":{ ...

This results in the error that the attribute is not found:

Caused by: org.mapfish.print.MissingPropertyException: Request Json is missing some required attributes at: 'tableAttribute':
Missing Properties:

* java.lang.String[] columns
* org.mapfish.print.wrapper.PArray[] data

All allowed properties are:

* data
* columns