Configuration - Gadreel/dcraft GitHub Wiki

Coding

Config Attribute

<Config Locale="x-pig-latin" Chronology="America/Chicago" />

cascades through each tier until a match is made

ResourceHub.getResources().getConfig().getAttribute("Chronology")

Config First Tag List

<Locale Name="x-pig-latin" />
<Locale Name="en" />

cascades through each tier until a match is made, combine all results from that tier level

ResourceHub.getResources().getConfig().getTagList("Locale")

Config Deep Tag List

<MimeDef Ext="html" Type="text/html" Compress="True" />
<MimeDef Ext="shtml" Type="text/html" Compress="True" />

cascades through each tier, combine all results

ResourceHub.getResources().getConfig().getTagListDeep("MimeDef")

Config Deep Tag List

<Service.Definition Name="dga" RunClass="cust.dga.Services">
	... details, but no Settings unless you are ok with them being overwritten ...
</Service.Definition>

cascades through each tier, combine all results

ResourceHub.getResources().getConfig().getTagListDeep("Service.Definition")

TODO

Locale

Core has a settings section for default that looks much like settings.xml

settings.xml

default locale in sites or core

<Settings Locale="x-pig-latin" Chronology="America/Chicago" />

supported locales in sites, not used in core, is in package to indicate what locales the package supports

<Settings>
	<Locale Name="x-pig-latin" />
	<Locale Name="en" />
	
	...
</Settings>

default locale in domain, not used in Core (a redirect to example.com after this will still keep the locale in session?)

<Settings>
	<Domain Name="pig.example.com" Use="Production" Locale="x-pig-latin" Chronology="America/Chicago" />
	...
</Settings>

Locale and Chron will come from Shared if not overridden in Core config

dictionary.xml

In config folder for sites

<Dictionary>
	<Locale Id="en">
		<Entry Token="mnuHome" Value="Home" />
		<Entry Token="mnuAbout" Value="About" />
		<Entry Token="mnuContact" Value="Contact" />
	</Locale>
	<Locale Id="x-pig-latin">
		<Entry Token="mnuHome" Value="omeHay" />
		<Entry Token="mnuAbout" Value="Aboutyay" />
		<Entry Token="mnuContact" Value="ontactCay" />
	</Locale>
</Dictionary>

In dictionary folder for packages.

No such thing as Shared dict.

Schema

The search for a datatype by name starts at Context and goes up until first match is made.

In Core and Site and Package (package loads into core)

scheme.xml

In config folder for sites

<Schema>
</Schema>

In schema folder for packages.

No such thing as Shared schema settings.

Service

The search for a service by name starts at Context and goes up until first match is made.

In Core and Site (select services from package load into core)

May define right in Core or Site:

<Settings>
	<Service Name="dga" RunClass="cust.dga.Services" />
</Settings>

Groovy in folders also works instead of, or in addition to, RunClass but Service must be listed for it to be found

Service Definitions may be found in packages.

define in Package or shared - not in settings at core or site

<ServiceDefinition Name="dga" RunClass="cust.dga.Services">
	... details, but no Settings unless you are ok with them being overwritten ...
</ServiceDefinition>

Then in Core or Site (settings are allowed and will start a new instance of the service):

<Settings>
	<Service Use="dga" Id="nn">
		<Settings ... />
	</Service>
</Settings>

If defined in Shared (outside of settings) then in config simply say:

<Settings>
	<Service Use="nn or id" />
</Settings>

MIME

The search for a mimedef by name starts at Context and goes up until first match is made.

In Core and Site and Package (package loads into core)

<Settings>
	<MimeDef Ext="html" Type="text/html" Compress="True" />
	<MimeDef Ext="shtml" Type="text/html" Compress="True" />
	<MimeDef Ext="xml" Type="text/xml" Compress="True" />
	<MimeDef Ext="txt" Type="text/plain" Compress="True" />
	<MimeDef Ext="jpg" Type="image/jpeg" />
	<MimeDef Ext="png" Type="image/png" />
	<MimeDef Ext="gif" Type="image/gif" />
	<MimeDef Ext="css" Type="text/css" Compress="True" />
	<MimeDef Ext="json" Type="application/json" Compress="True" />
	<MimeDef Ext="js" Type="application/javascript" Compress="True" />
	<MimeDef Ext="yaml" Type="text/yaml" Compress="True" />
	<MimeDef Ext="woff" Type="application/x-font-woff" />
	<MimeDef Ext="woff2" Type="application/font-woff2" />
	<MimeDef Ext="cur" Type="image/vnd.microsoft.icon" />
	<MimeDef Ext="ico" Type="image/vnd.microsoft.icon" />
	<MimeDef Ext="svg" Type="image/svg+xml" />
	<MimeDef Ext="pdf" Type="application/pdf" />
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

API

In Core and Site (default api session, others will have Account/Alt name)

<Settings>
	<Catalog Name="Api-Session">
		<Settings Class="dcraft.api.HyperSessionFactory" Host="root" Port="8443" Secure="True" />
	</Catalog>
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

Security and Policy

In Core and Site

Bubble = keep going up after applying this policy

<Settings>
	<Catalog Name="Policy-Http" Bubble="t/f">
		<Settings>
			<ContentSecurityPolicy Mode="Loose" />
			
			<Headers ... />
		</Settings>
	</Catalog>
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

