Backend Live - Javascript Commands
TODO
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
<dependency>
<groupId>info.magnolia.backendlive</groupId>
<artifactId>backend-live-commands</artifactId>
<version>1.0.1</version>
</dependency>
Installing to a Bundle
If you have an existing bundle, perhaps obtained by using the Magnolia CLI, you will need to add the modules as defined at Javascript Models 2.0, as well as its dependencies to each webapp’s /WEB-INF/lib
directories:
Using a standard Magnolia Bundle, these directories would be:
-
apache-tomcat/webapps/magnoliaAuthor/WEB-INF/lib/
-
apache-tomcat/webapps/magnoliaPublic/WEB-INF/lib/
Configuration
Make sure to follow the Configuration for Javascript Models 2.
You should already have exposed the cmsfn
Templating function to your Javascript projects, but if not, this is how the configuration should look in the Configuration
app:
Exposed Components can be considered "global", meaning that you do not reference them with this
, rather just cmsfn
. This will also apply to exposedComponents
you define for each definition, which we will explain later.
If you’d like a full list of the default exposeedComponents
and a description, you can click "Expand for More"
Expand for More
Component | Description |
---|---|
|
Navigate content and create links. |
|
Get assets and renditions and create links to assets. |
|
Get sites and themes. |
|
Get links to images from any workspace. |
|
Create links to css and js files by given patterns. |
|
Access REST clients. |
|
Search pages and content. |
|
Create site navigation. |
|
Get categories (tags) and access content by category. |
You are now ready to start writing your own custom Javascript component.
Usage
TODO
Samples
There are light-module samples for each of the projects found in our Backend-Live Samples repository.
Once you check out the project, you can simply copy the light-modules/backend-live-commands-lm
folder into your magnolia.resources.dir
location (defined in YOUR-WEB-APP/WEB-INF/config/default/magnolia.properties
).
If you are interested in a more complex demonstration, and tutorial on how to use multiple extensions in conjunction with each other, you may be interested in checking out our Backend Live Demo project.