IDによるコレクション・アセットとその評価された結果の取得
重要な注意: これは、コレクション・リソースです。指定したコレクション・アセットの評価された結果はすべて、レスポンスのアイテム配列で提供されます。各結果も集約されたアセットです。そのため、すべての集約アセット問合せパラメータ(assetDepth、expand、fields、segments、profileName)はこのリソースにも適用されます。これらの集約アセット問合せパラメータは、アイテム配列の各結果に適用されます。集約アセットとその問合せパラメータの詳細は、「アセット・リソース・エンドポイント」を参照してください。
次の表に、クライアント・リクエストをまとめます。
| 名前 | 説明 | 形式 |
|---|---|---|
| assetId | コレクション・アセットのID | 整数 double |
| collectionAssetType | コレクション・アセット・タイプの名前 | 文字列 |
| siteName | サイトの名前 | 文字列 |
| 名前 | 説明 | 形式 |
|---|---|---|
| assetDepth | このパラメータの詳細は、「アセット・リソース・エンドポイント」の'assetDepth'問合せパラメータを参照してください。アイテム配列の各結果に適用されます。 | 数値 |
| expand | assetTypeのカンマ区切りのリストを受け入れます。このパラメータの詳細は、「アセット・リソース・エンドポイント」の'expand'問合せパラメータを参照してください。アイテム配列の各結果に適用されます。 | 文字列 |
| fields | このパラメータの詳細は、「アセット・リソース・エンドポイント」の'fields'問合せパラメータを参照してください。アイテム配列の各結果に適用されます。 | 文字列 |
| limit | 返されるアイテムの合計数を指定します。 | 数値 |
| links | リンク名のカンマ区切りのリストを受け入れます。デフォルトでは、このパラメータですべてのリンク(next、prev、first、last、schema、selfおよびcanonicalリソース)が返されます。 | 文字列 |
| offset | 結果を返す開始地点となる開始索引を指定します。 | 数値 |
| profileName | このパラメータの詳細は、「アセット・リソース」の'profileName'問合せパラメータを参照してください。アイテム配列の各結果に適用されます。 | 文字列 |
| segments | これについては、「アセット・リソース」の'segments'問合せパラメータを参照してください。アイテム配列の各結果に適用されます。 | 文字列 |
| totalResults | ブール値を受け入れます。trueに設定すると、レスポンスに結果総数フィールドが表示されます。デフォルトはfalseです。 | ブール |
次の表に、サーバー・レスポンスをまとめます。
- application/json
200レスポンス
例1
次の例に、cURLを使用してRESTリソースに対するGETリクエストを送信し、WebCenter Sitesでavisportsサンプル・サイト下のIDが1395380847207のContentQueryの最初の4つのAVIArticle名を取得する方法を示します。
REST URLで、describedbyリンクのみを返すことも指定します。
問合せパラメータの詳細:
"limit=4": 最初の4つの結果。'offset'が指定されていないため、デフォルトは0です。
"assetDepth=0&fields=name&expand=AVIArticle": 結果(AVIArticles)はすべて'items'配列で提供されます。各アイテム(AVIArticle)は集約されたアセットであるため、そのアイテムのルート・アセットです。そのルート・アセット - AVIArticleの名前のみ必要です。
"links=describedby": describedbyリンクのみ表示されます。
curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ContentQuery/1395380847207/items?limit=4&assetDepth=0&fields=name&expand=AVIArticle&links=describedby"
例1 レスポンス・ヘッダー
次の例に、レスポンス・ヘッダーを示します。
HTTP/1.1 200 OK ETag: "9f4bca655ec8f44549cebba1c5e5351c732a38f7320692b76c5a4bad8c0fd8c0" Cache-Control: max-age=0 Content-Type: application/json;charset=utf-8
例1 レスポンス本文
次の例に、JSON形式のレスポンス本文のコンテンツを示します。
{
"offset": 0,
"limit": 50,
"count": 4,
"hasMore": true,
"links": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/metadata-catalog/aggregates/avisports/ContentQuery/1395380847207/items",
"rel": "describedby",
"templated": false,
"mediaType": "application/schema+json",
"method": "GET",
"profile": ""
}
],
"items": [
{
"AVIArticle:1328196047241": {
"name": "Veteran Skier Says Goodbye",
"parents": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208",
"rel": "assetReference",
"templated": false,
"mediaType": "",
"method": "GET",
"profile": ""
}
]
},
"start": "AVIArticle:1328196047241"
},
{
"start": "AVIArticle:1328196047309",
"AVIArticle:1328196047309": {
"name": "Rookie Skier Makes Her Mark ",
"parents": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208",
"rel": "assetReference",
"templated": false,
"mediaType": "",
"method": "GET",
"profile": ""
}
]
}
},
{
"start": "AVIArticle:1328196047338",
"AVIArticle:1328196047338": {
"name": "25 Nevada Resorts Serving Snow",
"parents": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208",
"rel": "assetReference",
"templated": false,
"mediaType": "",
"method": "GET",
"profile": ""
}
]
}
},
{
"AVIArticle:1328196047367": {
"name": "Ski Castle and Snowboard Wizards Unite ",
"parents": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208",
"rel": "assetReference",
"templated": false,
"mediaType": "",
"method": "GET",
"profile": ""
}
]
},
"start": "AVIArticle:1328196047367"
}
]
}
例2
次の例に、cURLを使用してRESTリソースに対するGETリクエストを送信し、WebCenter Sitesでavisportsサンプル・サイトのIDが1395380847207のContentQueryの最初の2つのAVIArticle名とそのrelatedImage名を取得する方法を示します。
REST URLで、nextリンクのみを返すことも指定します。
問合せパラメータの詳細:
"offset=0&limit=2": 最初の2つの結果。
注意: 結果(AVIArticles)はすべて'items'配列で提供されます。各アイテム(AVIArticle)は、集約されたアセットです。
"assetDepth=1": 深さ1のrelatedImageアセットの詳細も必要であるため、深さ1までの各アイテムの集約アセット・データが必要です。
"fields=name,relatedImage;AVIImage(name)": (1) ルート・アセット(AVIArticle:1328196047241)のnameおよびrelatedImage属性および(2) relatedImageアセットのname属性が必要です。
"expand=AVIArticle,AVIImage": 各アイテムでタイプAVIArticleのルート・アセットとタイプAVIImageのそのrelatedImageアセットのみが必要です。
"links=next": nextリンクのみ表示されます。
curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ContentQuery/1395380847207/items?offset=0&limit=2&assetDepth=1&fields=name,relatedImage;AVIImage(name)&expand=AVIArticle,AVIImage&links=next"
例2 レスポンス・ヘッダー
レスポンス・ヘッダーの例を次に示します。
HTTP/1.1 200 OK ETag: "3cb52510c786d128a15809407911f85d1dca06afe7cd228a122f3c39834e26f6" Cache-Control: max-age=0 Content-Type: application/json;charset=utf-8
例2 レスポンス本文
次の例に、JSON形式のレスポンス本文のコンテンツを示します。
{
"offset": 0,
"limit": 50,
"count": 2,
"hasMore": true,
"links": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ContentQuery/1395380847207/items?expand=AVIArticle,AVIImage&offset=2&limit=2&links=next&fields=name,relatedImage;AVIImage(name)&assetDepth=1",
"rel": "next",
"templated": false,
"mediaType": "",
"method": "",
"profile": ""
}
],
"items": [
{
"AVIImage:1327351719292": {
"name": "Yellow Skier",
"parents": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ImageCategory/1327351718428",
"rel": "assetReference",
"templated": false,
"mediaType": "",
"method": "GET",
"profile": ""
}
]
},
"AVIArticle:1328196047241": {
"name": "Veteran Skier Says Goodbye",
"relatedImage": {
"id": 1327351719292,
"type": "AVIImage"
},
"parents": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208",
"rel": "assetReference",
"templated": false,
"mediaType": "",
"method": "GET",
"profile": ""
}
]
},
"start": "AVIArticle:1328196047241"
},
{
"AVIImage:1328196052533": {
"name": "Female Snowboarder",
"parents": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ImageCategory/1327351718428",
"rel": "assetReference",
"templated": false,
"mediaType": "",
"method": "GET",
"profile": ""
}
]
},
"start": "AVIArticle:1328196047309",
"AVIArticle:1328196047309": {
"name": "Rookie Skier Makes Her Mark ",
"relatedImage": {
"id": 1328196052533,
"type": "AVIImage"
},
"parents": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351719208",
"rel": "assetReference",
"templated": false,
"mediaType": "",
"method": "GET",
"profile": ""
}
]
}
}
]
}