<br><br><div class="gmail_quote">On Tue, Feb 26, 2013 at 10:40 AM, Richard Kennard <span dir="ltr">&lt;<a href="mailto:richard@kennardconsulting.com" target="_blank">richard@kennardconsulting.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Seb,<br>
<br>
It sounds like there may be some convergence here. Your &#39;macros&#39; library may end up looking very similar to Metawidget&#39;s existing HTML5 WidgetBuilder. And<br>
your &#39;composition plugins&#39; may end up similar to Metawidget&#39;s LayoutDecorators and Layouts.<br>
<br>
I&#39;d like to make sure you&#39;re not re-inventing the wheel here? Is your main driver that you prefer writing templates in Freemarker to Java code?<br></blockquote><div><br></div><div>Absolutely :) ! A user should be able to read and understand a template / overload them and not forced to write a Java class, a mid-term vision is to be more and more polyglot.</div>
<div>Seb</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regards.<br>
<br>
Richard.<br>
<div class="im"><br>
On 26/02/2013 8:31 PM, Sebastien Blanc wrote:<br>
&gt; Hi Richard,<br>
&gt; Thanks for your remarks and questions, see my comments inline.<br>
&gt;<br>
</div><div><div class="h5">&gt; On Tue, Feb 26, 2013 at 10:06 AM, Richard Kennard &lt;<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a> &lt;mailto:<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a>&gt;&gt; wrote:<br>

