Versions Compared

Key

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

...

AttributeMulti-valued?Required?Notes
AddressYesNoSee note (info) below.
EmailAddressYesNoSee note (info) below.
IdentifierYesNoDoes not automatically include the unique key (SORID). See note (info) below.
NameYesNoDo not include Primary NameAt least one Name must be returned, and exactly one Name must be flagged primary. See note (info) below.
OrgIdentity.affiliationNoNoPossible values may vary by CO; see CoExtendedType::definedTypes
OrgIdentity.titleNoNo 
OrgIdentity.oNoNo 
OrgIdentity.ouNoNo PrimaryNameNoYesThis Name should not also be included in the Names array.
TelephoneNumberYesNoSee note (info) below.

...

Code Block
languagephp
$myData = array(
  'OrgIdentity' => array(
    'title' => 'Researcher',
    'o' => 'University of Impossible Equations',
    'ou' => 'Department of Timey Wimey Stuff'
  ),
  'PrimaryNameName' => array(
    array(
      'given' => 'Pat',
      'family' => 'Lee',
      'type' => 'official',
      'primary_name' => true
    )
  ),
  // Note below here are multi-valued arrays
  'Identifier' => array(
    array(
      'identifier' => 'plee@university.edu',
      'type' => 'eppn',
      'login' => true
    )
  ),
  'EmailAddress' => array(
    array(
      'mail' => 'plee@university.edu',
      'type' => 'official',
      'verified' => true
    ),
    array(
      'mail' => 'plee@socialemail.com',
      'type' => 'personal',
      'verified' => false
    )
  )
);

...

Code Block
languagephp
titleSample Source Plugin
// Plugin/FooSource/Controller/FooSourceCoPetitionsController.php 
 
App::uses('CoPetitionsController', 'Controller');
class FooSourceCoPetitionsController extends CoPetitionsController {
  public $name = "FooSourceCoPetitions";
  public $uses = array("CoPetition",
                       // Your plugin will most likely need to use OrgIdentitySource to
                       // create the OrgIdentity
                       "OrgIdentitySource");
 
  /**
   * @param  Integer $id CO Petition ID
   * @param  Array $oiscfg Array of configuration data for this plugin
   * @param  Array $onFinish URL, in Cake format
   * @param  Integer $actorCoPersonId CO Person ID of actor
   */


  protected function execute_plugin_selectOrgIdentityAuthenticate($id, $oiscfg, $onFinish, $actorCoPersonId) {
    // Do some work here, then redirect when finished.
    // By default, Exceptions will be caught further up the stack, though you could catch them here.
 
    $myId = result_of_some_work();
 
    // Create an Org Identity
    $this->OrgIdentitySource->createOrgIdentity($oiscfg['OrgIdentitySource']['id'],
                                                $myId,
                                                $actorCoPersonId,
                                                $this->cur_co['Co']['id'],
                                                $actorCoPersonId);

    // Create some history
    $this->CoPetition->CoPetitionHistoryRecord->record($id,
                                                       $actorCoPersonId,
                                                       PetitionActionEnum::IdentityLinked,
                                                       _txt('pl.foosource.linked', array($myId)));
 
    $this->redirect($onFinish);
  }
}


...