1 Introduction - Reference Documentation
Authors: Aaron Brown
Version: 1.0.0
1 Introduction
The Smartionary plugin for Grails provides a simple structure for storing and retrieving information to and from aDomain
with emphasis on treating it
like a Map.The goal of the plugin is to make it easy and convenient for developers and
non-developers to be able to create, update, delete, and access bits of
information.In a production environment, it may be necessary to have certain criteria or
sets of information be accessible to administrative or management roles, while
at the same time be available to the developer in a progremmatically convenient
way.With the Smartionary, required information can be put into the domain by the
developer during the development cycle. Once in production, if any modification
of the present data needs to be made, a maintaner (not necessarily the
developer) is able to alter the information without the need for downtime.This guide is intended to describe usage and best-practices for the plugin.
There are no configurations necessary, however the
Datasource and, if
used, the Spring Core Security Plugin
(Specifically, controllerAnnotations.staticRules
) should be carefully tested
to ensure the plugin is interacting with them appropriately (*this has not
been explicitly tested*).The term Smartionary is a bit overloaded (unfortunately).When referring tome.sudofu.smartionary.domain.Smartionary
, which is aDomain
class, it will be referred to as such (i.e. Smartionary domain).When referring tome.sudofu.smartionary.Smartionary
, which is the primary way to use the plugin, it will be referred to simply as the Smartionary or Smartionary interface.
Resources
1.1 Overview
This section will discuss the plugin's structure. There is no configuration necessary. However, bear in mind the considrations of theDatasource
and
Spring Core Security Plugin.Artifacts
Controllers
The plugin comes with twoControllers
:me.sudofu.smartionary.controller.SmartionaryController me.sudofu.smartionary.controller.SmartionaryEntryController
/smartionary/smartionaryEntry /smartionary/entries
Domains
It is not necessary to directly use the Domains. This is only provided for clarification purposes.See Smartionary Interface for primary usage.The plugin comes with two
Domains
:me.sudofu.smartionary.domain.Smartionary me.sudofu.smartionary.domain.SmartionaryEntry
Map
and Map.Entry
.The following constraints apply to the Domains:Smartionary
has manySmartionaryEntries
, and nothing more. Therefore, theMap
-like structure is limited to a single level (no nesting).See best-practices for a possible workaround.
- There can be no two
Smartionaries
with the same name. - Within a
Smartionary
there can be no twoSmartionaryEntries
with the same name.
Map myMap = [:]myMap.myValue = "foo"
| | |
|------|--------|-----Smartionary.name
| |
|--------|-----SmartionaryEntry.key
|-----SmartionaryEntry.value
The Smartionary Interface
The Smartionary Interface can be found in:me.sudofu.smartionary.Smartionary
Domains
, as it gives
very useful methods that follow the design philosphy of the plugin.
1.2 Changelog
Version 1.0.1
- Mapped the SmartionaryEntry key field to the Database column identifier.
Version 1.0.0
- Code Complete / Initial Release
- Interaction with Spring Core Security Plugin has not been tested.
- Interaction with custom
Datasource
configurations (i.e. multiple datasources) has not been tested.