Package org.exoplatform.webui.exception

Examples of org.exoplatform.webui.exception.MessageException


         OrganizationService orgService = uiForm.getApplicationComponent(OrganizationService.class);
         boolean authentication = orgService.getUserHandler().authenticate(username, password);
         if (!authentication)
         {
            throw new MessageException(new ApplicationMessage("UILoginForm.msg.Invalid-account", null));
         }

         PortalRequestContext prContext = Util.getPortalRequestContext();
         HttpServletRequest request = prContext.getRequest();
         HttpSession session = request.getSession();
View Full Code Here


                Util.getPortalRequestContext().setResponseComplete(true);
            } catch (Exception e) {
                UIPortletApplication uiPortlet = uiGadget.getAncestorOfType(UIPortletApplication.class);
                context.addUIComponentToUpdateByAjax(uiPortlet);
                context.setAttribute(UIGadget.SAVE_PREF_FAIL, true);
                throw new MessageException(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null,
                        ApplicationMessage.ERROR));
            }

            //
            if (uiGadget.isLossData()) {
View Full Code Here

        } catch (Exception e) {
            String message = e.getLocalizedMessage();
            log.error("Error processing the action: " + message, e);
            Object[] args = { message };
            context.addUIComponentToUpdateByAjax(uicomponent);
            throw new MessageException(new ApplicationMessage("UIPortletLifecycle.msg.process-error", args,
                    ApplicationMessage.ERROR));
        }

    }
View Full Code Here

                return;
            }
            UIFormPageIterator uiInputIterator = uiInputContainer.findFirstComponentOfType(UIFormPageIterator.class);
            if (uiInputIterator.getAvailable() < 1) {
                String[] args = { "UITabPane.title.UIListPermissionSelector" };
                throw new MessageException(new ApplicationMessage("EmptyIteratorValidator.msg.empty", args,
                        ApplicationMessage.INFO));
            }
        }
View Full Code Here

                return;
            }
            if (!url.trim().matches(URLValidator.URL_REGEX)) {
                uiForm.getUIStringInput(FIELD_URL).setValue(uiPortlet.getURL());
                Object[] args = { FIELD_URL, "URL" };
                throw new MessageException(new ApplicationMessage("ExpressionValidator.msg.value-invalid", args));
            }
            PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
            PortletPreferences pref = pcontext.getRequest().getPreferences();
            pref.setValue("url", uiForm.getUIStringInput(FIELD_URL).getValue());
            pref.store();
View Full Code Here

        private void throwMessageException(UILogoEditMode uiForm) throws MessageException {
            UILogoPortlet uiPortlet = uiForm.getParent();
            uiForm.getUIStringInput(FIELD_URL).setValue(uiPortlet.getURL());
            Object[] args = { FIELD_URL, "URL" };
            throw new MessageException(new ApplicationMessage("ExpressionValidator.msg.value-invalid", args));
        }
View Full Code Here

        if (permission == null || permission.length() < 1 || permission.equals("*"))
            return;
        Object[] args = { uicomponent.getName() };
        String[] tmp = permission.split(":", 2);
        if (tmp.length != 2) {
            throw new MessageException(new ApplicationMessage("PermissionValidator.msg.invalid-permission-input", args));
        }
        String membership = tmp[0];
        String groupId = tmp[1];
        Group group = null;
        MembershipType membershipType = null;
        try {
            membershipType = service.getMembershipTypeHandler().findMembershipType(membership);
            group = service.getGroupHandler().findGroupById(groupId);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
        if (membership.equals("*")) {
            if (membershipType != null && group != null)
                return;
            throw new MessageException(new ApplicationMessage("PermissionValidator.msg.membership-group-not-found", args));
        }
        if (group != null)
            return;
        throw new MessageException(new ApplicationMessage("PermissionValidator.msg.membership-group-not-found", args));
    }
View Full Code Here

        return createMessageException(value, uiInput, getMessageLocalizationKey());
    }

    protected MessageException createMessageException(String value, UIFormInput uiInput, String localizationKey)
            throws Exception {
        return new MessageException(new ApplicationMessage(localizationKey, getMessageArgs(value, uiInput),
                ApplicationMessage.WARNING));
    }
View Full Code Here

        CompoundApplicationMessage messages = new CompoundApplicationMessage();

        validate(value, label, messages, uiInput);

        if (!messages.isEmpty()) {
            throw new MessageException(messages);
        }
    }
View Full Code Here

            CompoundApplicationMessage messages = new CompoundApplicationMessage();

            validate((String) uiInput.getValue(), label, messages, uiInput);

            if (!messages.isEmpty()) {
                throw new MessageException(messages);
            }

        }
    }
View Full Code Here

TOP

Related Classes of org.exoplatform.webui.exception.MessageException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.