Make Changes to the Project
In this step you will go through a new development iteration, adding a new feature to your project, and updating its bootstrap module so that your content repository already running in an Bloomreach Cloud environment will be automatically updated when deploying the new release.
Add the Tagging Feature
In your local development environment, start your project and open the Essentials setup application:
http://localhost:8080/essentials/
Add the Tagging feature to your project.
Rebuild and restart your project.
Add Tagging to News Documents
Once the application has restarted, open the Tagging configuration by clicking on the Configure button in the Installed Features list.
In the Tagging configuration screen check the checkbox for "newsdocument" and click on the Add tagging button.
A message will appear at the top of the page telling you that tagging was successfully added:
Update the NewsDocument Bean
Bloomreach Experience Manager's delivery framework wraps document in the content repository in Java object knows as content beans. Because the News document type has changed, the corresponding bean class must be updated as well.
In the Essentials setup application, on the Tools page, select the Bean Writer tool.
Click on the Generate HST Content Beans button. A message will appear at the top of the page telling you that a method getTags was added to the NewsDocument bean.
Rebuild and restart your project.
Add Keywords to News Documents
Open the CMS application:
http://localhost:8080/cms/
Log in as admin and open the Content perspective.
Browse to a news document, e.g. My Project > news > 2019 > 02 > The medusa news.
Edit the news document and enter some keywords (comma separated) in the "Keywords" field.
Note that there are no keyword suggestions yet because these are the very first keywords you add to any document.
Save & close the document and publish it.
Modify the News Template to Display Tags
Open the website and browse to one of the news articles you added keywords to, e.g.
http://localhost:8080/site/news/2019/02/the-medusa-news.html
The tags are not shown because the template has not been updated.
In your project open the Freemarker template used to render the news articles:
repository-data/webfiles/src/main/resources/site/freemarker/hstdefault/newspage-main.ftl
Add the following code just before the </article> closing tag:
<#if document.tags??> <p>Tags:</p> <ul> <#list document.tags as tag> <li>${tag?html}</li> </#list> </ul> </#if>
Save the file and refresh the news page in your browser. A list of tags will be rendered at the bottom of the page:
Release the Project
"Release" version 1.0.1 of your project by entering the following command in the project's root directory:
mvn versions:set -DnewVersion=1.0.1
Clean up the temporary backups of the pom.xml files made by the Versions plugin:
mvn versions:commit
Create a Distribution
Create a distribution file for version 1.0.1 of your project by entering the following commands in the project's root directory:
mvn clean verify mvn -P dist
This creates a distribution file in the target directory:
myproject/target/myproject-1.0.1-distribution.tar.gz