Package com.adito.security.forms

Examples of com.adito.security.forms.ShowAvailableAccountsForm


     * @throws Exception
     */
    public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        CoreUtil.clearFlow(request);
        ShowAvailableAccountsForm accountsForm = (ShowAvailableAccountsForm) form;
       
        UserDatabase userDatabase = UserDatabaseManager.getInstance().getUserDatabase(getSessionInfo(request).getUser().getRealm());
        User[] users;
        try {
            String filterText = accountsForm.getFilterText();
            String filter = Util.isNullOrTrimmedBlank(filterText) ? UserDatabase.WILDCARD_SEARCH : filterText;
            int maxUserResults = userDatabase.getMaxUserResults();
            users = userDatabase.listAllUsers(filter, maxUserResults + 1);
           
            if (users.length > maxUserResults) {
                int newLength = users.length - 1;
                User[] copy = new User[newLength];
                System.arraycopy(users, 0, copy, 0, newLength);
                users = copy;
                saveMessage(request, "availableAccounts.match.limited", maxUserResults);
            }
        } catch (Exception e) {
            LOG.error("Could not list users.", e);
            String exceptionMessageChain = Util.getExceptionMessageChain(e);
            saveError(request, "availableAccounts.cannotListAccounts", exceptionMessageChain);
            users = new User[0];
        }
        accountsForm.initialize(users, request.getSession());
        ActionMessages messages = new ActionMessages();
        if (userDatabase.supportsAccountCreation() && !userDatabase.supportsPasswordChange()) {
            messages.add(Globals.MESSAGE_KEY, new ActionMessage("availableAccounts.noPasswordChange.text"));
        }
        if (!userDatabase.supportsAccountCreation() && userDatabase.supportsPasswordChange()) {
View Full Code Here


     * @return ActionForward
     * @throws Exception
     */
    public ActionForward redisplay(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        ShowAvailableAccountsForm accountsForm = (ShowAvailableAccountsForm) form;
        accountsForm.reInitialize(request.getSession());
        return mapping.findForward("display");
    }
View Full Code Here

     * @return forward
     * @throws Exception
     */
    public ActionForward displayFilterChanged(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                              HttpServletResponse response) throws Exception {
        ShowAvailableAccountsForm accountsForm = (ShowAvailableAccountsForm) form;
        accountsForm.rebuildModel();
        return mapping.findForward("display");
    }
View Full Code Here

TOP

Related Classes of com.adito.security.forms.ShowAvailableAccountsForm

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.