Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add HTML rendering for fcr:nodetypes
- Loading branch information
Showing
6 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
fcrepo-http-api/src/main/resources/views/jcr-nodetypes.vsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#* @vtlvariable name="rdf" type="com.hp.hpl.jena.sparql.core.DatasetGraph" *# | ||
#* @vtlvariable name="subjects" type="com.hp.hpl.jena.rdf.model.ResIterator" *# | ||
#* @vtlvariable name="nodeany" type="com.hp.hpl.jena.graph.Node" *# | ||
#* @vtlvariable name="topic" type="com.hp.hpl.jena.graph.Node" *# | ||
#* @vtlvariable name="model" type="com.hp.hpl.jena.rdf.model.Model" *# | ||
<!DOCTYPE html> | ||
#parse("views/common.vsl") | ||
<html> | ||
<head> | ||
<title>registered types</title> | ||
#parse("views/common-head.vsl") | ||
<script type="text/javascript"> | ||
$(function() { | ||
|
||
var uriToId = {}; | ||
|
||
$('h3').each(function() { | ||
if ( !this.id && this.innerText ) { | ||
this.id = this.innerText.toLowerCase().replace(/[^a-z0-9\-_]+/g, "_"); | ||
} | ||
|
||
uriToId[this.innerText] = this.id; | ||
}); | ||
|
||
$('dd a').each(function() { | ||
if (uriToId[this.href]) { | ||
this.href = "#" + uriToId[this.href]; | ||
} | ||
}); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<div id="main" class="container" resource="$uriInfo.baseUriBuilder.build()fcr:nodetypes"> | ||
#parse("views/common-header.vsl") | ||
|
||
<div class="row"> | ||
<div class="col-md-9"> | ||
<h1>Node Types</h1> | ||
|
||
#foreach($subject in $model.listSubjectsWithProperty($helpers.rdfType(), $helpers.rdfsClass())) | ||
<div class="panel panel-default"> | ||
|
||
<div class="panel-heading"> | ||
<h3 class="panel-title">$subject.getURI()</h3> | ||
</div> | ||
|
||
|
||
<div class="panel-body"> | ||
#triples($subject.asNode()) | ||
|
||
|
||
<h4>Properties</h4> | ||
#foreach($propertySubject in $model.listSubjectsWithProperty($helpers.rdfsDomain(), $subject)) | ||
<div resource="$propertySubject.getURI()"> | ||
<h5>$propertySubject.getURI()</h5> | ||
<div> | ||
#triples($propertySubject.asNode()) | ||
</div> | ||
</div> | ||
#end | ||
</div> | ||
</div> | ||
#end | ||
</div> | ||
|
||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters