This commit is contained in:
Michael Becker 2025-07-16 18:08:59 -04:00
parent fcb4817b69
commit 5261a95d68
10 changed files with 573 additions and 6 deletions

@ -1 +1 @@
Subproject commit 94de4f0a8e855543c0f1b0679aebf7caa2db56c9
Subproject commit 8825fc5980678050edde42e7555a15e3ed99c016

@ -1 +1 @@
Subproject commit 70a9255d1e6732bd3f43f633b32dfb20fea66aba
Subproject commit 62f717eda520af256b05f20505f18eca0d22e7b6

View File

@ -291,8 +291,8 @@ elif [ "$1" == "new" ]; then
shift;
BACKEND="vagrant"
BACKEND="docker"
while true; do
case "$1" in
-b | --backend ) BACKEND="$2"; shift 2 ;;
@ -301,6 +301,8 @@ elif [ "$1" == "new" ]; then
esac
done
ARGS=${1+"$@"}
if [ "$BACKEND" == "vagrant" ]; then
command -v vagrant 2>&1 >/dev/null
@ -331,10 +333,12 @@ elif [ "$1" == "new" ]; then
elif [ "$BACKEND" == "docker" ]; then
/usr/lib/mocha/docker/docker-run
pushd /usr/lib/mocha/docker
./docker-run $ARGS
popd
else
echo "unknown backend '$BACKEND'"
fi

41
mocha-suv/common/oms.conf Normal file
View File

@ -0,0 +1,41 @@
# --------------------------------------------
# Mocha OMS Configuration File
# Format Description
# --------------------------------------------
#
# Keys that can include Spaces = Value ...
#
# Property Group = { Property Name = Value }
# Property Group with Multiple Properties
# {
# Property Name = Value
# Another Property = Value
# }
#
# Test Group = { Name = Value, Another = Value2 }
#
# Array = [ Something, Something Else ]
# Multiline Array =
# [
# Something
# Something Else
# Yet Another Thing, And Another
# "Value with embedded, commas # and pound signs and \"quotes\""
# ]
#
# When reading the file, if '=' has been encountered but '\n' comes before
# a valid property value, assume property line continues on next line and
# keep reading. Otherwise, '\n' terminates the property line.
#
# Inside array, '\n' always delineates an array value, as does ',' (unless quoted).
# Quotes behave and can be escaped "just as you \"would\" expect".
Version = 1.0
OMS Server Settings =
{
Port = 4436
Catch Exceptions =
[
System.NotImplementedException
]
}

View File

@ -11,6 +11,10 @@ case "$1" in
exec $EXECPATH/$EXECFILE &
apache2ctl -D FOREGROUND
;;
"stop")
echo "not implemented; just restart the container for now"
exit 2
;;
"up")
exec $EXECPATH/$EXECFILE &
mocha up

View File

