XML iTunesフィードのレシピ構成の例
XML iTunesフィードのレシピ構成の例
この例では、iTunesのRSSタグ仕様に準拠したフィードのレシピ構成を示します。
フィード:
https://amzndevresources.com/fire-app-builder/feeds/feed1.xml
カテゴリーレシピ:
{
"cooker": "DynamicParser",
"format": "xml",
"model": "com.amazon.android.model.content.ContentContainer",
"translator": "ContentContainerTranslator",
"modelType": "array",
"query": "/rss/channel/item//*[name()='itunes:category']",
"queryResultType": "[]$",
"matchList": [
"#attributes/text@mName"
],
"keyDataType":"#attributes/text@keyDataPath"
}
コンテンツレシピ:
{
"cooker": "DynamicParser",
"format": "xml",
"model": "com.amazon.android.model.content.Content",
"translator": "ContentTranslator",
"modelType": "array",
"query": "//item[./*[name()='itunes:category'][@text='$$par0$$']]",
"matchList": [
"title/#text@mTitle",
"guid/#text@mId",
"description/#text@mDescription",
"enclosure/#attributes/url@mUrl",
"itunes:image/#attributes/href@mCardImageUrl",
"itunes:image/#attributes/href@mBackgroundImageUrl"
]
}
BasicFileBasedUrlGeneratorConfig.json:
{
"url_file": "urlFile_xmlfeed1.json"
}
urlFile_xmlfeed1.json
{
"urls": [
"https://amzndevresources.com/fire-app-builder/feeds/feed1.xml"
]
}
Navigator.java
...
public static final String NAVIGATOR_FILE = "Navigator_xmlfeed1.json";
...
Navigator_xmlfeed1.json
{
"config": {
"showRelatedContent": true,
"useCategoryAsDefaultRelatedContent": true,
"searchAlgo": "basic",
"enableCEA608": false,
"enableRecentRow": true,
"maxNumberOfRecentItems": 5
},
"branding": {
"globalTheme": "AppTheme",
"lightFont" : "Roboto Light",
"boldFont" : "Roboto Bold",
"regularFont" : "Roboto Regular"
},
"globalRecipes": [
{
"categories": {
"dataLoader": "recipes/xmlfeed1_DataLoaderRecipe0.json",
"dynamicParser": "recipes/xmlfeed1_CategoriesRecipe.json"
},
"contents": {
"dataLoader": "recipes/xmlfeed1_DataLoaderRecipe0.json",
"dynamicParser": "recipes/xmlfeed1_ContentsRecipe.json"
}
}
],
"graph": {
"com.amazon.android.tv.tenfoot.ui.activities.SplashActivity": {
"verifyScreenAccess": false,
"verifyNetworkConnection": true,
"onAction": "CONTENT_SPLASH_SCREEN"
},
"com.amazon.android.tv.tenfoot.ui.activities.ContentBrowseActivity": {
"verifyScreenAccess": false,
"verifyNetworkConnection": true,
"onAction": "CONTENT_HOME_SCREEN"
},
"com.amazon.android.tv.tenfoot.ui.activities.ContentDetailsActivity": {
"verifyScreenAccess": false,
"verifyNetworkConnection": true,
"onAction": "CONTENT_DETAILS_SCREEN"
},
"com.amazon.android.tv.tenfoot.ui.activities.ContentSearchActivity": {
"verifyScreenAccess": false,
"verifyNetworkConnection": true,
"onAction": "CONTENT_SEARCH_SCREEN"
},
"com.amazon.android.uamp.ui.PlaybackActivity": {
"verifyScreenAccess": false,
"verifyNetworkConnection": true,
"onAction": "CONTENT_RENDERER_SCREEN"
}
}
}
xmlfeed1_DataLoaderRecipe0.json
{
"task": "load_data",
"url_generator": {
"url_index": "0"
}
}
Last updated: 2018年8月3日