&gt;<br>
&gt;     Hi Vineet,<br>
&gt;<br>
&gt;     Thanks for your detailed response.<br>
&gt;<br>
&gt;     I&#39;m not opposed to the idea of a FreemarkerWidget (or VelocityWidget, or StringTemplateWidget). Indeed, the early versions of Metawidget looked much like<br>
&gt;     you describe: a separate, pluggable inspection layer, then a Metawidget to render it.<br>
&gt;<br>
&gt;     However, we subsequently got a lot of feedback and did many interviews, adoption studies and case studies. This ultimately led to the architecture of<br>
&gt;     pluggable WidgetBuilders, WidgetProcessors and Layouts. Let me give you 3 examples of the feedback we got:<br>
&gt;<br>
&gt;     1. Widget choice needs to be orthogonal to layout. If you look at your &#39;master.html.ftl&#39; and &#39;detail.html.ftl&#39; you have a lot of duplicated code between<br>
&gt;     them. Both templates contain &lt;#if... #else to choose between a &#39;select&#39; box and a &#39;text&#39; box. This code is going to inflate rapidly once you add your<br>
&gt;     date<br>
&gt;     pickers, telephone numbers, URLs etc. to the mix. Worse, such code will need to be duplicated across both templates.<br>
&gt;<br>
&gt;<br>
&gt; Vineet is currently  factorizing all the duplicated code into Freemarker&#39;s Macros, this Macros library will be shared along the different plugins.<br>
&gt;<br>
&gt;<br>
&gt;     2. Equally, layout needs to be orthogonal to the wider page. Say I decide I want to use tables with rows and columns, instead of a div-based layout.<br>
&gt;     Or say<br>
&gt;     I want to use different CSS classes to your &#39;control-group&#39; and &#39;controls&#39;. I will have to do it in both templates. But what is *actually* different<br>
&gt;     about<br>
&gt;     the templates is the choice of search buttons/results versus save/cancel buttons. So the &#39;middle bit&#39; of each page needs to be orthogonal. This will get<br>
&gt;     worse as you add more templates, such as separate &#39;search&#39;, &#39;view&#39; and &#39;edit&#39; templates (see the JSF scaffold).<br>
&gt;<br>
&gt; With Forge 2.0 in mind, where Plugins/addons will be able to be dependent from each other, inherit from each other, we plan to end up with some basic<br>
&gt; plugins which will offer a lot of flexibility to deliver &quot;Composition plugins&quot;. We are also going to introduce a lot of convention over configuration but<br>
&gt; with keeping in mind that the user can always override the conventions.<br>
&gt;<br>
&gt;<br>
&gt;     3. Developers like to use third-party widget libraries, and also in-house custom widget libraries. If I want to add RichFaces, or PrimeFaces, or a<br>
&gt;     mixture<br>
&gt;     of both, I want to be able to do so in a way that is orthogonal to all of the above<br>
&gt;<br>
&gt;     So my concern would be that a FreemarkerWidget would tightly couple widget choice (WidgetBuilders) and layout, and not allow widget processing (which is<br>
&gt;     important for other reasons I haven&#39;t touched upon). Freemarker does, I agree, offer an attractive level of immedicay and ease-of-editing templates.<br>
&gt;     But I<br>
&gt;     wonder what your thoughts are on how it scales for some of the points above?<br>
&gt;<br>
&gt;<br>
&gt; &quot;Scaling&quot; will be partly solved by the new architecture explained above. For sure, there will always be situations where the user wants to introduce his<br>
&gt; supra cool custom widget that don&#39;t fits without a lot of hacking but IMO that&#39;s beyond the scope of scaffolding. Scaffolding is just to &quot;boost up&quot; a new<br>
&gt; project, it&#39;s a one time action,  for sure, we can offer entry points for customization but we can&#39;t (or don&#39;t want to) cover all the specific situations.<br>
&gt;<br>
&gt; Regards,<br>
&gt; Seb<br>
&gt;<br>
&gt;<br>
&gt;     Regards,<br>
&gt;<br>
&gt;     Richard.<br>
&gt;<br>
</div></div>&gt;     &gt; On 22 February 2013 13:56, Vineet Reynolds Pereira &lt;<a href="mailto:vpereira@redhat.com">vpereira@redhat.com</a> &lt;mailto:<a href="mailto:vpereira@redhat.com">vpereira@redhat.com</a>&gt; &lt;mailto:<a href="mailto:vpereira@redhat.com">vpereira@redhat.com</a><br>

<div><div class="h5">&gt;     &lt;mailto:<a href="mailto:vpereira@redhat.com">vpereira@redhat.com</a>&gt;&gt;&gt; wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;     Hi Richard,<br>
&gt;     &gt;<br>
&gt;     &gt;        I&#39;m glad you brought this up, since we&#39;ve been looking to provide feedback once we&#39;ve finalized on our usage of the Metawidget APIs. By the way,<br>
&gt;     &gt;     I&#39;m the one responsible for the use (or abuse) of Metawidget in this manner.<br>
&gt;     &gt;<br>
&gt;     &gt;        The rationale behind the use of Metawidget inspectors alone, is mostly because we want to allow users to modify the generated scaffold. One<br>
&gt;     of the<br>
&gt;     &gt;     examples thrown around was to enable users to generate master-detail views instead of the plain CRUD forms generated by Forge. Another driving<br>
&gt;     factor<br>
&gt;     &gt;     was the need to create or enable creation of scaffold generators for several JS frameworks including but not restricted to AngularJS, Backbone.js,<br>
&gt;     &gt;     Aerogear etc. Furthermore, there is also a possibility of users needing to bring in plugins and extensions to these frameworks, like Angular-UI or<br>
&gt;     &gt;     Backbone.Forms, since the base frameworks may not satisfy all needs. From my understanding of the Metawidget pipeline and it&#39;s use in the Forge<br>
&gt;     Faces<br>
&gt;     &gt;     and (the earlier) Aerogear scaffold plugins, this would have been possible if a metawidget were created for every use case (one per framework, per<br>
&gt;     &gt;     widget-type). We attempted to bring in the use of templates written in a familiar templating langu!<br>
&gt;     &gt;      age (like Freemarker/Velocity/StringTemplate) into the scaffold generation phase to make it easier for users to modify the generated scaffold.<br>
&gt;     This<br>
&gt;     &gt;     is somewhat on the lines of what the Yeoman generators do.<br>
&gt;     &gt;<br>
&gt;     &gt;        Thanks to the APIs you&#39;ve made available for the Metawidget pipeline, the inspection results could be processed before feeding them to the<br>
&gt;     &gt;     templates. Every scaffold plugin that could potentially be written, would more or less use this approach, with the sole difference being in the<br>
&gt;     &gt;     contents of the templates themselves. I hope this explains why I used the Inspectors alone, and not the InspectionResultProcessors and the rest of<br>
&gt;     &gt;     the pipeline. The inspectors just fit in naturally into the Forge scaffold generation pipeline.<br>
&gt;     &gt;<br>
&gt;     &gt;        Based on the above, I personally think that a FreemarkerWidget (or VelocityWidget, or StringTemplateWidget) would be something to investigate.<br>
&gt;     &gt;     This is of course a raw idea of mine, and I would like to see if it is possible to use such a metawidget in a type-safe manner with the ability to<br>
&gt;     &gt;     configure the templates that it would consume. I&#39;m not sure if creating such a widget would deviate from the intention behind the Metawidget<br>
&gt;     project.<br>
&gt;     &gt;<br>
&gt;     &gt;        As a side note, I&#39;d also like to point out that there has been interest in supporting various additional HTML5 form input types (telephone<br>
&gt;     &gt;     numbers, URLs etc.) in the generated scaffold, and this would require extending the JPA/Bean Validation Inspectors in Metawidget.<br>
&gt;     &gt;<br>
&gt;     &gt;     Best regards,<br>
&gt;     &gt;     Vineet<br>
&gt;     &gt;<br>
&gt;     &gt;     PS: CC&#39;ing the forge-dev list.<br>
&gt;     &gt;<br>
&gt;     &gt;     ----- Original Message -----<br>
</div></div><div class="im">&gt;     &gt;     &gt; From: &quot;Richard Kennard&quot; &lt;<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a> &lt;mailto:<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a>&gt; &lt;mailto:<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a><br>

