public static class EditInfoActionListener extends EventListener<UIPageBrowser> {
public void execute(Event<UIPageBrowser> event) throws Exception {
UIPageBrowser uiPageBrowser = event.getSource();
WebuiRequestContext context = event.getRequestContext();
PortalRequestContext pcontext = (PortalRequestContext) context.getParentAppRequestContext();
UIPortalApplication uiPortalApp = (UIPortalApplication) pcontext.getUIApplication();
String id = context.getRequestParameter(OBJECTID);
UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
// Check existence of the page
PageContext pageContext = (id != null) ? service.getPage(PageKey.parse(id)) : null;
if (pageContext == null) {
uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { id }, 1));
return;
}
// Check current user 's permissions on the page
UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
if (!userACL.hasEditPermission(pageContext)) {
uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.edit.NotEditPage", new String[] { id }, 1));
return;
}
// Need this code to override editpage action in extension project
UIPageFactory clazz = UIPageFactory.getInstance(pageContext.getState().getFactoryId());