Example usage for javax.xml.bind JAXBException printStackTrace

List of usage examples for javax.xml.bind JAXBException printStackTrace

Introduction

In this page you can find the example usage for javax.xml.bind JAXBException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err .

Usage

From source file:org.megam.deccanplato.provider.zoho.crm.handler.TaskImpl.java

/**
 * this method creates a Task in zoho.com and returns that Task id.
 * and it uses the business support class Tasks to populate ZOHO XML input
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap /*  www.  j av a 2  s  .c  o m*/
 */
private Map<String, String> create(Map<String, String> outMap) {

    Tasks tasks = new Tasks();
    tasks.setDue_Date(args.get(DUE_DATE));
    tasks.setPriority(args.get(PRIORITY));
    tasks.setSubject(args.get(SUBJECT));
    tasks.setStatus(args.get(STATUS));
    String xmlout = null;
    try {
        xmlout = tasks.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> accountAttrList = new ArrayList<NameValuePair>();
    accountAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    accountAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    accountAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_TASK_XML_URL + INSERT_RECORDS, accountAttrList);
    String responseBody = null;

    TransportResponse response = null;

    try {
        response = TransportMachinery.post(tst);
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    responseBody = response.entityToString();

    outMap.put(OUTPUT, responseBody);
    return outMap;
}

From source file:org.megam.deccanplato.provider.zoho.crm.handler.SolutionImpl.java

/**
 * this method creates a Solution in zoho.com and returns that Solution id.
 * and it uses the business support class Solutions to populate ZOHO XML input
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap /*from  www  . ja  v  a  2 s. c  o  m*/
 */
private Map<String, String> create(Map<String, String> outMap) {

    Solutions solutions = new Solutions();
    solutions.setAnswer(args.get(SOLUTION_TITLE));
    solutions.setQuestion(args.get(QUESTION));
    solutions.setSolution_Title(args.get(ANSWER));
    solutions.setStatus(args.get(STATUS));
    String xmlout = null;
    try {
        xmlout = solutions.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> accountAttrList = new ArrayList<NameValuePair>();
    accountAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    accountAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    accountAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_SOLUTION_XML_URL + INSERT_RECORDS, accountAttrList);
    String responseBody = null;

    TransportResponse response = null;

    try {
        response = TransportMachinery.post(tst);
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    responseBody = response.entityToString();

    outMap.put(OUTPUT, responseBody);
    return outMap;
}

From source file:org.megam.deccanplato.provider.zoho.crm.handler.EventImpl.java

/**
 * this method update a particular Event in zoho.com and returns success message with updated Event id.
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap //  ww w . j  av  a 2 s.c om
 */
private Map<String, String> update(Map<String, String> outMap) {

    Events events = new Events();
    events.setStart_DateTime(args.get(START_DATE_TIME));
    events.setEnd_DateTime(args.get(END_DATE_TIME));
    events.setSubject(args.get(SUBJECT));
    events.setVenue(args.get(VENUE));
    String xmlout = null;
    try {
        xmlout = events.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> eventAttrList = new ArrayList<NameValuePair>();
    eventAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    eventAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    eventAttrList.add(new BasicNameValuePair(ID, args.get(ID)));
    eventAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_EVENT_XML_URL + UPDATE_RECORDS, eventAttrList);
    String responseBody = null;

    TransportResponse response = null;

    try {
        response = TransportMachinery.post(tst);
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    responseBody = response.entityToString();

    outMap.put(OUTPUT, responseBody);
    return outMap;

}

From source file:org.megam.deccanplato.provider.zoho.crm.handler.TaskImpl.java

/**
 * this method update a particular Task in zoho.com and returns success message with updated Task id.
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap //from w  w w.j a v  a 2 s. co  m
 */
private Map<String, String> update(Map<String, String> outMap) {

    Tasks tasks = new Tasks();
    tasks.setDue_Date(args.get(DUE_DATE));
    tasks.setPriority(args.get(PRIORITY));
    tasks.setSubject(args.get(SUBJECT));
    tasks.setStatus(args.get(STATUS));
    String xmlout = null;
    try {
        xmlout = tasks.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> accountAttrList = new ArrayList<NameValuePair>();
    accountAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    accountAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    accountAttrList.add(new BasicNameValuePair(ID, args.get(ID)));
    accountAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_TASK_XML_URL + UPDATE_RECORDS, accountAttrList);
    String responseBody = null;

    TransportResponse response = null;

    try {
        response = TransportMachinery.post(tst);
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    responseBody = response.entityToString();

    outMap.put(OUTPUT, responseBody);
    return outMap;

}

From source file:org.megam.deccanplato.provider.zoho.crm.handler.SolutionImpl.java

/**
 * this method update a particular Solution in zoho.com and returns success message with updated Solution id.
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap /*from w ww  .j  a  v a2  s  .co  m*/
 */
private Map<String, String> update(Map<String, String> outMap) {

    Solutions solutions = new Solutions();
    solutions.setAnswer(args.get(SOLUTION_TITLE));
    solutions.setQuestion(args.get(QUESTION));
    solutions.setSolution_Title(args.get(ANSWER));
    solutions.setStatus(args.get(STATUS));
    String xmlout = null;
    try {
        xmlout = solutions.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> accountAttrList = new ArrayList<NameValuePair>();
    accountAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    accountAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    accountAttrList.add(new BasicNameValuePair(ID, args.get(ID)));
    accountAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_SOLUTION_XML_URL + UPDATE_RECORDS, accountAttrList);
    String responseBody = null;

    TransportResponse response = null;

    try {
        response = TransportMachinery.post(tst);
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    responseBody = response.entityToString();

    outMap.put(OUTPUT, responseBody);
    return outMap;

}

From source file:com.ibm.opensirf.jaxrs.ObjectApi.java

@GET
@Path("container/{containername}/{po}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public PreservationObjectInformation getPOMetadata(@PathParam("containername") String containerName,
        @PathParam("po") String poUUID) throws IOException {
    JCloudsApi jcloudsSwift = new JCloudsApi();
    InputStream is = jcloudsSwift.getFileInputStream(containerName, SIRFContainer.SIRF_DEFAULT_CATALOG_ID);
    SIRFCatalog catalog = null;/* w  w w  .ja va 2 s.  c  om*/
    PreservationObjectInformation poi = null;

    try {
        catalog = new SIRFCatalogUnmarshaller("application/json").unmarshalCatalog(is);
        poi = catalog.getSirfObjects().get(poUUID);
        jcloudsSwift.close();
    } catch (IOException ioe) {
        ioe.printStackTrace();
    } catch (JAXBException jbe) {
        jbe.printStackTrace();
    }

    return poi;
}

From source file:org.megam.deccanplato.provider.zoho.crm.handler.PotentialImpl.java

/**
 * this method creates a Potential in zoho.com and returns that Potential id.
 * and it uses the business support class Potentials to populate ZOHO XML input
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap //from  w ww.  jav  a 2 s .c o  m
 */
private Map<String, String> create(Map<String, String> outMap) {

    Potentials potentials = new Potentials();
    potentials.setPotential_Name(args.get(POTENTIAL_NAME));
    potentials.setAccount_Name(args.get(ACCOUNT_NAME));
    potentials.setClose_Date(args.get(CLOSING_DATE));
    potentials.setStage(args.get(STAGE));
    potentials.setAmount(args.get(AMOUNT));
    String xmlout = null;
    try {
        xmlout = potentials.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> potentialAttrList = new ArrayList<NameValuePair>();
    potentialAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    potentialAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    potentialAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_POTENTIAL_XML_URL + INSERT_RECORDS, potentialAttrList);
    String responseBody = null;

    TransportResponse response = null;

    try {
        response = TransportMachinery.post(tst);
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    responseBody = response.entityToString();

    outMap.put(OUTPUT, responseBody);
    return outMap;
}

From source file:org.megam.deccanplato.provider.zoho.crm.handler.ContactImpl.java

/**
 * this method creates a Contact in zoho.com and returns that Contact id.
 * and it uses the business support class Contacts to populate ZOHO XML input
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap /*from w  w w  .  ja v  a  2 s  . co  m*/
 */
private Map<String, String> create(Map<String, String> outMap) {

    Contacts contacts = new Contacts();
    contacts.setLast_Name(args.get(LASTNAME));
    contacts.setEmail(args.get(EMAIL));
    contacts.setLead_Source(args.get(LEAD_SOURCE));
    contacts.setFax(args.get(FAX));
    contacts.setPhone(args.get(PHONE));
    String xmlout = null;
    try {
        xmlout = contacts.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> contactAttrList = new ArrayList<NameValuePair>();
    contactAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    contactAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    contactAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_CONTACT_XML_URL + INSERT_RECORDS, contactAttrList);
    String responseBody = null;

    TransportResponse response = null;

    try {
        response = TransportMachinery.post(tst);
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    responseBody = response.entityToString();

    outMap.put(OUTPUT, responseBody);
    return outMap;
}

From source file:org.megam.deccanplato.provider.zoho.crm.handler.AccountImpl.java

/**
 * this method creates an account in zoho.com and returns that account id.
 * and it uses the business support class Accounts to populate ZOHO XML input
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap /*from ww w .  j  a  v  a  2 s .c o  m*/
 */
private Map<String, String> create(Map<String, String> outMap) {

    Accounts accounts = new Accounts();
    accounts.setAccount_Name(args.get(ACCOUNTNAME));
    //accounts.setAccount_owner(args.get(ACCOUNTOWNER));
    accounts.setAnual_Revenue(args.get(ANNUALREVENUE));
    accounts.setEmployees(args.get(EMPLOYEES));
    accounts.setFax(args.get(FAX));
    accounts.setPhone(args.get(PHONE));
    String xmlout = null;
    try {
        xmlout = accounts.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> accountAttrList = new ArrayList<NameValuePair>();
    accountAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    accountAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    accountAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_ACCOUNT_XML_URL + INSERT_RECORDS, accountAttrList);
    String responseBody = null;

    TransportResponse response = null;

    try {
        response = TransportMachinery.post(tst);
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    responseBody = response.entityToString();

    outMap.put(OUTPUT, responseBody);
    return outMap;
}

From source file:org.megam.deccanplato.provider.zoho.crm.handler.CallImpl.java

/**
 * this method creates a call in zoho.com and returns that CALL id.
 * and it uses the business support class Calls to populate ZOHO XML input
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap /*  ww  w.j av  a  2  s. c o  m*/
 */
private Map<String, String> create(Map<String, String> outMap) {

    Calls calls = new Calls();
    calls.setCall_Duration(args.get(CALL_DURATION));
    calls.setCall_From_To(args.get(CALL_FROM_TO));
    calls.setSubject(args.get(SUBJECT));
    calls.setCall_Start_Time(args.get(CALL_START_TIME));
    calls.setContact_Name(args.get(CONTACT_NAME));
    calls.setCall_Type(CALL_TYPE);
    String xmlout = null;
    try {
        xmlout = calls.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> callAttrList = new ArrayList<NameValuePair>();
    callAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    callAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    callAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_CALL_XML_URL + INSERT_RECORDS, callAttrList);
    String responseBody = null;

    TransportResponse response = null;

    try {
        response = TransportMachinery.post(tst);
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    responseBody = response.entityToString();

    outMap.put(OUTPUT, responseBody);
    return outMap;
}