A prototype tool that boosts the integration of Headless CMS into MDE apps. This tool allows you to:
1 - Quickly discover the content exposed by the CMS API by extracting its model automatically.
2 - Represent this model in a standard notatios, as UML, to facilitate the integration with other parts of the system.
3 - Generatea a java library in charge of the communication between your apps and the source CMS.
The java library is built as a maven artifact and ready to be integrated to your consumer app. This tool is built as a Eclipse Plug-in and can be used following the instructions of this file.
-
The toolkit requires Eclipse 4.12 (2019-06) or above.
-
The toolkit requires EMF 2.10 (2015-01) or above.
-
The toolkit requires Maven for Eclipse Integration or above
-
For Drupal:
- JSON:API - Drupal core 8.1 or above.
- Open API for JSON API activated
- Set Open API for JSON API available for anonymous request (not authentication supported by now)
-
For Wordpress:
- A REST API v2 enabled - Wordpress core 4.7 or above
- One of the following API authentication plugins
- [Basic auth] (https://github.com/WP-API/Basic-Auth)
- [JWT auth] (https://es.wordpress.org/plugins/jwt-authentication-for-wp-rest-api/)
To install this tool open your Eclipse Installation, go to Help -> Install new softare and set the following update site:
https://som-research.github.io/CMS-Headless-Modeling/updates/
Once you have your eclipse application with this plugin installed, you should have at least one project opened.
1 - Then go to File -> Import
2 - Select Import CMS model
3 - Select the project and the folder where the model will be saved
4 - Set a name for the output model file
5 - Select the technology of the source CMS
6 - Set the url of the site (for example: https://www.mysupersite.com)
7 - In WordPress case you need to fill user and password (check that you have the supported authentication plugins enabled)
8 - Then, refresh your project folder. You will see a model like the following example:
Navigate to the .ecore file created in the root of the selected project. Click right button and search for "Generate CMS Connector"
Then a new project with the code will be created. Inside the packages "tests" there are some basic usage examples as:
MySite siteManager = new mySite();
SearchQueryBuilder searchQuery = siteManager.getSearchQueryBuilder();
List<Recipe> recipeList = siteManager.searchRecipe(searchQuery.build());
String Title = recipeList.get(3).getTitle());
searchQuery.addFilter(Post.FILTER_FIELD_COOKING_TIME, "30");
List<Recipe> recipeFilteredList = siteManager.searchRecipe(searchQuery.build());
print(recipeFilteredList.get(0).getTitle());
Recipe singleRecipe = siteManager.getRecipeById(recipeFilteredList.get(0).getUuid());
print(singleRecipe.getTitle());
List<Tags> tags = singleRecipe.getFieldTags();
tags.forEach((tag) ->{
print(tag.getName());
});
This tool is the outcome of the research paper: Enabling CMS as a content source for model-driven projects presented in the 16th International Conference on Research Challenges in Information Science.
The extraction and generation process are based in the following proposed global CMS model.
Author and maintainer: Joan Giner
SOM Research Group