Package net.stinfoservices.pacifiq.server.model

Examples of net.stinfoservices.pacifiq.server.model.Program


    @Override
    @Transactional(readOnly = false)
    public void updateName(Long id, String name) throws Exception {
        UzerDTO user = (UzerDTO) getSession().getAttribute("user");
        hasUpdateRights(user, id);
        Program prog = programDAO.find(id);
        prog.setName(name);
        programDAO.save(prog);
        alertManagement.alert(user);
    }
View Full Code Here


    @Override
    @Transactional(readOnly = false)
    public void updateDeliveryToPrime(Long id, Date deliveryToPrime) throws Exception {
        UzerDTO user = (UzerDTO) getSession().getAttribute("user");
        hasUpdateRights(user, id);
        Program prog = programDAO.find(id);
        prog.setDateOfDeliveryToPrime(deliveryToPrime);
        programDAO.save(prog);
        alertManagement.alert(user);
    }
View Full Code Here

    @Override
    @Transactional(readOnly = false)
    public void updateLaunchDate(Long id, Date launchDate) throws Exception {
        UzerDTO user = (UzerDTO) getSession().getAttribute("user");
        hasUpdateRights(user, id);
        Program prog = programDAO.find(id);
        prog.setLaunchDate(launchDate);
        programDAO.save(prog);
        alertManagement.alert(user);
    }
View Full Code Here

    @Override
    @Transactional(readOnly = false)
    public void updateLauncherType(Long id, String launcherType) throws Exception {
        UzerDTO user = (UzerDTO) getSession().getAttribute("user");
        hasUpdateRights(user, id);
        Program prog = programDAO.find(id);
        prog.setLauncherType(launcherType);
        programDAO.save(prog);
        alertManagement.alert(user);
    }
View Full Code Here

    @Override
    public void updateEcmManager(Long id, UzerDTO ecmManager) throws Exception {
        UzerDTO user = (UzerDTO) getSession().getAttribute("user");
        hasUpdateRights(user, id);
        Program prog = programDAO.find(id);
        prog.setEcmManager(uzerDAO.find(ecmManager.getId()));
        programDAO.save(prog);
        alertManagement.alert(user);

    }
View Full Code Here

    @Override
    public void updateProcessManager(Long id, UzerDTO processManager) throws Exception {
        UzerDTO user = (UzerDTO) getSession().getAttribute("user");
        hasUpdateRights(user, id);
        Program prog = programDAO.find(id);
        prog.setProcessManager(uzerDAO.find(processManager.getId()));
        programDAO.save(prog);
        alertManagement.alert(user);
    }
View Full Code Here

    @Override
    public void updateProgramManager(Long id, UzerDTO programManager) throws Exception {
        UzerDTO user = (UzerDTO) getSession().getAttribute("user");
        hasUpdateRights(user, id);
        Program prog = programDAO.find(id);
        prog.setProgramManager(uzerDAO.find(programManager.getId()));
        programDAO.save(prog);
        alertManagement.alert(user);
    }
View Full Code Here

                throw new CannotEditLaunchedProgramException(LocaleManager.getInstance(getSession()).getMessageResource(getClass())
                        .getString("EXCEPTION_ACCESS_DENIED_BECAUSE_OF_RIGHTS_PROGRAM_VALIDATION_SIMPLE"));
            }
        }
        alertManagement.alert(user);
        Program prog = programDAO.find(id);
        prog.setGcForLaunchValidated(gcForLaunchsValidated);
        programDAO.save(prog);
        return haveToDisableSaveButton;
    }
View Full Code Here

            isAdmin = true;
        } catch (Exception aae1) {
            isAdmin = false;
        }
        if (isAdmin) {
            Program programFound = programDAO.find(programId);

            if (programFound != null) {
                program = new ProgramDTO(programFound, DTOPath.PROGRAM_GC_FOR_LAUNCH);
                // do enable Save button even if program is validated...
                program.doForceDisplayGC4LaunchSaveButton();
            }
        } else {
            // Uzer has already somes PROGRAM_NAME lists
            UzerDTO user = (UzerDTO) getSession().getAttribute("user");

            if (user != null) {
                for (ProgramDTO dto : user.getProgramsManaged()) {
                    if (dto.getId().equals(programId)) {
                        // convert from PROGRAM_NAME to PROGRAM_GC_FOR_LAUNCH
                        Program programFound = programDAO.find(programId);
                        program = new ProgramDTO(programFound, DTOPath.PROGRAM_GC_FOR_LAUNCH);
                        // do not enable Save button even if program is validated...
                        break;
                    }
                }
                for (ProgramDTO dto : user.getEcmManaged()) {
                    if (dto.getId().equals(programId)) {
                        // convert from PROGRAM_NAME to PROGRAM_GC_FOR_LAUNCH
                        Program programFound = programDAO.find(programId);
                        program = new ProgramDTO(programFound, DTOPath.PROGRAM_GC_FOR_LAUNCH);
                        // do enable Save button even if program is validated...
                        program.doForceDisplayGC4LaunchSaveButton();
                        break;
                    }
View Full Code Here

            ServiceSecurityHelper.hasAuthority(ProfileHelper.SPECIFIC_PROGRAMS_EDITION, getSession());
            hasSpecificRights = true;
        }

        if (hasRights) {
            Program program = (document.getId() == null ? new Program() : programDAO.find(document.getId()));
            applyDiffProgram(program, document);
            Program programWithId = programDAO.save(program);
            UzerDTO user = (UzerDTO) getSession().getAttribute("user");
            alertManagement.alert(user);
            ProgramDTO programIdAndEnableGC4LaunchButton = new ProgramDTO();
            programIdAndEnableGC4LaunchButton.setId(programWithId.getId());

            if (isAdmin || (programWithId.getEcmManager() != null && programWithId.getEcmManager().getId() == user.getId())
                    || (programWithId.getProgramManager() != null && programWithId.getProgramManager().getId() == user.getId())) {
                programIdAndEnableGC4LaunchButton.enableGC4LaunchButton();
            }
            return programIdAndEnableGC4LaunchButton;
        }

        if (hasSpecificRights) {
            UzerDTO user = (UzerDTO) getSession().getAttribute("user");

            Set<ProgramDTO> specPrograms = new HashSet<ProgramDTO>();
            specPrograms.addAll(user.getProgramsWithConsultationRights());
            specPrograms.addAll(user.getProgramsWithEditionRights());

            List<Long> programsId = new ArrayList<Long>();
            for (ProgramDTO program : specPrograms) {
                programsId.add(program.getId());
            }

            if (programsId.contains(document.getId())) {
                Program program = programDAO.find(document.getId());
                applyDiffProgram(program, document);
                Program programWithId = programDAO.save(program);
                // programDAO.getSessionFactory().getCurrentSession().flush();
                alertManagement.alert(user);
                ProgramDTO programIdAndEnableGC4LaunchButton = new ProgramDTO();
                programIdAndEnableGC4LaunchButton.setId(programWithId.getId());
                if (isAdmin || (programWithId.getEcmManager() != null && programWithId.getEcmManager().getId() == user.getId())
                        || (programWithId.getProgramManager() != null && programWithId.getProgramManager().getId() == user.getId())) {
                    programIdAndEnableGC4LaunchButton.enableGC4LaunchButton();
                }
                return programIdAndEnableGC4LaunchButton;
            }
        }
View Full Code Here

TOP

Related Classes of net.stinfoservices.pacifiq.server.model.Program

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.