Search in sources :

Example 1 with DescribeSoftphoneLayoutResult

use of com.salesforce.soap.partner.DescribeSoftphoneLayoutResult in project tdi-studio-se by Talend.

the class PartnerSamples method describeSoftphoneLayoutSample.

private void describeSoftphoneLayoutSample() {
    if (!loggedIn) {
        if (!login()) {
            return;
        }
    }
    try {
        DescribeSoftphoneLayoutResult slr = binding.describeSoftphoneLayout();
        DescribeSoftphoneLayoutCallType[] callTypes = slr.getCallTypes();
        System.out.println("There are " + callTypes.length + " call types.");
        for (int i = 0; i < callTypes.length; i++) {
            DescribeSoftphoneLayoutCallType callType = callTypes[i];
            DescribeSoftphoneLayoutInfoField[] fields = callType.getInfoFields();
            System.out.println("    There are " + fields.length + " info fields.");
            for (int j = 0; j < fields.length; j++) {
                System.out.println("\t" + fields[j].getName() + "\n");
            }
            DescribeSoftphoneLayoutSection[] sections = callType.getSections();
            System.out.println("\tThere are " + sections.length + " sections on this layout.");
            for (int j = 0; j < sections.length; j++) {
                DescribeSoftphoneLayoutSection section = sections[j];
                DescribeSoftphoneLayoutItem[] items = section.getItems();
                for (int k = 0; k < items.length; k++) {
                    DescribeSoftphoneLayoutItem item = items[k];
                    System.out.println("Section " + j + " - item api name: " + item.getItemApiName());
                }
            }
        }
        getUserInput("\nHit return to continue...");
    } catch (ApiFault af) {
        System.out.println("\nFailed to describe softphone layout, error message was: \n" + af.getExceptionMessage());
        getUserInput("\nHit return to continue...");
    } catch (Exception ex) {
        System.out.println("\nFailed to describe softphone layout , error message was: \n" + ex.getMessage());
        getUserInput("\nHit return to continue...");
    }
}
Also used : ApiFault(com.salesforce.soap.partner.fault.ApiFault) DescribeSoftphoneLayoutItem(com.salesforce.soap.partner.DescribeSoftphoneLayoutItem) DescribeSoftphoneLayoutResult(com.salesforce.soap.partner.DescribeSoftphoneLayoutResult) DescribeSoftphoneLayoutCallType(com.salesforce.soap.partner.DescribeSoftphoneLayoutCallType) DescribeSoftphoneLayoutSection(com.salesforce.soap.partner.DescribeSoftphoneLayoutSection) DescribeSoftphoneLayoutInfoField(com.salesforce.soap.partner.DescribeSoftphoneLayoutInfoField) RemoteException(java.rmi.RemoteException) ServiceException(javax.xml.rpc.ServiceException) IOException(java.io.IOException)

Aggregations

DescribeSoftphoneLayoutCallType (com.salesforce.soap.partner.DescribeSoftphoneLayoutCallType)1 DescribeSoftphoneLayoutInfoField (com.salesforce.soap.partner.DescribeSoftphoneLayoutInfoField)1 DescribeSoftphoneLayoutItem (com.salesforce.soap.partner.DescribeSoftphoneLayoutItem)1 DescribeSoftphoneLayoutResult (com.salesforce.soap.partner.DescribeSoftphoneLayoutResult)1 DescribeSoftphoneLayoutSection (com.salesforce.soap.partner.DescribeSoftphoneLayoutSection)1 ApiFault (com.salesforce.soap.partner.fault.ApiFault)1 IOException (java.io.IOException)1 RemoteException (java.rmi.RemoteException)1 ServiceException (javax.xml.rpc.ServiceException)1