PDF Template data loader

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • a.slyzhko
    Senior Member
    • Oct 2023
    • 128

    #1

    PDF Template data loader

    PDF DataLoader is currently bound only to entity type via pdfDefs.{entityType}.dataLoaderClassNameList. Since DataLoader receives only Entity and Params, it has no access to the selected template, even though Service::generate already knows template. This makes template-specific PDF data preparation awkward for entity types that have multiple templates.

    Please consider adding template-aware loader support, e.g. by passing template into the loader or by supporting template-level loader registration in metadata.
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9794

    #2
    I don't know. The current design separating data and template is more 'proper'. Like a function and arguments should be separate.

    Comment

    • a.slyzhko
      Senior Member
      • Oct 2023
      • 128

      #3
      I agree that data and template should stay separate. So instead of passing template into the loader, maybe Template could have an extra multi-enum field where a user selects which data loaders to apply. The available options could come from loaders registered for the entity type. Then the framework would run only selected loaders for that specific template. This would keep loaders template-agnostic, but make their usage template-specific.

      Comment

      Working...