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
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ body.embed { padding-top: 0; }
.navbar-form .btn-search { background-image: url('../icons/ic_search_white_24px.svg'); background-position: center center; background-repeat: no-repeat; width: 34px; height: 34px; }
.action-bar { background-color: #dfdfdf; }
.action-bar form { margin-bottom: 0; }
.action-bar .span7 .row-fluid > * { margin-top: 10px; }
.action-bar .add-constructor, .dropdown-menu .add-constructor { background-color: inherit; display: block; text-align: left; width: 100%; }
.action-bar .add-constructor:hover { color: #ffffff; background-color: #007af5; }
.action-bar .breadcrumb { background-color: inherit; margin-top: 10px; margin-bottom: 0; padding-left: 0; padding-top: 5px; }
.action-bar .breadcrumb { background-color: inherit; margin-bottom: 0; padding-left: 0; padding-top: 5px; }
.action-bar .breadcrumb .container-logo { background-image: url('../icons/folder.svg'); background-position: left center; background-repeat: no-repeat; padding-left: 28px; }
.action-bar .breadcrumb .item-logo { background-image: url('../icons/file.svg'); background-position: left center; background-repeat: no-repeat; padding-left: 28px; }
.action-bar .breadcrumb .btn-group { margin-top: -4px; }
.action-bar #breadcrumb-nav > .label-info { margin-top: 10px; padding: 8px 15px; margin-right: 8px; font-size: inherit; background-color: #9954bb; }
.action-bar #created-modified-date p { text-align: right; margin-top: 10px; padding-top: 5px; }
.action-bar #breadcrumb-nav > .label-info { padding: 8px 15px; margin-right: 8px; font-size: inherit; background-color: #9954bb; }
.action-bar #doc-controls { text-align: right; padding-top: 5px; }
.action-bar #doc-controls .btn-edit { margin-top: -5px; margin-left: 10px; }
.action-bar p.alert { margin-bottom: 0; }
.nav-header.btn { color: inherit; }
ul.dropdown-menu { max-height: 26em; overflow-x: hidden; overflow-y: auto; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ exclude-result-prefixes="#all"

<!-- TEMPLATES -->

<!-- render block -->
<!-- render row -->

<!-- match resources that are not LDH system resources -->
<xsl:template match="*[@typeof[not(. = ('&ldh;Object', '&ldh;View', '&ldh;GraphChart', '&ldh;ResultSetChart'))]]" mode="ldh:RenderRow" priority="1">
Expand Down Expand Up @@ -181,7 +181,7 @@ exclude-result-prefixes="#all"

<xsl:template match="div[following-sibling::div[@typeof = ('&ldh;XHTML', '&ldh;Object')]]//button[contains-token(@class, 'btn-edit')][not(contains-token(@class, 'disabled'))]" mode="ixsl:onclick" priority="1">
<xsl:param name="block" select="ancestor::div[contains-token(@class, 'block')][1]" as="element()"/>
<!-- for content types, button.btn-edit is placed in its own div.row-fluid, therefore the next row is the actual container -->
<!-- for block types, button.btn-edit is placed in its own div.row-fluid, therefore the next row is the actual container -->
<xsl:param name="container" select="$block/descendant::div[@typeof][1]" as="element()"/> <!-- other resources can be nested within object -->

<xsl:next-match>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ exclude-result-prefixes="#all"
<xsl:variable name="textarea" select="ancestor::form/descendant::textarea[@name = 'query']" as="element()"/>
<xsl:variable name="yasqe" select="ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.yasqe'), $textarea/ixsl:get(., 'id'))"/>
<xsl:variable name="query-string" select="ixsl:call($yasqe, 'getValue', [])" as="xs:string?"/> <!-- get query string from YASQE -->
<xsl:variable name="method" select="'PATCH'" as="xs:string"/>
<xsl:variable name="action" select="ac:absolute-path(ldh:base-uri(.))" as="xs:anyURI"/>
<xsl:variable name="accept" select="'application/rdf+xml'" as="xs:string"/>
<xsl:variable name="etag" select="ixsl:get(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || ac:absolute-path(ldh:base-uri(.)) || '`'), 'etag')" as="xs:string"/>
Expand All @@ -377,7 +378,7 @@ exclude-result-prefixes="#all"
</xsl:apply-templates>
</xsl:variable>
<xsl:variable name="triples" select="ldh:descriptions-to-triples($query)" as="element()*"/>
<xsl:variable name="update-string" select="ldh:triples-to-sparql-update($about, $triples)" as="xs:string"/>
<xsl:variable name="update-string" select="ldh:insertdelete-update(ldh:triples-to-bgp(ldh:uri-po-pattern($about)), ldh:triples-to-bgp($triples), ldh:triples-to-bgp(ldh:uri-po-pattern($about)))" as="xs:string"/>
<xsl:variable name="resources" as="document-node()">
<xsl:document>
<rdf:RDF>
Expand All @@ -386,19 +387,21 @@ exclude-result-prefixes="#all"
</xsl:document>
</xsl:variable>
<xsl:variable name="request-uri" select="ldh:href($ldt:base, ac:absolute-path(ldh:base-uri(.)), map{}, $action)" as="xs:anyURI"/>

<xsl:variable name="request" as="item()*">
<!-- If-Match header checks preconditions, i.e. that the graph has not been modified in the meanwhile -->
<ixsl:schedule-action http-request="map{ 'method': 'PATCH', 'href': $request-uri, 'media-type': 'application/sparql-update', 'body': $update-string, 'headers': map{ 'If-Match': $etag, 'Accept': 'application/rdf+xml', 'Cache-Control': 'no-cache' } }">
<xsl:call-template name="ldh:ResourceUpdated">
<xsl:with-param name="doc-uri" select="ac:absolute-path(ldh:base-uri(.))"/>
<xsl:with-param name="block" select="$block"/>
<!-- <xsl:with-param name="container" select="$container"/>-->
<xsl:with-param name="resources" select="$resources"/>
</xsl:call-template>
</ixsl:schedule-action>
</xsl:variable>
<xsl:sequence select="$request[current-date() lt xs:date('2000-01-01')]"/>
<!-- If-Match header checks preconditions, i.e. that the graph has not been modified in the meanwhile -->
<xsl:variable name="request" select="map{ 'method': $method, 'href': $request-uri, 'media-type': 'application/sparql-update', 'body': $update-string, 'headers': map{ 'If-Match': $etag, 'Accept': 'application/rdf+xml', 'Cache-Control': 'no-cache' } }" as="map(*)"/>
<xsl:variable name="context" as="map(*)" select="
map{
'request': $request,
'doc-uri': ac:absolute-path(ldh:base-uri(.)),
'block': $block,
'resources': $resources
}"/>
<ixsl:promise select="
ixsl:http-request($context('request')) (: Step 1: send initial request :)
=> ixsl:then(ldh:rethread-response($context, ?)) (: Step 2: attach response to context :)
=> ixsl:then(ldh:handle-response#1) (: Step 3: handle 429s, etc. :)
=> ixsl:then(ldh:row-form-patch-response#1)
"/>
</xsl:template>

<!-- open query onclick -->
Expand Down
Loading