use of com.salesforce.soap.partner.DescribeTabSetResult in project tdi-studio-se by Talend.
the class PartnerSamples method describeTabsSample.
private void describeTabsSample() {
if (!loggedIn) {
if (!login()) {
return;
}
}
try {
DescribeTabSetResult[] dtsrs = binding.describeTabs();
System.out.println("There are " + new Integer(dtsrs.length).toString() + " tabsets defined.");
for (int i = 0; i < dtsrs.length; i++) {
System.out.println("Tabset " + new Integer(i + 1).toString() + ":");
DescribeTabSetResult dtsr = dtsrs[i];
String tabSetLabel = dtsr.getLabel();
String logoUrl = dtsr.getLogoUrl();
boolean isSelected = dtsr.isSelected();
DescribeTab[] tabs = dtsr.getTabs();
System.out.println("Label is " + tabSetLabel + " logo url is " + logoUrl + ", there are " + new Integer(tabs.length) + " tabs defined in this set.");
for (int j = 0; j < tabs.length; j++) {
DescribeTab tab = tabs[j];
String tabLabel = tab.getLabel();
String objectName = tab.getSobjectName();
String tabUrl = tab.getUrl();
System.out.println("\tTab " + new Integer(j + 1) + ": \n\t\tLabel = " + tabLabel + "\n\t\tObject details on tab: " + objectName + "\n\t\t" + "Url to tab: " + tabUrl);
}
}
getUserInput("\nHit return to continue...");
} catch (ApiFault af) {
System.out.println("Failed to successfully describe tabs.\n\n" + af.getExceptionMessage());
getUserInput("\nHit return to continue...");
} catch (Exception ex) {
System.out.println("Failed to successfully describe tabs.\n\n" + ex.getMessage());
getUserInput("\nHit return to continue...");
}
}
Aggregations