Email

Send email in Core and Site

<Settings>
	<Catalog Name="Email-Send">
		<Settings>
			...
		</Settings>
	</Catalog>
</Settings>

Webmaster list in Core and Site

Bubble = keep going up after collecting this list

<Settings>
	<Catalog Name="Email-List-Webmaster" Bubble="t/f">
		<Settings>
			...
		</Settings>
	</Catalog>
</Settings>

Ignore send list

<Settings>
	<Catalog Name="Email-Send-Ignore">
		<Settings>
			...
		</Settings>
	</Catalog>
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

Events

In Core and Site

Bubble = keep going up after triggering this event

<Settings>
	<Catalog Name="Event-ManagedForm-Subscribe-Submit" Bubble="t/f">
		...
	</Catalog>
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

Social Media

In Core and Site

<Settings>
	<Catalog Name="SocialMedia-Facebook">
		...
	</Catalog>
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

MD Plugins

The search for a plugin by name starts at Context and goes up until first match is made.

In Core and Site and Package (package loads into core)

<Settings>
	<MarkdownPlugin ... />
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

Web Tags

The search for a tag by name starts at Context and goes up until first match is made.

In Core and Site and Package (package loads into core)

<Settings>
	<WebTag ... />
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

Macros (web plus)

The search for a macro type by name starts at Context and goes up until first match is made.

In Core and Site and Package (package loads into core)

<Settings>
	<Macros>
		...
	</Macros>
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

Script Instructions

The search for an instruction by name starts at Context and goes up until first match is made.

In Core and Site and Package (package loads into core)

<Settings>
	<ScriptInstructions>
		...
	</ScriptInstructions>
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

Script Data Type

The search for a data type by name starts at Context and goes up until first match is made.

In Core and Site and Package (package loads into core)

<Settings>
	<ScriptType>
		...
	</ScriptType>
</Settings>

If defined in Shared then the types are automatically imported to Core. If defined in a package in use then the types are automatically imported to Core.

Modules

Only in packages and core, not at other levels.

In packages or shared define modules:

<ModuleDefinition Name="Web" RunClass="dcraft.web.WebModule">
	... details, but no Settings unless you are ok with them being overwritten ...
</ModuleDefinition>

In core

<Modules>
	<Module Use="Web" Id="nn">
		<Settings ... />
	</Module>
</Modules>

if defined in Shared then enable in Core:

<Modules>
	<Module Id="nn" />
</Modules>

Trust

<Settings>
	<TrustCertificate Thumb="995577..." />
</Settings>

If defined in Shared then the certs are automatically imported to Core. If defined in a package in use then the certs are automatically imported to Core.

Certificate

<Settings>
	<Certificate Name="*.example.com" File="example.jks" Password="aabbccddee" />
</Settings>

If defined in Shared then the certs are automatically imported to Core. If defined in a package in use then the certs are automatically imported to Core.

Buckets

In Core or Site.

<Settings>
	<Buckets>
		<Bucket Name="Learning" ReadAuthTags="User" WriteAuthTags="EdCoordinator,Staff,Admin" RootFolder="/files/learning" />
	</Buckets>
</Settings>

In packages or shared:

<BucketDefinition Name="Learning" ReadAuthTags="User"
	WriteAuthTags="EdCoordinator,Staff,Admin" RootFolder="/files/learning" />

then in core, site or shared

<Settings>
	<Buckets>
		<Bucket Use="Learning" Id="nn">
			<Settings ... />
		</Bucket>
	</Buckets>
</Settings>

If from shared (outside of Settings) then enable in core or site using

<Settings>
	<Buckets>
		<Bucket Id="nn" />
	</Buckets>
</Settings>

Schedule

In Core or Site.

<Settings>
	<Schedules>
		<CommonSchedule Title="ABC Nightly BATCH" RunClass="abc.DailyTest" View="Daily">
			<Daily>
				<Schedule At="09:00" RunIfMissed="False" />
			</Daily>
		</CommonSchedule>
	</Schedules>
</Settings>

In packages or shared:

<ScheduleDefinition Name="ABC-Nightly">
	<CommonSchedule Title="ABC Nightly BATCH" RunClass="abc.DailyTest" View="Daily">
		<Daily>
			<Schedule At="09:00" RunIfMissed="False" />
		</Daily>
	</CommonSchedule>
</ScheduleDefinition>

then in core, site or shared

<Settings>
	<Schedules>
		<Schedule Use="ABC-Nightly" Id="nn">
			<Settings ... />
		</Schedule>
	</Schedules>
</Settings>

If from shared (outside of settings) then enable in core or site using

<Settings>
	<Schedules>
		<Schedule Id="nn" />
	</Schedules>
</Settings>

TODO old

Server Level

Tenant Level

Features:

  • data
  • schema (data types)
  • data protection/crypto
  • services
  • trust managers
  • watchers
  • schedules

Tenant Settings

Details about config

  • Trust
  • Schedules
  • Site
  • Root Site Special

Site Level

  • website files
  • website config
  • locale config
  • domain name linking
  • certificates
  • dictionary
  • catalog

Site Settings

Details about config

  • Domain
  • Locale
  • Certificate
  • Buckets
  • Feed
  • Harden

Website settings

  • Package
  • Route
  • Global
  • Meta
⚠️ **GitHub.com Fallback** ⚠️