Search in sources :

Example 16 with UserDatabaseDTO

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

the class SchemaCsvWriterV3Test method setup.

@Before
public void setup() throws IOException {
    LocaleProxy.initialize();
    database = new UserDatabaseDTO(1, "Survey DB");
    formClassProvider = new TestBatchFormClassProvider();
    setupSurveyForm();
    setupMonthly();
    expectedSurveyExport = readExport("survey.csv");
}
Also used : UserDatabaseDTO(org.activityinfo.legacy.shared.model.UserDatabaseDTO) TestBatchFormClassProvider(org.activityinfo.model.formTree.TestBatchFormClassProvider) Before(org.junit.Before)

Example 17 with UserDatabaseDTO

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

the class NewDbExistingListPage method updateDialogData.

private void updateDialogData() {
    UserDatabaseDTO db = getSelectedDb();
    dialogData.setSourceDatabaseCountryId(db.getCountry().getId());
    dialogData.getCommand().setSourceDatabaseId(db.getId());
    dialogData.setHasDesignPrivileges(db.isDesignAllowed());
}
Also used : UserDatabaseDTO(org.activityinfo.legacy.shared.model.UserDatabaseDTO)

Example 18 with UserDatabaseDTO

use of org.activityinfo.legacy.shared.model.UserDatabaseDTO 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

UserDatabaseDTO (org.activityinfo.legacy.shared.model.UserDatabaseDTO)18 GetSchema (org.activityinfo.legacy.shared.command.GetSchema)11 SchemaDTO (org.activityinfo.legacy.shared.model.SchemaDTO)9 Test (org.junit.Test)8 CreateEntity (org.activityinfo.legacy.shared.command.CreateEntity)4 GetActivityForm (org.activityinfo.legacy.shared.command.GetActivityForm)4 ActivityDTO (org.activityinfo.legacy.shared.model.ActivityDTO)4 ActivityFormDTO (org.activityinfo.legacy.shared.model.ActivityFormDTO)4 OnDataSet (org.activityinfo.server.database.OnDataSet)3 CreateResult (org.activityinfo.legacy.shared.command.result.CreateResult)2 AttributeGroupDTO (org.activityinfo.legacy.shared.model.AttributeGroupDTO)2 Before (org.junit.Before)2 BaseListLoadResult (com.extjs.gxt.ui.client.data.BaseListLoadResult)1 Function (com.google.common.base.Function)1 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 XFormList (org.activityinfo.io.xform.formList.XFormList)1