Creating a Solstice application is simple using Majere.
In a Nutshell
- On the Majere home page, click "Create a new application".
- Fill out the "Application name" and "Package namespace" form fields. Adjust other fields to taste.
- Click "Save".
- If creation was successful, restart your web server and navigate a browser to your solstice installation. Append the new Application URL you specified to try out your new app!
The Details
Majere uses the parameters that you submit, combined with a few configuration options, to create the application directories and files. For example, let's create an application with the following parameters:
Application name: Hello World
Package namespace: HelloWorld
Application URL: helloworld
Majere first creates a directory called helloworld in your Solstice applications directory, identified in the app_dirs section of solstice_config.xml.
Into this directory it places the following directories and files, which are the basic ingredients for a solstice application:
config.xml
content/
example_config.xml
lang/
lib/
pageflow.xml
startup.pl
templates/
The config.xml and example_config.xml Files
The files config.xml and example_config.xml are actually identical. The important one is config.xml, which is required by Solstice for that app to start. However, our practice is to commit example_config.xml to our code repository instead, to provide a reference configuration file, avoiding the problem of committing local configurations.
The pageflow.xml File
Information about the state map file.
The startup.pl File
This optional file, if defined in the startup_file section of config.xml, is executed when the Web server is (re)started. It is created by Majere, but does nothing by default.
The content Directory
The content directory will contain static content for your application. If you specified that Majere should create a css or javascript file, they will be placed in this directory.
Your application's config.xml also contains the following section which describes what static content directories are present for your application:
XML
<statics>
<static>content
</static>
</statics>
The lang Directory
The lang directory contains language xml files. By default, Majere places one file in this directory, corresponding to the language specified in your solstice_config.xml file.
The lib Directory
The lib directory contains your application's perl packages. Majere creates a single subdirectory in lib, the "Package namespace" that you specified (HelloWorld in our example). Within the package namespace directory, it creates all of the models, views and controllers required to generate a home screen for your new application.
The templates Directory
The templates directory contains your application's html templates. Majere creates one template file by default, home.html.