Changeset 789
- Timestamp:
- 10/14/10 21:39:48 (14 years ago)
- Location:
- MDService2/trunk/MDService2/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/CompRegistryProxyAction.java
r706 r789 92 92 Admin.notifyUser("CCCRPA." + getFullFormat()); 93 93 MDTransformer.getMDTransformer().setSrcFile(getTargetRequest()); 94 _sourceStream = MDTransformer.getMDTransformer().transformXML(__sourceStream, getFullFormat(),null,null,null );94 _sourceStream = MDTransformer.getMDTransformer().transformXML(__sourceStream, getFullFormat(),null,null,null,null); 95 95 Admin.notifyUser("CRPA.- elements"); 96 96 setActionkey("elements"); … … 159 159 targetURL =new URL( getBaseURL(), getActionkey() + "/clarin.eu:cr1:" + compid); 160 160 } 161 Admin.notifyUser("CompReg.targetURL:" + targetURL);161 // Admin.notifyUser("CompReg.targetURL:" + targetURL); 162 162 // URLConnection urlConnection = targetURL.openConnection(); 163 163 // urlConnection.setRequestProperty("Accept", "application/xml"); -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/DCRProxyAction.java
r776 r789 67 67 68 68 Termset res = (Termset) getDCRs().get(dcr_id); 69 if (res==null) 70 Admin.notifyUser("getDCR(): no termset found for:" + dcr_id); 71 else 72 Admin.notifyUser("getDCR():" + res.getAttr("id") + ":" + res.getAttr("url") ); 69 if (res==null) Admin.notifyUser("getDCR(): no termset found for:" + dcr_id); 70 //else 71 //Admin.notifyUser("getDCR():" + res.getAttr("id") + ":" + res.getAttr("url") ); 73 72 74 73 return res; … … 126 125 //if (getActionkey().equals(DATCATS)) { 127 126 if ((getQ()!=null && !getQ().equals(""))) { 127 //targetURL =new URL(getBaseURI() + "?dcif-mode=all&workingLanguage=" + getLang()) ; 128 128 targetURL =new URL(getBaseURI() + "?dcif-mode=all&workingLanguage=" + getLang()) ; 129 129 } … … 137 137 } 138 138 */ 139 Admin.notifyUser("DCRProxy.targetURL:" + targetURL);139 // Admin.notifyUser("DCRProxy.targetURL:" + targetURL); 140 140 141 141 return targetURL; -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java
r772 r789 247 247 public void prepare() throws Exception { 248 248 249 String req_key = getRequestKey(); 250 Admin.notifyUser("request_key: " + req_key); 249 251 Admin.notifyUser(getProxyKey() + ".targetURL: " + getTargetRequest() + " .format:" + getFullFormat()); 250 252 251 253 // Caching 252 254 String xcid; 253 Admin.notifyUser("GPA.prepareSourceStream"); 255 256 // Admin.notifyUser("GPA.prepareSourceStream"); 257 254 258 if (getCache().equals(Cache.SKIP)) { 255 259 … … 258 262 } else { 259 263 if (getCache().equals(Cache.USE)) { 260 sourceStream = Cache.getCache().getFromCache( getRequestKey());264 sourceStream = Cache.getCache().getFromCache(req_key); 261 265 } 262 266 if (sourceStream == null) { // either not in cache or cache_flag=refresh 263 267 //sourceStream = getTargetRequest().openStream(); 264 268 sourceStream = getSourceStream(); 265 xcid = Cache.getCache().putInCache( getRequestKey(),sourceStream);266 Admin.notifyUser("putting in cache: " + getRequestKey());267 sourceStream = Cache.getCache().getFromCache( getRequestKey());269 xcid = Cache.getCache().putInCache(req_key,sourceStream); 270 Admin.notifyUser("putting in cache: " + req_key); 271 sourceStream = Cache.getCache().getFromCache(req_key); 268 272 } else { 269 Admin.notifyUser("reading from cache: " + getRequestKey());273 Admin.notifyUser("reading from cache: " + req_key); 270 274 } 271 275 } … … 277 281 MDTransformer.getMDTransformer().setSrcFile(getTargetRequest()); 278 282 // getColumns 279 resultStream = MDTransformer.getMDTransformer().transformXML(sourceStream, getFullFormat(), getColumns(), getStartRecord(), getMaximumRecords() );283 resultStream = MDTransformer.getMDTransformer().transformXML(sourceStream, getFullFormat(), getColumns(), getStartRecord(), getMaximumRecords(),getLang()); 280 284 } 281 285 -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/MDTransformer.java
r768 r789 165 165 * @throws IOException 166 166 */ 167 public void transformXML (InputStream in, String transkey, String cols, String startRecord, String maximumRecords, OutputStream out ) throws TransformerException, IOException {167 public void transformXML (InputStream in, String transkey, String cols, String startRecord, String maximumRecords, String lang, OutputStream out ) throws TransformerException, IOException { 168 168 169 169 // Create a transform factory instance. … … 177 177 getXSLStreamSource(transkey)); 178 178 179 transformer.setParameter("lang", lang); 179 180 transformer.setParameter("format", transkey); 180 181 transformer.setParameter("cols", cols); … … 225 226 * @throws TransformerException 226 227 */ 227 public InputStream transformXML ( InputStream xmlStream, String transkey, String cols, String startRecord, String maximumRecords ) throws IOException, InterruptedException, TransformerException {228 public InputStream transformXML ( InputStream xmlStream, String transkey, String cols, String startRecord, String maximumRecords, String lang) throws IOException, InterruptedException, TransformerException { 228 229 229 230 ByteArrayOutputStream out = new ByteArrayOutputStream(); 230 transformXML(xmlStream, transkey, cols, startRecord, maximumRecords, out);231 transformXML(xmlStream, transkey, cols, startRecord, maximumRecords, lang, out); 231 232 InputStream transformedStream = new ByteArrayInputStream(out.toByteArray()); 232 233 //Admin.notifyUser("transformedStream:" + transformedStream.toString()); … … 246 247 247 248 ByteArrayOutputStream out = new ByteArrayOutputStream(); 248 transformXML(xmlStream, transkey, "", "", "", out);249 transformXML(xmlStream, transkey, "", "", "","", out); 249 250 InputStream transformedStream = new ByteArrayInputStream(out.toByteArray()); 250 251 //Admin.notifyUser("transformedStream:" + transformedStream.toString()); -
MDService2/trunk/MDService2/src/terms_setup.xml
r776 r789 1 1 <Termsets> 2 <!-- <Termset type="model" id="tcp" name="TextCorpusProfile" url="" format="terms|cmdrepo" />-->3 <!-- <Termset type="model" id="tei" name="teiHeader" url="" format="terms" />-->2 <Termset type="model" id="tcp" name="TextCorpusProfile" url="" format="terms|cmdrepo" /> 3 <Termset type="model" id="tei" name="teiHeader" url="" format="terms" /> 4 4 5 <Termset type="dcr" id="isocat" name="isoCAT" url="http://www.isocat.org/rest/profile/5" format="dcif" />5 <Termset type="dcr" id="isocat" name="isoCAT" url="http://www.isocat.org/rest/profile/5" url_prefix="http://www.isocat.org/datcat/" format="dcif" /> 6 6 <Termset type="dcr" id="dce" name="dublincore elements" url="http://purl.org/dc/elements/1.1/" format="rdf" /> 7 7 <Termset type="rr" id="relcat" name="Relation Registry CMDI-set" url="http://lux13.mpi.nl/relcat/rest/set/cmdi" format="rdf" /> -
MDService2/trunk/MDService2/src/xsl/cmd_commons.xsl
r765 r789 24 24 --> 25 25 26 <xsl:param name="src_file" /> 26 <xsl:param name="src_file" /> 27 <!-- FIXME: he? --> 27 28 <xsl:param name="root_uri" select="$src_file" /> 29 30 <xsl:variable name="terms_setup" select="document($terms_setup_uri)" /> 28 31 29 32 <xsl:template match="/"> … … 146 149 147 150 151 <!-- should be obsoleted by model2matrix.xsl 152 148 153 <xsl:variable name="term_matrix" > 149 154 150 155 <xsl:for-each select="//CMD_Element" > 151 156 <xsl:variable name="context" select="my:context(.)" > 152 <!-- <xsl:for-each select="ancestor::CMD_Component" >153 <xsl:value-of select="@name" />.</xsl:for-each>-->154 157 </xsl:variable> 155 158 <Term elem="{@name}" datcat="{@ConceptLink}" profile="{ancestor::profileDescription[1]/name}" … … 161 164 </xsl:variable> 162 165 163 164 166 <xsl:template match="Term" mode="matrix" > 165 167 166 168 <xsl:for-each select=".//Term" > 167 169 <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 170 </xsl:variable> 171 171 <Term elem="{@name}" datcat="{my:term2datcat(@name)}" profile="{ancestor::profileDescription[1]/name}" … … 177 177 </xsl:template> 178 178 179 179 --> 180 180 181 <xsl:function name="my:profilematrix" > 181 182 <xsl:param name="term"/> … … 228 229 </xsl:function> 229 230 230 <xsl:function name="my:term2datcat"> 231 <xsl:param name="term"/> 232 <xsl:value-of select="$term_matrix/*[@elem=$term]/@datcat" /> 233 </xsl:function> 234 231 <!-- 232 <xsl:function name="my:term2datcat"> 233 <xsl:param name="term"/> 234 <xsl:value-of select="$term_matrix/*[@elem=$term]/@datcat" /> 235 </xsl:function> 236 --> 235 237 236 238 <xsl:function name="my:dict"> … … 270 272 </xsl:function> 271 273 274 272 275 <xsl:function name="my:shortURL" > 273 276 <xsl:param name="url" /> 274 277 <!-- <xsl:value-of select="replace($url, 'http://www.isocat.org/datcat/','isocat:')" /> --> 275 <xsl:value-of select="replace($url, $isocat_uri_match,'isocat:')" /> 278 <xsl:variable name="matching_termset" select="$terms_setup/Termsets/Termset[starts-with($url,@url_prefix)]" /> 279 280 <xsl:value-of select="if (exists($matching_termset)) then replace($url, $matching_termset/@url_prefix, concat($matching_termset/@id,':')) else $url" /> 276 281 </xsl:function> 277 282 -
MDService2/trunk/MDService2/src/xsl/datcat_all2terms.xsl
r768 r789 33 33 <xsl:template match="Termsets" > 34 34 <xsl:copy> 35 <xsl:message>count termsets:<xsl:value-of select="count(Termset)" /></xsl:message>36 <xsl:apply-templates />35 <xsl:message>count dcr/rd termsets:<xsl:value-of select="count(Termset[@type='dcr' or @type='rr'])" /></xsl:message> 36 <xsl:apply-templates select="Termset[@type='dcr' or @type='rr']" /> 37 37 </xsl:copy> 38 38 </xsl:template> -
MDService2/trunk/MDService2/src/xsl/datcat_dcif2terms.xsl
r768 r789 29 29 30 30 <xsl:template match="dcif:dataCategorySelection" > 31 <Termset id="isocat" label="{@name}" > 32 <xsl:apply-templates select="dcif:dataCategory" /> 33 31 <Termset id="isocat{if($lang!=$default_lang) then $lang else ''}" label="{concat(@name, ' [', $lang ,']')}" > 32 <xsl:apply-templates select="dcif:dataCategory" /> 34 33 </Termset> 35 34 </xsl:template> … … 38 37 name="TextCorpusProfile" count="8" count_text="199" count_distinct_text="87" path="TextCorpusProfile"/> 39 38 --> 40 <xsl:template match="dcif:dataCategory" > 41 <Term type="datcat" name="{@name}" datcat="{@pid}" id="{@identifier}"> 39 40 <!-- handling compressed dcif-format --> 41 <xsl:template match="dcif:dataCategory[@name]" > 42 <Term type="datcat" name="{@name}" datcat="{@pid}" id="{@identifier}"> 42 43 <xsl:for-each select="@*" > 43 44 <xsl:element name="{name()}" ><xsl:value-of select="." /></xsl:element> … … 46 47 </xsl:template> 47 48 49 <!-- handling full dcif-format --> 50 <xsl:template match="dcif:dataCategory" > 51 <xsl:variable name="n" > 52 <xsl:choose> 53 <xsl:when test=".//dcif:name[@xml:lang=$lang]"> 54 <xsl:value-of select=".//dcif:name[@xml:lang=$lang]" /> 55 </xsl:when> 56 <xsl:when test=".//dcif:name[@xml:lang=$default_lang]"> 57 <xsl:value-of select=".//dcif:name[@xml:lang=$default_lang]" /> 58 </xsl:when> 59 <xsl:when test=".//dcif:name"> 60 <xsl:value-of select=".//dcif:name" /> 61 </xsl:when> 62 <xsl:when test=".//dcif:dataElementName"> 63 <xsl:value-of select=".//dcif:dataElementName" /> 64 </xsl:when> 65 <xsl:otherwise> 66 <xsl:value-of select=".//dcif:identifier" /> 67 </xsl:otherwise> 68 </xsl:choose> 69 </xsl:variable> 70 71 <!-- <xsl:variable name="datcat" select="my:shortURL(@pid)" /> --> 72 73 <Term type="datcat" name="{$n}" datcat="{@pid}" id="{.//dcif:identifier}"> 74 <xsl:copy-of select="dcif:administrationRecord/*" /> 75 <xsl:choose> 76 <xsl:when test=".//dcif:languageSection[language=$lang]" > 77 <xsl:for-each select=".//dcif:languageSection[language=$lang]//*[@xml:lang=$lang]" > 78 <xsl:element name="{name()}" ><xsl:value-of select="." /></xsl:element> 79 </xsl:for-each> 80 </xsl:when> 81 <xsl:otherwise> 82 <xsl:for-each select=".//dcif:languageSection[1]//*[exists(text()) and text()!='']" > 83 <xsl:element name="{name()}" ><xsl:value-of select="." /></xsl:element> 84 </xsl:for-each> 85 </xsl:otherwise> 86 </xsl:choose> 87 88 <!-- probably need to add conceptual domain! --> 89 </Term> 90 </xsl:template> 91 48 92 </xsl:stylesheet> -
MDService2/trunk/MDService2/src/xsl/datcat_rdf2terms.xsl
r768 r789 29 29 <xsl:when test="contains($format,'rr-rdf')" > 30 30 <xsl:message>count rels:<xsl:value-of select="count(/rdf:RDF/rdf:Description)" /></xsl:message> 31 <xsl:message>src_file:<xsl:value-of select="$src_file" /></xsl:message> 32 <xsl:message>root_uri:<xsl:value-of select="$root_uri" /></xsl:message> 31 33 <xsl:call-template name="rr" /> 32 34 </xsl:when> … … 48 50 <xsl:variable name="rrroot" select="rdf:RDF" /> 49 51 <Termset type="rr" > 52 <!-- TODO: we have to match on ID/url! --> 53 <xsl:copy-of select="$terms_setup//Termset[@type='rr']/@*" /> 50 54 <xsl:for-each select="distinct-values(.//@rdf:about)" > <!-- .//@rdf:resource| --> 51 55 <xsl:variable name="datcat1" select="." /> 52 56 <Term type="rel" datcat="{$datcat1}" > 53 57 <xsl:for-each select="$rrroot/rdf:Description[@rdf:about=$datcat1]" > 54 <Term type="rel" name="{name(*[1])}" datcat="{*/@rdf:resource}" />58 <Term type="rel" reltype="{name(*[1])}" datcat="{*/@rdf:resource}" /> 55 59 </xsl:for-each> 56 60 <!-- <xsl:for-each select="$rrroot/rdf:Description[*/@rdf:resource=$datcat1]" > -
MDService2/trunk/MDService2/src/xsl/mdset2view.xsl
r774 r789 45 45 46 46 <xsl:variable name="columns" > 47 <xsl:message>COLUMNS: <xsl:value-of select="$cols" /><xsl:value-of select="string-length($cols)" /></xsl:message> 47 48 <xsl:variable name="colarray" select="tokenize($cols,',')"/> 48 49 <xsl:for-each select="$colarray" > … … 50 51 <!-- if (contains(.,'.')) then reverse(.) else . --> 51 52 </xsl:for-each> 52 53 <xsl:if test="count($colarray)=0" > 54 <xsl:copy-of select="$autocolumns"></xsl:copy-of> 55 <xsl:message>AUTOCOLUMNS: <xsl:copy-of select="$autocolumns" /><xsl:value-of select="count($autocolumns)" /></xsl:message> 56 </xsl:if> 57 58 </xsl:variable> 59 60 <xsl:variable name="autocolumns" > 61 <xsl:variable name="precompute"> 62 <xsl:for-each-group select="//Components//*[not(*)][exists(text())]" group-by="name()" > 63 <xsl:sort select="sum(current-group()/string-length(string-join(text(),';')))" order="descending" /> 64 <!-- <xsl:message>precomputing: <xsl:value-of select="name()" /> 65 count: <xsl:value-of select="count(current-group())" /> sum:<xsl:value-of select="sum(current-group()/string-length(string-join(text(),';')))" /></xsl:message> --> 66 <col key="{name()}" label="{name()}" xpath="{name()}" /> 67 </xsl:for-each-group> 68 </xsl:variable> 69 <!-- <xsl:message>precompute: <xsl:copy-of select="$precompute" /><xsl:value-of select="count($precompute)" /></xsl:message>--> 70 <xsl:copy-of select="$precompute/*[position() < $autocolumns_limit]"></xsl:copy-of> 53 71 </xsl:variable> 54 72 -
MDService2/trunk/MDService2/src/xsl/model2matrix.xsl
r776 r789 32 32 <xsl:template match="Terms" mode="matrix" > 33 33 34 <!-- hack for bug: missing value in: Terms/Term/@name --> 34 35 <xsl:variable name="termset_name" select="if (not(Term/@name='')) then Term/@name else replace(Term/@path,'/','')"></xsl:variable> 35 36 … … 44 45 <!-- get the whole Termset for every root-node (teiHeader, TCP, ...) --> 45 46 <Termsets> 46 <xsl:for-each select="Term/Term" > 47 <xsl:variable name="resolved_termset_uri" select="concat($model_matrix_uri,@name)" /> 47 <xsl:for-each select="Term/Term" > 48 <xsl:variable name="termset_name" select="@name" /> 49 <xsl:variable name="resolved_termset_uri" select="concat($model_matrix_uri,$termset_name)" /> 50 48 51 <xsl:variable name="termset" select="document($resolved_termset_uri)" /> 49 52 … … 55 58 56 59 <Termset> 60 <!-- <xsl:copy-of select="$terms_setup//Termset[@name=$termset_name]/@*" /> --> 57 61 <xsl:copy-of select="$termset_matrix/Terms/@*" /> 62 58 63 <xsl:copy-of select="$termset_matrix/Terms/*" /> 59 64 </Termset> … … 63 68 <xsl:otherwise> 64 69 65 <xsl:variable name="profile" select="my:profilematrix(Term/@name)" /> 70 <xsl:variable name="termset_name" select="Term/@name" /> 71 <xsl:variable name="profile" select="my:profilematrix($termset_name)" /> 66 72 <xsl:message>corresponding profile: <xsl:value-of select="concat($profile/@name, '#', $profile/@id)"/> </xsl:message> 67 73 <!-- <xsl:copy-of select="$profile" /> --> 68 74 75 <xsl:variable name="setup_entry" select="$terms_setup//Termset[@name=$termset_name]" /> 76 <xsl:message>corresponding terms_setup-entry: <xsl:value-of select="$setup_entry/concat(@name, '#', @id)"/> </xsl:message> 77 69 78 <xsl:variable name="prematrix"> 70 79 <Terms name="{$termset_name}"> 71 80 <xsl:copy-of select="@*" /> 81 <xsl:copy-of select="$setup_entry/@*" /> 72 82 <xsl:apply-templates mode="matrix" > 73 83 <xsl:with-param name="profile" select="$profile"></xsl:with-param> … … 112 122 <xsl:variable name="datcat_termsets" select="document($datcats_uri)" /> 113 123 114 <!-- resolve/invert datcat->Terms --> 115 <xsl:variable name="datcat_termsets_resolved" > 116 117 <xsl:apply-templates select="$datcat_termsets" mode="resolve-datcat" > 124 <!-- resolve/invert datcat->Terms --> 125 <xsl:variable name="datcat_termsets_resolved" > 126 <xsl:apply-templates select="$datcat_termsets//Termset[@type='dcr']" mode="resolve-datcat" > 118 127 <xsl:with-param name="model_termsets" select="$model_termsets" /> 119 128 </xsl:apply-templates> 120 129 </xsl:variable> 121 130 122 <!-- resolve RR: rels(datcat,datcat) --> 123 124 131 <!-- + resolve RR: rels(datcat,datcat) --> 132 <xsl:variable name="relcat_termsets_resolved" > 133 <xsl:apply-templates select="$datcat_termsets//Termset[@type='rr']" mode="resolve-relcat" > 134 <xsl:with-param name="datcat_termsets" select="$datcat_termsets_resolved" /> 135 </xsl:apply-templates> 136 </xsl:variable> 137 138 125 139 <Termsets> 126 140 <xsl:copy-of select="$model_termsets/Termsets/*" /> 127 <xsl:copy-of select="$datcat_termsets_resolved/Termsets/*" /> 141 <xsl:copy-of select="$datcat_termsets_resolved/*" /> 142 <xsl:copy-of select="$relcat_termsets_resolved/*" /> 128 143 </Termsets> 129 144 … … 138 153 <xsl:with-param name="model_termsets" select="$model_termsets" /> 139 154 </xsl:apply-templates> 155 140 156 </xsl:copy> 141 157 </xsl:template> … … 145 161 <xsl:copy> 146 162 <xsl:copy-of select="*|@*"></xsl:copy-of> 147 <xsl:copy-of select="$model_termsets//Term[@datcat=current()/@datcat]" /> 163 <xsl:variable name="matching_model_terms" select="$model_termsets//Term[@datcat=current()/@datcat]" /> 164 <!-- <xsl:attribute name="name" select="$matching_model_terms/"></xsl:attribute> --> 165 <xsl:copy-of select="$matching_model_terms" /> 148 166 </xsl:copy> 149 167 </xsl:template> 168 169 <xsl:template match="Termsets|Termset" mode="resolve-relcat" > 170 <xsl:param name="datcat_termsets" /> 171 <xsl:copy> 172 <xsl:copy-of select="@*"></xsl:copy-of> 173 <xsl:apply-templates mode="resolve-relcat"> 174 <xsl:with-param name="datcat_termsets" select="$datcat_termsets" /> 175 </xsl:apply-templates> 176 </xsl:copy> 177 </xsl:template> 178 179 <xsl:template match="Term" mode="resolve-relcat" > 180 <xsl:param name="datcat_termsets" /> 181 <xsl:copy> 182 <xsl:variable name="matching_datcat_terms" select="$datcat_termsets//Term[@datcat=current()/@datcat]" /> 183 <xsl:attribute name="name" select="($matching_datcat_terms//@name)[1]"></xsl:attribute> 184 <xsl:copy-of select="*|@*"></xsl:copy-of> 185 <xsl:copy-of select="$matching_datcat_terms" /> 186 </xsl:copy> 187 </xsl:template> 188 150 189 <!-- 151 190 <xsl:template match="@*|*" mode="resolve-datcat" > … … 158 197 <xsl:param name="term" select="." /> 159 198 160 199 200 <xsl:variable name="termset_id" select="if (exists(ancestor::Terms/@id)) then ancestor::Terms/@id else ancestor::Terms/@name" /> 201 161 202 <xsl:variable name="ambi_terms" select="$matrix//Term[lower-case(@name)=lower-case($term/@name)]" /> 162 203 163 <xsl:variable name="path" > 164 <xsl:choose> 204 <xsl:variable name="path" > 205 <xsl:value-of select="$termset_id" ></xsl:value-of><xsl:text>:</xsl:text> 206 207 <xsl:choose> 165 208 <xsl:when test="count($ambi_terms) > 1" > 166 209 <xsl:variable name="ambi_terms_parent" select="$ambi_terms[@name=$term/@name]" /> 167 168 169 210 <xsl:variable name="term1" select="." /> 170 211 <xsl:message>Term:<xsl:value-of select="$term1/@context" />|ambi: <xsl:value-of select="count($ambi_terms)" />|</xsl:message> -
MDService2/trunk/MDService2/src/xsl/params.xsl
r768 r789 14 14 should be universal language-selector eventually --> 15 15 <xsl:param name="lang" select="'en'" /> 16 <xsl:param name="default_lang" select="'en'" /> 16 17 17 18 <xsl:param name=" DCRs">19 20 < /xsl:param>21 18 19 <xsl:param name="model_matrix_uri" select="'http://localhost:8080/MDService2/model/matrix?q='" /> 20 <xsl:param name="datcats_terms_uri" select="'http://localhost:8080/MDService2/datcats/terms/?q='" /> 21 <xsl:param name="terms_setup_uri" select="'http://localhost:8080/MDService2/datcats/xml/?q='" /> 22 22 23 <!-- for resolving components by suffixing with @ComponentId --> 23 24 <!-- <xsl:param name="components_uri" select="'http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/'" /> --> … … 25 26 the absolute-URL is not nice, however I wasn't able to tell XSL how to resolve a relative url 26 27 --> 27 28 <xsl:param name="model_matrix_uri" select="'http://localhost:8080/MDService2/model/matrix?q='" />29 <xsl:param name="datcats_terms_uri" select="'http://localhost:8080/MDService2/datcats/terms/?q='" />30 28 <xsl:param name="cmdprofiles_uri" select="'http://localhost:8080/MDService2/compprofile/xml/'" /> 31 29 <xsl:param name="components_uri" select="'http://localhost:8080/MDService2/comp/xml/'" /> 32 30 <xsl:param name="components_id_prefix" select="'clarin.eu:cr1:'" /> 31 32 <xsl:param name="autocolumns_limit" select="6" /> 33 33 34 34 <xsl:param name="detail_comp_prefix" select="'comp/htmldetail/'"/> -
MDService2/trunk/MDService2/src/xsl/terms2view.xsl
r776 r789 204 204 <xsl:template name="autocomplete"> 205 205 206 <xsl:for-each-group select="//Term[not(ancestor::Term[@type='datcat'])]" group-by="lower-case(@name)" > 207 <Term name="{lower-case(@name)}"> 208 <xsl:for-each select="current-group()[not(@type='datcat')]" > 209 <context><xsl:value-of select="ancestor::Termset[1]/@name" />:<xsl:value-of select="@path" /></context> 210 </xsl:for-each> 211 <xsl:for-each select="current-group()[@type='datcat']" > 212 <xsl:variable name="datcat" select="." /> 213 <context><xsl:value-of select="ancestor::Termset[1]/@name" />:<xsl:value-of select="@name" /> 214 <xsl:for-each select="$datcat/Term" > 215 <context><xsl:value-of select="@path" /></context> 206 <xsl:for-each-group select="//Term[exists(@name)][not(ancestor::Term[@type='datcat'])]" group-by="lower-case(@name)" > 207 <xsl:sort select="lower-case(@name)" /> 208 <xsl:if test="exists(current-group()[not(@type='datcat')])" > 209 <Term name="{@name}"> 210 <xsl:for-each select="current-group()[not(@type='datcat' or @type='rel')]" > 211 <context><!-- <xsl:value-of select="ancestor::Termset[1]/@id" />: --><xsl:value-of select="@path" /></context> 216 212 </xsl:for-each> 217 </context> 218 </xsl:for-each> 219 </Term> 213 <xsl:for-each select="current-group()[@type='datcat' or @type='rel']" > 214 <xsl:variable name="datcat" select="." /> 215 <context><xsl:value-of select="ancestor::Termset[1]/@id" />:<xsl:value-of select="@name" /> 216 <xsl:for-each-group select="$datcat/Term" group-by="@path" > 217 <context><xsl:value-of select="@path" /></context> 218 </xsl:for-each-group> 219 </context> 220 </xsl:for-each> 221 </Term> 222 </xsl:if> 220 223 </xsl:for-each-group> 221 224 </xsl:template>
Note: See TracChangeset
for help on using the changeset viewer.