This article will focus on
Riot content management system written in
Java . The system is based on the
Spring Framework , uses
Ajax .

I will give the main features of the system and tell you step by step how to install it. The article is addressed to all those interested in Java content management systems.
')
Content
What is Riot
- Main characteristics
- System requirements
- Used libraries
- Documentation
Creating a new Riot project
- Russification Riot
- Configuring the connection to the database
- Errors during installation
What is Riot
Riot is a opensource framework for building web applications.End users can view the system as a
CMS , but from the standpoint of the developer, Riot is rather a
Content Management Framework ( CMF ) , since the system does not offer an out-of-the-box solution. Riot is a web application framework based on opensource technologies, the most significant of which are
Spring and
Hibernate .
Main characteristics:
- the ability to edit content directly on the page using the Ajax interface;
- the ability to manage business objects ( domain objects ) from the administrator section regardless of their origin (Hibernate, JPA, custom DAO);
- multilingual support in the interface and in the content;
- module support;
- multisiting support;
- customizable design templates, the ability to manage blocks of content directly on the site;
- user management;
- beautiful URLs like site.com/level1/level2/../page.html ;
- ability to integrate into existing applications.
System requirements:
- works on any platform with installed Java-machine from version 1.5;
- uses servlet containers that support specification 2.5;
- uses Hibernate for data access, which makes it possible to choose DBMS from the set of available ones ;
- Some features require the ImageMagick library, which is also available on most platforms.
Used libraries:
- Spring Framework - as an IoC container and web MVC framework;
- ORM framework Hibernate ;
- Template FreeMarker ;
- Direct Web Remoting is a library that allows Javascript code in the browser to interact with Java objects on the server. The Riot Toolbar uses the DWR to create an Ajax user interface;
- Apache Ant - java-utility to automate the process of assembling a software product;
- Ivy is a dependency determination manager with flexibility and simplicity.
Documentation:
Documentation on the system a bit. The developers of riot insist that the system is based on well-known well-documented technologies and it will be easy to deal with the add-ons of riot. There is a group in
Google , in which there is a discussion of the system, there is an online
JavaDoc and
fmdoc .
Creating a new Riot project
We will create a new project in
Eclipse (with the installed
Web Standard Tools plugin). If you do not want to use the IDE, simply create a new folder for the future project.

In the created folder, place the following Ant-file
setup.xml and run the default target
(wget http://riotfamily.org/setup.xml && ant -f setup.xml).
Setup.xml downloads the file
www.riotfamily.org/setup/skeleton-8.0.zip and unpacks it. Runs the
skeleton.xml ant script. Removes
skeleton.xml, setup.xml, skeleton-8.0.zip .
Execution of the skeleton.xml file.The file checks whether the project was created in Eclipse, and if so, the script patches several
config files in the IDE . (for example, the
build / conf folder is added to the list of
source folders ). After that, the
setup procedure of the
build.xml file is called, which performs dependency resolution using
Ivy and builds the project. It took me about 15 minutes to build the project, for them ivy pulled out eleven megabytes of libraries.
After the project is completed, update the project structure from Eclipse to see the files loaded during project creation.

If you are not using an editor, use the ant war command to create a WAR file.
Place the created war file in the Tomkat webapps folder and restart the server.
The default site will be available at
localhost: 8080 / <context> / .
The admin panel will be available at
localhost: 8080 / <context> / riot .
Username: admin
Password: admin

Russification Riot
Riot uses
utf8 encoding, but in order for the system to understand
Cyrillic , you need to check several settings of the application.
- Check the coding of the DBMS. For MySQL, I had to write in the file my.cnf (my.ini) :
character-set-server = utf8
collation-server = utf8_general_ci
- To correctly convert text into a picture ( org.riotfamily.website.txt2img package ), add cyrillic fonts (for example, this one ) to the riot-config / website-servlet.xml file;
- To translate the admin menu into the browser's address bar, enter the javascript: void (frameset.toggleI18n ()) command, after which a yellow [l18n] button will appear next to each label. Click on it and translate the menu.

Configuring the connection to the database
By default, Riot uses
HSQLDB and does not store changes to the system after a reboot. To configure work with
MySQL (PostgreSQL), change the settings for the
conf \ default \ application.properties file according to the recommendations given in
conf \ mysql \ application.properties or
conf \ postgres \ application.properties .
Errors during installation
1. After building the project, I had Eclipse validation errors spring-beans-2.5.xsd. The solution turned out to be
simple .
2. Also, an error occurred while creating the
riot_dbmsgsrc_entries table.
I had to change the code:
- CREATE TABLE `riot _ dbmsgsrc _ entries` (
- `id` bigint ( 20 ) NOT NULL auto_increment ,
- `bundle` varchar ( 255 ) collate utf8_general_ci default NULL ,
- `code` varchar ( 255 ) collate utf8_general_ci default NULL ,
- `comment` longtext collate utf8_general_ci ,
- PRIMARY KEY ( `id` ) ,
- UNIQUE KEY `bundle` ( ` bundle` , `code` )
- ) ENGINE = MyISAM DEFAULT CHARSET = utf8 COLLATE = utf8_general_ci AUTO_INCREMENT = 1 ;
on
- CREATE TABLE `riot _ dbmsgsrc _ entries` (
- `id` bigint ( 20 ) NOT NULL auto_increment ,
- `bundle` varchar ( 255 ) collate utf8_general_ci default NULL ,
- `code` varchar ( 255 ) collate utf8_general_ci default NULL ,
- `comment` longtext collate utf8_general_ci ,
- PRIMARY KEY ( `id` ) ,
- UNIQUE KEY `bundle` ( ` bundle` ( 100 ) , `code` ( 100 ) )
- ) ENGINE = MyISAM DEFAULT CHARSET = utf8 COLLATE = utf8_general_ci AUTO_INCREMENT = 1 ;
3. I could not start Tomket from the editor, so I added the purpose of starting / stopping the server and the purpose of placing the war-file in the webapps folder in build.xml. My changes:
- <! - The Tomcat folder ->
- <property name = "tomcat.dir" value = "C: / Program Files / Apache Software Foundation / Tomcat 6.0" />
- <! - The Tomcat webapp content ->
- <property name = "tomcat.webapp.dir" value = "$ {tomcat.dir} / webapps" />
- <! - Copies war file into Tomcat ->
- <target name = "deploy-tomcat" depends = "war" description = "Copies war file into Tomcat" >
- <antcall target = "tomcat-stop" />
- <copy file = "$ {war.location}" todir = "$ {tomcat.webapp.dir}" />
- <delete dir = "$ {tomcat.webapp.dir} / $ {ant.project.name}" />
- <antcall target = "tomcat-start" />
- </ target >
- <! - Runs Tomcat ->
- <target name = "tomcat-start" >
- <java jar = "$ {tomcat.dir} /bin/bootstrap.jar" fork = "true" >
- <jvmarg value = "-Dcatalina.home = $ {tomcat.dir}" />
- </ java >
- </ target >
- <! - Stops Tomcat ->
- <target name = "tomcat-stop" >
- <java jar = "$ {tomcat.dir} /bin/bootstrap.jar" fork = "true" >
- <jvmarg value = "-Dcatalina.home = $ {tomcat.dir}" />
- <arg line = "stop" />
- </ java >
- </ target >
findings
Riot is an interesting and flexible system built on java-technologies. Riot provides the developer with a web application framework with already implemented basic CMS functions.