Database Schema

Summary

This page describes the key database tables, displays the relationship between them.

Tables

There are five tables that ShUIE needs:
Table Name Use
P3_ShUIE_CONTEXT Stores criteria that describe a context
P3_ShUIE_INJECT Stores JavaScript and CSS fragments
P3_ShUIE_SETTINGS Stores shared settings
P3_ShUIE_CONTEXT_INJECT Relates scripts to contexts
P3_ShUIE_INJECT_SETTINGS Relates settings to scripts


ShUIE-Schema.gif

P3_ShUIE_CONTEXT

Stores criteria that describe a context.
Column Properties Notes
ContextId PK, int, not null
Name nvarchar(255), not null A textual label for a context, such as "Global" or "Risks List"
Active bit, not null Boolean indicator to show whether this context is enabled
SiteUri nvarchar(255), null A context criteria, if specified this context only applies to Sites whose Uri contains this string
WebUri nvarchar(255), null A context criteria, if specified this context only applies to Webs whose Uri contains this string
WebTitle nvarchar(255), null A context criteria, if specified this context only applies to Webs whose Title contains this string
ListTitle nvarchar(255), null A context criteria, if specified this context only applies to Lists whose Title contains this string
UserLogin nvarchar(255), null A context criteria, if specified this context only applies to Users whose NTLOGIN contains this string
Username nvarchar(255), null A context criteria, if specified this context only applies to Users whose Name contains this string
UserIsSiteAdmin bit, null A context criteria, if specified this context defines uses that either are, or are not, Site Administrators
UserIsWebAdmin bit, null A context criteria, if specified this context defines uses that either are, or are not, Web Administrators

P3_ShUIE_CONTEXT_INJECT

Associates scripts to contexts in a many-to-many relationship, and provides additional context criteria based on page mode.
Column Properties Notes
ContextId PK, int, not null
InjectId PK, int, not null
Active bit, not null Boolean indicator to show whether this criteria and script combination is enabled
Invalid bit, not null Boolean indicator that, if populated, applies when the page mode is 'invalid'
New bit, not null Boolean indicator that, if populated, applies when the page mode is 'new'
Edit bit, not null Boolean indicator that, if populated, applies when the page mode is 'edit'
Display bit, not null Boolean indicator that, if populated, applies when the page mode is 'display'

P3_ShUIE_INJECT

Stores JavaScript and CSS to be injected.
Column Properties Notes
InjectId PK, int, not null
Name nvarchar(255), not null A meaningful textual label that describes a script, such as "jqDock" or "List Print CSS"
Active bit, not null Boolean indicator to show whether this script is enabled
Text ntext, not null The JavaScript or CSS fragment
Type nvarchar(3), not null Either 'js' or 'css' to indicate the type of script stored in Text
CssMediaType nvarchar(50), null If Type = 'css', then this describes the media type of the CSS, such as "screen" or "print"
Minify bit, not null Boolean indicator to describe whether minification (compression) of the JavaScript or CSS should take place
Sequence int, not null A numerical value used to order the output of scripts... 1 = first, some large number = last

P3_ShUIE_INJECT_SETTINGS

A simple many-to-many lookup table to associate settings to scripts.
Column Properties Notes
InjectId PK, FK, int, not null
Name PK, FK, nvarchar(50), not null

P3_ShUIE_SETTINGS

Stores settings for use by one or more scripts.
Column Properties Notes
Name PK, nvarchar(50), not null The name of the setting as it will be rendered and available within Json. Constrained to alpha only, and starts with a capital letter
StringValue nvarchar(512), null Stores a string value
DateTimeValue datetime, null Stores a datetime value
NumberValue decimal(25,6), null Stores a numerical value
JsonObject nvarchar3072, null Stores a raw Json string


Note: The value columns are constrained so that only 1 of them may be populated. The columns enforce the datatype to help ensure that human errors from incorrect types are not present. JsonObject is available for use as a raw store of Json, but this is not generally advised for most settings.

Last edited Dec 4, 2008 at 3:01 PM by DavidK, version 8

Comments

No comments yet.