AnsweredAssumed Answered

Admin Console customization - How To?

Question asked by nenad982 on Nov 11, 2014
Hi all,

I would like to customize Admin Console (Alfresco Ent v4.2.2) and to add additional options in the list of available options (links) on the left hand side. When admin clicks on that link, corresponding configuration (page) is going to be displayed. Configuration from that page is persisted in custom type in repository. So basically I will have only one instance of custom type with custom metadata and my custom MBean will get/set metadata from/on that custom type and display it on Admin Console. If admin wants to change something, he can edit values in the text fields on Admin Console and this will be persisted in only instance of this custom type.

The issue which I currently experience is that when user enters some invalid value in the text field (invalid format of email…) I would like to check it on the server and if something is wrong to throw some known exception like IllegalArgumentException or NullPointerException. What I experience in this situation is that debugger will go on the line in the code where exception is going to be thrown (throw new NullPointerException("custom message");) and will skip the rest of the code related to setting this specific property and will go on setting next MBean property in the list of sent MBean properties from UI.

So I don't see exception in the logs and whole transaction is not canceled, but instead next property is going to be processed and after all properties are processed SUCCESS message will be returned on UI.

My custom MBean extends and implements following (public class CustomBeanImpl extends MBeanSupport implements MyCustomMBean).

Does anybody know how when some exception is thrown in the MBean setter method I can stop whole process, rollback transaction, throw exception and return FAILURE message on UI?

Thanks,
Nenad

Outcomes