Resource

From Hypertopic

Jump to: navigation, search

Contents

Document Format of Resource

Resource DTD

<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT resource (entity*)>
<!ATTLIST resource
    name CDATA #REQUIRED
    href CDATA #REQUIRED
>
<!ATTLIST entity
    href CDATA #REQUIRED
>

Example of Resource

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE value SYSTEM "http://tech-ada.utt.fr/validator/dtd/resource.dtd">
  <resource name="original" href="http://tech-ada.utt.fr/resource.htm">
  <entity href="http://tech-ada.utt.fr/entity/JIGSAW/" />
</resource>

XML structure of Resource

XPath Cardinality Description
/resource/@name Required The name of resource
/resource/@href Required Resource URL.
/value/entity * Entities described by the resource.
/value/entity/@href Required Entity URI.

Get a Resource

Get a resource.

Arguments

resourceurl (Required)

The URL of resource which should be encode with RFC1738 encode.

Note: This method requires an HTTP GET request.

Example Request

To retrieve a resource which URL is "http://tech-ada.utt.fr/resource.htm".

GET /resource/http%3A%2F%2Ftech-ada.utt.fr%2Fresource.htm/

Example Response

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE value SYSTEM "http://tech-ada.utt.fr/validator/dtd/resource.dtd">
<resource href="http://tech-ada.utt.fr/resource.htm">
    <entity href="http://tech-ada.utt.fr/entity/JIGSAW/" />
</resource>

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.
Personal tools