Toolset

Installation

Most recent MvcLang (v2) version and previous version (v1) is accessible from GitHub link below:

https://github.com/iremfidandan/MvcLangv2

Obeo Designer Community Edition is required to execute MVCLang Modelling Editor. It can be downloaded from:

https://www.obeodesigner.com/en/download

Metamodelling Project Setup

  1. Create a new workspace folder.

  2. Open Obeo Designer and click Browse... button.

  3. Select the workspace folder that you created according to 1. Step from file system.

  4. Click Launch button.

  5. Click Window -> Perspective -> Open Perspective -> Other... -> Git

  6. Click Clone a Git Repository from Git Repositories

  7. Copy https://github.com/iremfidandan/MvcLangv2 and paste it URI textbox.

  8. Click Next button.

  9. Uncheck MvcLangv1 and click Next button.

  10. Click Finish button.

  11. Right click on recently cloned repo and click Import Projects...

  12. Click Deselect All button and then select only CodeGenerationPrototype projects.

  13. Click Finish button.

  14. Click Window -> Perspective -> Open Perspective -> Other... -> Modelling

  15. Right click on com.eryaz.prototype.ryz and click Properties

  16. Click Java Build Path and then Click Source tab.

  17. Click on com.eryaz.prototype.ryz/src, click Remove button and click Apply and Close button.

  18. Right click com.eryaz.prototype.ryz -> Run As -> Run Configurations

  19. Right click on Eclipse Application -> New Configuration, click Apply and click Run.

Modelling Project Setup

  1. Click Window -> Perspective -> Open Perspective -> Other... -> Git

  2. Click Add An Existing Local Git Repository To This View.

  3. Check only mvcLang and click Add.

  4. Right click on mvcLang and click Import Projects...

  5. Click Select All button and click Finish button.

  6. Click Window -> Perspective -> Open Perspective -> Other... -> Modelling

Create New MVCLang Project

  1. Click File -> New -> Other… -> Example EMF Model Creation Wizards –> Ryz Model

  2. Click Next button.

  3. Select Parent Folder as com.eryaz.prototype.ryz.modeltest and give an arbitiary name for your ryz model.

  4. Click Next button.

  5. Select Model Object as Project.

  6. Click Finish button.

  7. Click on the arrow that is on the left side of .ryz file you created recently according to 3. step from Model Explorer.

  8. Click Project and give an arbitiary name from Properties View.

  9. Right click on Project that in the .ryz file and click New Representation -> Other respectively.

  10. Select projects -> Projects Diagram and click Finish button respectively.

  11. Click OK button.

Generate Code From A Model

  1. In the modelling editor, right click on com.eryaz.prototype.ryz.codegeneration -> src -> com.eryaz.prototype.ryz.codegeneration.main -> generate.mtl and click Run As -> Run Configurations.

  2. Right click on Acceleo Application and click New Configuration.

  3. Give a name to your run configuration.

  4. Click Search… button inside Main Class group and select com.eryaz.prototype.ryz.codegeneration.main.Generate.

  5. Click Browse… button inside Model and select ryz model that you created.

  6. Click Browse… button inside Target and select com.eryaz.prototype.ryz.generatedcodes.

  7. Click Apply and Run buttons respectively.

  8. If you want to regenerate code from your model, click Run button’s menu on the toolbar and then click your run configuration.

Running Auto-Generated Codes On Visual Studio 2015

  1. Open Visual Studio 2015 and click File -> New Project.

  2. Click Installed -> Templates -> Visual C# -> Web -> ASP.NET Web Application and give a name to your solution and project.

  3. Click OK button.

  4. Select Empty Template and check MVC checkbox from Add folders and core references for.

  5. Click OK button.

  6. Click Tools -> Extensions and Updates and install SQLite/SQL Server Compact Toolbox.

  7. Click Tools -> SQLite/SQL Server Compact Toolbox.

  8. Right click on Data Connections from SQLite/SQL Server Compact Toolbox and click Add SQL Server Compact Connection.

  9. Click Create… button and create your application’s db file on where you want.

  10. Copy auto-generated connection string.

  11. Right click on the solution that you created according to 5. Step and click Manage NuGet Packages for Solution.

  12. Install EntityFramework and EntityFramework.SqlServerCompact respectively.

  13. Open Web.config file in your project root and paste below xml between <configSections> and <appSettings> tags.

<connectionStrings>

<add name="<your case study’s project name>Context" connectionString="Data Source=<autogenerated connection string that you copied> providerName="System.Data.SqlServerCe.4.0" />

</connectionStrings>

  1. Click View -> Other Window -> Package Manager Console.

  2. Write below commands respectively on Package Manger Console

enable-migrations -enableautomaticmigration

add-migration <Your Migration Class Name>

update-database

  1. Right click on the solution that you created according to 5. Step and click Manage NuGet Packages for Solution.

  2. Search for Ninject.MVC5, set Dependency Behavior to Highest and File Conflict Action to Prompt and install it.

  3. Open autogenerated App_Start ->Ninject.Web.Common.cs file and paste these code lines inside RegisterServices method.

<your case study’s project name>Context context = new <your case study’s project name>Context();

context.Database.Initialize(force: false);

UnitOfWork uow = new UnitOfWork(context);

kernel.Bind<IUnitOfWork>().ToConstant<UnitOfWork>(uow);

  1. Right click on the solution that you created according to 5. Step and click Manage NuGet Packages for Solution.

  2. Install JQuery and Microsoft.jQuery.Unobtrusive.Ajax respectively.