1 | -- |
---|
2 | -- Copyright (C) 2013 DASISH |
---|
3 | -- |
---|
4 | -- This program is free software; you can redistribute it and/or |
---|
5 | -- |
---|
6 | -- Copyright (C) 2013 DASISH |
---|
7 | -- |
---|
8 | -- This program is free software; you can redistribute it and/or |
---|
9 | -- modify it under the terms of the GNU General Public License |
---|
10 | -- as published by the Free Software Foundation; either version 2 |
---|
11 | -- of the License, or (at your option) any later version. |
---|
12 | -- |
---|
13 | -- This program is distributed in the hope that it will be useful, |
---|
14 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | -- GNU General Public License for more details. |
---|
17 | -- |
---|
18 | -- You should have received a copy of the GNU General Public License |
---|
19 | -- along with this program; if not, write to the Free Software |
---|
20 | -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
21 | -- |
---|
22 | |
---|
23 | INSERT INTO principal (principal_name, external_id, remote_id, e_mail) VALUES ('a user', '00000000-0000-0000-0000-000000000003', 'a1', 'a.user@gmail.com'); -- 1 |
---|
24 | INSERT INTO principal (principal_name, external_id, remote_id, e_mail) VALUES ('b user', '00000000-0000-0000-0000-000000000004', 'b2', 'b.user@gmail.com');-- 2 |
---|
25 | |
---|
26 | INSERT INTO notebook (title, owner_id, external_id) VALUES ('a notebook', 2, '00000000-0000-0000-0000-000000000001'); -- 1 |
---|
27 | -- INSERT INTO notebook (title, owner_id, external_id) VALUES ('a notebook', 1, 1); |
---|
28 | |
---|
29 | INSERT INTO annotation (owner_id,headline, body_text, body_mimetype, external_id, is_xml) VALUES (1, 'a headline', '<html><body>some html</body></html>', 'text/html' , '00000000-0000-0000-0000-000000000005', false); --1 |
---|
30 | |
---|
31 | INSERT INTO notebook (title, owner_id, external_id) VALUES ('a second notebook', 2, '00000000-0000-0000-0000-000000000002'); --2 |
---|
32 | -- INSERT INTO notebook (title, owner_id, external_id) VALUES ('a second notebook', 1, 2); |
---|
33 | INSERT INTO notebooks_annotations (notebook_id,annotation_id) VALUES (1,1); |
---|
34 | INSERT INTO notebooks_annotations (notebook_id,annotation_id) VALUES (2,1); |
---|
35 | |
---|
36 | |
---|
37 | -- Test data for jdbcAnnotationDao -- |
---|
38 | |
---|
39 | INSERT INTO principal (principal_name, external_id, remote_id, e_mail) VALUES ('Twan', '00000000-0000-0000-0000-000000000111', 'x3', 'twagoo@mpi.nl'); --3 |
---|
40 | INSERT INTO principal (principal_name, external_id, remote_id, e_mail) VALUES ('Peter', '00000000-0000-0000-0000-000000000112', 'y4', 'Peter.Withers@mpi.nl'); -- 4 |
---|
41 | INSERT INTO principal (principal_name, external_id, remote_id, e_mail) VALUES ('Olha', '00000000-0000-0000-0000-000000000113', 'JUnit@test.com', 'olhsha@mpi.nl'); -- 5 |
---|
42 | INSERT INTO principal (principal_name, external_id, remote_id, e_mail) VALUES ('Eric', '00000000-0000-0000-0000-000000000114', 'v6', 'eriaue@mpi.nl'); -- 6 |
---|
43 | |
---|
44 | |
---|
45 | INSERT INTO notebook (title, owner_id, external_id) VALUES ('Notebook 3', 3, '00000000-0000-0000-0000-000000000011'); -- 3 |
---|
46 | INSERT INTO notebook (title, owner_id, external_id) VALUES ('Notebook 4', 4, '00000000-0000-0000-0000-000000000012'); --4 |
---|
47 | INSERT INTO notebook (title, owner_id, external_id) VALUES ('Notebook 5', 5, '00000000-0000-0000-0000-000000000013'); --5 |
---|
48 | INSERT INTO notebook (title, owner_id, external_id) VALUES ('Notebook 6', 5, '00000000-0000-0000-0000-000000000014'); --6 |
---|
49 | |
---|
50 | INSERT INTO annotation (owner_id,headline,body_text, body_mimetype, external_id, last_modified, is_xml) VALUES (3, 'Sagrada Famiglia','<html><body>some html 1</body></html>', 'text/html' , '00000000-0000-0000-0000-000000000021', '2013-08-12 09:25:00.383', false); --2 |
---|
51 | INSERT INTO annotation (owner_id,headline,body_text, body_mimetype, external_id, is_xml) VALUES (4, 'Gaudi','<html><body>some html 2</body></html>', 'text/html' , '00000000-0000-0000-0000-000000000022',false); --3 |
---|
52 | INSERT INTO annotation (owner_id,headline,body_text, body_mimetype, external_id, is_xml) VALUES (5, 'Art Nuveau','some plain text', 'text/plain' , '00000000-0000-0000-0000-000000000023', false); --4 |
---|
53 | INSERT INTO annotation (owner_id,headline,body_text, body_mimetype, external_id, is_xml) VALUES (3, 'Annotation to delete','<html><body>some html 4</body></html>', 'text/html' , '00000000-0000-0000-0000-000000000024',false); --5 |
---|
54 | |
---|
55 | |
---|
56 | |
---|
57 | INSERT INTO notebooks_annotations (notebook_id,annotation_id) VALUES (3,2); |
---|
58 | INSERT INTO notebooks_annotations (notebook_id,annotation_id) VALUES (3,3); |
---|
59 | INSERT INTO notebooks_annotations (notebook_id,annotation_id) VALUES (4,4); |
---|
60 | INSERT INTO notebooks_annotations (notebook_id,annotation_id) VALUES (5,4); |
---|
61 | |
---|
62 | |
---|
63 | INSERT INTO target (external_id, link_uri, version, fragment_descriptor) VALUES ('00000000-0000-0000-0000-000000000031', 'http://nl.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia', 'version 1.0', '#de_Opdracht'); -- 1 |
---|
64 | INSERT INTO target (external_id, link_uri, version, fragment_descriptor) VALUES ('00000000-0000-0000-0000-000000000032', 'http://nl.wikipedia.org/wiki/Antoni_Gaud%C3%AD', 'version 1.0', '##Vroege_werk'); --2 |
---|
65 | INSERT INTO target (external_id, link_uri, version, fragment_descriptor) VALUES ('00000000-0000-0000-0000-000000000033', 'http://en.wikipedia.org/wiki/Art_Nouveau', 'june 1013', '##Spain'); --3 |
---|
66 | INSERT INTO target (external_id, link_uri, version, fragment_descriptor) VALUES ('00000000-0000-0000-0000-000000000034', '???', 'back up', '#1111'); --4 |
---|
67 | INSERT INTO target (external_id, link_uri, version, fragment_descriptor) VALUES ('00000000-0000-0000-0000-000000000035', '???', 'back up', '#111111'); --5 |
---|
68 | INSERT INTO target (external_id, link_uri, version, fragment_descriptor) VALUES ('00000000-0000-0000-0000-000000000036', '???', 'version 2.0', '#1111111'); --6 not used by any annotation |
---|
69 | INSERT INTO target (external_id, link_uri, version, fragment_descriptor) VALUES ('00000000-0000-0000-0000-000000000037', '???', 'version 2.0', '#11111111'); |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | INSERT INTO annotations_targets (annotation_id, target_id) VALUES (2, 1); |
---|
74 | INSERT INTO annotations_targets (annotation_id, target_id) VALUES (2, 2); |
---|
75 | INSERT INTO annotations_targets (annotation_id, target_id) VALUES (3, 2); |
---|
76 | INSERT INTO annotations_targets (annotation_id, target_id) VALUES (4, 3); |
---|
77 | INSERT INTO annotations_targets (annotation_id, target_id) VALUES (5, 3); -- Target 3 should not be deleted when annot 5 is deleted |
---|
78 | INSERT INTO annotations_targets (annotation_id, target_id) VALUES (5, 4); -- Target 4 to be deleted when annot 5 is deleted |
---|
79 | INSERT INTO annotations_targets (annotation_id, target_id) VALUES (4, 5); |
---|
80 | INSERT INTO annotations_targets (annotation_id, target_id) VALUES (4, 7); |
---|
81 | |
---|
82 | INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000051', 'text/html', 'latex', 'text', X'1001'); --1 |
---|
83 | INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000052', 'text/html', 'vi', 'text', X'1002'); -- 2 |
---|
84 | INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000053', 'image/png', 'screenshooter', 'image', X'1003'); -- 3 |
---|
85 | INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000054', 'text/html', 'oxygen', 'text', X'1004'); --4 |
---|
86 | INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000055', 'image/jpg', 'photomaster', 'image', X'1005'); --5 |
---|
87 | INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000056', 'text/plain', 'some tool', 'text', X'1006'); --6 not used |
---|
88 | INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000057', 'text/html', 'some tool 2', 'text', X'1007'); --7 |
---|
89 | |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | INSERT INTO targets_cached_representations (target_id, cached_representation_id, fragment_descriptor_in_cached) VALUES (1, 1, '#1'); |
---|
94 | INSERT INTO targets_cached_representations (target_id, cached_representation_id, fragment_descriptor_in_cached) VALUES (1, 2, '#2'); |
---|
95 | INSERT INTO targets_cached_representations (target_id, cached_representation_id, fragment_descriptor_in_cached) VALUES (2, 3, '#11'); |
---|
96 | INSERT INTO targets_cached_representations (target_id, cached_representation_id, fragment_descriptor_in_cached) VALUES (3, 4, '#12'); |
---|
97 | INSERT INTO targets_cached_representations (target_id, cached_representation_id, fragment_descriptor_in_cached) VALUES (4, 5, '#01'); |
---|
98 | INSERT INTO targets_cached_representations (target_id, cached_representation_id, fragment_descriptor_in_cached) VALUES (5, 7, '#02'); |
---|
99 | |
---|
100 | |
---|
101 | |
---|
102 | |
---|
103 | |
---|
104 | ---- PERMISSIONS -------------------------------------------------------------------------------------------- |
---|
105 | |
---|
106 | INSERT INTO permission_(permission_mode) VALUES ('owner'); |
---|
107 | INSERT INTO permission_(permission_mode) VALUES ('writer'); |
---|
108 | INSERT INTO permission_(permission_mode) VALUES ('reader'); |
---|
109 | |
---|
110 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (2, 3, 'owner'); |
---|
111 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (2, 4, 'writer'); |
---|
112 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (2, 5, 'reader'); |
---|
113 | |
---|
114 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (3, 4, 'owner'); |
---|
115 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (3, 3, 'reader'); |
---|
116 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (3, 5, 'writer'); |
---|
117 | |
---|
118 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (4, 5, 'owner'); |
---|
119 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (4, 3, 'reader'); |
---|
120 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (4, 4, 'reader'); |
---|
121 | |
---|
122 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (5, 5, 'owner'); |
---|
123 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (5, 4, 'writer'); |
---|
124 | INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (5, 3, 'writer'); |
---|
125 | -- checking integrity control: |
---|
126 | -- INSERT INTO annotations_principals_permissions (annotation_id, principal_id, permission_) VALUES (5, 5, 'reader'); |
---|