@ -0,0 +1,42 @@
<!-- Imported references from net.alcetech.Mocha.System -->
<!ENTITY A_Name "{9153A637-992E-4712-ADF2-B03F0D9EDEA6}">
<!-- Local references defined in this document -->
<!ENTITY C_PrepChart "{ffe41b43-1004-4634-a8d9-4b6276b6dc06}">
<!ENTITY C_Recipe "{f302338d-d329-4cf1-85b4-9f4b555942ae}">
<!ENTITY C_RecipeShelfLife "{7e8162f3-b043-4e7d-8e04-ddb6a6f352e2}">
<!ENTITY C_RecipeShelfLifeMeasurementUnit "{e5cd7d48-d676-439a-9c6f-cb9d0b0b19a8}">
<!ENTITY C_PrepCook "{5b60b388-757a-4425-8d51-e63c96bc01d9}">
<!ENTITY C_PrepChartRecipeAssignment "{8b3284a8-fea1-4bda-bd8b-fd15cfd21b23}">
<!ENTITY A_RecipeName "{4897a52c-a5a3-4aad-bced-a617dc0afaa4}">
<!ENTITY A_RecipeShelfLifeValue "{1f12ca6f-eeb7-436a-9f3b-654808c014bd}">
<!ENTITY R_Recipe__has__Recipe_Shelf_Life "{285f3926-fe59-4800-9e07-654bba2df640}">
<!ENTITY R_Recipe_Shelf_Life__has__Recipe_Shelf_Life_Measurement_Unit "{0015bb60-9a82-45e9-ba43-f9a9ed33cdd2}">
<!ENTITY R_Prep_Chart__has__Recipe "{550b53ae-e975-48f8-a124-5eab4d00227b}">
<!ENTITY R_Recipe__for__Prep_Chart "{18ed440d-9f37-4215-b489-cfad3e088f6d}">
<!ENTITY R_Prep_Chart__has__Prep_Chart_Recipe_Assignment "{fa60aa6f-f59d-4277-a27a-c24bb46e4f4e}">
<!ENTITY R_Prep_Chart_Recipe_Assignment__has__Recipe "{06e24e1a-733d-4bb6-b29c-27055cd0c68e}">
<!ENTITY R_Recipe__for__Prep_Chart_Recipe_Assignment "{6e5f7edc-8a82-47a1-84e3-e9821362ef7d}">
<!ENTITY R_Prep_Chart_Recipe_Assignment__assigns_for__Prep_Cook "{6159ee21-e128-4d68-987c-f3946d36cca7}">
<!ENTITY R_Prep_Cook__has_assigned__Prep_Chart_Recipe_Assignment "{8bc8e384-b3b6-4423-a2ef-c6bc12c3eeab}">
<!ENTITY I_PrepChart1 "{9bc308d5-f6ab-467b-b502-741b294cf2a7}">
<!ENTITY I_RecipeShelfLifeMeasurementUnit_Hour "{cf4ed18e-f680-447e-9005-da7fee6740fd}">
<!ENTITY I_RecipeShelfLifeMeasurementUnit_Day "{c5beb8a7-6f6e-4133-bc0b-0ae1e7467531}">
<!ENTITY I_Recipe_Pancake "{aad15c08-4261-40b1-abfa-8b85789c99df}">
<!-- Prep Chart Line Item -->
<!ENTITY R_Prep_Chart_Line_Item__has__Prep_Chart_Period "{c779c437-49c1-4395-8c46-625068ec3bec}">

