Package org.zeroexchange.model.user

Examples of org.zeroexchange.model.user.User


                        rowItem.add(new AttributeModifier("class", "resource-accepted"));
                    } else {
                        rowItem.add(new AttributeModifier("class", "resource-unaccepted"));
                    }
                }
                User currentUser = authorizedUserService.getCurrentUser();
                if(currentUser != null && !resourceVisitService.isVisited(resource)) {
                    rowItem.add(new AttributeAppender("class", " visitedItem"));
                }
                return rowItem;
            }
View Full Code Here


            @Override
            public void populateItem(Item<ICellPopulator<Resource>> cellItem,
                    String componentId, IModel<Resource> rowModel) {
                Resource resource = rowModel.getObject();
                User owner = resource.getOwner();
                cellItem.add(new Label(componentId, owner == null ? "" : owner.getDisplayName()));
            }
        });

        // Producers column
        columns.add(new AbstractColumn<Resource, String>(new ResourceModel(MKEY_PRODUCERS)) {
View Full Code Here

    @Override
    public CHECreditStatus getOrCreateByUserId(Integer userId) {
        CHECreditStatus status = getByUserId(userId);
        if(status == null) {
            status = new CHECreditStatus();
            User userStub = new User();
            userStub.setId(userId);
            status.setUser(userStub);
        }
        return status;
    }
View Full Code Here

    @Autowired
    private CreditLineReader creditLineReader;
   
    @Test(expectedExceptions = DebtRotingException.class)
    public void testDebtRoute() throws DebtRotingException {
        User a = new User();
        User b = new User();
        User c = new User();
        User d = new User();
        CreditLine l1 = new CreditLine();
        l1.setMaxCreditValue(BigDecimal.TEN);
        l1.setDebtor(a);
        l1.setCreditor(b);
        CreditLine l2 = new CreditLine();
View Full Code Here

  private UncompletedStep uncompletedStep;
 
  @Test
  public void testUncompletedStep() {
    Contract contract = new Contract();
    User contractOwner = new User();
    contractOwner.setId(1);
    contract.setOwner(contractOwner);
   
    //Empty contract
    ContractStatus nextStatus = uncompletedStep.nextStep(contract);
    Assert.assertEquals(nextStatus, ContractStatus.UNCOMPLETED);

    //Need only
    Resource resource = new Resource();
    resource.setOwner(contractOwner);
    Need need = new Need();
    need.setAmount(BigDecimal.ONE);
    need.setAcceptDate(new Date());
    User needOwner = new User();
    needOwner.setId(2);
    need.setUser(needOwner);
    resource.getNeeds().add(need);
    contract.getResources().add(resource);
    nextStatus = uncompletedStep.nextStep(contract);
    Assert.assertEquals(nextStatus, ContractStatus.UNCOMPLETED);

    //+Supply
    Supply offer = new Supply();
    offer.setAcceptDate(new Date());
    offer.setAmount(BigDecimal.ONE);
    User offerOwner = new User();
    offerOwner.setId(2);
    offer.setUser(offerOwner);
    resource.getSupplies().add(offer);
    nextStatus = uncompletedStep.nextStep(contract);
    Assert.assertEquals(nextStatus, ContractStatus.READY);
  }
View Full Code Here

        }
        if (!(object instanceof SharedViewable)) {
            throw new BusinessLogicException("Object of class '" + object.getClass().getName() +"' is not implements " +
                    SharedViewable.class.getName());
        }
        User currentUser = authorizedUserService.getCurrentUser();
        if(currentUser == null) {
            return object;
        }
        if (object instanceof Identifiable && ((Identifiable)object).getId() == null) {
            return object;
View Full Code Here

        }
        if (!(object instanceof SharedViewable)) {
            throw new BusinessLogicException("Object of class '" + object.getClass().getName() +"' is not implements " +
                    SharedViewable.class.getName());
        }
        User currentUser = authorizedUserService.getCurrentUser();
        if(currentUser == null) {
            return true;
        }
        return ((SharedViewable)object).getViewers().contains(currentUser);
    }
View Full Code Here

    @Override
    @Transactional(readOnly = true)
    public UserDetails loadUserByUsername(String username)
            throws UsernameNotFoundException, DataAccessException {
        LocalCredential credential = localCredentialDAO.findCredential(username);
        User user = credential == null ? null : credential.getUser();
        if(user == null) {
            throw new UsernameNotFoundException("Username by nickname '" + username + "' not found");
        }

        final Collection<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
        if(user.getRoles() != null) {
            for(Role role : user.getRoles()){
                authorities.add(new GrantedAuthorityImpl(roleManagementService.getAcegiToken(role)));
            }
        }

        return new ZEUserDetails(authorities, user, credential);
View Full Code Here

        if(!(resourceTender instanceof Supply)) {
            return;
        }
       
        Contract contract = event.getContract();
        User tenderOwner = resourceTender.getUser();
        if(tenderOwner != null && contract != null) {
            if(internalIsUserEffective(contract, tenderOwner.getId(), new HashSet<Integer>())) {
                contractWriter.markUserEffective(contract.getId(), tenderOwner);
            } else {
                contractWriter.markUserIneffective(contract.getId(), tenderOwner);
            }
        }
View Full Code Here

        Collection<Resource> resources = contract.getResources();
        for(Resource resource : resources) {
            ResourceTender userTender = resourceInformant.getUserTender(resource, userId);
            if(userTender != null && userTender instanceof Supply
                    && userTender.getAcceptDate() != null) {
                User resourceOwner = resource.getOwner();
                Set<Need> resourceNeeds = resource.getNeeds();
                for(ResourceTender need: resourceNeeds) {
                    if(need.getAcceptDate() != null &&
                            need.getUser() != null &&
                            internalIsUserEffective(contract, need.getUser().getId(), passedUserIds)) {
View Full Code Here

TOP

Related Classes of org.zeroexchange.model.user.User

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.