start

Applies a template to the model and stores the resulting content in an Eclipse resource.

See also <overrides> , <targetProject> , <workingSet>


Tag Summary
 
required <start template="value" resource="value" />
 
full tag <start template="value" resource="value" project="value" replace="value" show="value" sourceFolder="value" edit="value" startType="value" />

Required Attributes
 
template The name of the template to be applied. This value is the project relative path of the template in the pattern project. Note that by placing templates in a uniquely-named directory (e.g. using the pattern id as the folder name), templates can be uniquely named across pattterns and can be more safely overriden.
resource The name of the file to be created. If this file is to be created in a Java package, then this value should be the path relative to the Java project's source folder. Otherwise, the value should be a path relative to the project root directory.

Optional Attributes
 
project The name of the existing project into which the resource will be created. If omitted, this value will default to the current targetProject which itself defaults to the project containing the primary input file ("appdef") and is changed using the targetWorkspace tag.
replace A true/false value indicated whether an exisiting copy of the resource to be created should be replaced by the new copy
show Indicates whether the resource to be created is to be included in the working set created by the application of this pattern. One of "true" (include the file in the working set), "false" (do not include the file), "folder" (include the entire folder containing the file) and "project" (include the entire project containing the file).
sourceFolder If the file is to be generated into a java package and the containing project has more than one source folder, this attribute can be used to specify which source folder should contain the target package. If omitted, this value defaults to the name of the first or only source folder
edit A true/false value indicating whether the type-appropriate editor should be opened on this file when the pattern completes.
startType A value that is ignored by the tag, but which is used when this pattern is migrated to JET2. This flag is used to indicate how the resource attribute is interpreted. A value of "javaClass" means that the file is a Java class, "javaFile" means that the file is not a Java class but is still generated into a Java package and "file" means that the file is not generated into a java package at all.

Example
 
<start
        template="com.ibm.issw.jdbc/ddl.pat"
        resource="data/%schema(name)%.ddl"
        replace="true"
        show="true"
        edit="true" />

This start tag will apply template "com.ibm.issw.jdbc/ddl.pat" to the model and write the resulting content to a DDL file in folder /data. If the name attribute of the node associated with name "schema" has value "policy", for example, the the file would be writter to /data/policy.ddl. Since no project is specified the file will be created in the same project as the original appdef file (or whichever file had this pattern applied to it) unless the targetProject tag was used to name a different target project.

The new file will replace an existing file by the same name. If this pattern creates a working set then this file will be added to that working set. Finally, when the pattern completes, the default DDL editor (probably the base text editor) will be opened on this file.


© Copyright IBM Corporation 2000, 2006. All Rights Reserved.