&gt;     &lt;mailto:<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a>&gt;&gt;&gt;<br>
</div><div><div class="h5">&gt;     &gt;     &gt; To: <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt; &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>

&gt;     &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;&gt;<br>
&gt;     &gt;     &gt; Sent: Thursday, February 21, 2013 5:17:29 AM<br>
&gt;     &gt;     &gt; Subject: Re: [aerogear-dev] Aerogear Forge Plugin<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; Seb,<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; This looks very cool. I see you have used parts of Metawidget for<br>
&gt;     &gt;     &gt; some of the implementation? I&#39;d love to hear your thoughts on how it<br>
&gt;     &gt;     &gt; went and/or any<br>
&gt;     &gt;     &gt; changes you&#39;d like me to make to Metawidget. For example:<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; 1. You have some code in Html5Scaffold that processes the inspection<br>
&gt;     &gt;     &gt; result returned by CompositeInspector. It does things like<br>
&gt;     &gt;     &gt; &#39;Canonicalize all numerical<br>
&gt;     &gt;     &gt; types in Java to &quot;number&quot; for HTML5 form input type support&#39; and<br>
&gt;     &gt;     &gt; &#39;Extract simple type name of the relationship types&#39;. Was there a<br>
&gt;     &gt;     &gt; reason you didn&#39;t factor<br>
&gt;     &gt;     &gt; this into a Metawidget InspectionResultProcessor<br>
&gt;     &gt;     &gt; (<a href="http://metawidget.org/doc/reference/en/html/ch02s03.html" target="_blank">http://metawidget.org/doc/reference/en/html/ch02s03.html</a>)?<br>
&gt;     &gt;     &gt; Specifically BaseInspectionResultProcessor has<br>
&gt;     &gt;     &gt; some methods to help?<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; 2. You appear to be using FreeMarker templates rather than<br>
&gt;     &gt;     &gt; Metawidget&#39;s WidgetBuilders, WidgetProcessors and Layouts (see the<br>
&gt;     &gt;     &gt; existing Forge JSF scaffold,<br>
&gt;     &gt;     &gt; Forge GWT scaffold, and Forge Spring scaffold). Could I ask what the<br>
&gt;     &gt;     &gt; reasons were behind this?<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; 3. I have recently implemented a pure client-side, pure run-time,<br>
&gt;     &gt;     &gt; AngularJS version of Metawidget. If you were interested in a<br>
&gt;     &gt;     &gt; non-static version of your<br>
&gt;     &gt;     &gt; scaffold, perhaps you could give it a try?<br>
&gt;     &gt;     &gt; <a href="http://blog.kennardconsulting.com/2013/01/metawidget-meets-jquery-ui-and-angularjs.html" target="_blank">http://blog.kennardconsulting.com/2013/01/metawidget-meets-jquery-ui-and-angularjs.html</a><br>

