来自 CICS 的 Atom 订阅源的 URL

订阅源或集合中的 Atom 订阅源文档、集合和 Atom 条目文档包含可供 Web 客户机用于和文档进行交互的 URL(统一资源定位符)。 Each URL is provided in an <atom:link> element in the Atom document. An Atom document can have more than one <atom:link> element, and the rel attribute of the element, known as the link relation, specifies the purpose of the different URLs.

由 CICS 提供的 Atom 订阅源文档或集合最多可包含以下四类 URL:
  • 查找整个 Atom 订阅源或集合的 URL。 This feed URL is provided in an <atom:link rel="self" > element that is a child element of the <atom:feed> element. Web 客户机可以使用该 URL 从 Atom 订阅源或集合中获取包含多个条目的 Atom 订阅源文档。
  • 在订阅源或集合中查找各个 Atom 条目的个别 URL。 These entry URLs are provided in <atom:link rel="self" > elements that are child elements of the <atom:entry> element. Web 客户机可以使用这些 URL 从订阅源或集合中检索单个的 Atom 条目。
  • 编辑 URL,Web 客户机可使用这些 URL 来发出编辑集合的请求。 These URLs are provided in <atom:link rel="edit" > elements. CICS provides one editing URL for the whole of a collection, as a child element of the <atom:feed> element in the collection document, and individual editing URLs for each Atom entry in a collection, as child elements of the <atom:entry> elements. CICS also provides <atom:link rel="self" > URLs for collections and Atom entries in collections.
  • 导航 URL,Web 客户机可使用这些 URL 来检索 Atom 订阅源或集合中 Atom 条目的部分列表。 These URLs are provided in <atom:link> elements with rel attributes of "first", "previous", "next", and "last". 这些 URL 使 Web 客户机能够浏览整个 Atom 订阅源或集合,而无需一次检索所有 Atom 条目。 CICS provides an <atom:link rel="next"> element in Atom feed documents with a URL that web clients can use to retrieve the next window of Atom entries from the feed. In Atom documents that contain partial lists of entries from collections, CICS adds <atom:link> elements with rel attributes of "first", "previous", "next", and "last", to provide navigation to the other partial lists of Atom entries from the collection.

对于 Atom 订阅源,针对整个订阅源的 URL 通常是在因特网或公司的内部网中公布的。 当 Web 客户机通过使用订阅源 URL 获取 Atom 订阅源文档时,Atom 订阅源文档中的 Atom 条目将包含其自己的的单独 URL,并且 Web 客户机可以使用这些 URL 来检索单个的 Atom 条目。

对于包含可编辑 Atom 条目的集合,服务器可用的服务文档提供服务器中每个集合的编辑 URL。 Web 客户机可以使用这些 URL 之一查看集合中的 Atom 条目,并可以发出向集合添加更多条目的请求。 Web 客户机可针对单个 Atom 条目使用编辑 URL,以发出更新或删除该条目的请求。

Atom 联合格式允许使用国际资源标识 (IRI),IRI 允许使用适用于英语以外的其他本地语言的 Unicode 字符和格式。 您可以使用包含 Unicode 字符(作为 CICS 的 Atom 订阅源的资源定位符)的 IRI 来替换普通 URL。 在 Atom 联合格式和 Atom 发布协议的 RFC 中,针对 Atom 订阅源和 Atom 条目的资源定位符被称为 IRI。 国际化资源标识 (IRI) 说明 IRI 以及如何将其用于 Atom 订阅源。

如何指定和解析 Atom URL

In CICS, you use the <atom:link> child elements of the <atom:feed> and <atom:entry> elements in an Atom configuration file to specify a URL for the whole of the Atom feed or collection, and also a standard URL for the individual Atom entries. In the Atom configuration file you always specify <atom:link rel="self"> for these child elements, and when CICS sends out the Atom document, CICS adds an identical link in an <atom:link rel="edit" > element to collections and Atom entries in collections. 您可以省略 Atom 配置文件中的 URL 的方案和主机部分,而仅指定路径部分。 CICS 会在向客户机返回订阅源或条目文档时为 URL 添加方案和主机部分。

You do not need to specify any of the <atom:link> elements for navigation URLs, with rel attributes of "first", "previous", "next", and "last", in your Atom configuration file. CICS 会为您创建这些链接。

您为整个订阅源指定的 URL 和为个别条目指定的标准 URL 必须包含以相同方式开始的路径部分。 您可以在 CICS 用于处理针对 Atom 订阅源的 Web 客户机请求的 URIMAP 资源定义中指定路径部分的此公共部分,并使用星号来表明将对路径剩余部分进行路径匹配。 路径部分的公共部分是 CICS 用于标识 Atom 订阅源或集合的部分,因此该部分对于该 Atom 订阅源或集合(是通过指定主机名提供服务的所有 Atom 订阅源和集合的一部分)必须是唯一的。

当 Web 客户机使用包含路径部分的此公共部分的 URL 发出请求时,CICS 将查找匹配的 URIMAP 资源定义,并使用一些其他资源将该请求 URL 映射为 Atom 订阅源的数据。 图 1 显示了订阅源 URL 的以下过程:

