Package com.nineteendrops.tracdrops.client.core

Examples of com.nineteendrops.tracdrops.client.core.TracException


     * @see com.nineteendrops.tracdrops.client.core.multicall.MultiParameter
     */
    public Object encode(TracProperties tracProperties, Object parameter) {

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

        SearchQuery searchQuery = (SearchQuery)parameter;

        // check for mandatory fields
View Full Code Here


public class TicketToCreateFormatEncoder implements ParameterEncoder{

    public Object encode(TracProperties tracProperties, Object parameter) {

        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);
View Full Code Here

public class AttachmentToPutAttachmentEncoder implements ParameterEncoder{

    public Object encode(TracProperties tracProperties, Object parameter) {

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

        TicketAttachment ticketAttachment = (TicketAttachment)parameter;


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

        String fileName = ticketAttachment.getFilename();
        if(fileName == null || fileName.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "TicketAttachment.fileName", this.getClass().getName()));
        }

        String description = ticketAttachment.getDescription();
        if(description == null) description = "";

        String fullFileName = ticketAttachment.getFullFileName();
        if(fullFileName == null || fullFileName.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "TicketAttachment.fullFileName", this.getClass().getName()));
        }

        byte[] binaryData = Utils.getBinaryData(fullFileName, tracProperties);

        MultiParameter multiParameter = new MultiParameter();
View Full Code Here

public class SimpleObjectToCreateUpdateFormatEncoder implements ParameterEncoder {

    public Object encode(TracProperties tracProperties, Object parameter) {

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

        SimpleObject simpleObject = (SimpleObject)parameter;

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

        String order = simpleObject.getOrder();
        if(order == null || order.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "SimpleObject.order", this.getClass().getName()));
        }


        MultiParameter multiParameter = new MultiParameter();
        multiParameter.addParameter(name);
View Full Code Here

        TicketQuery ticketQuery = (TicketQuery)parameter;

        String query = ticketQuery.getFullQuery();

        if(query.equals("")){
            throw new TracException(MessageUtils.getMessage("api.ticket.ticket.query.no.filters"));
        }

        return query;
    }
View Full Code Here

public class MilestoneToCreateUpdateFormatEncoder implements ParameterEncoder {

    public Object encode(TracProperties tracProperties, Object parameter) {

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

        Milestone milestone = (Milestone)parameter;

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

        Date due = milestone.getDue();
        if(due == null){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "Milestone.due", this.getClass().getName()));
        }

        String description = milestone.getDescription();
        if(description == null){
            description = "";
View Full Code Here

public class ComponentToCreateUpdateFormatEncoder implements ParameterEncoder {

    public Object encode(TracProperties tracProperties, Object parameter) {

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

        Component component = (Component)parameter;

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

        String owner = component.getOwner();
        if(owner == null || owner.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "Component.owner", this.getClass().getName()));
        }

        String description = component.getDescription();
        if(description == null){
            description = "";
View Full Code Here

public class AttachmentToAttachmentPathEncoder implements ParameterEncoder{

    public Object encode(TracProperties tracProperties, Object parameter) {

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

        WikiAttachment wikiAttachment = (WikiAttachment)parameter;

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

        String fileName = wikiAttachment.getFileName();
        if(fileName == null || fileName.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "TicketAttachment.fileName", this.getClass().getName()));
        }

        String pathToAttachment = pageName + "/" + fileName;

        MultiParameter multiParameter = new MultiParameter();
View Full Code Here

public class AttachmentToPutAttachmentExEncoder implements ParameterEncoder {

    public Object encode(TracProperties tracProperties, Object parameter) {

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

        WikiAttachment wikiAttachment = (WikiAttachment)parameter;

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

        String fileName = wikiAttachment.getFileName();
        if(fileName == null || fileName.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "wikiAttachment.fileName", this.getClass().getName()));
        }

        String description = wikiAttachment.getDescription();
        if(description == null) description = "";

        String fullFileName = wikiAttachment.getFullFileName();
        if(fullFileName == null || fullFileName.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "wikiAttachment.fullFileName", this.getClass().getName()));
        }

        byte[] binaryData = Utils.getBinaryData(fullFileName, tracProperties);

        MultiParameter multiParameter = new MultiParameter();
View Full Code Here

public class PageToPutFormatEncoder implements ParameterEncoder {

    public Object encode(TracProperties tracProperties, Object parameter) {

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

        WikiPage wikiPage = (WikiPage)parameter;

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

        String content = wikiPage.getContent();
        if(content == null || content.trim().equals("")){
            throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "wikiPage.content", this.getClass().getName()));
        }

        MultiParameter multiParameter = new MultiParameter();
        multiParameter.addParameter(name);
        multiParameter.addParameter(content);
View Full Code Here

TOP

Related Classes of com.nineteendrops.tracdrops.client.core.TracException

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.