Book Image

Alfresco Developer Guide

Book Image

Alfresco Developer Guide

Overview of this book

Table of Contents (17 chapters)
Alfresco Developer Guide
Credits
About the Author
About the Reviewers
Preface
Index

Writing Action Evaluators to Show/Hide UI Actions


In the previous example, you set up two UI actions to enable and disable the isActive flag for a webable piece of content. The actions only show up if a user has the appropriate permissions. But what if SomeCo wants to give several different people or groups Write permission, but only wants a subset of those folks to be able to publish documents to the Web? Not only that, but isn't it a bit sloppy to show the Enable link when the isActive flag is already set to True (and Disable when it is already set to False)?

Both of these issues are easily addressed by implementing an Action Evaluator. An Action Evaluator is a Java class that decides whether or not a UI Action should show up.

Step-by-Step: Evaluating Whether or Not to Show the Set Web Flag UI Actions

SomeCo wants to create a group called "Publisher" and populate it with the people and groups allowed to click the Enable and Disable UI Actions created in the previous example. Additionally...