Examples of ApplicationUser


Examples of no.ugland.utransprod.model.ApplicationUser

  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

Examples of no.ugland.utransprod.model.ApplicationUser

    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

Examples of no.ugland.utransprod.model.ApplicationUser

        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

Examples of no.ugland.utransprod.model.ApplicationUser

    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

Examples of no.ugland.utransprod.model.ApplicationUser

    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

Examples of no.ugland.utransprod.model.ApplicationUser

    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

Examples of no.ugland.utransprod.model.ApplicationUser

    JobFunctionManager jobFunctionManager=(JobFunctionManager)ModelUtil.getBean(JobFunctionManager.MANAGER_NAME);
    when(managerRepository.getJobFunctionManager()).thenReturn(jobFunctionManager);
    UserType userType = new UserType();
    userType.setIsAdmin(1);
    when(login.getUserType()).thenReturn(userType);
    ApplicationUser applicationUser = new ApplicationUser();
    ProductArea productArea = productAreaManager
        .findByName("Garasje villa");
    applicationUser.setProductArea(productArea);
    when(login.getApplicationUser()).thenReturn(applicationUser);
    final Supplier supplier = new Supplier();
    supplier.setSupplierId(47);
    supplier.setSupplierName("S�rensen Garagebygg ANS");
View Full Code Here

Examples of no.ugland.utransprod.model.ApplicationUser

        deviationStatusManager);
    when(managerRepository.getApplicationUserManager()).thenReturn(
        applicationUserManager);
    when(managerRepository.getProductAreaGroupManager()).thenReturn(
        productAreaGroupManager);
    ApplicationUser applicationUser = new ApplicationUser();
    applicationUser.setFirstName("firstName");
    applicationUser.setLastName("lastName");

    List<ProductAreaGroup> productAreaGroupList = Lists.newArrayList();
    ProductAreaGroup productAreaGroup = new ProductAreaGroup();
    productAreaGroup.setProductAreaGroupName("Garasje");
    productAreaGroupList.add(productAreaGroup);
    when(productAreaGroupManager.findAll())
        .thenReturn(productAreaGroupList);
    Util.setProductAreaGroupManager(productAreaGroupManager);

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

Examples of no.ugland.utransprod.model.ApplicationUser

    buttonEdit.setEnabled(hasSelection);
    if (viewHandler.hasWriteAccess()) {
      if (deviation != null) {

        JobFunction jobFunction = deviation.getDeviationFunction();
        ApplicationUser manager = null;
        ApplicationUser currentUser = ((DeviationViewHandler) viewHandler)
            .getApplicationUser();
        if (jobFunction != null) {
          manager = jobFunction.getManager();
        }
        if ((currentUser != null && currentUser.equals(manager))
            || (currentUser != null && viewHandler.getUserType()
                .isAdministrator())) {
          buttonRemove.setEnabled(hasSelection);
        } else {
          buttonRemove.setEnabled(false);
View Full Code Here

Examples of no.ugland.utransprod.model.ApplicationUser

        takstolPackageVManager);
    TakstolProductionVManager takstolProsuctionVManager = (TakstolProductionVManager) ModelUtil
        .getBean(TakstolProductionVManager.MANAGER_NAME);
    when(managerRepository.getTakstolProductionVManager()).thenReturn(
        takstolProsuctionVManager);
    final ApplicationUser applicationUser = new ApplicationUser();
    when(login.getApplicationUser()).thenReturn(applicationUser);
    final UserType userType = new UserType();
    Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
    UserTypeAccess userTypeAccess = new UserTypeAccess();
    userTypeAccess.setWriteAccess(1);
    WindowAccess windowAccess = new WindowAccess();
    windowAccess.setWindowName("Produksjonsenhet");
    userTypeAccess.setWindowAccess(windowAccess);
    userTypeAccesses.add(userTypeAccess);
    userType.setUserTypeAccesses(userTypeAccesses);
    userType.setIsAdmin(1);
    when(login.getUserType()).thenReturn(userType);

    ProductAreaManager productAreaManager = (ProductAreaManager) ModelUtil
        .getBean(ProductAreaManager.MANAGER_NAME);
    when(managerRepository.getProductAreaManager()).thenReturn(
        productAreaManager);

    DeviationStatusManager deviationStatusManager = (DeviationStatusManager) ModelUtil
        .getBean(DeviationStatusManager.MANAGER_NAME);
    when(managerRepository.getDeviationStatusManager()).thenReturn(
        deviationStatusManager);

    ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
        .getBean(ApplicationUserManager.MANAGER_NAME);
    when(managerRepository.getApplicationUserManager()).thenReturn(
        applicationUserManager);
    ArticleTypeManager articleTypeManager = (ArticleTypeManager) ModelUtil
        .getBean(ArticleTypeManager.MANAGER_NAME);
    when(managerRepository.getArticleTypeManager()).thenReturn(
        articleTypeManager);
    ProductAreaGroupManager productAreaGroupManager = (ProductAreaGroupManager) ModelUtil
        .getBean(ProductAreaGroupManager.MANAGER_NAME);
    when(managerRepository.getProductAreaGroupManager()).thenReturn(
        productAreaGroupManager);

    OrderManager orderManager = (OrderManager) ModelUtil
        .getBean(OrderManager.MANAGER_NAME);
    when(managerRepository.getOrderManager()).thenReturn(orderManager);

    ProductArea productArea = new ProductArea();

    ProductAreaGroup productAreaGroup = productAreaGroupManager
        .findByName("Garasje");
    productArea.setProductAreaGroup(productAreaGroup);
    applicationUser.setProductArea(productArea);

    final DeviationManager deviationManager = (DeviationManager) ModelUtil
        .getBean(DeviationManager.MANAGER_NAME);
    final PreventiveActionManager preventiveActionManager = (PreventiveActionManager) ModelUtil
        .getBean(PreventiveActionManager.MANAGER_NAME);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.