Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • objectclass: An array with the following keys:
    • required: Whether or not this objectclass is required. Currently, all plugin-defined schemas must be required.
  • attributes: An array where each key defines the name of the attribute, and each value is an array with the following keys:
    • required: Whether or not this attribute is required for this objectclass
    • multiple: Whether or not this attribute permits multiple values
    • extendedtype: If the value for this attribute will be pulled from a model that supports extended types, the type of data to be pulled:
      • address_types
      • email_address_types
      • identifier_types
      • telephone_number_types
    • defaulttype: If the value for this attribute will be pulled from a model that supports extended types, the default type (cm_co_extended_types:name)

 


Note

Currently, only schemas related to person attributes are supported. ie: these attributes will only be assembled for CO Person transactions, not CO Group transactions.

...

Code Block
languagephp
titleExample Schema DefitionDefinition
public $attributes = array(
  'testPerson' => array(
    'objectclass' => array(
      'required'    => true
    ),
    'attributes' => array(
      'testDescription' => array(
        'required'    => true,
        'multiple'    => false
      ),
      'erpNumber' => array(
        'required'     => false,
        'multiple'     => false,
        'extendedtype' => 'identifier_types',
        'defaulttype'  => 'employeenumber'
      )
    )
  )
);

...


assemblePluginAttributes()

...

  • A simple string, for single valued attributes
  • An array of strings, for multi valued attributes
  • An empty array, if there is no value for the attribute (do not set the attribute to null), even if the attribute would otherwise be single valued

...


Code Block
languagephp
titleSample Attribute Assembly
linenumberstrue
public function assemblePluginAttributes($configuredAttributes, $provisioningData) {
  $attrs = array();
  
  foreach($configuredAttributes as $attr => $cfg) {
    switch($attr) {
      case 'erpNumber':
        $attrs[$attr] = array();
        foreach($provisioningData['Identifier'] as $m) {
          if(isset($m['type'])
             && $m['type'] == $cfg['defaulttype']
             && $m['status'] == StatusEnum::Active) {
            $attrs[$attr] = $m['identifier'];
            break;
          }
        }
        break;
      case 'testDescription':
        $attrs[$attr] = "This is a test description";
        break;
      // else we don't know what this attribute is
    }
  }
  
  return $attrs;
} 

...