Skip to content

Commit

Permalink
ldh:View is now a "normal" resource, not a content block
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Nov 24, 2024
1 parent 1a062dd commit 2c16b28
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/main/resources/com/atomgraph/linkeddatahub/ldh.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@
# charts

:Chart a rdfs:Class, owl:Class ;
rdfs:subClassOf :Block ;
rdfs:label "Chart" ;
spin:constructor :ChartConstructor ;
spin:constraint :MissingQuery, :MissingChartType ;
Expand Down Expand Up @@ -301,7 +300,6 @@
# view

:View a rdfs:Class, owl:Class ;
rdfs:subClassOf :Block ;
rdfs:label "View" ;
spin:constructor :ViewConstructor ;
spin:constraint :MissingQuery ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ extension-element-prefixes="ixsl"
<button type="button" class="btn btn-primary create-action add-constructor" data-for-class="&ldh;XHTML">
<xsl:apply-templates select="key('resources', '&ldh;XHTML', document(ac:document-uri('&ldh;')))" mode="ac:label"/>
</button>
<button type="button" class="btn btn-primary create-action add-constructor" data-for-class="&ldh;View">
<xsl:apply-templates select="key('resources', '&ldh;View', document(ac:document-uri('&ldh;')))" mode="ac:label"/>
</button>
<button type="button" class="btn btn-primary create-action add-constructor" data-for-class="&ldh;Object">
<xsl:apply-templates select="key('resources', '&ldh;Object', document(ac:document-uri('&ldh;')))" mode="ac:label"/>
</button>
Expand All @@ -215,8 +212,8 @@ extension-element-prefixes="ixsl"
<xsl:param name="classes" as="element()*"/>

<!-- select elements explicitly, because Saxon-JS chokes on text nodes here -->
<!-- hide the content resources - cannot suppress them in the resource-level bs2:Block because its being reused ldh:ContentList/bs2:RowContent modes -->
<xsl:apply-templates select="*[not(rdf:type/@rdf:resource = ('&ldh;XHTML', '&ldh;View', '&ldh;Object'))]" mode="#current">
<!-- hide the content resources - cannot suppress them in the resource-level bs2:Block because its being reused ldh:ContentList/bs2:Row modes -->
<xsl:apply-templates select="*[not(rdf:type/@rdf:resource = ('&ldh;XHTML', '&ldh;Object'))]" mode="#current">
<xsl:sort select="ac:label(.)"/>
</xsl:apply-templates>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ exclude-result-prefixes="#all">
<xsl:param name="ldhc:enableWebIDSignUp" as="xs:boolean"/>
<xsl:param name="ldh:renderSystemResources" select="false()" as="xs:boolean"/>
<xsl:param name="google:clientID" as="xs:string?"/>
<xsl:param name="default-classes" select="(xs:anyURI('&lapp;Application'), xs:anyURI('&sd;Service'), xs:anyURI('&nfo;FileDataObject'), xs:anyURI('&sp;Construct'), xs:anyURI('&sp;Describe'), xs:anyURI('&sp;Select'), xs:anyURI('&sp;Ask'), xs:anyURI('&ldh;RDFImport'), xs:anyURI('&ldh;CSVImport'), xs:anyURI('&ldh;GraphChart'), xs:anyURI('&ldh;ResultSetChart'))" as="xs:anyURI*"/>
<xsl:param name="default-classes" select="(xs:anyURI('&lapp;Application'), xs:anyURI('&sd;Service'), xs:anyURI('&nfo;FileDataObject'), xs:anyURI('&sp;Construct'), xs:anyURI('&sp;Describe'), xs:anyURI('&sp;Select'), xs:anyURI('&sp;Ask'), xs:anyURI('&ldh;RDFImport'), xs:anyURI('&ldh;CSVImport'), xs:anyURI('&ldh;GraphChart'), xs:anyURI('&ldh;ResultSetChart'), xs:anyURI('&ldh;View'))" as="xs:anyURI*"/>
<xsl:param name="location-mapping" as="map(xs:anyURI, xs:anyURI)">
<xsl:map>
<xsl:map-entry key="resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $ac:contextUri)" select="resolve-uri('static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/translations.rdf', $ac:contextUri)"/>
Expand Down Expand Up @@ -847,7 +847,7 @@ LIMIT 100

<xsl:for-each select="$content-values">
<xsl:if test="doc-available(ac:document-uri(.))">
<xsl:apply-templates select="key('resources', ., document(ac:document-uri(.)))" mode="bs2:RowContent"/>
<xsl:apply-templates select="key('resources', ., document(ac:document-uri(.)))" mode="bs2:Row"/>
</xsl:if>
</xsl:for-each>
</xsl:when>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ extension-element-prefixes="ixsl"
</xsl:template>

<!-- resource block overrides -->
<xsl:template match="*[@rdf:about][rdf:type/@rdf:resource = ('&ldh;View', '&ldh;Object')]" mode="bs2:Row" priority="1">
<xsl:template match="*[@rdf:about][rdf:type/@rdf:resource = '&ldh;Object']" mode="bs2:Row" priority="1">
<!-- TO-DO: use $ldh:requestUri to resolve URIs server-side -->
<xsl:param name="id" select="if (contains(@rdf:about, ac:absolute-path(ldh:base-uri(.)) || '#')) then substring-after(@rdf:about, ac:absolute-path(ldh:base-uri(.)) || '#') else generate-id()" as="xs:string?"/>
<xsl:param name="class" select="'row-fluid block'" as="xs:string?"/>
Expand Down Expand Up @@ -903,7 +903,7 @@ extension-element-prefixes="ixsl"

<!-- ROW CONTENT HEADER -->

<xsl:template match="*[@rdf:about][rdf:type/@rdf:resource = ('&ldh;View', '&ldh;Object')]" mode="bs2:RowContentHeader" priority="1">
<xsl:template match="*[@rdf:about][rdf:type/@rdf:resource = ('&ldh;XHTML', '&ldh;Object')]" mode="bs2:RowContentHeader" priority="1">
<xsl:variable name="anchor" as="node()*">
<xsl:for-each select="@rdf:about">
<xsl:apply-templates select="key('resources', ., document(ac:document-uri(.)))" mode="xhtml:Anchor">
Expand Down Expand Up @@ -1382,9 +1382,9 @@ extension-element-prefixes="ixsl"

<!-- PROPERTY CONTROL -->

<!-- hide property dropdown for content instances -->
<!-- hide property dropdown for block instances -->

<xsl:template match="*[rdf:type/@rdf:resource = ('&ldh;XHTML', '&ldh;Object', '&ldh;View')]" mode="bs2:PropertyControl" priority="1"/>
<xsl:template match="*[rdf:type/@rdf:resource = ('&ldh;XHTML', '&ldh;Object')]" mode="bs2:PropertyControl" priority="1"/>

<xsl:template match="*[@rdf:about or @rdf:nodeID]" mode="bs2:PropertyControl">
<xsl:param name="class" as="xs:string?"/>
Expand Down

0 comments on commit 2c16b28

Please sign in to comment.