Skip to content

Plugin Instances

Daniel Hindi edited this page Sep 15, 2015 · 9 revisions

#buildfire.pluginInstance

This is an object within the buildfire singleton that is for retrieving other plugins instances that are added to the current app context.

What is a plugin instance?

a plugin instance is a new occurrence of a plugin type. For example you can have installed one Text Plugin but have two instances of it.

Typically this is used in launcher or folder type plugins. These types of plugins help the user navigate to other plugins.

  • Gotchya: Be careful when saving the plugin instances data to your local datastore. The instance may be deleted or modified after your save. Use Dynamic Data Injection to get latest data

Methods

buildfire.pluginInstance.showDialog(options, callback)

Used typically on the control side. This method will display a dialog that allows the user to search and select one or many plugins

  • options is an object that consists of the following properties
    • prop1 : property description
    • prop1 : property description
  • callback is a function that is called when the dialog is complete

example

buildfire.pluginInstance.showDialog({
    prop1:""
},function(instances){

});

buildfire.pluginInstance.get(ids, callback)

Will fetch a list of plugins based on the list of ids that were passed in

  • ids an array of strings representing plugin instance ids
  • callback is a function that is called with the results

example

buildfire.pluginInstance.get(['123','321'],function(instances){

});

buildfire.pluginInstance.search(options, callback)

Will search all the plugins and return results paginated

  • options an object dictating the search criteria
    • title : string that will be regex'ed on title
    • pageIndex : integer that start with page zero
    • pageSize : max size of 20
  • callback is a function that is called with the results

example

buildfire.pluginInstance.search({},function(instances){

});

Clone this wiki locally