WebService Class Reference
[Framework for the Web Services]

A Web Service abstract class. More...

Inherited by AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, CompoundWebService, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

List of all members.

Public Member Functions

 __construct ()
 __destruct ()
 ws_conneg ($accept, $accept_charset, $accept_encoding, $accept_language)
 does the content negotiation for the queries that come from the Web (when this class acts as a Web Service)
 ws_serialize ()
 Output the content generated by the class in some serialization format.
 ws_respond ($content)
 Sends the respond to the user. The $content should come from ws_serialize() to be valid according to the conneg with the user.
 process ()
 Process the functionality of the web service.
 pipeline_conneg ($accept, $accept_charset, $accept_encoding, $accept_language)
 Propagate the conneg to the nodes that belong to the current pipeline of web services.
 pipeline_getResponseHeaderStatus ()
 Returns the response HTTP header status.
 pipeline_getError ()
 Returns the error structure.
 pipeline_getResponseHeaderStatusMsg ()
 Returns the response HTTP header status message.
 pipeline_getResponseHeaderStatusMsgExt ()
 Returns the response HTTP header status message extension.
 pipeline_getResultset ()
 Create a resultset in a pipelined mode based on the processed information by the Web service.
 pipeline_serialize ()
 Serialize content into different serialization formats.
 pipeline_serialize_reification ()
 Returns the description of the reification of some triples defined by pipeline_serialize().
 injectDoctype ($xmlDoc)
 Inject the DOCType in a XML document.
 xmlEncode ($string)
 Encode content to be included in XML files.
 jsonEncode ($string)
 Encode a string to put in a JSON value.

Static Public Attributes

static $data_ini = "/data/"
 data.ini file folder
static $network_ini = "/usr/share/structwsf/"
 network.ini file folder

Protected Member Functions

 validateQuery ()
 Validate a query to this web service.

Protected Attributes

 $db_username = ""
 Database user name.
 $db_password = ""
 Database password.
 $db_dsn = ""
 Database DSN connection.
 $db_host = "localhost"
 Database host.
 $dtdBaseURL = ""
 DTD URL of the web service.
 $wsf_graph = ""
 The graph where the Web Services Framework description has been indexed.
 $wsf_base_url = ""
 Base URL of the WSF.
 $wsf_base_path = ""
 Local server path of the WSF files.
 $wsf_local_ip = ""
 Local server path of the WSF files.
 $wsf_solr_core = ""
 The core to use for Solr; "" for no core.
 $ontologies_files_folder = ""
 Path to the ontologies description files (in RDFS and OWL).
 $solr_host = "localhost"
 Hostname where to send queries to the Solr instance.
 $ontological_structure_folder = ""
 Path to the structWSF ontological structure.
 $log_table = "SD.WSF.ws_queries_log"
 Name of the logging table on the Virtuoso instance.
 $solr_auto_commit = FALSE
 Auto commit handled by the Solr data management systems. If this parameter is true, then this means Solr will handle the commit operation by itself. If it is false, then the web services will trigger the commit operations. Usually, Auto-commit should be handled by Solr when the size of the dataset is too big, otherwise operation such as delete could take much time.
 $uri
 The URI of the Authentication Registrar web service.
 $title
 The Title of the Authentication Registrar web service.
 $crud_usage
 The CRUD usage of the Authentication Registrar web service.
 $endpoint
 The endpoint of the Authentication Registrar web service.


Detailed Description

A Web Service abstract class.

This abstract class is used to define a web service that can interact with external webservices, or web services in a pipeline (compound), in a RESTful way.


Todo:
Creating a DTD for creating structured error reports
Todo:
Extension of the web service framework to enable the integration of a caching system (like memcached)

Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 31 of file WebService.php.


Constructor & Destructor Documentation


Member Function Documentation

WebService::injectDoctype ( xmlDoc  )  [abstract]

Inject the DOCType in a XML document.


Parameters:
[in] $xmlDoc The XML document where to inject the doctype
Returns:
a XML document with a doctype
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::jsonEncode ( string  ) 

Encode a string to put in a JSON value.

Parameters:
[in] $string The string to escape

Returns:
returns the escaped string
Author:
Frederick Giasson, Structured Dynamics LLC.



Definition at line 398 of file WebService.php.

Referenced by Sparql::pipeline_serialize(), Search::pipeline_serialize(), DatasetRead::pipeline_serialize(), CrudRead::pipeline_serialize(), Browse::pipeline_serialize(), and AuthLister::pipeline_serialize().

WebService::pipeline_conneg ( accept,
accept_charset,
accept_encoding,
accept_language 
) [abstract]

Propagate the conneg to the nodes that belong to the current pipeline of web services.


Parameters:
[in] $accept Accepted mime types (HTTP header)
[in] $accept_charset Accepted charsets (HTTP header)
[in] $accept_encoding Accepted encodings (HTTP header)
[in] $accept_language Accepted languages (HTTP header)
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::pipeline_getError (  )  [abstract]

Returns the error structure.


Returns:
returns the error structure
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::pipeline_getResponseHeaderStatus (  )  [abstract]

Returns the response HTTP header status.


Returns:
returns the response HTTP header status
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::pipeline_getResponseHeaderStatusMsg (  )  [abstract]

Returns the response HTTP header status message.


