JSDoc
Last updated
Last updated
This documentation is intended to help you create plugins for Datashare client. All methods currently exposed in the class are available to a global variable called datashare
.
Example
Class representing the core application with public methods for plugins.
Kind: global class Mixes: , , , , ,
instance
: Promise.<Object>
:
:
⇒ Plugin
: I18n
: VueRouter
: Vuex.Store
⇒ *
: Auth
: Object
: Api
: Vue
: VueWait
: String
⇒
⇒
⇒
⇒
⇒
⇒
⇒
⇒
⇒
⇒ VueCore
⇒ Promise.<Object>
⇒ Vue
⇒
⇒ Promise.<Object>
⇒ Promise
⇒ Promise
static
⇒
Create an application
api
Datashare api interface
mode
mode of authentication ('local' or 'server'
Get a promise that is resolved when the application is ready
Deprecated
The application core instance. Deprecated in favor or the core
property.
The application core instance
The Bootstrap Vue plugin instance.
The I18n instance
The VueRouter instance
The Vuex instance
The CorePlugin instance
The Auth module instance
The configuration object provided by Murmur
The Datashare api interface
The Vue app
The VueWait
Get current Datashare mode
Add a Vue plugin to the app
Plugin
Object
The actual Vue plugin class
options
Object
Option to pass to the plugin
Configure all default Vue plugins for this application
Configure vue-i18n plugin
Configure bootstrap-vue plugin
Configure vue-router plugin
Configure vuex plugin
Configure most common Vue plugins (Murmur, VueShortkey, VueScrollTo and VueCalendar)
Configure vue-wait plugin
Add a $core property to the instance's Vue
Build a VueCore instance with the current Core instance as parameter of the global properties.
Load settings from the server and instantiate most the application configuration.
Mount the instance's vue application
[selector]
String
#app
Query selector to the mounting point
Build a promise to be resolved when the application is configured.
Dispatch an event from the document root, passing the core application through event message.
name
String
Name of the event to fire
...args
Mixed
Additional params to pass to the event
Get the current signed user.
Get and update user definition in place
Get settings (both from the server settings and the current mode)
Append the given title to the page title
title
String
Title to append to the page
[suffix]
String
Datashare
Suffix to the title
Register a callback to an event using the EventBus singleton.
event
String
callback
*
Unregister a callback to an event using the EventBus singleton.
event
String
callback
*
Emit an event using the EventBus singleton.
event
String
payload
*
instantiate a Core class (useful for chaining usage or mapping)
...options
Mixed
Options to pass to the Core constructor
Mixin class extending the core to add helpers for components.
Kind: global mixin
Mixin class extending the core to add helpers for filters.
Kind: global mixin
Register a filter
...args
Mixed
Filter's params.
args.type
String
Type of the filter.
args.options
Object
Options to pass to the filter constructor.
args.options.name
String
Name of the filter.
args.options.key
String
Key of the filter. Typically ElasticSearch field name.
[args.options.icon]
String
Icon of the filter.
[args.options.isSearchable]
Boolean
false
Set if this filter should be searchable or not.
[args.options.alternativeSearch]
function
()=>{})
Set a function about how to transform query term before searching for it.
[args.options.order]
Number
Order of the filter. Will be added as last filter by default.
Unregister a filter
name
String
Name of the filter to unregister
Register a filter only for a specific project
name
String
Name of the project
...args
Mixed
Filter's options.
args.name
String
Name of the filter
args.type
String
Type of the filter.
args.options
Object
Options to pass to the filter constructor
Unregister a filter only for a specific project
name
String
Name of the project
name
String
Name of the filter
Mixin class extending the core to add helpers for hooks.
Kind: global mixin
Register a hook
...args
Mixed
Hook's options
args.name
String
Name of the hook
args.target
String
Target of the hook
args.order
Number
Priority of the hook
args.definition
Object
Options to pass to the hook constructor
Unregister a specific hook
name
String
Name of the hook
Unregister all hooks from a target
name
String
Name of the target
Unregister all hooks, on every targets
Register a hook for a specific project
project
String
Project to add this hook to
options
Object
Hook's options
options.name
String
Name of the hook
options.target
String
Target of the hook
options.order
Number
Priority of the hook
options.definition
Object
Options to pass to the hook constructor
Mixin class extending the core to add helpers for i18n.
Kind: global mixin
Initialize i18N using the local storage and load the necessary locale's messages
Set the active locale both in local stoage and VueI18n.
locale
String
Key of the local (fr, de, en, ja, ...)
Check the given locale storage was loaded.
locale
String
Key of the local (fr, de, en, ja, ...)
Load i18n messages for the given locale (if needed) and set it as the current locale.
locale
String
Key of the local (fr, de, en, ja, ...)
Mixin class extending the core to add helpers for pipelines.
Kind: global mixin
Register a pipeline
...args
Mixed
Pipeline's options.
args.name
String
Name of the pipeline
args.type
String | function
Type of the pipeline.
category
String
The pipeline to target
Unregister a pipeline
name
String
Name of the pipeline
Register a pipeline for a specific project
project
String
Name of the project
...args
Mixed
Pipeline's options.
args.name
String
Name of the pipeline
args.type
String | function
Type of the pipeline.
category
String
The pipeline to target
Unregister a pipeline for a specific project
project
String
Name of the project
name
String
Name of the pipeline
Mixin class extending the core to add helpers for projects.
Kind: global mixin
Call a function when a project is selected
name
String
Name of the project
withFn
function
Function to call when the project is selected
withoutFn
function
Function to call when the project is unselected
mutationType
String
Mutation type that will be watched for changes.
storePath
String
Path to the project in the store
Create a default project on Datashare using the API
Mixin class extending the core to add helpers for widgets.
Kind: global mixin
Register a widget
...args
Mixed
Widget's options passed to widget constructor
args.name
String
Name of the widget
args.card
Boolean
Either or not this widget should be a card
component from Boostrap.
args.cols
Number
Number of columns to fill in the grid (from 1 to 12)
[args.type]
String
WidgetEmpty
Type of the widget
Unregister a widget
name
String
Name of the widget to unregister
Unregister all widgets
Register a widget for a specific project
project
String
Name of the project to add this widget to
options
Object
Widget's options passed to widget constructor
options.name
String
Name of the widget
options.card
Boolean
Either or not this widget should be a card
component from Boostrap
options.cols
Number
Number of columns to fill in the grid (from 1 to 12)
[options.type]
String
WidgetEmpty
Type of the widget
Replace an existing widget
name
String
Name of the widget to replace
options
Object
Widget's options passed to widget constructor.
options.card
Boolean
Either or not this widget should be a card
component from Boostrap
options.cols
Number
Number of columns to fill in the grid (from 1 to 12)
[options.type]
String
WidgetEmpty
Type of the widget
Example
Replace an existing widget for a specific project
project
String
Name of the project to add this widget to
name
String
Name of the widget to replace
options
Object
Widget's options passed to widget constructor. Each widget class can define its own default values.
options.card
Boolean
Either or not this widget should be a card
component from Boostrap
options.cols
Number
Number of columns to fill in the grid (from 1 to 12)
[options.type]
String
WidgetEmpty
Type of the widget
List all projects this user has access to.
Kind: global variable
List all projects name ids this user has access to.
Kind: global variable
Get the name of the default project
Kind: global variable
Asynchronously find a component in the lazyComponents object by its name.
Kind: global function Returns: Promise.<(object|null)> - - A promise that resolves with the found component object, or null if not found.
name
string
The name of the component to find.
Asynchronously get a component from the lazyComponents object based on its name.
Kind: global function Returns: Promise.<(object|Error)> - - A promise that resolves with the found component object, or rejects with an Error if not found.
name
string
The name of the component to retrieve.
Check if multiple component names are the same when slugified.
Kind: global function Returns: boolean - - True if all names are the same when slugified, false otherwise.
...names
string
The component names to compare.
Generate a slug from the component name using kebab case and lowercase.
Kind: global function Returns: string - - The slugified component name.
name
string
The name of the component to slugify.
Get the lazyComponents object using require.context for lazy loading of components.
Kind: global function Returns: Object - - The lazyComponents object generated using require.context.
Return true if the default project exists
Kind: global function
Retrieve a project by its name
Kind: global function Returns: Object - The project matching with this name
name
String
Name of the project to retrieve
Delete a project by it name identifier.
Kind: global function Returns: Promise:Integer - Index of the project deleted or -1 if project does not exist
name
String
Name of the project to retrieve
Delete a project from the search store
Kind: global function
name
String
Name of the project to delete fropm the store
Update a project in the list or add it if it doesn't exist yet.
Kind: global function Returns: Object - The project
project
Object
Kind: instance property of Fullfil: Object The actual application core instance.
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance method of Returns: - the current instance of Core
Kind: instance method of Returns: - the current instance of Core
Kind: instance method of Returns: - the current instance of Core
Kind: instance method of Returns: - the current instance of Core
Kind: instance method of Returns: - the current instance of Core
Kind: instance method of Returns: - the current instance of Core
Kind: instance method of Returns: - the current instance of Core
Kind: instance method of Returns: - the current instance of Core
Kind: instance method of Returns: - the current instance of Core
Kind: instance method of
Kind: instance method of Fullfil: - The instance of the core application Reject: Object - The Error object
Kind: instance method of Returns: Vue - The instantiated Vue
Kind: instance method of
Kind: instance method of Returns: - the current instance of Core
Kind: instance method of Fullfil: Object Current user
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: static method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
⇒ Promise
⇒ String
⇒ Boolean
⇒ Promise
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
⇒ Promise:Object
Kind: instance method of
Kind: instance method of Returns: Promise:Object - The HTTP response object
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of
Kind: instance method of