ArcXPContentManager

class ArcXPContentManager

This class is responsible for dispensing content.

Content source may be from api or db depending on repository

This class has a restricted constructor, so use the instance provided by com.arcxp.ArcXPMobileSDK method com.arcxp.ArcXPMobileSDK.contentManager after initializing com.arcxp.ArcXPMobileSDK.

Each request method can either use ArcXPContentCallback parameter for result stream or use the return value LiveData and subscribe to result stream.

Functions

Link copied to clipboard
fun clearCache(): Job

clearCache removes all entries from database

Link copied to clipboard
fun deleteCollection(collectionAlias: String): Job
Link copied to clipboard
fun deleteItem(id: String): Job
Link copied to clipboard
fun getArcXPStory(    id: String,     listener: ArcXPContentCallback? = null,     shouldIgnoreCache: Boolean = false): LiveData<Either<ArcXPException, ArcXPStory>>

getArcXPStory This function requests a story / article result by ANS ID

Link copied to clipboard
suspend fun getArcXPStorySuspend(id: String, shouldIgnoreCache: Boolean = false): Either<ArcXPException, ArcXPStory>

getArcXPStorySuspend This function requests a story / article result by ANS ID

Link copied to clipboard
fun getCollection(    collectionAlias: String,     listener: ArcXPContentCallback? = null,     shouldIgnoreCache: Boolean = false,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE,     preLoading: Boolean? = null): LiveData<Either<ArcXPException, Map<Int, ArcXPContentElement>>>

This function requests a collection result by content alias

Link copied to clipboard
fun getCollectionAsJson(    collectionAlias: String,     listener: ArcXPContentCallback? = null,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE,     preLoading: Boolean? = null): LiveData<Either<ArcXPException, String>>

This function requests a collection result by content alias as a json string

Link copied to clipboard
suspend fun getCollectionAsJsonSuspend(    collectionAlias: String,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE,     shouldIgnoreCache: Boolean = false,     preLoading: Boolean? = null): Either<ArcXPException, String>

getCollectionAsJsonSuspend - request collection by content alias Note this should be a troubleshooting function, does not use cache

Link copied to clipboard
suspend fun getCollectionSuspend(    collectionAlias: String,     shouldIgnoreCache: Boolean = false,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE,     preLoading: Boolean? = null): Either<ArcXPException, Map<Int, ArcXPContentElement>>

getCollectionSuspend this suspend function requests a collection result by content alias

Link copied to clipboard
fun getContentAsJson(    id: String,     shouldIgnoreCache: Boolean = false,     listener: ArcXPContentCallback? = null): LiveData<Either<ArcXPException, String>>

getContentAsJson This function requests a result by ANS ID as a json string

Link copied to clipboard
suspend fun getContentAsJsonSuspend(id: String, shouldIgnoreCache: Boolean = false): Either<ArcXPException, String>

getContentAsJsonSuspend - request content element as JSON by ANS id Note this should be a troubleshooting function, does not use cache

Link copied to clipboard
suspend fun getContentSuspend(id: String, shouldIgnoreCache: Boolean = false): Either<ArcXPException, ArcXPContentElement>

getContentSuspend This suspend function requests an ans result by id

Link copied to clipboard
fun getGallery(    id: String,     listener: ArcXPContentCallback? = null,     shouldIgnoreCache: Boolean = false): LiveData<Either<ArcXPException, ArcXPContentElement>>

This function requests a gallery result by ANS ID

Link copied to clipboard
fun getSectionList(    siteHierarchy: String,     listener: ArcXPContentCallback? = null,     shouldIgnoreCache: Boolean = false): LiveData<Either<ArcXPException, List<ArcXPSection>>>

This function requests list of section headers that are used for navigation It is expected these correlate with existing collections

Link copied to clipboard
fun getSectionListAsJson(    siteHierarchy: String,     listener: ArcXPContentCallback? = null,     shouldIgnoreCache: Boolean = false): LiveData<Either<ArcXPException, String>>

This function requests list of section headers as a json string that are used for navigation It is expected these correlate with existing collections

Link copied to clipboard
suspend fun getSectionListAsJsonSuspend(siteHierarchy: String, shouldIgnoreCache: Boolean = false): Either<ArcXPException, String>

getSectionListAsJsonSuspend - request section lists / navigation

Link copied to clipboard
suspend fun getSectionListSuspend(siteHierarchy: String, shouldIgnoreCache: Boolean = false): Either<ArcXPException, List<ArcXPSection>>

