Actor
From Hypertopic
Contents |
Document Format of Actor
Actor List DTD
<?xml version="1.0" encoding="UTF-8"?> <!ELEMENT actors (actor*)> <!ELEMENT actor (#PCDATA)> <!ATTLIST actor href CDATA #REQUIRED >
Example of Actor List
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE actors SYSTEM "http://tech-ada.utt.fr/validator/dtd/actors.dtd"> <actors> <actor href="http://tech-ada.utt.fr/actor/windows+user/">windows xp user</actor> <actor href="http://tech-ada.utt.fr/actor/linux+fans/">linux fans group</actor> </actors>
Actor DTD
<?xml version="1.0" encoding="UTF-8"?> <!ELEMENT actor (viewpoint*)> <!ELEMENT viewpoint (#PCDATA)> <!ATTLIST actor name CDATA #IMPLIED > <!ATTLIST viewpoint href CDATA #REQUIRED role CDATA #IMPLIED >
Example of Actor
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE actor SYSTEM "http://tech-ada.utt.fr/validator/dtd/actor.dtd"> <actor name="linux fans"> <viewpoint href="http://tech-ada.utt.fr/viewpoint/1/" role="publisher">Software features</viewpoint> <viewpoint href="http://tech-ada.utt.fr/viewpoint/2/" role="author">Software creators</viewpoint> </actor>
XML structure of Actor
| XPath | Cardinality | Description |
| /actor/@name | Optional | Actor full name, limited to 255 characters |
| /viewpoint | * | Viewpoints which this actor could visit or manipulate |
| /viewpoint/@href | Required | Viewpoint URI |
| /viewpoint/@role | Optional | The role of the actor. |
Create or Update Actor
To create or update an actor, using PUT method. If the actor doesn't exist, this method will create a new actor. If the actor exists, this method will replace it.
Arguments
actorname (Required)
- The identity of actor to be operated. .
Examples
To create a new actor (identity: linux fans, full name: linux fans group) without linking to any viewpoint, send a PUT request, and supply a new actor in specific format:
PUT http://tech-ada.utt.fr/actor/linux+fans/
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE actor SYSTEM "http://argos.hypertopic.org/validator/dtd/actor.dtd"> <actor name="linux fans group" />
The server responds:
201 Created Location: http://tech-ada.utt.fr/actor/linux+fans/
Note: If you try to link a viewpoint which doesn't exist to an actor, this request will not be executed successful. To update an actor, using PUT request. The following example shows how to update an actor:
PUT http://tech-ada.utt.fr/actor/linux+fans/
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE actor SYSTEM "http://argos.hypertopic.org/validator/dtd/actor.dtd"> <actor name="linux fans group"> <viewpoint href="http://tech-ada.utt.fr/viewpoint/1/" role="publisher">Software features</viewpoint> <viewpoint href="http://tech-ada.utt.fr/viewpoint/2/" role="author">Software creators</viewpoint> </actor>
The server responds:
205 Reset Content
Note: Before you update the actor 'linux fans', please create the viewpoint 'Software feature' and 'Software creators' first.
Status Codes
201: Created
- The request has been fulfilled and resulted in a new resource being created.
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.
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 an actor
Delete an actor by actorname.
Arguments
actorname (Required)
- The identity of actor to be deleted. .
Examples
To delete an actor, send DELETE request to actor's URI.
DELETE http://tech-ada.utt.fr/actor/linux+fans/
The server responds:
200 OK
If the specific actor doesn't exist, this method will return 404 status code.
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 List of Actor
Get a list of all actors.
Arguments
none
Examples
To get a list of all actors, send GET request to /actor/. The following example shows how to get a list of actor:
GET http://tech-ada.utt.fr/actor/
The server responds:
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE actors SYSTEM "http://tech-ada.utt.fr/validator/dtd/actors.dtd"> <actors> <actor href="http://tech-ada.utt.fr/actor/windows+user/">windows user</actor> <actor href="http://tech-ada.utt.fr/actor/linux+fans/">linux fans</actor> <actor href="http://tech-ada.utt.fr/actor/mac+os+fans/">mac os fans</actor> </actors>
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.
Get an Actor
Get a specific actor's information.
Arguments
actorname (Required)
- The identity of the actor to get detail information for.
Examples
GET http://tech-ada.utt.fr/actor/linux+fans/
The server responds:
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE actor SYSTEM "http://tech-ada.utt.fr/validator/dtd/actor.dtd"> <actor name="linux fans"> <viewpoint href="http://tech-ada.utt.fr/viewpoint/1/" role="publisher">Software features</viewpoint> <viewpoint href="http://tech-ada.utt.fr/viewpoint/2/" role="author">Software creators</viewpoint> </actor>
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.
