Open Semantic Framework PHP API  3.0
 All Data Structures Namespaces Files Functions Variables Pages
AuthRegistrarWsQuery Class Reference

Auth Registrar WS Query to a OSF Auth Registrar WS web service endpoint. More...

Inheritance diagram for AuthRegistrarWsQuery:

Public Member Functions

 __construct ($network, $appID, $apiKey, $userID)
 Constructor. More...
 
 title ($title)
 Title of the web service to register to this OSF instance. More...
 
 endpointUrl ($url)
 URL of the web service endpoint where to send the HTTP queries. More...
 
 endpointUri ($uri)
 URI of the web service to register to the OSF instance. More...
 
 crudUsage ($crudPermission)
 Define the CRUD usage of the endpoint. More...
 

Detailed Description

Auth Registrar WS Query to a OSF Auth Registrar WS web service endpoint.

The Auth Registrar: WS Web service is used to register a Web service endpoint to the WSF (Web Services Framework). Once a Web service is registered to a WSF, it can then be used by other Web services, become accessible to users, etc.

Here is a code example of how this class can be used by developers:

use \StructuredDynamics\osf\framework\Namespaces;
use \StructuredDynamics\osf\php\api\ws\auth\registrar\ws\AuthRegistrarWsQuery;
use \StructuredDynamics\osf\php\api\ws\auth\lister\AuthListerQuery;
use \StructuredDynamics\osf\php\api\framework\CRUDPermission;
// Register a new web service endpoint to the OSF instance
$arws = new AuthRegistrarWsQuery("http://localhost/ws/");
// Define the title
$arws->title("A new web service endpoint");
// Define the endpoint's URI
$arws->endpointUri("http://localhost/wsf/ws/new/");
// Define the access URL
$arws->endpointUrl("http://localhost/ws/new/");
// Specifies that READ permission are needed to use this web service endpoint
$arws->crudUsage(new CRUDPermission(FALSE, TRUE, FALSE, FALSE));
$arws->send();
if($arws->isSuccessful())
{
// Now, let's use the auth: lister endpoint to make sure we can see it in the OSF instance
$authlister = new AuthListerQuery("http://localhost/ws/");
// Specifies that we want to get all the list of all registered web service endpoints.
$authlister->getRegisteredWebServiceEndpointsUri();
// Send the auth lister query to the endpoint
$authlister->send();
// Get back the resultset returned by the endpoint
$resultset = $authlister->getResultset()->getResultset();
$webservices = array();
// Get all the URIs from the resultset array
foreach($resultset["unspecified"] as $list)
{
foreach($list[Namespaces::$rdf."li"] as $item)
{
array_push($webservices, $item["uri"]);
}
}
print_r($webservices);
}
else
{
echo "Web service registration failed: ".$arws->getStatus()." (".$arws->getStatusMessage().")\n";
echo $arws->getStatusMessageDescription();
}
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_WS
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 84 of file AuthRegistrarWsQuery.php.

Constructor & Destructor Documentation

__construct (   $network,
  $appID,
  $apiKey,
  $userID 
)

Constructor.

Parameters
mixed$networkOSF network where to send this query. Ex: http://localhost/ws/
mixed$appIDThe Application ID of the instance instance to key. The APP-ID is related to the API-KEY
mixed$apiKeyThe API Key of the OSF web service endpoints
mixed$userIDThe ID of the user that is doing the query

Definition at line 94 of file AuthRegistrarWsQuery.php.

Member Function Documentation

crudUsage (   $crudPermission)

Define the CRUD usage of the endpoint.

The CRUD usage are the 4 CRUD operations that the endpoint can perform on the data hosted on the OSF instance. For example, the CRUD: Create endpoint has the CRUD usage: <True,False,False,False>. This means that it perform creation operations with the data. This means that the user that will send a request to the CRUD: Create web service endpoint will need to have Create permissions on the target dataset in order to be able to use that web service endpoint on that target dataset.

Parameters
mixed$crudPermission
mixed$crudPermissionA CRUDPermission object instance that define the permissions granted for the target IP, target Dataset and target Web Service Endpoints of this access permission record.
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_WS#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 197 of file AuthRegistrarWsQuery.php.

endpointUri (   $uri)

URI of the web service to register to the OSF instance.

The URI is the unique idenfier of the endpoint, in the OSF instance. That URI is not the URL access endpoint. However, both can be the same.

Note: in OSF, when another web service require the URI/Identifier of a web service, it is really the URI of that web service, and not its access URL.

Required: This function must be called before sending the query

Parameters
mixed$uriURI of the web service to register to the OSF instance
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_WS#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 172 of file AuthRegistrarWsQuery.php.

endpointUrl (   $url)

URL of the web service endpoint where to send the HTTP queries.

Required: This function must be called before sending the query

Parameters
mixed$urlURL of the web service endpoint that people will access on the web
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_WS#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 149 of file AuthRegistrarWsQuery.php.

title (   $title)

Title of the web service to register to this OSF instance.

Required: This function must be called before sending the query

Parameters
mixed$titleTitle of the web service to register
See also
http://wiki.opensemanticframework.org/index.php/Auth_Registrar:_WS#Web_Service_Endpoint_Information
Author
Frederick Giasson, Structured Dynamics LLC.

Definition at line 131 of file AuthRegistrarWsQuery.php.