Passing Parameters to the AEK from App Builder
The aim of this blog is to give a step-by-step guide on how to pass useful values (like a color or a page title) from the App Builder to any AEK integration. This topic assumes you’re already familiar with:
- How to create and publish AEK menu options
- How to create and deploy AEK projects
If you’re not, please review these pages:
- Creating and publishing AEK menu options (see #7): https://knowledge.exlibrisgroup.com/campusM/Product_Documentation/03_Managing_the_App_and_its_Services/03_Creating_Services
- Getting Started with the AEK: https://developers.exlibrisgroup.com/campusm/NPM/GettingStarted
|1.||Create an AEK project that you would like to pass a parameter into.|
|2.||Edit the runserver.yaml file to simulate passing in parameters from an “action link.” Make sure the devPath is correct or else you will get errors that your screen cannot be found.|
The runserver.yaml file should look something like this:
Later on when the AEK project has been deployed to the environment, these parameters will come from the App Builder configuration.
|3.||In your AEK project, you can obtain the parameter being passed. There are two ways to do this, one on the client side and one on the server-side:|
The example project showcases both ways of obtaining these parameters. Please find the “action-link-parameters” project here for more details: https://github.com/ExLibrisGroup/campusm-aek/tree/master/action-link-parameters.
The example project shows the difference in speed between these two methods. The project code also details the specifics of how they work.
|4.||Deploy your own custom project to your app environment or deploy the example given. Once the project has been deployed to your app environment, you will need to set up the AEK menu option. This is required for the Action URL later on.|
|5.||After setting up your AEK menu option, get the AEK menu option ID, either from the form itself or from the address bar. You will need the “AEK” prefix.|
Here is an example:
|6.||Now that the AEK menu option has been set up, go to your new tile within the App Builder and assign it an Action URL. Once the URL has been typed you have to hit Enter; there are no mouse options to confirm the new URL.|
The URL should look something like this:
campusm://loadaek?toolbar=[ menu option ID ]&[ parameter name ]=[ parameter value ]
Here is an example:
|7.||The example project allows you to pass in a variable called “test_param” and this changes the colors that display on the page. The example project is passing in the color “firebrick” from the runserver.yaml file.|
Here is what the example project should look like once it’s up and running: