Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions 1edtech-examples/model/model_with_localizations.lines
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Model test01 2022-03-24 v0p1 "s:Draft" "t:Test Model 01" "Test model 01" "l:en-US"

Package DataClasses DataModel

Class Thing Unordered false []
Property id UUID 1
Property startDate DateZ 1
Property endDate DateZ 0..1

Class Thang Unordered false []
Property id UUID 1
Property thingRef UUIDRef 1
Property size Integer 0..1

Package PrimitiveTypes DataModel
//some includes from the common data model
Includes [String, Date, NormalizedString, Integer]

Package DerivedTypes DataModel
//some includes from the common data model
Includes [DateZ, UUID, UUIDRef, Identifier, Reference]


Package BaseService ServiceModel REST /ims/test/v0p1

Interface Things "t:The Thing Endpoints" "n:note1" "n:note2"

Operation getThingById GET /thing/{id} "Get a Thing by ID"
Param id in Path NormalizedString 1 "The sourced ID of the thing"
Response 200 Thing
Responses errors

Operation getAllThings GET /things "Get all the Things"
Params commonQueryParams in
Response 200 Thing 0..* paging
Response Default String

Interface Thangs "t:The Thang Endpoints"

Operation addThang POST /thang Thang "Add a single Thang"
Response 202
Params commonResponseHeaders out
Response Default String

Operation addThangs POST /thangs Thang 1..* "Add multiple Thangs"
Response 202
Params commonResponseHeaders out
Param X-Header-Baz out Header String 0..1
Responses errors

//a reusable group of query parameters
ParamList commonQueryParams
Param query1 in Query String 1
Param query2 in Query Integer 0..1

//a reusable group of response parameters
ParamList commonResponseHeaders
Param X-Header-Foo out Header String 0..1
Param X-Header-Bar out Header Integer 0..1

//a reusable group of responses
ResponseList errors
Response 404
Response 402
Response Default String 0..1

Localizations ca-ES http://localhost:8000/1edtech-examples/model/model_with_localizations_ca_ES.lines
29 changes: 29 additions & 0 deletions 1edtech-examples/model/model_with_localizations_ca_ES.lines
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Model test01 "t:Model de prova 01" "Model de prova 01"

Package DataClasses "Classes de dades"

Class Thing "Cosa"
Property id "identificador"
Property startDate "Data d'inici"
Property endDate "Data de finalització"

Class Thang "Thang"
Property id "identificador"
Property thingRef "referència a Cosa"
Property size "mida"


Package BaseService "Servei Base"

Interface Things "t:Operacions sobre Cosa" "n:primera nota" "n:segona nota"

Operation getThingById "Obtenir una Cosa per ID"
Param id "ID de la cosa"

Operation getAllThings "Obtenir totes les coses"

Interface Thangs "t:Operacions sobre Thang"

Operation addThang "Afegir un Thang"

Operation addThangs "Afegir múltiples Thangs"
123 changes: 123 additions & 0 deletions 1edtech-examples/mps_ca.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="ca-ES">

<head>
<meta charset='utf-8'>
<title>
Exemple d'especificació 1EdTech
</title>
<script src='../profiles/1edtech.js' type="module" class="remove"></script>

<!-- Load the MPS configuration -->
<script class="remove" src="mps-config.js"></script>
<script class="remove" src="mps-auth.js"></script>

<!-- Load ajv2019 (Another JSON Schema Validator) if you want your examples validated -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/ajv/8.8.2/ajv2019.bundle.min.js"
integrity="sha512-9CfeXrjdW9wxGntWtQ4wE0k9RD8avpYxoPEKAGu+EP87RyqXYVQjed0l872XkNtQeIyYavZeqY+jzm69pmjEDw=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script class='remove'>

