public interface

KnowledgeUIClient

com.salesforce.android.knowledge.ui.KnowledgeUIClient

Class Overview

A KnowledgeUIClient is used to launch and control the Knowledge UI. Applications should instantiate an instance of this client using createClient(Context), which may then be used to launch Knowledge UI by calling launchHome(Activity).

Listeners can be registered with the client to react to events that occur, for example using addOnCloseListener(OnCloseListener) to detect when the user has left Knowledge UI.

Instances should not be re-used after the KnowledgeUIClient.OnCloseListener has been invoked. Applications wishing to re-launch Knowledge UI should instantiate a new client instance for each launch.

Launching multiple concurrent instances of Knowledge UI is not supported. It is the application's responsibility to ensure that it does not instantiate multiple KnowledgeUIClient instances concurrently.

Summary

Nested Classes
interface KnowledgeUIClient.OnCloseListener Interface for handling the event where the user has closed the Knowledge UI. 
Public Methods
abstract void addOnCloseListener(KnowledgeUIClient.OnCloseListener onCloseListener)
Register an KnowledgeUIClient.OnCloseListener implementation with the client.
abstract void close()
Close the UI.
abstract KnowledgeUIConfiguration getConfiguration()
Retrieve the KnowledgeUIConfiguration that was used to instantiate this client.
abstract KnowledgeCssProvider getCssProvider()
Get the KnowledgeCssProvider instance the Knowledge UI Client is using to load custom CSS into Knowledge articles.
abstract KnowledgeImageProvider getImageProvider()
Get the KnowledgeImageProvider instance the Knowledge UI Client is using to load images.
abstract KnowledgeJsProvider getJsProvider()
Get the KnowledgeJsProvider instance the Knowledge UI Client is using to load custom JavaScript into Knowledge articles.
abstract KnowledgeClient getKnowledgeCoreClient()
Get the KnowledgeClient that the Knowledge UI Client is using to perform asynchronous data requests.
abstract void launchArticle(Activity activity, ArticleSummary articleSummary)
Launch the Knowledge UI Activity, if it is not already started, and load SCENE_ARTICLE_DETAIL.
abstract void launchHome(Activity activity)
Launch the Knowledge UI Activity, if it is not already started, and load SCENE_HOME.
abstract void removeOnCloseListener(KnowledgeUIClient.OnCloseListener onCloseListener)
Remove a previously-added KnowledgeUIClient.OnCloseListener.

Public Methods

public abstract void addOnCloseListener (KnowledgeUIClient.OnCloseListener onCloseListener)

Register an KnowledgeUIClient.OnCloseListener implementation with the client. Does nothing if the listener has already been added.

Parameters
onCloseListener The listener that will be called when Knowledge UI is closed.

public abstract void close ()

Close the UI. This will finish the Knowledge UI and return control to the application.

public abstract KnowledgeUIConfiguration getConfiguration ()

Retrieve the KnowledgeUIConfiguration that was used to instantiate this client.

Returns
  • The configuration instance.

public abstract KnowledgeCssProvider getCssProvider ()

Get the KnowledgeCssProvider instance the Knowledge UI Client is using to load custom CSS into Knowledge articles.

Returns

public abstract KnowledgeImageProvider getImageProvider ()

Get the KnowledgeImageProvider instance the Knowledge UI Client is using to load images.

Returns

public abstract KnowledgeJsProvider getJsProvider ()

Get the KnowledgeJsProvider instance the Knowledge UI Client is using to load custom JavaScript into Knowledge articles.

Returns

public abstract KnowledgeClient getKnowledgeCoreClient ()

Get the KnowledgeClient that the Knowledge UI Client is using to perform asynchronous data requests.

Returns

public abstract void launchArticle (Activity activity, ArticleSummary articleSummary)

Launch the Knowledge UI Activity, if it is not already started, and load SCENE_ARTICLE_DETAIL. ArticleSummary instances can be obtained by submitting a query via ArticleListRequest.

Parameters
activity An Activity instance.
articleSummary An ArticleSummary instance.

public abstract void launchHome (Activity activity)

Launch the Knowledge UI Activity, if it is not already started, and load SCENE_HOME.

Parameters
activity An Activity instance.

public abstract void removeOnCloseListener (KnowledgeUIClient.OnCloseListener onCloseListener)

Remove a previously-added KnowledgeUIClient.OnCloseListener. Does nothing if the listener has not already been added.

Parameters
onCloseListener The listener to remove.