Adding your own alert messages
By Kyle Hatlestad on Sep 09, 2011
If you’ve installed WebCenter Content (UCM) or have made changes such as switching the search engine, you may have noticed an alert message at the top of the pages letting you know if there is a specific task that needs to be done such as a restart or rebuild of the search collection.
Well, these alerts are open for administrators to set as well. So for instance, if you have a planned outage you can set a message letting users know the system is going to be down for a certain amount of time.
Adding and managing alerts is very simple. There are three primary services that are used: SET_USER_ALERT,GET_USER_ALERTS, DELETE_USER_ALERT. With SET_USER_ALERT, you simply need to pass in alertId (a unique identifier you give the alert) and alertMsg with the message you want to display. And because it’s just a service, you can simply call it in a URL to set it (as an administrator):
You can get fancy with the message by including HTML as well as Idoc Script. That will be processed on the page as it’s being rendered. Optionally, you can pass in alertUrl which would be a URL that the message would lead to. This value is appended to the “/cs/idcplg” path.
To know what alerts are set, you can run the GET_USER_ALERTS service and pass in IsJava=1 to display the values back:
It will then display the alerts in the USER_ALERTS result set.
To remove the alert, simply run the DELETE_USER_ALERT service and pass in alertId to identify which alert to remove. Optionally, you can pass in isTempAlert=1 when you first create the alert and it will be removed the next time the server restarts.