SPL Editor Guide
Introduction
The SPL Policy editor is an Eclipse based text editor that expedites authoring and validation of SPL policies. The SPL editor greatly simplifies the process of creating policies with the help of policy templates, auto-completion and expression list prompting. SPL editor also allows easy import and export of policies.
Some of the salient features of the SPL Editor include:
- Policy authoring
- Policy Import/Export
- Customizable syntax highlighting.
- Policy outline view for quick policy navigation
- Error location indication
- Automatic syntax and semantic validation
- Statement auto-completion.
- Policy Execution.
- Policy execution simulation
Getting Started
Prerequisites
To use the JavaSPL editor you will first need to download and install eclipse platform 3.3 or later , EMF 2.3 or later and the ANTLR v2 plugin
Download or build the SPL Editor
Download and extract SPLEditor.zip to a temporary location. You can also Build the editor from source
Install the Editor
To install the editor simply unzip SPLEditor.zip into your ECLIPSE_HOME and restart Eclipse
Using the Editor
Create SPL Project
- Launch Eclipse and Select File / New / Project from the Eclipse main menu and
expand the Policy folder.
- Select the SPL Project and click Next .
- Enter a Name for your project
- Your new SPL Editor is now ready for use
Create a SPL Policy
- Right-click on the project in the Navigator view
- Select New -> File to display the New File dialog box,
expand the Policy folder and Select SPL Policy option and
click Next .
- Enter a name for the source file in the File name field and click Next
- Choose from one of the built-in policy templates and click Finish
- Replace the < > template sections of the generated policy appropriately
- Add the jar file that contains the anchor classes imported by the policy to the project classpath
- Save the policy (Ctrl+s)
Import a SPL Policy
- Right click on the SPL project where the policy is to be imported and click on
Import . Optionally, you could do File -> Import
- Select Policy -> SPL Policy and click Next
- Make sure the Policy Binding is set to Java
and browse the local file system for the directory where the policy file resides
- A list of polices will be displayed in the text box below. Select the ones you would like to import
- Set the Destination to project where the policy needs to be imported
- Click on Finish
- Double-click on the policy to open it into the editor
- Add the jar file that contains the anchor classes imported by the policy to the project classpath
Editing a SPL Policy
- To access anchor object members, after the instance name, simply type ‘.’ and a drop down list with the properties and methods will appear.
- To access built-in and custom operators and actions list type Ctrl + space. A drop down list with all supported operators and actions will appear.
- An outline view on the right enables users to quickly navigate the policy file.
- If syntax or semantic errors exist then they will be displayed in the problems pane at the bottom.
User-Defined Expressions
SPL allows users to add custom actions or expressions to the runtime. The Editor needs to be configured to recognize these custom expressions.
- Right click on the project and select Properties . This opens a dialog box.
- Expand the policy option and either select add custom jar or delete the custom jar to the project
- Browse the local filesystem and select the jar file that contains the
custom expressions classes and the customexpressions.properties.(Refer the
User Guide).
- The list of classes inside the jar will get displayed. Click Apply to add the jars to the classpath and register the custom expressions.
- Clicking Ctrl + space in the policy section should display the newly added custom expressions in the drop-down list
- To delete the custom expressions from the runtime use the
Delete Custom Jar option in the Properties
panel.
Customizing the SPL Editor
The SPL Policy editor allows users to customize the syntax highlighting. From the main menu select Window->Preferences to show preferences dialog box. Expand the Policy node on left and click on Policy Editor .

