jAPS 2.0 entando- Rss plugin

Do It The jAPS Way

Eugenio Santoboni

Reviser 
Chief Solution Engineer
AgileTec s.r.l.

William Ghelfi

Reviser 
Chief Interaction Designer
Tzente s.r.l.

Stefano Puddu

First Italian version 
AgileTec s.r.l.

Rinaldo Bonazzo

First Italian version 
AgileTec s.r.l.

Matteo E. Minnai

English translation 
Junior Developer
Tzente s.r.l.

Legal Notice

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the Appendix entitled "GNU Free Documentation License".

The copyright holders make no representation about the suitability of this Document for any purpose. It is provided «as is» without expressed or implied warranty. If you modify this Document in any way, identify your resulting Document as a variant of this Document.

2011-03-09

Diario delle Revisioni
Revisione 1.22011-03-09MEM

Revision for the release of jAPS 2.0 entando version 2.2.0

Revisione 1.12010-02-23MEM

Revision for the release of jAPS 2.0.10

Revisione 1.02009-10-26MEM

Translation and adaptation of the Italian documentation

Estratto

The aim of this document is to fully describe the structure of the Rss plugin.


Lista delle Tabelle

2.1. Characteristics overview

Capitolo 1. Scope of the document

Introduction

The goal of this document is to fully describe the structure of the RSS(jprss) Plugin.

Target audience

This document is for those who want to know more about the RSS plugin functionalities and are considering to install it in a production or development environment with the Eclipse IDE. This document is aimed at system administrators (responsible for jAPS 2.0 entando installations) and Java developers (with a basic comprehension of the jAPS 2.0 entando framework).

Prerequisites

In order to take maximum advantage from the present document, it is necessary to have a basic knowledge about: the Java platform, the Eclipse IDE, the Apache Tomcat servlet container, the PosgreSQL DBMS and the jAPS 2.0 entando framework.

Resources

Additional informations may be obtained through the official mailing-lists:

Is it also possible to refer to the documentation found in the:

jAPS 2.0 entando Project - Developer Website

Capitolo 2. Plugin characteristic

Plugin characteristic

The jprss plugin allows to serve the portal contents through RSS channels.

Tabella 2.1. Characteristics overview

CodeNameTypePlugin versionVersion of jAPS 2.0 entando
jprssRSSPurePlugin1.22.2.0 -
jprssRSSPurePlugin1.12.0.8 - 2.0.10
jprssRSSPurePlugin1.02.0.6

Prerequisites

This plugin requires the following dependencies to be satisfied:

  • jacms version 2.2.0

Since version 2.0.8 jacms is bundled with jAPS2 itself, requiring no actions to be taken by the final user.

Functionalities:

This module offers:

  • A back-end interface used by the administrator to create and manage the contents served through RSS channel. This interface adheres strictly to the pre-existing back-end graphics and settings, and it is accessible from the Plugin menu item.

  • A showlet for the front-end designed to serve the list of the links of the active channels.

The links to RSS contents served in the Front-end always follow this pattern:

					http://ipaddress:8080/myportal/do/jprss/Rss/Feed/show.action?id
				

where 'ipaddress' is the ip of the 'myPortal' portal and the id is the ID of the served content.

Capitolo 3. Installation and Integration

Plugin type

The jprss plugin serves the content of the portal in the RSS format.

This plugin is a PurePlugin, because the installation neither alters nor modifies pre existing functionalities of the system.

Package description

This package strictly adheres to the document jAPSPlugin Pattern so it contains all the directories expected (such as the doc and src directories as well as the readme file)

Moreover, the src is structured as follows:

  • java directory. It contains the source files and the test suites of the plugin.

  • sql directory. It contains the sql scripts to execute in the port and serv database, for the production, development and test environment.

  • The webapp directory. This directory contains all the files needed by the web application. More specifically we have the jsp files of the user interfaces and the related configuration files, the xml declaring the beans of the various services (both belonging to the jAPS 2.0 entando business logic layer and the Struts2 presentation layer), all the required jar libraries (including the plugin itself!) and, finally, the static resources (css, images, js and so on).

Integration in a production environment

From now on we refer to the application where the plugin is going to be deployed as myportal. We also refer to the compressed file containing the all the plugin elements as 'package'.

To perform the installation in a production environment based on the jAPS 2.0 entando compatible with this plugin, the following steps must be taken:

  1. Stop the servlet container

  2. Copy the content of the src/webapp/WEB-INF/lib directory of the downloaded package inside the myportal/WEB-INF/lib/ directory within the server container.

  3. Make sure that the myportal/WEB-INF/plugins/ directory exists, otherwise create it. Copy the content of the src/webapp/WEB-INF/plugins directory of the plugin package inside the myportal/WEB-INF/plugins/ directory within the server container.

  4. Copy the content of the directory src/webapp/resources/plugins/ of the plugin package in the myportal/resources/plugins/.

  5. Locate the SQL scripts in the src/sql directory inside the plugin package. Execute the script (eg. using the free program PgAdmin) to update the port database in production. The script has the parameter version set to production, change it accordingly to your needs. Substitute with the appropriate values the following strings: CONTENT_TYPE, ATTRIBUTE_NAME and finally MAX_ITEMS.

  6. In the src/sql directory, locate and execute the script servScript.sql to update the serv database in production.

Installation in a development environment

