You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently experimenting with using the Grantlee_Templates library as a replacement for the (very) basic templating language that the Shibboleth SP project provides to render HTML error report pages:
It's working well so far, but the issue that I'm running into is that the templating API of the Shibboleth SP project uses dynamic variable lookup, i.e. there is a TemplateParameters class with a getParameter(const char* varName) method that gets invoked at runtime to look up the desired variable from a set of different possible sources in a well-defined order.
In my replacement POC I have access to such a TemplateParameters instance, but I can't "plug it in" to the Grantlee templating system because Context::lookup is declared as non-virtual, so I have no chance of modifying how variables are looked up at runtime. If instead it were declared virtual, I could create a subclass of Context that dispatches runtime lookup of variables to the TemplateParameters instance (though only after first failing the original Context::lookup --the ability for local variables to be pushed onto the stack at runtime by various tags like for and with must stay respected).
So my question is this: would you consider virtualizing Context::lookup and related others to allow end users to customize runtime variable lookup?
The text was updated successfully, but these errors were encountered:
Because I have no reliable way of precomputing all variables. The getParameter function internally looks up variables from a number of different sources to which I have no direct access. I can look at the source code and find out and hack in manual access to those sources and replicate the final list of variables it would produce, but that requires hacking and will break as soon the implementation of getParameter changes.
I'm currently experimenting with using the Grantlee_Templates library as a replacement for the (very) basic templating language that the Shibboleth SP project provides to render HTML error report pages:
https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPErrors
It's working well so far, but the issue that I'm running into is that the templating API of the Shibboleth SP project uses dynamic variable lookup, i.e. there is a TemplateParameters class with a
getParameter(const char* varName)
method that gets invoked at runtime to look up the desired variable from a set of different possible sources in a well-defined order.In my replacement POC I have access to such a TemplateParameters instance, but I can't "plug it in" to the Grantlee templating system because
Context::lookup
is declared as non-virtual, so I have no chance of modifying how variables are looked up at runtime. If instead it were declared virtual, I could create a subclass of Context that dispatches runtime lookup of variables to the TemplateParameters instance (though only after first failing the originalContext::lookup
--the ability for local variables to be pushed onto the stack at runtime by various tags likefor
andwith
must stay respected).So my question is this: would you consider virtualizing
Context::lookup
and related others to allow end users to customize runtime variable lookup?The text was updated successfully, but these errors were encountered: