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:
Add the Fiona 7 gem to the “Gemfile” in the main directory of the application:
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 the “Obj” class, which inherits from “RailsConnector::BasicObj,” in "app/models/obj.rb”:
class Obj < RailsConnector::BasicObj end
For an application using the Fiona 7 gem, two 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 = '220.127.116.11' # 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.
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 %>
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.