Open Journal Systems  3.3.0
MedraWebservice Class Reference

Public Member Functions

 __construct ($endpoint, $login, $password)
 
 _doRequest ($action, $arg, $attachment=null)
 
 _escapeXmlEntities ($string)
 
 _getContentId ($prefix)
 
 _getMimePart ($contentId, $content)
 
 upload ($xml)
 
 viewMetadata ($doi)
 

Data Fields

 $_auth
 
 $_endpoint
 

Detailed Description

A wrapper for the mEDRA web service 2.0.

NB: We do not use PHP's SoapClient because it is not PHP4 compatible and it doesn't support multipart SOAP messages.

Definition at line 26 of file MedraWebservice.inc.php.

Constructor & Destructor Documentation

◆ __construct()

MedraWebservice::__construct (   $endpoint,
  $login,
  $password 
)

Constructor

Parameters
$endpointstring The mEDRA web service endpoint.
$loginstring
$passwordstring

Definition at line 47 of file MedraWebservice.inc.php.

Member Function Documentation

◆ _doRequest()

MedraWebservice::_doRequest (   $action,
  $arg,
  $attachment = null 
)

Do the actual web service request.

Parameters
$actionstring
$argstring
$attachmentarray
Returns
boolean|string True for success, an error message otherwise.

Definition at line 87 of file MedraWebservice.inc.php.

References _getContentId(), _getMimePart(), PKPCurlHelper\getCurlObject(), PKPString\regexp_match(), PKPString\regexp_match_get(), and PKPString\regexp_replace().

Referenced by upload(), and viewMetadata().

◆ _escapeXmlEntities()

MedraWebservice::_escapeXmlEntities (   $string)

Escape XML entities.

Parameters
$stringstring

Definition at line 199 of file MedraWebservice.inc.php.

References XMLNode\xmlentities().

Referenced by viewMetadata().

◆ _getContentId()

MedraWebservice::_getContentId (   $prefix)

Create a globally unique MIME content ID.

Parameters
$prefixstring
Returns
string

Definition at line 191 of file MedraWebservice.inc.php.

Referenced by _doRequest(), and upload().

◆ _getMimePart()

MedraWebservice::_getMimePart (   $contentId,
  $content 
)

Create a mime part with the given content.

Parameters
$contentIdstring
$contentstring
Returns
string

Definition at line 178 of file MedraWebservice.inc.php.

Referenced by _doRequest().

◆ upload()

MedraWebservice::upload (   $xml)

mEDRA upload operation.

Parameters
$xml

Definition at line 60 of file MedraWebservice.inc.php.

References _doRequest(), and _getContentId().

◆ viewMetadata()

MedraWebservice::viewMetadata (   $doi)

mEDRA viewMetadata operation

Definition at line 70 of file MedraWebservice.inc.php.

References _doRequest(), and _escapeXmlEntities().

Field Documentation

◆ $_auth

string MedraWebservice::$_auth

HTTP authentication credentials.

Definition at line 32 of file MedraWebservice.inc.php.

◆ $_endpoint

string MedraWebservice::$_endpoint

The mEDRA web service endpoint.

Definition at line 38 of file MedraWebservice.inc.php.


The documentation for this class was generated from the following file: