The add-property command. Expanding the schema of a type with custom properties

0 Likes
over 4 years ago

The add-property command supports creating custom properties on an existing type. 

The syntax of the command is 

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

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

The xml is different for each property type, and must obey the custom component syntax  (schema examples below). Note that after the command completes, the server automatically prepends Usr_ to the property name.

Creating properties through the command line provides an alternative to creating them through the Cross Platform Client. Ideally, the server will be in exclusive administration mode when creating properties, so that all other users will not be affected. Property creation is slow and expensive, since the database schema and metadata change, the database view member table has to be filled with the appropriate defaults, etc.

examples of property definiton XML for various property meta-types

  <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>

 

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended