Skip to content

Commit

Permalink
Query content refactoring
Browse files Browse the repository at this point in the history
`bs2:Create` at the end of document-level `bs2:Row`
  • Loading branch information
namedgraph committed Dec 8, 2023
1 parent 26a5a04 commit 18f83bf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1184,13 +1184,12 @@ exclude-result-prefixes="#all"

<xsl:template name="bs2:QueryForm">
<xsl:param name="method" select="'get'" as="xs:string"/>
<xsl:param name="action" select="xs:anyURI('')" as="xs:anyURI"/>
<xsl:param name="action" select="$sd:endpoint" as="xs:anyURI"/>
<xsl:param name="id" as="xs:string?"/>
<xsl:param name="class" select="'sparql-query-form form-horizontal'" as="xs:string?"/>
<xsl:param name="accept-charset" select="'UTF-8'" as="xs:string?"/>
<xsl:param name="enctype" as="xs:string?"/>
<xsl:param name="textarea-id" select="'id' || ac:uuid()" as="xs:string"/>
<!--<xsl:param name="uri" as="xs:anyURI?"/>-->
<xsl:param name="mode" as="xs:anyURI*"/>
<xsl:param name="service" as="xs:anyURI?"/>
<xsl:param name="endpoint" as="xs:anyURI?"/>
Expand Down Expand Up @@ -1218,8 +1217,8 @@ LIMIT 100]]>
</xsl:if>

<!-- <fieldset>-->
<div class="control-group">
<label class="control-label">Service</label> <!-- for="service" -->
<!-- <div class="control-group">
<label class="control-label">Service</label> for="service"
<div class="controls">
<select name="service" class="input-xxlarge input-query-service">
Expand All @@ -1235,12 +1234,12 @@ LIMIT 100]]>
</div>
<div class="control-group required">
<label class="control-label">Title</label> <!-- for="title" -->
<label class="control-label">Title</label> for="title"
<div class="controls">
<input type="text" name="title"/>
</div>
</div>
</div>-->

<textarea name="query" class="span12" rows="15">
<xsl:if test="$textarea-id">
Expand All @@ -1260,21 +1259,21 @@ LIMIT 100]]>
<xsl:apply-templates select="key('resources', 'run', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $ac:contextUri)))" mode="ac:label"/>
</xsl:value-of>
</button>
<button type="button" class="btn btn-primary btn-save btn-save-query">
<!-- <button type="button" class="btn btn-primary btn-save btn-save-query">
<xsl:value-of>
<xsl:apply-templates select="key('resources', 'save', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $ac:contextUri)))" mode="ac:label"/>
</xsl:value-of>
</button>
</button>-->
<button type="button" class="btn btn-primary btn-open-query">
<xsl:value-of>
<xsl:apply-templates select="key('resources', 'open', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $ac:contextUri)))" mode="ac:label"/>
</xsl:value-of>
</button>
<button type="button" class="btn btn-cancel">
<!-- <button type="button" class="btn btn-cancel">
<xsl:value-of>
<xsl:apply-templates select="key('resources', 'cancel', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $ac:contextUri)))" mode="ac:label"/>
</xsl:value-of>
</button>
</button>-->
</div>
<!-- </fieldset>-->
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,22 @@ extension-element-prefixes="ixsl"
<!-- ROW BLOCK -->

<xsl:template match="rdf:RDF" mode="bs2:Row">
<xsl:param name="create-resource" select="true()" as="xs:boolean"/>
<!-- select elements explicitly, because Saxon-JS chokes on text nodes here -->
<!-- hide the current document resource and the content resources -->
<xsl:apply-templates select="*" mode="#current">
<xsl:sort select="ac:label(.)"/>
</xsl:apply-templates>

<xsl:if test="$create-resource">
<div class="create-resource row-fluid">
<div class="main offset2 span7">
<xsl:apply-templates select="." mode="bs2:Create">
<xsl:with-param name="classes" select="$classes"/>
</xsl:apply-templates>
</div>
</div>
</xsl:if>
</xsl:template>

