This WG has debated metadata in the introspection doc before relating to what types of content the server will accept. This weeks interop discussions have highlighted the fact that we already have mismatches between server implementations that will accept or reject various content variations. This pace requires that a server either accept everything that is given to it or declare exactly what it will accept up front.

#pragma section-numbers off

== Abstract ==

Adds a means of identifying the types of Text Constructs and Content that an Entry Collection allows.

== Status ==

Open (JoeGregorio & JamesSnell)

== Rationale ==

There is currently no method for a client to discover
what Text Constructs a server supports. This causes
interop problems. See the discussions around the
following:

 * http://www.imc.org/atom-protocol/mail-archive/msg04052.html
 * http://www.imc.org/atom-protocol/mail-archive/msg04268.html
 * http://www.imc.org/atom-protocol/mail-archive/msg04055.html

== Proposal ==

Add {{{accepted-text}}} and {{{accepted-content}}} elements to the {{{app:collection}}} element in Introspection Documents.

{{{
appCollection =
   element app:collection {
      appCommonAttributes,
      attribute title { text },
      attribute href { text },
      ( appMemberType,
        appAcceptedText?,
        appAcceptedContent?,
        & extensionElement* )
   }
}}}

{{{
7.2.3.X The 'accepted-text' element

The 'accepted-text' element is used to specify a subset of Text Construct
types a server is willing to accept in a POST or PUT operation. The value of
the element is a comma separated list of Text Construct types.  If no
'accepted-text' element is present, then it is assumed that the server
accepts entries with any type of Text Construct. A collection MUST NOT
reject an entry based solely on the type of a Text Construct if the type
is listed in 'accepted-text'.

(ed. note: I have zero clue how to represent a comma separated list of fixed
values using the relaxng style)

  atomTextType = ('text' | 'html' | 'xhtml' )
  appAcceptedText = element app:accepted-text {
    (atomTextType [, atomTextType]*)
  }

For example, if a collection does not support Text Constructs that are 'xhtml', then it would include an 'accepted-text' element listing only 'text' and 'html'.

  <collection title="My blog entries"
    href="http://example.org/reilly/main";>
    <member-type>entry</member-type>
    <accepted-text>text, html</accepted-text>
  </collection>

7.2.3.X The 'accepted-content' element

The 'accepted-content' element is used to specify a subset of Content types a server is willing to accept in a POST or PUT operation. The value of the element is a comma separated list of Content types, including MIME media-types and MIME media-ranges. If no 'accepted-content' element is present, then it is assumed that the server accepts entries with any Content type. A collection MUST NOT reject an entry based solely on the type of its Content if the type is listed
in 'accepted-content'.


  atomContentType = ('text' | 'html' | 'xhtml' | media-type | media-range )
  appAcceptedContent = element app:accepted-content {
    attribute allowsrc ( 'yes' | 'no')?,
    (atomContentType [, atomContentType]*)
  }

The 'accepted-content' element MAY contain an 'allowsrc' attribute, with a value of either 'yes' or 'no', indicating whether or not content elements with the src attribute will be accepted. If the 'allowsrc' attribute is missing, the
value is considered to be 'yes'.

For example, if a collection does not support any content other than 'text', 'html', 'xhtml' and Base64 encoded image files, it would include an 'accepted-content'
element listing each of the accepted types.

  <collection title="My blog entries"
    href="http://example.org/reilly/main";>
    <member-type>entry</member-type>
<accepted-content allowsrc="no">text, html, xhtml, image/*</accepted-content>
  </collection>
}}}

== Impacts ==

== Example ==

{{{
  <!-- text only titles and summary, text/html/xhtml in the content -->
  <collection title="My Entries" href="...">
    <member-type>entry</member-type>
    <accepted-type>text</accepted-type>
    <accepted-content>text, html, xhtml</accepted-content>
  </collection>
}}}

== Notes ==

References copied from ThomasBroyer's PaceCollectionsAcceptedMediaTypes.

== References ==

* HTML4 forms' {{{accept}}} attribute: [http://www.w3.org/TR/html4/interact/forms.html#adef-accept] * XForms {{{upload}}}'s {{{mediatype}}} attribute: [http://www.w3.org/TR/xforms/slice8.html#ui-upload]

----

CategoryProposals

Reply via email to