View File

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright (C) 2025 Michael Becker <alcexhim@gmail.com>
This file is part of mocha-suv.
mocha-suv is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mocha-suv is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mocha-suv. If not, see <https://www.gnu.org/licenses/>.
-->
<!DOCTYPE schema SYSTEM "PrepChart.dtd">
<!-- <mocha xmlns="https://schemas.mochapowered.com/MochaX" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://schemas.mochapowered.com/MochaX ../mochax.xsd"> -->
<?xml-model href="../mochax.xsd" type="application/xml" schematypens="http://www.w3.org/2001/XMLSchema"?>
<mocha xmlns="https://schemas.mochapowered.com/MochaX">
<library id="com.mochapowered.CBOCSPrepChart_v1">
<baseAddress classIndex="202100" attributeIndex="410000" relationshipIndex="410000" />
<instances>
<class id="&C_PrepChart;" name="Prep Chart" />
<class id="&C_Recipe;" name="Recipe">
<instances>
<instance id="&I_Recipe_Pancake;">
<attributes>
<attribute id="&A_Name;" value="Pancake, *Prep" />
</attributes>
<relationships>
<relationship id="&R_Recipe__has__Recipe_Shelf_Life;">
<targetInstances>
<instance classId="&C_RecipeShelfLife;" instanceId="{a6882b8e-7c29-4bd8-84c5-32df4abd0fe9}">
<attributes>
<attribute id="&A_RecipeShelfLifeValue;" value="9" />
</attributes>
<relationships>
<relationship id="&R_Recipe_Shelf_Life__has__Recipe_Shelf_Life_Measurement_Unit;">
<targetInstances>
<instanceReference instanceId="&I_RecipeShelfLifeMeasurementUnit_Hour;" />
</targetInstances>
</relationship>
</relationships>
</instance>
</targetInstances>
</relationship>
</relationships>
</instance>
</instances>
</class>
<class id="&C_RecipeShelfLife;" name="Recipe Shelf Life">
<attributes>
<attributeReference attributeInstanceId="&A_RecipeShelfLifeValue;" />
</attributes>
</class>
<class id="&C_RecipeShelfLifeMeasurementUnit;" name="Recipe Shelf Life Measurement Unit">
<attributes>
<attributeReference attributeInstanceId="&A_Name;" />
</attributes>
<instances>
<instance id="&I_RecipeShelfLifeMeasurementUnit_Hour;">
<attributes>
<attribute id="&A_Name;" value="Hour" />
</attributes>
</instance>
<instance id="&I_RecipeShelfLifeMeasurementUnit_Day;">
<attributes>
<attribute id="&A_Name;" value="Day" />
</attributes>
</instance>
</instances>
</class>
<class id="&C_PrepCook;" name="Prep Cook">
</class>
<class id="&C_PrepChartRecipeAssignment;" name="Prep Chart Recipe Assignment">
</class>
<attribute id="&A_RecipeName;" index="410001" name="Recipe Name" type="text" />
<attribute id="&A_RecipeShelfLifeValue;" index="410002" name="Recipe Shelf Life Value" type="text" />
<relationship id="&R_Prep_Chart__has__Recipe;" sourceClassId="&C_PrepChart;" type="has" targetClassId="&C_Recipe;" siblingInstanceId="&R_Recipe__for__Prep_Chart;" siblingType="for" />
<relationship id="&R_Recipe_Shelf_Life__has__Recipe_Shelf_Life_Measurement_Unit;" sourceClassId="&C_RecipeShelfLife;" type="has" targetClassId="&C_RecipeShelfLifeMeasurementUnit;" />
<relationship id="&R_Prep_Chart__has__Prep_Chart_Recipe_Assignment;" sourceClassId="&C_PrepChart;" type="has" targetClassId="&C_PrepChartRecipeAssignment;" />
<relationship id="&R_Prep_Chart_Recipe_Assignment__has__Recipe;" sourceClassId="&C_PrepChartRecipeAssignment;" type="has" targetClassId="&C_Recipe;" siblingInstanceId="&R_Recipe__for__Prep_Chart_Recipe_Assignment;" siblingType="for" />
<relationship id="&R_Prep_Chart_Recipe_Assignment__assigns_for__Prep_Cook;" sourceClassId="&C_PrepChartRecipeAssignment;" type="assigns to" targetClassId="&C_PrepCook;" siblingInstanceId="&R_Prep_Cook__has_assigned__Prep_Chart_Recipe_Assignment;" siblingType="has assigned" singular="true" />
<relationship id="&R_Prep_Chart_Line_Item__has__Prep_Chart_Period;" sourceClassId="&C_PrepChartLineItem;" type="has" targetClassId="&C_PrepChartPeriod;" siblingInstanceId="&R_Prep_Chart_Period__for__Prep_Chart_Line_Item;" siblingType="for" />
</instances>
</library>
<application>
<tenants>
<tenant name="cbocs" type="production">
<references>
<libraryReference libraryId="com.mochapowered.CBOCSPrepChart_v1" />
<libraryReference libraryId="{2826E41F-763A-413F-B239-3D9698AB629F}" filename="/usr/share/mocha/system/Mocha.System.mcl" />
</references>
<instances>
<instance classId="&C_PrepChart;" instanceId="&I_PrepChart1;">
<attributes>
<attribute id="&A_Name;" value="Prep Chart 1" />
</attributes>
<relationships>
<relationship id="&R_Prep_Chart__has__Recipe;">
<targetInstances>
<instanceReference instanceId="&I_Recipe_Pancake;" />
</targetInstances>
</relationship>
</relationships>
</instance>
</instances>
</tenant>
<tenant name="cbocs1" type="implementation">
<references>
<libraryReference libraryId="com.mochapowered.CBOCSPrepChart_v1" />
<libraryReference libraryId="{2826E41F-763A-413F-B239-3D9698AB629F}" filename="/usr/share/mocha/system/Mocha.System.mcl" />
</references>
</tenant>
</tenants>
</application>
</mocha>

