Package com.nineteendrops.tracdrops.client.api.ticket.ticket

Examples of com.nineteendrops.tracdrops.client.api.ticket.ticket.Ticket


        if(parameter == null){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "Ticket", this.getClass().getName()));
        }
       
        Ticket ticket = (Ticket)parameter;

        // check for mandatory fields
        String summary = ticket.getSummary();
        if(summary == null || summary.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "Ticket.summary", this.getClass().getName()));
        }

        String description = ticket.getDescription();
        if(description == null || description.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "Ticket.description", this.getClass().getName()));
        }


        MultiParameter multiParameter = new MultiParameter();
        multiParameter.addParameter(summary);
        multiParameter.addParameter(description);

        Hashtable attributes = new Hashtable();
        for(String key: TicketKeys.FIELDS_ARRAY){
            if(!key.equals(TicketKeys.FIELD_SUMMARY) && !key.equals(TicketKeys.FIELD_DESCRIPTION)){
                String attribute = ticket.getOtherAttribute(key);
                if(attribute != null && !attribute.trim().equals("")){
                    attributes.put(key, attribute);
                }
            }
        }
View Full Code Here


        if(parameter == null){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "Ticket", this.getClass().getName()));
        }

        Ticket ticket = (Ticket)parameter;

        // check for mandatory fields
        Integer idTicket = ticket.getIdTicket();
        if(idTicket == 0){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "Ticket.idTicket", this.getClass().getName()));
        }

        String comment = ticket.getComment();
        if(comment == null || comment.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "Ticket.comment", this.getClass().getName()));
        }


        MultiParameter multiParameter = new MultiParameter();
        multiParameter.addParameter(idTicket);
        multiParameter.addParameter(comment);

        Hashtable attributes = new Hashtable();
        for(String key: TicketKeys.FIELDS_ARRAY){
            if(!key.equals(TicketKeys.FIELD_COMMENT)){
                String attribute = ticket.getOtherAttribute(key);
                if(attribute != null && !attribute.trim().equals("")){
                    attributes.put(key, attribute);
                }
            }
        }
View Full Code Here

    public Object decode(Object result, TracProperties tracProperties, ArrayList keptParametersForDecoder) {

        Object[] resultArray = (Object[])result;

        return new Ticket((Integer)resultArray[0],
                          (Date)resultArray[1],
                          (Date)resultArray[2],
                          (HashMap)resultArray[3]);
    }
View Full Code Here

TOP

Related Classes of com.nineteendrops.tracdrops.client.api.ticket.ticket.Ticket

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.