Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.UserType


  @Before
  public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    colliManager = (ColliManager) ModelUtil.getBean("colliManager");
    when(managerRepository.getColliManager()).thenReturn(colliManager);
    UserType userType = new UserType();
    userType.setIsAdmin(1);
    when(login.getUserType()).thenReturn(userType);

    viewHandler = new ColliViewHandler("Kolli", new Colli(), null, login,
        managerRepository, null);
View Full Code Here


    productArea.setProductAreaGroup(productAreaGroup);
    applicationUser.setProductArea(productArea);
    applicationUser.setUserName("username");
    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);

    OrderViewHandler orderViewHandler = new OrderViewHandler(login,
        managerRepository, deviationOverviewViewFactory,
        deviationViewHandlerFactory, true);
View Full Code Here

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

    when(managerRepository.getSupplierManager())
        .thenReturn(supplierManager);
View Full Code Here

        articleTypeManager);
    ApplicationUser applicationUser = new ApplicationUser();
    applicationUser.setFirstName("firstName");
    applicationUser.setLastName("lastName");
    when(login.getApplicationUser()).thenReturn(applicationUser);
    UserType userType = new UserType();
    userType.setIsAdmin(1);
    when(login.getUserType()).thenReturn(userType);

    Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
    UserTypeAccess userTypeAccess = new UserTypeAccess();
    userTypeAccess.setWindowAccess(new WindowAccess(null, "Attributter",
        null));
    userTypeAccesses.add(userTypeAccess);
    userType.setUserTypeAccesses(userTypeAccesses);
    ProductArea productArea = new ProductArea();
    ProductAreaGroup productAreaGroup = new ProductAreaGroup();
    productArea.setProductAreaGroup(productAreaGroup);
    applicationUser.setProductArea(productArea);
    final PacklistVManager packlistVManager = (PacklistVManager) ModelUtil
View Full Code Here

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

         * @param rowIndex
         * @param columnIndex
         * @return verdi
         */
        public Object getValueAt(int rowIndex, int columnIndex) {
            UserType userType = (UserType) getRow(rowIndex);
            switch (columnIndex) {
            case 0:
                return userType.getDescription();
            case 1:
                return userType.getStartupWindowEnum();
            case 2:
                return Util.convertNumberToBoolean(userType.getIsAdmin());
            default:
                throw new IllegalStateException("Unknown column");
            }

        }
View Full Code Here

        @Override
        public void setValueAt(Object object, int rowIndex, int columnIndex) {
            Boolean access = (Boolean) object;
            WindowAccess windowAccess = (WindowAccess) getRow(rowIndex);
            UserTypeAccess userTypeAccess = userTypeAccessMap.get(windowAccess);
            UserType userType = ((UserTypeModel) presentationModel.getBean())
                    .getObject();
            List<UserTypeAccess> userTypeAccessList = (List<UserTypeAccess>) presentationModel
                    .getBufferedValue(UserTypeModel.PROPERTY_USER_TYPE_ACCESS_LIST);
            if (access) {
                if (userTypeAccess == null) {
View Full Code Here

        .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

    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);
    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 DeviationOverviewViewFactory deviationOverviewViewFactory = new DeviationOverviewViewFactory() {

      public DeviationOverviewView create(
          DeviationViewHandler deviationViewHandler,
View Full Code Here

    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));
    userType.setIsAdmin(1);
    Set<UserTypeAccess> userTypeAccesses = new HashSet<UserTypeAccess>();
    userTypeAccesses.add(userTypeAccess);
    userType.setUserTypeAccesses(userTypeAccesses);
    when(login.getUserType()).thenReturn(userType);

    OrderViewHandler orderViewHandler = new OrderViewHandler(login,
        managerRepository, deviationOverviewViewFactory,
        deviationViewHandlerFactory, true);
View Full Code Here

TOP

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

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.