•  
     
    story #38630 Export to file
Summary
Empty
Export to file
Empty

Specifications often needs to leave the platform where they were elaborated :

  • To be shared with a 3rd party actor that cannot have access to the platform for security / network reasons.
  • Because they are required by a customer, for instance when specifications are made by a supplier for a customer and customer wants to consolidate / compute coverage on its own (for instance with things like Reqtify).
  • Because they are requested for audit purpose.

Those documents should look like Company documents in term of colors, images, headers and footers. The solutions to export to docx with the necessary level of formatting led to a dead end (see art #32665) so the current strategy will be to :

  • export to PDF with Company look and feel
  • export to docx "naked"

Export to PDF

Investigations made in art #32665 showed that the best approach is to leverage on the ability of the browser to generate a PDF. There are some limitations, mainly on the ability to have page numbers in the Table of Contents. However, user interview made with users that are used to concurrent product like Confluence did not raise this as major problem (if any).

Define a template

We need to be able to define :

  • a cover page, including images
  • styling and colors for headings and paragraphs
  • headers and footers with images and user defined text

The definition of a template is done in HTML / CSS (with code mirror ?)

  1. One section for cover page
  2. One section for general styling
  3. One section for headers
  4. One section for footers

There is also the ability to upload images that will be used in the template. A template must have a name and has an optional description.

On template definition page, there is a Preview button that allows to test the rendering of the PDF with «Lorem ipsum» content.

When a new template is created, a default content is proposed that corresponds to a Tuleap template. The goal is to provide a working example that template administrators can use as a starting point to develop their own templates. It's also possible to duplicate an existing template.

In addition to template definition, several metadata are collected and displayed (on template view):

  • Last author (user)
  • Last update date

At each template modification, an application log is recorded with the user who did the change, the date of change, the template id, template name and which fields where changed.

Site wide templates

Templates will be a bit tedious to build so it's expected that a handful of person will develop the initial template that will be reused across the company. However, it's very unlikely that site administrators will have the skills to build the templates (HTML and CSS at a level that is not basic). In addition to that, we cannot promote the sharing of templates across projects because it would engage to a dangerous path where confidential info about project names or people names could be leaked. We choose to address these problems by defining templates at site admin level with a new, dedicated, permission.

In this first user story, templates can only be defined at Site level, the ability to define templates at project level will come in the future. The goal is to cover the most common use case (company wide shared templates).

Applying a template to a document

On an Artidoc, in the carret menu, there is an option to export to PDF. Anyone who can read the document can export it to PDF. The user who does the export have the possibility to choose a template to apply to the document.

The user must select the template each and every time the export is done.

If no template is defined at site admin level, the ability to export to PDF is displayed "disabled" with an info "No template was defined for export, contact site administrator"

User must be registered to export to PDF (otherwise the content of templates are exposed to anonymous)

Non requirements

This story is a first implementation and some features are excluded to better collect the actual need and, more important, verify that we address the right problem, the right way. Things that are not covered:

  • Variables. It's possible that some metadata will be required inside the template (for instance the document owner might be needed in the header / footer).
  • Produce the PDF server side. The current strategy is to leverage on the browser print features with specific stylesheet. In a longer term, we might imagine to do the rendering server side with headless chromium. However that requires the deployment of a lot of things for On Premise deployments. We should ensure that the overall process and rendering is OK for end users before going this way (if we really have to).
  • Have templates at project level. It's possible that some projects might need specific templates, for instance to produce docs that looks like a template requested by a customer. But at the moment we don't know if this requires to have the need to treat it separately. If really needed, it could be done either by having a concept of site wide templates, restricted to some projects (as we do when we restrict plugin usage), or to have templates defined at project level.
Empty
Empty
Status
Artidoc
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?
Empty
Details
#38630
Manuel Vacelet (vaceletm)
2024-09-26 11:00
2024-06-24 16:17
38441

References
Referencing story #38630

Git commit

tuleap/tuleap/stable

feat: Convert cog button to dropdown menu f16706c3f8
feat: Introduce pdftemplate plugin c78f507c68
feat: apply styles defined in pdf template b25bd8c220
feat: Introduce pdf template administration 31a13c7b09
feat: PDF template manager permission dba3a52f99
feat: PDF template creation caa1f5a8d9
feat: delete PDF template 31d0e26330
fix: artidoc e2e 0f877d3707
refactor: convert assoc array to presenter object 102efca282
feat: Display edit PDF template interface a674523159
feat: do update pdf template b7617eaebf
feat: Preview PDF template c5a3f4b3e0
feat: Display submenu when more than one template 89d68a4de4
feat: disable PDF option menu 57cc33ab9d
fix: do not break page just between section number and title 7271d1c50e
feat: Take into account default value for section d3db9215e5
feat: Adjust default style to match Tuleap design 87c1f25c0b
feat: Store last update info about template 18221f8718
fix: print accurate content with new section de9b113623
feat: feature flag to choose editor 112e06458e
fix: bump indentUnit to 4 dd53f07ad9
fix: ensure uniqueness of id 1bf2142545
feat: Promote pdftemplate to TEE c7f7efa300
feat: Duplicate a PDF template 5e8e66ca9b
feat: support pdf export with prose-mirror dd504e4908
feat: prevent pdf export in edition mode 53564c16cf
feat: headers and footers a493701f3f
feat: artidoc supports headers and footers in pdf exports 8ab156bfdf
feat: Introduce Image library 2f0380794e
fix: remove body margins in default pdf templates styles 7edf993999
fix: Artidoc TOC in PDF contains an extra "0." 7a88538a14
feat: ability to upload an image f58b1a7e3a
feat: Display uploaded images f2311b2683
fix: Artidoc TOC does not link to internal document e5e54121a1
feat: Ability to delete image 3bb2802fb2
feat: Display images library in template edition 384a826b00
fix: pdftemplate-admin navigation tab translations are broken e2f7b1c10e
feat: pdftemplate has its own logger 11403668ad
refactor: let @tuleap/print-as-pdf inject title/header/footer content b67fc54a15
feat: expose pdftemplate variables 0c991c4208
fix: declare log file for pdftemplate 26085966c8
feat: detect misusages of variables 1b8c8f14dc
feat: Add some comments in general styling 84cac0833d
feat: Display error during preview 497f3555d6
feat: Display error during export in artidoc 4a006666ec
feat: Display user/date in templates list 7081a34ff8
fix: patch infinite loop bug when image not found 588a9c469d
fix: escape variable interpretation 49c4a918c3
fix: dropdown does not show anymore when an editor has left edition mode bff22f72e2
chore: tlp-modal is a prod dep 5dd5e68fb1
feat: reset table border and padding behavior 12c0b3fc8c
fix: force full page width 9ec77d801d
Referenced by story #38630

Follow-ups

User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Status changed from Ready (hot) to Done
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Permissions set to
  • Category set to Artidoc