Viewpoint
From Hypertopic
Contents |
Document Format of Viewpoint
Viewpoint List DTD
<?xml version="1.0" encoding="UTF-8"?> <!ELEMENT viewpoints (viewpoint*)> <!ELEMENT viewpoint (#PCDATA)> <!ATTLIST viewpoint href CDATA #REQUIRED >
Example of Viewpoint List
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE viewpoints SYSTEM "http://tech-ada.utt.fr/validator/dtd/viewpoints.dtd"> <viewpoints> <viewpoint href="http://tech-ada.utt.fr/viewpoint/1/">Software features</viewpoint> <viewpoint href="http://tech-ada.utt.fr/viewpoint/2/">Software creators</viewpoint> </viewpoints>
Viewpoint DTD
<?xml version="1.0" encoding="UTF-8"?> <!ELEMENT viewpoint (actor*, topic*)> <!ELEMENT actor (#PCDATA)> <!ELEMENT topic (#PCDATA)> <!ATTLIST viewpoint href CDATA #IMPLIED name CDATA #IMPLIED > <!ATTLIST actor href CDATA #REQUIRED name CDATA #IMPLIED role CDATA #IMPLIED > <!ATTLIST topic href CDATA #REQUIRED >
Example Viewpoint
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE viewpoint SYSTEM "http://tech-ada.utt.fr/validator/dtd/viewpoint.dtd"> <viewpoint name="Software features"> <actor href="http://tech-ada.utt.fr/actor/linux+fans/" name="linux fans" role="read" /> <topic href="http://tech-ada.utt.fr/viewpoint/1/topic/1/">World Wide Web</topic> </viewpoint>
XML structure of Viewpoint
| XPath | Cardinality | Description |
| /viewpoint/@href | Optional | Viewpoint URI |
| /viewpoint/@name | Optional | Viewpoint Name |
| /viewpoint/actor/ | * | Actor which could visit or manipulate this viewpoint |
| /viewpoint/actor/@href | Required | Actor URI |
| /viewpoint/actor/@name | Optional | The full name of the actor. |
| /viewpoint/actor/@role | Optional | The role of the actor. |
| /viewpoint/topic/ | * | Topics which are linked to the viewpoint. |
| /viewpoint/topic/@href | Required | Topic URI |
Create a New Viewpoint
Add a new viewpoint.
Arguments
This method has no arguments. Note: This method requires an HTTP POST request.
Example Request
POST /viewpoint/
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE viewpoint SYSTEM "http://tech-ada.utt.fr/validator/dtd/viewpoint.dtd"> <viewpoint name="Software features" />
Example Response
201 Created Location: /viewpoint/1/
Status Codes
201: Created
- request has been fulfilled and resulted in a new resource being created.
400:' Bad Request
- The request could not be understood by the server due to malformed syntax.
500: Internal Server Error
- The server encountered an unexpected condition which prevented it from fulfilling the request.
503: Service currently unavailable
- The requested service is temporarily unavailable.
Update a ViewPoint
set a specific viewpoint information.
Arguments
viewpointid (Required)
- The id of the viewpoint to set detail information for. You can use this method to change viewpoint name.
Note: This method requires an HTTP PUT request.
Example Request
PUT /viewpoint/1/
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE viewpoint SYSTEM "http://tech-ada.utt.fr/validator/dtd/viewpoint.dtd"> <viewpoint name="Software creators" />
Example Response
This method has no specific response - It returns status code 205 Reset Content, if it completes without error
Status Codes
205: Reset Content
- The server has fulfilled the request and the user agent SHOULD reset the document view which caused the request to be sent.
400: Bad Request
- The request could not be understood by the server due to malformed syntax.
404: Not Found
- The server has not found anything matching the Request-URI.
500: Internal Server Error
- The server encountered an unexpected condition which prevented it from fulfilling the request.
503: Service currently unavailable
- The requested service is temporarily unavailable.
Delete a ViewPoint
Delete a specific viewpoint. Actually the viewpoint will not be deleted, the method just set the viewpoint as inactive.
Arguments
viewpointid (Required)
- The id of the viewpoint to delete.
Note: This method requires an HTTP DELETE request.
Example Request
DELETE /viewpoint/1/
Example Response
This method has no specific response - It returns an empty sucess response if it completes without error.
Status Codes
200: OK
- The request has succeeded.
404: Not Found
- The server has not found anything matching the Request-URI.
500: Internal Server Error
- The server encountered an unexpected condition which prevented it from fulfilling the request.
503: Service currently unavailable
- The requested service is temporarily unavailable.
Get a List of ViewPoint
get all viewpoint information.
Arguments
Note: This method requires an HTTP GET request.
Example Request
GET /viewpoint/
Example Response
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE viewpoints SYSTEM "http://tech-ada.utt.fr/validator/dtd/viewpoints.dtd"> <viewpoints> <viewpoint href="http://tech-ada.utt.fr/viewpoint/1/">Software features</viewpoint> <viewpoint href="http://tech-ada.utt.fr/viewpoint/2/">Software creators</viewpoint> </viewpoints>
Status Codes
200: OK
- The request has succeeded.
500: Internal Server Error
- The server encountered an unexpected condition which prevented it from fulfilling the request.
503: Service currently unavailable
- The requested service is temporarily unavailable.
Get a ViewPoint
Get a specific viewpoint information.
Arguments
viewpointid (Required)
- The id of the viewpoint to fetch detail information for.
Note: This method requires an HTTP GET request.
Example Request
GET /viewpoint/1/
Example Response
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE viewpoint SYSTEM "http://tech-ada.utt.fr/validator/dtd/viewpoint.dtd"> <viewpoint name="Software features"> <actor href="http://tech-ada.utt.fr/actor/linux+fans/" name="linux fans" role="read" /> <topic href="http://tech-ada.utt.fr/viewpoint/1/topic/1/">World Wide Web</topic> </viewpoint>
Status Codes
200: OK
- The request has succeeded.
404: Not Found
- The server has not found anything matching the Request-URI.
500: Internal Server Error
- The server encountered an unexpected condition which prevented it from fulfilling the request.
503: Service currently unavailable
- The requested service is temporarily unavailable.
