Example usage for com.google.gwt.gdata.client.analytics AccountEntry getTableId

List of usage examples for com.google.gwt.gdata.client.analytics AccountEntry getTableId

Introduction

In this page you can find the example usage for com.google.gwt.gdata.client.analytics AccountEntry getTableId.

Prototype

public final native TableId getTableId() ;

Source Link

Document

Returns the data source ID.

Usage

From source file:com.google.gwt.gdata.sample.hellogdata.client.AnalyticsBounceRateDemo.java

License:Apache License

/**
 * Retrieve the Analytics accounts feed using the Analytics service and
 * the accounts feed uri. In GData all get, insert, update and delete methods
 * always receive a callback defining success and failure handlers.
 * Here, the failure handler displays an error message while the
 * success handler picks up the first Account entry and
 * calls queryData to retrieve the data feed for that account.
 * /*  w w  w  .  j  a v a 2  s .  c  om*/
 * @param accountsFeedUri The uri of the accounts feed
 */
private void getAccounts(String accountsFeedUri) {
    showStatus("Loading Analytics accounts feed...", false);
    service.getAccountFeed(accountsFeedUri, new AccountFeedCallback() {
        public void onFailure(CallErrorException caught) {
            showStatus("An error occurred while retrieving the Analytics " + "Accounts feed: "
                    + caught.getMessage(), true);
        }

        public void onSuccess(AccountFeed result) {
            AccountEntry[] entries = result.getEntries();
            if (entries.length == 0) {
                showStatus("You have no Analytics accounts.", false);
            } else {
                AccountEntry targetEntry = entries[0];
                queryData(targetEntry.getTableId().getValue());
            }
        }
    });
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.AnalyticsYourAccountsDemo.java

License:Apache License

/**
* Displays a set of Analytics data entries in a tabular fashion with
* the help of a GWT FlexTable widget. The data fields Account Name,
* Profile Name, Profile Id and Table Id are displayed.
* 
* @param entries The Analytics data entries to display.
*//*from  ww  w  . ja  va2  s. com*/
private void showData(AccountEntry[] entries) {
    mainPanel.clear();
    String[] labels = new String[] { "Account Name", "Profile Name", "Profile Id", "Table Id" };
    mainPanel.insertRow(0);
    for (int i = 0; i < labels.length; i++) {
        mainPanel.addCell(0);
        mainPanel.setWidget(0, i, new Label(labels[i]));
        mainPanel.getFlexCellFormatter().setStyleName(0, i, "hm-tableheader");
    }
    for (int i = 0; i < entries.length; i++) {
        AccountEntry entry = entries[i];
        int row = mainPanel.insertRow(i + 1);
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 0, new Label(entry.getPropertyValue("ga:AccountName")));
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 1, new Label(entry.getTitle().getText()));
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 2, new Label(entry.getPropertyValue("ga:ProfileId")));
        mainPanel.addCell(row);
        mainPanel.setWidget(row, 3, new Label(entry.getTableId().getValue()));
    }
}