Search in sources :

Example 1 with DescribeTab

use of com.salesforce.soap.partner.DescribeTab 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...");
    }
}
Also used : DescribeTabSetResult(com.salesforce.soap.partner.DescribeTabSetResult) ApiFault(com.salesforce.soap.partner.fault.ApiFault) DescribeTab(com.salesforce.soap.partner.DescribeTab) RemoteException(java.rmi.RemoteException) ServiceException(javax.xml.rpc.ServiceException) IOException(java.io.IOException)

Aggregations

DescribeTab (com.salesforce.soap.partner.DescribeTab)1 DescribeTabSetResult (com.salesforce.soap.partner.DescribeTabSetResult)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