{"id":14966695,"url":"https://github.com/dipiert/ifml2php","last_synced_at":"2025-10-25T17:30:34.806Z","repository":{"id":164935455,"uuid":"96826691","full_name":"Dipiert/ifml2php","owner":"Dipiert","description":"Towards a Model-Driven Web Engineering for current needs and trends","archived":false,"fork":false,"pushed_at":"2020-06-19T23:31:47.000Z","size":13111,"stargazers_count":4,"open_issues_count":6,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T09:23:02.054Z","etag":null,"topics":["acceleo","atl","eclipse-modeling","laravel","mdwe","metamodel","php","transformations","yii2-framework"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dipiert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-10T22:24:36.000Z","updated_at":"2024-11-13T17:17:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"672abd59-6fb1-49df-8e92-99d70f6e938e","html_url":"https://github.com/Dipiert/ifml2php","commit_stats":{"total_commits":307,"total_committers":5,"mean_commits":61.4,"dds":0.50814332247557,"last_synced_commit":"0b9acf996158dfad142f285a85c7dd418fb2fa1a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dipiert%2Fifml2php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dipiert%2Fifml2php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dipiert%2Fifml2php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dipiert%2Fifml2php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dipiert","download_url":"https://codeload.github.com/Dipiert/ifml2php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238183619,"owners_count":19430156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acceleo","atl","eclipse-modeling","laravel","mdwe","metamodel","php","transformations","yii2-framework"],"created_at":"2024-09-24T13:36:48.826Z","updated_at":"2025-10-25T17:30:31.413Z","avatar_url":"https://github.com/Dipiert.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ifml2php\n## From [IFML](http://www.ifml.org/) Models to PHP frameworks [Yii2](http://www.yiiframework.com/) and [Laravel](https://laravel.com/). A set of transformations using [ATL](https://eclipse.org/atl/), [Acceleo](https://www.eclipse.org/acceleo/) and Java.\n\nA practical implementation of the achievements of models integration it's not possible if a suitable set of tools doesn't exist to facilitate the application of models, techniques, transformations and maintenance of the coherence of the models in order to achieve, in the end, executable code.\nThis project intended to facilitate the adoption of the MDD approach by Web Developers meeting their needs and current trends.\n\n\n### Related Links\n* [Eclipse Luna](https://eclipse.org/luna/)\n* [IFML Editor](https://github.com/ifml/ifml-editor)\n* [Sirius](https://eclipse.org/sirius/)\n* [Un caso de estudio sobre la aplicación de UWE para la generación de sistemas web](https://goo.gl/dozG7N)\n* [Enfoque MDWE soportando Modelo MVC Web para Frameworks PHP](https://goo.gl/wTcbjK)\n* [Generación semiautomática de aplicaciones Web De modelos en IFML a aplicaciones basadas en frameworks PHP Yii2 y Laravel\n](https://dipiert.neocities.org/bachelor_degree_thesis.pdf)\n\n## Setting up your development environment\n\n### Requirements\n\n * [Eclipse Luna Modeling Tools](https://www.eclipse.org/downloads/packages/eclipse-modeling-tools/lunasr2)\n * [Composer](https://getcomposer.org/download/)\n * [Apache Commons Lang](https://commons.apache.org/proper/commons-lang/)\n * [Laravel Framework](https://laravel.com/)\n * [Laravel Collective](https://laravelcollective.com/docs/5.0/html)\n * [Yii2 Framework](http://www.yiiframework.com/)\n\n### [Eclipse](https://www.eclipse.org/downloads/packages/eclipse-modeling-tools/lunasr2)\n\nThe [Acceleo](https://www.eclipse.org/acceleo/) and [ATL](https://eclipse.org/atl/) frameworks are designed for Model-to-Text and Model-Transformation aiding. And we will use them along the project.\n\nThe first step will be to download and install Eclipse Modeling Tools from the link above. Once Eclipse is ready we need to install the Acceleo and ATL Frameworks.\nWe can do this by opening Eclipse and going to:\n\n 1) Help -\u003e Installing Modelling Components\n 2) Choose Acceleo y ATL.\n 3) After install you will be prompted to restart Eclipse, do it.\n\n\n![Installing ATL \u0026 Acceleo](https://github.com/Dipiert/ifml2php/blob/master/images/install_atl-acceleo.gif \"Installing ATL \u0026 Acceleo\")\n\nOnce Eclipse starts again we need to install the [IFML Editor](https://github.com/ifml/ifml-editor), in order to do that we can follow the instructions [here](http://ifml.github.io/).\n\nThis should leave us with a starting working environment.\n\n### [Composer](https://getcomposer.org/download/)\n\nComposer is a **Dependency Manager for PHP** which is going to allow us to install and both Laravel and Yii2 frameworks.\n\n#### Installation\n\nFor Microsoft Windows you the best way is to download and run [Composer Setup Executable](https://getcomposer.org/Composer-Setup.exe) and it will install the latest composer version whenever it is executed.\n\nFor Ubuntu based Linux distros running the following should do the trick:\n\n ```\n sudo apt install composer\n ```\n\nAny other case this should be enough to get things working:\n\n ```\n php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\"\n php -r \"if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;\"\n php composer-setup.php\n php -r \"unlink('composer-setup.php');\"\n ```\n\n## Proyects\n\n### Naming conventions\n\nThe naming convention is for all projects is:\n\n`\u003cdomain\u003e.\u003cproject-name\u003e.\u003ckind-of-input\u003e.\u003cinput-metamodel-name\u003e.gen.\u003coutput-language-name\u003e`\n\nWhere `kind-of-input` is one of:\n * pim: Platform-Independent Model\n * psm: Platform-Specific Models\n * dsl: Domain-Specific Language\n\n### ATL Project\n\nFirst things first, you should import the ATL project in Eclipse:\n\n 1) File -\u003e Import (Alt + F + I)\n 2) General\n 3) Existing project into workspace\n\nIn this repo, the ATL project is called **`edu.ifml2php.pim.ifml.gen.lycmm`**.\n\n**`lycmm`** means \"Laravel, Yii2 \u0026 CodeIgniter Meta-Model\".\n\nThe ATL project consists in:\n\n- A file called **ifml2OurMM.atl**, where the Model-To-Model (M2M) transformation rules lives.\n- A folder called **atlLibraries**, where the IFML helpers live.\n\nThe **ifml2OurMM.launch** file on the ATL project's root contains run configuration parameters. You shouldn't need to change that file but in case you want to know the details about this file go to [Making a .launch file](#launch) section on this README.\n\nFinally, right click in **ifml2OurMM.atl** file, then \"Run As\" -\u003e \"ATL Transformation\" should do the trick.\n\nIf the transformation was successful you should see a file called **preProd-gen.xmi** (or the name you've set it to in the .launch file) on the ATL project's root.\n\n#### \u003ca name=\"launch\"\u003e\u003c/a\u003e Making a .launch file.\n\nRight click in  **ifml2OurMM.atl** file, then \"Run As\" -\u003e \"Run Configuration\". This opens a window where you can set the following parameters:\n\n(We encourage the use of URIs instead absolute paths or relative paths whenever possible)\n\nATL Module: This should point to the path of the ifml2OutMM.atl file you've just right-clicked on.\n\n##### Metamodels:\n\nName| Path |URI\n---| --- |---\nUMLMM | | uri:http://www.eclipse.org/uml2/5.0.0/UML\nIFMLMM | /models/metamodels/IFML-Metamodel.ecore | uri:http://www.omg.org/spec/20130218/core\nextMM | /models/metamodels/IFML-Metamodel.ecore | uri:http://www.omg.org/spec/20130218/ext\nourMM | /edu.ifml2php.pim.ifml.gen.lycmm/models/metamodels/Metamodel.ecore  | uri:http://www.application.org\n\n***Do not check the `Is Metametamodel` check box***\n\n##### Source Models:\n\nName | Conforms to | Path (/edu.ifml2php.pim.ifml.gen.lycmm/models/models/) | Type\n--- | --- | --- | ---\numl |UMLMMM | model.uml | Domain\nifml | IFMLMM | movies.core | Interaction Flow\nextm | extMM | movies.core | Interaction Flow\n\n##### Target models:\n\nourm: This is the path where the generated .xmi file will be stored. In this case, the ATL project's root.\n\n##### Libraries:\n\n\n| Name | Path (/edu.ifml2php.pim.ifml.gen.lycmm/atlLibraries/)|\n| --- | --- |\n| ifmlCoreLibrary | ifmlCoreLibrary.asm |\n| ifmlExtLibrary | ifmlExtLibrary.asm |\n| mvcLibrary | mvcLibrary.asm |\n| systemLibrary | systemLibrary.asm |\n\nIn order to use the models in an Acceleo project you need to include **Metamodel.ecore** to EMF registry.\n\nThe easiest way to do that is:\n 1. Change to ATL Perspective: Window-\u003eOpen Perspective-\u003eOther-\u003eATL\n 2. Right click on **Metamodel.ecore** -\u003e Register Metamodel.\n\n![Registering a Metamodel](https://github.com/Dipiert/ifml2php/blob/master/images/register_metamodel.gif \"Registering a Metamodel\")\n\nYou will not see any visual change but trust me, the metamodel is registered now.\n\n### Acceleo Project\n\nNow you should import the ATL project in Eclipse:\n\n 1) File -\u003e Import (Alt + F + I)\n 2) General\n 3) Existing project into workspace\n\nIn this repo, there are two Acceleo projects called:\n * **`edu.ifml2php.psm.lycmm.gen.laravel`**.\n * **`edu.ifml2php.psm.lycmm.gen.yii2`**.\n\n## Testing\nSelenium tests are using GeckoDriver v0.19.1, ChromeDriver v2.35 \u0026 OperaDriver v2.33\n\n## Troubleshooting\n\n### ATL\n\n * You must specify a path for ```\u003cmodel-name\u003e```\n * Arguments of a generation cannot be null\n * {.asm, .atl} does not exist\n \n Verify the M2M transformations parameters in the .launch file\n\n### Acceleo\n\n- Package with URI ```\u003curi\u003e``` not found\n\nDo a manual register of the metamodel, add the following code on the ```registerPackages()``` method in the corresponding Java launcher. \n\nIf you change the content of any method of a Java Launcher, don't forget to change the ```@generated``` tag in the Javadoc of the method to ```@generated NOT``` (preferable by consistency style) or ```@not-generated```. Without this new tag, any compilation of the Acceleo module with the main template that has caused the creation of this class will revert your modifications.\n\n```\nURI uri = URI.createFileURI(\"../edu.ifml2php.pim.ifml.gen.lycmm/models/metamodels/Metamodel.ecore\");\nResource resource = resourceSet.getResource(uri, true);         \nEPackage PHPMVC = (EPackage) resource.getContents().get(0);\nList\u003cEPackage\u003e subPackages = PHPMVC.getESubpackages();\nfor(EPackage subPack : subPackages){\n   EPackage.Registry.INSTANCE.put(subPack.getNsURI(), subPack);\n}\n```\n\n- ClassNotFoundException: org.eclipse.uml2.types.TypesPackage\n\nAdd [org.eclipse.uml2.types](http://central.maven.org/maven2/org/eclipse/uml2/types/2.0.0-v20140602-0749/types-2.0.0-v20140602-0749.jar) to the classpath.\n\n- Could not find public template ```\u003ctemplate-name\u003e``` in module ```\u003cmodule-name\u003e```\n\nMake sure you have the ```@main``` annotation to the corresponding public template.\n\n- java.lang.NoClassDefFoundError: org/eclipse/core/resources/IresourceChangeListener\n\nAdd [org.eclipse.core.resources](http://central.maven.org/maven2/org/eclipse/birt/runtime/org.eclipse.core.resources/3.9.1.v20140825-1431/org.eclipse.core.resources-3.9.1.v20140825-1431.jar) to the classpath.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdipiert%2Fifml2php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdipiert%2Fifml2php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdipiert%2Fifml2php/lists"}