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...");
}
}
Aggregations