use of org.activityinfo.server.DeploymentConfiguration in project activityinfo by bedatadriven.
the class ConfigModule method provideDeploymentConfig.
@Provides
@Singleton
public DeploymentConfiguration provideDeploymentConfig(ServletContext context) {
Properties properties = new Properties();
tryToLoadFrom(properties, webInfDirectory(context));
tryToLoadFrom(properties, systemSettings());
tryToLoadFrom(properties, userSettings());
if (DeploymentEnvironment.isAppEngine()) {
tryToLoadFromAppEngineDatastore(properties);
tryToLoadFromDefaultBucket(properties);
}
// -Dactivityinfo.config=/path/to/conf.properties
if (!Strings.isNullOrEmpty(System.getProperty("activityinfo.config"))) {
tryToLoadFrom(properties, new File(System.getProperty("activityinfo.config")));
}
return new DeploymentConfiguration(properties);
}
use of org.activityinfo.server.DeploymentConfiguration in project activityinfo by bedatadriven.
the class ConfigModuleStub method provideDeploymentConfig.
@Provides
public DeploymentConfiguration provideDeploymentConfig() {
Properties properties = new Properties();
properties.setProperty(DeploymentConfiguration.BLOBSERVICE_GCS_BUCKET_NAME, "app_default_bucket");
return new DeploymentConfiguration(properties);
}
use of org.activityinfo.server.DeploymentConfiguration in project activityinfo by bedatadriven.
the class XFormResourceTest method setUp.
@Before
public void setUp() throws IOException {
objectifyService = ObjectifyService.begin();
Provider<AuthenticatedUser> authProvider = Providers.of(new AuthenticatedUser("", USER_ID, "jorden@bdd.com"));
resourceLocator = new ResourceLocatorSyncImpl(injector.getProvider(FormStorageProvider.class), authProvider, new PermissionOracle(injector.getProvider(EntityManager.class)), new BlobAuthorizerStub());
OdkFormFieldBuilderFactory fieldFactory = new OdkFormFieldBuilderFactory(resourceLocator);
AuthTokenProvider tokenService = new AuthTokenProvider();
TestBlobstoreService blobstore = new TestBlobstoreService(injector.getInstance(DeploymentConfiguration.class), injector.getInstance(EntityManager.class));
TestInstanceIdService idService = new TestInstanceIdService();
SubmissionArchiver backupService = new SubmissionArchiver(new DeploymentConfiguration(new Properties()));
formResource = new XFormResources(resourceLocator, authProvider, fieldFactory, tokenService);
formSubmissionResource = new XFormSubmissionResource(getDispatcherSync(), resourceLocator, tokenService, blobstore, idService, backupService);
}
use of org.activityinfo.server.DeploymentConfiguration in project activityinfo by bedatadriven.
the class HostControllerTest method setup.
@Before
public void setup() {
DeploymentConfiguration deploymentConfig = new DeploymentConfiguration(new Properties());
authProvider = new ServerSideAuthProvider();
authProvider.clear();
entityManager = createMock(EntityManager.class);
expect(entityManager.find(User.class, 3)).andReturn(new User()).anyTimes();
replay(entityManager);
resource = new HostController(authProvider, Providers.of(entityManager));
}
use of org.activityinfo.server.DeploymentConfiguration in project activityinfo by bedatadriven.
the class PostmarkMailSenderTest method setUp.
@Before
public void setUp() throws TemplateModelException {
Properties properties = new Properties();
properties.setProperty(PostmarkMailSender.POSTMARK_API_KEY, "POSTMARK_API_TEST");
DeploymentConfiguration config = new DeploymentConfiguration(properties);
TemplateModule templateModule = new TemplateModule();
sender = new PostmarkMailSender(config, templateModule.provideConfiguration(Providers.of(Domain.DEFAULT)));
}
Aggregations