About AEM OSGi Test Bench
OSGI REST Test Bench was created to provide developer examples of interacting with AEM OSGI via REST based APIs. It provides functional cases to query AEM for available workflows, running workflows, creation of workflows, resources from Sites instances as well as Assets specific content.
In each API example, clicking on the ? will reveal an AJAX based example that demonstrates querying for the respective API.
Setting up the Test Bench
-
Navigate to your WWW published directory structure. On the Mac this may be /Library/WebServer/Documents/ (the default location)
-
Within this location create a new directory called “osgitoolkit”
-
Place the OSGI Toolkit HTML file into this location and rename the file “index.html”. You should have a directory structure that looks like this:
../osgitoolkit/index.hml
- If not already running, start your Apache instance with this command in the shell:
sudo apachectl start
- Launch your browser and point it to http://localhost/osgitoolkit
You should see something that looks like below.
If not, see if any other web content is accessible or double check Apache is actually running.
With the previous steps complete, now to configure your local AEM instance to allow connections.
Configuring Adobe Experience Manager
- Navigate to the AEM administration panel and click on the Web Console item.
- Search for and select the Apache Sling Referrer Filter item. Click the pencil icon to make edits that reflect below.
The above presumes you are running AEM on your local instance; if not make the entry reflect your instance accordingly. Make your changes and click “Save”.
- Next, search and select the Adobe Granite Cross Origin Resource Sharing item. Click the pencil icon to make edits that reflect below.
As with the previous change, note the server location may be unique to your instance.
Additionally note the added Supported Header values.
Click Save to apply the changes.
Once changes have been applied you should be able now return to your browser. Clicking the Get Running Workflow Instances should now return a result that lists workflows that exist on your specific AEM instance.
You should see a response output to the results field as shown below:
Optional
While not required, if you want to run the Trigger Full Workflow instance, the sample payload included contains elements aligned with the “Simple Assign Workflow”. Using the package manager, install the package to add that workflow model to your instance.