Package org.nxplanner.forms

Examples of org.nxplanner.forms.PersonEditorForm


        return person;
    }

    protected void beforeObjectCommit(Object object, Session session, ActionMapping actionMapping, ActionForm actionForm,
            HttpServletRequest request, HttpServletResponse reply) throws Exception {
        PersonEditorForm personForm = (PersonEditorForm)actionForm;
        Person person = (Person)object;
        for (int index = 0; index < personForm.getProjectCount(); index++) {
            int projectId = personForm.getProjectIdAsInt(index);
            if (isCurrentUserAdminOfProject(request, projectId)) {
                deleteRoleAssociationsForProject(projectId, person.getId());
                addRoleAssociationForProject(projectId, person.getId(), personForm.getProjectRole(index));
            }
        }
        if (isCurrentUserAdminOfProject(request, ANY_PROJECT_ID)) {
            roleAssociationRepository.deleteForPersonOnProject(SYSADMIN_ROLE_NAME, person.getId(), ANY_PROJECT_ID);
            if (personForm.isSystemAdmin()) {
                addRoleAssociationForProject(ANY_PROJECT_ID, person.getId(), SYSADMIN_ROLE_NAME);
            }
        }
        authorizer.invalidateCache(person.getId());
    }
View Full Code Here


    }

    protected void afterObjectCommit(ActionMapping actionMapping, ActionForm actionForm,
            HttpServletRequest request, HttpServletResponse reply)
            throws ServletException {
        PersonEditorForm personForm = (PersonEditorForm)actionForm;
        String newPassword = personForm.getNewPassword();
        if (StringUtils.isNotEmpty(newPassword)) {
            LoginModule loginModule = AuthenticatorImpl.getLoginModule(request);
            if (loginModule != null) {
                try {
                    loginModule.changePassword(personForm.getUserId(), personForm.getNewPassword());
                } catch (AuthenticationException e) {
                    throw new ServletException(e);
                }
            }
        }
View Full Code Here

    }

    protected void setUp() throws Exception {
        super.setUp();
        support = new XPlannerTestSupport();
        mockEditorForm = new PersonEditorForm();
        mockEditorForm.reset(support.mapping, support.request);
        mockPerson = new Person("mock");
        mockPerson.setId(PERSON_ID);
        support.setUpSubjectInRole("xyz");
        mockRoleRepositoryControl = MockControl.createControl(RoleRepository.class);
View Full Code Here

TOP

Related Classes of org.nxplanner.forms.PersonEditorForm

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.