Skip to content

An Eclipse plugin to boost the integration of java apps with Headless CMS (WordPress or Drupal). Extract and discover the content inside the CMS, and generate, automatically, a java library in charge of the communication between the apps.

Notifications You must be signed in to change notification settings

SOM-Research/CMS-Headless-Modeling

Repository files navigation

CMS Discoverer

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.

Prerequisites and supported technologies

Installation

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/

Usage and Examples

Extracting the CMS model

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

New Project Wizard - Step 1

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)

New Project Wizard - Step 1

8 - Then, refresh your project folder. You will see a model like the following example:

New Project Wizard - Step 1

Genearting the connector java library

Navigate to the .ecore file created in the root of the selected project. Click right button and search for "Generate CMS Connector"

Generate-connector

Then a new project with the code will be created. Inside the packages "tests" there are some basic usage examples as:

Init site and search query

MySite siteManager = new mySite();
SearchQueryBuilder searchQuery = siteManager.getSearchQueryBuilder();
Listing content
List<Recipe> recipeList = siteManager.searchRecipe(searchQuery.build());
String Title = recipeList.get(3).getTitle());

Search with filters

searchQuery.addFilter(Post.FILTER_FIELD_COOKING_TIME, "30");
List<Recipe> recipeFilteredList = siteManager.searchRecipe(searchQuery.build());
print(recipeFilteredList.get(0).getTitle());

Get content by id

Recipe singleRecipe = siteManager.getRecipeById(recipeFilteredList.get(0).getUuid());
print(singleRecipe.getTitle());

Navigate between relationships

List<Tags> tags = singleRecipe.getFieldTags();
tags.forEach((tag) ->{
  print(tag.getName());
});

Research Background of the tool

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.

Headless CMS generic model

Project Content and Credits

Author and maintainer: Joan Giner

SOM Research Group

About

An Eclipse plugin to boost the integration of java apps with Headless CMS (WordPress or Drupal). Extract and discover the content inside the CMS, and generate, automatically, a java library in charge of the communication between the apps.

Topics

Resources

Stars

Watchers

Forks