(Quick Reference)

1 Introduction - Reference Documentation

Authors: Aaron Brown

Version: 1.0.0

Table of Contents

1 Introduction

The Smartionary plugin for Grails provides a simple structure for storing and retrieving information to and from a Domain 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 to me.sudofu.smartionary.domain.Smartionary, which is a Domain class, it will be referred to as such (i.e. Smartionary domain).

When referring to me.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. Grails Plugin Page
  2. Source

1.1 Overview

This section will discuss the plugin's structure. There is no configuration necessary. However, bear in mind the considrations of the Datasource and Spring Core Security Plugin.

Artifacts

Controllers

The plugin comes with two Controllers:

me.sudofu.smartionary.controller.SmartionaryController
me.sudofu.smartionary.controller.SmartionaryEntryController

The URIs for these controllers are:

/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

These domains are meant to emulate Map and Map.Entry.

Smartionary has many SmartionaryEntries, and nothing more. Therefore, the Map-like structure is limited to a single level (no nesting).

See best-practices for a possible workaround.

The following constraints apply to the Domains:

  • There can be no two Smartionaries with the same name.
  • Within a Smartionary there can be no two SmartionaryEntries with the same name.

Here is a visual structure of what this would look like:

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

It is meant to be the primary way to interact with the Domains, as it gives very useful methods that follow the design philosphy of the plugin.

1.2 Changelog

Version 1.0.1

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.