View File

@ -0,0 +1,20 @@
// Copyright (C) 2025 Michael Becker <alcexhim@gmail.com>
//
// This file is part of mocha-suv.
//
// mocha-suv is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// mocha-suv is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with mocha-suv. If not, see <https://www.gnu.org/licenses/>.
<mocha>
<library id="com.mochapowered.CBOCSPrepChart_v1">
<class id="&C_PrepChartLineItem;"></class>

View File

@ -0,0 +1,93 @@
// class name id sugarname { }
classIndexBase 13100
attributes {
text `Recipe Name` recipeName
}
relationships {
hasShelfLifeMeasurementUnit {
source shelfLife
type "has"
target shelfLifeMeasurementUnit
singular false
sibling {
type "for"
}
}
hasPrepChartItem {
source prepchart
type "has"
target prepchartitem
singular false
sibling {
type "for"
}
}
}
class `Recipe Shelf Life` shelfLife {
attribute shelfLifeAmount
relationship hasShelfLifeMeasurementUnit
}
class `Recipe Shelf Life Measurement Unit` shelfLifeMeasurementUnit {
attribute shelfLifeAmount
relationship hasShelfLifeMeasurementUnit
}
module `Prep Chart` prepchartmodule {
class `Prep Chart` prepchart {
attributes {
name
}
relationships {
hasPrepChartItem items
}
constructors {
name
}
}
class `Prep Chart Line Item` prepchartitem {
attributes {
name
}
relationships {
forPrepChartItem
}
public getSpecificInstances `get` `Prep Chart Line Item 1` returns pp1
public getSpecificInstances `get` `My Line Items` returns [ pp1 pp2 pp3 ]
instances {
{
name "Prep Chart Line Item 1"
} pp1
`Prep Chart Line Item 2` pp2
}
constructors {
name
}
}
prepchart `Default Prep Chart`
{
items
{
pp1
pp2
new prepchartitem `Prep Chart Line Item 3` pp3
}
}
}

233
samples/mochax.xsd Normal file
View File

