1 | <accessor debug="false"> |
---|
2 | <name>ISOcat.access.data.dc.hug</name> |
---|
3 | <descr>Hug the context of a DC.</descr> |
---|
4 | <param mandatory="true"> |
---|
5 | <name>dc</name> |
---|
6 | <descr>the DC key</descr> |
---|
7 | <type canonical="true">string</type> |
---|
8 | </param> |
---|
9 | <param> |
---|
10 | <name>check</name> |
---|
11 | <descr>check the DC</descr> |
---|
12 | <type canonical="true">string</type> |
---|
13 | <source> |
---|
14 | <param/> |
---|
15 | <default> |
---|
16 | <string>true</string> |
---|
17 | </default> |
---|
18 | </source> |
---|
19 | </param> |
---|
20 | <param> |
---|
21 | <name>dir</name> |
---|
22 | <descr>direction of the DC check propagation</descr> |
---|
23 | <type canonical="true">string</type> |
---|
24 | <source> |
---|
25 | <param/> |
---|
26 | <default> |
---|
27 | <string/> |
---|
28 | </default> |
---|
29 | </source> |
---|
30 | </param> |
---|
31 | <idoc> |
---|
32 | <seq> |
---|
33 | <!-- get the scope of the DC --> |
---|
34 | <instr> |
---|
35 | <type>ISOcat.access.data.dc.scope</type> |
---|
36 | <dc>var:dc</dc> |
---|
37 | <target>var:scope</target> |
---|
38 | </instr> |
---|
39 | <accessor-debug> |
---|
40 | <instr> |
---|
41 | <type>log</type> |
---|
42 | <operand>var:scope</operand> |
---|
43 | </instr> |
---|
44 | </accessor-debug> |
---|
45 | <!-- touch the users with access to this DC --> |
---|
46 | <instr> |
---|
47 | <type>xslt2</type> |
---|
48 | <operand>var:scope</operand> |
---|
49 | <operator> |
---|
50 | <xsl:stylesheet |
---|
51 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
52 | version="2.0" |
---|
53 | > |
---|
54 | <xsl:template match="text()"/> |
---|
55 | <xsl:template match="/"> |
---|
56 | <idoc> |
---|
57 | <seq> |
---|
58 | <xsl:choose> |
---|
59 | <xsl:when test="/scope/public/@rights='r'"> |
---|
60 | <instr> |
---|
61 | <type>sloot.cutGoldenThreads</type> |
---|
62 | <param> |
---|
63 | <string>goldenthread:/user/.+?/all</string> |
---|
64 | </param> |
---|
65 | </instr> |
---|
66 | </xsl:when> |
---|
67 | <xsl:otherwise> |
---|
68 | <!-- the owner --> |
---|
69 | <instr> |
---|
70 | <type>ISOcat.access.data.user.touch</type> |
---|
71 | <user> |
---|
72 | <string> |
---|
73 | <xsl:value-of select="/scope/private/account/@ref"/> |
---|
74 | </string> |
---|
75 | </user> |
---|
76 | <target>var:void</target> |
---|
77 | </instr> |
---|
78 | <!-- sharing users --> |
---|
79 | <xsl:for-each select="/scope/shared/account[@type='user']"> |
---|
80 | <instr> |
---|
81 | <type>ISOcat.access.data.user.touch</type> |
---|
82 | <user> |
---|
83 | <string> |
---|
84 | <xsl:value-of select="@ref"/> |
---|
85 | </string> |
---|
86 | </user> |
---|
87 | <target>var:void</target> |
---|
88 | </instr> |
---|
89 | </xsl:for-each> |
---|
90 | </xsl:otherwise> |
---|
91 | </xsl:choose> |
---|
92 | <xsl:apply-templates/> |
---|
93 | <instr> |
---|
94 | <type>copy</type> |
---|
95 | <operand> |
---|
96 | <null/> |
---|
97 | </operand> |
---|
98 | <target>this:response</target> |
---|
99 | </instr> |
---|
100 | </seq> |
---|
101 | </idoc> |
---|
102 | </xsl:template> |
---|
103 | </xsl:stylesheet> |
---|
104 | </operator> |
---|
105 | <target>var:hug</target> |
---|
106 | </instr> |
---|
107 | <accessor-debug> |
---|
108 | <instr> |
---|
109 | <type>log</type> |
---|
110 | <operand>var:hug</operand> |
---|
111 | </instr> |
---|
112 | <instr> |
---|
113 | <type>copy</type> |
---|
114 | <operand>var:hug</operand> |
---|
115 | <target>ffcpl:/trace/dc_hug.scope.xml</target> |
---|
116 | </instr> |
---|
117 | </accessor-debug> |
---|
118 | <instr> |
---|
119 | <type>dpml</type> |
---|
120 | <operand>var:hug</operand> |
---|
121 | <target>var:void</target> |
---|
122 | </instr> |
---|
123 | <!-- get the context of the DC --> |
---|
124 | <instr> |
---|
125 | <type>ISOcat.access.data.dc.context</type> |
---|
126 | <dc>var:dc</dc> |
---|
127 | <target>var:context</target> |
---|
128 | </instr> |
---|
129 | <accessor-debug> |
---|
130 | <instr> |
---|
131 | <type>log</type> |
---|
132 | <operand>var:context</operand> |
---|
133 | </instr> |
---|
134 | </accessor-debug> |
---|
135 | <!-- touch the contextual DCs/DCSs/profiles --> |
---|
136 | <instr> |
---|
137 | <type>xslt2</type> |
---|
138 | <operand>var:context</operand> |
---|
139 | <operator> |
---|
140 | <xsl:stylesheet |
---|
141 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
142 | version="2.0" |
---|
143 | xmlns:isocat="http://www.isocat.org/" |
---|
144 | > |
---|
145 | <xsl:param name="check"/> |
---|
146 | <xsl:param name="dir"/> |
---|
147 | <xsl:template match="text()"/> |
---|
148 | <xsl:template name="dc-name"> |
---|
149 | <xsl:if test="exists(@identifier)"> |
---|
150 | <xsl:text>/</xsl:text> |
---|
151 | <xsl:value-of select="@identifier"/> |
---|
152 | <xsl:text>/</xsl:text> |
---|
153 | </xsl:if> |
---|
154 | <xsl:if test="exists(@name)"> |
---|
155 | <xsl:text> (</xsl:text> |
---|
156 | <xsl:value-of select="@name"/> |
---|
157 | <xsl:text>)</xsl:text> |
---|
158 | </xsl:if> |
---|
159 | </xsl:template> |
---|
160 | <xsl:function name="isocat:touch"> |
---|
161 | <xsl:param name="what"/> |
---|
162 | <xsl:param name="id"/> |
---|
163 | <xsl:param name="dir"/> |
---|
164 | <instr> |
---|
165 | <type>ISOcat.access.data.<xsl:value-of select="$what"/>.touch</type> |
---|
166 | <xsl:element name="{$what}"> |
---|
167 | <string> |
---|
168 | <xsl:value-of select="$id"/> |
---|
169 | </string> |
---|
170 | </xsl:element> |
---|
171 | <check> |
---|
172 | <string> |
---|
173 | <xsl:value-of select="$check"/> |
---|
174 | </string> |
---|
175 | </check> |
---|
176 | <dir> |
---|
177 | <string> |
---|
178 | <xsl:value-of select="if ($dir='') then ('down') else ($dir)"/> |
---|
179 | </string> |
---|
180 | </dir> |
---|
181 | <target>var:void</target> |
---|
182 | </instr> |
---|
183 | </xsl:function> |
---|
184 | <xsl:template match="super"> |
---|
185 | <xsl:comment>touch the super simple DC[<xsl:call-template name="dc-name"/>]</xsl:comment> |
---|
186 | <xsl:copy-of select="isocat:touch('dc',@dc,$dir)"/> |
---|
187 | </xsl:template> |
---|
188 | <xsl:template match="domain"> |
---|
189 | <xsl:if test="$dir='up' or ($dir='' and /dc/@type='simple')"> |
---|
190 | <xsl:comment>touch the domain complex DC[<xsl:call-template name="dc-name"/>]</xsl:comment> |
---|
191 | <xsl:copy-of select="isocat:touch('dc',@dc,'up')"/> |
---|
192 | </xsl:if> |
---|
193 | </xsl:template> |
---|
194 | <xsl:template match="value"> |
---|
195 | <xsl:if test="$dir=('','down')"> |
---|
196 | <xsl:comment>touch the value simple DC[<xsl:call-template name="dc-name"/>]</xsl:comment> |
---|
197 | <xsl:copy-of select="isocat:touch('dc',@dc,'down')"/> |
---|
198 | </xsl:if> |
---|
199 | </xsl:template> |
---|
200 | <xsl:template match="profile"> |
---|
201 | <xsl:comment>touch the profile[<xsl:value-of select="@name"/>]</xsl:comment> |
---|
202 | <xsl:copy-of select="isocat:touch('profile',@ref,$dir)"/> |
---|
203 | </xsl:template> |
---|
204 | <xsl:template match="dcs"> |
---|
205 | <xsl:comment>touch the DCS[<xsl:value-of select="@name"/>]</xsl:comment> |
---|
206 | <xsl:copy-of select="isocat:touch('dcs',@ref,$dir)"/> |
---|
207 | </xsl:template> |
---|
208 | <xsl:template match="/"> |
---|
209 | <idoc> |
---|
210 | <seq> |
---|
211 | <xsl:apply-templates/> |
---|
212 | <instr> |
---|
213 | <type>copy</type> |
---|
214 | <operand> |
---|
215 | <null/> |
---|
216 | </operand> |
---|
217 | <target>this:response</target> |
---|
218 | </instr> |
---|
219 | </seq> |
---|
220 | </idoc> |
---|
221 | </xsl:template> |
---|
222 | </xsl:stylesheet> |
---|
223 | </operator> |
---|
224 | <check>var:check</check> |
---|
225 | <dir>var:dir</dir> |
---|
226 | <target>var:hug</target> |
---|
227 | </instr> |
---|
228 | <accessor-debug> |
---|
229 | <instr> |
---|
230 | <type>log</type> |
---|
231 | <operand>var:hug</operand> |
---|
232 | </instr> |
---|
233 | <instr> |
---|
234 | <type>copy</type> |
---|
235 | <operand>var:hug</operand> |
---|
236 | <target>ffcpl:/trace/dc_hug.context.xml</target> |
---|
237 | </instr> |
---|
238 | </accessor-debug> |
---|
239 | <instr> |
---|
240 | <type>dpml</type> |
---|
241 | <operand>var:hug</operand> |
---|
242 | <target>var:void</target> |
---|
243 | </instr> |
---|
244 | <instr> |
---|
245 | <type>copy</type> |
---|
246 | <operand> |
---|
247 | <null/> |
---|
248 | </operand> |
---|
249 | <target>this:response</target> |
---|
250 | </instr> |
---|
251 | </seq> |
---|
252 | </idoc> |
---|
253 | <exception> |
---|
254 | <debug/> |
---|
255 | <trace>ffcpl:/trace/dc_hug.exception.xml</trace> |
---|
256 | </exception> |
---|
257 | <response> |
---|
258 | <debug>ffcpl:/trace/dc_hug.response.xml</debug> |
---|
259 | <mime>application/xml</mime> |
---|
260 | </response> |
---|
261 | </accessor> |
---|