...
Attribute | Multi-valued? | Required? | Notes | ||||
---|---|---|---|---|---|---|---|
Address | Yes | No | See note below. | ||||
EmailAddress | Yes | No | See note below. | ||||
Identifier | Yes | No | Does not automatically include the unique key (SORID). See note below. | ||||
Name | Yes | No | Do not include Primary NameAt least one Name must be returned, and exactly one Name must be flagged primary. See note below. | ||||
OrgIdentity.affiliation | No | No | Possible values may vary by CO; see CoExtendedType::definedTypes | ||||
OrgIdentity.title | No | No | |||||
OrgIdentity.o | No | No | |||||
OrgIdentity.ou | No | No | PrimaryName | No | Yes | This Name should not also be included in the Names array. | |
TelephoneNumber | Yes | No | See note below. |
...
Code Block | ||
---|---|---|
| ||
$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 | ||||
---|---|---|---|---|
| ||||
// 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);
}
}
|
...