Changeset 4259
- Timestamp:
- 01/13/14 16:01:59 (10 years ago)
- Location:
- vlo/branches/to-wicket-1.6/vlo_web_app/src/main
- Files:
-
- 1 added
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/ShowResultPage.html
r4249 r4259 54 54 <div wicket:id="completeCmdiContainer" id="completeCmdiView"> 55 55 <a wicket:id="toggleCmdiView"><span style="font-weight: bold;" wicket:id="toggleLabel">[toggle cmdi view]</span></a> 56 < span id="completeCmdi" wicket:id="completeCmdi"></span>56 <div id="completeCmdi" wicket:id="completeCmdi"></div> 57 57 </div> 58 58 <br> -
vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/pages/ShowResultPage.java
r4255 r4259 43 43 import org.apache.wicket.markup.ComponentTag; 44 44 import org.apache.wicket.markup.MarkupStream; 45 import org.apache.wicket.markup.head.CssHeaderItem; 46 import org.apache.wicket.markup.head.IHeaderResponse; 45 47 import org.apache.wicket.markup.html.WebMarkupContainer; 46 48 import org.apache.wicket.markup.html.basic.Label; … … 55 57 import org.apache.wicket.request.Url; 56 58 import org.apache.wicket.request.cycle.RequestCycle; 59 import org.apache.wicket.request.resource.PackageResourceReference; 60 import org.apache.wicket.request.resource.ResourceReference; 57 61 import org.apache.wicket.util.encoding.UrlDecoder; 58 62 import org.apache.wicket.util.encoding.UrlEncoder; … … 71 75 public static final String feedbackfromURL = VloConfig.getFeedbackFromUrl(); 72 76 73 private final URL xslFile = getClass().getResource("/cmdi2xhtml.xsl"); 77 private final URL xslFile = getClass().getResource("/eu/clarin/cmdi/vlo/pages/cmdi2xhtml.xsl"); 78 private final ResourceReference XSL_CSS_REFERENCE = new PackageResourceReference(getClass(), "cmdi.css"); 74 79 75 80 @SuppressWarnings("serial") … … 573 578 trans.transform(); 574 579 } catch (Exception e) { 575 LOG.error("Couldn't create CMDI metadata: " + e.getMessage());580 LOG.error("Couldn't create CMDI metadata: ", e); 576 581 strWriter = new StringWriter().append("<b>Could not load complete CMDI metadata</b>"); 577 582 } … … 580 585 completeCmdiLabel.setEscapeModelStrings(false); 581 586 } 587 588 @Override 589 public void renderHead(IHeaderResponse response) { 590 super.renderHead(response); 591 response.render(CssHeaderItem.forReference(XSL_CSS_REFERENCE)); 592 } 582 593 } -
vlo/branches/to-wicket-1.6/vlo_web_app/src/main/resources/eu/clarin/cmdi/vlo/pages/cmdi2xhtml.xsl
r4258 r4259 43 43 name="nchildren" 44 44 select="fn:count(child::element())"/> 45 45 <li> 46 46 47 <code class="node">48 <xsl:value-of49 select="fn:concat(local-name(), ' ')"/>50 <xsl:if51 test="count(@*) > 0">52 <div class="attributes">53 <xsl:for-each54 select="@*">55 <xsl:value-of56 select="name()"/>="<xsl:value-of select="."/>"57 </xsl:for-each>58 </div>59 </xsl:if>60 </code>47 <code class="node"> 48 <xsl:value-of 49 select="fn:concat(local-name(), ' ')"/> 50 <xsl:if 51 test="count(@*) > 0"> 52 <div class="attributes"> 53 <xsl:for-each 54 select="@*"> 55 <xsl:value-of 56 select="name()"/>="<xsl:value-of select="."/>" 57 </xsl:for-each> 58 </div> 59 </xsl:if> 60 </code> 61 61 62 <xsl:choose> 63 <xsl:when 64 test="$nchildren = 0 and not(not(child::node()))"> 65 <!--<br /><br />--> 66 <div class="Component_tree_node_content"> 67 <xsl:choose> 68 <xsl:when 69 test="self::element() castable as xs:string"> 70 <xsl:variable 71 name="leaf_value" 72 select="self::element() cast as xs:string" 73 as="xs:string"/> 74 <xsl:variable 75 name="is_URL" 76 select="starts-with($leaf_value, 'http://') or starts-with($leaf_value, 'https://')" 77 as="xs:boolean"/> 78 <code class="leaf"> 79 <xsl:choose> 80 <xsl:when 81 test="$is_URL"> 82 <a href="{$leaf_value}"> 62 <xsl:choose> 63 <xsl:when 64 test="$nchildren = 0 and not(not(child::node()))"> 65 <!--<br /><br />--> 66 <div class="Component_tree_node_content"> 67 <xsl:choose> 68 <xsl:when 69 test="self::element() castable as xs:string"> 70 <xsl:variable 71 name="leaf_value" 72 select="self::element() cast as xs:string" 73 as="xs:string"/> 74 <xsl:variable 75 name="is_URL" 76 select="starts-with($leaf_value, 'http://') or starts-with($leaf_value, 'https://')" 77 as="xs:boolean"/> 78 <code class="leaf"> 79 <xsl:choose> 80 <xsl:when 81 test="$is_URL"> 82 <a href="{$leaf_value}"> 83 <xsl:value-of 84 select="$leaf_value"/> 85 </a> 86 </xsl:when> 87 <xsl:otherwise> 83 88 <xsl:value-of 84 select="$leaf_value"/> 85 </a> 86 </xsl:when> 87 <xsl:otherwise> 88 <xsl:value-of 89 select="$leaf_value"/> 90 </xsl:otherwise> 91 </xsl:choose> 92 </code> 93 </xsl:when> 94 <xsl:otherwise> 95 <xsl:variable 96 name="leaf_value" 97 select="format-number(self::element(), '#') cast as xs:string" 98 as="xs:string"/> 99 <xsl:variable 100 name="is_URL" 101 select="starts-with($leaf_value, 'http://') or starts-with($leaf_value, 'https://')" 102 as="xs:boolean"/> 103 <code class="leaf"> 104 <xsl:choose> 105 <xsl:when 106 test="$is_URL"> 89 select="$leaf_value"/> 90 </xsl:otherwise> 91 </xsl:choose> 92 </code> 93 </xsl:when> 94 <xsl:otherwise> 95 <xsl:variable 96 name="leaf_value" 97 select="format-number(self::element(), '#') cast as xs:string" 98 as="xs:string"/> 99 <xsl:variable 100 name="is_URL" 101 select="starts-with($leaf_value, 'http://') or starts-with($leaf_value, 'https://')" 102 as="xs:boolean"/> 103 <code class="leaf"> 104 <xsl:choose> 105 <xsl:when 106 test="$is_URL"> 107 107 <a href="{$leaf_value}"><xsl:value-of select="$leaf_value"/></a> 108 </xsl:when>109 <xsl:otherwise>110 <xsl:value-of111 select="$leaf_value"/>112 </xsl:otherwise>113 </xsl:choose>114 </code>115 </xsl:otherwise>116 </xsl:choose>117 </div>118 </xsl:when>119 <xsl:otherwise>120 <ul>121 <xsl:call-template122 name="Component_tree">123 <xsl:with-param124 name="nodeset"125 select="self::element()"/>126 </xsl:call-template>127 </ul>128 </xsl:otherwise>129 </xsl:choose>108 </xsl:when> 109 <xsl:otherwise> 110 <xsl:value-of 111 select="$leaf_value"/> 112 </xsl:otherwise> 113 </xsl:choose> 114 </code> 115 </xsl:otherwise> 116 </xsl:choose> 117 </div> 118 </xsl:when> 119 <xsl:otherwise> 120 <ul> 121 <xsl:call-template 122 name="Component_tree"> 123 <xsl:with-param 124 name="nodeset" 125 select="self::element()"/> 126 </xsl:call-template> 127 </ul> 128 </xsl:otherwise> 129 </xsl:choose> 130 130 131 131 </li> … … 136 136 137 137 <xsl:template match="CMD"> 138 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> 139 <meta charset="utf-8"/> 140 <head> 141 <title>CMDI collection "<xsl:value-of select="./Header/MdCollectionDisplayName" xmlns="cmd"/>"</title> 142 <link rel="stylesheet" type="text/css" href="http://catalog.clarin.eu/ds/vlo/css/main.css"></link> 143 144 <style media="screen" type="text/css"> 145 <![CDATA[ 146 li 147 { 148 margin: 20px; 149 margin-left: -1.2em; 150 } 138 <article style="background-color:#EEEEEE"> 139 <div class="endgame"> 140 <xsl:if test="not(not(Resources/*[normalize-space()]))"> 141 <p> 142 <h1>Resources</h1> 143 <table> 144 <caption>Resources</caption> 145 <thead> 146 <tr> 147 <th class="attribute">Reference to resource</th> 148 <th class="attribute">Resource description</th> 149 <th class="attribute">Resource MIME type</th> 150 <th class="attribute">Resource Proxy ID</th> 151 </tr> 152 </thead> 153 <tbody class="attributesTbody"> 154 <xsl:for-each 155 select="Resources/ResourceProxyList/ResourceProxy"> 156 <xsl:variable 157 name="URI" 158 select="ResourceRef/text()" 159 as="xs:string"/> 160 <tr> 161 <td class="attributeValue"> 162 <xsl:variable 163 name="protocol" 164 select="fn:substring-before($URI, ':')" 165 as="xs:string"/> 166 <xsl:choose> 167 <xsl:when 168 test="$protocol = 'hdl'"> 169 <xsl:variable 170 name="HANDLE_PREFIX" 171 select="'http://hdl.handle.net'" 172 as="xs:string"/> 173 <xsl:variable 174 name="Handle_reference" 175 select="fn:substring-after($URI, ':')" 176 as="xs:string"/> 177 <xsl:variable 178 name="Handle_HTTP_URL" 179 select="fn:concat($HANDLE_PREFIX, '/', $Handle_reference)" 180 as="xs:string"/> 181 <a href="{$Handle_HTTP_URL}"> 182 <xsl:value-of 183 select="$Handle_HTTP_URL"/> 184 </a> 185 </xsl:when> 186 <xsl:otherwise> 187 <a href="{ResourceRef}"> 188 <xsl:value-of 189 select="ResourceRef"/> 190 </a> 191 </xsl:otherwise> 192 </xsl:choose> 193 </td> 194 <td class="attributeValue"> 195 <xsl:value-of select="ResourceType"/> 196 </td> 197 <td class="attributeValue"> 198 <xsl:value-of select="ResourceType/@mimetype"/> 199 </td> 200 <td class="attributeValue"> 201 <xsl:value-of select="./@id"/> 202 </td> 203 </tr> 204 </xsl:for-each> 205 </tbody> 206 </table> 207 </p> 208 </xsl:if> 209 </div> 151 210 152 .node 153 { 154 background-color: rgba(188, 205, 232, 0.8); 155 border: 1px ridge; 156 font-weight: bold; 157 padding: 5px; 158 /*float: left;*/ 159 } 160 161 .leaf 162 { 163 } 164 165 .Component_tree_node_content 166 { 167 background-color: rgba(188, 200, 232, 0.3); 168 border: 1px dotted red; 169 margin-top: 10px; 170 margin-left: 10px; 171 padding: 5px; 172 display: inline-block; 173 /*float: left;*/ 174 /*display: table-cell;*/ 175 } 176 177 .attributes 178 { 179 display: inline-block; 180 font-style: italic; 181 font-weight: normal; 182 /*background-color: rgba(100, 201, 234, 0.4);*/ 183 } 184 185 footer 186 { 187 border: 1px dotted; 188 } 189 190 address 191 { 192 display: inline-block; 193 } 194 195 .searchword { background-color: yellow; } 196 ]]> 197 </style> 198 </head> 199 <body> 200 <article style="background-color:#EEEEEE"> 201 <div class="endgame"> 202 <xsl:if test="not(not(Resources/*[normalize-space()]))"> 203 <p> 204 <h1>Resources</h1> 205 <table> 206 <caption>Resources</caption> 207 <thead> 208 <tr> 209 <th class="attribute">Reference to resource</th> 210 <th class="attribute">Resource description</th> 211 <th class="attribute">Resource MIME type</th> 212 <th class="attribute">Resource Proxy ID</th> 213 </tr> 214 </thead> 215 <tbody class="attributesTbody"> 216 <xsl:for-each 217 select="Resources/ResourceProxyList/ResourceProxy"> 218 <xsl:variable 219 name="URI" 220 select="ResourceRef/text()" 221 as="xs:string"/> 222 <tr> 223 <td class="attributeValue"> 224 <xsl:variable 225 name="protocol" 226 select="fn:substring-before($URI, ':')" 227 as="xs:string"/> 228 <xsl:choose> 229 <xsl:when 230 test="$protocol = 'hdl'"> 231 <xsl:variable 232 name="HANDLE_PREFIX" 233 select="'http://hdl.handle.net'" 234 as="xs:string"/> 235 <xsl:variable 236 name="Handle_reference" 237 select="fn:substring-after($URI, ':')" 238 as="xs:string"/> 239 <xsl:variable 240 name="Handle_HTTP_URL" 241 select="fn:concat($HANDLE_PREFIX, '/', $Handle_reference)" 242 as="xs:string"/> 243 <a href="{$Handle_HTTP_URL}"> 244 <xsl:value-of 245 select="$Handle_HTTP_URL"/> 246 </a> 247 </xsl:when> 248 <xsl:otherwise> 249 <a href="{ResourceRef}"> 250 <xsl:value-of 251 select="ResourceRef"/> 252 </a> 253 </xsl:otherwise> 254 </xsl:choose> 255 </td> 256 <td class="attributeValue"> 257 <xsl:value-of select="ResourceType"/> 258 </td> 259 <td class="attributeValue"> 260 <xsl:value-of select="ResourceType/@mimetype"/> 261 </td> 262 <td class="attributeValue"> 263 <xsl:value-of select="./@id"/> 264 </td> 265 </tr> 266 </xsl:for-each> 267 </tbody> 268 </table> 269 </p> 270 </xsl:if> 271 </div> 272 273 <p> 274 <h1>Metadata content</h1> 275 <xsl:call-template name="Component_tree"/> 276 </p> 277 </article> 278 </body> 279 </html> 211 <p> 212 <h1>Metadata content</h1> 213 <xsl:call-template name="Component_tree"/> 214 </p> 215 </article> 280 216 </xsl:template> 281 217 </xsl:stylesheet>
Note: See TracChangeset
for help on using the changeset viewer.