Hi Thomas, <br><br>Sorry for the late response. I have been on Vacation.<br><br>Actually I think that perhaps the best solution is actuallly just to expose MVEL as a dependency to plugins that request it. This would be the simplest solution IMO, and would only request code-changes in the Forge plugin installer:<br>
<br><a href="https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/plugins/builtin/ForgePlugin.java#L617">https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/plugins/builtin/ForgePlugin.java#L617</a><br>
<br>Just like this.<br><br>What do you think?<br>~Lincoln<br><br><div class="gmail_quote">On Fri, Feb 17, 2012 at 2:08 PM, Thomas Frühbeck <span dir="ltr">&lt;<a href="mailto:fruehbeck@aon.at">fruehbeck@aon.at</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 15.02.2012 16:03, schrieb Lincoln Baxter, III:<br>
<div class="im">&gt; I just had a thought. Are you sure that you really need the MVEL<br>
&gt; library? Is it possible that you are directly referencing MVEL classes<br>
&gt; when you should instead be referencing Seam Render classes?<br>
&gt;<br>
&gt; &quot;TemplateCompiler&quot; comes to mind.<br>
</div>Lincoln you were right, the issue is in fact related to TemplateCompiler<br>
but not directly.<br>
I think I understand the problem now in detail and want to propose a<br>
solution. As my code was just taken from the FacesScaffold I did not<br>
further think about using it.<br>
As it turns out my plugin is not &quot;as privileged?&quot; as the FacesScaffold,<br>
so the problem became visible with my implementation.<br>
<br>
Situation: the FacesScaffold wants to calculate the textual indentation<br>
for the metawidgets that will be rendered inside of a template.<br>
To access the _compiled_ template, which seams to show the real<br>
indentation level, the following code was executed:<br>
<br>
     private org.jboss.seam.render.template.CompiledTemplateResource<br>
createTemplate;<br>
     ...<br>
          String template =<br>
String.valueOf(this.createTemplate.getCompiledTemplate().getTemplate());<br>
<br>
<br>
Now there is the hidden access to the MVEL libraries, because<br>
CompiledTemplateResource.getTemplate() will return a native<br>
org.mvel2.templates.CompiledTemplate.<br>
This is _very_ unfortunate, because there seems to be no easy way to<br>
e.g. override getTemplate() because it is already in the seam.render libs.<br>
On the other side it is quite important to provide consistent<br>
indentation for the generated sources - it simply looks ugly and unprof<br>
if code goes zigzag.<br>
<br>
My proposed solution is to provide a TemplateConverter in the<br>
scaffold.faces plugin. There the visibility of MVEL is provided and so<br>
does not conflict with forge&#39;s libs.<br>
On the other hand the FacesScaffold classes are visible to the other<br>
plugins.<br>
<br>
package org.jboss.forge.scaffold.faces;<br>
<br>
@Dependent<br>
public class TemplateConverter {<br>
<br>
     public String convert(CompiledTemplateResource resource) {<br>
         return new String(resource.getCompiledTemplate().getTemplate());<br>
     }<br>
}<br>
<br>
So now I can convert the compiled templates by :<br>
    @Inject<br>
    private TemplateConverter templateConverter;<br>
...<br>
    String template = templateConverter.convert(this.backingBeanTemplate);<br>
<br>
I would be very glad to provide the pull.request for this class.<br>
Any recommendations for the solution or the destination package for the<br>
converter?<br>
<div class="HOEnZb"><div class="h5"><br>
Thomas<br>
_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>&quot;Keep it Simple&quot;<br>