Package com.impetus.kundera.datakeeper.service

Examples of com.impetus.kundera.datakeeper.service.DataKeeperService


        this.subordinates = subordinates;
    }

    public String searchSubordinates()
    {
        DataKeeperService service = DataKeeperUtils.getService();
        setManagerId(Integer.parseInt(FacesUtils.getRequest().getParameter("managerId")));
        List<Employee> subordinates = service.findSubOrdinates(getManagerId());
        if (subordinates != null)
        {
            this.subordinates = subordinates;
        }
        return "foundEmployess";
View Full Code Here


        return "foundEmployess";
    }

    public String searchEmployee()
    {
        DataKeeperService service = DataKeeperUtils.getService();
        Employee employee = null;
        switch (SearchType.getSearchType(searchBy))
        {
        case ID:
            employee = service.findEmployee(Integer.parseInt(getSearchText()));
            break;
        case NAME:
            employee = service.findEmployeeByName(getSearchText());
            break;
        }
        if (employee != null)
        {
            List<Employee> employees = new ArrayList<Employee>();
View Full Code Here

        return "foundEmployess";
    }

    public String searchEmployeeByYearOfComplition()
    {
        DataKeeperService service = DataKeeperUtils.getService();
        HttpSession session = FacesUtils.getSession();
        Employee employee = (Employee) session.getAttribute(DataKeeperConstants.EMPLOYEE);
        List<Employee> employees = service.findEmployeeByDateOfJoining(getNoOfYears(), employee.getCompany());
        if (employees != null)
        {
            this.subordinates = employees;
        }
        return "foundEmployess";
View Full Code Here

        this.counter = counter;
    }

    public String incrementCounter()
    {
        DataKeeperService service = DataKeeperUtils.getService();

        HttpSession session = FacesUtils.getSession();
        Employee employee = (Employee) session.getAttribute(DataKeeperConstants.EMPLOYEE);
        counter.setEmployeeId(employee.getEmployeeId());
       
        service.incrementCounter(counter);
       
        return "success";
    }
View Full Code Here

    public String handleFileUpload(FileUploadEvent event)
    {
        HttpSession session = FacesUtils.getSession();
        Employee employee = (Employee) session.getAttribute(DataKeeperConstants.EMPLOYEE);

        DataKeeperService service = DataKeeperUtils.getService();

        UploadedFile file = event.getFile();

        if (file != null)
        {
            DocumentInfo dataInfo = new DocumentInfo();
            dataInfo.setData(file.getContents());
            dataInfo.setDocumentName(file.getFileName());
            dataInfo.setSize(file.getSize());
            dataInfo.setOwnerName(employee.getEmployeeName());
            dataInfo.setOwnerId(employee.getEmployeeId());
            dataInfo.setUplodedDate(new Date());

            service.insertData(dataInfo);

            FacesMessage msg = new FacesMessage("Succesful", file.getFileName() + " is uploaded.");
            FacesContext.getCurrentInstance().addMessage(null, msg);

            return "successfully uploaded";
View Full Code Here

public class DataKeeperUtils
{
    public static DataKeeperService getService()
    {
        HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
        DataKeeperService datakeeper = (DataKeeperService) session.getAttribute("datakeeper");
        if (datakeeper == null)
        {
            BeanFactory beanfactory = new ClassPathXmlApplicationContext("appContext.xml");
            datakeeper = (DataKeeperService) beanfactory.getBean("datakeeper");
            session.setAttribute("datakeeper", datakeeper);
View Full Code Here

    }

    public String deleteAccount()
    {
        HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
        DataKeeperService service = DataKeeperUtils.getService();
        Employee employee = (Employee) session.getAttribute(DataKeeperConstants.EMPLOYEE);

        service.removeEmployee(employee);

        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Account successfully deleted"));
        session.invalidate();
        return "Account successfully deleted";
    }
View Full Code Here

        {
            return outcome;
        }
        else
        {
            DataKeeperService service = DataKeeperUtils.getService();
            Employee foundEmployee = service.findEmployeeByName(employee.getEmployeeName());
            boolean success = service.authenticateEmployee(foundEmployee, employee.getPassword());

            if (!success)
            {
                FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Incorrect User Name/Password"));
                outcome = DataKeeperConstants.OUTCOME_LOGIN_FAILED;
View Full Code Here

        return event.getNewStep();
    }

    public String save()
    {
        DataKeeperService service = DataKeeperUtils.getService();

        Employee manager = service.findEmployee(managerId);

        employee.setManager(manager);
        employee.setTimestamp(employee.getJoiningDate().getTime());

        service.insertEmployee(employee);

        FacesMessage msg = new FacesMessage("SignUp Successful! Welcome, " + employee.getEmployeeName());

        FacesContext.getCurrentInstance().addMessage(null, msg);
View Full Code Here

    public void download()
    {
       
       
       
        DataKeeperService service = DataKeeperUtils.getService();

        setDocumentId(Integer.parseInt(FacesUtils.getRequest().getParameter("documentId")));
        DocumentInfo document = service.findDocumentByDocumentId(getDocumentId());

        final HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance()
                .getExternalContext().getResponse();

        ServletOutputStream out = null;
View Full Code Here

TOP

Related Classes of com.impetus.kundera.datakeeper.service.DataKeeperService

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.