Admin

Admin extensions allow sections to be placed in the admin pane that when clicked, open a custom component.

Tutorial

This tutorial registers three admin extensions that show React, Flight, and an admin extension that opens a link.

Create a web plugin

First, create the web plugin that registers the resources.

app.registerJavaScript("/org/visallo/examples/admin/plugin.js");

app.registerJavaScriptComponent("/org/visallo/examples/admin/React.jsx");
app.registerJavaScript("/org/visallo/examples/admin/flight.js", false);
app.registerJavaScriptTemplate("/org/visallo/examples/admin/flight-template.hbs");

app.registerResourceBundle("/org/visallo/examples/admin/messages.properties");

Register Extension

Register the admin extensions in the plugin.js file.

visallo.registry.registerExtension('org.visallo.admin', {
   section: i18n('org.visallo.examples.admin.section'),
   name: i18n('org.visallo.examples.admin.react.name'),
   subtitle: i18n('org.visallo.examples.admin.react.subtitle'),
   componentPath: 'org/visallo/examples/admin/React'
});

The other two are very similar except we had sortHint to "Open URL" so it is first.

options: {
    sortHint: 0
}

Notice we use the globally available i18n function to display strings. These are defined in messages.properties.

org.visallo.examples.admin.section=Examples
org.visallo.examples.admin.react.name=React
org.visallo.examples.admin.react.subtitle=React admin example

results matching ""

    No results matching ""