1 / 15

J- oy

J- oy. Template Structure. Template – Overview. expressions.properties. Templates Folder. Path expressions. Resources. settings.properties. < Templates Group >. Template metadata. Scripts. < scripFile >. groovy. < Template >. Scripts. UMLModel. static. < path >. < file >.

fauna
Download Presentation

J- oy

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. J-oy TemplateStructure

  2. Template – Overview expressions.properties Templates Folder Pathexpressions Resources settings.properties <TemplatesGroup> Templatemetadata Scripts <scripFile>.groovy <Template> Scripts UMLModel static <path> <file> UMLPackage dynamic <path> <file>.gsp UMLClass GSP Templates

  3. Template – Folders Templates Folder Resources <TemplatesGroup> Scripts <Template> UMLModel static UMLPackage dynamic UMLClass Folders with predefined name.

  4. Template – Paths Templates Folder Resources <TemplatesGroup> Scripts <Template> UMLModel static <path> UMLPackage dynamic <path> UMLClass 0, 1 or more nested folders. GString expressions can be used as part of the name. i.e.: ${object.name} Path expressions can be used as part of the name. i.e.: ##exp1##

  5. Template – Static files Templates Folder Resources <TemplatesGroup> Scripts <Template> UMLModel static <path> <file> UMLPackage dynamic <path> UMLClass Static content files. GString expressions can be used as part of the name. i.e.: ${object.name}.gif Path expressions can be used as part of the name. i.e.: ##exp1##.gif

  6. Template – Dynamic files Templates Folder Resources <TemplatesGroup> Scripts <Template> UMLModel static <path> <file> UMLPackage dynamic <path> <file>.gsp UMLClass Groovy Server Pages used for generating dynamic content files. GString expressions can be used as part of the name. i.e.: ${object.name}.gif Path expressions can be used as part of the name. i.e.: ##exp1##.gif

  7. Sample - Groovy Server Pages publicclass ${object.name} implementsSerializable { privatestatic final longserialVersionUID = 1L; @Id @Basic(optional = false) @Column(name = "${object.name}_ID") privateInteger ${object.name}Id; <%object.ownedAttributes.each{attribute->%> @Column private ${attribute?.type?.name} ${attribute?.name}; <%}%> ${object.name}.java.gsp

  8. Template – Scripts Templates Folder Resources <TemplatesGroup> Scripts <scripFile>.groovy <Template> UMLModel static <path> <file> UMLPackage dynamic <path> <file>.gsp UMLClass Groovy files used for providing reusable object-oriented scripting support to GSP templates.

  9. Sample - Groovy Script import org.eclipse.uml2.uml.Property; importorg.eclipse.emf.common.util.EList; classJPAUtil { privateObjectumlClass; JPAUtil(ObjectumlClass){ this.umlClass=umlClass; } StringgetDump() { StringBuildersb = new StringBuilder(); sb.append("\nUMLClass.name: " + umlClass.getName()); sb.append("\nUMLClass.package: " + umlClass.getPackage().getName()); // JPAUtil.groovy

  10. Template – Pathexpressions expressions.properties Templates Folder Resources <TemplatesGroup> Scripts <scripFile>.groovy <Template> UMLModel static <path> <file> UMLPackage dynamic <path> <file>.gsp UMLClass Path expressions file. This file holds expressions that can be used in folder and file names for dynamically generating paths, using scripts that include characters not supported by the file system.

  11. Sample – Path expressions exp1=${umlclass.name} exp2=<%JPAUtil.generateJSFFileName(umlclass)%> expressions.properties

  12. Template – Settingsmetadata expressions.properties Templates Folder Resources settings.properties <TemplatesGroup> Scripts <scripFile>.groovy <Template> UMLModel static <path> <file> UMLPackage dynamic <path> <file>.gsp UMLClass Metadata defining template parameters that must be provided as input for the template execution. Template parameters are provided as an input file to the templates engine. When running in interactive mode, engine can ask for missing parameters if needed.

  13. Sample - Groovy Script # Metadatafortemplaterequiredsettings template.name=EntitiestoJava settings.count=3 setting.0.key=MavenGroupId setting.0.label=MavenGroup Id setting.0.default=ar.com.coonocer setting.0.mandatory=true setting.0.format=String setting.1.key=MavenArtifacId setting.1.label=MavenArtifac Id setting.1.default=web-project ... expressions.properties

  14. Template – Runtimeview Template GSP TemplateGroovyClasses TemplateLibraries? J-oy JRE 1.5

  15. Futherquestions • Ifyouwanttocontribute, haveanyquestionorsuggestion, pleasecontactus at: • info.joy.team@gmail.com

More Related