&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; Regards,<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; Richard.<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; On 20/02/2013 11:49 PM, Jay Balunas wrote:<br>
&gt;     &gt;     &gt; &gt; Wow!!!  Really awesome work guys!!!<br>
&gt;     &gt;     &gt; &gt;<br>
&gt;     &gt;     &gt; &gt; On Feb 15, 2013, at 11:15 AM, Sebastien Blanc wrote:<br>
&gt;     &gt;     &gt; &gt;<br>
&gt;     &gt;     &gt; &gt;&gt; Hi all !<br>
&gt;     &gt;     &gt; &gt;&gt; I&#39;m pleased to announce that the first version of the Aerogear<br>
&gt;     &gt;     &gt; &gt;&gt; Scaffold Plugin for forge is available !<br>
&gt;     &gt;     &gt; &gt;&gt; It&#39;s still an alpha but thanks to the excellent work and help from<br>
&gt;     &gt;     &gt; &gt;&gt; Vineet we have a working plugin :<br>
&gt;     &gt;     &gt; &gt;&gt;<br>
&gt;     &gt;     &gt; &gt;&gt; - CRUD Scaffolding based on your entities.<br>
&gt;     &gt;     &gt; &gt;&gt; - One-to-one , many-to-one relation supported.<br>
&gt;     &gt;     &gt; &gt;&gt; - AngularJS and bootstrap responsive based.<br>
&gt;     &gt;     &gt; &gt;&gt; - Aerogear Pipe and Store used.<br>
&gt;     &gt;     &gt; &gt;&gt;<br>
&gt;     &gt;     &gt; &gt;&gt; There is still a lot to do but you can already play with it, a<br>
&gt;     &gt;     &gt; &gt;&gt; quickstart is available here and you should be able to create<br>
&gt;     &gt;     &gt; &gt;&gt; your first Aerogear App in<br>
&gt;     &gt;     &gt; &gt;&gt; 5 minutes ;) <a href="https://gist.github.com/sebastienblanc/4961324" target="_blank">https://gist.github.com/sebastienblanc/4961324</a><br>
&gt;     &gt;     &gt; &gt;&gt;<br>
&gt;     &gt;     &gt; &gt;&gt; An example of a generated application can also be found here :<br>
&gt;     &gt;     &gt; &gt;&gt; <a href="https://github.com/sebastienblanc/scaffoldtester" target="_blank">https://github.com/sebastienblanc/scaffoldtester</a> , please review<br>
&gt;     &gt;     &gt; &gt;&gt; the generated code (at<br>
&gt;     &gt;     &gt; &gt;&gt; least the JS and HTML) and report it to me and I will update the<br>
&gt;     &gt;     &gt; &gt;&gt; templates accordingly.<br>
&gt;     &gt;     &gt; &gt;&gt;<br>
&gt;     &gt;     &gt; &gt;&gt; Next steps are :<br>
&gt;     &gt;     &gt; &gt;&gt; - Integrate Search feature (using the DataStore filter facilities)<br>
&gt;     &gt;     &gt; &gt;&gt; - Integrate Aerogear Pagination (although generic pagination is<br>
&gt;     &gt;     &gt; &gt;&gt; present now)<br>
&gt;     &gt;     &gt; &gt;&gt; - Integrate jQueryMobile (will probably be another plugin)<br>
&gt;     &gt;     &gt; &gt;&gt;<br>
&gt;     &gt;     &gt; &gt;&gt; Enjoy !<br>
&gt;     &gt;     &gt; &gt;&gt;<br>
&gt;     &gt;     &gt; &gt;&gt; Seb<br>
&gt;     &gt;     &gt; &gt;&gt;<br>
&gt;     &gt;     &gt; &gt;&gt; _______________________________________________<br>
&gt;     &gt;     &gt; &gt;&gt; aerogear-dev mailing list<br>
&gt;     &gt;     &gt; &gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt; &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>

</div></div>&gt;     &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;&gt; &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;<br>

<div class="HOEnZb"><div class="h5">&gt;     &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;&gt;&gt;<br>

&gt;     &gt;     &gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;     &gt;     &gt; &gt;<br>
&gt;     &gt;     &gt; &gt;<br>
&gt;     &gt;     &gt; &gt;<br>
&gt;     &gt;     &gt; &gt; _______________________________________________<br>
&gt;     &gt;     &gt; &gt; aerogear-dev mailing list<br>
&gt;     &gt;     &gt; &gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt; &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;&gt;<br>

&gt;     &gt;     &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; _______________________________________________<br>
&gt;     &gt;     &gt; aerogear-dev mailing list<br>
&gt;     &gt;     &gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt; &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;&gt;<br>

&gt;     &gt;     &gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;     _______________________________________________<br>
&gt;     &gt;     aerogear-dev mailing list<br>
&gt;     &gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt; &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;&gt;<br>

&gt;     &gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; _______________________________________________<br>
&gt;     &gt; aerogear-dev mailing list<br>
&gt;     &gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;<br>
&gt;     &gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     aerogear-dev mailing list<br>
&gt;     <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;<br>
&gt;     <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
</div></div><div class="HOEnZb"><div class="h5">&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
<br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</div></div></blockquote></div><br>