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.PotentialImpl.java

/**
 * this method update a particular Potential in zoho.com and returns success message with updated Potential id.
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap //from  w  w  w . j  a va2s  .c  o m
 */
private Map<String, String> update(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(ID, args.get(ID)));
    potentialAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_POTENTIAL_XML_URL + UPDATE_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:com.ibm.opensirf.jaxrs.ObjectApi.java

@DELETE
@Path("container/{containername}/{po}")
public Response deletePO(@PathParam("containername") String containerName, @PathParam("po") String poName)
        throws IOException, URISyntaxException {

    // TODO: overload with other DELETE

    JCloudsApi jcloudsSwift = new JCloudsApi();
    InputStream is = jcloudsSwift.getFileInputStream(containerName, SIRFContainer.SIRF_DEFAULT_CATALOG_ID);
    SIRFCatalog catalog = null;//from www .  j a  va  2s.  co  m

    try {
        catalog = new SIRFCatalogUnmarshaller("application/json").unmarshalCatalog(is);
        catalog.getSirfObjects().remove(poName);
        jcloudsSwift.uploadObjectFromString(containerName, SIRFContainer.SIRF_DEFAULT_CATALOG_ID,
                new SIRFCatalogMarshaller("application/json").marshalCatalog(catalog));
        jcloudsSwift.close();
    } catch (IOException ioe) {
        ioe.printStackTrace();
    } catch (JAXBException jbe) {
        jbe.printStackTrace();
    }

    return Response.ok().build();
}

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

/**
 * this method creates a case in zoho.com and returns that case id.
 * and it uses the business support class cases 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.j a v  a2s.  c  om*/
 */
private Map<String, String> create(Map<String, String> outMap) {

    Cases cases = new Cases();
    cases.setCase_Type(args.get(CASE_TYPE));
    cases.setCase_Origin(args.get(CASE_ORIGIN));
    cases.setCase_Reason(args.get(CASE_REASON));
    cases.setStatus(args.get(STATUS));
    cases.setPriority(args.get(PRIORITY));
    cases.setSubject(args.get(SUBJECT));
    String xmlout = null;
    try {
        xmlout = cases.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> caseAttrList = new ArrayList<NameValuePair>();
    caseAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    caseAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    caseAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_CASE_XML_URL + INSERT_RECORDS, caseAttrList);
    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 update a particular Contact in zoho.com and returns success message with updated Contact id.
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap /*from   w  w  w .  jav  a  2  s.  c  o  m*/
 */
private Map<String, String> update(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(ID, args.get(ID)));
    contactAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_CONTACT_XML_URL + UPDATE_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.CallImpl.java

/**
 * this method update a particular call in zoho.com and returns success message with updated call 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  2s .  c o m*/
 */
private Map<String, String> update(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(ID, args.get(ID)));
    callAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_CALL_XML_URL + UPDATE_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;

}

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

/**
 * this method update a particular account in zoho.com and returns success message with updated account id.
 * This method takes input as a MAP(contains json dada) and returns a MAP.
 * @param outMap // ww w  .j a va  2 s.  co m
 */
private Map<String, String> update(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(ID, args.get(ID)));
    accountAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_ACCOUNT_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.CaseImpl.java

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

    Cases cases = new Cases();
    cases.setCase_Type(args.get(CASE_TYPE));
    cases.setCase_Origin(args.get(CASE_ORIGIN));
    cases.setCase_Reason(args.get(CASE_REASON));
    cases.setStatus(args.get(STATUS));
    cases.setPriority(args.get(PRIORITY));
    cases.setSubject(args.get(SUBJECT));
    String xmlout = null;
    try {
        xmlout = cases.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> caseAttrList = new ArrayList<NameValuePair>();
    caseAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    caseAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    caseAttrList.add(new BasicNameValuePair(ID, args.get(ID)));
    caseAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_CASE_XML_URL + UPDATE_RECORDS, caseAttrList);
    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.CampaignImpl.java

/**
 * this method creates a Campaign in zoho.com and returns that Campaign id.
 * and it uses the business support class Campaigns 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. j  av a  2  s.co  m
 */
private Map<String, String> create(Map<String, String> outMap) {

    Campaigns campaigns = new Campaigns();
    campaigns.setCampaign_Name(args.get(CAMPAIGN_NAME));
    campaigns.setStart_Date(args.get(START_DATE));
    campaigns.setEnd_Date(args.get(END_DATE));
    campaigns.setStatus(args.get(STATUS));
    campaigns.setExpected_Revenue(args.get(EXPECTED_REVENUE));
    campaigns.setBudgeted_Cost(args.get(BUDGETED_COST));
    campaigns.setActual_Cost(args.get(ACTUAL_COST));
    String xmlout = null;
    try {
        xmlout = campaigns.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> campaignAttrList = new ArrayList<NameValuePair>();
    campaignAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    campaignAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    campaignAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_CAMPAIGN_XML_URL + INSERT_RECORDS, campaignAttrList);
    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.invoice.handler.ItemImpl.java

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

    final String ZOHO_INVOICE_ITEM_CREATE_URL = ZOHO_INVOICE_ITEM + "create";

    Item itm = new Item();
    itm.setName(args.get(ITEM_NAME));
    itm.setDescription(args.get(DESCRIPTION));
    itm.setRate(args.get(RATE));
    itm.setTax1Name(args.get(TAX_NAME_1));
    String xmlout = null;
    try {
        xmlout = itm.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> createAttrList = new ArrayList<NameValuePair>();
    createAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    createAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    createAttrList.add(new BasicNameValuePair(ZOHO_XMLSTRING, xmlout));
    createAttrList.add(new BasicNameValuePair(APIKEY, args.get(APIKEY)));

    TransportTools tst = new TransportTools(ZOHO_INVOICE_ITEM_CREATE_URL, createAttrList);
    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.CampaignImpl.java

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

    Campaigns campaigns = new Campaigns();
    campaigns.setCampaign_Name(args.get(CAMPAIGN_NAME));
    campaigns.setStart_Date(args.get(START_DATE));
    campaigns.setEnd_Date(args.get(END_DATE));
    campaigns.setStatus(args.get(STATUS));
    campaigns.setExpected_Revenue(args.get(EXPECTED_REVENUE));
    campaigns.setBudgeted_Cost(args.get(BUDGETED_COST));
    campaigns.setActual_Cost(args.get(ACTUAL_COST));
    String xmlout = null;
    try {
        xmlout = campaigns.toXMLString();
    } catch (JAXBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    List<NameValuePair> campaignAttrList = new ArrayList<NameValuePair>();
    campaignAttrList.add(new BasicNameValuePair(OAUTH_TOKEN, args.get(AUTHTOKEN)));
    campaignAttrList.add(new BasicNameValuePair(ZOHO_SCOPE, SCOPE));
    campaignAttrList.add(new BasicNameValuePair(ID, args.get(ID)));
    campaignAttrList.add(new BasicNameValuePair(ZOHO_XMLDATA, xmlout));

    TransportTools tst = new TransportTools(ZOHO_CRM_CAMPAIGN_XML_URL + UPDATE_RECORDS, campaignAttrList);
    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;

}