You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org> on 2007/08/22 18:32:30 UTC

[jira] Closed: (VELOCITY-529) Set a macro library programmatically for each individual page request

     [ https://issues.apache.org/jira/browse/VELOCITY-529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Will Glass-Husain closed VELOCITY-529.
--------------------------------------

    Resolution: Fixed

patch applied from VELOCITY-362.  Nice work.

> Set a macro library programmatically for each individual page request
> ---------------------------------------------------------------------
>
>                 Key: VELOCITY-529
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-529
>             Project: Velocity
>          Issue Type: New Feature
>            Reporter: Will Glass-Husain
>            Priority: Minor
>             Fix For: 1.6
>
>         Attachments: template_macro_lib.patch
>
>
> I'd like to see Velocity allow developers to specify one or more macro files programmatically when a page is processed.  The resulting behavior would be the same as if the user had used #parse to load the macro file at the top of the page.  (assuming VELOCITY-362 was fixed and this worked).
> Velocity currently allows a developer to specify a VMGlobal library which loads a common set of macros applied for all pages.  This is different because the macro file could be different for different pages.
> Probably the best way for this to work would be to use a structure similar to the event handlers which specifies a macro file name and attaches it to the context.  When the page is processed, Velocity would use the resource loaders to load both the page and the macro file.  (taking advantage of the resource caching mechanism for optimal performance).
> Why is this useful?  There may be cases where different parts of an application require different sets of macros.  In some cases, you may have many different parties developing different parts of the application.  (For example in my primary app, we have large amounts of users regularly uploading Velocity pages to separate accounts).  It's good practice to separate out modules from the main file.  If this could be specified programmatically then template writers could upload both a macro file as well as a set of templates that use them.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org