Project Templates

From: Mike Schrag (mschra..dimension.com)
Date: Thu Jun 21 2007 - 17:54:07 EDT

  • Next message: Lachlan Deck: "Re: triple clicking in the html editor"

    I just committed the new wizard "WO Project from Template" and it
    should be in tonight's build.

    I believe we should ultimately replace all of the current WO
    templates with this, but it needs to be extended to be able to load
    templates from inside the jar, or maybe it should unzip predefined
    templates in your ~/Library folder you. Here's the rundown on how it
    works -- if someone wants to make nice pretty wiki docs for this,
    that would be handy:

    You can now build custom project template folders in "~/Library/
    Application Support/WOLips/Project Templates". As an example, you
    can make a folder called "Wonder Application," and inside, build an
    entire project -- folders, files, whatever. These files will all be
    parsed as velocity templates, so you can drop in variables or
    conditionals wherever you need.

    This is the simplest way to do things. To be fancier, you can also
    create a template.xml in the "Wonder Application" folder like:

    <?xml version="1.0" encoding="UTF-8"?>
    <template name = "Wonder Application">
       <inputs>
         <input name = "useProjects" type = "Boolean">
           <question>Link to Eclipse Projects?</question>
           <default>false</default>
         </input>
       </inputs>
    </template>

    You can declare an arbitrary set of inputs, which will become text
    fields, spinners, and checkboxes in the project creation wizard
    (Boolean, String, and Integer types are supported right now). The
    input name matches the velocity variable names you use in your
    templates. The template name is the name that is displayed in the
    chooser in the New Project wizard, though it will default to the
    folder name if you don't provide a template.xml.

    I'm attaching an example of Wonder Application as a project template
    -- just unzip in your Project Templates folder:



    Look in .classpath in that template to see the use of the
    "useProjects" variable defined in template.xml.

    Here's how it looks in WOLips. The new "WO Project from Template"
    option:






    Then your available templates appear here:






    The input options from your template.xml then appear:






    And then the usual project stuff:






    ms



    This archive was generated by hypermail 2.0.0 : Thu Jun 21 2007 - 17:55:20 EDT