Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.ApplicationUser


    managerRepository = injector.getInstance(ManagerRepository.class);

    ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
        .getBean("applicationUserManager");
    ApplicationUser user;
    user = applicationUserManager.login("admin", "admin");
    applicationUserManager.lazyLoad(user, new LazyLoadEnum[][] { {
        LazyLoadEnum.USER_ROLES, LazyLoadEnum.NONE } });
    UserType userType = user.getUserRoles().iterator().next().getUserType();

    Login login = new LoginImpl(user, userType);

    AccidentViewHandler accidentViewHandler = new AccidentViewHandler(
        login, managerRepository);
View Full Code Here


    when(managerRepository.getApplicationUserManager()).thenReturn(applicationUserManager);
    final DeviationManager deviationManager = (DeviationManager) ModelUtil
        .getBean(DeviationManager.MANAGER_NAME);
    when(managerRepository.getDeviationManager()).thenReturn(deviationManager);
   
final ApplicationUser applicationUser = new ApplicationUser();
   
    final ProductArea productArea = productAreaManager
        .findByName("Garasje villa");
    ProductAreaGroupManager productAreaGroupManager = (ProductAreaGroupManager) ModelUtil
        .getBean(ProductAreaGroupManager.MANAGER_NAME);
    ProductAreaGroup productAreaGroup = productAreaGroupManager
        .findByName("Garasje");
    productArea.setProductAreaGroup(productAreaGroup);
    applicationUser.setProductArea(productArea);
    applicationUser.setUserName("username");
    applicationUser.setGroupUser("Nei");
    when(login.getApplicationUser()).thenReturn(applicationUser);
    final UserType userType = new UserType();
    Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
    UserTypeAccess userTypeAccess = new UserTypeAccess();
    userTypeAccess.setWriteAccess(1);
View Full Code Here

    when(managerRepository.getDeviationStatusManager()).thenReturn(
        deviationStatusManager);
    when(managerRepository.getApplicationUserManager()).thenReturn(
        applicationUserManager);
    when(managerRepository.getOrderManager()).thenReturn(orderManager);
    ApplicationUser applicationUser = new ApplicationUser();
    when(login.getApplicationUser()).thenReturn(applicationUser);
    UserType userType = new UserType();
    UserTypeAccess userTypeAccess = new UserTypeAccess();
    userTypeAccess.setWindowAccess(new WindowAccess(null, "Attributter",
        null));
View Full Code Here

    final DeviationManager deviationManager = (DeviationManager) ModelUtil
        .getBean(DeviationManager.MANAGER_NAME);
    when(managerRepository.getDeviationManager()).thenReturn(
        deviationManager);

    final ApplicationUser applicationUser = new ApplicationUser();
    final ProductArea productArea = productAreaManager
        .findByName("Garasje villa");
    ProductAreaGroupManager productAreaGroupManager = (ProductAreaGroupManager) ModelUtil
        .getBean(ProductAreaGroupManager.MANAGER_NAME);
    ProductAreaGroup productAreaGroup = productAreaGroupManager
        .findByName("Garasje");
    productArea.setProductAreaGroup(productAreaGroup);
    applicationUser.setProductArea(productArea);
    applicationUser.setUserName("username");
    applicationUser.setGroupUser("Nei");
    when(login.getApplicationUser()).thenReturn(applicationUser);
    final UserType userType = new UserType();
    Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
    UserTypeAccess userTypeAccess = new UserTypeAccess();
    userTypeAccess.setWriteAccess(1);
