To extend the Registry Object API, a registry object handler is required.
A list of available handler is available at
A handler will use any available resource that is available in the get_resource() function available in the registry_objects API handler file. This is currently limited to:
- index: The SOLR index of the record, providing the record is indexed correctly
- xml: The RIFCS of the record
- gXPath: The DOMXPath of the RIFCS, with the correct namespace
- ro: The internal ro object of the registry
- params: the params that is passed to the registry object API
- default_params: the default params that is defaulted to the registry object API
Using these resource or any other resource, the handler should be able to return an array of result.
For example, this is the description handler located at
To add a registry object handler, a new handler with a unique name must be registered in the array available near the top of the registry objects API file, located at
applications/registry/services/method_handlers/registry_objects.php as a
private $valid_methods array.
Then a file with a similar name must be placed in
This will will contain a class that extends ROHandler with a mandatory function of handle() that returns the result we want
- We want to create a handler that returns the registry object name
- We add
- We create a
Content of the name.php file will be
By going to
registry/services/api/registry_objects/145382/name, we’ll see the expected result