var respecConfig = {
specTitle: "Exemple d'especificació 1EdTech",
shortName: "example",
specStatus: "Base Document",
specVersion: "1.0",
docVersion: "1",
specNature: "normative",
specType: "spec",
skipCertGuideConformanceRef: true,
localBiblio: {
"DATA-INTEGRITY": {
title: "Data Integrity 1.0",
href: "https://w3c-ccg.github.io/data-integrity-spec/",
authors: [
"Manu Sporny",
"Dave Longley"
],
status: "CG-DRAFT",
publisher: "Credentials Community Group"
},
"MULTIBASE": {
title: "Multibase"
},
"MULTICODEC": {
title: "Multicodec"
},
"CTDL-TERMS": {
title: "CTDL Terms",
publisher: "Credential Engine"
},
"CTDL-ASN-TERMS": {
title: "CTDL-ASN Terms",
publisher: "Credential Engine"
}
},

// Add the MPS configuration to respecConfig
mps: {..._mps, apiKey: _mpsApiKey},

showPrivacyAnnotations: true,

// Add VC proof examples
// postProcess: [
// window.respecVc.createVcExamples
// ],
};
respecConfig.mps.apiKey = _mpsApiKey;
</script>
</head>

<body>
<section id='abstract'>
<h2>Resum</h2>
<p>Resum molt simple.</p>
<div class="note">
Per que aquest exemple funcioni correctament s'ha de carregar al MPS el model definit a
<code>model/model_with_localizations.lines</code>. Aquest model pressuposa que el servidor
respec està arrencat en el port 8000.
</div>
<div class="note">
In order to work properly, the model defined at <code>model/model_with_localizations.lines</code>
must be sideloaded into MPS. This model assumes respec server is running on port 8000.
</div>
</section>
<section id="conformance" class="informative">
<h2>Conformitat</h2>
</section>
<section>
<h2>Terminologia</h2>
<dl>
<dt><dfn>Authorization Server</dfn></dt>
<dd>Un servidor d'autorització.</dd>
<dt><dfn>Resource Server</dfn></dt>
<dd>Un servidor de recursos.</dd>
<dt><dfn>credential equality and comparison</dfn></dt>
<dd>Un algoritme.</dd>
</dl>
</section>
<section id="data-integrity">
<h2>Integritat</h2>
<p>Aquesta especificació empra els termes definits a l'especificació [[DATA-INTEGRITY]].</p>
</section>
<section id="proofs-signatures">
<h2>Sigantures</h2>
</section>

<!-- Start a data model section-->
<section data-model="org.1edtech.test01.v0p1.model"
data-service-model="org.1edtech.test01.v0p1.servicemodel"
data-source="SANDBOX">
</section>

<section data-model="org.1edtech.test01.v0p1.model" data-package="DataClasses" class="appendix" data-source="SANDBOX"></section>
<section data-model="org.1edtech.test01.v0p1.model" data-stereotype="DerivedType" title="Derived Types" class="appendix" data-source="SANDBOX">
<p>Tipus derivats del Common Data Model.</p>
</section>
<section data-model="org.1edtech.test01.v0p1.model" data-stereotype="PrimitiveType" title="Primitive Types" class="appendix" data-source="SANDBOX"></section>


</body>

</html>
9 changes: 6 additions & 3 deletions src/1edtech/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
// Module 1edtech/abstract
// Handle the abstract section properly.
import { html } from "../core/import-maps.js";
import { showWarning } from "../core/utils.js";
import { getIntlData, showWarning } from "../core/utils.js";
export const name = "1edtech/abstract";

import localizationStrings from "./translations/abstract.js";
const l10n = getIntlData(localizationStrings);

/**
* Handles checking for the abstract, and inserts a temp one if not present.
*/
Expand All @@ -14,7 +17,7 @@ export async function run() {
showWarning("Document should have one element with 'abstract'", name);
// insert a temp abstract
abstract = html`<section id="abstract" class="introductory remove">
<h2>To be removed</h2>
<h2>${l10n.to_be_removed}</h2>
</section>`;
document.body.prepend(abstract);
}
Expand All @@ -35,6 +38,6 @@ export async function run() {
return;
}
abstractHeading = document.createElement("h2");
abstractHeading.textContent = "Abstract";
abstractHeading.textContent = l10n.abstract;
abstract.prepend(abstractHeading);
}
40 changes: 13 additions & 27 deletions src/1edtech/conformance.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
// - Use slightly modified conformance text.
//
// Note: Run after inlines so the conformance section has an id and NormativeReferences is available.
import { htmlJoinAnd, showError, showWarning } from "../core/utils.js";
import { getIntlData, htmlJoinAnd, showError, showWarning } from "../core/utils.js";
import { html } from "../core/import-maps.js";
import { renderInlineCitation } from "../core/render-biblio.js";
import { rfc2119Usage } from "../core/inlines.js";
import localizationStrings from "./translations/conformance.js";
const l10n = getIntlData(localizationStrings);

