Search in sources :

Example 11 with ActivityDTO

use of org.activityinfo.legacy.shared.model.ActivityDTO in project activityinfo by bedatadriven.

the class SiteGridPanel method updateHeading.

private void updateHeading(final Filter filter) {
    setHeadingText(I18N.CONSTANTS.sitesHeader());
    dispatcher.execute(new GetSchema(), new AsyncCallback<SchemaDTO>() {

        @Override
        public void onFailure(Throwable caught) {
        // TODO Auto-generated method stub
        }

        @Override
        public void onSuccess(SchemaDTO result) {
            if (filter.isDimensionRestrictedToSingleCategory(DimensionType.Activity)) {
                int activityId = filter.getRestrictedCategory(DimensionType.Activity);
                ActivityDTO activity = result.getActivityById(activityId);
                setHeadingText(activity.getDatabaseName() + " - " + activity.getName());
            } else if (filter.isDimensionRestrictedToSingleCategory(DimensionType.Database)) {
                int databaseId = filter.getRestrictedCategory(DimensionType.Database);
                UserDatabaseDTO db = result.getDatabaseById(databaseId);
                setHeadingText(db.getName());
            }
        }
    });
}
Also used : UserDatabaseDTO(org.activityinfo.legacy.shared.model.UserDatabaseDTO) ActivityDTO(org.activityinfo.legacy.shared.model.ActivityDTO) GetSchema(org.activityinfo.legacy.shared.command.GetSchema) SchemaDTO(org.activityinfo.legacy.shared.model.SchemaDTO)

Aggregations

ActivityDTO (org.activityinfo.legacy.shared.model.ActivityDTO)11 GetSchema (org.activityinfo.legacy.shared.command.GetSchema)4 UserDatabaseDTO (org.activityinfo.legacy.shared.model.UserDatabaseDTO)4 ModelData (com.extjs.gxt.ui.client.data.ModelData)3 SchemaDTO (org.activityinfo.legacy.shared.model.SchemaDTO)3 MessageBoxEvent (com.extjs.gxt.ui.client.event.MessageBoxEvent)1 Record (com.extjs.gxt.ui.client.store.Record)1 TreePanel (com.extjs.gxt.ui.client.widget.treepanel.TreePanel)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 ArrayList (java.util.ArrayList)1 XFormList (org.activityinfo.io.xform.formList.XFormList)1 XFormListItem (org.activityinfo.io.xform.formList.XFormListItem)1 AuthenticatedUser (org.activityinfo.legacy.shared.AuthenticatedUser)1 Filter (org.activityinfo.legacy.shared.command.Filter)1 GetActivityForm (org.activityinfo.legacy.shared.command.GetActivityForm)1 SiteResult (org.activityinfo.legacy.shared.command.result.SiteResult)1 FolderDTO (org.activityinfo.legacy.shared.model.FolderDTO)1 SiteDTO (org.activityinfo.legacy.shared.model.SiteDTO)1