use of org.applause.lang.applauseDsl.DataSourceCall in project applause by applause.
the class DefaultDetailsScreenModuleFileCompiler method dataAccessMethodNameForCreate.
public String dataAccessMethodNameForCreate(final Screen it) {
DataSourceCall _datasource = it.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {
public Boolean apply(final DataSourceAccessMethod it) {
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
boolean _equals = Objects.equal(_verb, RESTVerb.POST);
return Boolean.valueOf(_equals);
}
};
DataSourceAccessMethod _findFirst = IterableExtensions.<DataSourceAccessMethod>findFirst(_methods, _function);
String _name = _findFirst.getName();
return _name;
}
use of org.applause.lang.applauseDsl.DataSourceCall in project applause by applause.
the class DefaultDetailsScreenModuleFileCompiler method dataAccessMethodNameForUpdate.
public String dataAccessMethodNameForUpdate(final Screen it) {
DataSourceCall _datasource = it.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {
public Boolean apply(final DataSourceAccessMethod it) {
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
boolean _equals = Objects.equal(_verb, RESTVerb.PUT);
return Boolean.valueOf(_equals);
}
};
DataSourceAccessMethod _findFirst = IterableExtensions.<DataSourceAccessMethod>findFirst(_methods, _function);
String _name = _findFirst.getName();
return _name;
}
use of org.applause.lang.applauseDsl.DataSourceCall in project applause by applause.
the class ScreensValidationTestHelper method hasDataSource.
public void hasDataSource(final CharSequence sequence) {
try {
final Model model = this._parseHelper.parse(sequence);
EList<NamedElement> _elements = model.getElements();
Iterable<Screen> _filter = Iterables.<Screen>filter(_elements, Screen.class);
final Screen screen = IterableExtensions.<Screen>head(_filter);
DataSourceCall _datasource = screen.getDatasource();
Assert.assertNotNull(_datasource);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.applause.lang.applauseDsl.DataSourceCall in project applause by applause.
the class ApplauseDslScopeProvider method scope_RESTMethodCall_restMethod.
public IScope scope_RESTMethodCall_restMethod(final RESTMethodCall ctx, final EReference ref) {
DataSourceCall _datasource = ctx.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
IScope _scopeFor = Scopes.scopeFor(_methods);
return _scopeFor;
}
use of org.applause.lang.applauseDsl.DataSourceCall in project applause by applause.
the class DefaultListScreenClassExtensions method resourceType.
public Entity resourceType(final Screen it) {
DataSourceCall _datasource = it.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
Entity _resourceType = _datasource_1.getResourceType();
return _resourceType;
}
Aggregations