As a convention, we call the project where the plugin is about to be installed myproject.

To perform the installation of jprss in an Eclipse IDE, on a version of jAPS 2.0 entando compatible with the plugin, follow these steps:

  1. Copy the content of the src/webapp/WEB-INF/lib directory of the plugin package in the myproject/WebContent/WEB-INF/lib/ directory with the exclusion of the file jAPSPlugin-jprss-1.1.jar.

  2. Make sure that the myproject/WEB-INF/plugins/ directory exists, otherwise create it. Copy the content of the src/webapp/WEB-INF/plugins directory in the myproject/WebContent/WEB-INF/plugins/ directory.

  3. Copy the content of the directory src/webapp/resources/plugins of the plugin package in the myproject/WebContent/resources/plugins/ directory.

  4. Execute the script portScript.sql (found in the src/sql directory of the plugin package) to update the local port database. The script has the version set to production, change it accordingly to your needs. Substitute with the appropriate values the following strings: CONTENT_TYPE, ATTRIBUTE_NAME and finally MAX_ITEMS.

  5. Execute the script servScript.sql (found in the src/sql directory of the plugin package) to update your local serv database.

  6. Execute the script portTestScript.sql (found in the src/sql directory of the plugin package) to update your local port database used for tests.

  7. Execute the script servTestScript.sql (found in the src/sql directory of the plugin package) to update your local serv database used for tests.

  8. Copy the content of the src/java/main/com directory of the plugin package in the myproject/src/com of your project.

  9. Copy the content of the src/java/test/test directory into myproject/src/test.

  10. Copy the file src/java/main/jprss_japs-struts-plugin.xml in myproject/src/. Look for a file named japs-struts-plugin.xml under the src directory of your Eclipse project: if it exists copy the content of the tag <struts> of the file jprss_japs-struts-plugin.xml inside the existing japs-struts-plugin.xml file, then delete jprss_japs-struts-plugin.xml. If the japs-struts-plugin.xml does not exist rename the file jprss_japs-struts-plugin.xml in japs-struts-plugin.xml.

  11. Delete or comment out (using a java comment) the method getSpringConfigFilePaths() of the class JpRssConfigTestUtils.java belonging to the test.com.agiletec.plugins.jprss package.

  12. Delete or comment out (using a java comment) the method setInitParameters() of the class JpRssApsAdminBaseTestCase.java belonging to the package test.com.agiletec.plugins.jprss.apsadmin.

Once the following steps are performed, restart your project and verify the presence of the RSS menu item under the Plugin menu in the back-end interface.

Capitolo 4. Plugin configuration

RSS channel configuration

Note: the pictures shown below of the jAPS backend may actually differ from the actual, however the underlying logic is mostly unchanged from the previous versions. A brief paragraph highlighting the only configuration change that improves the entire configuration and installation process follows.

RSS plugins takes advantage of one of the new key core features of the jAPS 2.0 entando, the attributes roles. As a matter of fact the "jprss_config" configuration item in the table "sysconfig" has been dropped.

Before configuring the RSS channels you must decide what kind of contents are suitable for publishing. Now that the configuration item does not exist anymore the role is used to decide if the attribute will become, for example, the title of the rss feed.

To do so, you must edit the "entity type" of the contents you want to publish into RSS format: in the attribute list edit the attribute of your choice that will be, for example, the title of the rss. At this point under "Role" select you have to choose one of the roles for the attribute injected in the system by the plugin:

  • jprss:title - the attribute that contains the title of the rss content

  • jprss:description - the attribute that contains the description of the rss content

Confirm clicking the "Add" button, then proceed with the attribute configuration eventually pressing the "save" button. Once that each of the roles above are assigned you can enter the administration area of the plugin.

To enter the RSS administration interface follow these steps:

  1. Enter the administration area of the portal

  2. Plugin

  3. RSS

The RSS welcome screen, with two icons, appears:

RSS channel list

The list of the RSS channels actually defined in the portal

Press on the New channel link to proceed as shown in the next figure:

New RSS channel

Choice of the content type to be served through a RSS channel (translator note: 'notizia' means 'news').

Once the content type has been selected, the fields showed below must be filled to complete the creation of the RSS channel.

New RSS channel

Fields of the RSS channel

Now the following information must be provided to complete the creation of the new channel:

  • The title of the RSS channel

  • A brief description of the RSS channel

  • Choose if the channel must be immediately served checking the 'Active' box

  • RSS compliancy standard of the channel

  • Definition of the Category this channel belongs to

  • Definition of the Filters (refer to the next paragraph on how to create Filters)

once the form is properly filled the RSS channel is ready to be exposed in the front-end.

Filters management: if the contents to be exposed through RSS must be filtered for any reason, just select Add in the filter box shown in the last picture. The following screen appears:

Creating a filter on RSS channel

Filter management for RSS channels

You may configure the filters depending on the attributes used in the Content Type used for the RSS channel.

Esempio 4.1. Example of a Date filter

Configuring the date filter of the RSS channel

Creation of a date filter for the RSS channel


Esempio 4.2. example of a Text-type filer

Creation of a Text-type filter for a RSS channel

Creation of a Text-type filter for a RSS channel (translator note: 'Titolo' means 'title')


Result expected if the filters shown above are added to a new RSS channel in the same way they are presented in this guide.

Resulting RSS channel configuration

Resulting RSS channel configuration