source: cats/ISOcat/trunk/mod-ISOcat-access-data/access/group_recommendation.acc @ 2686

Last change on this file since 2686 was 2686, checked in by mwindhouwer, 11 years ago

Fixed the throtteling:

  • all SQL request go through the ISOcat.database throttle (settings in the ISOcat config), also the indirect DBX ones
  • big (more then 100 DCs) DCS to DCIF go through the big-dcif throttle (hardcoded settings)
File size: 2.3 KB
Line 
1<accessor debug="false">
2        <name>ISOcat.access.data.group.recommendation</name>
3        <descr>This group recommends a DC</descr>
4        <param mandatory="true">
5                <name>id</name>
6                <descr>the group id</descr>
7                <type canonical="true">string</type>
8        </param>
9        <param mandatory="true">
10                <name>dc</name>
11                <descr>the DC id</descr>
12                <type canonical="true">string</type>
13        </param>
14        <idoc>
15                <instr>
16                        <type>sloot.xquery</type>
17                        <operator>
18                                <sql>
19                                        SELECT
20                                                *
21                                        FROM
22                                                core_recommendation
23                                        WHERE
24                                                "group" = {string($group)}
25                                        AND
26                                                "dc" = {string($dc)}
27                                        ;
28                                </sql>
29                        </operator>
30                        <group>var:id</group>
31                        <dc>var:dc</dc>
32                        <target>var:sql</target>
33                </instr>
34                <accessor-debug>
35                        <instr>
36                                <type>log</type>
37                                <operand>var:sql</operand>
38                        </instr>
39                </accessor-debug>
40                <if>
41                        <cond>
42                                <instr>
43                                        <type>isocat.sqlBooleanQuery</type>
44                                        <operand>var:sql</operand>
45                                        <target>this:cond</target>
46                                </instr>
47                        </cond>
48                        <then>
49                                <!-- the recommendation already exists: noop -->
50                                <instr>
51                                        <type>copy</type>
52                                        <operand>
53                                                <null/>
54                                        </operand>
55                                        <target>var:void</target>
56                                </instr>
57                        </then>
58                        <else>
59                                <!-- add the recommendation -->
60                                <instr>
61                                        <type>sloot.xquery</type>
62                                        <operator>
63                                                <sql>
64                                                        INSERT INTO
65                                                                core_recommendation
66                                                                ("group","dc")
67                                                        VALUES
68                                                                ({string($group)},{string($dc)})
69                                                        ;
70                                                </sql>
71                                        </operator>
72                                        <group>var:id</group>
73                                        <dc>var:dc</dc>
74                                        <target>var:sql</target>
75                                </instr>
76                                <accessor-debug>
77                                        <instr>
78                                                <type>log</type>
79                                                <operand>var:sql</operand>
80                                        </instr>
81                                </accessor-debug>
82                                <instr>
83                                        <type>isocat.sqlUpdate</type>
84                                        <operand>var:sql</operand>
85                                        <target>var:res</target>
86                                </instr>
87                                <!-- touch the updated DC -->
88                                <instr>
89                                        <type>ISOcat.access.data.dc.touch</type>
90                                        <dc>var:dc</dc>
91                                        <check>
92                                                <b>f</b>
93                                        </check>
94                                        <target>var:void</target>
95                                </instr>
96                               
97                        </else>
98                </if>
99                <instr>
100                        <type>copy</type>
101                        <operand>
102                                <null/>
103                        </operand>
104                        <target>this:response</target>
105                </instr>
106        </idoc>
107        <exception>
108                <debug/>
109                <trace>ffcpl:/trace/group_recommendation.exception.xml</trace>
110                <throw/>
111        </exception>
112        <response>
113                <debug>ffcpl:/trace/group_recommendation.response.xml</debug>
114                <mime>application/xml</mime>
115        </response>
116</accessor>
Note: See TracBrowser for help on using the repository browser.