Package info.jtrac.domain

Examples of info.jtrac.domain.History


                protected void populateItem(ListItem listItem) {
                    if (listItem.getIndex() % 2 != 0) {
                        listItem.add(sam);
                    }
                   
                    final History h = (History) listItem.getModelObject();
                    listItem.add(new Label("loggedBy", new PropertyModel(h, "loggedBy.name")));
                    listItem.add(new Label("status", new PropertyModel(h, "statusValue")));
                    listItem.add(new Label("assignedTo", new PropertyModel(h, "assignedTo.name")));
                   
                    WebMarkupContainer comment = new WebMarkupContainer("comment");
                    comment.add(new AttachmentLinkPanel("attachment", h.getAttachment()));
                    comment.add(new Label("comment", ItemUtils.fixWhiteSpace(h.getComment())).setEscapeModelStrings(false));
                    listItem.add(comment);
                   
                    listItem.add(new Label("timeStamp", DateUtils.formatTimeStamp(h.getTimeStamp())));
                    listItem.add(new ListView("fields", editable) {
                        /* (non-Javadoc)
                         * @see org.apache.wicket.markup.html.list.ListView#populateItem(org.apache.wicket.markup.html.list.ListItem)
                         */
                        protected void populateItem(ListItem listItem) {
                            Field field = (Field) listItem.getModelObject();
                            listItem.add(new Label("field", h.getCustomValue(field.getName())));
                        }
                    });
                }
            });
        }
View Full Code Here


                        case SUMMARY:
                            setText(row, col++, item.getSummary());
                            break;
                        case DETAIL:
                            if (showHistory) {
                                History h = (History) item;
                                if(h.getIndex() > 0) {
                                    setText(row, col++, h.getComment());
                                } else {
                                    setText(row, col++, h.getDetail());
                                }
                            } else {
                                setText(row, col++, item.getDetail());
                            }
                            break;
View Full Code Here

       
        public ItemViewForm(String id, final Item item) {
            super(id);
            setMultiPart(true);
            this.itemId = item.getId();
            final History history = new History();
            history.setItemUsers(item.getItemUsers());
            final BoundCompoundPropertyModel model = new BoundCompoundPropertyModel(history);
            setModel(model);
            add(new TextArea("comment").setRequired(true).add(new ErrorHighlighter()));
            // custom fields ===================================================
            User user = getPrincipal();
View Full Code Here

        }
       
        @Override
        protected void onSubmit() {
            final FileUpload fileUpload = fileUploadField.getFileUpload();
            History history = (History) getModelObject();
            User user = JtracSession.get().getUser();
            history.setLoggedBy(user);
            getJtrac().storeHistoryForItem(itemId, history, fileUpload);
            setResponsePage(ItemViewPage.class, new PageParameters("0=" + history.getRefId()));
        }
View Full Code Here

        }

    }

    public synchronized void storeItem(Item item, FileUpload fileUpload) {
        History history = new History(item);
        Attachment attachment = getAttachment(fileUpload);
        if(attachment != null) {
            item.add(attachment);
            history.setAttachment(attachment);
        }
        // timestamp can be set by import, then retain
        Date now = item.getTimeStamp();
        if(now == null) {
            now = new Date();
        }
        item.setTimeStamp(now);
        history.setTimeStamp(now);
        item.add(history);
        item.setSequenceNum(dao.loadNextSequenceNum(item.getSpace().getId()));
        // this will at the moment execute unnecessary updates (bug in Hibernate handling of "version" property)
        // se http://opensource.atlassian.com/projects/hibernate/browse/HHH-1401
        // TODO confirm if above does not happen anymore
View Full Code Here

            item.setSendNotifications(false);
            if(item.getStatus() == State.CLOSED) {
                // we support CLOSED items for import also but for consistency
                // simulate the item first created OPEN and then being CLOSED
                item.setStatus(State.OPEN);
                History history = new History();
                history.setTimeStamp(item.getTimeStamp());
                // need to do this as storeHistoryForItem does some role checks
                // and so to avoid lazy initialization exception
                history.setLoggedBy(loadUser(item.getLoggedBy().getId()));
                history.setAssignedTo(item.getAssignedTo());
                history.setComment("-");
                history.setStatus(State.CLOSED);
                history.setSendNotifications(false);
                storeItem(item, null);
                storeHistoryForItem(item.getId(), history, null);
            } else {
                storeItem(item, null);
            }
View Full Code Here

        }
    }
   
    public synchronized void updateItem(Item item, User user) {
        logger.debug("update item called");
        History history = new History(item);
        history.setAssignedTo(null);
        history.setStatus(null);
        history.setLoggedBy(user);
        history.setComment(item.getEditReason());
        history.setTimeStamp(new Date());
        item.add(history);
        dao.storeItem(item)// merge edits + history       
        // TODO index?
        if (item.isSendNotifications()) {
            mailSender.send(item);
View Full Code Here

                                    value = new PropertyModel(item, "summary");
                                    break;
                                case DETAIL:                               
                                    if(showHistory) {
                                        Fragment detailFrag = new Fragment("column", "detail", ItemListPanel.this);
                                        final History history = (History) item;
                                        detailFrag.add(new AttachmentLinkPanel("attachment", history.getAttachment()));
                                        if (history.getIndex() > 0) {
                                            detailFrag.add(new Label("detail", new PropertyModel(history, "comment")));
                                        } else {
                                            detailFrag.add(new Label("detail", new PropertyModel(history, "detail")));
                                        }
                                        listItem.add(detailFrag);
View Full Code Here

TOP

Related Classes of info.jtrac.domain.History

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.