View Full Code Here

  private void setUpDialog() {
    applicationParamManager = (ApplicationParamManager) ModelUtil
        .getBean("applicationParamManager");
    ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
        .getBean("applicationUserManager");
    ApplicationUser user;
    user = applicationUserManager.login("admin", "admin");
    applicationUserManager.lazyLoad(user, new LazyLoadEnum[][] { {
        LazyLoadEnum.USER_ROLES, LazyLoadEnum.NONE } });
    UserType userType = user.getUserRoles().iterator().next().getUserType();

    ApplicationParamViewHandler applicationParamViewHandler = new ApplicationParamViewHandler(
        "Kollier", applicationParamManager, userType);

    final EditColliSetupView editColliSetupView = new EditColliSetupView(
View Full Code Here

    windowAccess.setWindowName("Produksjonsenhet");
    userTypeAccess.setWindowAccess(windowAccess);
    userTypeAccesses.add(userTypeAccess);
    userType.setUserTypeAccesses(userTypeAccesses);
    when(login.getUserType()).thenReturn(userType);
    final ApplicationUser applicationUser = new ApplicationUser();
    ProductArea productArea = new ProductArea();
    ProductAreaGroup productAreaGroup = new ProductAreaGroup();
    productArea.setProductAreaGroup(productAreaGroup);
    applicationUser.setProductArea(productArea);
    when(login.getApplicationUser()).thenReturn(applicationUser);

   

   
View Full Code Here

        deviationStatusManager);
    when(managerRepository.getApplicationUserManager()).thenReturn(
        applicationUserManager);
    when(managerRepository.getProductAreaGroupManager()).thenReturn(
        productAreaGroupManager);
    ApplicationUser applicationUser = new ApplicationUser();

    UserType userType = new UserType();
    userType.setIsAdmin(1);
    ProductArea productArea = new ProductArea();
    productArea.setProductAreaGroup(productAreaGroup);
    applicationUser.setProductArea(productArea);
    when(login.getUserType()).thenReturn(userType);
    when(login.getApplicationUser()).thenReturn(applicationUser);

    PaidViewHandler paidViewHandler = new PaidViewHandler(
        new PaidApplyList(login, paidVManager), login,
View Full Code Here

    final ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean(ConstructionTypeManager.MANAGER_NAME);
    when(managerRepository.getConstructionTypeManager()).thenReturn(
        constructionTypeManager);

    ApplicationUser user;

    user = applicationUserManager.login("admin", "admin");
    applicationUserManager.lazyLoad(user, new LazyLoadEnum[][] { {
        LazyLoadEnum.USER_ROLES, LazyLoadEnum.NONE } });
    UserType userType = user.getUserRoles().iterator().next().getUserType();

    Login login = new LoginImpl(user, userType);

    ConstructionTypeViewHandler constructionTypeViewHandler = new ConstructionTypeViewHandler(
        login, managerRepository, false, false);
View Full Code Here

    deviationManager = (DeviationManager) ModelUtil
        .getBean("deviationManager");
    final ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
        .getBean("applicationUserManager");
    ApplicationUser user;
    user = applicationUserManager.login("avviktransport", "avviktransport");
    applicationUserManager.lazyLoad(user, new LazyLoadEnum[][] { {
        LazyLoadEnum.USER_ROLES, LazyLoadEnum.NONE } });
    JobFunctionManager jobFunctionManager = (JobFunctionManager) ModelUtil
        .getBean("jobFunctionManager");
    if (user == null) {

      UserTypeManager userTypeManager = (UserTypeManager) ModelUtil
          .getBean("userTypeManager");
      JobFunction jobFunction = new JobFunction();
      jobFunction.setJobFunctionName("Transport");
      List<JobFunction> jobFunctions = jobFunctionManager
          .findByObject(jobFunction);
      jobFunction = jobFunctions.get(0);

      user = new ApplicationUser(null, "avviktransport",
          "avviktransport", "avviktransport", "avviktransport", null,
          "Nei", jobFunction, productArea, null);
      applicationUserManager.saveObject(user);

      UserType userType = new UserType();
      userType.setDescription("Avvik");
      List<UserType> userTypes = userTypeManager.findByObject(userType);
      userType = userTypes.get(0);

      Set<UserRole> userRoles = new HashSet<UserRole>();
      UserRole userRole = new UserRole(null, userType, user);
      userRoles.add(userRole);
      user.setUserRoles(userRoles);

      applicationUserManager.saveObject(user);
    }

    JobFunction jobFunction = user.getJobFunction();

    if (!jobFunction.getManager().equals(user)) {
      jobFunction.setManager(user);
      jobFunctionManager.saveObject(jobFunction);
    }

    Login login = new LoginImpl(user, user.getUserRoles().iterator().next()
        .getUserType());

    final PreventiveActionManager preventiveActionManager = (PreventiveActionManager) ModelUtil
        .getBean(PreventiveActionManager.MANAGER_NAME);
    final DeviationManager deviationManager = (DeviationManager) ModelUtil
View Full Code Here

    TakstolInfoVManager takstolInfoVManager = (TakstolInfoVManager) ModelUtil
        .getBean(TakstolInfoVManager.MANAGER_NAME);
    when(managerRepository.getTakstolInfoVManager()).thenReturn(
        takstolInfoVManager);

    ApplicationUser applicationUser = new ApplicationUser();
    applicationUser.setUserName("admin");
    applicationUser = applicationUserManager.findByObject(applicationUser)
        .get(0);
    ProductArea productArea = new ProductArea();
    ProductAreaGroupManager productAreaGroupManager = (ProductAreaGroupManager) ModelUtil
        .getBean(ProductAreaGroupManager.MANAGER_NAME);
    ProductAreaGroup productAreaGroup = productAreaGroupManager
        .findByName("Garasje");
    productArea.setProductAreaGroup(productAreaGroup);
    applicationUser.setProductArea(productArea);
    when(login.getApplicationUser()).thenReturn(applicationUser);

    UserType userType = new UserType();
    Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
    UserTypeAccess userTypeAccess = new UserTypeAccess();
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.model.ApplicationUser

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.