1 | <?xml version="1.0"?> |
---|
2 | <dbx:transform |
---|
3 | xmlns:dbx="http://www.windhouwer.nl/sloot/dbx" |
---|
4 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
5 | > |
---|
6 | <dbx:param name="group"/> |
---|
7 | <dbx:param name="props"/> |
---|
8 | |
---|
9 | <dbx:process> |
---|
10 | <dbx:for-each table="core_adhoc_group" min="1" max="1"> |
---|
11 | <dbx:where field="id" select="$group" type="integer"/> |
---|
12 | <group type="group"> |
---|
13 | <dbx:attribute name="key" field="id"/> |
---|
14 | <dbx:attribute name="owner_id" field="owner"/> |
---|
15 | <dbx:for-each table="view_user" min="1" max="1"> |
---|
16 | <dbx:where field="id" select="$current/owner" type="integer"/> |
---|
17 | <dbx:attribute name="owner" field="login"/> |
---|
18 | </dbx:for-each> |
---|
19 | <name dbx:field="name"/> |
---|
20 | <description dbx:field="description"/> |
---|
21 | <dbx:for-each table="link_group_members" min="1" max="*"> |
---|
22 | <dbx:where field="group" select="$current/id" type="integer"/> |
---|
23 | <member> |
---|
24 | <dbx:attribute name="ref" field="member"/> |
---|
25 | <dbx:attribute name="role" field="role"/> |
---|
26 | <dbx:attribute name="status" field="status"/> |
---|
27 | <dbx:for-each table="view_user" min="1" max="1"> |
---|
28 | <dbx:where field="id" select="$current/member" type="integer"/> |
---|
29 | <first_name dbx:field="first_name" dbx:when="normalize-space(.)!=''"/> |
---|
30 | <last_name dbx:field="last_name" dbx:when="normalize-space(.)!=''"/> |
---|
31 | <name dbx:field="name" dbx:when="normalize-space(.)!=''"/> |
---|
32 | <organization dbx:field="organization" dbx:when="normalize-space(.)!=''"/> |
---|
33 | <forum dbx:field="forum" dbx:when="normalize-space(.)!=''"/> |
---|
34 | </dbx:for-each> |
---|
35 | </member> |
---|
36 | </dbx:for-each> |
---|
37 | <dbx:for-each table="core_group" min="1" max="1"> |
---|
38 | <dbx:where field="id" select="$current/id"/> |
---|
39 | <forum> |
---|
40 | <dbx:attribute name="public" field="forum_public" when="normalize-space(@public)!=''"/> |
---|
41 | <dbx:attribute name="private" field="forum_private" when="normalize-space(@private)!=''"/> |
---|
42 | </forum> |
---|
43 | </dbx:for-each> |
---|
44 | <dbx:for-each table="view_link_dcs_access" min="0" max="*"> |
---|
45 | <dbx:where field="account" select="$current/id"/> |
---|
46 | <dbx:sort field="name" function="upper"/> |
---|
47 | <dbx:variable name="rights" field="rights"/> |
---|
48 | <dbx:for-each table="core_data_category_selection"> |
---|
49 | <dbx:where field="id" select="$current/dcs" type="integer"/> |
---|
50 | <dcs> |
---|
51 | <dbx:attribute name="ref" field="id"/> |
---|
52 | <dbx:attribute name="href" value="{string($props//site)}rest/dcs/{$current/id}"/> |
---|
53 | <dbx:attribute name="mode" select="$rights"/> |
---|
54 | <name dbx:field="name"/> |
---|
55 | </dcs> |
---|
56 | </dbx:for-each> |
---|
57 | </dbx:for-each> |
---|
58 | </group> |
---|
59 | </dbx:for-each> |
---|
60 | </dbx:process> |
---|
61 | |
---|
62 | <dbx:postprocess> |
---|
63 | <dbx:stylesheet template="identity"> |
---|
64 | <xsl:template match="group"> |
---|
65 | <xsl:copy> |
---|
66 | <xsl:apply-templates select="@*"/> |
---|
67 | <xsl:apply-templates select="* except (member,dcs)"/> |
---|
68 | <xsl:apply-templates select="member"> |
---|
69 | <xsl:sort select="name"/> |
---|
70 | </xsl:apply-templates> |
---|
71 | <xsl:apply-templates select="dcs"> |
---|
72 | <xsl:sort select="name"/> |
---|
73 | </xsl:apply-templates> |
---|
74 | </xsl:copy> |
---|
75 | </xsl:template> |
---|
76 | </dbx:stylesheet> |
---|
77 | </dbx:postprocess> |
---|
78 | |
---|
79 | </dbx:transform> |
---|
80 | |
---|