Skip to content

Commit

Permalink
Merge pull request #1674 from CruGlobal/specCleanup
Browse files Browse the repository at this point in the history
xml spec cleanup
  • Loading branch information
frett authored Oct 24, 2024
2 parents 42eb9b8 + a867982 commit af4ce91
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 139 deletions.
2 changes: 1 addition & 1 deletion public/xmlns/lesson.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<xs:import namespace="https://mobile-content-api.cru.org/xmlns/analytics" schemaLocation="analytics.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/content" schemaLocation="content.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/page" schemaLocation="page.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/page" schemaLocation="page_base.xsd" />

<xs:element name="page">
<xs:complexType>
Expand Down
2 changes: 1 addition & 1 deletion public/xmlns/manifest.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/article" schemaLocation="article.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/content" schemaLocation="content.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/lesson" schemaLocation="lesson.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/page" schemaLocation="page.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/page" schemaLocation="page_base.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/publish" schemaLocation="publish.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/shareable" schemaLocation="shareable.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/tract" schemaLocation="tract.xsd" />
Expand Down
138 changes: 4 additions & 134 deletions public/xmlns/page.xsd
Original file line number Diff line number Diff line change
@@ -1,138 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:analytics="https://mobile-content-api.cru.org/xmlns/analytics"
xmlns:content="https://mobile-content-api.cru.org/xmlns/content"
xmlns:cyoa="https://mobile-content-api.cru.org/xmlns/cyoa"
xmlns:page="https://mobile-content-api.cru.org/xmlns/page" xmlns:xs="http://www.w3.org/2001/XMLSchema"
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" targetNamespace="https://mobile-content-api.cru.org/xmlns/page">

<xs:import namespace="https://mobile-content-api.cru.org/xmlns/analytics" schemaLocation="analytics.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/content" schemaLocation="content.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/cyoa" schemaLocation="cyoa.xsd" />

<!-- region Page -->
<xs:complexType name="BasePageType">
<xs:sequence>
<xs:element ref="analytics:events" minOccurs="0">
<xs:annotation>
<xs:documentation>
Analytics events to trigger for this page. The default trigger mode for analytics events on
pages is "visible".
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>

<xs:attribute name="id" type="content:id" />

<xs:attribute name="hidden" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>Is this page hidden until triggered by a listener.</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="listeners" type="content:listeners">
<xs:annotation>
<xs:documentation>This is a list of event_ids that will cause navigation to jump to this page. Page
listeners are always "active".
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dismiss-listeners" type="content:listeners">
<xs:annotation>
<xs:documentation>This is the list of event_ids that will pop this page off a navigation stack. This
listener is only "active" when the page is on top of the navigation stack.

This listener currently only applies to the cyoa tool type.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="primary-color" type="content:colorValue">
<xs:annotation>
<xs:documentation>The primary color for this page. Defaults to the primary-color of the Manifest.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="primary-text-color" type="content:colorValue">
<xs:annotation>
<xs:documentation>The text color for text displayed on top of the primary-color. Defaults to the
primary-text-color of the Manifest.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="background-color" type="content:colorValue" default="rgba(255, 255, 255, 0)">
<xs:annotation>
<xs:documentation>This defines the background color for this page. This background color is layered on
top of any manifest background layers.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="background-image" type="xs:string">
<xs:annotation>
<xs:documentation>This defines a background image for this page.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="background-image-align" type="content:imageGravity" default="center">
<xs:annotation>
<xs:documentation>This defines how we align the background image. This defaults to center.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="background-image-scale-type" type="content:imageScaleType" default="fill-x">
<xs:annotation>
<xs:documentation>This defines how we should scale the background image. This defaults to fill-x.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="control-color" type="content:colorValue">
<xs:annotation>
<xs:documentation>This defines the control color for this page. This defaults to the page control color
defined on the manifest.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="text-color" type="content:colorValue">
<xs:annotation>
<xs:documentation>The default text color for text content on this page. Defaults to the Manifest
text-color.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="text-scale" type="xs:float" default="1">
<xs:annotation>
<xs:documentation>Defines how much to scale all the text content on this page by.</xs:documentation>
</xs:annotation>
</xs:attribute>

<!-- Import any external groups of attributes we want to support -->
<xs:attributeGroup ref="content:page" />
<xs:attributeGroup ref="cyoa:page" />
</xs:complexType>
<!-- region Page -->

<!-- region external attributes -->
<xs:attributeGroup name="manifest">
<xs:annotation>
<xs:documentation>This attribute group is the set of attributes that can appear on the manifest node in the
manifest xml.
</xs:documentation>
</xs:annotation>
<xs:attribute ref="page:control-color" default="rgba(225, 225, 225, 1)">
<xs:annotation>
<xs:documentation>
This defines the control color for pages.

Deprecated behavior:
Fallback to lesson:control-color for lesson tool types.
Remove this behavior once lesson:control-color is removed.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>