@ -0,0 +1,233 @@
<!--
Copyright (C) 2025 Michael Becker <alcexhim@gmail.com>
This file is part of mocha-suv.
mocha-suv is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
mocha-suv is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mocha-suv. If not, see <https://www.gnu.org/licenses/>.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="https://schemas.mochapowered.com/MochaX" xmlns:mx="https://schemas.mochapowered.com/MochaX" elementFormDefault="qualified">
<xs:group name="attributeDefinitionsGroup">
<xs:sequence>
<xs:element name="attributes" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="attributeReference">
<xs:complexType>
<xs:attribute name="attributeInstanceId" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:group>
<xs:group name="attributeValuesGroup">
<xs:sequence>
<xs:element name="attributes" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="attribute">
<xs:complexType>
<xs:attribute name="id" use="required" type="xs:string" />
<xs:attribute name="value" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="relationships" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="relationship">
<xs:complexType>
<xs:sequence>
<xs:element name="targetInstances" type="mx:instanceReferenceOrDefinitionList">
</xs:element>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:string" />
<xs:attribute name="value" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:group>
<xs:complexType name="referenceList">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<!--
<xs:element name="tenantReference">
<xs:complexType>
<xs:attribute name="tenantId" use="required"></xs:attribute>
</xs:complexType>
</xs:element>
-->
<xs:element name="libraryReference">
<xs:complexType>
<xs:attribute name="libraryId" use="required"></xs:attribute>
<xs:attribute name="filename" use="optional"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:complexType name="instanceReferenceList">
<xs:group ref="mx:instanceReferenceGroup" />
</xs:complexType>
<xs:complexType name="instanceReferenceOrDefinitionList">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="mx:instanceReferenceGroup" />
<xs:group ref="mx:instanceDefinitionGroup" />
</xs:choice>
</xs:complexType>
<xs:simpleType name="tenantType">
<xs:restriction base="xs:string">
<xs:enumeration value="production" />
<xs:enumeration value="sandbox" />
<xs:enumeration value="implementation" />
<xs:enumeration value="sandbox-preview" />
<xs:enumeration value="implementation-preview" />
<xs:enumeration value="development" />
<xs:enumeration value="quality-preview" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="attributeType">
<xs:restriction base="xs:string">
<xs:enumeration value="text" />
<xs:enumeration value="boolean" />
<xs:enumeration value="numeric" />
<xs:enumeration value="date" />
<xs:enumeration value="xml" />
<xs:enumeration value="file" />
</xs:restriction>
</xs:simpleType>
<xs:group name="instanceReferenceGroup">
<xs:sequence>
<xs:element name="instanceReference">
<xs:complexType>
<xs:attribute name="instanceId" use="required" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:group>
<xs:group name="instanceDefinitionGroup">
<xs:choice>
<xs:element name="instance">
<xs:complexType>
<xs:sequence>
<xs:group ref="mx:attributeValuesGroup" />
</xs:sequence>
<xs:attribute name="classId" use="required" />
<xs:attribute name="instanceId" use="required" />
<xs:attribute name="classIndex" />
<xs:attribute name="instanceIndex" />
</xs:complexType>
</xs:element>
<xs:element name="class">
<xs:complexType>
<xs:sequence>
<xs:group ref="mx:attributeDefinitionsGroup"></xs:group>
<xs:element name="instances" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="instance" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:group ref="mx:attributeValuesGroup" />
<xs:attribute name="id" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" use="required" />
<xs:attribute name="index" />
<xs:attribute name="name" />
</xs:complexType>
</xs:element>
<xs:element name="attribute">
<xs:complexType>
<xs:attribute name="id" use="required" />
<xs:attribute name="index" type="xs:positiveInteger" use="required" />
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="type" type="mx:attributeType" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="relationship">
<xs:complexType>
<xs:attribute name="id" use="required" />
<xs:attribute name="sourceClassId" type="xs:string" use="required" />
<xs:attribute name="type" type="xs:string" use="required" />
<xs:attribute name="targetClassId" type="xs:string" use="required" />
<xs:attribute name="singular" type="xs:boolean" />
<xs:attribute name="siblingType" type="xs:string" />
<xs:attribute name="siblingInstanceId" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:group>
<xs:complexType name="instanceList">
<xs:group ref="mx:instanceDefinitionGroup" minOccurs="0" maxOccurs="unbounded" />
</xs:complexType>
<xs:element name="mocha">
<xs:complexType>
<xs:sequence>
<xs:element name="library" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="baseAddress" minOccurs="0" maxOccurs="1">
<!--
Defines the initial index values used for classes, attributes, and relationships.
-->
<xs:complexType>
<xs:attribute name="classIndex" type="xs:positiveInteger" />
<xs:attribute name="attributeIndex" type="xs:positiveInteger" />
<xs:attribute name="relationshipIndex" type="xs:positiveInteger" />
</xs:complexType>
</xs:element>
<xs:element name="references" minOccurs="0" maxOccurs="1" type="mx:referenceList" />
<xs:element name="instances" minOccurs="0" maxOccurs="1" type="mx:instanceList" />
</xs:sequence>
<xs:attribute name="id" use="required" />
<xs:attribute name="name" />
<xs:attribute name="filename" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="application" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:choice>
<xs:element name="tenants">
<xs:complexType>
<xs:sequence>
<xs:element name="tenant" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="references" minOccurs="0" maxOccurs="1" type="mx:referenceList" />
<xs:element name="instances" minOccurs="0" maxOccurs="1" type="mx:instanceList" />
</xs:sequence>
<xs:attribute name="name" use="required" />
<xs:attribute name="type" use="required" type="mx:tenantType"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>