1. Trang chủ >
  2. Công Nghệ Thông Tin >
  3. Quản trị mạng >

Appendix G. IETF Link Relations Internet Draft

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (7.09 MB, 242 trang )


www.it-ebooks.info



Internet-Drafts are draft documents valid for a maximum of six months

and may be updated, replaced, or obsoleted by other documents at any

time. It is inappropriate to use Internet-Drafts as reference

material or to cite them other than as "work in progress."

The list of current Internet-Drafts can be accessed at

http://www.ietf.org/ietf/1id-abstracts.txt.

The list of Internet-Draft Shadow Directories can be accessed at

http://www.ietf.org/shadow.html.

This Internet-Draft will expire on April 11, 2012.

Copyright Notice

Copyright (c) 2011 IETF Trust and the persons identified as the



Amundsen

Internet-Draft



Expires April 11, 2012

The Item and Collection Link Relations



document authors.



[Page 1]

October 2011



All rights reserved.



This document is subject to BCP 78 and the IETF Trust's Legal

Provisions Relating to IETF Documents

(http://trustee.ietf.org/license-info) in effect on the date of

publication of this document. Please review these documents

carefully, as they describe your rights and restrictions with respect

to this document. Code Components extracted from this document must

include Simplified BSD License text as described in Section 4.e of

the Trust Legal Provisions and are provided without warranty as

described in the BSD License.

1. Introduction

RFC 5988 [RFC5988] standardized a means of indicating the

relationships between resources on the Web. This specification

defines a pair of reciprocal link relation types that may be used to

express the relationship between a collection and its members.

These link relation types can be applied to a wide range of use cases

across multiple media types. For example, the 'collection' and

'item' link relation types are used in these media types:

1.



OpenSearch 1.1: see Section 4.5.4.1 of [OpenSearch]



2.



Maze+XML: see Section 3 of [Maze]



3.



Collection+JSON: see Section 5 of [CollectionJSON]



2. Link Relations



212 | Appendix G: IETF Link Relations Internet Draft



www.it-ebooks.info



The following link relations are defined.

2.1.



'item'



When included in a resource which represents a collection, the 'item'

link relation identifies a target resource that represents a member

of that collection.

For example, if a resource represents a catalog of products, that

same representation may include one or more links to resources which

represent members of that catalog.



Amundsen

Internet-Draft



Expires April 11, 2012



[Page 2]



The Item and Collection Link Relations



October 2011





...

Product Group X Listing



...

View Product X001

View Product X002

...



or, in the case of a Link Header field

Link: <...>; rel="item"; title="View Product X001"

Link: <...>; rel="item"; title="View Product X002"

2.2.



'collection'



When included in a resource which represents a member of a

collection, the 'collection' link relation identifies a target

resource that represents a collection of which the context resource

is a member.

For example, if a resource represents a single product in a catalog,

that same representation may include a link to a resource which

represents a product group to which this single product belongs:

Return to Product Group X

or, in the case of a Link Header field



IETF Link Relations Internet Draft | 213



www.it-ebooks.info



Link: <...>; rel="collection"; title="Return to Product Group X"

Since it is possible that a resource could be a member of multiple

collections, multiple 'collection' link relations may appear within

the same representation:

View other widgets

View all discontinued items

The target resource representation need not be restricted to

representing a list. It may simply be a document that provides

details on the collection of which the context resource is a member:

Link: <...>; rel="collection";

title="Shakespeare's Collected Works - A History"



Amundsen

Internet-Draft



Expires April 11, 2012

The Item and Collection Link Relations



[Page 3]

October 2011



3. IANA Considerations

IANA is asked to register the 'collection' and 'item' Link Relations

below as per [RFC5988].

3.1.



'item' Link Relation Registration



Relation Name:

item

Description:

The target IRI points to a resource that is a member of the

collection represented by the context IRI.

Reference:

See Section 2

3.2.



'collection' Link Relation Registration



Relation Name:

collection

Description:



214 | Appendix G: IETF Link Relations Internet Draft



www.it-ebooks.info



The target IRI points to a resource which represents a collection

of which the context IRI is a member.

Reference:

See Section 2

4. Security Considerations

The two link relation types defined in this document are not believed

to introduce any new security issues to those which are discussed in

Section 7 of RFC5988 [RFC5988].

5. Internationalisation Considerations

The 'item' and 'collection' link relation types do not have any

internationalization considerations other than those which are

discussed in Section 8 of RFC5988 [RFC5988].

6. References



Amundsen



Expires April 11, 2012



Internet-Draft

6.1.



The Item and Collection Link Relations



October 2011



Normative References



[RFC5988]

6.2.



[Page 4]



Nottingham, M., "Web Linking", RFC 5988,

October 2010.



Informative References



[OpenSearch]



Clinton, D., "Open Search 1.1", Work in Progress ,

March 2011,
Specifications/OpenSearch/1.1/>.



[Maze]



Amundsen, M., "Maze+XML - Format", Web Page ,

December 2010,

.



[CollectionJSON]



Amundsen, M., "Collection+JSON - Document Format",

Web Page , July 2011,
media-types/collection/format/>.



Appendix A.



Acknowledgements



The author gratefully acknowledges the contributions of Julian

Reschke and Mykyta Yevstifeyev.

Author's Address

Mike Amundsen



IETF Link Relations Internet Draft | 215



www.it-ebooks.info



EMail: mca@amundsen.com

URI:

http://amundsen.com



216 | Appendix G: IETF Link Relations Internet Draft



www.it-ebooks.info



APPENDIX H



Source Code, Software, and

Installation Notes



Below are notes on the source code contained in this book and the software used in its

preparation including some hints on installing CouchDB and Node.js on Ubuntu.



Source Code

A number of source code artifacts were produced in the writing of this book. These

include:















HTML5 markup

CSS documents

Client-side JavaScript files

Server-side JavaScript for Node.js

JavaScript for CouchDB

Bash scripts for installing the databases



All of these documents, along with any additional materials related to the book, can

be found by visiting the Hypermedia page at amundsen.com.



Prerequisites

The items below were installed to prep Ubuntu for CouchDB and Node.js.

These were installed via the command line:

sudo apt-get install curl

sudo apt-get install git

sudo apt-get pkg-config



The following were installed using Ubuntu’s Software Center:



217



www.it-ebooks.info



• python (2.6)

• GNU C++ Compiler

• libssl-dev



CouchDB

Installing CouchDB from the command line was very easy:

sudo apt-get install couchdb



To test the install, you can bring up your browser and open the Futon helper app:

http://localhost:5984/_utils/



You can run the CouchDB Test Suite from Futon if you wish. In my case, all tests passed

(using FF3.6), but a few scripts run long enough that FF popped up a dialog a few times

asking if I wanted to kill the script. I always answered “No” and let the tests continue.



Node.js

I used a script from the Node.js git site (https://gist.github.com/579814) called nodeand-npm-in-30-seconds.sh:

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc

. ~/.bashrc

mkdir ~/local

mkdir ~/node-latest-install

cd ~/node-latest-install

curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1

./configure --prefix=~/local

make install # ok, this step probably takes more than 30 seconds...

curl http://npmjs.org/install.sh | sh



For the record, despite the script’s name, it takes more than 30 seconds to build Node.js.

I also installed the following packages using npm:

npm install express

npm install ejs

npm install cradle



Cloud Services

I relied on a handful of cloud services throughout the writing, coding, and testing of

the contents of this book. I did this primarily as an experiment to see just how easily I

would be able to complete tasks while relying only on the cloud. I must say that I was

pleasantly surprised by the sophistication of available services and their overall reliability.

The following services were used in the creation of the book:

218 | Appendix H: Source Code, Software, and Installation Notes



Xem Thêm
Tải bản đầy đủ (.pdf) (242 trang)

×