Package org.zeroexchange.model.collaboration

Examples of org.zeroexchange.model.collaboration.Contract



    private Collection<GanttLine> getGanttLines(int contractId) {
        Collection<GanttLine> lines = new ArrayList<GanttLine>();
       
        Contract contract = contractReader.getContract(contractId);
        Date contractCreationDate = contract.getCreationDate();
        if(contractCreationDate != null) {
            for(Resource resource: contract.getResources()) {
                Date supplyDate = resourceInformant.getSupplyDate(resource);
                if(supplyDate != null) {
                    lines.add(createGanttLine(resource.getTitle(), contractCreationDate, supplyDate));
                }
            }
View Full Code Here


            @Override
            protected void onSubmit() {
                ContractData contractData = getModelObject();
               
                Contract contract = new Contract();
                contract.setTitle(contractData.getTitle());
                contract.setOwner(userReader.getUser(authorizedUserService.getCurrentUserId()));
               
                contract = contractWriter.save(contract);

                eventsDispatcher.publishEvent(new ContractCreated(contract));

                setResponsePage(CreateResource.class,
                        new PageParameters().
                            add(CreateResource.PARAM_CONTRACT_ID, contract.getId()));
            }
           
   
        };
        titleInput = new TextField<String>("title");
View Full Code Here

            private static final long serialVersionUID = 1L;

            @Override
            protected List<CreditPaths> getItems() {
                User debtor = authorizedUserService.getCurrentUser();
                Contract contract = (Contract) getDefaultModelObject();
                Contract persistedContract = contractReader.getContract(contract.getId());
                contract = contractReader.getContract(contract.getId());
                Collection<User> creditors = contractInformant.getCreditors(persistedContract);
                return creditPathFinder.findPaths(debtor, creditors, BigDecimal.ZERO);
            }
           
View Full Code Here

            private static final long serialVersionUID = 1L;

            @Override
            public void populateItem(Item<ICellPopulator<Contract>> cellItem,
                    String componentId, IModel<Contract> rowModel) {
                Contract contract = rowModel.getObject();
                cellItem.add(new Label(componentId, contract.getTitle()));
            }

        });

        //Contract's creator column
        columns.add(new AbstractColumn<Contract, String>(new ResourceModel(MKEY_CONTRACT_CREATOR),
                Contract.FIELD_OWNER + "." + User.FIELD_DISPLAY_NAME) {
            private static final long serialVersionUID = 1L;
           
            @Override
            public void populateItem(Item<ICellPopulator<Contract>> cellItem,
                    String componentId, IModel<Contract> rowModel) {
                String creatorNickName = "";
               
                Contract contract = rowModel.getObject();
                User creator = contract.getOwner();
                if(creator != null) {
                    creatorNickName = creator.getDisplayName();
                }
                cellItem.add(new Label(componentId, creatorNickName));
            }

            @Override
            public String getCssClass() {
                return "creatorColumn";
            }
        });
       

        // Resources column
        columns.add(new AbstractColumn<Contract, String>(new ResourceModel(MKEY_CONTRACT_RESOURCES)) {
            private static final long serialVersionUID = 1L;
            @Override
            public void populateItem(Item<ICellPopulator<Contract>> cellItem,
                    String componentId, IModel<Contract> rowModel) {
                Contract contract = rowModel.getObject();
               
                String representation = representationFactory.getRepresentation(
                        contract.getResources(), CLEN_RESOURCES);
                cellItem.add(new Label(componentId, representation));
            }

        });
       
        // Status column
        columns.add(new AbstractColumn<Contract, String>(new ResourceModel(MKEY_CONTRACT_STATUS), Contract.FIELD_STATUS) {
            private static final long serialVersionUID = 1L;
            @Override
            public void populateItem(Item<ICellPopulator<Contract>> cellItem,
                    String componentId, IModel<Contract> rowModel) {
                Contract contract = rowModel.getObject();
                ContractStatus contractStatus = contractStatusInformant.getContractStatus(contract,
                        authorizedUserService.getCurrentUserId());
                if(contractStatus != null) {
                    cellItem.add(new Label(componentId, new ResourceModel(MKEY_STATE_PREFIX  + contractStatus.name())));
                } else {
                    cellItem.add(new Label(componentId, "???"));
                }
            }

        });

        // Creation date column
        columns.add(new AbstractColumn<Contract, String>(new ResourceModel(MKEY_CONTRACT_CREATION), Contract.FIELD_CREATION_DATE) {
            private static final long serialVersionUID = 1L;
            @Override
            public void populateItem(Item<ICellPopulator<Contract>> cellItem,
                    String componentId, IModel<Contract> rowModel) {
                Contract contract = rowModel.getObject();
                Date date = contract.getCreationDate();
                cellItem.add(new Label(componentId, date == null ? "" : DateFormat.getInstance().format(date)));
            }

        });
       
        // Modified date column
        columns.add(new AbstractColumn<Contract, String>(new ResourceModel(MKEY_CONTRACT_MODIFICATION), Contract.FIELD_MODIFICATION_DATE) {
            private static final long serialVersionUID = 1L;
            @Override
            public void populateItem(Item<ICellPopulator<Contract>> cellItem,
                    String componentId, IModel<Contract> rowModel) {
                Contract contract = rowModel.getObject();
                Date date = contract.getModificationDate();
                cellItem.add(new Label(componentId, date == null ? "" : DateFormat.getInstance().format(date)));
            }

        });
       
        // Viewers count column
        columns.add(new AbstractColumn<Contract, String>(new ResourceModel(MKEY_VIEWERS_COUNT),
                Contract.FIELD_VIWERS_COUNT) {
            private static final long serialVersionUID = 1L;
            @Override
            public void populateItem(Item<ICellPopulator<Contract>> cellItem,
                    String componentId, IModel<Contract> rowModel) {
                Contract contract = rowModel.getObject();
                Integer viewersCount = contract.getViewersCount();
                cellItem.add(new Label(componentId, viewersCount == null ? "" : viewersCount.toString()));
            }

        });
       
View Full Code Here

TOP

Related Classes of org.zeroexchange.model.collaboration.Contract

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.