getSectionListSuspend This suspend function requests list of section headers that are used for navigation It is expected these results correlate with existing collections for subsequent requests

Link copied to clipboard
fun getVideo(    id: String,     listener: ArcXPContentCallback? = null,     shouldIgnoreCache: Boolean = false): LiveData<Either<ArcXPException, ArcXPContentElement>>

This function requests a video result by ANS ID

Link copied to clipboard
fun search(    searchTerm: String,     listener: ArcXPContentCallback? = null,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): LiveData<Either<ArcXPException, Map<Int, ArcXPContentElement>>>
fun search(    searchTerms: List<String>,     listener: ArcXPContentCallback? = null,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): LiveData<Either<ArcXPException, Map<Int, ArcXPContentElement>>>

This function requests a search to be performed by search Term (keyword/tag based on resolver setup default is tag(used in example app)) note: cache is not used for search, but if you open item it will be cached

Link copied to clipboard
fun searchAsJson(    searchTerm: String,     listener: ArcXPContentCallback? = null,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): LiveData<Either<ArcXPException, String>>
fun searchAsJson(    searchTerms: List<String>,     listener: ArcXPContentCallback? = null,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): LiveData<Either<ArcXPException, String>>

This function requests a search to be performed by search Term (keyword/tag based on resolver setup default is tag(used in example app)) note: cache is not used for search, but if you open item it will be cached

Link copied to clipboard
suspend fun searchAsJsonSuspend(    searchTerm: String,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): Either<ArcXPException, String>

searchAsJsonSuspendThis function requests a search to be performed by search Term (keyword/tag based on resolver setup default is tag(used in example app)) note: cache is not used for search, but if you open item it will be cached

suspend fun searchAsJsonSuspend(    searchTerms: List<String>,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): Either<ArcXPException, String>

searchAsJsonSuspend this function requests a search to be performed by search Term (keyword/tag based on resolver setup default is tag(used in example app)) note: cache is not used for search, but if you open item it will be cached

Link copied to clipboard
suspend fun searchSuspend(    searchTerm: String,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): Either<ArcXPException, Map<Int, ArcXPContentElement>>
suspend fun searchSuspend(    searchTerms: List<String>,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): Either<ArcXPException, Map<Int, ArcXPContentElement>>

searchSuspend requests a search to be performed by search Term (keyword/tag based on resolver setup default is tag(used in example app)) note: cache is not used for search, but if you open item it will be cached

Link copied to clipboard
fun searchVideos(    searchTerm: String,     listener: ArcXPContentCallback? = null,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): LiveData<Either<ArcXPException, Map<Int, ArcXPContentElement>>>
fun searchVideos(    searchTerms: List<String>,     listener: ArcXPContentCallback? = null,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): LiveData<Either<ArcXPException, Map<Int, ArcXPContentElement>>>

This function requests a search to be performed by search Term (keyword/tag based on resolver setup default is tag(used in example app)) note: cache is not used for search, but if you open item it will be cached

Link copied to clipboard
suspend fun searchVideosSuspend(    searchTerm: String,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): Either<ArcXPException, Map<Int, ArcXPContentElement>>

searchVideosSuspend requests a search to be performed by search Term (keyword/tag based on resolver setup default is tag(used in example app))

suspend fun searchVideosSuspend(    searchTerms: List<String>,     from: Int = 0,     size: Int = DEFAULT_PAGINATION_SIZE): Either<ArcXPException, Map<Int, ArcXPContentElement>>

searchVideosSuspend requests a search to be performed by search Term (keyword/tag based on resolver setup default is tag(used in example app)) note: cache is not used for search, but if you open item it will be cached

Properties

Link copied to clipboard

collectionLiveData subscribe to this for ordered list of collection with their server index (WebSked order) in list as key (getCollection returns this additionally)

Link copied to clipboard

contentLiveData subscribe to this for generic content element results for search / section lists (getVideo, getGallery return this additionally)

Link copied to clipboard
val jsonLiveData: LiveData<Either<ArcXPException, String>>

jsonLiveData subscribe to this for all raw json results as string ( -AsJson methods return this additionally)

Link copied to clipboard

searchLiveData subscribe to this for ordered list of collection with their server index (search result order) in list as key (search, searchVideo returns this additionally)

Link copied to clipboard

sectionListLiveData subscribe to this for navigation list from server in list as key (getSectionList returns this additionally)

Link copied to clipboard
val storyLiveData: LiveData<Either<ArcXPException, ArcXPStory>>

storyLiveData subscribe to this for story element results (getStory returns this additionally)