图 1。 Atom 订阅源的请求 URL
该图显示请求 URL www.example.com/atom/cicsfile/filea,该 URL 映射到指定 PATH (atom/cicsfile/*) 和 USAGE (ATOM) 的 URIMAP 资源。 URIMAP 指定 ATOMSERVICE 资源。 The ATOMSERVICE resource locates an Atom configuration file that contains the tag <atom:link rel=“self” href=“/atom/cicsfile/filea”>, which is the URL for the Atom feed.
  • 要处理来自 Web 客户机的入站请求,您需要创建一个 URIMAP 资源定义,用于指定路径部分中由订阅源和条目 URL 共有的部分。 在本示例中,路径部分的公共部分是 atom/cicsfile/。 当 Web 客户机使用为 Atom 订阅源或集合或 Atom 条目定义的 URL 发出请求时,CICS 将查找与路径部分的公共部分匹配的 URIMAP 资源。 在本示例中,Web 客户机使用订阅源 URL www.example.com/atom/cicsfile/filea 请求 Atom 订阅源。
  • URIMAP 资源指定一个 ATOMSERVICE 资源,该 ATOMSERVICE 资源指定提供 Atom 订阅源的 Atom 配置文件、XML 绑定(XSDBIND 文件)和 CICS 资源。 例如,ATOMSERVICE 资源指定 FILEA 文件作为保存 Atom 条目数据的资源。
  • CICS uses the ATOMSERVICE resource to locate the Atom configuration file, and compares the path component of the inbound URL used by the web client to the URLs specified in all the <atom:link> elements in the Atom configuration file. When CICS finds a URL in an <atom:link> element that has a matching path component, it carries out the appropriate action, either returning the Atom feed or entry document or implementing the edit request. 在本示例中,由 Web 客户机使用的请求 URL 与为 Atom 配置文件的 Atom 订阅源指定的 URL 匹配,因此 CICS 必须返回一个 Atom 订阅源文档。
  • Atom 配置文件(如 ATOMSERVICE 资源)将指定 FILEA 文件作为保存 Atom 条目数据的资源。 如 针对来自 CICS的 Atom 订阅源的数据处理中所述, CICS 可以直接操作以从包含 Atom 条目数据的文件或临时存储器队列中抽取数据,或者将请求传递到服务例程。

In 图 1, the path for the URL for the whole Atom feed, as specified in the <atom:link> child element of the <atom:feed> element in the Atom configuration file, is /atom/cicsfile/filea. The <atom:entry> element in the Atom configuration file also has an <atom:link> child element, which contains the path /atom/cicsfile/entry. 这是 Atom 条目的标准路径。 针对 Atom 条目的此标准路径以路径部分的公共部分 atom/cicsfile/ 开始。 The remainder of the standard path for Atom entries must be different from the path for the Atom feed that is specified in the <atom:link> child element of the <atom:feed> element. CICS 使用该部分路径在 Atom 配置文件中进行路径匹配,以确定是否需要 Atom 订阅源文档或 Atom 条目文档。

图 2 显示了 CICS 如何处理来自 Web 客户机的单个 Atom 条目请求,并标识正确的 Atom 条目:
图 2。 针对 Atom 条目的请求 URL
该图显示请求 URL www.example.com/atom/cicsfile/entry/23,该 URL 映射到指定 PATH (atom/cicsfile/*) 和 USAGE (ATOM) 的 URIMAP 资源。 URIMAP 指定 ATOMSERVICE 资源。 The ATOMSERVICE resource locates an Atom configuration file that contains the tag <atom:link rel=“self” href=“/atom/cicsfile/entry”>, which is a prototype URL for Atom entries. 请求 URL 末尾的数字 23 用于查找 FILEA 文件中的记录号 23。
  • Web 客户机使用 URL www.example.com/atom/cicsfile/entry/23 请求单个 Atom 条目。 The web client obtained this URL from the <atom:link> child element for the Atom entry, which the web client originally received as part of an Atom feed document.
  • Atom 条目 URL 包含 Atom 订阅源的路径部分的公共部分 atom/cicsfile/,因此它可以由与 订阅源 URL 相同的 URIMAP 和 ATOMSERVICE 资源进行处理。 在本示例中,由 Web 客户机使用的请求 URL 与为 Atom 配置文件中的 Atom 条目指定的标准路径匹配,因此 CICS 必须返回一个 Atom 条目文档。
  • CICS 通过检查跟在标准路径后的请求 URL 的其余部分,识别要返回给 Web 客户机的 Atom 条目。 在本示例中,请求 URL 包含数字“23”。 这是条目的选择器值。 选择器值是一个标识,通常是一个数值,用于确定文件、临时存储器队列或其他包含 Atom 条目数据的资源中的记录。 在本示例中,为 Atom 条目选择的选择器值是记录号。 当选择了选择器值时,必须确保在附加了选择器值之后,针对整个 Atom 订阅源的 URL 和针对 Atom 条目的标准路径仍然不相同。 Atom 条目的选择器值 更详细地说明了如何选择和使用选择器值。

CICS also uses the selector value to build navigation links to partial lists of entries from the Atom feed or collection, in the <atom:link> elements with rel attributes of "first", "previous", "next", and "last". CICS 通过获取为整个 Atom 订阅源或集合指定的路径,并附加 Atom 条目显示在部分列表开头的选择器值,来构建这些导航链接。 CICS 将该信息与为 Atom 订阅源或集合指定的窗口设置一起使用,以向 Web 客户机返回部分列表。 在此处所使用的 Atom 订阅源示例中,对于以选择器值为“9”的 Atom 条目开始的条目部分列表,CICS 将创建链接 www.example.com/atom/cicsfile/filea/9

这些示例显示以缺省格式(称为“segment”格式)附加到 URL 的选择器值,在此格式中,选择器值将用作路径部分的最后一段。 或者,您可以选择一种与使用 CA8K SupportPac 开发的应用程序兼容的 URL 格式(针对 Atom 条目的选择器值位于查询字符串中)。 You can specify this alternative "query" format using the <cics:selector> element in the Atom configuration file. If <cics:selector style="query"/> is specified for the example Atom feed used here, CICS creates the links for individual Atom entries in the format www.example.com/atom/cicsfile/entry?s=23. 相同的格式也会用于导航链接。