export const name = "1edtech/conformance";

Expand Down Expand Up @@ -53,38 +55,28 @@ function getNormativeText(conf) {
const plural = terms.length > 1;

const content = html`<p>
As well as sections marked as non-normative, all authoring guidelines,
diagrams, examples, and notes in this specification are non-normative.
Everything else in this specification is normative.
${l10n.normative_text_paragraph_1}
</p>
${terms.length
? html`
<p>
The key word${plural ? "s" : ""} ${[keywords]} in this document
${plural ? "are" : "is"} to be interpreted as described in
${renderInlineCitation("RFC2119")}.
${plural ? `${l10n.the_plural} ${l10n.key_words}` : `${l10n.the} ${l10n.key_word}`}
${[keywords]}
${l10n.keywords_paragraph
.replace("{0}", plural ? l10n.are : l10n.is)
.replace("{1}", renderInlineCitation("RFC2119"))}
</p>
`
: null}
<p>
An implementation of this specification that fails to implement a
MUST/REQUIRED/SHALL requirement or fails to abide by a MUST NOT/SHALL NOT
prohibition is considered nonconformant. SHOULD/SHOULD NOT/RECOMMENDED
statements constitute a best practice. Ignoring a best practice does not
violate conformance but a decision to disregard such guidance should be
carefully considered. MAY/OPTIONAL statements indicate that implementers
are entirely free to choose whether or not to implement the option.
</p>`;
<p>${l10n.normative_text_implementation}</p>`;

if (conf.skipCertGuideConformanceRef || conf.specType == "cert") {
return content;
}

return html`${content}
<p>
The <a href="#document-set">Conformance and Certification Guide</a>
for this specification may introduce greater normative constraints than
those defined here for specific service or implementation categories.
${l10n.normative_text_certification_constraints}
</p>`;
}

Expand All @@ -101,14 +93,8 @@ function getInformativeText(conf) {
}

return html` <p>
This document is an informative resource in the Document Set of the
${conf.mainSpecTitle ? conf.mainSpecTitle : ""} specification
${conf.mainSpecBiblioKey
? renderInlineCitation(conf.mainSpecBiblioKey)
: ""}.
As such, it does not include any normative requirements. Occurrences in this
document of terms such as MAY, MUST, MUST NOT, SHOULD or RECOMMENDED have no
impact on the conformance criteria for implementors of this specification.
${l10n.informative_text_paragraph_1.replace("{0}", conf.mainSpecTitle ? conf.mainSpecTitle : "").replace("{1}", conf.mainSpecBiblioKey ? renderInlineCitation(conf.mainSpecBiblioKey) : "")}.
${l10n.informative_text_paragraph_2}
</p>`;
}

Expand Down
18 changes: 11 additions & 7 deletions src/1edtech/contrib.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// @ts-check

import { toHTMLNode } from "./utils.js";
import { getIntlData } from "../core/utils.js";

import localizationStrings from "./translations/contrib.js";
const l10n = getIntlData(localizationStrings);

export const name = "1edtech/contrib";

Expand All @@ -10,14 +14,14 @@ export async function run(conf) {
if (conf.specType !== "errata") {
const useRoles = hasRoles(conf.contributors);
const contrib = toHTMLNode(`<section id='contributors' class="appendix">
<h2>List of Contributors</h2>
<p>The following individuals contributed to the development of this document:</p>
<table class="contributors" title="List of Contributors"
summary="The list of contributors to this work.">
<h2>${l10n.title}</h2>
<p>${l10n.intro}</p>
<table class="contributors" title="${l10n.title}"
summary="${l10n.summary}">
<thead>
<th>Name</th>
<th>Organization</th>
${useRoles ? `<th>Role</th>` : ``}
<th>${l10n.name}</th>
<th>${l10n.organization}</th>
${useRoles ? `<th>${l10n.role}</th>` : ``}
</thead>
<tbody>
${personsToTableRows(conf.contributors, useRoles)}
Expand Down
Loading
Loading