Installation

Prerequisites

The starting point of the installation is a Rails application using Rails 4.1. 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:

  • Rails 4.1
  • jQuery and jQuery-ujs
  • Infopark CMS Fiona, including activated XML access, railsified
  • MySQL database
  • ImageMagick
Optionally, the FionaConnector may be used.

Step 1: Install the gem

Add the Fiona 7 gem to the “Gemfile” in the main directory of the application:

gem 'infopark_fiona7'

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:

bundle install

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.

Step 2: Include CSS and JavaScript

To enable the full functionality of the gem, the application needs to include CSS and JavaScript components.

CSS components

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

JavaScript components

This guide also assumes that no extensions such as CoffeeScript are used in the “application.js" file. Add the following line to the “app/assets/javascripts/application.js” file:

//= require fiona7

This line must be placed directly below the following lines:

//= require jquery
//= require jquery_ujs

Step 3: Implement base class

To be able to work with Fiona 7 in your application, the “Obj” class needs to be implemented. For this, please create the “Obj” class, which inherits from “RailsConnector::BasicObj,” in "app/models/obj.rb”:

class Obj < RailsConnector::BasicObj
end

Step 4: Configure connections

For an application using the Fiona 7 gem, two connections need to be configured:

  • A direct connection to the MySQL database used by the CMS
  • A connection to the XML interface of the CMS

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 = '33.33.33.10'       # 3
  config.port = 7001                # 4
  config.username = 'root'          # 5
  config.secret = 'MYSECRET'        # 6
  config.mode = :legacy             # 7
end

Line 2: The instance name, usually ‘default’.

Line 3: The hostname or the IP address of the CMS server.

Line 4: The port number of the XML interface; see the “config/server.xml” CMS file.

Line 5: The login of a user having “permissionGlobalRoot”.

Line 6: The instance “secret"; see the “config/server.xml” file.

Line 7: The application mode, “:legacy" or “:standalone.” This setting is explained in the section Two Operation Modes.

Attention! 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.

Step 5: Enable the user interface

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.

Step 6: Provide log-in link

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 %>

Step7: Initialize the CMS instance

Prior to developing an application based on Fiona 7, each CMS instance needs to be initialized using the following command:

bundle exec rake fiona7:initialize

This command checks the connections, structures, and settings of the CMS for compatibility with Fiona 7 and adjusts them if required.

Finally, the site can be launched. After logging in, the markers and all other editing elements appear.