Changeset 765
- Timestamp:
- 10/10/10 12:28:04 (14 years ago)
- Location:
- MDService2/trunk/MDService2/src/xsl
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/src/xsl/cmd_commons.xsl
r742 r765 42 42 43 43 <xsl:template name="html"> 44 44 45 <html> 45 46 <head> 46 47 <title><xsl:value-of select="$title"/></title> 47 <!-- <link rel="stylesheet" media="all" type="text/css" href="{$style_dir}/vronk_style.css" /> 48 <link rel="stylesheet" media="all" type="text/css" href="{$style_dir}/cmdi.css" /> 48 49 <link rel="stylesheet" href="{$base_dir}/style/jquery/clarindotblue/jquery-ui-1.8.5.custom.css" type="text/css" /> 50 <link href="{$base_dir}/style/jquery/jquery-treeview/jquery.treeview.css" rel="stylesheet" /> 51 <link href="{$base_dir}/style/jquery/treetable/jquery.treeTable.css" rel="stylesheet" ></link> 52 <link href="{$base_dir}/style/cmds-ui.css" type="text/css" rel="stylesheet"></link> 53 54 <link href="{$base_dir}style/jquery/jquery-textboxlist/TextboxList.css" rel="stylesheet" type="text/css"></link> 55 <link href="{$base_dir}style/jquery/jquery-autocomplete/jquery.autocomplete.css" rel="stylesheet" type="text/css"></link> 56 57 <script src="{$base_dir}/scripts/jquery/js/jquery-1.4.2.js" type="text/javascript"></script> 58 <script src="{$base_dir}/scripts/jquery/js/jquery-ui-1.8.5.custom.min.js" type="text/javascript"></script> 59 <script src="{$base_dir}/scripts/jquery/jquery-treeview/jquery.treeview.js" type="text/javascript"></script> 60 <script src="{$base_dir}/scripts/jquery/jquery-treeTable/jquery.treeTable.js" type="text/javascript"></script> 61 <!-- <script src="scripts/jquery/jquery-autocomplete/jquery.autocomplete.js" type="text/javascript"></script> 62 63 <script src="scripts/mdservice_searchclause.js" type="text/javascript"></script> 64 <script src="scripts/mdservice_model.js" type="text/javascript"></script> 65 <script src="scripts/mdservice2_ui.js" type="text/javascript"></script> 49 66 --> 50 <link rel="stylesheet" href="{$base_dir}/style/jquery/smoothness/jquery-ui-1.8.1.custom.css" type="text/css" ></link> 51 <link href="{$base_dir}/style/jquery/jquery-treeview/jquery.treeview.css" rel="stylesheet" ></link> 52 <link href="{$base_dir}/style/jquery/treetable/jquery.treeTable.css" rel="stylesheet" ></link> 53 <link href="{$base_dir}/style/metares.css" type="text/css" rel="stylesheet" ></link> 54 <link href="{$base_dir}/style/cmdi.css" type="text/css" rel="stylesheet" ></link> 55 <link href="{$base_dir}/style/query.css" type="text/css" rel="stylesheet" ></link> 56 <!-- 57 <link href="{$base_dir}/style/jquery/jquery-textboxlist/TextboxList.css" rel="stylesheet" type="text/css" /> 58 <link href="{$base_dir}/style/jquery/jquery-autocomplete/jquery.autocomplete.css" rel="stylesheet" type="text/css" /> 59 --> 60 <!-- 61 <script src="{$base_dir}/scripts/jquery/js/jquery-1.3.2.min.js" type="text/javascript"></script>--> 62 <script src="{$base_dir}/scripts/jquery/js/jquery-1.4.2.js" type="text/javascript"></script> 63 <script src="{$base_dir}/scripts/jquery/js/jquery-ui-1.8.1.custom.min.js" type="text/javascript"></script> 64 65 <!-- 66 <script src="{$base_dir}/scripts/jquery/jquery-textboxlist/GrowingInput.js" type="text/javascript"></script> 67 68 <script src="scripts/jquery/jquery-textboxlist/TextboxList.js" type="text/javascript"></script> 69 70 --> 71 72 <script src="{$base_dir}/scripts/jquery/jquery-treeview/jquery.treeview.js" type="text/javascript"></script> 73 74 <script src="{$base_dir}/scripts/jquery/jquery-treeTable/jquery.treeTable.js" type="text/javascript"></script> 75 <!-- <script src="scripts/jquery/jquery-autocomplete/jquery.autocomplete.js" type="text/javascript"></script> 76 77 <script src="scripts/mdservice_searchclause.js" type="text/javascript"></script> 78 <script src="scripts/mdservice_model.js" type="text/javascript"></script> 79 <script src="scripts/mdservice2_ui.js" type="text/javascript"></script> 80 --> 67 81 68 <xsl:call-template name="callback-header"/> 82 69 </head> … … 141 128 <xsl:template match="componentDescription[id] | profileDescription[id]" mode="include"> 142 129 143 <xsl:variable name="resolved_uri" select="concat($root_uri, '/', id)" /> 130 <!-- <xsl:variable name="resolved_uri" select="concat($root_uri, '/', id)" />--> 131 <xsl:variable name="resolved_uri" select="concat($cmdprofiles_uri , '/', my:extractID(id))" /> 132 144 133 145 134 <xsl:message>resolved_uri:<xsl:value-of select="$resolved_uri" /></xsl:message> … … 160 149 161 150 <xsl:for-each select="//CMD_Element" > 162 <xsl:variable name="co mp_path" select="my:comppath(.)" >151 <xsl:variable name="context" select="my:context(.)" > 163 152 <!-- <xsl:for-each select="ancestor::CMD_Component" > 164 153 <xsl:value-of select="@name" />.</xsl:for-each>--> 165 154 </xsl:variable> 166 155 <Term elem="{@name}" datcat="{@ConceptLink}" profile="{ancestor::profileDescription[1]/name}" 167 parent="{ancestor::CMD_Component[1]/@name}" co mppath="{$comp_path}" >156 parent="{ancestor::CMD_Component[1]/@name}" context="{$context}" > 168 157 <xsl:copy-of select="." /> 169 158 </Term> … … 171 160 172 161 </xsl:variable> 162 163 164 <xsl:template match="Term" mode="matrix" > 165 166 <xsl:for-each select=".//Term" > 167 <xsl:variable name="context" select="my:context(.)" > 168 <!-- <xsl:for-each select="ancestor::CMD_Component" > 169 <xsl:value-of select="@name" />.</xsl:for-each>--> 170 </xsl:variable> 171 <Term elem="{@name}" datcat="{my:term2datcat(@name)}" profile="{ancestor::profileDescription[1]/name}" 172 parent="{ancestor::Term[1]/@name}" context="{$context}" > 173 <xsl:copy-of select="." /> 174 </Term> 175 </xsl:for-each> 176 177 </xsl:template> 178 179 180 <xsl:function name="my:profilematrix" > 181 <xsl:param name="term"/> 182 183 <xsl:variable name="profile" select="my:profile($term,true())" /> 184 <Terms name="{$profile/name}" id="{$profile/id}"> 185 <xsl:for-each select="$profile//CMD_Component|$profile//CMD_Element" > 186 <xsl:variable name="context" select="my:context(.)" /> 187 188 <xsl:variable name="id" > 189 <xsl:choose> 190 <xsl:when test="@ComponentId"> 191 <xsl:value-of select="@ComponentId" /> 192 </xsl:when> 193 <xsl:otherwise> 194 <xsl:value-of select="ancestor::CMD_Component[@ComponentId][1]/@ComponentId" /><xsl:text>#</xsl:text> 195 <xsl:for-each select="ancestor::CMD_Component[not(descendant-or-self::CMD_Component[@ComponentId])]" > 196 <xsl:value-of select="@name" />.</xsl:for-each><xsl:value-of select="@name" /> 197 </xsl:otherwise> 198 </xsl:choose> 199 </xsl:variable> 200 <Term name="{@name}" datcat="{@ConceptLink}" id="{$id}" 201 parent="{ancestor::CMD_Component[1]/@name}" context="{$context}" 202 > 203 <!-- <xsl:copy-of select="." /> --> 204 </Term> 205 </xsl:for-each> 206 </Terms> 207 208 </xsl:function> 209 210 <xsl:function name="my:profile" > 211 <xsl:param name="term"/> 212 <xsl:param name="resolve" /> <!-- true|false--> 213 214 <xsl:message>cmdprofiles_uri: <xsl:value-of select="$cmdprofiles_uri" /></xsl:message> 215 216 <xsl:variable name="profile" select="doc($cmdprofiles_uri)//profileDescription[name=$term]" /> 217 218 <xsl:choose> 219 <xsl:when test="$resolve=true()"> 220 <xsl:apply-templates select="$profile" mode="include" /> 221 </xsl:when> 222 <xsl:otherwise> 223 <xsl:copy-of select="$profile" /> 224 </xsl:otherwise> 225 </xsl:choose> 226 227 228 </xsl:function> 229 230 <xsl:function name="my:term2datcat"> 231 <xsl:param name="term"/> 232 <xsl:value-of select="$term_matrix/*[@elem=$term]/@datcat" /> 233 </xsl:function> 173 234 174 235 … … 202 263 </xsl:when> 203 264 <xsl:when test="contains($uri,$components_id_prefix)"> 204 <!-- <xsl:value-of select="substring-after($uri, 'clarin.eu:cr1:')" /> -->265 <!-- <xsl:value-of select="substring-after($uri,$components_id_prefix)" /> --> 205 266 <xsl:value-of select="substring-after($uri, $components_id_prefix)" /> 206 267 </xsl:when> … … 228 289 </xsl:function> 229 290 230 <xsl:function name="my:co mppath" >291 <xsl:function name="my:context" > 231 292 <xsl:param name="child" /> 232 <xsl:for-each select="$child/ancestor::CMD_Component" > 233 <xsl:value-of select="@name" />.</xsl:for-each><xsl:value-of select="$child/@name" /> 293 <xsl:variable name="collect" > 294 <xsl:for-each select="$child/ancestor::CMD_Component|$child/ancestor::Term" > 295 <xsl:value-of select="@name" />.</xsl:for-each><xsl:value-of select="$child/@name" /> 296 </xsl:variable> 297 <xsl:value-of select="$collect" /> 234 298 </xsl:function> 235 299 -
MDService2/trunk/MDService2/src/xsl/complist2terms.xsl
r692 r765 30 30 31 31 32 <xsl:variable name="term_matrix" >33 34 <xsl:for-each select="//CMD_Element" >35 <xsl:variable name="comp_path" select="my:comppath(.)" >36 <!-- <xsl:for-each select="ancestor::CMD_Component" >37 <xsl:value-of select="@name" />.</xsl:for-each>-->38 </xsl:variable>39 <Term elem="{@name}" datcat="{@ConceptLink}" profile="{ancestor::profileDescription[1]/name}"40 parent="{ancestor::CMD_Component[1]/@name}" comppath="{$comp_path}" >41 <xsl:copy-of select="." />42 </Term>43 </xsl:for-each>44 45 </xsl:variable>46 47 32 48 33 <xsl:template name="continue-root"> -
MDService2/trunk/MDService2/src/xsl/mdinst2view.xsl
r699 r765 89 89 </xsl:choose> 90 90 </xsl:variable> 91 <div class=" elem {$has_text}" ><span class="elem_name"><xsl:value-of select="name()" />:</span>92 <span class=" elem_value"><xsl:value-of select="text()" /></span>91 <div class="cmds-xmlelem value-{$has_text}" ><span class="label"><xsl:value-of select="name()" />:</span> 92 <span class="value"><xsl:value-of select="text()" /></span> 93 93 <xsl:apply-templates select="*" /> 94 94 <xsl:if test="@*"> … … 102 102 103 103 <xsl:template match="@*" > 104 <span class=" attr_name"><xsl:value-of select="name()" />: </span><span class="value"><xsl:value-of select="." /></span>;104 <span class="label"><xsl:value-of select="name()" />: </span><span class="value"><xsl:value-of select="." /></span>; 105 105 </xsl:template> 106 106 -
MDService2/trunk/MDService2/src/xsl/model2view.xsl
r699 r765 4 4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 5 5 xmlns:xs="http://www.w3.org/2001/XMLSchema" 6 xmlns:m="http://www.vronk.net/schemas"6 xmlns:my="myFunctions" 7 7 > 8 8 <!-- … … 17 17 --> 18 18 <xsl:import href="cmd_commons.xsl"/> 19 <xsl:import href="model2matrix.xsl"/> 19 20 20 21 … … 32 33 <xsl:param name="detail_uri_prefix" select="'?q='"/> 33 34 --> 34 < !-- <xsl:output method="html" /> -->35 <xsl:output method="html" /> 35 36 36 37 … … 38 39 39 40 <xsl:template name="continue-root"> 41 42 <xsl:variable name="termmatrix"> 43 <xsl:apply-templates mode="matrix" /> 44 </xsl:variable> 45 46 <xsl:for-each select="$termmatrix" > 47 <xsl:call-template name="continue" /> 48 </xsl:for-each> 49 50 </xsl:template> 51 52 <xsl:template name="continue"> 40 53 <div> 41 54 <xsl:choose> 42 55 <xsl:when test="$format='model2htmltable'" > 43 56 <xsl:call-template name="header"/> 44 <xsl:call-template name="table"/> 57 <xsl:call-template name="table"/> 58 45 59 </xsl:when> 46 60 <xsl:when test="$format='model2htmlpage'" > 47 61 <xsl:call-template name="header"/> 48 62 <div id="model"> 49 <table id="modeltree" > 63 <xsl:call-template name="terms-tree" /> 64 <xsl:call-template name="list-datcats" /> 65 <!-- <table id="modeltree" > 50 66 <thead> 51 <tr><th class="treecol">Name</th><th>Count Elems</th><th>Count Text</th><th>Count Distinct Text</th><th>Path</th>< /tr>67 <tr><th class="treecol">Name</th><th>Count Elems</th><th>Count Text</th><th>Count Distinct Text</th><th>Path</th><th>comp/datcat</th></tr> 52 68 </thead> 53 69 <xsl:apply-templates select="*/Term" mode="detail"> 54 70 <xsl:sort order="ascending" select="@n" /> 55 71 </xsl:apply-templates> 56 </table> 57 </div> 72 </table> --> 73 </div> 74 58 75 </xsl:when> 59 76 <xsl:when test="$format='model2htmllist'" > … … 62 79 <xsl:when test="$format='model2htmlselect'" > 63 80 <select id="terms-select"> 64 <xsl:apply-templates select=" /*/*/Term" mode="select"/>81 <xsl:apply-templates select="./*/*/Term" mode="select"/> 65 82 </select> 66 83 </xsl:when> … … 119 136 120 137 <xsl:template match="Term" mode="list" > 121 < xsl:variable name="translated_path" select="translate(replace(@path,'//',''),'/','.')" />122 <li>< span class="term_detail_caller"><a href="{concat($detail_model_prefix,$translated_path)}" >138 <!-- <xsl:variable name="translated_path" select="translate(replace(@path,'//',''),'/','.')" /> --> 139 <li><div class="cmds-elem-plus"><span class="detail-caller"><a href="{concat($detail_model_prefix,@context)}" > 123 140 <xsl:value-of select="@name"/></a></span> 124 141 <span class="note">|<xsl:value-of select="@count"/>/<xsl:value-of select="@count_text"/>/<xsl:value-of select="@count_distinct_text"/>|</span> 125 <span class="data comppath"><xsl:value-of select=" $translated_path" /></span>142 <span class="data comppath"><xsl:value-of select="@path" /></span> 126 143 <span class="cmd cmd_filter"><xsl:text> </xsl:text></span> 127 144 <span class="cmd cmd_detail" ><xsl:text> </xsl:text></span> 128 145 <span class="cmd cmd_columns" ><xsl:text> </xsl:text></span> 129 146 <div class="detail"> 147 <xsl:for-each select="@*" > 148 <div class="cmds-elem-prop"><span class="label"><xsl:value-of select="name()" />: </span> 149 <span class="value"><xsl:value-of select="." /></span></div> 150 </xsl:for-each> 151 </div> 152 </div> 130 153 <ul><xsl:apply-templates select="*" mode="list" /></ul> 131 154 </li> 132 155 </xsl:template> 156 157 158 <xsl:template name="terms-tree" > 159 <table id="modeltree" > 160 <thead> 161 <tr><th class="treecol">Name</th><th>Count Elems</th><th>Count Text</th><th>Count Distinct Text</th><th>Path</th><th>comp/datcat</th></tr> 162 </thead> 163 <xsl:apply-templates select="*/Term" mode="detail"> 164 <xsl:sort order="ascending" select="@n" /> 165 </xsl:apply-templates> 166 </table> 167 </xsl:template> 133 168 134 169 <xsl:template match="Term" mode="detail" > … … 152 187 <td class="number"><xsl:value-of select="@count_text" /></td> 153 188 <td class="number"><xsl:value-of select="@count_distinct_text" /></td> 154 <td><xsl:value-of select="@path" /></td> 189 <td><xsl:value-of select="@path" />,<xsl:value-of select="@context" /></td> 190 <td><xsl:value-of select="@corresponding_component" />,<xsl:value-of select="@datcat" /></td> 155 191 </tr> 156 192 <xsl:if test="Term and ($lv<$max_depth or $max_depth=0)"> … … 186 222 <option value="{@name}" ><xsl:value-of select="for $i in (2 to $lv) return ' '" /><xsl:value-of select="@name" /> |<xsl:value-of select="@count" />|</option> 187 223 <xsl:apply-templates select="Term" mode="select" /> 224 </xsl:template> 225 226 <!-- 227 <xsl:template name="list-datcats" > 228 <table id="datcats" > 229 <thead> 230 <tr><th class="treecol">Name</th><th>Count Elems</th><th>Count Text</th><th>Count Distinct Text</th><th>Path</th><th>comp/datcat</th></tr> 231 </thead> 232 <xsl:apply-templates select="*/Term" mode="detail"> 233 <xsl:sort order="ascending" select="@n" /> 234 </xsl:apply-templates> 235 </table> 236 </xsl:template> 237 --> 238 <xsl:template name="list-datcats"> 239 <xsl:param name="matrix" select="."></xsl:param> 240 <table> 241 <caption>DatCats |<xsl:value-of select="count(distinct-values($matrix//Term/@datcat))" />| <span class="note">* Click on numbers to see detail </span></caption> 242 <thead><tr><th rowspan="2">id</th><th rowspan="2">name</th> 243 <th colspan="3" >count </th><th rowspan="2">elems</th></tr> 244 <tr><th>profile*</th><th >all*</th><th>elems</th> </tr> </thead> 245 <tbody> 246 <xsl:for-each-group select="$matrix//Term" group-by="@datcat"> 247 <xsl:sort select="lower-case(@datcat)" order="ascending"/> 248 <tr><td valign="top"><xsl:value-of select="my:shortURL(@datcat)"/></td> 249 <td valign="top"><xsl:value-of select="my:rewriteURL(@datcat)"/></td> 250 <td valign="top" align="right"> 251 <span class="detail-caller" ><xsl:value-of select="count(distinct-values(current-group()/@name))"/></span> 252 <div class="detail" > 253 <div class="box_heading"><xsl:value-of select="my:rewriteURL(@datcat)"/></div> 254 <ul> 255 <xsl:for-each select="distinct-values(current-group()/@name)" > 256 <li><xsl:value-of select="." /></li> 257 </xsl:for-each> 258 </ul> 259 </div> 260 </td> 261 <td valign="top" align="right"> 262 <span class="term_detail_caller" ><xsl:value-of select="count(current-group())"/></span> 263 <div class="term_detail" > 264 <div class="box_heading"><xsl:value-of select="my:rewriteURL(@datcat)"/></div> 265 <ul> 266 <xsl:for-each-group select="current-group()" group-by="@name" > 267 <li><xsl:value-of select="@name" /> 268 <ul> 269 <xsl:for-each select="current-group()/@context" > 270 <li><xsl:value-of select="." /></li> 271 </xsl:for-each> 272 </ul> 273 </li> 274 </xsl:for-each-group> 275 </ul> 276 </div> 277 </td> 278 <td valign="top" align="right"><xsl:value-of select="count(distinct-values(current-group()/@elem))"/></td> 279 280 <td width="40%"> 281 <xsl:for-each select="distinct-values(current-group()/@elem)"> 282 <xsl:sort select="." /> 283 <xsl:value-of select="."/>, 284 </xsl:for-each> 285 </td> 286 </tr> 287 </xsl:for-each-group> 288 </tbody> 289 </table> 188 290 </xsl:template> 291 292 293 294 189 295 190 296 <xsl:template name="callback-header" > … … 196 302 table thead {background: #ccccff; font-size:0.9em; } 197 303 table thead tr th { border:1px solid #9999aa; font-weight:normal; text-align:left; padding: 1px 4px;} 198 } 304 199 305 </style> 200 306 <script type="text/javascript" > -
MDService2/trunk/MDService2/src/xsl/params.xsl
r742 r765 4 4 5 5 6 <!-- <xsl:param name="title" select="'Default Title'" /> --> 6 7 <xsl:param name="format" select="'htmlpag'"/> <!-- table|list --> 7 8 <xsl:param name="display_values_limit" select="10" /> … … 19 20 the absolute-URL is not nice, however I wasn't able to tell XSL how to resolve a relative url 20 21 --> 22 <xsl:param name="cmdprofiles_uri" select="'http://localhost:8080/MDService2/compprofile/xml/'" /> 21 23 <xsl:param name="components_uri" select="'http://localhost:8080/MDService2/comp/xml/'" /> 22 24 <xsl:param name="components_id_prefix" select="'clarin.eu:cr1:'" />
Note: See TracChangeset
for help on using the changeset viewer.