STWTemplateManager

open class STWTemplateManager
STWTemplateManager

Public Class that manages all operations concerning My Business templates in the Application. The templates are grouped by categories.

This class offers several possible operations defined in the following list:

  • Get all template categories
  • Get the full template list
  • Get the list of templates of defined category
  • Get recent used templates
  • Add/Remove template to/from favorite templates
  • Get the list of favorite templates
  • Get the template icon
  • Register a listener to handle all update events

Functions

Link copied to clipboard
open fun addTemplateToFavorite(    @NonNull context: Context,     @NonNull templateUuid: String,     @Nullable callback: STWOperationCallback)
Adds a template to the list of favorite templates.
Link copied to clipboard
open fun changeTemplateFavoriteListOrder(    @NonNull context: Context,     @NonNull sortedList: List<TemplateItem>,     @Nullable callback: STWOperationCallback)
Changes the order of favorite list.
Link copied to clipboard
open fun downloadTemplatePreview(@Nullable templateUuid: String, @Nullable callback: STWOperationCallback<MyBusinessError>)
Downloads the template preview for the given template UUID.
Link copied to clipboard
open fun geTemplateIcon(@NonNull iconName: String, iconType: Int): Bitmap
Gets the template icon as Bitmap.
Link copied to clipboard
open fun getFavoriteTemplateList(@NonNull context: Context): List<TemplateItem>
Gets the list of user favorite templates.
Link copied to clipboard
open fun getInstance(): STWTemplateManager
Get or create the single instance of STWTemplateManager.
Link copied to clipboard
open fun getRecentUsedTemplates(@NonNull context: Context): List<TemplateItem>
Gets the list of templates recently used to create processes.
Link copied to clipboard
open fun getTemplateByName(@NonNull context: Context, @NonNull templateName: String): TemplateItem
Gets a template having the given template name.
Link copied to clipboard
open fun getTemplateCategoryByName(@NonNull context: Context, @NonNull categoryName: String): TemplateCategoryItem
Gets a template category having the given categoryName.
Link copied to clipboard
open fun getTemplateCategoryByUUID(@NonNull context: Context, @NonNull categoryUUID: String): TemplateCategoryItem
Gets a template category having the given categoryUUID.
Link copied to clipboard
open fun getTemplateCategoryList(@NonNull context: Context): List<TemplateCategoryItem>
Gets the list of Template Categories sorted by name
Link copied to clipboard
open fun getTemplateList(    @NonNull context: Context,     @NonNull categoryUUID: String,     @Nullable searchKeyword: String): List<TemplateItem>
Gets the list of templates that belongs to given category, and matching the keyword.
Link copied to clipboard
open fun isTemplateAvailable(@NonNull context: Context, @NonNull templateUuid: String): Boolean
Checks the availability of template.
Link copied to clipboard
open fun registerFavoriteListListener(@NonNull listener: STWFavoriteListUpdateListener)
Register a listener to handle all events of favorite template list updates.
Link copied to clipboard
open fun registerTemplateListListener(@NonNull listener: STWTemplateListUpdateListener)
Register a listener to handle all events of template list updates.
Link copied to clipboard
open fun removeTemplateFromFavorite(    @NonNull context: Context,     @NonNull templateUuid: String,     @Nullable callback: STWOperationCallback)
Removes a template from the list of favorite templates.
Link copied to clipboard
open fun unregisterFavoriteListListener(@NonNull listener: STWFavoriteListUpdateListener)
Unregister a previously registered listener of favorite list updates.
Link copied to clipboard
open fun unregisterTemplateListListener(@NonNull listener: STWTemplateListUpdateListener)
Unregister a previously registered template update listener