<xs:attribute name="control-color" type="content:colorValue" />
<!-- endregion external attributes -->
<xs:include schemaLocation="page_base.xsd" />
<xs:include schemaLocation="page_cardcollection.xsd" />
<xs:include schemaLocation="page_content.xsd" />
</xs:schema>
138 changes: 138 additions & 0 deletions public/xmlns/page_base.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:analytics="https://mobile-content-api.cru.org/xmlns/analytics"
xmlns:content="https://mobile-content-api.cru.org/xmlns/content"
xmlns:cyoa="https://mobile-content-api.cru.org/xmlns/cyoa"
xmlns:page="https://mobile-content-api.cru.org/xmlns/page" xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" targetNamespace="https://mobile-content-api.cru.org/xmlns/page">

<xs:import namespace="https://mobile-content-api.cru.org/xmlns/analytics" schemaLocation="analytics.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/content" schemaLocation="content.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/cyoa" schemaLocation="cyoa.xsd" />

<!-- region Page -->
<xs:complexType name="BasePageType">
<xs:sequence>
<xs:element ref="analytics:events" minOccurs="0">
<xs:annotation>
<xs:documentation>
Analytics events to trigger for this page. The default trigger mode for analytics events on
pages is "visible".
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>

<xs:attribute name="id" type="content:id" />

<xs:attribute name="hidden" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>Is this page hidden until triggered by a listener.</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="listeners" type="content:listeners">
<xs:annotation>
<xs:documentation>This is a list of event_ids that will cause navigation to jump to this page. Page
listeners are always "active".
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dismiss-listeners" type="content:listeners">
<xs:annotation>
<xs:documentation>This is the list of event_ids that will pop this page off a navigation stack. This
listener is only "active" when the page is on top of the navigation stack.

This listener currently only applies to the cyoa tool type.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="primary-color" type="content:colorValue">
<xs:annotation>
<xs:documentation>The primary color for this page. Defaults to the primary-color of the Manifest.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="primary-text-color" type="content:colorValue">
<xs:annotation>
<xs:documentation>The text color for text displayed on top of the primary-color. Defaults to the
primary-text-color of the Manifest.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="background-color" type="content:colorValue" default="rgba(255, 255, 255, 0)">
<xs:annotation>
<xs:documentation>This defines the background color for this page. This background color is layered on
top of any manifest background layers.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="background-image" type="xs:string">
<xs:annotation>
<xs:documentation>This defines a background image for this page.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="background-image-align" type="content:imageGravity" default="center">
<xs:annotation>
<xs:documentation>This defines how we align the background image. This defaults to center.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="background-image-scale-type" type="content:imageScaleType" default="fill-x">
<xs:annotation>
<xs:documentation>This defines how we should scale the background image. This defaults to fill-x.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="control-color" type="content:colorValue">
<xs:annotation>
<xs:documentation>This defines the control color for this page. This defaults to the page control color
defined on the manifest.
</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:attribute name="text-color" type="content:colorValue">
<xs:annotation>
<xs:documentation>The default text color for text content on this page. Defaults to the Manifest
text-color.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="text-scale" type="xs:float" default="1">
<xs:annotation>
<xs:documentation>Defines how much to scale all the text content on this page by.</xs:documentation>
</xs:annotation>
</xs:attribute>

<!-- Import any external groups of attributes we want to support -->
<xs:attributeGroup ref="content:page" />
<xs:attributeGroup ref="cyoa:page" />
</xs:complexType>
<!-- region Page -->

<!-- region external attributes -->
<xs:attributeGroup name="manifest">
<xs:annotation>
<xs:documentation>This attribute group is the set of attributes that can appear on the manifest node in the
manifest xml.
</xs:documentation>
</xs:annotation>
<xs:attribute ref="page:control-color" default="rgba(225, 225, 225, 1)">
<xs:annotation>
<xs:documentation>
This defines the control color for pages.

Deprecated behavior:
Fallback to lesson:control-color for lesson tool types.
Remove this behavior once lesson:control-color is removed.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>

<xs:attribute name="control-color" type="content:colorValue" />
<!-- endregion external attributes -->
</xs:schema>
2 changes: 1 addition & 1 deletion public/xmlns/page_cardcollection.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<xs:import namespace="https://mobile-content-api.cru.org/xmlns/analytics" schemaLocation="analytics.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/content" schemaLocation="content.xsd" />
<xs:include schemaLocation="page.xsd" />
<xs:include schemaLocation="page_base.xsd" />

<xs:complexType name="cardcollection">
<xs:complexContent>
Expand Down
2 changes: 1 addition & 1 deletion public/xmlns/page_content.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
elementFormDefault="qualified" targetNamespace="https://mobile-content-api.cru.org/xmlns/page">

<xs:import namespace="https://mobile-content-api.cru.org/xmlns/content" schemaLocation="content.xsd" />
<xs:include schemaLocation="page.xsd" />
<xs:include schemaLocation="page_base.xsd" />

<xs:complexType name="content">
<xs:complexContent>
Expand Down
2 changes: 1 addition & 1 deletion public/xmlns/tract.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<xs:import namespace="https://mobile-content-api.cru.org/xmlns/analytics" schemaLocation="analytics.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/content" schemaLocation="content.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/page" schemaLocation="page.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/page" schemaLocation="page_base.xsd" />
<xs:import namespace="https://mobile-content-api.cru.org/xmlns/training" schemaLocation="training.xsd" />

<xs:element name="page">
Expand Down

0 comments on commit af4ce91

Please sign in to comment.