# Processes Extension point

###### Identifier:

org.eclipse.cdt.core.templateProcessTypes

###### Since:

CDT 4.0

###### Description:

This extension point is to be extended to define new processes to be used in template descriptors by template writers.

###### Configuration Markup:

<!ELEMENT extension (processType+)>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED>

One or more elements of processType should be added as children to this element.

<!ELEMENT processType ((simple | simpleArray | complex | complexArray)*)>

<!ATTLIST processType

name CDATA #REQUIRED

processRunner CDATA #REQUIRED>

This element defines a single process. A process is analogous to a procedure with a set of parameters. In similar terms, one can say that this element defines the prototype of this process procedure. One needs to specify all the parameters expected by this process. In the eventual template xml, one needs to specify arguments for the process matching the types and order of these parameters.

- name - The value of this attribute is used (fully qualified with the namespace in which the extension is declared), to uniquely identify this processType. e.g. a value such as AddFiles will mean that the usage in the template.xml should be something like <process type="<plugin_id>.AddFiles>
- processRunner - A class that extends org.eclipse.cdt.core.templateengine.process.ProcessRunner abstract class and implements all its abstract methods. This is the code that actually processes.

<!ELEMENT simple EMPTY>

<!ATTLIST simple

name CDATA #REQUIRED

external (true | false)

nullable (true | false) >

A simple string parameter. In the eventual template xml, one needs to specify the same name as the value of the name attribute of a simple argument alongwith the corresponding value attribute.

- name - Name of the parameter. This should be used exactly as is in the name attribute of a simple argument in the template xml.
- external - This is an optional attribute. If specified with a true value, it implies that the template xml need not mention this argument for this param. The attribute does not have any meaning in the context of a child of a complex param or of a child of a complexArray param. Another thing to note is that arguments corresponding to external=true type params, if not mentioned in the template xml, should be supplied directly through the ValueStore with the key as the param's name. If not mentioned, this attribute's is treated as false.
- nullable - This is an optional attribute. If specified with a true value, it implies that the template xml need not mention the value attribute of the argument for this param. The attribute does not have any meaning in the context of a child of a complex param or of a child of a complexArray param. If not mentioned, this attribute's is treated as false.

<!ELEMENT simpleArray EMPTY>

<!ATTLIST simpleArray

name CDATA #REQUIRED>

A simple string array parameter. In the eventual template xml, one needs to specify the same name as the value of the name attribute of a simple-array argument alongwith the corresponding element children, one child per array element with the corresponding value attribute.

- name - Name of the parameter. This should be used exactly as is in the name attribute of a simple-array argument in the template xml.

<!ELEMENT complex ((simple | simpleArray | complex | complexArray))+>

<!ATTLIST complex

name CDATA #REQUIRED>

A complex parameter that groups together any number of simple, simpleArray, complex, complexArray parameters. This is equivalent of an object parameter. In the eventual template xml, one needs to specify the same name as the value of the name attribute of a simple argument alongwith the corresponding children, each child matching the type of the corresponding child of this element.

- name - Name of the parameter. This should be used exactly as is in the name attribute of a complex argument in the template xml.

<!ELEMENT complexArray (baseType)>

<!ATTLIST complexArray

name CDATA #REQUIRED>

A complex array parameter. Each element of this parameter is of the same base complex type as specified by the baseType child of this element. In the eventual template xml, one needs to specify the same name as the value of the name attribute of a complex-array argument alongwith the corresponding element children, one child per array element with the corresponding complex type arguments (based on baseType definition).

- name - Name of the parameter. This should be used exactly as is in the name attribute of a complex-array argument in the template xml.

<!ELEMENT baseType ((simple | simpleArray | complex | complexArray))+>

This is not a direct parameter of a process. This simply acts as a complex grouping of parameters to be used as the base type of complexArray parameters.

###### Examples:

The following is an example of the extension point usage:

       <extension
             id="processExample"
             name="Process Example"
             point="org.eclipse.cdt.core.templateengine.processTypes">
            <processType
                name="NewManagedProject"
                processRunner="org.eclipse.cdt.core.templateengine.process.processes.NewManagedProject">
             <simple name="name"/>
             <simple
                   external="true"
                   name="projectType"/>
             <simple
                   external="true"
                   name="location"
                   nullable="true"/>
             <simple name="targetType"/>
            </processType>
            <processType
                name="SetMBSBooleanOptionValue"
                processRunner="org.eclipse.cdt.core.templateengine.process.processes.SetMBSBooleanOptionValue">
             <simple name="projectName"/>
             <complexArray name="resourcePaths">
                <baseType>
                   <simple name="id"/>
                   <simple name="value"/>
                   <simple name="path"/>
                </baseType>
             </complexArray>
            </processType>
            <processType
                name="AddFile"
                processRunner="org.eclipse.cdt.core.templateengine.process.processes.AddFile">
             <simple name="projectName"/>
             <complex name="file">
                <simple name="source"/>
                <simple name="target"/>
                <simple name="replaceable"/>
             </complex>
            </processType>
            <processType
                name="AppendToMBSStringListOptionValues"
                processRunner="org.eclipse.cdt.core.templateengine.process.processes.AppendToMBSStringListOptionValues">
             <simple name="projectName"/>
             <complexArray name="resourcePaths">
                <baseType>
                   <simple name="id"/>
                   <simpleArray name="values"/>
                   <simple name="path"/>
                </baseType>
             </complexArray>
            </processType>
        </extension>

For more details on how to define your own templates, please check examples provided under `org.eclipse.cdt.gnu.templates`

###### Supplied Implementation:

An implementation of this extension point is supplied in `org.eclipse.cdt.core.templateengine`

Copyright (c) 2007 Symbian Software Limited and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Bala Torati (Symbian) - Initial API and implementation