http://www.intertwingly.net/wiki/pie/PaceCategoryListing2

Now With Actual Spec Text!


#pragma section-numbers off

== Abstract ==

Redo on PaceCategoryListing

== Status ==

Proposal

== Rationale ==

We need a way of enumerating available categories

== Proposal ==

7.1 Example

{{{
<?xml version="1.0" encoding='utf-8'?>
<service xmlns="http://purl.org/atom/app#";>
  <workspace title="Main Site" >
    <collection
      title="My Blog Entries"
      href="http://example.org/reilly/main"; >
      <member-type>entry</member-type>
      <categories fixed="yes">
        <atom:category
          scheme="http://example.org/categories/";
          term="foo" />
        <atom:category
          scheme="http://example.org/categories/";
          term="bar" />
      </categories>
    </collection>
    <collection
      title="Pictures"
      href="http://example.org/reilly/pic"; >
      <member-type>media</member-type>
    </collection>
  </workspace>
  <workspace title="Side Bar Blog">
    <collection title="Remaindered Links"
      href="http://example.org/reilly/list"; >
      <member-type>entry</member-type>
      <categories fixed="no" />
    </collection>
  </workspace>
</service>
}}}

This Introspection Document describes two workspaces. The first, called "Main Site", has two collections called "My Blog Entries" and "Pictures" whose IRIs are "http://example.org/reilly/main"; and "http://example.org/reilly/pic"; respectively. "My Blog Entries" is an Entry collection and "Pictures" is a Media collection. Entry and Media collections are discussed in Section 7.2.4.

The second workspace is called "Side Bar Blog" and has a single collection called "Remaindered Links" whose collection IRI is "http://example.org/reilly/list";. "Remaindered Links" is an Entry collection.

Within each of the two entry collections, the categories element provides a listing of available categories that may be specified for member entries. In the "My Blog Entries" collection, the list of available categories is a closed set, indicating that the server MAY NOT accept entries with categories other those listed. The "Side Bar Blog" collection specifies an open set of categories indicating that the server will accept any categories contained in the member entry.

7.2.2 The "app:workspace" Element

{modify element definition}

{{{appWorkspace =
  element app:workspace {
    appCommonAttributes,
    attribute title { text },
    ( appCollection+,
      appCategories?,
      & extensionElement* )
  }
}}}

{add to 7.2.2}

An app:categories element appearing as a child of app:workspace apply to all
contained app:collection elements that do not contain their own app:categories element.

7.2.3 The "app:collection" Element

The "app:collection" describes a collection. The app:collection element MUST contain one app:member-type element and MAY contain one app:categories element.

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

7.2.5

The "app:categories" element provides a listing of what categories may be applied
to the members of a collection.

{{{
appInlineCategories =
    element app:categories {
      attribute fixed { 'yes' | 'no' }?,
      (atomCategory*)
    }

  appOutOfLineCategories =
    element app:categories {
      attribute fixed { 'yes' | 'no' }?,
      attribute type { media-type }?,
      attribute href { atomURI },
      (empty)
    }

  appCategories = appInlineCategories | appOutOfLineCategories
}}}

The app:categories element MAY contain a "fixed" attribute, with a value of either "yes" or "no", indicating whether or not the listing of categories is considered to be a fixed, or closed set. Collections that indicate a fixed set MAY reject members that include categories not specified in the provided listing. Collections that indicate an open set SHOULD NOT reject otherwise acceptable members that include categories that are not specified in the provided listing.

The app:categories element MAY contain a "href" attribute, whose value MUST be an IRI reference. If the "href" attribute is provided, app:categories MUST be empty and the "type" attribute SHOULD be provided, the value of which MUST be a MIME media type.



== Impacts ==

== Notes ==


----

CategoryProposals

Reply via email to