source: cats/ISOcat/trunk/mod-ISOcat-site/site/clarin/vlo/mapping/facetConcepts.acc @ 5763

Last change on this file since 5763 was 5763, checked in by Menzo Windhouwer, 10 years ago

M mod-ISOcat-site/site/clarin/vlo/mapping/facetConcepts.acc

  • removed cast to HTML
File size: 5.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<accessor debug="true">
3    <name>/clarin/vlo/mapping/facetConfig.xml</name>
4    <descr>Return the VLO facet mapping (in HTML).</descr>
5        <param>
6                <name>representation</name>
7                <descr>the profile to check</descr>
8                <type canonical="true">string</type>
9                <source>
10                        <nvp/>
11                        <default>
12                                <string>html</string>
13                        </default>
14                </source>
15        </param>
16       
17    <idoc>
18        <instr>
19            <type>sloot.xquery</type>
20            <operator>
21                <uri>{string(doc('etc/config.xml')/nvp/mapping)}</uri>
22            </operator>
23            <target>var:conf</target>
24        </instr>
25        <accessor-debug>
26            <instr>
27                <type>log</type>
28                <operand>var:conf</operand>
29            </instr>
30        </accessor-debug>
31        <choose>
32                <cond>
33                        <instr>
34                                <type>sloot.xpath2eval</type>
35                                <operand>var:representation</operand>
36                                <operator>
37                                        <xpath>.='xml'</xpath>
38                                </operator>
39                                <target>this:cond</target>
40                        </instr>
41                </cond>
42                <then>
43                        <instr>
44                                <type>copy</type>
45                                <operand>curi:var:conf</operand>
46                                <target>this:response</target>
47                        </instr>
48                        <instr>
49                                <type>cast</type>
50                                <operand>this:response</operand>
51                                <operator>
52                                        <cast>
53                                                <mimetype>application/xml</mimetype>
54                                        </cast>
55                                </operator>
56                                <target>this:response</target>
57                        </instr>
58                </then>
59                <else>
60                        <instr>
61                                <type>xslt2</type>
62                                <operand>curi:var:conf</operand>
63                                <operator>
64                                        <xsl:stylesheet
65                                                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
66                                                version="2.0"
67                                                >
68                                                <xsl:template match="text()"/>
69                                               
70                                                <xsl:template match="/facetConcepts">
71                                                        <dl>
72                                                                <xsl:apply-templates/>
73                                                        </dl>
74                                                </xsl:template>
75                                                <xsl:template match="facetConcept">
76                                                        <dt>
77                                                                <xsl:text>Facet: </xsl:text>
78                                                                <xsl:value-of select="@name"/>
79                                                        </dt>
80                                                        <dd>
81                                                                <xsl:if test="@allowMultipleValues='true'">
82                                                                        <p>Multiple values are allowed.</p>
83                                                                </xsl:if>
84                                                                <dl>
85                                                                        <xsl:apply-templates/>
86                                                                </dl>
87                                                        </dd>
88                                                </xsl:template>
89                                                <xsl:template match="concept">
90                                                        <dt>
91                                                                <xsl:text>CMD Element ConceptLink: </xsl:text>
92                                                                <a href="{.}">
93                                                                        <xsl:value-of select="."/>
94                                                                </a>
95                                                        </dt>
96                                                </xsl:template>
97                                                <xsl:template match="acceptableContext">
98                                                        <dt>
99                                                                <xsl:text>Acceptable context</xsl:text>
100                                                        </dt>
101                                                        <dd>
102                                                                <xsl:if test="empty(@includeEmpty) or (@includeEmpty='true')">
103                                                                        <p>An empty context leads to acception.</p>
104                                                                </xsl:if>
105                                                                <xsl:if test="@includeAny='true'">
106                                                                        <p>Any context, which is not rejected, leads to acception.</p>
107                                                                </xsl:if>
108                                                                <dl>
109                                                                        <xsl:apply-templates/>
110                                                                </dl>
111                                                        </dd>
112                                                </xsl:template>
113                                                <xsl:template match="acceptableContext/concept">
114                                                        <dt>
115                                                                <xsl:text>Accepted CMD Container ConceptLink: </xsl:text>
116                                                                <a href="{.}">
117                                                                        <xsl:value-of select="."/>
118                                                                </a>
119                                                        </dt>
120                                                </xsl:template>
121                                                <xsl:template match="rejectableContext">
122                                                        <dt>
123                                                                <xsl:text>Rejectable context</xsl:text>
124                                                        </dt>
125                                                        <dd>
126                                                                <xsl:if test="empty(@includeAny) or (@includeAny='true')">
127                                                                        <p>Any context leads to rejection.</p>
128                                                                </xsl:if>
129                                                                <xsl:if test="@includeEmpty='true'">
130                                                                        <p>Any empty context leads to rejection.</p>
131                                                                </xsl:if>
132                                                                <dl>
133                                                                        <xsl:apply-templates/>
134                                                                </dl>
135                                                        </dd>
136                                                </xsl:template>
137                                                <xsl:template match="rejectableContext/concept">
138                                                        <dt>
139                                                                <xsl:text>Rejected CMD Container ConceptLink: </xsl:text>
140                                                                <a href="{.}">
141                                                                        <xsl:value-of select="."/>
142                                                                </a>
143                                                        </dt>
144                                                </xsl:template>
145                                                <xsl:template match="pattern">
146                                                        <dt>
147                                                                <xsl:text>Fallback xpath: </xsl:text>
148                                                                <xsl:value-of select="."/>
149                                                        </dt>
150                                                </xsl:template>
151                                                <xsl:template match="blacklistPattern">
152                                                        <dt>
153                                                                <xsl:text>Blacklist xpath: </xsl:text>
154                                                                <xsl:value-of select="."/>
155                                                        </dt>
156                                                </xsl:template>
157                                        </xsl:stylesheet>
158                                </operator>
159                                <target>this:response</target>
160                        </instr>
161                        <instr>
162                                <type>cast</type>
163                                <operand>this:response</operand>
164                                <operator>
165                                        <cast>
166                                                <mimetype>text/html</mimetype>
167                                        </cast>
168                                </operator>
169                                <target>this:response</target>
170                        </instr>
171                </else>
172        </choose>
173    </idoc>
174    <exception>
175        <debug/>
176        <trace>ffcpl:/trace/clarin-vlo-mapping.facetConcepts.exception.xml</trace>
177        <!--<throw/>-->
178        <response>
179            <fieldset style="border: red dotted 1px;padding:1em;">
180                <legend style="font-weight:bold;">The facetConcepts.xml couldn't be accessed!</legend>
181                If this keeps on happening please contact: <a href="mailto:Menzo.Windhouwer@mpi.nl">Menzo Windhouwer</a>.
182            </fieldset>
183        </response>
184    </exception>
185    <response>
186        <debug>ffcpl:/trace/clarin-vlo-mapping.facetConcepts.response.xml</debug>
187    </response>
188</accessor>
189
Note: See TracBrowser for help on using the repository browser.