Search in sources :

Example 11 with DataSource

use of org.applause.lang.applauseDsl.DataSource in project applause by applause.

the class DataAccessCompiler method doGenerate.

public void doGenerate(final Resource resource, final IFileSystemAccess fsa) {
    TreeIterator<EObject> _allContents = resource.getAllContents();
    Iterable<EObject> _iterable = IteratorExtensions.<EObject>toIterable(_allContents);
    Iterable<DataSource> _filter = Iterables.<DataSource>filter(_iterable, DataSource.class);
    final Procedure1<DataSource> _function = new Procedure1<DataSource>() {

        public void apply(final DataSource it) {
            Entity _resourceType = it.getResourceType();
            String _entityDataAccessCategoryHeaderFileName = DataAccessCompiler.this._dataAccessClassExtensions.entityDataAccessCategoryHeaderFileName(_resourceType);
            CharSequence _compileHeaderFile = DataAccessCompiler.this._entityDataAccessHeaderFileCompiler.compileHeaderFile(it);
            fsa.generateFile(_entityDataAccessCategoryHeaderFileName, IosOutputConfigurationProvider.IOS_OUTPUT_DATAACCESS, _compileHeaderFile);
            Entity _resourceType_1 = it.getResourceType();
            String _entityDataAccessCategoryModuleFileName = DataAccessCompiler.this._dataAccessClassExtensions.entityDataAccessCategoryModuleFileName(_resourceType_1);
            CharSequence _compileModuleFile = DataAccessCompiler.this._entityDataAccessModuleFileCompiler.compileModuleFile(it);
            fsa.generateFile(_entityDataAccessCategoryModuleFileName, IosOutputConfigurationProvider.IOS_OUTPUT_DATAACCESS, _compileModuleFile);
        }
    };
    IterableExtensions.<DataSource>forEach(_filter, _function);
}
Also used : Entity(org.applause.lang.applauseDsl.Entity) EObject(org.eclipse.emf.ecore.EObject) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) DataSource(org.applause.lang.applauseDsl.DataSource)

Example 12 with DataSource

use of org.applause.lang.applauseDsl.DataSource in project applause by applause.

the class EntityDataAccessExtensions method resourceType.

public Entity resourceType(final DataSourceAccessMethod it) {
    EObject _eContainer = it.eContainer();
    Entity _resourceType = ((DataSource) _eContainer).getResourceType();
    return _resourceType;
}
Also used : Entity(org.applause.lang.applauseDsl.Entity) EObject(org.eclipse.emf.ecore.EObject) DataSource(org.applause.lang.applauseDsl.DataSource)

Example 13 with DataSource

use of org.applause.lang.applauseDsl.DataSource in project applause by applause.

the class EntityDataAccessGeneratorSpec method isGeneratedHeaderFileFromModel.

public void isGeneratedHeaderFileFromModel(final CharSequence expectedGeneratedCode, final String dataSourceName, final CharSequence input) {
    final DataSource datasource = this.datasource(input, dataSourceName);
    final CharSequence result = this._entityDataAccessHeaderFileCompiler.compileHeaderFile(datasource);
    String _string = result.toString();
    String _string_1 = expectedGeneratedCode.toString();
    Matcher<String> _equalTo = CoreMatchers.<String>equalTo(_string_1);
    Assert.<String>assertThat(_string, _equalTo);
}
Also used : DataSource(org.applause.lang.applauseDsl.DataSource)

Example 14 with DataSource

use of org.applause.lang.applauseDsl.DataSource in project applause by applause.

the class RESTURLsAbsoluteRESTURLsSpec method baseUrlShouldBe.

public void baseUrlShouldBe(final CharSequence sequence, final String url) {
    try {
        final Model model = this._parseHelper.parse(sequence);
        EList<NamedElement> _elements = model.getElements();
        Iterable<DataSource> _filter = Iterables.<DataSource>filter(_elements, DataSource.class);
        final DataSource datasource = IterableExtensions.<DataSource>head(_filter);
        final AbsoluteRESTURL baseUrl = datasource.getBaseUrl();
        String _value = this._rESTURLExtensions.value(baseUrl);
        Matcher<String> _is = CoreMatchers.<String>is(url);
        Assert.<String>assertThat(_value, _is);
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : Model(org.applause.lang.applauseDsl.Model) NamedElement(org.applause.lang.applauseDsl.NamedElement) DataSource(org.applause.lang.applauseDsl.DataSource) AbsoluteRESTURL(org.applause.lang.applauseDsl.AbsoluteRESTURL)

Aggregations

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