Search in sources :

Example 1 with DataSourceCall

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;
}
Also used : DataSourceCall(org.applause.lang.applauseDsl.DataSourceCall) DataSourceAccessMethod(org.applause.lang.applauseDsl.DataSourceAccessMethod) RESTSpecification(org.applause.lang.applauseDsl.RESTSpecification) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) RESTVerb(org.applause.lang.applauseDsl.RESTVerb) DataSource(org.applause.lang.applauseDsl.DataSource)

Example 2 with DataSourceCall

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;
}
Also used : DataSourceCall(org.applause.lang.applauseDsl.DataSourceCall) DataSourceAccessMethod(org.applause.lang.applauseDsl.DataSourceAccessMethod) RESTSpecification(org.applause.lang.applauseDsl.RESTSpecification) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) RESTVerb(org.applause.lang.applauseDsl.RESTVerb) DataSource(org.applause.lang.applauseDsl.DataSource)

Example 3 with DataSourceCall

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);
    }
}
Also used : DataSourceCall(org.applause.lang.applauseDsl.DataSourceCall) Screen(org.applause.lang.applauseDsl.Screen) Model(org.applause.lang.applauseDsl.Model) NamedElement(org.applause.lang.applauseDsl.NamedElement)

Example 4 with DataSourceCall

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;
}
Also used : DataSourceCall(org.applause.lang.applauseDsl.DataSourceCall) DataSourceAccessMethod(org.applause.lang.applauseDsl.DataSourceAccessMethod) IScope(org.eclipse.xtext.scoping.IScope) DataSource(org.applause.lang.applauseDsl.DataSource)

Example 5 with DataSourceCall

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;
}
Also used : Entity(org.applause.lang.applauseDsl.Entity) DataSourceCall(org.applause.lang.applauseDsl.DataSourceCall) DataSource(org.applause.lang.applauseDsl.DataSource)

Aggregations

DataSourceCall (org.applause.lang.applauseDsl.DataSourceCall)11 DataSource (org.applause.lang.applauseDsl.DataSource)7 DataSourceAccessMethod (org.applause.lang.applauseDsl.DataSourceAccessMethod)5 Entity (org.applause.lang.applauseDsl.Entity)3 RESTSpecification (org.applause.lang.applauseDsl.RESTSpecification)3 RESTVerb (org.applause.lang.applauseDsl.RESTVerb)3 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)3 Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)3 Screen (org.applause.lang.applauseDsl.Screen)2 Model (org.applause.lang.applauseDsl.Model)1 NamedElement (org.applause.lang.applauseDsl.NamedElement)1 UIComponentMemberConfiguration (org.applause.lang.applauseDsl.UIComponentMemberConfiguration)1 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)1 IScope (org.eclipse.xtext.scoping.IScope)1