Returns:
returns the response HTTP header status message
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::pipeline_getResponseHeaderStatusMsgExt (  )  [abstract]

Returns the response HTTP header status message extension.


Returns:
returns the response HTTP header status message extension
Note:
The extension of a HTTP status message is
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::pipeline_getResultset (  )  [abstract]

Create a resultset in a pipelined mode based on the processed information by the Web service.


Returns:
a resultset XML document
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::pipeline_serialize (  )  [abstract]

Serialize content into different serialization formats.


Returns:
returns the serialized content
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::pipeline_serialize_reification (  )  [abstract]

Returns the description of the reification of some triples defined by pipeline_serialize().


Note:
most of the web services won't implement this procedure.
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::process (  )  [abstract]

Process the functionality of the web service.


Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::validateQuery (  )  [abstract, protected]

Validate a query to this web service.


Returns:
TRUE if valid; FALSE otherwise
Note:
Usually, this function sends a query to the Authentication web service in order to be validated.
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::ws_conneg ( accept,
accept_charset,
accept_encoding,
accept_language 
) [abstract]

does the content negotiation for the queries that come from the Web (when this class acts as a Web Service)


Parameters:
[in] $accept Accepted mime types (HTTP header)
[in] $accept_charset Accepted charsets (HTTP header)
[in] $accept_encoding Accepted encodings (HTTP header)
[in] $accept_language Accepted languages (HTTP header)
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::ws_respond ( content  )  [abstract]

Sends the respond to the user. The $content should come from ws_serialize() to be valid according to the conneg with the user.


Parameters:
[in] $content The content (body) of the response.
Returns:
NULL
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.

WebService::ws_serialize (  )  [abstract]

Output the content generated by the class in some serialization format.


Returns:
returns the serialized content
Author:
Frederick Giasson, Structured Dynamics LLC.



Reimplemented in AuthLister, AuthRegistrarAccess, AuthRegistrarWs, AuthValidator, Browse, ConverterBibtex, ConverterIrJSON, ConverterTsv, CrudCreate, CrudDelete, CrudRead, CrudUpdate, DatasetCreate, DatasetDelete, DatasetRead, DatasetUpdate, OntologyCreate, Search, and Sparql.


Member Data Documentation

WebService::$crud_usage [protected]

The CRUD usage of the Authentication Registrar web service.

Definition at line 95 of file WebService.php.

Referenced by AuthRegistrarWs::ws_conneg().

WebService::$data_ini = "/data/" [static]

data.ini file folder

Definition at line 34 of file WebService.php.

Referenced by __construct(), and Logger::__construct().

WebService::$db_dsn = "" [protected]

Database DSN connection.

Definition at line 46 of file WebService.php.

WebService::$db_host = "localhost" [protected]

Database host.

Definition at line 49 of file WebService.php.

WebService::$db_password = "" [protected]

Database password.

Definition at line 43 of file WebService.php.

WebService::$db_username = "" [protected]

Database user name.

Definition at line 40 of file WebService.php.

WebService::$dtdBaseURL = "" [protected]

DTD URL of the web service.

Definition at line 52 of file WebService.php.

WebService::$endpoint [protected]

The endpoint of the Authentication Registrar web service.

Definition at line 98 of file WebService.php.

WebService::$log_table = "SD.WSF.ws_queries_log" [protected]

Name of the logging table on the Virtuoso instance.

Definition at line 79 of file WebService.php.

WebService::$network_ini = "/usr/share/structwsf/" [static]

network.ini file folder

Definition at line 37 of file WebService.php.

Referenced by __construct().

WebService::$ontological_structure_folder = "" [protected]

Path to the structWSF ontological structure.

Definition at line 76 of file WebService.php.

WebService::$ontologies_files_folder = "" [protected]

Path to the ontologies description files (in RDFS and OWL).

Definition at line 70 of file WebService.php.

WebService::$solr_auto_commit = FALSE [protected]

Auto commit handled by the Solr data management systems. If this parameter is true, then this means Solr will handle the commit operation by itself. If it is false, then the web services will trigger the commit operations. Usually, Auto-commit should be handled by Solr when the size of the dataset is too big, otherwise operation such as delete could take much time.

Definition at line 86 of file WebService.php.

WebService::$solr_host = "localhost" [protected]

Hostname where to send queries to the Solr instance.

Definition at line 73 of file WebService.php.

WebService::$title [protected]

The Title of the Authentication Registrar web service.

Definition at line 92 of file WebService.php.

Referenced by DatasetUpdate::__construct(), and DatasetRead::process().

WebService::$wsf_base_path = "" [protected]

Local server path of the WSF files.

Definition at line 61 of file WebService.php.

WebService::$wsf_base_url = "" [protected]

Base URL of the WSF.

Definition at line 58 of file WebService.php.

WebService::$wsf_graph = "" [protected]

The graph where the Web Services Framework description has been indexed.

Definition at line 55 of file WebService.php.

WebService::$wsf_local_ip = "" [protected]

Local server path of the WSF files.

Definition at line 64 of file WebService.php.

WebService::$wsf_solr_core = "" [protected]

The core to use for Solr; "" for no core.

Definition at line 67 of file WebService.php.


The documentation for this class was generated from the following file:
Copyright © 2009. Structured Dynamics LLC Structured Dynamics LLC. All rights reserved.