CRaSH Integration
Integrates CRaSH in XWiki |
Type | XAR |
Category | |
Developed by | Vincent Massol, Frédéric Bouquet |
Active Installs | 1 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
Integrates CRaSH into XWiki by allowing the following features:
- Run CRaSH inside XWiki to provide a shell for it
- Ability to start/stop CRaSH from the XWiki Admin UI
- Ability to add commands as wiki pages and to access XWiki script bindings
Start/Stop CRaSH
Connect using SSH
Before you can connect using SSH you'll need to edit XWiki's xwiki.properties and add 2 configuration variables (modify the username and password as you see fit!):
crash.auth.simple.password=admin
Then here's what you'll get connecting to XWiki's CRaSH instance:
Default XWiki Command
By default we provide an xwiki command (located in page Crash.XWikiCommand and you can use to run any XWQL query.
Examples:
- Return the list of all users in the wiki: xwiki xwql "from doc.object(XWiki.XWikiUsers) as user"
- Return the list of all pages containing CRaSH commands in the wiki: xwiki xwql "from doc.object(Crash.CrashCommandClass) as user"
For reference, here's the definition of this command:
class xwiki
{
@Usage("execute an XWQL query")
@Command
public String xwql(
@Usage("The XWQL query")
@Argument
String query)
{
context.attributes.services.query.xwql(query).setLimit(100).execute().each() {
out.println("- ${it}")
}
out.println("")
}
}
Adding a new Command
Create a page and add an Object of type Crash.CrashCommandClass. For example:
And here's what you get when you execute it from SSH:
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Dependencies
Dependencies for this extension (org.xwiki.contrib:application-crash-ui 1.0):
- org.xwiki.platform:xwiki-platform-administration-ui 5.0-rc-1
- org.xwiki.contrib:application-crash-api 1.0