|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:sc="http://www.ascc.net/xml/schematron" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:srophe="https://srophe.app" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:local="http://syriaca.org/ns" version="3.0"> |
3 | 3 | <!-- |
4 | | - Generate XForms from a schema. Designed for TEI XML creation and editing. Run as an eXist-db application. |
5 | | - Resulting TEI can be saved to eXist-db, downloaded to local filesystem, or saved to a GitHub repository |
| 4 | + Generate XForms from a schema. Designed for TEI XML creation and editing. Run as an Elemental application. |
| 5 | + Resulting TEI can be saved to Elemental, downloaded to local filesystem, or saved to a GitHub repository |
6 | 6 | |
7 | 7 | Expectations: |
8 | 8 | |
|
12 | 12 | - Local schema constrainst, such as an ODD file |
13 | 13 | - Main schema as an ODD file |
14 | 14 | - XSLTForms |
15 | | - - eXist-db |
| 15 | + - Elemental |
16 | 16 | |
17 | 17 | Version: 1.72 Beta |
18 | 18 | -1.23 marks a major redesign |
|
652 | 652 | <xf:setvalue ref="instance('i-rec')//*:titleStmt/*:editor[last()]" value="instance('i-user')//*:fullName"/> |
653 | 653 | <xf:setvalue ref="instance('i-rec')//*:titleStmt/*:editor[last()]/@xml:id" value="instance('i-user')//*:user"/> |
654 | 654 | --> |
655 | | - <xf:insert ref="instance('i-rec')//*:revisionDesc/child::*" at="1" origin="instance('i-admin')//*:change[1]" position="before"/> |
656 | | - <xf:setvalue ref="instance('i-rec')//*:revisionDesc/*:change[1]/@who" value="concat('#',instance('i-user')//*:user)"/> |
657 | | - <xf:setvalue ref="instance('i-rec')//*:revisionDesc/*:change[1]/@when" value="getXMLDate()"/> |
658 | 655 | <xf:setvalue ref="instance('i-new')//*:new" value="'true'"/> |
659 | 656 | </xf:action> |
660 | 657 | <xf:message level="modeless" ev:event="xforms-submit-error"> Submit error. </xf:message> |
|
669 | 666 | <xf:setvalue ref="instance('i-rec')//*:titleStmt/*:editor[last()]" value="instance('i-user')//*:fullName"/> |
670 | 667 | <xf:setvalue ref="instance('i-rec')//*:titleStmt/*:editor[last()]/@xml:id" value="instance('i-user')//*:user"/> |
671 | 668 | --> |
672 | | - <xf:insert ref="instance('i-rec')//*:revisionDesc/child::*" at="1" origin="instance('i-admin')//*:change[1]" position="before"/> |
673 | | - <xf:setvalue ref="instance('i-rec')//*:revisionDesc/*:change[1]/@who" value="concat('#',instance('i-user')//*:user)"/> |
674 | | - <xf:setvalue ref="instance('i-rec')//*:revisionDesc/*:change[1]/@when" value="getXMLDate()"/> |
675 | 669 | <xf:setvalue ref="instance('i-new')//*:new" value="'false'"/> |
676 | 670 | </xf:action> |
677 | 671 | <xf:message level="modeless" ev:event="xforms-submit-error"> Submit error. </xf:message> |
|
719 | 713 |
|
720 | 714 | <!-- Save record to github --> |
721 | 715 | <xf:submission id="s-github" ref="instance('i-rec')" replace="instance" instance="i-submission" method="post"> |
| 716 | + <xf:action ev:event="xforms-submit"> |
| 717 | + <!-- Set the change details in the record before saving --> |
| 718 | + <xf:insert context="instance('i-rec')//tei:teiHeader/tei:revisionDesc" nodeset="tei:change" at="1" position="before" origin="instance('i-admin')/tei:change"/> |
| 719 | + </xf:action> |
722 | 720 | <xf:resource value="concat('services/submit.xql?type=github','&new=',string(instance('i-new')//*:new),'&eXistCollection=',string(instance('i-submission-params')//*:saveOptions/*:option[@name='exist-db']/*:parameter[@name='eXistCollection']),'&githubRepoName=',string(instance('i-submission-params')//*:parameter[@name='githubRepoName']),'&githubPath=',string(instance('i-submission-params')//*:parameter[@name='githubPath']),'&githubOwner=',string(instance('i-submission-params')//*:parameter[@name='githubOwner']),'&githubBranch=',string(instance('i-submission-params')//*:parameter[@name='githubBranch']))"/> |
723 | 721 | <xf:action ev:event="xforms-submit-done"> |
724 | 722 | <xf:message ref="instance('i-submission')//*:message"/> |
|
1104 | 1102 | </div> |
1105 | 1103 | <div class="input-group mb-3"> |
1106 | 1104 | <h3>Credits</h3> |
1107 | | - <xf:repeat ref="instance('i-rec')//*:revisionDesc/*:change" id="changeRec"> |
| 1105 | + <xf:repeat ref="instance('i-rec')//tei:teiHeader/tei:revisionDesc/tei:change" id="changeRec"> |
1108 | 1106 | <div class="change"> |
1109 | 1107 | <xf:output value="concat(@who,' (', @when,'): ', .)"/> |
1110 | 1108 | </div> |
|
1156 | 1154 | <div class="fileLoading"> |
1157 | 1155 | <p>Write a one-sentence description of the changes you made to the file.</p> |
1158 | 1156 | <div class="input-group mb-3 full-width"> |
1159 | | - <xf:textarea ref="instance('i-rec')//*:revisionDesc/*:change[1]" class="large-textarea"/> |
| 1157 | + <xf:textarea ref="instance('i-admin')/tei:change" class="large-textarea"/> |
1160 | 1158 | </div> |
1161 | 1159 | <div class="mb-3"> |
1162 | 1160 | <xf:trigger class="btn btn-outline-secondary" appearance="minimal"> |
1163 | 1161 | <xf:label> Save</xf:label> |
1164 | 1162 | <xf:action ev:event="DOMActivate"> |
| 1163 | + <xf:setvalue ref="instance('i-admin')/tei:change/@who" value="concat('#', instance('i-user')//*:user)"/> |
| 1164 | + <xf:setvalue ref="instance('i-admin')/tei:change/@when" value="getXMLDate()"/> |
1165 | 1165 | <xf:toggle case="changeElementHide" ev:event="DOMActivate"/> |
1166 | 1166 | <xf:send submission="s-github"/> |
1167 | 1167 | </xf:action> |
1168 | 1168 | </xf:trigger> |
1169 | 1169 | <xf:trigger class="btn btn-outline-secondary" appearance="minimal"> |
1170 | 1170 | <xf:label> Cancel</xf:label> |
1171 | 1171 | <xf:action ev:event="DOMActivate"> |
| 1172 | + <xf:setvalue ref="instance('i-admin')/tei:change/@who" value="'#'"/> |
| 1173 | + <xf:setvalue ref="instance('i-admin')/tei:change/@when" value="''"/> |
| 1174 | + <xf:setvalue ref="instance('i-admin')/tei:change" value="''"/> |
1172 | 1175 | <xf:toggle case="changeElementHide" ev:event="DOMActivate"/> |
1173 | | - <xf:setvalue ref="instance('i-rec')//*:revisionDesc/*:change[1]" value="''"/> |
1174 | 1176 | </xf:action> |
1175 | 1177 | </xf:trigger> |
1176 | 1178 | </div> |
|
0 commit comments