Liferay automatically generates REST APIs for published object definitions. These include APIs for active standalone actions.
To view these APIs,
Open Liferay’s API Explorer at [server]:[port]/o/api (e.g., localhost:8080/o/api).
Click REST Applications and select the desired object definition. Custom objects use the c/[pluralobjectlabel] naming pattern (e.g., c/tickets).
For each standalone action, Liferay generates two PUT APIs: one that uses the entry’s ID and another that uses the entry’s external reference code (ERC).
Calling either API triggers the action for the specified entry.
If Liferay’s out-of-the-box button fragment doesn’t satisfy your use case, you can map actions to custom buttons by adding the attributes data-lfr-editable-id="action" and data-lfr-editable-type="action" to their HTML tag. To learn more about adding attributes to fragments, see Fragment Specific Tags and Attributes Reference.
Here is an example of an action-ready custom button:
<button class="btn btn-${configuration.buttonSize} btn-${configuration.buttonType}"
data-lfr-editable-id="action" data-lfr-editable-type="action">
Go Somewhere
</button>
When a user clicks on a component mapped to an action, you can choose what happens when that action succeeds or fails.
There are four options available for both outcomes and an extra success interaction:
None: Nothing happens after the action is performed.
Show Notification: Notify the user. You can write your custom success/error message, preview the notification, and configure the page to reload after the action is triggered.
Go to Page: Navigate to a Success/Error Page in your site.
Go to External URL: Navigate to an external URL.
Go to Entry Display Page (Success Interactions only): When mapped to a specific object entry with an action in place, you can select this option as a success interaction. It redirects the user to a display page template.
The selected option is executed after the user triggers the action.
Liferay automatically generates permissions for managing which roles can trigger standalone actions. Each permission follows the action.[actionName] naming pattern (e.g., action.sendReminder). See Permissions Framework Integration for more information on object permissions.
This website uses cookies and similar tools, some of which are provided by third parties (together “tools”). These tools enable us and the third parties to access and record certain user-related and activity data and to track your interactions with this website. These tools and the informationcollected are used to operate and secure this website, enhance performance, enable certain website features and functionality, analyze and improve website performance, and personalize user experience.
If you click “Accept All”, you allow the deployment of all these tools and collection of the information by us and the third parties for all these purposes.
If you click “Decline All” your IP address and other information may still be collected but only by tools (including third party tools) that are necessary to operate, secure and enable default website features and functionalities. Review and change your preferences by clicking the “Configurations” at any time.
Visit our Privacy Policy