Bob DuCharme

added a mprgswp:Table class to SWP_mprg.ui.ttl

1 +<ui:call ui:template="{= ?template }" arg:report="{= ?report }">
2 + <ui:if ui:condition="{= spr:rowCount(?rs) &gt; 0 }">
3 + <div>
4 + <hr />
5 + <ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/ddr-tables&gt;">
6 + <h2>{= ui:label(?template) }</h2>
7 + </ui:setContext>
8 + <table class="ddrTable" letrs:hrs="{#
9 + SELECT ?header ?left
10 + WHERE {
11 + GRAPH &lt;http://www.reportinghub.no/ep/spin/ddr-tables&gt; {
12 + ?template rhspin:tableHeaders ?list .
13 + ?list &lt;http://jena.hpl.hp.com/ARQ/list#member&gt; ?str .
14 + BIND (fn:starts-with(?str, '*') AS ?left) .
15 + BIND (IF(?left, fn:substring(?str, 2), ?str) AS ?header) .
16 + }
17 + }
18 + }">
19 + <tr class="ddrTR">
20 + <ui:forEach ui:resultSet="{= ?hrs }">
21 + <th class="ddrTH" style="text-align: {= IF(?left, 'left', 'center') }"
22 + ><ui:parse ui:str="{= html:encodeBRs(spif:replaceAll(?header, ' ', '&nbsp;')) }" /></th>
23 + </ui:forEach>
24 + </tr>
25 + <ui:forEach ui:resultSet="{# SELECT ?row ?rowIndex WHERE { ?rs spr:rowIndices ?rowIndex } }">
26 + <tr class="ddrTR">
27 + <ui:forEach ui:resultSet="{# SELECT ?cell ?colIndex WHERE { (?rs ?rowIndex) spr:rowCells (?cell ?colIndex) } }">
28 + <!--td class="ddrTD" style="text-align: {= IF(spr:cell(?hrs, ?colIndex, 1), 'left', 'center') }"-->
29 + <td class="ddrTD">{= ?cell }</td>
30 + </ui:forEach>
31 + </tr>
32 + </ui:forEach>
33 + </table>
34 + <br />
35 + </div>
36 + </ui:if>
37 +</ui:call>
...\ No newline at end of file ...\ No newline at end of file
...@@ -51,7 +51,7 @@ arg:template ...@@ -51,7 +51,7 @@ arg:template
51 51
52 <http://www.reportinghub.no/swp/mprg> 52 <http://www.reportinghub.no/swp/mprg>
53 rdf:type owl:Ontology ; 53 rdf:type owl:Ontology ;
54 - owl:imports <http://www.reportinghub.no/ep/spin/mpr-tables> , <http://www.reportinghub.no/spin/rh> , <http://www.reportinghub.no/ep/spin/ddr-tables> , <http://www.reportinghub.no/ep/schema/1.0/production-report> , <http://uispin.org/tui> ; 54 + owl:imports <http://uispin.org/tui> , <http://www.reportinghub.no/ep/schema/1.0/production-report> , <http://www.reportinghub.no/ep/spin/ddr-tables> , <http://www.reportinghub.no/spin/rh> , <http://www.reportinghub.no/ep/spin/mpr-tables> ;
55 owl:versionInfo "0.1.0"^^xsd:string . 55 owl:versionInfo "0.1.0"^^xsd:string .
56 56
57 mprgswp:MPRGView 57 mprgswp:MPRGView
...@@ -65,6 +65,12 @@ mprgswp:MPRGView ...@@ -65,6 +65,12 @@ mprgswp:MPRGView
65 spl:valueType <http://www.reportinghub.no/ep/schema/production-report#ProductionReport> 65 spl:valueType <http://www.reportinghub.no/ep/schema/production-report#ProductionReport>
66 ] ; 66 ] ;
67 ui:headIncludes 67 ui:headIncludes
68 + [ rdf:type html:Link ;
69 + html:href "http://spinrdf.org/rhlib/ddr.css"^^xsd:string ;
70 + html:rel "stylesheet"^^xsd:string ;
71 + html:type "text/css"^^xsd:string
72 + ] ;
73 + ui:headIncludes
68 [ rdf:type html:Title ; 74 [ rdf:type html:Title ;
69 ui:child 75 ui:child
70 [ rdf:type ui:TextNode ; 76 [ rdf:type ui:TextNode ;
...@@ -72,10 +78,24 @@ mprgswp:MPRGView ...@@ -72,10 +78,24 @@ mprgswp:MPRGView
72 ui:text "Monthly Production Report (government)"^^xsd:string 78 ui:text "Monthly Production Report (government)"^^xsd:string
73 ] 79 ]
74 ] ; 80 ] ;
75 - ui:headIncludes
76 - [ rdf:type html:Link ;
77 - html:href "http://spinrdf.org/rhlib/ddr.css"^^xsd:string ;
78 - html:rel "stylesheet"^^xsd:string ;
79 - html:type "text/css"^^xsd:string
80 - ] ;
81 ui:prototype <http://www.reportinghub.no/swp/MPRG.uispin.html> . 81 ui:prototype <http://www.reportinghub.no/swp/MPRG.uispin.html> .
82 +
83 +mprgswp:Table
84 + rdf:type ui:NodeClass ;
85 + rdfs:comment "An HTML table displaying the results of a given SPIN template for a given MPRG. The template should also provide rhspin:tableHeaders."^^xsd:string ;
86 + rdfs:label "Table"^^xsd:string ;
87 + rdfs:subClassOf ui:Element ;
88 + spin:constraint
89 + [ rdf:type spl:Argument ;
90 + rdfs:comment "The SPIN Template to execute."^^xsd:string ;
91 + spl:predicate arg:template ;
92 + spl:valueType spin:Template
93 + ] ;
94 + spin:constraint
95 + [ rdf:type spl:Argument ;
96 + rdfs:comment "The report that serves as root of the template."^^xsd:string ;
97 + spl:optional "true"^^xsd:boolean ;
98 + spl:predicate arg:report ;
99 + spl:valueType <http://www.reportinghub.no/ep/schema/production-report#MonthlyProductionReport>
100 + ] ;
101 + ui:prototype <http://www.reportinghub.no/swp/MPRGTable.uispin.html> .
......