You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

 

Aspire Shell


Aspire Shell is a Groovy driven console for configuring, testing, and executing any document processing tasks in Aspire.

Starting Up Aspire Shell


 

To start Aspire, execute the "aspiresh.sh" or "aspiresh.bat" script in the "bin" directory. 

Linux

Set your working directory to your Aspire distribution and then execute "bin/aspiresh.sh" (make sure it has execute permission for your user):

$ cd my-aspire/target/my-aspire-1.0-SNAPSHOT-distribution.dir
$ bin/aspiresh.sh


************************************************************************
*
* ASPIRE BOOTLOADER
*
* Bundle id : 10
*
* Location  : file:bundles/boot/aspire-bootloader-3.1.jar
*

Maven update policy: always


Settings (org.apache.felix.webconsole.internal.servlet.OsgiManager):  {password=admin, manager.root=/osgi, username=admin}
Maven update policy: always
Aspire Console Mode
Aspire>

Microsoft Windows from the Command Prompt

Set your working directory to your Aspire distribution and then execute "bin\aspiresh.bat":

 

 

$ cd my-aspire\target\my-aspire-1.0-SNAPSHOT-distribution.dir
$ bin\aspiresh.bat
Removing Felix-Cache and AppBundle-Cache directories


************************************************************************
*
* ASPIRE BOOTLOADER
*
* Bundle id : 10
*
* Location  : file:bundles/boot/aspire-bootloader-3.1.jar
*

Maven update policy: always


Settings (org.apache.felix.webconsole.internal.servlet.OsgiManager):  {password=admin, manager.root=/osgi, username=admin}
Maven update policy: always
Aspire Console Mode
Aspire>

Using Aspire Shell

Groovy in Aspire Shell

One of the most powerful features in Aspire Shell is the ability to parse and evaluate Groovy Expressions on the fly, just as GroovyShell does. But not only normal Groovy Expressions but also Groovy Pipelines expressions.

Aspire> 5 + 6
11
Aspire> println "hello world, this is Aspire Shell"
hello world, this is Aspire Shell

Loading components

You can load any component by just typing its configuration:

Example:

Aspire> <component name="FetchUrl" subType="default" factoryName="aspire-fetch-url" />
Aspire> <component name="ExtractText" subType="default" factoryName="aspire-extract-text" />
Aspire> 
You can also load components with multiple line configurations:

 

 Aspire> <component name="PostHTTP" subType="default" factoryName="aspire-post-http">
Aspire:   <postUrl>http://localhost:8983/solr/update</postUrl>
Aspire:   <postXsl>config/xsl/aspireToSolr.xsl</postXsl>
Aspire:   <okayResponse><![CDATA[<int name="status">0</int>]]></okayResponse>
Aspire: </component>
Aspire>
 

 

 

 

 

 

 

 

 

 

 

 

 

  • No labels