<!-- MAP -->
Expand Down Expand Up @@ -846,14 +857,6 @@ extension-element-prefixes="ixsl"
<xsl:apply-templates select="." mode="bs2:Create">
<xsl:with-param name="classes" select="$classes"/>
</xsl:apply-templates>

<!-- separate "Create" button only for Content -->
<a href="{ac:build-uri(ac:absolute-path(base-uri()), map{ 'forClass': '&ldh;Content' })}" class="btn btn-primary add-constructor create-action">
<xsl:value-of>
<xsl:apply-templates select="key('resources', '&ldh;Content', document(ac:document-uri('&ldh;')))" mode="ac:label"/>
</xsl:value-of>
<input type="hidden" class="forClass" value="&ldh;Content"/>
</a>
</div>
</div>
</xsl:if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exclude-result-prefixes="#all">

<!-- BLOCK MODE -->

<xsl:template match="*[ixsl:query-params()?mode = '&ldh;ContentMode'][sp:text/text()]" mode="bs2:Block" use-when="system-property('xsl:product-name') eq 'SaxonJS'">
<xsl:template match="*[sp:text/text()] | *[@rdf:nodeID]/sp:text/@rdf:nodeID[key('resources', .)[not(* except rdf:type[@rdf:resource = '&xsd;string'])]]" mode="bs2:Block" use-when="system-property('xsl:product-name') eq 'SaxonJS'">
<xsl:param name="method" select="'get'" as="xs:string"/>
<xsl:param name="action" select="xs:anyURI('')" as="xs:anyURI"/>
<xsl:param name="id" as="xs:string?"/>
Expand Down Expand Up @@ -63,8 +63,8 @@ exclude-result-prefixes="#all">
</xsl:if>

<!-- <fieldset>-->
<div class="control-group">
<label class="control-label">Service</label> <!-- for="service" -->
<!-- <div class="control-group">
<label class="control-label">Service</label> for="service"
<div class="controls">
<select name="service" class="input-xxlarge input-query-service">
Expand All @@ -77,7 +77,7 @@ exclude-result-prefixes="#all">
</option>
</select>
</div>
</div>
</div>-->

<!-- <div class="control-group required">
<label class="control-label">Title</label>
Expand Down Expand Up @@ -110,11 +110,12 @@ exclude-result-prefixes="#all">
<xsl:apply-templates select="key('resources', 'open', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $ac:contextUri)))" mode="ac:label"/>
</xsl:value-of>
</button>
<!-- <button type="button" class="btn btn-primary btn-save btn-save-query">
<button type="button" class="btn btn-primary btn-save btn-save-query">
<xsl:value-of>
<xsl:apply-templates select="key('resources', 'save', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $ac:contextUri)))" mode="ac:label"/>
</xsl:value-of>
</button>
<!--
<button type="button" class="btn btn-cancel">
<xsl:value-of>
<xsl:apply-templates select="key('resources', 'cancel', document(resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $ac:contextUri)))" mode="ac:label"/>
Expand All @@ -123,12 +124,14 @@ exclude-result-prefixes="#all">
</div>
<!-- </fieldset>-->
</form>

<xsl:next-match/>
</xsl:template>

<xsl:template match="sp:text/text() | *[@rdf:*[local-name() = 'nodeID']]/sp:text/@rdf:*[local-name() = 'nodeID'][key('resources', .)[not(* except rdf:type[@rdf:resource = '&xsd;string'])]]" mode="bs2:FormControl">
<xsl:param name="type-label" select="true()" as="xs:boolean"/>

<textarea name="ol" id="{generate-id()}" class="sp:text" rows="10" style="font-family: monospace;">
<textarea name="ol" id="{generate-id()}" rows="10" style="font-family: monospace;">
<xsl:if test="self::text()">
<xsl:value-of select="."/>
</xsl:if>
Expand Down

0 comments on commit 18f83bf

Please sign in to comment.