Search code examples
seamseam-gen

How to control package structure with seam-gen


I've been adding to an existing application by generating with seam-gen and adjusting from there. One problem I keep having is that I have to spend a great deal of time editing the xhtml files to reflect package structure.

for example, seam-gen thinks this will work

   <s:decorate id="simplePidField" template="layout/edit.xhtml">

and so in every .xhtml, we have to change that to

   <s:decorate id="simplePidField" template="/layout/edit.xhtml">

This and other inconsistencies arise because seam-gen builds a flat directory with ALL of the xhtml files in one place, while our app has these divided and sub-divided into several directories.

Is there a way, in the reveng.xml file to define a package structure?
Thanks.


Solution

  • No not in the reveng.xml file. You have to look at the freemarker code in seam-gen source and adjust it there.

    Look at the

    seam-src/seam-gen/view/editproperty.xhtml.ftl 
    

    file and locate

    <s:decorate id="${componentProperty.name}Field" template="layout/edit.xhtml"> '

    and

    <s:decorate id="${property.name}Field" template="layout/edit.xhtml">'

    and change those respectively.


    Otherwise you just have to use search / replace functionality inside your view folder. This is probably just easier