[MAGNOLIA-2993] Extract logic out of taglibs - reusability, testability, ... Created: 07/Jan/10  Updated: 20/Apr/17  Resolved: 13/Oct/12

Status: Closed
Project: Magnolia
Component/s: taglibs, templating
Affects Version/s: None
Fix Version/s: 4.5

Type: New Feature Priority: Major
Reporter: Magnolia International Assignee: Jan Haderka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MAGNOLIA-3087 Allow configuration of shared variabl... Closed
depends upon MAGNOLIA-1275 <cms:out inherit="true"> does not wor... Closed
is depended upon by MAGNOLIA-2545 Cleanup soft-dependency between gui c... Closed
relation
is related to MGNLSTK-554 freemarker error in search results st... Closed
is related to MAGNOLIA-1768 Review Resource class and make it con... Closed
is related to MGNLSTK-584 Cleaner way to pass paragraph lists t... Closed
is related to MAGNOLIA-2850 Clarify and clean up concepts of "mai... Closed
is related to MAGNOLIA-2394 Rename includeTemplate to renderParag... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Some of our tags are extremely complex; testing them, fixing them, has become very tedious. Many of them have fuzzy logic that isn't well defined.

Extracting this will also allow us to reuse them in Freemarker templates (amongst others) without depending on the taglib itself; a macro library or ${mgnl} methods might provide a simpler/cleaner/lighter syntax.



 Comments   
Comment by Magnolia International [ 08/Jan/10 ]

We should also extract the "snippets" logic that was duplicated in stk (see MGNLSTK-554)

Comment by Fabrizio Giustina [ 31/Jan/10 ]

just a note if anybody will start this: be very careful with tag pooling, according to jsp specification you should never change the value of any field set using a tag attribute, since the container is not forced to reset them.

For example if you have two tags in page:
<tag attribute="value"/>
<tag attribute="value"/>

the setAttribute(value) method will be called only the first time, while for the second tag the container expects that the attribute is already set by reusing the previous tag instance. If we extract tags in helper classes me must pay attention to this.

Comment by Magnolia International [ 08/Feb/10 ]

I thought the "new" JSP 2.0 SimpleTag interfaces/classes got rid of all the lifecycle/pooling cruft; one tag in the jsp=one instance of the tag class. Isn't that the case ?

Comment by Magnolia International [ 08/Feb/10 ]

See current draft/concept at http://wiki.magnolia-cms.com/display/DEV/Concept+taglib+cleanup%2C+extraction%2C+rewrite

Comment by Magnolia International [ 22/Mar/10 ]

Status in 4.3

  • introduced new magnolia-module-templating-components module, which contains the components themselves (thin wrapper around magnolia-gui components, hiding complexity, providing good defaults) as well as JSP tags and FreeMarker directives
  • this new module is currently in the /add-ons folder of the bundles
  • it should already be useable as a starting point to integrate with other rendering engines
  • i18n

Still to do

  • "extract" a few more tags: render ("include"), iterator (sets current content), header links (js and css)
  • introduce some form of RenderingContext - holding current model, renderable definition, etc.
  • the above and the rendering engine will impact "include" and "iterator"
  • refactor components to make it simpler to add extra buttons in main bar, for example (see http://wiki.magnolia-cms.com/display/WIKI/Add+Magnolia+MainBar+functionalities+with+Ajax)
  • more simplification: with the introduction of new components such as "singleton", do we still need to be able to be able to disable the delete and move buttons? (we'll probably need a simple "edit" button for page properties to be edited outside the main bar, too)
Comment by Jan Haderka [ 13/Oct/12 ]

Fixed in 4.5 when rewriting templating engine.

Generated at Mon Feb 12 03:42:08 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.