Examples of UserType


Examples of no.ugland.utransprod.model.UserType

    when(managerRepository.getAttributeChoiceManager()).thenReturn(
        attributeChoiceManager);
    when(managerRepository.getAttributeManager()).thenReturn(
        attributeManager);
    UserType userType = new UserType();
    Set<UserTypeAccess> userTypeAccesses = Sets.newHashSet();
    userTypeAccesses.add(new UserTypeAccess(null, 1, userType,
        new WindowAccess(null, "Attributter", null)));
    userType.setUserTypeAccesses(userTypeAccesses);
    when(login.getUserType()).thenReturn(userType);
    UserUtil.setUserTypeManagerForTest(userTypeManager);

    AttributeViewHandler attributeViewHandler = new AttributeViewHandler(
        login, managerRepository);
View Full Code Here

Examples of no.ugland.utransprod.model.UserType

  private Login login;

  @Before
  public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    UserType userType = new UserType();
    userType.setIsAdmin(1);
    when(login.getUserType()).thenReturn(userType);

    BudgetManager productionBudgetManager = (BudgetManager) ModelUtil
        .getBean(BudgetManager.MANAGER_NAME);

    Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
    UserTypeAccess userTypeAccess = new UserTypeAccess();
    userTypeAccess.setWindowAccess(new WindowAccess(null, "Attributter",
        null));
    userTypeAccesses.add(userTypeAccess);
    userType.setUserTypeAccesses(userTypeAccesses);

    final OverviewView<Budget, ProductionBudgetModel> view = new OverviewView<Budget, ProductionBudgetModel>(
        new ProductionBudgetViewHandler(login, true,
            productionBudgetManager));
View Full Code Here

Examples of no.ugland.utransprod.model.UserType

        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);
View Full Code Here

Examples of no.ugland.utransprod.model.UserType

    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.UserType

  @Before
  public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);

    final UserType userType = new UserType();
    userType.setIsAdmin(1);
    Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
    UserTypeAccess userTypeAccess = new UserTypeAccess();
    userTypeAccess.setWindowAccess(new WindowAccess(null, "Attributter",
        null));
    userTypeAccesses.add(userTypeAccess);
    userType.setUserTypeAccesses(userTypeAccesses);

    when(login.getUserType()).thenReturn(userType);

    final AttributeChoiceOverviewView view = new AttributeChoiceOverviewView(
        new AttributeChoiceViewHandler(login, managerRepository,
View Full Code Here

Examples of no.ugland.utransprod.model.UserType

        applicationUserManager
                .lazyLoad(
                        login.getApplicationUser(),
                        new LazyLoadEnum[][] {{LazyLoadEnum.USER_ROLES,LazyLoadEnum.NONE}});
        Set<UserRole> roles = login.getApplicationUser().getUserRoles();
        UserType userType;
        UserRole userRole = null;

        if (roles != null) {
            if (roles.size() > 1) {
                userRole = (UserRole) JOptionPane.showInputDialog(null,
                        "Velg rolle", "Velg rolle",
                        JOptionPane.QUESTION_MESSAGE, null, roles.toArray(),
                        null);
            } else if (roles.size() == 1) {
                userRole = roles.iterator().next();
            }
        }
        if (userRole != null) {
            userType = userRole.getUserType();
            login.setUserType(userType);
            try {
                Class<?> windowClass = Class.forName(userType
                        .getStartupWindow());
                MainWindow mainWindow = (MainWindow)injector.getInstance(windowClass);
                mainWindow.setLogin(login);

                mainWindow.buildMainWindow(new SystemReadyListener() {
View Full Code Here

Examples of no.ugland.utransprod.model.UserType

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

    final PreventiveActionViewHandler preventiveActionViewHandler = new PreventiveActionViewHandler(
        login, managerRepository);
    final DeviationOverviewViewFactory deviationOverviewViewFactory = new DeviationOverviewViewFactory() {
View Full Code Here

Examples of no.ugland.utransprod.model.UserType

      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);
View Full Code Here

Examples of no.ugland.utransprod.model.UserType

        .getBean(AssemblyOverdueVManager.MANAGER_NAME);
    when(managerRepository.getAssemblyOverdueVManager()).thenReturn(
        assemblyOverdueVmnager);
    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");

    final YearWeek yearWeek = new YearWeek(2009, 34);
    final CraningCostManager craningCostManager = (CraningCostManager) ModelUtil
        .getBean(CraningCostManager.MANAGER_NAME);
    final AssemblyReportFactory assemblyReportFactory = new AssemblyReportFactory() {

      public AssemblyReport create(Order order,
          List<Ordln> vismaOrderLines) {

        return new AssemblyReportImpl(craningCostManager, order,
            vismaOrderLines);
      }
    };
    final PreventiveActionViewHandler preventiveActionViewHandler = new PreventiveActionViewHandler(
        login, managerRepository);
    final DeviationViewHandlerFactory deviationViewHandlerFactory = new DeviationViewHandlerFactory() {

      public DeviationViewHandler create(Order aOrder, boolean doSeAll,
          boolean forOrderInfo, boolean isForRegisterNew,
          Deviation notDisplayDeviation,
          boolean isDeviationTableEditable) {

        return new DeviationViewHandler(login, managerRepository,
            preventiveActionViewHandler, aOrder, doSeAll,
            forOrderInfo, isForRegisterNew, notDisplayDeviation,
            isDeviationTableEditable);
      }
    };
    final DeviationOverviewViewFactory deviationOverviewViewFactory = new DeviationOverviewViewFactory() {

      public DeviationOverviewView create(
          DeviationViewHandler deviationViewHandler,
          boolean useSearchButton, Order aOrder, boolean doSeeAll,
          boolean forOrderInfo, boolean isForRegisterNew,
          Deviation notDisplayDeviation,
          boolean isDeviationTableEditable) {
        return new DeviationOverviewView(preventiveActionViewHandler,
            deviationViewHandler, useSearchButton, aOrder,
            doSeeAll, forOrderInfo, isForRegisterNew,
            notDisplayDeviation, isDeviationTableEditable);
      }
    };
    final OrderViewHandlerFactory orderViewHandlerFactory = new OrderViewHandlerFactory() {

      public OrderViewHandler create(boolean notInitData) {

        return new OrderViewHandler(login, managerRepository,
            deviationOverviewViewFactory,
            deviationViewHandlerFactory, notInitData);
      }
    };
    final SupplierOrderViewHandler supplierOrderViewHandler = new SupplierOrderViewHandler(
        login, managerRepository, assemblyReportFactory,
        deviationViewHandlerFactory, orderViewHandlerFactory, supplier,
        yearWeek);

    Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
    UserTypeAccess userTypeAccess = new UserTypeAccess();
    userTypeAccess.setWindowAccess(new WindowAccess(null, "Attributter",
        null));
    userTypeAccesses.add(userTypeAccess);
    userType.setUserTypeAccesses(userTypeAccesses);

    final List<Supplier> supplierList = new ArrayList<Supplier>();
    supplierList.add(supplier);

    final OrderViewHandler orderViewHandler = new OrderViewHandler(login,
View Full Code Here

Examples of no.ugland.utransprod.model.UserType

    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);

    AbstractProductionPackageViewHandler<FaktureringV> productionViewHandler = new InvoiceViewHandler(
        login, new InvoiceApplyList(login, faktureringVManager),
        managerRepository, deviationViewHandlerFactory);
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.