This guide refers to a Fiona-on-Rails application meant to be operated with Fiona 7 in legacy mode.
The starting point of the installation is a Rails application using Rails 4.2. This may be a RailsConnector application or a pure Rails application. For the Fiona 7 gem to work as intended, the following components are mandatory:
Add the Fiona 7 gem to the “Gemfile” in the main directory of the application:
In case you are using “turbolinks“, please remove it because Scrivito does not support it. This affects:
The Fiona 7 gem (as well as the RailsConnector, now FionaConnector) is published at RubyGems.org, so it can be installed using the following command:
The components required for compatibility with Scrivito are automatically taken account of.
The following steps serve to configure the application for interoperating with the Fiona 7 gem.
This guide assumes that neither SCSS or LESS nor any other similar solution is used in the “application.css" file. Add the following line to the “app/assets/stylesheets/application.css" file, preferredly above or below “*= require_self”:
*= require fiona7
//= require fiona7
This line must be placed directly below the following lines:
//= require jquery //= require jquery_ujs
To be able to work with Fiona 7 in your application, the
Obj class needs to be implemented. For this, please create this class, which inherits from
RailsConnector::BasicObj, in “app/models/obj.rb”:
class Obj < RailsConnector::BasicObj end
To enable access to objects based on the
Obj class, please include
Scrivito::ControllerActions in the
CmsController, in “app/controllers/cms_controller.rb”:
class CmsController < ApplicationController include Scrivito::ControllerActions end
For an application using the Fiona 7 gem, three connections need to be configured:
The MySQL configuration is fully identical to the one the RailsConnector (or FionaConnector) uses, meaning that the “cms:” entry in the “config/database.yml” file needs to be the same.
Specify the access parameters for the XML interface in the “config/initializers/fiona7.rb” file. The following example illustrates the configuration keys and the format of their values:
Fiona7.configure do |config| # 1 config.instance = 'playland' # 2 config.host = '18.104.22.168' # 3 config.port = 7001 # 4 config.username = 'root' # 5 config.secret = 'MYSECRET' # 6 config.mode = :legacy # 7 end
Fiona7::VeritySearchEngine::VeritySearchRequest.configured_host = '22.214.171.124' # 8 Fiona7::VeritySearchEngine::VeritySearchRequest.configured_port = 7011 # 9
The lines above mean or cause:
The credentials, consisting of the
username and the
secret, represent a CMS user with root access. For this reason, these credentials should never be published or checked in to a repository. We recommend using Rails Secrets for persisting them. Furthermore, access to the XML interface should be restricted to the known IP addresses using a firewall.
Enable the user interface by adding
<%= fiona7_head_tags %>
to the HEAD section of the layout and
<%= fiona7_body_tags %>
to the BODY section of the layout.
Editors need to log in to be able to edit content in the preview. As a default, the log-in form is hidden and needs to be enabled first. To do this, insert the following line into the layout where appropriate to have the log-in button show up:
<%= fiona7_login_button %>
Starting a Fiona-7-based application for the first time causes the CMS instance belonging to it to be automatically initialized. In this process, the connections, structures, and settings of the CMS are checked for compatibility with Fiona 7 and adjusted if required.
After launching the app and opening the site in the browser, you can log in and create or edit content in editing mode.