Package no.ugland.utransprod.model

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


        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

    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

        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

        ApplicationUserManager applicationUserManager=(ApplicationUserManager)ModelUtil.getBean(ApplicationUserManager.MANAGER_NAME);
        return applicationUserManager.login(userName, password);
    }
    private static UserType initUserType(){
        ApplicationUserManager applicationUserManager=(ApplicationUserManager)ModelUtil.getBean(ApplicationUserManager.MANAGER_NAME);
        ApplicationUser user=getUser();
        applicationUserManager.lazyLoad(user, new LazyLoadEnum[][]{{LazyLoadEnum.USER_ROLES,LazyLoadEnum.NONE}});
        return user.getUserRoles().iterator().next().getUserType();
    }
View Full Code Here

        .getBean(ApplicationUserManager.MANAGER_NAME);
    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

    MockitoAnnotations.initMocks(this);
    JobFunctionManager jobFunctionManager = (JobFunctionManager) ModelUtil
        .getBean(JobFunctionManager.MANAGER_NAME);
    when(managerRepository.getJobFunctionManager()).thenReturn(
        jobFunctionManager);
    ApplicationUser applicationUser = new ApplicationUser();
    applicationUser.setUserName("username");
    when(login.getApplicationUser()).thenReturn(applicationUser);
    UserType userType = new UserType();
    userType.setIsAdmin(1);
    when(login.getUserType()).thenReturn(userType);
    preventiveActionManager = (PreventiveActionManager) ModelUtil
View Full Code Here

    userTypeAccess.setWindowAccess(windowAccess);
    userTypeAccesses.add(userTypeAccess);
    userType.setUserTypeAccesses(userTypeAccesses);

    when(login.getUserType()).thenReturn(userType);
    ApplicationUser applicationUser = new ApplicationUser();
    applicationUser.setGroupUser("Nei");
    when(login.getApplicationUser()).thenReturn(applicationUser);
    when(managerRepository.getAccidentManager())
        .thenReturn(accidentManager);
    List<Accident> accidentList = Lists.newArrayList();
    Accident accident = new Accident();
View Full Code Here

  /**
   * @see no.ugland.utransprod.gui.handlers.AbstractViewHandler#getNewObject()
   */
  @Override
  public ApplicationUser getNewObject() {
    return new ApplicationUser();
  }
View Full Code Here

   * @param window
   * @param presentationModel
   */
  void addProductAreaGroup(WindowInterface window,
      PresentationModel presentationModel) {
    ApplicationUser user = ((ApplicationUserModel) presentationModel
        .getBean()).getObject();
    List<ProductAreaGroup> groups = new ArrayList<ProductAreaGroup>(
        productAreaGroups);
       
    if (user.getProductArea() != null) {
      groups.remove(user.getProductArea().getProductAreaGroup());
    }
    ProductAreaGroup selectedGroup = (ProductAreaGroup) JOptionPane
        .showInputDialog(window.getComponent(), "Velg produktomr�de",
            "Legg til produktomr�de",
            JOptionPane.INFORMATION_MESSAGE, null,
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.