The add-type command. Creating StarTeam custom components.

0 Likes
over 4 years ago

The add-type command is used to create a custom component on the server.

The syntax of the command is 

add-property -xmlFile <pathToPropertyDefinitionXmlFile> | -xml <property definition xml string> { -verify} -s "user[:password]@host:port" [ -epwdfile "pathToPasswordFile"]

Note that either -xmlFile or -xml must be specified, but not both. 

The optional test -verify checks the syntax of the xml, but does not create the component.

The xml is different for each property type, and must obey the custom component syntax  (schema examples below). When created, the custom component is an aggregate of the properties described in its schema.

Creating components through the command line provides an alternative to creating them through the Server Administration Tool. Ideally, the server will be in exclusive administration mode when creating components

An example of component definition XML below.

<?xml version="1.0" encoding="utf-8"  standalone="no"?>

<ComponentDefinition version="1.1">

<Component name="afooComponentEx">

<ClassDisplayName default="afooComponentEx"></ClassDisplayName>

<ComponentType>1</ComponentType>

<Descriptor>aTimenSpan</Descriptor>

<PrimaryDescriptor>aStringnThing</PrimaryDescriptor>

<Descriptor>aPrincipalID</Descriptor>

  <Properties>

    <Property name="anInteger">

    <DisplayName default="bar"></DisplayName>

    <Type>1</Type>

    <DefaultValue>10</DefaultValue>

    </Property>

 

    <Property name="aLongInteger">

    <DisplayName default="aLongInteger"></DisplayName>

    <Type>16</Type>

    <DefaultValue>19</DefaultValue>

    </Property>

 

    <Property name="aDouble">

    <DisplayName default="aDouble"></DisplayName>

    <Type>6</Type>

    <DefaultValue>33.45</DefaultValue>

    </Property>

 

    <Property name="aDatenTime">

    <DisplayName default="aDatenTime"></DisplayName>

    <Type>7</Type>

    <IgnoreTime>0</IgnoreTime>

    </Property>

 

    <Property name="aDateIgnorTime">

    <DisplayName default="aDateIgnorTime"></DisplayName>

    <Type>7</Type>

    <IgnoreTime>1</IgnoreTime>

    </Property>

 

    <Property name="aTimenSpan">

    <DisplayName default="aTimenSpan"></DisplayName>

    <Type>15</Type>

    <DefaultValue>7.0</DefaultValue>

    <Units>4.0</Units>

    </Property>

 

    <Property name="aBoolean">

    <DisplayName default="aBoolean"></DisplayName>

    <Type>14</Type>

    <DefaultValue>"TRUE"</DefaultValue>

    </Property>

 

    <Property name="aStringnThing">

    <DisplayName default="aStringnThing"></DisplayName>

    <Type>8</Type>

    <Length>512</Length>

    <DefaultValue>a stitch in time</DefaultValue>

    </Property>

 

    <Property name="anArrayOIDs">

    <DisplayName default="anArrayOIDs"></DisplayName>

   <Type>13</Type>

    <Length>500</Length>

     <ExternClassName>Group</ExternClassName>

    </Property>

 

    <Property name="aPrincipalID">

    <DisplayName default="aPrincipalID"></DisplayName>

    <Type>4</Type>

    <ExternClassName>User</ExternClassName>

    </Property>

 

    <Property name="aBucketOBits">

    <DisplayName default="aBucketOBits"></DisplayName>

    <Type>17</Type>

    </Property>

 

    <Property name="aSetOPieces">

    <DisplayName default="aSetOPieces"></DisplayName>

    <Type>2</Type>

    <DefaultValue>100</DefaultValue>

    <DefaultValue>101</DefaultValue>

    <Flags multiselect="true"  supportsProcessRules="false"/>

      <Enum code="100">

      <EnumName default="Windows"></EnumName>

      <ParentCode>-1</ParentCode>

      <Order>100</Order>

      <Flags selectable="true" isClosedState="false"/>

      </Enum>

      <Enum code="101">

      <EnumName default="Linux"></EnumName>

      <ParentCode>-1</ParentCode>

      <Order>101</Order>

      <Flags selectable="true" isClosedState="false"/>

      </Enum>

    </Property>

 

  </Properties>

</Component>

</ComponentDefinition>

  <Property name="anInteger">

    <DisplayName default="bar"></DisplayName>

    <Type>1</Type>

    <DefaultValue>10</DefaultValue>

    </Property>

 

    <Property name="aLongInteger">

    <DisplayName default="aLongInteger"></DisplayName>

    <Type>16</Type>

    <DefaultValue>19</DefaultValue>

    </Property>

 

    <Property name="aDouble">

    <DisplayName default="aDouble"></DisplayName>

    <Type>6</Type>

    <DefaultValue>33.45</DefaultValue>

    </Property>

 

    <Property name="aDatenTime">

    <DisplayName default="aDatenTime"></DisplayName>

    <Type>7</Type>

    <IgnoreTime>0</IgnoreTime>

    </Property>

 

    <Property name="aDateIgnorTime">

    <DisplayName default="aDateIgnorTime"></DisplayName>

    <Type>7</Type>

    <IgnoreTime>1</IgnoreTime>

    </Property>

 

    <Property name="aTimenSpan">

    <DisplayName default="aTimenSpan"></DisplayName>

    <Type>15</Type>

    <DefaultValue>7.0</DefaultValue>

    <Units>4.0</Units>

    </Property>

 

    <Property name="aBoolean">

    <DisplayName default="aBoolean"></DisplayName>

    <Type>14</Type>

    <DefaultValue>"TRUE"</DefaultValue>

    </Property>

 

    <Property name="aStringnThing">

    <DisplayName default="aStringnThing"></DisplayName>

    <Type>8</Type>

    <Length>512</Length>

    <DefaultValue>a stitch in time</DefaultValue>

    </Property>

 

    <Property name="anArrayOIDs">

    <DisplayName default="anArrayOIDs"></DisplayName>

    <Type>13</Type>

    <Length>500</Length>

     <ExternClassName>Group</ExternClassName>

    </Property>

 

    <Property name="aPrincipalID">

    <DisplayName default="aPrincipalID"></DisplayName>

    <Type>4</Type>

    <ExternClassName>User</ExternClassName>

    </Property>

 

    <Property name="aBucketOBits">

    <DisplayName default="aBucketOBits"></DisplayName>

    <Type>17</Type>

    </Property>

 

    <Property name="aSetOPieces">

    <DisplayName default="aSetOPieces"></DisplayName>

    <Type>2</Type>

    <DefaultValue>100</DefaultValue>

    <DefaultValue>101</DefaultValue>

    <Flags multiselect="true"  supportsProcessRules="false"/>

      <Enum code="100">

      <EnumName default="Windows"></EnumName>

      <ParentCode>-1</ParentCode>

      <Order>100</Order>

      <Flags selectable="true" isClosedState="false"/>

      </Enum>

      <Enum code="101">

      <EnumName default="Linux"></EnumName>

      <ParentCode>-1</ParentCode>

      <Order>101</Order>

      <Flags selectable="true" isClosedState="false"/>

      </Enum>

    </Property>

 

  </Properties>

</Component>

</ComponentDefinition>

 

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended