File: db_repl_pub_cr_edit.vspx

package info (click to toggle)
virtuoso-opensource 6.1.6%2Bdfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (224 lines) | stat: -rw-r--r-- 9,199 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<?xml version="1.0" encoding="UTF-8"?>
<!--
 -
 -  $Id$
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -
 -  Copyright (C) 1998-2012 OpenLink Software
 -
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -
 -
-->
<v:page name="event_edit_page"
  decor="yacutia_decor.vspx"
  style="yacutia_style.xsl"
  vm:owner="yacutia_db_repl_page"
  doctype="-//W3C//DTD XHTML 1.0 Transitional//EN"
  fast-render="1"
  xmlns:v="http://www.openlinksw.com/vspx/"
  xmlns:vm="http://www.openlinksw.com/vspx/macro">
  <vm:pagetitle>Virtuoso HTTP Database Replication</vm:pagetitle>
  <vm:pagewrapper>
    <vm:variables>
      <v:variable name="acct" persist="1" type="varchar" default="''"/>
      <v:variable persist="0" name="_item" type="varchar" default="''"/>
      <v:variable persist="0" name="_item_type" type="integer" default="0"/>
    </vm:variables>
    <vm:menu>
      <vm:menuitem value="Transactional (publish)"/>
    </vm:menu>
    <vm:pagebody vdb_check="1">
      <v:form name="event_form1" type="simple" method="POST" action="">
        <input type="hidden" name="item" value="<?V get_keyword('item', self.vc_page.vc_event.ve_params) ?>"/>
        <input type="hidden" name="item_type" value="<?V get_keyword('item_type', self.vc_page.vc_event.ve_params) ?>"/>
        <v:before-data-bind>
          <v:script>
            <![CDATA[
              declare _acct varchar;
              _acct := get_keyword('acct', control.vc_page.vc_event.ve_params, '');
              if (_acct <> '')
                self.acct := _acct;
              self._item := cast(deserialize(decode_base64(get_keyword('item', self.vc_page.vc_event.ve_params))) as varchar);
              self._item_type := atoi(get_keyword('item_type', self.vc_page.vc_event.ve_params, '0'));
            ]]>
          </v:script>
        </v:before-data-bind>
        <table class="ctl_grp">
          <tr class="ctl_grp_title">
            <th colspan="2">
              <?vsp
                http(sprintf('Create Conflict Resolver for table %s', self._item));
              ?>
            </th>
          </tr>
          <tr>
            <td class="ctl_lbl_ctr">Name suffix</td>
            <td class="ctl_ctr">
              <input type="text" name="suffix"/>
            </td>
          </tr>
          <tr>
            <td class="ctl_lbl_ctr">Order</td>
            <td class="ctl_ctr"><input type="text" name="order" value="100"/></td>
          </tr>
          <?vsp
            if (self._item_type <> 1)
            {
          ?>
          <tr>
            <td class="ctl_lbl_ctr">Type</td>
            <td class="ctl_ctr">
              <select name="type">
                <option label="U" value="U">U</option>
                <option label="I" value="I">I</option>
                <option label="D" value="D">D</option>
              </select>
            </td>
          </tr>
          <?vsp
            }
          ?>
          <tr>
            <td class="ctl_lbl_ctr">Class</td>
            <td class="ctl_ctr">
              <select name="class">
                <?vsp
                  if (self._item_type = 1)
                  {
                ?>
                <option label="Min Creation Time" value="min_ctime">Min Creation Time</option>
                <option label="Max Creation Time" value="max_ctime">Max Creation Time</option>
                <option label="Min Modification Time" value="min_mtime">Min Modification Time</option>
                <option label="Max Modification Time" value="max_mtime">Max Modification Time</option>
                <option label="Backup" value="backup">Do Backup</option>
                <option label="Notify" value="notify">Do Notify</option>
                <?vsp
                  }
                  else if (self._item_type = 2)
                  {
                ?>
                <option label="Min" value="min">Min</option>
                <option label="Max" value="max">Max</option>
                <option label="Ave" value="ave">Ave</option>
                <?vsp
                  }
                  else
                  {
                ?>
                <option label="Min" value="min">Min</option>
                <option label="Max" value="max">Max</option>
                <option label="Ave" value="ave">Ave</option>
                <option label="Add" value="add">Add</option>
                <?vsp
                  }
                ?>
                <option label="Publisher Wins" value="pub_wins">Publisher Wins</option>
                <option label="Subscriber Wins" value="sub_wins">Subscriber Wins</option>
                <option label="Custom" value="custom">Custom</option>
              </select>
            </td>
          </tr>
          <?vsp
            if (self._item_type <> 1)
            {
          ?>
          <tr>
            <td class="ctl_lbl_ctr">Column</td>
            <td class="ctl_ctr">
              <select name="col">
                <?vsp
                  declare _cols, _col any;
                  declare _col_name varchar;
                  declare _col_dtp integer;
                  declare _ix, _len integer;
                  _cols := REPL_ALL_COLS(self._item);
                  _ix := 0;
                  _len := length(_cols);
                  while (_ix < _len)
                  {
                    _col := aref(_cols, _ix);
                    _col_name := repl_undot_name(aref(_col, 0));
                    _col_dtp := aref(_col, 1);
                    if (_col_dtp <> 128)
                    {
                ?>
                <option label="<?V _col_name ?>" value="<?V _col_name ?>"><?V _col_name ?></option>
                <?vsp
                    }
                    _ix := _ix + 1;
                  }
                ?>
              </select>
            </td>
          </tr>
          <?vsp
            }
          ?>
          <tr class="form_cmd_row">
            <td colspan="2">
              <v:button action="simple" name="cancel" value="Cancel">
                <v:on-post>
                  <v:script>
                    <![CDATA[
                      http_request_status('HTTP/1.1 302 Found');
                      http_header(sprintf('Location: db_repl_pub_cr.vspx?sid=%s&realm=%s&item=%s&item_type=%s&acct=%s\r\n', self.sid, self.realm, encode_base64(serialize(self._item)), cast(self._item_type as varchar), self.acct));
                      return;
                    ]]>
                  </v:script>
                </v:on-post>
              </v:button>
              <v:button action="simple" name="add" value="Add">
                <v:on-post>
                  <v:script>
                    <![CDATA[
                      declare _suffix, _order, _type, _class, _col varchar;
                      _suffix := get_keyword('suffix', self.vc_page.vc_event.ve_params, '');
                      _order := get_keyword('order', self.vc_page.vc_event.ve_params, '');
                      _type := get_keyword('type', self.vc_page.vc_event.ve_params, '');
                      _class := get_keyword('class', self.vc_page.vc_event.ve_params, '');
                      _col := get_keyword('col', self.vc_page.vc_event.ve_params, '');
                      if (_order = '')
                        _order := '100';
                      declare _err any;
                      declare _stmt varchar;
                      declare _params any;
                      _stmt := 'REPL_ADD_CR(?, ?, ?, ?, ?, ?)';
                      _params := vector(self._item, _suffix, _type, _order, _class, _col);
                      declare _state, _msg varchar;
                      _state := '00000';
                      _msg := '';
                      exec(_stmt, _state, _msg, _params);
                      if (_state <> '00000')
                      {
                        self.vc_error_message := _msg;
                        self.vc_is_valid := 0;
                        return;
                      }
                      http_request_status('HTTP/1.1 302 Found');
                      http_header(sprintf('Location: db_repl_pub_cr.vspx?sid=%s&realm=%s&item=%s&item_type=%s&acct=%s\r\n', self.sid, self.realm, encode_base64(serialize(self._item)), cast(self._item_type as varchar), self.acct));
                      return;
                    ]]>
                  </v:script>
                </v:on-post>
              </v:button>
            </td>
          </tr>
        </table>
      </v:form>
    </vm:pagebody>
  </vm:pagewrapper>
</v:page>