Compare commits
711 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d6a60636ed | ||
|
9ca2f6bb1e | ||
|
b886a5888a | ||
|
cec140b1fd | ||
|
84cffac713 | ||
|
754d4b3dcf | ||
|
7ee577c400 | ||
|
c854c1b377 | ||
|
bfe24b7dfb | ||
|
85c7e3ce5c | ||
|
27304ea385 | ||
|
8a994ee6f5 | ||
|
5ec3b6cce1 | ||
|
8cd05ec37e | ||
|
5a00229390 | ||
|
4b01f7c8ee | ||
|
edb91b92bd | ||
|
c6ae7be255 | ||
|
86ba19c120 | ||
|
183ab33729 | ||
|
9e992a8f61 | ||
|
5d18283285 | ||
|
d66666010d | ||
|
bddf867b63 | ||
|
d0d161e8ab | ||
|
64c7198d50 | ||
|
2fae012fd9 | ||
|
e8ee76c5f8 | ||
|
3d6df8a143 | ||
|
dec0fb7aef | ||
|
980a984499 | ||
|
1f8e251009 | ||
|
4729022d6a | ||
|
eb9a28603c | ||
|
d191aa9075 | ||
|
e585686bd2 | ||
|
44b3707005 | ||
|
251f0eca46 | ||
|
1bdf75e295 | ||
|
ccdab5257b | ||
|
797a4adfd4 | ||
|
3b64577d15 | ||
|
06fc95c454 | ||
|
0c15789c4b | ||
|
ae31613fdd | ||
|
6432fefa67 | ||
|
29037e60d8 | ||
|
29894a276e | ||
|
db0595ac7e | ||
|
bf8345908b | ||
|
d111c54f15 | ||
|
6a5eb910b5 | ||
|
8462e54293 | ||
|
7b45b4b633 | ||
|
b7051d56c0 | ||
|
8be0f19792 | ||
|
44dbce0801 | ||
|
878fe464ea | ||
|
68fd71d300 | ||
|
73e955afac | ||
|
ea4684d9c8 | ||
|
0b021c7602 | ||
|
1de1a9f55f | ||
|
60d75b6f2d | ||
|
ae71b1331f | ||
|
c56698d085 | ||
|
7299c7d506 | ||
|
9e8f73df99 | ||
|
572eb44e7a | ||
|
1d6e3ec4bf | ||
|
83e51a6501 | ||
|
5733dbf45e | ||
|
b110d338af | ||
|
08a066271b | ||
|
8996df4cbb | ||
|
c5932dc0f8 | ||
|
832fb6ce52 | ||
|
bbc380366f | ||
|
95d9414ae3 | ||
|
1a31e5ee99 | ||
|
d48abe6121 | ||
|
f564b4b34a | ||
|
147a4ec06a | ||
|
c81439cae8 | ||
|
06d3f0cd25 | ||
|
2a37167b01 | ||
|
2b89fdccca | ||
|
6624abb9ed | ||
|
726ffcd817 | ||
|
356ab4b1c1 | ||
|
a9c1d42925 | ||
|
08a9289893 | ||
|
3df00e9e0e | ||
|
b3e2e37929 | ||
|
7f6d575c16 | ||
|
10b9a4ceb2 | ||
|
d23595a75c | ||
|
a3c6ce10c2 | ||
|
1444be36ce | ||
|
ba90addad2 | ||
|
cfa669fe2e | ||
|
efb7e0cc3b | ||
|
668506ceb8 | ||
|
105c0544e1 | ||
|
29acc46d34 | ||
|
6fe9dcf578 | ||
|
d555309c22 | ||
|
d089b471fc | ||
|
7525ba4820 | ||
|
58390dfb92 | ||
|
b765a21369 | ||
|
560ceffaaf | ||
|
f3cc90d9d0 | ||
|
434fb4c8f5 | ||
|
57e5fcac3a | ||
|
b99cb2f8a3 | ||
|
ea95ba0ec7 | ||
|
3cf726f928 | ||
|
460d8270c6 | ||
|
079606c4e7 | ||
|
d67a16f550 | ||
|
8db7f5015f | ||
|
734463d233 | ||
|
fdf041e8b1 | ||
|
23611c8d54 | ||
|
729d2e98f7 | ||
|
baa8adacda | ||
|
7a535b1dca | ||
|
632a9a6e00 | ||
|
a4aa1c5436 | ||
|
9a19e2a5eb | ||
|
6d1a00291e | ||
|
d6656dffc0 | ||
|
3b23fead8e | ||
|
94b043ecf5 | ||
|
c8286c26aa | ||
|
f567513468 | ||
|
472bb38342 | ||
|
10fb98cdaa | ||
|
f65149c948 | ||
|
b4857ed99e | ||
|
131a501508 | ||
|
37e9676687 | ||
|
6ed7bc9154 | ||
|
d535fcc381 | ||
|
d28b439e62 | ||
|
0738804d88 | ||
|
f248a8c099 | ||
|
0891beeecd | ||
|
4646ae15c4 | ||
|
54fb696090 | ||
|
e5d9380699 | ||
|
5fe892abfd | ||
|
12ec295fe0 | ||
|
8936ef5008 | ||
|
0eaa8c8638 | ||
|
28010a85aa | ||
|
f1e4b1c8c0 | ||
|
1a2ba04b76 | ||
|
1ead555e09 | ||
|
cf246f00c8 | ||
|
4200d85cc0 | ||
|
a4ae253ae3 | ||
|
640b8d7ed0 | ||
|
5429178a1c | ||
|
163bc960b3 | ||
|
b79930394d | ||
|
c8e0b92ef5 | ||
|
7d0e4dc35a | ||
|
5f9b98324d | ||
|
95fcbb5888 | ||
|
2f4efde017 | ||
|
a62a053533 | ||
|
2d6a0c3e24 | ||
|
9897e69ee2 | ||
|
01fa9def4a | ||
|
71bba1c5ab | ||
|
708b8eb355 | ||
|
3e7ed53a2d | ||
|
136dc1154b | ||
|
301048ecad | ||
|
26138188ea | ||
|
558aa31516 | ||
|
f0e056c298 | ||
|
ccd5eb8e15 | ||
|
43d5779d5f | ||
|
148b56aecb | ||
|
684c412e95 | ||
|
7d9ccaec91 | ||
|
b4c69133f5 | ||
|
9edea47dbd | ||
|
ed55fd824f | ||
|
eff063ca37 | ||
|
a74f4158c6 | ||
|
d601a2818f | ||
|
81e9b5f59d | ||
|
f048d0adb7 | ||
|
2ec941e1a0 | ||
|
72a46367d6 | ||
|
b19ac2c4c3 | ||
|
acb3782561 | ||
|
c7b193f43f | ||
|
154db9d9e8 | ||
|
deb6c4be4d | ||
|
8b6ef7536e | ||
|
d0e07269c4 | ||
|
81e3cb590c | ||
|
a70dd1e52e | ||
|
194a7f200e | ||
|
306a2a2ada | ||
|
0c43bb4ad3 | ||
|
829815f9e9 | ||
|
93a8647c6a | ||
|
6ac7948312 | ||
|
0dc426487d | ||
|
b9e64e20e3 | ||
|
561fb00ac2 | ||
|
b774052e1d | ||
|
367bcf084d | ||
|
fe2b7225ef | ||
|
49d9820a44 | ||
|
3f2c687643 | ||
|
c68b4c90da | ||
|
1b480b566a | ||
|
504e3e18e6 | ||
|
f2be251c8b | ||
|
cedd12314b | ||
|
02cb53d082 | ||
|
0acd0c097f | ||
|
9a9dabc0ab | ||
|
99be712a5f | ||
|
ed4d50724a | ||
|
94812cd96a | ||
|
f39e82b016 | ||
|
2f994be98d | ||
|
40907bc479 | ||
|
d4f9fb1756 | ||
|
14d688b9bf | ||
|
a745167c75 | ||
|
2cb7ec9afb | ||
|
540b575e54 | ||
|
7e5b3c51a8 | ||
|
5d4da27842 | ||
|
20a786460c | ||
|
07b18d9527 | ||
|
adfc6c08f2 | ||
|
9a1c0fe46d | ||
|
a8f7d28c11 | ||
|
5b1fb27ca2 | ||
|
cf0b3cf80d | ||
|
0493d66daa | ||
|
f66c476187 | ||
|
9b3f1c79a6 | ||
|
5e62eb3279 | ||
|
2ccb4bfb83 | ||
|
686e011f9b | ||
|
f610bfdfb3 | ||
|
f0c6d944a8 | ||
|
ebf4603889 | ||
|
706031a641 | ||
|
25e6e4de4f | ||
|
ae604b1c70 | ||
|
0d11dee06c | ||
|
00773ae3b9 | ||
|
88fed0af0a | ||
|
31aab0bd48 | ||
|
4f40431d55 | ||
|
d1004f2919 | ||
|
7151aa4e2c | ||
|
c3d2739293 | ||
|
091955255b | ||
|
2aa68c3d4b | ||
|
f4fb008f1b | ||
|
da2594292b | ||
|
f30106ab39 | ||
|
8a684519f0 | ||
|
24417d4fd0 | ||
|
9c4dfb7f25 | ||
|
7d6c26539d | ||
|
8bdc5f6b05 | ||
|
91b5a08b11 | ||
|
c0b8eb7176 | ||
|
871d89a304 | ||
|
0933786525 | ||
|
0968549e55 | ||
|
bec5a087aa | ||
|
2528ceb8df | ||
|
f5c7d63528 | ||
|
af0a62aee9 | ||
|
8e402431b8 | ||
|
e34f5ce45a | ||
|
b401a53a21 | ||
|
0c103fc3a2 | ||
|
2e7aa144b2 | ||
|
4eec745296 | ||
|
947fd30fa2 | ||
|
52cac830ae | ||
|
808660cfbb | ||
|
9d2cf7e1ff | ||
|
5d231249c7 | ||
|
242827f7e6 | ||
|
3736f48efa | ||
|
9639b9e113 | ||
|
531be52c5b | ||
|
2e24032d1c | ||
|
cc9fa543cb | ||
|
541d07c46c | ||
|
52d3838094 | ||
|
3828a1afdb | ||
|
d288787fdc | ||
|
c6aed4bf6e | ||
|
2c26c3cdc0 | ||
|
7eda354f8f | ||
|
9b133468e4 | ||
|
f20b3a7a46 | ||
|
953e473ef0 | ||
|
abede3c010 | ||
|
f2a5221cbd | ||
|
e165bbbff6 | ||
|
3d948a1419 | ||
|
cd02cdb1ce | ||
|
1e90a74ac7 | ||
|
ae587a037a | ||
|
703414266e | ||
|
22c102917e | ||
|
970e5bd2ed | ||
|
0001dff347 | ||
|
c525acbad4 | ||
|
a50a96492f | ||
|
83d80cadb5 | ||
|
63c063933d | ||
|
b2adb4f6a6 | ||
|
59a57e0b34 | ||
|
94915bc8e4 | ||
|
80dfab3ef4 | ||
|
fd73564be2 | ||
|
3679db819a | ||
|
50adfa0053 | ||
|
a2db34ae61 | ||
|
5f29024559 | ||
|
9a77ff3bb8 | ||
|
94ac039390 | ||
|
805f5eed7f | ||
|
e4d5425a7d | ||
|
914e3b508c | ||
|
86324c6873 | ||
|
5e4c1e4357 | ||
|
896e299f8f | ||
|
c87424ae80 | ||
|
751157815e | ||
|
fc6b573f86 | ||
|
9f6ba0b19c | ||
|
175b2f8921 | ||
|
711b673e31 | ||
|
f8b25f949a | ||
|
fd6d23c513 | ||
|
55ab430cfe | ||
|
1dce163782 | ||
|
4d3d8daa37 | ||
|
efd285eb10 | ||
|
128052102d | ||
|
8f2f9da3da | ||
|
84c96287f3 | ||
|
f75124233b | ||
|
26bd9f8840 | ||
|
da8f474c64 | ||
|
5e8c1960e7 | ||
|
35d76ea56f | ||
|
a230dd104c | ||
|
31fb342ef1 | ||
|
65283a0edc | ||
|
9686431874 | ||
|
96cb014a6e | ||
|
8915e7eddf | ||
|
fd021de86d | ||
|
f5b4cc9ea7 | ||
|
8e66c97aa3 | ||
|
bd80d95d22 | ||
|
4d46864388 | ||
|
3696e126e3 | ||
|
65ee33a09f | ||
|
dce29eda19 | ||
|
81d3d591fa | ||
|
2a2dc7c57f | ||
|
2c355205d0 | ||
|
ed508d646c | ||
|
fcb99490d8 | ||
|
fd00a5e0fc | ||
|
f9d1e869b0 | ||
|
06210ab95b | ||
|
3137f78cce | ||
|
dcd59efc12 | ||
|
2b8972a35a | ||
|
f961ae578c | ||
|
0188e15a92 | ||
|
c12b73c1ff | ||
|
a60f001f2c | ||
|
04d58533cf | ||
|
ed6d89fb7e | ||
|
3b47ed2e52 | ||
|
abfc06c7d5 | ||
|
712cc2c60b | ||
|
057d5bc01f | ||
|
e36b0b8b52 | ||
|
4dd7a82e32 | ||
|
580d977aa9 | ||
|
45c67d6b57 | ||
|
0b6c8a5977 | ||
|
811cc8a668 | ||
|
f136240591 | ||
|
e0a6d15ad0 | ||
|
617abd9d90 | ||
|
c2e74cb2d4 | ||
|
db70db49a5 | ||
|
4cc6382043 | ||
|
c8d3d99224 | ||
|
645402e691 | ||
|
8ed1a18280 | ||
|
0d81db52f1 | ||
|
67398fe07e | ||
|
9b21c77485 | ||
|
94356a5773 | ||
|
2f8df725c9 | ||
|
b9e508424c | ||
|
48e211cc2d | ||
|
3578d6e624 | ||
|
8356906791 | ||
|
9e7f289a9e | ||
|
9e67329703 | ||
|
8489eaea6d | ||
|
9fb0ebd8f6 | ||
|
e03f5f632b | ||
|
b6ee7e61b8 | ||
|
202c3f28a3 | ||
|
a1a28efe49 | ||
|
0e5592a0d3 | ||
|
52efdf729b | ||
|
ef3e8ae772 | ||
|
1c1fc2ca96 | ||
|
bf3bd5c1c7 | ||
|
9cabfb14a5 | ||
|
def2034fa0 | ||
|
b5a7a11920 | ||
|
6155a70c04 | ||
|
846ad24bf3 | ||
|
9ab0637690 | ||
|
fe331a5170 | ||
|
f4969e11b9 | ||
|
312f5447b8 | ||
|
879fa4c926 | ||
|
5e0c879654 | ||
|
9049ca25aa | ||
|
76ccc5e6b2 | ||
|
8aa733158c | ||
|
0eef3b3251 | ||
|
965ba4edaa | ||
|
7960c0a419 | ||
|
99a3fa64ec | ||
|
a7316d516c | ||
|
efe562f057 | ||
|
d2b7b640d9 | ||
|
79f5e51513 | ||
|
0f605d89f0 | ||
|
cb6828c08e | ||
|
3ff67910c9 | ||
|
51f531f6b4 | ||
|
fc22dd32a2 | ||
|
deca7e51b2 | ||
|
28ffead0a0 | ||
|
d1dfb48be5 | ||
|
9360a27f15 | ||
|
cc8ff94b10 | ||
|
f245116e48 | ||
|
7bd87c50ac | ||
|
86d5c98ed7 | ||
|
5d05f21803 | ||
|
6e2880c8cc | ||
|
87ce3fc0a9 | ||
|
92849b02eb | ||
|
829655f253 | ||
|
b4bdad796e | ||
|
d52e2c04a6 | ||
|
edc3351fd8 | ||
|
73a664ab97 | ||
|
cabca992d1 | ||
|
e734ea350c | ||
|
ac7af5b8f1 | ||
|
43e9f8fcad | ||
|
7a401b648e | ||
|
82ff47220d | ||
|
f3d88e91c4 | ||
|
37419cba66 | ||
|
8b0465bda6 | ||
|
765b1fc80e | ||
|
0d8b6b210e | ||
|
d2c287684f | ||
|
bad11bea88 | ||
|
6c1188314b | ||
|
f4f97d3112 | ||
|
a958fcbd6e | ||
|
02b31e463b | ||
|
6fe53446ce | ||
|
5d62bf520a | ||
|
12448fc6cb | ||
|
ebd6f886d5 | ||
|
66e4b0fb19 | ||
|
f34ec25610 | ||
|
46264991b9 | ||
|
b9748ca23a | ||
|
fe99c9a238 | ||
|
9f495f1e76 | ||
|
dd1698b5d9 | ||
|
c5bf91a9fe | ||
|
ac8309819c | ||
|
e1e9c9ebeb | ||
|
4062b6771c | ||
|
0cdabba5eb | ||
|
064b8f1071 | ||
|
c3dcd8f3a9 | ||
|
b717a5f910 | ||
|
1602421544 | ||
|
fe44da9b43 | ||
|
2a8ae4c397 | ||
|
7f7a67872e | ||
|
322b0ba13e | ||
|
0aa2d67698 | ||
|
3c0055b767 | ||
|
2549305621 | ||
|
42564b2759 | ||
|
032df5fdf4 | ||
|
dbbe8901b7 | ||
|
91f27c4e10 | ||
|
91aeddee70 | ||
|
fab3c96097 | ||
|
b89b08b7b3 | ||
|
ed37b20dfc | ||
|
f44e616a4b | ||
|
e70f2726a3 | ||
|
964505abd4 | ||
|
ce932e57e0 | ||
|
2ec9e70245 | ||
|
fc6d91f59e | ||
|
f8a6607de9 | ||
|
ca0b5bfcbe | ||
|
be545d7103 | ||
|
3832844ee6 | ||
|
b3234675cc | ||
|
146c6d8a17 | ||
|
37e11a5b05 | ||
|
ea5f1afa40 | ||
|
2e0339492d | ||
|
f8d6cdebc4 | ||
|
58ed80d763 | ||
|
61569bc571 | ||
|
7ba21f85bf | ||
|
2c5f7139d5 | ||
|
0c433352c5 | ||
|
07c8a1d8c7 | ||
|
6560973237 | ||
|
596aeeebc4 | ||
|
16e59a0879 | ||
|
2861a7b5f9 | ||
|
b1172f16cc | ||
|
71762ff629 | ||
|
00fd168489 | ||
|
c1318e496c | ||
|
8de31d9edc | ||
|
90b584569b | ||
|
df98282620 | ||
|
751692837c | ||
|
3f2f23d3c1 | ||
|
4ac8a41a46 | ||
|
cba00adc41 | ||
|
0f66d6fb6d | ||
|
b36df012f8 | ||
|
e302171ac9 | ||
|
abdb56c35d | ||
|
a228ea6ed5 | ||
|
6c2d277f02 | ||
|
10f8b5748e | ||
|
6a9d1c684e | ||
|
2f8cd121e3 | ||
|
fe8516bb94 | ||
|
29e397ab3f | ||
|
c1d041e3f8 | ||
|
98729c2582 | ||
|
53768b5400 | ||
|
7feb29b151 | ||
|
031bbe50e1 | ||
|
17ea409542 | ||
|
37b4298579 | ||
|
5cb2289cbc | ||
|
c86bd15382 | ||
|
aed1c0afcb | ||
|
a74efa4647 | ||
|
cf0f0a8c00 | ||
|
52ce817e3a | ||
|
45a190bbac | ||
|
d7c74e289e | ||
|
27a82d9e41 | ||
|
806bb96ce1 | ||
|
9067a6cff2 | ||
|
ef88ee06de | ||
|
b4005c8159 | ||
|
2d58e9a0f5 | ||
|
af8d833356 | ||
|
6303ba93c7 | ||
|
04d43e62c7 | ||
|
a179875fee | ||
|
e5e2e86fce | ||
|
dafe8eeb03 | ||
|
a492521a10 | ||
|
ddaa89acee | ||
|
a155477eff | ||
|
24b4f4b190 | ||
|
cc57fae5cf | ||
|
d17b8397f7 | ||
|
ad9d00843f | ||
|
742fa9d03e | ||
|
7fa766c2d0 | ||
|
3fdbcb31d3 | ||
|
3672d2a8e2 | ||
|
4f1bb45fc2 | ||
|
c37b632ac9 | ||
|
c7f7b20260 | ||
|
9985384a7f | ||
|
295fbba387 | ||
|
dfe07e2da0 | ||
|
dbf8b0e28c | ||
|
1811749964 | ||
|
e72ae37ac7 | ||
|
6b76c53663 | ||
|
3bd2242080 | ||
|
e5ab234d01 | ||
|
22d9f7a199 | ||
|
1e5e11a309 | ||
|
f6e5018272 | ||
|
4a0d70e3b3 | ||
|
3d1dc9bfc6 | ||
|
14e9bf0e06 | ||
|
f8fb56e49f | ||
|
65f4238c3e | ||
|
66fcc68677 | ||
|
63d4de6da1 | ||
|
8320ae0abf | ||
|
be4d7d1c91 | ||
|
f6b1499322 | ||
|
25ac0bbadd | ||
|
b847782079 | ||
|
cfaa8f786d | ||
|
0dafb4b31b | ||
|
acd149bfc9 | ||
|
155ec74dea | ||
|
56ac4aaed3 | ||
|
7db5bb3591 | ||
|
9c632faf77 | ||
|
85d41300bf | ||
|
a42c54678a | ||
|
88f5f1a5bd | ||
|
f5d3b51f6e | ||
|
ff63b4f89c | ||
|
d2f9749d61 | ||
|
7bbcd82488 | ||
|
a0ee153ca0 | ||
|
8a8922f2a6 | ||
|
7c4f500361 | ||
|
9cbb6eadc2 | ||
|
310a6b9e03 | ||
|
cd776073dc | ||
|
6555203a94 | ||
|
f8cb849597 | ||
|
5e93c0a98c | ||
|
4ec8e75bdb | ||
|
a19003077c | ||
|
8a9c219b9d | ||
|
662fc82919 | ||
|
029bfa809a | ||
|
7246260220 | ||
|
000b6a693d | ||
|
e1d4f0afc8 | ||
|
849cb4a9ce | ||
|
de64764306 | ||
|
c44d88eb09 | ||
|
66e214ca88 | ||
|
bb26d73462 | ||
|
6badd972b0 | ||
|
7b1574150a | ||
|
46f3ec96c5 | ||
|
69ed3d8126 | ||
|
1400130ebf | ||
|
a0ea9a6980 | ||
|
36a35b44d7 | ||
|
f90dd4f22a | ||
|
f1c9c95ed5 | ||
|
15e03c690f | ||
|
e0a67fe1d7 | ||
|
b4f036745f | ||
|
5719e54091 | ||
|
3895365d93 | ||
|
7d073920df | ||
|
5c9a10b878 | ||
|
bef8711138 | ||
|
011acba666 | ||
|
a1199687d4 | ||
|
4c988d4ae2 | ||
|
022e3d982a | ||
|
69912ecef4 | ||
|
a263a05520 | ||
|
2e2e978c43 | ||
|
1e53ba827f | ||
|
d811c8f011 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@ wisemapping.log*
|
||||
*/.DS_Store
|
||||
.DS_Store
|
||||
target
|
||||
.idea
|
||||
|
@@ -1,34 +0,0 @@
|
||||
# Compiling and Running
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The following products must be installed:
|
||||
|
||||
* Java Development Kit 6 or higher (http://java.sun.com/javase/downloads/index.jsp)
|
||||
* Maven 3.x or higher (http://maven.apache.org/)
|
||||
|
||||
## Compiling
|
||||
|
||||
WiseMapping uses Maven as packaging and project management. The project is composed of 4 maven sub-modules:
|
||||
|
||||
* core-js: Utilities JavaScript libraries
|
||||
* web2d: JavaScript 2D VML/SVG abstraction library used by the mind map editor
|
||||
* mindplot: JavaScript mind map designer core
|
||||
* wise-editor: Mindmap Editor standalone distribution
|
||||
* wise-webapp: J2EE web application
|
||||
|
||||
Full compilation of the project can be done executing within <project-dir>:
|
||||
|
||||
`mvn package`
|
||||
|
||||
Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapping*.war will be generated.
|
||||
|
||||
## Testing
|
||||
The previously generated war can be deployed locally executing within the directory <project-dir>/wise-webapp the following command:
|
||||
|
||||
`mvn jetty:run-war`
|
||||
|
||||
This will start the application on the URL: http://localhost:8080/wise-webapp/. Additionally, a file based database is automatically populated with a test user.
|
||||
|
||||
User: test@wisemapping.org
|
||||
Password: test
|
22
Home.textile
22
Home.textile
@@ -1,22 +0,0 @@
|
||||
h1. What is WiseMapping Open Source?
|
||||
|
||||
WiseMapping is a free web based mindmapping application. The goal of this project is to provide a high quality product that can be deployed by educational and academic institutions, private and public companies and anyone who needs to have a mindmapping application. WiseMapping is based on the same code source supporting WiseMapping.com.
|
||||
|
||||
|
||||
h1. Why Open Source ?
|
||||
|
||||
In the last years, we have received hundred of mails from different persons asking for:
|
||||
Integrating wisemapping.com with their sites
|
||||
Deploying a private instance of wisemapping.com
|
||||
Participating in the development of the site
|
||||
All this make us wonder "Why if we share our product to all this people and invite them to participate with us in this journey ?" .
|
||||
|
||||
h1. Who are we ?
|
||||
|
||||
We’re a couple of friends working on an idea: “Create the best on-line collaborative mind mapping tool ever created”. This has been our idea since the first day we started.
|
||||
|
||||
h1. [[Documentation]]
|
||||
|
||||
h1. [[Compiling and Running]]
|
||||
|
||||
h1. [[FAQ]]
|
108
README.md
108
README.md
@@ -1,6 +1,4 @@
|
||||
# WiseMapping: a Web based mindmapping application
|
||||
|
||||
## Project Information
|
||||
# Project Information
|
||||
|
||||
The goal of this project is to provide a high quality product that can be deployed by educational and academic institutions, private and public companies and anyone who needs to have a mindmapping application. WiseMapping is based on the same code source supporting WiseMapping.com. More info: www.wisemapping.org
|
||||
|
||||
@@ -9,116 +7,66 @@ The goal of this project is to provide a high quality product that can be deploy
|
||||
### Prerequisites
|
||||
|
||||
The following products must be installed:
|
||||
* Java Development Kit 6 or higher (http://java.sun.com/javase/downloads/index.jsp)
|
||||
* Maven 2.2.1 or higher (http://maven.apache.org/)
|
||||
|
||||
* Java Development Kit 7 or higher ([http://www.oracle.com/technetwork/java/javase/downloads/index.html])
|
||||
* Maven 3.x or higher ([http://maven.apache.org/])
|
||||
|
||||
### Compiling
|
||||
|
||||
WiseMapping uses Maven as packaging and project management. The project is composed of 4 maven sub-modules:
|
||||
* core-js: Utilities JavaScript libraries
|
||||
WiseMapping uses Maven as packaging and project management. It's composed of 5 maven sub-modules:
|
||||
|
||||
* core-js: Utilities JavaScript classes
|
||||
* web2d: JavaScript 2D SVG abstraction library used by the mind map editor
|
||||
* mindplot: JavaScript mind map designer core
|
||||
* mindplot: JavaScript mindmap designer core
|
||||
* wise-editor: Mindmap Editor standalone distribution
|
||||
* wise-webapp: J2EE web application
|
||||
|
||||
Full compilation of the project can be done executing within <project-dir>:
|
||||
The full compilation of the project can be performed executing within <project-dir>:
|
||||
|
||||
`mvn install`
|
||||
`mvn package`
|
||||
|
||||
Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapping.war will be generated.
|
||||
Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapping*.war will be generated.
|
||||
|
||||
### Testing
|
||||
|
||||
The previously generated war can be deployed locally executing within the directory <project-dir>/wise-webapp the following command:
|
||||
|
||||
`mvn jetty:run-war`
|
||||
`cd wise-webapp;mvn jetty:run-war`
|
||||
|
||||
This will start the application on the URL: http://localhost:8080/wise-webapp/. Additionally, a file based database is automatically populated with a test user.
|
||||
This will start the application on the URL: [http://localhost:8080/wise-webapp/]. Additionally, a file based database is automatically populated with a test user.
|
||||
|
||||
User: test@wisemapping.org
|
||||
|
||||
Password: test
|
||||
|
||||
## Running the JS only version
|
||||
|
||||
Start by creating the .zip file:
|
||||
Start by creating the .zip file:
|
||||
|
||||
`mvn assembly:assembly -Dmaven.test.skip=true`
|
||||
|
||||
To test the javascript frontend you then do:
|
||||
|
||||
unzip target/wisemapping-3.0-SNAPSHOT-editor.zip
|
||||
cd target/wisemapping-3.0-SNAPSHOT-editor
|
||||
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>".").start'
|
||||
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>".").start'
|
||||
|
||||
Now open a browser using the URL http://localhost:8000/
|
||||
Now open a browser using the URL http://localhost:8000/wise-editor/src/main/webapp/
|
||||
|
||||
### Attaching drag and drop events.
|
||||
## Members
|
||||
|
||||
1) Support for dragging TextNodes:
|
||||
### Founders
|
||||
|
||||
The following code is an example of how to add attach to the div dragImageNode the support for node dragging.
|
||||
|
||||
$("dragTextNode").addEvent('mousedown', function(event) {
|
||||
event.preventDefault();
|
||||
* Pablo Luna <pveiga@wisemapping.com>
|
||||
* Paulo Veiga <pablo@wisemapping.com>
|
||||
|
||||
// Create a image node ...
|
||||
var mindmap = designer.getMindmap();
|
||||
var node = mindmap.createNode();
|
||||
node.setText("Node Text !!!!");
|
||||
node.setMetadata("{'media':'test'}");
|
||||
node.setShapeType(mindplot.model.TopicShape.RECTANGLE);
|
||||
### Individual Controbutors
|
||||
|
||||
// Add link ...
|
||||
var link = node.createFeature(mindplot.TopicFeature.Link.id, {url:"http://www.wisemapping.com"});
|
||||
node.addFeature(link);
|
||||
* Ezequiel Bergamaschi <ezequielbergamaschi@gmail.com>
|
||||
* Claudio Barril <claudiobarril@gmail.com>
|
||||
|
||||
// Add Note ...
|
||||
var note = node.createFeature(mindplot.TopicFeature.Note.id, {text:"This is a note"});
|
||||
node.addFeature(note);
|
||||
### Past Individual Contributors
|
||||
|
||||
designer.addDraggedNode(event, node);
|
||||
});
|
||||
|
||||
In the example, a new node is created with text "Node Text !!!!" and a note and a link associated to it when the user drop the node. Something to pay attention is the node.setMetadata("{}"), this attributes will be persisted during the serialization. Here you can store all the data you need.
|
||||
|
||||
2) Support for dragging Images: Similar to the point 1,drag support is registered to the div dragImageNode.
|
||||
|
||||
$("dragImageNode").addEvent('mousedown', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
// Create a image node ...
|
||||
var mindmap = designer.getMindmap();
|
||||
var node = mindmap.createNode();
|
||||
node.setImageSize(80, 43);
|
||||
node.setMetadata("{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}");
|
||||
node.setImageUrl("images/logo-small.png");
|
||||
node.setShapeType(mindplot.model.TopicShape.IMAGE);
|
||||
|
||||
designer.addDraggedNode(event, node);
|
||||
});
|
||||
|
||||
The node.setShapeType(mindplot.model.TopicShape.IMAGE) defines a image node. This makes mandatory the set of setImageUrl and setImageSize properties in the node.
|
||||
|
||||
3) An event registration mechanism for Image nodes edit events: The next snipped show how to register a custom edition handler.
|
||||
|
||||
designer.addEvent("editnode", function(event) {
|
||||
var node = event.model;
|
||||
|
||||
alert("Node Id:" + node.getId());
|
||||
alert("Node Metadata:" + node.getMetadata());
|
||||
alert("Is Read Only:" + event.readOnly);
|
||||
} });
|
||||
|
||||
|
||||
|
||||
## Author
|
||||
|
||||
* Pablo Luna
|
||||
* Paulo Veiga
|
||||
* Ignacio Manzano
|
||||
* Nicolas Damonte
|
||||
|
||||
|
||||
## License
|
||||
|
||||
The source code is Licensed under the WiseMapping Open License, Version 1.0 (the “License”);
|
||||
|
||||
You may obtain a copy of the License at: http://www.wisemapping.org/license
|
||||
You may obtain a copy of the License at: [https://wisemapping.atlassian.net/wiki/display/WS/License]
|
||||
|
47
config/database/hsql/apopulate-schemas.sql
Normal file
47
config/database/hsql/apopulate-schemas.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURDATE(), 1,'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (2, 'Admin', 'User', 'admin', 1237, CURDATE(), 1,'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (3, 'homer@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (3, 'Homer', 'Simpson', 'homer', 1237, CURDATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (4, 'marge@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (4, 'Marge', 'Bouvier', 'marge', 1237, CURDATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (5, 'bart@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (5, 'Bart', 'Simpson', 'bart', 1237, CURDATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (6, 'lisa@wisemapping.org', CURDATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (6, 'Lisa', 'Simpson', 'lisa', 1237, CURDATE(), 1, 'D');
|
||||
|
||||
INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition_date, creator_id, tags, last_editor_id)
|
||||
VALUES (1, 'Welcome Test', x'504B0304140008080800ED036F4400000000000000000000000007000000636F6E74656E74AD57DD8EDA3814BEEF53B8E9452F360CF985B0C0542C43D5B960355259ED45558D9CC464AC3176E43843A76FB3CFD0479817DB1393F0938442871A09417EFC7DE7F83BDFB1472B9C228E57646CE4194E88819E88CCA8E06343619E08E3FA0D82315222A5118A08571233B827737854916F6A6C4CC54A20F822FC3B96E88381683C366C032D05579FD53383A987C377448FE17068A030990A26E4D8786761F8042586C6A191E07A828C26FCFE81B0D4E8EEDDDED048454695E668F76DB3E3590612322630A35591BA93F02489714C321413B478F9012F8AAC24D760E7E95163E7F856485C638B5E8E506EE90796EF0FF6E8B78410611E11B61F446B20CEC0373B03671B885D053249244920AF7F0B854BFAAE5D83D43372A1C8F5E8ED97E9CD6431F932CB9440107BCEB17E15BDFDFAF57AD4D50F1D32E96A2A27E8B90EE4D9B68366A22B7E33CE70048018DDE184729CA17F49B8E1DB3F9EED963818E58F289720B207A5D23FBBDDF57A7D9508913072158915E03EA7855A6533A9E785625B108AB78DC4AD2299E74CD194410C903CCA8416CEC71C244F1A1A28865E0AA72D843AA46739ED2AD5422A17D5AD6769B9B4601459EA9E8B61BB4D0195C194287E0D65180A160FA9C28C46E70259A6BD13AA53E12C687A90B20D5EEF006F4157241BF6862D419DB97810A5BB53A157817F14720592BBA14B220B7408377BC0854E24891406ED6CF804AD2B794C9DA78B36303BBD5E3317B7600155CA3DB74D225B935842D5DCAF41F32713D2BC50E7D3B18343423B11C434A22F3F38FA27C33C0667606841228663B121E938C76BB4E17F5B83C4716C2FFB47FDEF01CBF8FE913C87027E9C4C66C7F582C26306FB65A2B9F57EC93F8A80773E38174F4411702725775D00BA15473386A6B9CC84D4C6A8DF7A85203BAE0FCE18047B296F53D8B653D2A24B8249CEB248D2904A704B09FF62A84009660DABF24D556BE2FD56B102D3BED9290CA06E7C7792141DBF303E281D89D28252E5EB05A74DDAD0270245C6C5513374EAE6F24BECFA60CBBD165F29D96134559275E744E13FDA697ECEC38AEA718ACD767E614EA16DB7F8D1FCE5BF0C7DB8429FA0BA5104DEFA882847EF2711B4C8C22569614B227B8FB00419E0CD82FBD6C15EE764B9DBAE670E5A32063283DC285A76969F94CF5E2DC35E295C2EEBB5DC703CDF357B7EB391DDF22750309AAC68228A3D00CC8A4321714961F07A61384ECF6CDB17CD562109410584A3BF9848AA9D9D750112D4C7BEFDEC149887B08218A91CCD715AEDC2ECF3D47E8E6BF703B36F37EB529BB6D87AF65CE459D9C65EE5D6F120F4EDE0E76EBDD218A765EFF44DC7A91BB577814FDF88901134D595024BBAE73AE99E416A77BCD0AF3DDBF4FBFB7AD2FB94DF475DF39D4A52D02DFBCD858C21D98765AECDE202C61329710607B95D43D4A4EF00B3101CBEB425BA3DD821BA4D418390F5CE43081656D6E0F48F56CBE11F49182E00B2079AA24C468BE2DE6DB97781639EDA5D30101C22C8429F13009CF0182216EBEAD89A819454796589D946F0A32E9C84AFDFFC0F504B070890C15C185C040000100F0000504B01021400140008080800ED036F4490C15C185C040000100F0000070000000000000000000000000000000000636F6E74656E74504B0506000000000100010035000000910400000000', '', 0, now(), now(), 1, NULL, 1);
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (1, 0, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (1, 1, 1, 1, 0);
|
||||
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (2, 1, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (2, 2, 2, 1, 1);
|
||||
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (1, 'test label', 1, NULL, '#ff0000', 'glyphicon glyphicon-tag');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (1,1);
|
||||
|
||||
INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition_date, creator_id, tags, last_editor_id)
|
||||
VALUES (2, 'Welcome Admin', x'504B0304140008080800ED036F4400000000000000000000000007000000636F6E74656E74AD57DD8EDA3814BEEF53B8E9452F360CF985B0C0542C43D5B960355259ED45558D9CC464AC3176E43843A76FB3CFD0479817DB1393F0938442871A09417EFC7DE7F83BDFB1472B9C228E57646CE4194E88819E88CCA8E06343619E08E3FA0D82315222A5118A08571233B827737854916F6A6C4CC54A20F822FC3B96E88381683C366C032D05579FD53383A987C377448FE17068A030990A26E4D8786761F8042586C6A191E07A828C26FCFE81B0D4E8EEDDDED048454695E668F76DB3E3590612322630A35591BA93F02489714C321413B478F9012F8AAC24D760E7E95163E7F856485C638B5E8E506EE90796EF0FF6E8B78410611E11B61F446B20CEC0373B03671B885D053249244920AF7F0B854BFAAE5D83D43372A1C8F5E8ED97E9CD6431F932CB9440107BCEB17E15BDFDFAF57AD4D50F1D32E96A2A27E8B90EE4D9B68366A22B7E33CE70048018DDE184729CA17F49B8E1DB3F9EED963818E58F289720B207A5D23FBBDDF57A7D9508913072158915E03EA7855A6533A9E785625B108AB78DC4AD2299E74CD194410C903CCA8416CEC71C244F1A1A28865E0AA72D843AA46739ED2AD5422A17D5AD6769B9B4601459EA9E8B61BB4D0195C194287E0D65180A160FA9C28C46E70259A6BD13AA53E12C687A90B20D5EEF006F4157241BF6862D419DB97810A5BB53A157817F14720592BBA14B220B7408377BC0854E24891406ED6CF804AD2B794C9DA78B36303BBD5E3317B7600155CA3DB74D225B935842D5DCAF41F32713D2BC50E7D3B18343423B11C434A22F3F38FA27C33C0667606841228663B121E938C76BB4E17F5B83C4716C2FFB47FDEF01CBF8FE913C87027E9C4C66C7F582C26306FB65A2B9F57EC93F8A80773E38174F4411702725775D00BA15473386A6B9CC84D4C6A8DF7A85203BAE0FCE18047B296F53D8B653D2A24B8249CEB248D2904A704B09FF62A84009660DABF24D556BE2FD56B102D3BED9290CA06E7C7792141DBF303E281D89D28252E5EB05A74DDAD0270245C6C5513374EAE6F24BECFA60CBBD165F29D96134559275E744E13FDA697ECEC38AEA718ACD767E614EA16DB7F8D1FCE5BF0C7DB8429FA0BA5104DEFA882847EF2711B4C8C22569614B227B8FB00419E0CD82FBD6C15EE764B9DBAE670E5A32063283DC285A76969F94CF5E2DC35E295C2EEBB5DC703CDF357B7EB391DDF22750309AAC68228A3D00CC8A4321714961F07A61384ECF6CDB17CD562109410584A3BF9848AA9D9D750112D4C7BEFDEC149887B08218A91CCD715AEDC2ECF3D47E8E6BF703B36F37EB529BB6D87AF65CE459D9C65EE5D6F120F4EDE0E76EBDD218A765EFF44DC7A91BB577814FDF88901134D595024BBAE73AE99E416A77BCD0AF3DDBF4FBFB7AD2FB94DF475DF39D4A52D02DFBCD858C21D98765AECDE202C61329710607B95D43D4A4EF00B3101CBEB425BA3DD821BA4D418390F5CE43081656D6E0F48F56CBE11F49182E00B2079AA24C468BE2DE6DB97781639EDA5D30101C22C8429F13009CF0182216EBEAD89A819454796589D946F0A32E9C84AFDFFC0F504B070890C15C185C040000100F0000504B01021400140008080800ED036F4490C15C185C040000100F0000070000000000000000000000000000000000636F6E74656E74504B0506000000000100010035000000910400000000', 'This is a short description', 0, now(), now(), 2, NULL, 2);
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (3, 1, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (3, 2, 3, 2, 0);
|
||||
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (2, 'admin label', 2, NULL, '#0000ff', 'glyphicon glyphicon-star');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (2,2);
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (3, 'mindmap shared', 2, NULL, '#00ff00', 'glyphicon glyphicon-share');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (3,1);
|
||||
|
||||
COMMIT;
|
||||
SHUTDOWN;
|
96
config/database/hsql/create-schemas.sql
Normal file
96
config/database/hsql/create-schemas.sql
Normal file
@@ -0,0 +1,96 @@
|
||||
CREATE TABLE COLLABORATOR (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
email VARCHAR(255) NOT NULL,
|
||||
creation_date DATE
|
||||
);
|
||||
|
||||
CREATE TABLE USER (
|
||||
colaborator_id INTEGER NOT NULL IDENTITY,
|
||||
authentication_type CHAR(1) NOT NULL,
|
||||
authenticator_uri VARCHAR(255) NULL,
|
||||
firstname VARCHAR(255) NOT NULL,
|
||||
lastname VARCHAR(255) NOT NULL,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
activation_code BIGINT NOT NULL,
|
||||
activation_date DATE,
|
||||
allow_send_email CHAR(1) NOT NULL,
|
||||
locale VARCHAR(5),
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id)
|
||||
);
|
||||
|
||||
CREATE TABLE MINDMAP (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
description VARCHAR(255) NOT NULL,
|
||||
xml LONGVARBINARY NOT NULL,
|
||||
public BOOLEAN NOT NULL,
|
||||
creation_date DATETIME,
|
||||
edition_date DATETIME,
|
||||
creator_id INTEGER NOT NULL,
|
||||
tags VARCHAR(1014),
|
||||
last_editor_id INTEGER NOT NULL
|
||||
--FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id)
|
||||
);
|
||||
|
||||
CREATE TABLE LABEL (
|
||||
id INTEGER NOT NULL PRIMARY KEY IDENTITY,
|
||||
title VARCHAR(30),
|
||||
creator_id INTEGER NOT NULL,
|
||||
parent_label_id INTEGER,
|
||||
color VARCHAR(7) NOT NULL,
|
||||
iconName VARCHAR(50) NOT NULL
|
||||
--FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id)
|
||||
);
|
||||
|
||||
CREATE TABLE R_LABEL_MINDMAP (
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
label_id INTEGER NOT NULL,
|
||||
PRIMARY KEY (mindmap_id, label_id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id),
|
||||
FOREIGN KEY (label_id) REFERENCES LABEL (id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
CREATE TABLE MINDMAP_HISTORY (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
xml LONGVARBINARY NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
creation_date DATETIME,
|
||||
editor_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id)
|
||||
);
|
||||
|
||||
CREATE TABLE COLLABORATION_PROPERTIES (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
starred BOOLEAN NOT NULL,
|
||||
mindmap_properties VARCHAR(512)
|
||||
);
|
||||
|
||||
CREATE TABLE COLLABORATION (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
colaborator_id INTEGER NOT NULL,
|
||||
properties_id INTEGER NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
role_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id),
|
||||
FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE TAG (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
user_id INTEGER NOT NULL,
|
||||
--FOREIGN KEY(user_id) REFERENCES USER(colaborator_id)
|
||||
);
|
||||
|
||||
CREATE TABLE ACCESS_AUDITORY (
|
||||
id INTEGER NOT NULL IDENTITY,
|
||||
user_id INTEGER NOT NULL,
|
||||
login_date DATE,
|
||||
FOREIGN KEY (user_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
COMMIT;
|
11
config/database/hsql/drop-schemas.sql
Normal file
11
config/database/hsql/drop-schemas.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
DROP TABLE IF EXISTS ACCESS_AUDITORY;
|
||||
DROP TABLE IF EXISTS TAG;
|
||||
DROP TABLE IF EXISTS COLLABORATION;
|
||||
DROP TABLE IF EXISTS COLLABORATION_PROPERTIES;
|
||||
DROP TABLE IF EXISTS MINDMAP_HISTORY;
|
||||
DROP TABLE IF EXISTS R_LABEL_MINDMAP;
|
||||
DROP TABLE IF EXISTS LABEL;
|
||||
DROP TABLE IF EXISTS MINDMAP;
|
||||
DROP TABLE IF EXISTS USER;
|
||||
DROP TABLE IF EXISTS COLLABORATOR;
|
||||
COMMIT;
|
50
config/database/mysql/apopulate-schemas.sql
Normal file
50
config/database/mysql/apopulate-schemas.sql
Normal file
@@ -0,0 +1,50 @@
|
||||
#
|
||||
# Command: mysql -u root -p < apopulate_schemas.sql
|
||||
#
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (2, 'Admin', 'User', 'admin', 1237, CURRENT_DATE(), 1,'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (3, 'homer@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (3, 'Homer', 'Simpson', 'homer', 1237, CURRENT_DATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (4, 'marge@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (4, 'Marge', 'Bouvier', 'marge', 1237, CURRENT_DATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (5, 'bart@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (5, 'Bart', 'Simpson', 'bart', 1237, CURRENT_DATE(), 1, 'D');
|
||||
|
||||
INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (6, 'lisa@wisemapping.org', CURRENT_DATE());
|
||||
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type)
|
||||
VALUES (6, 'Lisa', 'Simpson', 'lisa', 1237, CURRENT_DATE(), 1, 'D');
|
||||
|
||||
INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition_date, creator_id, tags, last_editor_id)
|
||||
VALUES (1, 'Welcome Test', 0x504B0304140008080800ED036F4400000000000000000000000007000000636F6E74656E74AD57DD8EDA3814BEEF53B8E9452F360CF985B0C0542C43D5B960355259ED45558D9CC464AC3176E43843A76FB3CFD0479817DB1393F0938442871A09417EFC7DE7F83BDFB1472B9C228E57646CE4194E88819E88CCA8E06343619E08E3FA0D82315222A5118A08571233B827737854916F6A6C4CC54A20F822FC3B96E88381683C366C032D05579FD53383A987C377448FE17068A030990A26E4D8786761F8042586C6A191E07A828C26FCFE81B0D4E8EEDDDED048454695E668F76DB3E3590612322630A35591BA93F02489714C321413B478F9012F8AAC24D760E7E95163E7F856485C638B5E8E506EE90796EF0FF6E8B78410611E11B61F446B20CEC0373B03671B885D053249244920AF7F0B854BFAAE5D83D43372A1C8F5E8ED97E9CD6431F932CB9440107BCEB17E15BDFDFAF57AD4D50F1D32E96A2A27E8B90EE4D9B68366A22B7E33CE70048018DDE184729CA17F49B8E1DB3F9EED963818E58F289720B207A5D23FBBDDF57A7D9508913072158915E03EA7855A6533A9E785625B108AB78DC4AD2299E74CD194410C903CCA8416CEC71C244F1A1A28865E0AA72D843AA46739ED2AD5422A17D5AD6769B9B4601459EA9E8B61BB4D0195C194287E0D65180A160FA9C28C46E70259A6BD13AA53E12C687A90B20D5EEF006F4157241BF6862D419DB97810A5BB53A157817F14720592BBA14B220B7408377BC0854E24891406ED6CF804AD2B794C9DA78B36303BBD5E3317B7600155CA3DB74D225B935842D5DCAF41F32713D2BC50E7D3B18343423B11C434A22F3F38FA27C33C0667606841228663B121E938C76BB4E17F5B83C4716C2FFB47FDEF01CBF8FE913C87027E9C4C66C7F582C26306FB65A2B9F57EC93F8A80773E38174F4411702725775D00BA15473386A6B9CC84D4C6A8DF7A85203BAE0FCE18047B296F53D8B653D2A24B8249CEB248D2904A704B09FF62A84009660DABF24D556BE2FD56B102D3BED9290CA06E7C7792141DBF303E281D89D28252E5EB05A74DDAD0270245C6C5513374EAE6F24BECFA60CBBD165F29D96134559275E744E13FDA697ECEC38AEA718ACD767E614EA16DB7F8D1FCE5BF0C7DB8429FA0BA5104DEFA882847EF2711B4C8C22569614B227B8FB00419E0CD82FBD6C15EE764B9DBAE670E5A32063283DC285A76969F94CF5E2DC35E295C2EEBB5DC703CDF357B7EB391DDF22750309AAC68228A3D00CC8A4321714961F07A61384ECF6CDB17CD562109410584A3BF9848AA9D9D750112D4C7BEFDEC149887B08218A91CCD715AEDC2ECF3D47E8E6BF703B36F37EB529BB6D87AF65CE459D9C65EE5D6F120F4EDE0E76EBDD218A765EFF44DC7A91BB577814FDF88901134D595024BBAE73AE99E416A77BCD0AF3DDBF4FBFB7AD2FB94DF475DF39D4A52D02DFBCD858C21D98765AECDE202C61329710607B95D43D4A4EF00B3101CBEB425BA3DD821BA4D418390F5CE43081656D6E0F48F56CBE11F49182E00B2079AA24C468BE2DE6DB97781639EDA5D30101C22C8429F13009CF0182216EBEAD89A819454796589D946F0A32E9C84AFDFFC0F504B070890C15C185C040000100F0000504B01021400140008080800ED036F4490C15C185C040000100F0000070000000000000000000000000000000000636F6E74656E74504B0506000000000100010035000000910400000000, '', 0, now(), now(), 1, NULL, 1);
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (1, 0, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (1, 1, 1, 1, 0);
|
||||
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (2, 1, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (2, 2, 2, 1, 1);
|
||||
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (1, 'test label', 1, NULL, '#ff0000', 'glyphicon glyphicon-tag');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (1,1);
|
||||
|
||||
INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition_date, creator_id, tags, last_editor_id)
|
||||
VALUES (2, 'Welcome Admin', 0x504B0304140008080800ED036F4400000000000000000000000007000000636F6E74656E74AD57DD8EDA3814BEEF53B8E9452F360CF985B0C0542C43D5B960355259ED45558D9CC464AC3176E43843A76FB3CFD0479817DB1393F0938442871A09417EFC7DE7F83BDFB1472B9C228E57646CE4194E88819E88CCA8E06343619E08E3FA0D82315222A5118A08571233B827737854916F6A6C4CC54A20F822FC3B96E88381683C366C032D05579FD53383A987C377448FE17068A030990A26E4D8786761F8042586C6A191E07A828C26FCFE81B0D4E8EEDDDED048454695E668F76DB3E3590612322630A35591BA93F02489714C321413B478F9012F8AAC24D760E7E95163E7F856485C638B5E8E506EE90796EF0FF6E8B78410611E11B61F446B20CEC0373B03671B885D053249244920AF7F0B854BFAAE5D83D43372A1C8F5E8ED97E9CD6431F932CB9440107BCEB17E15BDFDFAF57AD4D50F1D32E96A2A27E8B90EE4D9B68366A22B7E33CE70048018DDE184729CA17F49B8E1DB3F9EED963818E58F289720B207A5D23FBBDDF57A7D9508913072158915E03EA7855A6533A9E785625B108AB78DC4AD2299E74CD194410C903CCA8416CEC71C244F1A1A28865E0AA72D843AA46739ED2AD5422A17D5AD6769B9B4601459EA9E8B61BB4D0195C194287E0D65180A160FA9C28C46E70259A6BD13AA53E12C687A90B20D5EEF006F4157241BF6862D419DB97810A5BB53A157817F14720592BBA14B220B7408377BC0854E24891406ED6CF804AD2B794C9DA78B36303BBD5E3317B7600155CA3DB74D225B935842D5DCAF41F32713D2BC50E7D3B18343423B11C434A22F3F38FA27C33C0667606841228663B121E938C76BB4E17F5B83C4716C2FFB47FDEF01CBF8FE913C87027E9C4C66C7F582C26306FB65A2B9F57EC93F8A80773E38174F4411702725775D00BA15473386A6B9CC84D4C6A8DF7A85203BAE0FCE18047B296F53D8B653D2A24B8249CEB248D2904A704B09FF62A84009660DABF24D556BE2FD56B102D3BED9290CA06E7C7792141DBF303E281D89D28252E5EB05A74DDAD0270245C6C5513374EAE6F24BECFA60CBBD165F29D96134559275E744E13FDA697ECEC38AEA718ACD767E614EA16DB7F8D1FCE5BF0C7DB8429FA0BA5104DEFA882847EF2711B4C8C22569614B227B8FB00419E0CD82FBD6C15EE764B9DBAE670E5A32063283DC285A76969F94CF5E2DC35E295C2EEBB5DC703CDF357B7EB391DDF22750309AAC68228A3D00CC8A4321714961F07A61384ECF6CDB17CD562109410584A3BF9848AA9D9D750112D4C7BEFDEC149887B08218A91CCD715AEDC2ECF3D47E8E6BF703B36F37EB529BB6D87AF65CE459D9C65EE5D6F120F4EDE0E76EBDD218A765EFF44DC7A91BB577814FDF88901134D595024BBAE73AE99E416A77BCD0AF3DDBF4FBFB7AD2FB94DF475DF39D4A52D02DFBCD858C21D98765AECDE202C61329710607B95D43D4A4EF00B3101CBEB425BA3DD821BA4D418390F5CE43081656D6E0F48F56CBE11F49182E00B2079AA24C468BE2DE6DB97781639EDA5D30101C22C8429F13009CF0182216EBEAD89A819454796589D946F0A32E9C84AFDFFC0F504B070890C15C185C040000100F0000504B01021400140008080800ED036F4490C15C185C040000100F0000070000000000000000000000000000000000636F6E74656E74504B0506000000000100010035000000910400000000, 'This is a short description', 0, now(), now(), 2, NULL, 2);
|
||||
INSERT INTO COLLABORATION_PROPERTIES (id, starred, mindmap_properties) VALUES (3, 1, '{zoom:0.8}');
|
||||
INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_id) VALUES (3, 2, 3, 2, 0);
|
||||
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (2, 'admin label', 2, NULL, '#0000ff', 'glyphicon glyphicon-star');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (2,2);
|
||||
INSERT INTO LABEL (id, title, creator_id, parent_label_id, color, iconName) VALUES (3, 'mindmap shared', 2, NULL, '#00ff00', 'glyphicon glyphicon-share');
|
||||
INSERT INTO R_LABEL_MINDMAP (label_id, mindmap_id) VALUES (3,1);
|
||||
|
||||
COMMIT;
|
10
config/database/mysql/create-database.sql
Normal file
10
config/database/mysql/create-database.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Command: mysql -u root -p < create_database.sql
|
||||
#
|
||||
DROP DATABASE IF EXISTS wisemapping;
|
||||
|
||||
CREATE DATABASE IF NOT EXISTS wisemapping
|
||||
CHARACTER SET = 'utf8'
|
||||
COLLATE = 'utf8_unicode_ci';
|
||||
GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost';
|
||||
SET PASSWORD FOR 'wisemapping'@'localhost' = PASSWORD('password');
|
137
config/database/mysql/create-schemas.sql
Normal file
137
config/database/mysql/create-schemas.sql
Normal file
@@ -0,0 +1,137 @@
|
||||
#
|
||||
# Command: mysql -u root -p < create_schemas.sql
|
||||
#
|
||||
|
||||
USE wisemapping;
|
||||
|
||||
CREATE TABLE COLLABORATOR (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
email VARCHAR(255)
|
||||
CHARACTER SET utf8 NOT NULL UNIQUE,
|
||||
creation_date DATE
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE USER (
|
||||
colaborator_id INTEGER NOT NULL PRIMARY KEY,
|
||||
authentication_type CHAR(1)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
authenticator_uri VARCHAR(255)
|
||||
CHARACTER SET utf8,
|
||||
firstname VARCHAR(255) CHARACTER SET utf8 NOT NULL,
|
||||
lastname VARCHAR(255) CHARACTER SET utf8 NOT NULL,
|
||||
password VARCHAR(255) CHARACTER SET utf8 NOT NULL,
|
||||
activation_code BIGINT(20) NOT NULL,
|
||||
activation_date DATE,
|
||||
allow_send_email CHAR(1) CHARACTER SET utf8 NOT NULL DEFAULT 0,
|
||||
locale VARCHAR(5),
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE MINDMAP (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
title VARCHAR(255)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
description VARCHAR(255)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
xml MEDIUMBLOB NOT NULL,
|
||||
public BOOL NOT NULL DEFAULT 0,
|
||||
creation_date DATETIME,
|
||||
edition_date DATETIME,
|
||||
creator_id INTEGER NOT NULL,
|
||||
tags VARCHAR(1014)
|
||||
CHARACTER SET utf8,
|
||||
last_editor_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE LABEL (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
title VARCHAR(30)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
creator_id INTEGER NOT NULL,
|
||||
parent_label_id INTEGER,
|
||||
color VARCHAR(7) NOT NULL,
|
||||
iconName VARCHAR(50) NOT NULL,
|
||||
FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id),
|
||||
FOREIGN KEY (parent_label_id) REFERENCES LABEL (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE R_LABEL_MINDMAP (
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
label_id INTEGER NOT NULL,
|
||||
PRIMARY KEY (mindmap_id, label_id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id),
|
||||
FOREIGN KEY (label_id) REFERENCES LABEL (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE MINDMAP_HISTORY
|
||||
(id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
xml MEDIUMBLOB NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
creation_date DATETIME,
|
||||
editor_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE COLLABORATION_PROPERTIES (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
starred BOOL NOT NULL DEFAULT 0,
|
||||
mindmap_properties VARCHAR(512)
|
||||
CHARACTER SET utf8
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE COLLABORATION (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
colaborator_id INTEGER NOT NULL,
|
||||
properties_id INTEGER NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
role_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION,
|
||||
FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE TAG (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
name VARCHAR(255)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
user_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (user_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE ACCESS_AUDITORY (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
login_date DATE,
|
||||
user_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (user_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
COMMIT;
|
11
config/database/mysql/drop-schemas.sql
Normal file
11
config/database/mysql/drop-schemas.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
DROP TABLE IF EXISTS TAG;
|
||||
DROP TABLE IF EXISTS ACCESS_AUDITORY;
|
||||
DROP TABLE IF EXISTS COLLABORATION;
|
||||
DROP TABLE IF EXISTS COLLABORATION_PROPERTIES;
|
||||
DROP TABLE IF EXISTS MINDMAP_HISTORY;
|
||||
DROP TABLE IF EXISTS LABEL;
|
||||
DROP TABLE IF EXISTS MINDMAP;
|
||||
DROP TABLE IF EXISTS R_LABEL_MINDMAP
|
||||
DROP TABLE IF EXISTS USER;
|
||||
DROP TABLE IF EXISTS COLLABORATOR;
|
||||
COMMIT;
|
57
config/database/mysql/v2.0-to-v3.0.sql
Normal file
57
config/database/mysql/v2.0-to-v3.0.sql
Normal file
@@ -0,0 +1,57 @@
|
||||
CREATE TABLE COLLABORATION_PROPERTIES (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
starred BOOL NOT NULL DEFAULT 0,
|
||||
mindmap_properties VARCHAR(512)
|
||||
CHARACTER SET utf8
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
DROP TABLE `MINDMAP_NATIVE`;
|
||||
ALTER TABLE `MINDMAP_COLABORATOR` RENAME TO `COLLABORATION`;
|
||||
ALTER TABLE `COLABORATOR` RENAME TO `COLLABORATOR`;
|
||||
|
||||
ALTER TABLE `MINDMAP` DROP COLUMN `editor_properties`, DROP COLUMN `mindMapNative_id`;
|
||||
|
||||
ALTER TABLE `MINDMAP` CHANGE COLUMN `owner_id` `creator_id` INT(11) NOT NULL
|
||||
, DROP INDEX `owner_id`
|
||||
, ADD INDEX `owner_id` (`creator_id` ASC);
|
||||
|
||||
ALTER TABLE `COLLABORATION` ADD COLUMN `properties_id` INT(11) NULL DEFAULT NULL
|
||||
AFTER `role_id`;
|
||||
DROP TABLE USER_LOGIN;
|
||||
|
||||
CREATE TABLE ACCESS_AUDITORY (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
user_id INTEGER NOT NULL,
|
||||
login_date DATE
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
#ALTER TABLE ACCESS_AUDITORY
|
||||
# ADD CONSTRAINT `user_id`
|
||||
# FOREIGN KEY ()
|
||||
# REFERENCES `USER` ()
|
||||
# ON DELETE CASCADE
|
||||
# ON UPDATE NO ACTION
|
||||
#, ADD INDEX `user_id` () ;
|
||||
|
||||
ALTER TABLE `MINDMAP_HISTORY` DROP COLUMN `creator_user`, ADD COLUMN `editor_id` INT(11) NULL DEFAULT NULL AFTER `creation_date`;
|
||||
|
||||
ALTER TABLE `USER` ADD COLUMN `locale` VARCHAR(5) NULL
|
||||
AFTER `allowSendEmail`;
|
||||
|
||||
ALTER TABLE `MINDMAP` DROP COLUMN `last_editor`, ADD COLUMN `last_editor_id` INT(11) NULL DEFAULT 2
|
||||
AFTER `tags`;
|
||||
|
||||
ALTER TABLE `USER` DROP COLUMN `username`, CHANGE COLUMN `activationCode` `activation_code` BIGINT(20) NOT NULL, CHANGE COLUMN `allowSendEmail` `allow_send_email` CHAR(1) NOT NULL DEFAULT '0';
|
||||
|
||||
INSERT INTO `MINDMAP` (`last_editor_id`) VALUES (1);
|
||||
|
||||
INSERT INTO `COLLABORATOR` (`id`, `email`, `creation_date`) VALUES (8081, 'migfake@wis.com', '2007-10-09');
|
||||
DELETE FROM `USER`
|
||||
WHERE activation_date IS null;
|
||||
DROP TABLE FEEDBACK;
|
||||
|
||||
|
||||
ALTER TABLE `MINDMAP` CHANGE COLUMN `XML` `XML` MEDIUMBLOB NULL DEFAULT NULL;
|
||||
ALTER TABLE `MINDMAP_HISTORY` CHANGE COLUMN `XML` `XML` MEDIUMBLOB NULL DEFAULT NULL;
|
5
config/database/mysql/v3.0-to-v3.1.sql
Normal file
5
config/database/mysql/v3.0-to-v3.1.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE `USER` ADD COLUMN `authentication_type` CHAR(1) CHARACTER SET utf8 NOT NULL DEFAULT 'D'
|
||||
AFTER `colaborator_id`;
|
||||
|
||||
ALTER TABLE `USER` ADD COLUMN `authenticator_uri` VARCHAR(255) CHARACTER SET utf8
|
||||
AFTER `authentication_type`;
|
34
config/database/mysql/v3.1-to-v3.3.sql
Normal file
34
config/database/mysql/v3.1-to-v3.3.sql
Normal file
@@ -0,0 +1,34 @@
|
||||
ALTER TABLE `USER` DROP COLUMN `id`;
|
||||
|
||||
ALTER TABLE `ACCESS_AUDITORY`
|
||||
ADD CONSTRAINT
|
||||
FOREIGN KEY (user_id) REFERENCES USER (colaborator_id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION;
|
||||
|
||||
CREATE TABLE LABEL (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
title VARCHAR(30)
|
||||
CHARACTER SET utf8 NOT NULL,
|
||||
creator_id INTEGER NOT NULL,
|
||||
parent_label_id INTEGER,
|
||||
color VARCHAR(7) NOT NULL,
|
||||
FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id),
|
||||
FOREIGN KEY (parent_label_id) REFERENCES LABEL (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
CREATE TABLE R_LABEL_MINDMAP (
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
label_id INTEGER NOT NULL,
|
||||
PRIMARY KEY (mindmap_id, label_id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id),
|
||||
FOREIGN KEY (label_id) REFERENCES LABEL (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE NO ACTION
|
||||
)
|
||||
CHARACTER SET utf8;
|
||||
|
||||
|
3
config/database/postgres/create-database.sql
Normal file
3
config/database/postgres/create-database.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
CREATE DATABASE wisemapping;
|
||||
CREATE USER wisemapping WITH PASSWORD 'password';
|
||||
GRANT ALL PRIVILEGES ON DATABASE wisemapping TO wisemapping;
|
96
config/database/postgres/create-schemas.sql
Normal file
96
config/database/postgres/create-schemas.sql
Normal file
@@ -0,0 +1,96 @@
|
||||
CREATE TABLE COLLABORATOR (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
email VARCHAR(255) NOT NULL UNIQUE,
|
||||
creation_date DATE
|
||||
);
|
||||
|
||||
CREATE TABLE "user" (
|
||||
authentication_type TEXT NOT NULL,
|
||||
authenticator_uri VARCHAR(255),
|
||||
colaborator_id INTEGER NOT NULL PRIMARY KEY,
|
||||
firstname VARCHAR(255) NOT NULL,
|
||||
lastname VARCHAR(255) NOT NULL,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
activation_code BIGINT NOT NULL,
|
||||
activation_date DATE,
|
||||
allow_send_email TEXT NOT NULL DEFAULT 0,
|
||||
locale VARCHAR(5),
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
CREATE TABLE LABEL (
|
||||
id INTEGER NOT NULL PRIMARY KEY,
|
||||
title VARCHAR(255),
|
||||
creator_id INTEGER NOT NULL,
|
||||
parent_label_id INTEGER,
|
||||
color VARCHAR(7) NOT NULL
|
||||
--FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id)
|
||||
);
|
||||
|
||||
CREATE TABLE R_LABEL_MINDMAP (
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
label_id INTEGER NOT NULL,
|
||||
PRIMARY KEY (mindmap_id, label_id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id),
|
||||
FOREIGN KEY (label_id) REFERENCES LABEL (id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
CREATE TABLE MINDMAP (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
description VARCHAR(255) NOT NULL,
|
||||
xml BYTEA NOT NULL,
|
||||
public BOOL NOT NULL DEFAULT FALSE,
|
||||
creation_date TIMESTAMP,
|
||||
edition_date TIMESTAMP,
|
||||
creator_id INTEGER NOT NULL,
|
||||
tags VARCHAR(1014),
|
||||
last_editor_id INTEGER NOT NULL --,
|
||||
--FOREIGN KEY(creator_id) REFERENCES "USER"(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE MINDMAP_HISTORY
|
||||
(id SERIAL NOT NULL PRIMARY KEY,
|
||||
xml BYTEA NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
creation_date TIMESTAMP,
|
||||
editor_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE COLLABORATION_PROPERTIES (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
starred BOOL NOT NULL DEFAULT FALSE,
|
||||
mindmap_properties VARCHAR(512)
|
||||
);
|
||||
|
||||
CREATE TABLE COLLABORATION (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
colaborator_id INTEGER NOT NULL,
|
||||
properties_id INTEGER NOT NULL,
|
||||
mindmap_id INTEGER NOT NULL,
|
||||
role_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id),
|
||||
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) ON DELETE CASCADE ON UPDATE NO ACTION,
|
||||
FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
CREATE TABLE TAG (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
name VARCHAR(255) NOT NULL,
|
||||
user_id INTEGER NOT NULL --,
|
||||
--FOREIGN KEY(user_id) REFERENCES "USER"(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE ACCESS_AUDITORY (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
login_date DATE,
|
||||
user_id INTEGER NOT NULL,
|
||||
FOREIGN KEY (user_id) REFERENCES "user" (colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
|
||||
);
|
||||
|
||||
|
||||
COMMIT;
|
@@ -1,9 +1,11 @@
|
||||
DROP TABLE TAG;
|
||||
DROP TABLE ACCESS_AUDITORY;
|
||||
DROP TABLE COLLABORATION;
|
||||
DROP TABLE COLLABORATION_PROPERTIES;
|
||||
DROP TABLE MINDMAP_HISTORY;
|
||||
DROP TABLE MINDMAP;
|
||||
DROP TABLE USER;
|
||||
DROP TABLE COLLABORATOR;
|
||||
DROP TABLE TAG;
|
||||
DROP TABLE ACCESS_AUDITORY;
|
||||
DROP TABLE COLLABORATION;
|
||||
DROP TABLE COLLABORATION_PROPERTIES;
|
||||
DROP TABLE MINDMAP_HISTORY;
|
||||
DROP TABLE R_LABEL_MINDMAP;
|
||||
DROP TABLE LABEL;
|
||||
DROP TABLE MINDMAP;
|
||||
DROP TABLE "user";
|
||||
DROP TABLE COLLABORATOR;
|
||||
COMMIT;
|
@@ -9,7 +9,7 @@
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -13,15 +13,9 @@ $defined = function (obj) {
|
||||
|
||||
$assert = function (assert, message) {
|
||||
if (!$defined(assert) || !assert) {
|
||||
var stack;
|
||||
try {
|
||||
null.eval();
|
||||
} catch (e) {
|
||||
stack = e;
|
||||
}
|
||||
console.log(message + "," + stack);
|
||||
window.errorStack = stackTrace();
|
||||
throw message;
|
||||
logStackTrace();
|
||||
console.log(message);
|
||||
throw new Error(message);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -29,77 +23,35 @@ Math.sign = function (value) {
|
||||
return (value >= 0) ? 1 : -1;
|
||||
};
|
||||
|
||||
function stackTrace() {
|
||||
var result = "";
|
||||
var isCallstackPopulated = false;
|
||||
try {
|
||||
null.eval();
|
||||
} catch (e) {
|
||||
if (e.stack) { //Firefox and Chrome...
|
||||
result = e.stack;
|
||||
isCallstackPopulated = true;
|
||||
}
|
||||
else if (window.opera && e.message) { //Opera
|
||||
result = e.message;
|
||||
isCallstackPopulated = true;
|
||||
function logStackTrace(exception) {
|
||||
|
||||
if (!$defined(exception)) {
|
||||
try {
|
||||
throw Error("Unexpected Exception");
|
||||
} catch (e) {
|
||||
exception = e;
|
||||
}
|
||||
}
|
||||
var result = "";
|
||||
if (exception.stack) { //Firefox and Chrome...
|
||||
result = exception.stack;
|
||||
}
|
||||
else if (window.opera && exception.message) { //Opera
|
||||
result = exception.message;
|
||||
} else { //IE and Safari
|
||||
result = exception.sourceURL + ': ' + exception.line + "\n\n";
|
||||
|
||||
var currentFunction = arguments.callee.caller;
|
||||
while (currentFunction) {
|
||||
var fn = currentFunction.toString();
|
||||
result = result + "\n" + fn;
|
||||
currentFunction = currentFunction.caller;
|
||||
}
|
||||
}
|
||||
window.errorStack = result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* DOMParser HTML extension
|
||||
* 2012-02-02
|
||||
*
|
||||
* By Eli Grey, http://eligrey.com
|
||||
* Public domain.
|
||||
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||
*/
|
||||
|
||||
/*! @source https://gist.github.com/1129031 */
|
||||
/*global document, DOMParser*/
|
||||
|
||||
(function (DOMParser) {
|
||||
"use strict";
|
||||
|
||||
var DOMParser_proto = DOMParser.prototype , real_parseFromString = DOMParser_proto.parseFromString;
|
||||
|
||||
// Firefox/Opera/IE throw errors on unsupported types
|
||||
try {
|
||||
// WebKit returns null on unsupported types
|
||||
if ((new DOMParser).parseFromString("", "text/html")) {
|
||||
// text/html parsing is natively supported
|
||||
return;
|
||||
}
|
||||
} catch (ex) {
|
||||
}
|
||||
|
||||
DOMParser_proto.parseFromString = function (markup, type) {
|
||||
if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
|
||||
var
|
||||
doc = document.implementation.createHTMLDocument("")
|
||||
, doc_elt = doc.documentElement
|
||||
, first_elt
|
||||
;
|
||||
|
||||
doc_elt.innerHTML = markup;
|
||||
first_elt = doc_elt.firstElementChild;
|
||||
|
||||
if (// are we dealing with an entire document or a fragment?
|
||||
doc_elt.childElementCount === 1
|
||||
&& first_elt.localName.toLowerCase() === "html"
|
||||
) {
|
||||
doc.replaceChild(first_elt, doc_elt);
|
||||
}
|
||||
|
||||
return doc;
|
||||
} else {
|
||||
return real_parseFromString.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
}(DOMParser));
|
||||
|
||||
// Support for Windows ...
|
||||
if (!window.console) {
|
||||
console = {
|
||||
|
@@ -1,64 +1,61 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
core.Utils = {
|
||||
|
||||
};
|
||||
|
||||
|
||||
core.Utils.innerXML = function(/*Node*/node) {
|
||||
// summary:
|
||||
// Implementation of MS's innerXML function.
|
||||
if ($defined(node.innerXML)) {
|
||||
return node.innerXML;
|
||||
// string
|
||||
} else if ($defined(node.xml)) {
|
||||
return node.xml;
|
||||
// string
|
||||
} else if ($defined(XMLSerializer)) {
|
||||
return (new XMLSerializer()).serializeToString(node);
|
||||
// string
|
||||
}
|
||||
};
|
||||
|
||||
core.Utils.createDocument = function() {
|
||||
// summary:
|
||||
// cross-browser implementation of creating an XML document object.
|
||||
var doc = null;
|
||||
var _document = window.document;
|
||||
if ($defined(window.ActiveXObject)) {
|
||||
var prefixes = [ "MSXML2", "Microsoft", "MSXML", "MSXML3" ];
|
||||
for (var i = 0; i < prefixes.length; i++) {
|
||||
try {
|
||||
doc = new ActiveXObject(prefixes[i] + ".XMLDOM");
|
||||
} catch(e) { /* squelch */
|
||||
}
|
||||
|
||||
|
||||
if ($defined(doc)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ((_document.implementation) &&
|
||||
(_document.implementation.createDocument)) {
|
||||
doc = _document.implementation.createDocument("", "", null);
|
||||
}
|
||||
|
||||
return doc;
|
||||
// DOMDocument
|
||||
/*
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
core.Utils = {
|
||||
|
||||
};
|
||||
|
||||
|
||||
core.Utils.innerXML = function (node) {
|
||||
// summary:
|
||||
// Implementation of MS's innerXML function.
|
||||
if ($defined(node.innerXML)) {
|
||||
return node.innerXML;
|
||||
// string
|
||||
} else if ($defined(node.xml)) {
|
||||
return node.xml;
|
||||
// string
|
||||
} else if ($defined(XMLSerializer)) {
|
||||
return (new XMLSerializer()).serializeToString(node);
|
||||
// string
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Cross-browser implementation of creating an XML document object.
|
||||
*/
|
||||
core.Utils.createDocument = function () {
|
||||
var doc = null;
|
||||
if ($defined(window.ActiveXObject)) {
|
||||
//http://blogs.msdn.com/b/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx
|
||||
var progIDs = [ 'Msxml2.DOMDocument.6.0', 'Msxml2.DOMDocument.3.0'];
|
||||
for (var i = 0; i < progIDs.length; i++) {
|
||||
try {
|
||||
doc = new ActiveXObject(progIDs[i]);
|
||||
break;
|
||||
}
|
||||
catch (ex) {
|
||||
}
|
||||
}
|
||||
} else if (window.document.implementation && window.document.implementation.createDocument) {
|
||||
doc = window.document.implementation.createDocument("", "", null);
|
||||
}
|
||||
$assert(doc, "Parser could not be instantiated");
|
||||
|
||||
return doc;
|
||||
};
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<files>
|
||||
<file>
|
||||
<file>
|
||||
<source>core-js/target/classes/core.js</source>
|
||||
<outputDirectory>/js</outputDirectory>
|
||||
</file>
|
||||
@@ -14,10 +14,6 @@
|
||||
<source>mindplot/target/classes/mindplot-min.js</source>
|
||||
<outputDirectory>/js</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>mindplot/target/classes/mindplot.js</source>
|
||||
<outputDirectory>/js</outputDirectory>
|
||||
</file>
|
||||
</files>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
|
@@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
WISE_VERSION=$1
|
||||
SERVER_DOWNLOAD_DIR=/var/www/wisemapping.org/stable
|
||||
|
||||
WISE_BIN_FILE_NAME=wisemapping-${WISE_VERSION}.zip
|
||||
WISE_BIN_FILE_PATH=./target/${WISE_BIN_FILE_NAME}
|
||||
|
||||
#WISE_SRC_FILE_NAME=wisemapping-${WISE_VERSION}-src.tar.gz
|
||||
#WISE_SRC_FILE_PATH=./target/${WISE_SRC_FILE_NAME}
|
||||
|
||||
#scp ${WISE_SRC_FILE_PATH} thecrow@wisemapping.com:${SERVER_DOWNLOAD_DIR}/
|
||||
scp ${WISE_BIN_FILE_PATH} thecrow@wisemapping.com:${SERVER_DOWNLOAD_DIR}
|
||||
|
||||
# It's there ?
|
||||
cd target
|
||||
wget -S http://downloads.wisemapping.org/stable/${WISE_BIN_FILE_NAME}
|
||||
#wget -S http://downloads.wisemapping.org/stable/${WISE_SRC_FILE_NAME}
|
@@ -1,6 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
set -e
|
||||
set -u
|
||||
|
||||
@@ -9,7 +8,8 @@ BASE_DIR=`pwd`
|
||||
TARGET_DIR=$BASE_DIR/target
|
||||
JETTY_DIR=$TARGET_DIR/wisemapping-$WISE_VERSION
|
||||
WISE_WEBAPP_DIR=$JETTY_DIR/webapps/wisemapping
|
||||
JETTY_DIST_DIR=jetty-distribution-8.1.4.v20120524
|
||||
JETTY_VERSION=8.1.14.v20131031
|
||||
JETTY_DIST_DIR=jetty-distribution-${JETTY_VERSION}
|
||||
JETTY_ZIP=${JETTY_DIST_DIR}.zip
|
||||
|
||||
# Clean ...
|
||||
@@ -24,7 +24,7 @@ mvn -o -f $BASE_DIR/../pom.xml package -Dmaven.test.skip=true
|
||||
if [ ! -f ./target/${JETTY_ZIP} ]
|
||||
then
|
||||
echo "Download Jetty"
|
||||
wget http://download.eclipse.org/jetty/8.1.4.v20120524/dist/jetty-distribution-8.1.4.v20120524.zip -P $TARGET_DIR
|
||||
wget http://download.eclipse.org/jetty/${JETTY_VERSION}/dist/${JETTY_ZIP} -P $TARGET_DIR
|
||||
fi
|
||||
|
||||
echo "Unzip Jetty ...:"
|
||||
@@ -42,17 +42,17 @@ mkdir $WISE_WEBAPP_DIR
|
||||
unzip $BASE_DIR/../wise-webapp/target/wisemapping.war -d $WISE_WEBAPP_DIR >/dev/null
|
||||
|
||||
# DB Configuration ...
|
||||
sed 's/target\/db\/wisemapping/webapps\/wisemapping\/WEB-INF\/database\/wisemapping/' $WISE_WEBAPP_DIR/WEB-INF/app.properties > $WISE_WEBAPP_DIR/WEB-INF/app.properties2
|
||||
sed 's/\${database.base.url}\/db\/wisemapping/webapps\/wisemapping\/WEB-INF\/database\/wisemapping/' $WISE_WEBAPP_DIR/WEB-INF/app.properties > $WISE_WEBAPP_DIR/WEB-INF/app.properties2
|
||||
mv $WISE_WEBAPP_DIR/WEB-INF/app.properties2 $WISE_WEBAPP_DIR/WEB-INF/app.properties
|
||||
|
||||
|
||||
mkdir $WISE_WEBAPP_DIR/WEB-INF/database
|
||||
cp -r $BASE_DIR/../wise-webapp/target/db/* $WISE_WEBAPP_DIR/WEB-INF/database/
|
||||
cp $BASE_DIR/wisemapping.xml $JETTY_DIR/contexts/
|
||||
|
||||
|
||||
# Distribute scripts
|
||||
cp -r $BASE_DIR/../wise-webapp/src/test/sql $TARGET_DIR/wisemapping-$WISE_VERSION/config
|
||||
cp -r $BASE_DIR/../config/ $TARGET_DIR/wisemapping-$WISE_VERSION/config
|
||||
cp ./start.sh ${JETTY_DIR}/
|
||||
|
||||
# Store version
|
||||
echo $1 > $WISE_WEBAPP_DIR/version
|
||||
|
@@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
WISE_VERSION=$1
|
||||
TMP_DIR=/tmp/wise-src/wisemapping-src
|
||||
TAR_FILE_NAME=wisemapping-${WISE_VERSION}-src.tar.gz
|
||||
OUTPUT_DIR=`pwd`"/target"
|
||||
OUTPUT_FILE=${OUTPUT_DIR}/${TAR_FILE_NAME}
|
||||
|
||||
|
||||
# Clean all.
|
||||
cd ..
|
||||
rm -rf ${TMP_DIR}/../
|
||||
mvn clean
|
||||
|
||||
# Prepare copy
|
||||
mkdir -p ${TMP_DIR}
|
||||
rsync -aCv --exclude ".git" --exclude "wisemapping.i*" --exclude "**/*/Brix*" --exclude "**/brix" --exclude "*/*.iml" --exclude "*/wisemapping.log*" --exclude "**/.DS_Store" --exclude "*.textile" --exclude "**/.gitignore" --exclude "installer" --exclude "*/target" . ${TMP_DIR}
|
||||
|
||||
# Zip file
|
||||
[ ! -e ${OUTPUT_DIR} ] && mkdir ${OUTPUT_DIR}
|
||||
rm -f ${OUTPUT_FILE}
|
||||
|
||||
cd ${TMP_DIR}/..
|
||||
tar -cvzf ${OUTPUT_FILE} .
|
||||
|
||||
echo
|
||||
echo "#################################################################"
|
||||
echo "Zip file generated on:"${OUTPUT_FILE}
|
||||
echo "#################################################################"
|
4
distribution/start.sh
Executable file
4
distribution/start.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
java -Xmx256m -Dorg.apache.jasper.compiler.disablejsr199=true -jar start.jar
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Copyright [2011] [wisemapping]
|
||||
Copyright [2014] [wisemapping]
|
||||
|
||||
Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>3.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
@@ -140,6 +140,7 @@
|
||||
<include>Workspace.js</include>
|
||||
<include>ShrinkConnector.js</include>
|
||||
<include>DesignerKeyboard.js</include>
|
||||
<include>TopicStyle.js</include>
|
||||
<include>NodeGraph.js</include>
|
||||
<include>Topic.js</include>
|
||||
<include>CentralTopic.js</include>
|
||||
@@ -192,9 +193,7 @@
|
||||
<include>commands/AddFeatureToTopicCommand.js</include>
|
||||
<include>commands/AddRelationshipCommand.js</include>
|
||||
<include>commands/MoveControlPointCommand.js</include>
|
||||
<include>collaboration/CollaborationManager.js</include>
|
||||
<include>collaboration/framework/AbstractCollaborativeFramework.js</include>
|
||||
<include>collaboration/framework/AbstractCollaborativeModelFactory.js</include>
|
||||
<include>widget/ModalDialogNotifier.js</include>
|
||||
<include>widget/ToolbarNotifier.js</include>
|
||||
<include>widget/ToolbarItem.js</include>
|
||||
<include>widget/ToolbarPaneItem.js</include>
|
||||
@@ -226,10 +225,12 @@
|
||||
<include>layout/EventBus.js</include>
|
||||
<include>MessageBundle_en.js</include>
|
||||
<include>MessageBundle_es.js</include>
|
||||
<include>MessageBundle_de.js</include>
|
||||
<include>MessageBundle_fr.js</include>
|
||||
<include>MessageBundle_pt_BR.js</include>
|
||||
<include>MessageBundle_zh_CN.js</include>
|
||||
<include>MessageBundle_zh_TW.js</include>
|
||||
<include>MessageBundle_ca.js</include>
|
||||
<include>footer.js</include>
|
||||
</includes>
|
||||
</aggregation>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -36,29 +36,11 @@ mindplot.CentralTopic = new Class({
|
||||
return this.getPosition();
|
||||
},
|
||||
|
||||
_getInnerPadding:function () {
|
||||
return 11;
|
||||
},
|
||||
|
||||
getTopicType:function () {
|
||||
return mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE;
|
||||
},
|
||||
|
||||
setCursor:function (type) {
|
||||
type = (type == 'move') ? 'default' : type;
|
||||
this.parent(type);
|
||||
},
|
||||
|
||||
isConnectedToCentralTopic:function () {
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
_defaultShapeType:function () {
|
||||
return mindplot.model.TopicShape.ROUNDED_RECT;
|
||||
},
|
||||
|
||||
|
||||
updateTopicShape:function () {
|
||||
|
||||
},
|
||||
@@ -70,28 +52,6 @@ mindplot.CentralTopic = new Class({
|
||||
this.setPosition(zeroPoint);
|
||||
},
|
||||
|
||||
_defaultText:function () {
|
||||
return $msg('CENTRAL_TOPIC');
|
||||
},
|
||||
|
||||
_defaultBackgroundColor:function () {
|
||||
return "rgb(80,157,192)";
|
||||
},
|
||||
|
||||
_defaultBorderColor:function () {
|
||||
return "rgb(57,113,177)";
|
||||
},
|
||||
|
||||
_defaultFontStyle:function () {
|
||||
return {
|
||||
font:"Verdana",
|
||||
size:10,
|
||||
style:"normal",
|
||||
weight:"bold",
|
||||
color:"#ffffff"
|
||||
};
|
||||
},
|
||||
|
||||
getShrinkConnector:function () {
|
||||
return null;
|
||||
},
|
||||
|
@@ -1,153 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.BrixActionDispatcher = new Class({
|
||||
Extends: mindplot.ActionDispatcher,
|
||||
initialize: function(commandContext, fireOnChange) {
|
||||
this.parent(commandContext, fireOnChange);
|
||||
this._commandContext = commandContext;
|
||||
},
|
||||
|
||||
dragTopic: function(topicId, position, order, parentTopic) {
|
||||
var framework = this._getFramework();
|
||||
var node = framework.getTopic(topicId);
|
||||
|
||||
// Set node order ...
|
||||
if (order != null) {
|
||||
node.setOrder(order);
|
||||
} else if (position != null) {
|
||||
// Set position ...
|
||||
node.setPosition(position);
|
||||
} else {
|
||||
$assert("Illegal commnand state exception.");
|
||||
}
|
||||
// Finally, connect node ...
|
||||
if ($defined(this._parentId)) {
|
||||
var parentNode = topic.findTopics([this._parentId])[0];
|
||||
node.disconnect();
|
||||
node.connect(parentNode);
|
||||
}
|
||||
},
|
||||
|
||||
changeTextToTopic : function(topicsIds, text) {
|
||||
var framework = this._getFramework();
|
||||
var topicId;
|
||||
if (!(topicsIds instanceof Array)) {
|
||||
topicId = topicsIds;
|
||||
} else {
|
||||
topicId = topicsIds[0];
|
||||
}
|
||||
var node = framework.getTopic(topicId);
|
||||
node.setText(text);
|
||||
|
||||
},
|
||||
|
||||
_getFramework:function () {
|
||||
return mindplot.collaboration.CollaborationManager.getInstance().getCollaborativeFramework();
|
||||
},
|
||||
|
||||
addTopics : function(nodeModel, parentTopicId) {
|
||||
var framework = this._getFramework();
|
||||
var cmindmap = framework.getModel();
|
||||
|
||||
var cparent = $defined(parentTopicId) ? framework.getTopic(parentTopicId) : cmindmap.getCentralTopic();
|
||||
var cnode = cmindmap.createNode(nodeModel.getType(), nodeModel.getId());
|
||||
nodeModel.copyTo(cnode);
|
||||
|
||||
cnode.connectTo(cparent);
|
||||
},
|
||||
|
||||
changeFontSizeToTopic : function(topicsIds, size) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setFontSize(size, true);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
changeFontColorToTopic : function(topicsIds, color) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setFontColor(color, true);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
changeFontFamilyToTopic : function(topicsIds, family) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setFontFamily(family, true);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
changeFontStyleToTopic : function(topicsIds) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
var style = ( topic.getFontStyle() == "italic") ? "normal" : "italic";
|
||||
topic.setFontStyle(style, true);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
changeShapeTypeToTopic : function(topicsIds, shapeType) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setShapeType(shapeType);
|
||||
}.bind(this))
|
||||
},
|
||||
|
||||
changeFontWeightToTopic : function(topicsIds) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
var weight = (topic.getFontWeight() == "bold") ? "normal" : "bold";
|
||||
topic.setFontWeight(weight, true);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
changeBackgroundColorToTopic : function(topicsIds, color) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setBackgroundColor(color, true);
|
||||
}.bind(this));
|
||||
|
||||
},
|
||||
|
||||
changeBorderColorToTopic : function(topicsIds, color) {
|
||||
topicsIds.each(function(topicId) {
|
||||
var framework = this._getFramework();
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.setBorderColor(color);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
deleteEntities : function(topicsIds, relIds) {
|
||||
$assert(topicsIds, "topicsIds can not be null");
|
||||
var framework = this._getFramework();
|
||||
var mindmap = framework.getModel();
|
||||
|
||||
topicsIds.each(function(topicId) {
|
||||
var topic = framework.getTopic(topicId);
|
||||
topic.deleteNode();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -29,16 +29,12 @@ mindplot.ConnectionLine = new Class({
|
||||
var ctrlPoints = this._getCtrlPoints(sourceNode, targetNode);
|
||||
if (targetNode.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
line = this._createLine(lineType, mindplot.ConnectionLine.CURVED);
|
||||
if (line.getType() == "CurvedLine") {
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
}
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
} else {
|
||||
line = this._createLine(lineType, mindplot.ConnectionLine.SIMPLE_CURVED);
|
||||
if (line.getType() == "CurvedLine") {
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
}
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
}
|
||||
// Set line styles ...
|
||||
var strokeColor = mindplot.ConnectionLine.getStrokeColor();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -33,11 +33,7 @@ mindplot.Designer = new Class({
|
||||
|
||||
// Dispatcher manager ...
|
||||
var commandContext = new mindplot.CommandContext(this);
|
||||
if (!$defined(options.collab) || options.collab == 'standalone') {
|
||||
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext);
|
||||
} else {
|
||||
this._actionDispatcher = new mindplot.BrixActionDispatcher(commandContext);
|
||||
}
|
||||
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext);
|
||||
|
||||
this._actionDispatcher.addEvent("modelUpdate", function (event) {
|
||||
this.fireEvent("modelUpdate", event);
|
||||
@@ -55,9 +51,15 @@ mindplot.Designer = new Class({
|
||||
|
||||
// Register events
|
||||
if (!this.isReadOnly()) {
|
||||
this._registerEvents();
|
||||
// Register mouse events ...
|
||||
this._registerMouseEvents();
|
||||
|
||||
// Register keyboard events ...
|
||||
mindplot.DesignerKeyboard.register(this);
|
||||
|
||||
this._dragManager = this._buildDragManager(this._workspace);
|
||||
}
|
||||
this._registerWheelEvents();
|
||||
|
||||
this._relPivot = new mindplot.RelationshipPivot(this._workspace, this);
|
||||
|
||||
@@ -76,6 +78,32 @@ mindplot.Designer = new Class({
|
||||
this.deselectAll();
|
||||
},
|
||||
|
||||
_registerWheelEvents:function () {
|
||||
var workspace = this._workspace;
|
||||
var screenManager = workspace.getScreenManager();
|
||||
|
||||
// Zoom In and Zoom Out must active event
|
||||
$(document).addEvent('mousewheel', function (event) {
|
||||
// Change mousewheel handling so we let the default
|
||||
//event happen if we are outside the container.
|
||||
var coords = screenManager.getContainer().getCoordinates();
|
||||
var isOutsideContainer = event.client.y < coords.top ||
|
||||
event.client.y > coords.bottom ||
|
||||
event.client.x < coords.left ||
|
||||
event.client.x > coords.right;
|
||||
|
||||
if (!isOutsideContainer) {
|
||||
if (event.wheel > 0) {
|
||||
this.zoomIn(1.05);
|
||||
}
|
||||
else {
|
||||
this.zoomOut(1.05);
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
* Activates the keyboard events so you can enter text into forms
|
||||
*/
|
||||
@@ -84,14 +112,6 @@ mindplot.Designer = new Class({
|
||||
},
|
||||
|
||||
|
||||
_registerEvents:function () {
|
||||
// Register mouse events ...
|
||||
this._registerMouseEvents();
|
||||
|
||||
// Register keyboard events ...
|
||||
mindplot.DesignerKeyboard.register(this);
|
||||
},
|
||||
|
||||
addEvent:function (type, listener) {
|
||||
if (type == mindplot.TopicEvent.EDIT || type == mindplot.TopicEvent.CLICK) {
|
||||
var editor = mindplot.TopicEventDispatcher.getInstance();
|
||||
@@ -136,26 +156,48 @@ mindplot.Designer = new Class({
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
// Register mouse drag and drop event ...
|
||||
function noopHandler(evt) {
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
||||
$(document).addEvent('mousewheel', function (event) {
|
||||
// Change mousewheel handling so we let the default
|
||||
//event happen if we are outside the container.
|
||||
var coords = screenManager.getContainer().getCoordinates();
|
||||
var isOutsideContainer = event.client.y < coords.top ||
|
||||
event.client.y > coords.bottom ||
|
||||
event.client.x < coords.left ||
|
||||
event.client.x > coords.right;
|
||||
// Enable drag events ...
|
||||
// @Todo: Images support on progress ...
|
||||
// Element.NativeEvents.dragenter = 2;
|
||||
// Element.NativeEvents.dragexit = 2;
|
||||
// Element.NativeEvents.dragover = 2;
|
||||
// Element.NativeEvents.drop = 2;
|
||||
//
|
||||
// screenManager.addEvent('dragenter', noopHandler);
|
||||
// screenManager.addEvent('dragexit', noopHandler);
|
||||
// screenManager.addEvent('dragover', noopHandler);
|
||||
// screenManager.addEvent('drop', function (evt) {
|
||||
// evt.stopPropagation();
|
||||
// evt.preventDefault();
|
||||
////
|
||||
// var files = evt.event.dataTransfer.files;
|
||||
// console.log(event);
|
||||
//
|
||||
// var count = files.length;
|
||||
//
|
||||
// // Only call the handler if 1 or more files was dropped.
|
||||
// if (count > 0) {
|
||||
//
|
||||
// var model = this.getMindmap().createNode();
|
||||
// model.setImageSize(80, 43);
|
||||
// model.setMetadata("{'media':'video,'url':'http://www.youtube.com/watch?v=P3FrXftyuzw&feature=g-vrec&context=G2b4ab69RVAAAAAAAAAA'}");
|
||||
// model.setImageUrl("images/logo-small.png");
|
||||
// model.setShapeType(mindplot.model.TopicShape.IMAGE);
|
||||
//
|
||||
// var position = screenManager.getWorkspaceMousePosition(evt);
|
||||
// model.setPosition(position.x, position.y);
|
||||
// model.setPosition(100, 100);
|
||||
//
|
||||
// this._actionDispatcher.addTopics([model]);
|
||||
// }
|
||||
// }.bind(this));
|
||||
|
||||
if (!isOutsideContainer) {
|
||||
if (event.wheel > 0) {
|
||||
this.zoomIn(1.05);
|
||||
}
|
||||
else {
|
||||
this.zoomOut(1.05);
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
},
|
||||
|
||||
@@ -203,12 +245,8 @@ mindplot.Designer = new Class({
|
||||
|
||||
|
||||
_buildNodeGraph:function (model, readOnly) {
|
||||
var workspace = this._workspace;
|
||||
|
||||
// Create node graph ...
|
||||
var topic = mindplot.NodeGraph.create(model, {readOnly:readOnly});
|
||||
|
||||
// Append it to the workspace ...
|
||||
this.getModel().addTopic(topic);
|
||||
|
||||
// Add Topic events ...
|
||||
@@ -244,7 +282,7 @@ mindplot.Designer = new Class({
|
||||
}
|
||||
}
|
||||
$assert(targetTopic, "Could not find a topic to connect");
|
||||
topic.connectTo(targetTopic, workspace);
|
||||
topic.connectTo(targetTopic, this._workspace);
|
||||
}
|
||||
|
||||
topic.addEvent('ontblur', function () {
|
||||
@@ -358,7 +396,7 @@ mindplot.Designer = new Class({
|
||||
|
||||
// Exclude central topic ..
|
||||
topics = topics.filter(function (topic) {
|
||||
return topic.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE
|
||||
return !topic.isCentralTopic();
|
||||
});
|
||||
|
||||
this._clipboard = topics.map(function (topic) {
|
||||
@@ -398,8 +436,9 @@ mindplot.Designer = new Class({
|
||||
}
|
||||
// Execute event ...
|
||||
var topic = nodes[0];
|
||||
this._actionDispatcher.shrinkBranch([topic.getId()], !topic.areChildrenShrunken());
|
||||
|
||||
if (topic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
this._actionDispatcher.shrinkBranch([topic.getId()], !topic.areChildrenShrunken());
|
||||
}
|
||||
},
|
||||
|
||||
createChildForSelectedNode:function () {
|
||||
@@ -427,10 +466,52 @@ mindplot.Designer = new Class({
|
||||
|
||||
},
|
||||
|
||||
_copyNodeProps: function(sourceModel,targetModel){
|
||||
|
||||
// I don't copy the font size if the target is the source is the central topic.
|
||||
if(sourceModel.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE)
|
||||
{
|
||||
var fontSize = sourceModel.getFontSize();
|
||||
if(fontSize){
|
||||
targetModel.setFontSize(fontSize)
|
||||
}
|
||||
}
|
||||
|
||||
var fontFamily = sourceModel.getFontFamily();
|
||||
if(fontFamily){
|
||||
targetModel.setFontFamily(fontFamily)
|
||||
}
|
||||
|
||||
var fontColor = sourceModel.getFontColor();
|
||||
if(fontColor){
|
||||
targetModel.setFontColor(fontColor)
|
||||
}
|
||||
|
||||
var fontWeight = sourceModel.getFontWeight();
|
||||
if(fontWeight){
|
||||
targetModel.setFontWeight(fontWeight)
|
||||
}
|
||||
|
||||
var fontStyle = sourceModel.getFontStyle();
|
||||
if(fontStyle){
|
||||
targetModel.setFontStyle(fontStyle)
|
||||
}
|
||||
|
||||
var shape = sourceModel.getShapeType();
|
||||
if(shape){
|
||||
targetModel.setShapeType(shape)
|
||||
}
|
||||
|
||||
var borderColor = sourceModel.getBorderColor();
|
||||
if(borderColor){
|
||||
targetModel.setBorderColor(borderColor)
|
||||
}
|
||||
},
|
||||
|
||||
_createChildModel:function (topic, mousePos) {
|
||||
// Create a new node ...
|
||||
var model = topic.getModel();
|
||||
var mindmap = model.getMindmap();
|
||||
var parentModel = topic.getModel();
|
||||
var mindmap = parentModel.getMindmap();
|
||||
var childModel = mindmap.createNode();
|
||||
|
||||
// Create a new node ...
|
||||
@@ -441,6 +522,8 @@ mindplot.Designer = new Class({
|
||||
var position = result.position;
|
||||
childModel.setPosition(position.x, position.y);
|
||||
|
||||
this._copyNodeProps(parentModel,childModel);
|
||||
|
||||
return childModel;
|
||||
},
|
||||
|
||||
@@ -505,8 +588,11 @@ mindplot.Designer = new Class({
|
||||
// Create a new node ...
|
||||
var order = topic.getOrder() + 1;
|
||||
result.setOrder(order);
|
||||
result.setPosition(10, 10); // Set a dummy pisition ...
|
||||
result.setPosition(10, 10); // Set a dummy position ...
|
||||
}
|
||||
|
||||
this._copyNodeProps(model,result);
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
@@ -552,7 +638,7 @@ mindplot.Designer = new Class({
|
||||
for (var i = 0; i < branches.length; i++) {
|
||||
// NodeModel -> NodeGraph ...
|
||||
var nodeModel = branches[i];
|
||||
var nodeGraph = this._nodeModelToNodeGraph(nodeModel, false);
|
||||
var nodeGraph = this._nodeModelToNodeGraph(nodeModel);
|
||||
|
||||
// Update shrink render state...
|
||||
nodeGraph.setBranchVisibility(true);
|
||||
@@ -590,7 +676,7 @@ mindplot.Designer = new Class({
|
||||
return this._options.readOnly;
|
||||
},
|
||||
|
||||
_nodeModelToNodeGraph:function (nodeModel, isVisible) {
|
||||
_nodeModelToNodeGraph:function (nodeModel) {
|
||||
$assert(nodeModel, "Node model can not be null");
|
||||
var children = nodeModel.getChildren().slice();
|
||||
children = children.sort(function (a, b) {
|
||||
@@ -598,16 +684,13 @@ mindplot.Designer = new Class({
|
||||
});
|
||||
|
||||
var nodeGraph = this._buildNodeGraph(nodeModel, this.isReadOnly());
|
||||
|
||||
if (isVisible) {
|
||||
nodeGraph.setVisibility(isVisible);
|
||||
}
|
||||
nodeGraph.setVisibility(false);
|
||||
|
||||
this._workspace.appendChild(nodeGraph);
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
if ($defined(child))
|
||||
this._nodeModelToNodeGraph(child, false);
|
||||
this._nodeModelToNodeGraph(child);
|
||||
}
|
||||
|
||||
return nodeGraph;
|
||||
@@ -658,6 +741,9 @@ mindplot.Designer = new Class({
|
||||
|
||||
var targetTopicId = model.getToNode();
|
||||
var targetTopic = dmodel.findTopicById(targetTopicId);
|
||||
$assert(targetTopic, "targetTopic could not be found:" + targetTopicId + dmodel.getTopics().map(function (e) {
|
||||
return e.getId()
|
||||
}));
|
||||
|
||||
// Build relationship line ....
|
||||
var result = new mindplot.Relationship(sourceTopic, targetTopic, model);
|
||||
@@ -688,7 +774,7 @@ mindplot.Designer = new Class({
|
||||
},
|
||||
|
||||
_removeTopic:function (node) {
|
||||
if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
if (!node.isCentralTopic()) {
|
||||
var parent = node._parent;
|
||||
node.disconnect(this._workspace);
|
||||
|
||||
@@ -710,7 +796,16 @@ mindplot.Designer = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
_resetEdition:function () {
|
||||
var screenManager = this._workspace.getScreenManager();
|
||||
screenManager.fireEvent("update");
|
||||
screenManager.fireEvent("mouseup");
|
||||
this._relPivot.dispose();
|
||||
},
|
||||
|
||||
deleteSelectedEntities:function () {
|
||||
// Is there some action in progress ?.
|
||||
this._resetEdition();
|
||||
|
||||
var topics = this.getModel().filterSelectedTopics();
|
||||
var relation = this.getModel().filterSelectedRelationships();
|
||||
@@ -718,14 +813,14 @@ mindplot.Designer = new Class({
|
||||
// If there are more than one node selected,
|
||||
$notify($msg('ENTITIES_COULD_NOT_BE_DELETED'));
|
||||
return;
|
||||
} else if (topics.length == 1 && topics[0].getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
} else if (topics.length == 1 && topics[0].isCentralTopic()) {
|
||||
$notify($msg('CENTRAL_TOPIC_CAN_NOT_BE_DELETED'));
|
||||
return;
|
||||
}
|
||||
|
||||
// If the central topic has been selected, I must filter ir
|
||||
var topicIds = topics.filter(function (topic) {
|
||||
return topic.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE
|
||||
return !topic.isCentralTopic();
|
||||
}).map(function (topic) {
|
||||
return topic.getId()
|
||||
});
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -60,19 +60,32 @@ mindplot.DesignerKeyboard = new Class({
|
||||
}
|
||||
}.bind(this),
|
||||
|
||||
'delete':function () {
|
||||
'delete':function (event) {
|
||||
designer.deleteSelectedEntities();
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'enter':function () {
|
||||
designer.createSiblingForSelectedNode();
|
||||
}.bind(this),
|
||||
|
||||
'insert':function () {
|
||||
'insert':function (event) {
|
||||
designer.createChildForSelectedNode();
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'-':function () {
|
||||
'tab':function (event) {
|
||||
designer.createChildForSelectedNode();
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'-':function () { // "-" is a insert on several Browsers. Don't ask why ...
|
||||
designer.createChildForSelectedNode();
|
||||
}.bind(this),
|
||||
|
||||
@@ -225,10 +238,39 @@ mindplot.DesignerKeyboard = new Class({
|
||||
designer.selectAll();
|
||||
},
|
||||
|
||||
'right':function () {
|
||||
'meta+=':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.zoomIn();
|
||||
},
|
||||
|
||||
'meta+-':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.zoomOut();
|
||||
},
|
||||
|
||||
'ctrl+=':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.zoomIn();
|
||||
},
|
||||
|
||||
'ctrl+-':function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
designer.zoomOut();
|
||||
},
|
||||
|
||||
|
||||
'right':function (event) {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
if (node.getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
if (node.isCentralTopic()) {
|
||||
this._goToSideChild(designer, node, 'RIGHT');
|
||||
}
|
||||
else {
|
||||
@@ -243,12 +285,14 @@ mindplot.DesignerKeyboard = new Class({
|
||||
var centralTopic = model.getCentralTopic();
|
||||
this._goToNode(designer, centralTopic);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'left':function () {
|
||||
'left':function (event) {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
if (node.getTopicType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
if (node.isCentralTopic()) {
|
||||
this._goToSideChild(designer, node, 'LEFT');
|
||||
}
|
||||
else {
|
||||
@@ -263,37 +307,48 @@ mindplot.DesignerKeyboard = new Class({
|
||||
var centralTopic = model.getCentralTopic();
|
||||
this._goToNode(designer, centralTopic);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'up':function () {
|
||||
'up':function (event) {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
if (!node.isCentralTopic()) {
|
||||
this._goToBrother(designer, node, 'UP');
|
||||
}
|
||||
} else {
|
||||
var centralTopic = model.getCentralTopic();
|
||||
this._goToNode(designer, centralTopic);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this),
|
||||
|
||||
'down':function () {
|
||||
'down':function (event) {
|
||||
var node = model.selectedTopic();
|
||||
if (node) {
|
||||
if (node.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
if (!node.isCentralTopic()) {
|
||||
this._goToBrother(designer, node, 'DOWN');
|
||||
}
|
||||
} else {
|
||||
var centralTopic = model.getCentralTopic();
|
||||
this._goToNode(designer, centralTopic);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}.bind(this)
|
||||
};
|
||||
this.addEvents(keyboardEvents);
|
||||
|
||||
var regex = /^(?:shift|control|ctrl|alt|meta)$/;
|
||||
var modifiers = ['shift', 'control', 'alt', 'meta'];
|
||||
|
||||
var excludes = ['esc', 'capslock', 'tab', 'f1', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12', 'backspace', 'down', 'up', 'left', 'right', 'control'];
|
||||
if (!Browser.Platform.mac) {
|
||||
// This is to avoid enter on edition mode in the node when alt+tab is pressed.
|
||||
excludes.push("alt");
|
||||
}
|
||||
|
||||
$(document).addEvent('keydown', function (event) {
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -83,6 +83,7 @@ mindplot.DesignerModel = new Class({
|
||||
|
||||
addTopic:function (topic) {
|
||||
$assert(topic, "topic can not be null");
|
||||
$assert(typeof topic.getId() == "number", "id is not a number:" + topic.getId());
|
||||
this._topics.push(topic);
|
||||
},
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -115,14 +115,16 @@ mindplot.DragTopic = new Class({
|
||||
},
|
||||
|
||||
removeFromWorkspace:function (workspace) {
|
||||
// Remove drag shadow.
|
||||
workspace.removeChild(this._elem2d);
|
||||
this._isInWorkspace = false;
|
||||
if (this._isInWorkspace) {
|
||||
// Remove drag shadow.
|
||||
workspace.removeChild(this._elem2d);
|
||||
|
||||
// Remove pivot shape. To improve performace it will not be removed. Only the visibility will be changed.
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.setVisibility(false);
|
||||
// Remove pivot shape. To improve performance it will not be removed. Only the visibility will be changed.
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.setVisibility(false);
|
||||
|
||||
this._isInWorkspace = false;
|
||||
}
|
||||
},
|
||||
|
||||
isInWorkspace:function () {
|
||||
@@ -130,10 +132,12 @@ mindplot.DragTopic = new Class({
|
||||
},
|
||||
|
||||
addToWorkspace:function (workspace) {
|
||||
workspace.appendChild(this._elem2d);
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.addToWorkspace(workspace);
|
||||
this._isInWorkspace = true;
|
||||
if (!this._isInWorkspace) {
|
||||
workspace.appendChild(this._elem2d);
|
||||
var dragPivot = this._getDragPivot();
|
||||
dragPivot.addToWorkspace(workspace);
|
||||
this._isInWorkspace = true;
|
||||
}
|
||||
},
|
||||
|
||||
_getDragPivot:function () {
|
||||
|
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.EditorOptions =
|
||||
{
|
||||
LayoutManager:"OriginalLayout",
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -80,7 +80,7 @@ mindplot.IconGroup = new Class({
|
||||
}, this);
|
||||
|
||||
if (result == null) {
|
||||
throw "Icon can no be found.";
|
||||
throw new Error("Icon can no be found:" + iconModel.getId() + ", Icons:" + this._icons);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -102,7 +102,6 @@ mindplot.ImageIcon = new Class({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mindplot.ImageIcon.prototype.ICON_FAMILIES = [
|
||||
{"id":"face", "icons":["face_plain", "face_sad", "face_crying", "face_smile", "face_surprise", "face_wink"]},
|
||||
{"id":"funy", "icons":["funy_angel", "funy_devilish", "funy_glasses", "funy_grin", "funy_kiss", "funy_monkey"]},
|
||||
@@ -114,6 +113,7 @@ mindplot.ImageIcon.prototype.ICON_FAMILIES = [
|
||||
{"id":"onoff", "icons":["onoff_clock", "onoff_clock_red", "onoff_add", "onoff_delete", "onoff_status_offline", "onoff_status_online"]},
|
||||
{"id":"money", "icons":["money_money", "money_dollar", "money_euro", "money_pound", "money_yen", "money_coins", "money_ruby"]},
|
||||
{"id":"time", "icons":["time_calendar", "time_clock", "time_hourglass"]},
|
||||
{"id":"number", "icons":["number_1", "number_2", "number_3", "number_4", "number_5", "number_6", "number_7", "number_8", "number_9"]},
|
||||
{"id":"chart", "icons":["chart_bar", "chart_line", "chart_curve", "chart_pie", "chart_organisation"]},
|
||||
{"id":"sign", "icons":["sign_warning", "sign_info", "sign_stop", "sign_help", "sign_cancel"]},
|
||||
{"id":"hard", "icons":["hard_cd", "hard_computer", "hard_controller", "hard_driver_disk", "hard_ipod", "hard_keyboard", "hard_mouse", "hard_printer"]},
|
||||
@@ -126,7 +126,7 @@ mindplot.ImageIcon.prototype.ICON_FAMILIES = [
|
||||
{"id":"bullet", "icons":["bullet_black", "bullet_blue", "bullet_green", "bullet_orange", "bullet_red", "bullet_pink", "bullet_purple"]},
|
||||
{"id":"tag", "icons":["tag_blue", "tag_green", "tag_orange", "tag_red", "tag_pink", "tag_yellow"]},
|
||||
{"id":"object", "icons":["object_bell", "object_clanbomber", "object_key", "object_pencil", "object_phone", "object_magnifier", "object_clip", "object_music", "object_star", "object_wizard", "object_house", "object_cake", "object_camera", "object_palette", "object_rainbow"]},
|
||||
{"id":"weather", "icons":["weather_clear-night", "weather_clear", "weather_few-clouds-night", "weather_few-clouds", "weather_overcast", "weather_severe-alert", "weather_showers-scattered", "weather_showers", "weather_snow", "weather_storm"]}
|
||||
{"id":"weather", "icons":["weather_clear-night", "weather_clear", "weather_few-clouds-night", "weather_few-clouds", "weather_overcast", "weather_severe-alert", "weather_showers-scattered", "weather_showers", "weather_snow", "weather_storm"]},
|
||||
{"id":"task", "icons":["task_0", "task_25", "task_50", "task_75", "task_100"]}
|
||||
];
|
||||
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -18,28 +18,29 @@
|
||||
|
||||
mindplot.LocalStorageManager = new Class({
|
||||
Extends:mindplot.PersistenceManager,
|
||||
initialize: function() {
|
||||
initialize:function (documentUrl,forceLoad) {
|
||||
this.parent();
|
||||
this.documentUrl = documentUrl;
|
||||
this.forceLoad = forceLoad;
|
||||
},
|
||||
|
||||
saveMapXml : function(mapId, mapXml, pref, saveHistory, events) {
|
||||
saveMapXml:function (mapId, mapXml, pref, saveHistory, events) {
|
||||
localStorage.setItem(mapId + "-xml", mapXml);
|
||||
events.onSuccess();
|
||||
},
|
||||
|
||||
discardChanges : function(mapId) {
|
||||
discardChanges:function (mapId) {
|
||||
localStorage.removeItem(mapId + "-xml");
|
||||
},
|
||||
|
||||
loadMapDom : function(mapId) {
|
||||
loadMapDom:function (mapId) {
|
||||
var xml = localStorage.getItem(mapId + "-xml");
|
||||
if (xml == null) {
|
||||
// Let's try to open one from the local directory ...
|
||||
if (xml == null || this.forceLoad) {
|
||||
var xmlRequest = new Request({
|
||||
url: 'samples/' + mapId + '.xml',
|
||||
method: 'get',
|
||||
async: false,
|
||||
onSuccess: function(responseText) {
|
||||
url:this.documentUrl.replace("{id}", mapId),
|
||||
headers:{"Content-Type":"text/plain","Accept":"application/xml"},
|
||||
method:'get',
|
||||
async:false,
|
||||
onSuccess:function (responseText) {
|
||||
xml = responseText;
|
||||
}
|
||||
});
|
||||
@@ -47,13 +48,16 @@ mindplot.LocalStorageManager = new Class({
|
||||
|
||||
// If I could not load it from a file, hard code one.
|
||||
if (xml == null) {
|
||||
throw "Map could not be loaded";
|
||||
throw new Error("Map could not be loaded");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var parser = new DOMParser();
|
||||
return parser.parseFromString(xml, "text/xml");
|
||||
},
|
||||
|
||||
unlockMap:function (mindmap) {
|
||||
// Ignore, no implementation required ...
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -55,16 +55,11 @@ mindplot.MainTopic = new Class({
|
||||
return group;
|
||||
},
|
||||
|
||||
|
||||
_defaultShapeType:function () {
|
||||
return mindplot.model.TopicShape.LINE;
|
||||
},
|
||||
|
||||
updateTopicShape:function (targetTopic, workspace) {
|
||||
// Change figure based on the connected topic ...
|
||||
var model = this.getModel();
|
||||
var shapeType = model.getShapeType();
|
||||
if (targetTopic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
if (!targetTopic.isCentralTopic()) {
|
||||
if (!$defined(shapeType)) {
|
||||
// Get the real shape type ...
|
||||
shapeType = this.getShapeType();
|
||||
@@ -88,10 +83,6 @@ mindplot.MainTopic = new Class({
|
||||
innerShape.setVisibility(true);
|
||||
},
|
||||
|
||||
getTopicType:function () {
|
||||
return "MainTopic";
|
||||
},
|
||||
|
||||
_updatePositionOnChangeSize:function (oldSize, newSize) {
|
||||
|
||||
var xOffset = Math.round((newSize.width - oldSize.width) / 2);
|
||||
@@ -107,28 +98,7 @@ mindplot.MainTopic = new Class({
|
||||
},
|
||||
|
||||
workoutIncomingConnectionPoint:function (sourcePosition) {
|
||||
$assert(sourcePosition, 'sourcePoint can not be null');
|
||||
var pos = this.getPosition();
|
||||
var size = this.getSize();
|
||||
|
||||
var isAtRight = mindplot.util.Shape.isAtRight(sourcePosition, pos);
|
||||
var result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight);
|
||||
if (this.getShapeType() == mindplot.model.TopicShape.LINE) {
|
||||
result.y = result.y + (this.getSize().height / 2);
|
||||
}
|
||||
|
||||
// Move a little the position...
|
||||
var offset = mindplot.Topic.CONNECTOR_WIDTH / 2;
|
||||
if (this.getPosition().x > 0) {
|
||||
result.x = result.x + offset;
|
||||
} else {
|
||||
result.x = result.x - offset;
|
||||
}
|
||||
|
||||
result.x = Math.ceil(result.x);
|
||||
result.y = Math.ceil(result.y);
|
||||
return result;
|
||||
|
||||
return mindplot.util.Shape.workoutIncomingConnectionPoint(this, sourcePosition);
|
||||
},
|
||||
|
||||
workoutOutgoingConnectionPoint:function (targetPosition) {
|
||||
@@ -167,82 +137,6 @@ mindplot.MainTopic = new Class({
|
||||
result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight, true);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
_getInnerPadding:function () {
|
||||
var result;
|
||||
var parent = this.getModel().getParent();
|
||||
if (parent && mindplot.model.INodeModel.MAIN_TOPIC_TYPE == parent.getType()) {
|
||||
result = 3;
|
||||
}
|
||||
else {
|
||||
result = 4;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
isConnectedToCentralTopic:function () {
|
||||
var model = this.getModel();
|
||||
var parent = model.getParent();
|
||||
|
||||
return parent && parent.getType() === mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE;
|
||||
},
|
||||
|
||||
_defaultText:function () {
|
||||
var targetTopic = this.getOutgoingConnectedTopic();
|
||||
var result = "";
|
||||
if ($defined(targetTopic)) {
|
||||
if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
result = $msg('MAIN_TOPIC');
|
||||
} else {
|
||||
result = $msg('SUB_TOPIC');
|
||||
}
|
||||
} else {
|
||||
result = $msg('ISOLATED_TOPIC');
|
||||
;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
_defaultFontStyle:function () {
|
||||
var targetTopic = this.getOutgoingConnectedTopic();
|
||||
var result;
|
||||
if ($defined(targetTopic)) {
|
||||
if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
result = {
|
||||
font:"Arial",
|
||||
size:8,
|
||||
style:"normal",
|
||||
weight:"normal",
|
||||
color:"rgb(82,92,97)"
|
||||
};
|
||||
} else {
|
||||
result = {
|
||||
font:"Arial",
|
||||
size:6,
|
||||
style:"normal",
|
||||
weight:"normal",
|
||||
color:"rgb(82,92,97)"
|
||||
};
|
||||
}
|
||||
} else {
|
||||
result = {
|
||||
font:"Verdana",
|
||||
size:8,
|
||||
style:"normal",
|
||||
weight:"normal",
|
||||
color:"rgb(82,92,97)"
|
||||
};
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
_defaultBackgroundColor:function () {
|
||||
return "rgb(224,229,239)";
|
||||
},
|
||||
|
||||
_defaultBorderColor:function () {
|
||||
return 'rgb(2,59,185)';
|
||||
}
|
||||
|
||||
});
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -17,20 +17,21 @@
|
||||
*/
|
||||
|
||||
mindplot.MultilineTextEditor = new Class({
|
||||
Extends: Events,
|
||||
initialize:function() {
|
||||
Extends:Events,
|
||||
initialize:function () {
|
||||
this._topic = null;
|
||||
this._timeoutId = -1;
|
||||
},
|
||||
|
||||
_buildEditor : function() {
|
||||
_buildEditor:function () {
|
||||
|
||||
var result = new Element('div');
|
||||
result.setStyles({
|
||||
position:"absolute",
|
||||
display: "none",
|
||||
zIndex: "8",
|
||||
display:"none",
|
||||
zIndex:"8",
|
||||
overflow:"hidden",
|
||||
border: "0 none"
|
||||
border:"0 none"
|
||||
}
|
||||
);
|
||||
|
||||
@@ -42,17 +43,17 @@ mindplot.MultilineTextEditor = new Class({
|
||||
);
|
||||
|
||||
textareaElem.setStyles({
|
||||
border: "1px gray dashed",
|
||||
border:"1px gray dashed",
|
||||
background:"rgba(98, 135, 167, .3)",
|
||||
outline: '0 none',
|
||||
resize: 'none',
|
||||
outline:'0 none',
|
||||
resize:'none',
|
||||
overflow:"hidden"
|
||||
});
|
||||
textareaElem.inject(result);
|
||||
return result;
|
||||
},
|
||||
|
||||
_registerEvents : function(containerElem) {
|
||||
_registerEvents:function (containerElem) {
|
||||
var textareaElem = this._getTextareaElem();
|
||||
|
||||
textareaElem.addEvent('keydown', function (event) {
|
||||
@@ -63,8 +64,30 @@ mindplot.MultilineTextEditor = new Class({
|
||||
case 'enter':
|
||||
if (event.meta || event.control) {
|
||||
|
||||
// @todo: Enters must be in any place ...
|
||||
textareaElem.value = textareaElem.value + "\n";
|
||||
// Add return ...
|
||||
var text = textareaElem.value;
|
||||
var cursorPosition = text.length;
|
||||
if (textareaElem.selectionStart) {
|
||||
cursorPosition = textareaElem.selectionStart;
|
||||
}
|
||||
|
||||
var head = text.substring(0, cursorPosition);
|
||||
var tail = "";
|
||||
if (cursorPosition < text.length) {
|
||||
tail = text.substring(cursorPosition, text.length);
|
||||
}
|
||||
textareaElem.value = head + "\n" + tail;
|
||||
|
||||
// Position cursor ...
|
||||
if (textareaElem.setSelectionRange) {
|
||||
textareaElem.focus();
|
||||
textareaElem.setSelectionRange(cursorPosition + 1, cursorPosition + 1);
|
||||
} else if (textareaElem.createTextRange) {
|
||||
var range = textareaElem.createTextRange();
|
||||
range.moveStart('character', cursorPosition + 1);
|
||||
range.select();
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
this.close(true);
|
||||
@@ -74,36 +97,36 @@ mindplot.MultilineTextEditor = new Class({
|
||||
event.stopPropagation();
|
||||
}.bind(this));
|
||||
|
||||
textareaElem.addEvent('keypress', function(event) {
|
||||
textareaElem.addEvent('keypress', function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
textareaElem.addEvent('keyup', function(event) {
|
||||
textareaElem.addEvent('keyup', function (event) {
|
||||
var text = this._getTextareaElem().value;
|
||||
this.fireEvent('input', [event, text]);
|
||||
this._adjustEditorSize();
|
||||
}.bind(this));
|
||||
|
||||
// If the user clicks on the input, all event must be ignored ...
|
||||
containerElem.addEvent('click', function(event) {
|
||||
containerElem.addEvent('click', function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
containerElem.addEvent('dblclick', function(event) {
|
||||
containerElem.addEvent('dblclick', function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
containerElem.addEvent('mousedown', function(event) {
|
||||
containerElem.addEvent('mousedown', function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
},
|
||||
|
||||
_adjustEditorSize : function() {
|
||||
_adjustEditorSize:function () {
|
||||
|
||||
if (this.isVisible()) {
|
||||
var textElem = this._getTextareaElem();
|
||||
|
||||
var lines = textElem.value.split('\n');
|
||||
var maxLineLength = 1;
|
||||
lines.each(function(line) {
|
||||
lines.each(function (line) {
|
||||
if (maxLineLength < line.length)
|
||||
maxLineLength = line.length;
|
||||
});
|
||||
@@ -112,17 +135,17 @@ mindplot.MultilineTextEditor = new Class({
|
||||
textElem.setAttribute('rows', lines.length);
|
||||
|
||||
this._containerElem.setStyles({
|
||||
width: (maxLineLength + 3) + 'em',
|
||||
height: textElem.getSize().height
|
||||
width:(maxLineLength + 3) + 'em',
|
||||
height:textElem.getSize().height
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
isVisible : function () {
|
||||
isVisible:function () {
|
||||
return $defined(this._containerElem) && this._containerElem.getStyle('display') == 'block';
|
||||
},
|
||||
|
||||
_updateModel : function () {
|
||||
_updateModel:function () {
|
||||
|
||||
if (this._topic.getText() != this._getText()) {
|
||||
var text = this._getText();
|
||||
@@ -133,7 +156,11 @@ mindplot.MultilineTextEditor = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
show : function (topic,text) {
|
||||
show:function (topic, text) {
|
||||
// Close a previous node editor if it's opened ...
|
||||
if (this._topic) {
|
||||
this.close(false);
|
||||
}
|
||||
|
||||
this._topic = topic;
|
||||
if (!this.isVisible()) {
|
||||
@@ -147,7 +174,7 @@ mindplot.MultilineTextEditor = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
_showEditor : function (defaultText) {
|
||||
_showEditor:function (defaultText) {
|
||||
|
||||
var topic = this._topic;
|
||||
|
||||
@@ -162,12 +189,12 @@ mindplot.MultilineTextEditor = new Class({
|
||||
this._setStyle(font);
|
||||
|
||||
// Set editor's initial size
|
||||
var displayFunc = function() {
|
||||
var displayFunc = function () {
|
||||
// Position the editor and set the size...
|
||||
var textShape = this._topic.getTextShape();
|
||||
var textShape = topic.getTextShape();
|
||||
textShape.positionRelativeTo(this._containerElem, {
|
||||
position: {x: 'left',y:'top'},
|
||||
edge: {x: 'left', y: 'top'}
|
||||
position:{x:'left', y:'top'},
|
||||
edge:{x:'left', y:'top'}
|
||||
});
|
||||
this._containerElem.setStyle('display', 'block');
|
||||
|
||||
@@ -181,10 +208,10 @@ mindplot.MultilineTextEditor = new Class({
|
||||
|
||||
}.bind(this);
|
||||
|
||||
displayFunc.delay(10);
|
||||
this._timeoutId = displayFunc.delay(10);
|
||||
},
|
||||
|
||||
_setStyle : function (fontStyle) {
|
||||
_setStyle:function (fontStyle) {
|
||||
var inputField = this._getTextareaElem();
|
||||
if (!$defined(fontStyle.font)) {
|
||||
fontStyle.font = "Arial";
|
||||
@@ -199,31 +226,31 @@ mindplot.MultilineTextEditor = new Class({
|
||||
fontStyle.size = 12;
|
||||
}
|
||||
var style = {
|
||||
fontSize : fontStyle.size + "px",
|
||||
fontFamily : fontStyle.font,
|
||||
fontStyle : fontStyle.style,
|
||||
fontWeight : fontStyle.weight,
|
||||
color : fontStyle.color
|
||||
fontSize:fontStyle.size + "px",
|
||||
fontFamily:fontStyle.font,
|
||||
fontStyle:fontStyle.style,
|
||||
fontWeight:fontStyle.weight,
|
||||
color:fontStyle.color
|
||||
};
|
||||
inputField.setStyles(style);
|
||||
this._containerElem.setStyles(style);
|
||||
},
|
||||
|
||||
_setText : function(text) {
|
||||
_setText:function (text) {
|
||||
var textareaElem = this._getTextareaElem();
|
||||
textareaElem.value = text;
|
||||
this._adjustEditorSize();
|
||||
},
|
||||
|
||||
_getText : function() {
|
||||
_getText:function () {
|
||||
return this._getTextareaElem().value;
|
||||
},
|
||||
|
||||
_getTextareaElem : function() {
|
||||
_getTextareaElem:function () {
|
||||
return this._containerElem.getElement('textarea');
|
||||
},
|
||||
|
||||
_positionCursor : function(textareaElem, selectText) {
|
||||
_positionCursor:function (textareaElem, selectText) {
|
||||
textareaElem.focus();
|
||||
if (selectText) {
|
||||
// Mark text as selected ...
|
||||
@@ -248,9 +275,11 @@ mindplot.MultilineTextEditor = new Class({
|
||||
|
||||
},
|
||||
|
||||
close : function(update) {
|
||||
if (this.isVisible()) {
|
||||
close:function (update) {
|
||||
if (this.isVisible() && this._topic) {
|
||||
// Update changes ...
|
||||
clearTimeout(this._timeoutId);
|
||||
|
||||
if (!$defined(update) || update) {
|
||||
this._updateModel();
|
||||
}
|
||||
@@ -261,8 +290,9 @@ mindplot.MultilineTextEditor = new Class({
|
||||
// Remove it form the screen ...
|
||||
this._containerElem.dispose();
|
||||
this._containerElem = null;
|
||||
this._topic = null;
|
||||
this._timeoutId = -1;
|
||||
}
|
||||
this._topic = null;
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -38,6 +38,7 @@ mindplot.NodeGraph = new Class({
|
||||
},
|
||||
|
||||
setId : function(id) {
|
||||
$assert(typeof topic.getId() == "number", "id is not a number:" + id);
|
||||
this.getModel().setId(id);
|
||||
},
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -47,7 +47,7 @@ mindplot.NoteIcon = new Class({
|
||||
var result = new Element('div');
|
||||
result.setStyles({padding:'5px'});
|
||||
|
||||
var title = new Element('div', {text:'Note'});
|
||||
var title = new Element('div', {text:$msg('NOTE')});
|
||||
title.setStyles({
|
||||
'font-weight':'bold',
|
||||
color:'black',
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -31,7 +31,7 @@ mindplot.PersistenceManager = new Class({
|
||||
|
||||
},
|
||||
|
||||
save:function (mindmap, editorProperties, saveHistory, events) {
|
||||
save:function (mindmap, editorProperties, saveHistory, events, sync) {
|
||||
$assert(mindmap, "mindmap can not be null");
|
||||
$assert(editorProperties, "editorProperties can not be null");
|
||||
|
||||
@@ -44,10 +44,10 @@ mindplot.PersistenceManager = new Class({
|
||||
|
||||
var pref = JSON.encode(editorProperties);
|
||||
try {
|
||||
this.saveMapXml(mapId, mapXml, pref, saveHistory, events);
|
||||
this.saveMapXml(mapId, mapXml, pref, saveHistory, events, sync);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
events.onError();
|
||||
events.onError(this._buildError());
|
||||
}
|
||||
},
|
||||
|
||||
@@ -58,15 +58,19 @@ mindplot.PersistenceManager = new Class({
|
||||
},
|
||||
|
||||
discardChanges:function (mapId) {
|
||||
throw "Method must be implemented";
|
||||
throw new Error("Method must be implemented");
|
||||
},
|
||||
|
||||
loadMapDom:function (mapId) {
|
||||
throw "Method must be implemented";
|
||||
throw new Error("Method must be implemented");
|
||||
},
|
||||
|
||||
saveMapXml:function (mapId, mapXml, pref, saveHistory, events) {
|
||||
throw "Method must be implemented";
|
||||
saveMapXml:function (mapId, mapXml, pref, saveHistory, events, sync) {
|
||||
throw new Error("Method must be implemented");
|
||||
},
|
||||
|
||||
unlockMap:function (mindmap) {
|
||||
throw new Error("Method must be implemented");
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -83,14 +83,19 @@ mindplot.Relationship = new Class({
|
||||
|
||||
var targetTopic = this._targetTopic;
|
||||
var targetPosition = targetTopic.getPosition();
|
||||
if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
targetPosition = mindplot.util.Shape.workoutIncomingConnectionPoint(targetTopic, sourcePosition);
|
||||
}
|
||||
|
||||
var sPos, tPos;
|
||||
this._line2d.setStroke(2);
|
||||
var ctrlPoints = this._line2d.getControlPoints();
|
||||
if (!this._line2d.isDestControlPointCustom() && !this._line2d.isSrcControlPointCustom()) {
|
||||
|
||||
var defaultPoints = mindplot.util.Shape.calculateDefaultControlPoints(sourcePosition, targetPosition);
|
||||
ctrlPoints[0].x = defaultPoints[0].x;
|
||||
ctrlPoints[0].y = defaultPoints[0].y;
|
||||
|
||||
ctrlPoints[1].x = defaultPoints[1].x;
|
||||
ctrlPoints[1].y = defaultPoints[1].y;
|
||||
}
|
||||
@@ -101,6 +106,7 @@ mindplot.Relationship = new Class({
|
||||
var tpoint = new core.Point();
|
||||
tpoint.x = parseInt(ctrlPoints[1].x) + parseInt(targetPosition.x);
|
||||
tpoint.y = parseInt(ctrlPoints[1].y) + parseInt(targetPosition.y);
|
||||
|
||||
sPos = mindplot.util.Shape.calculateRelationShipPointCoordinates(sourceTopic, spoint);
|
||||
tPos = mindplot.util.Shape.calculateRelationShipPointCoordinates(targetTopic, tpoint);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -43,7 +43,9 @@ mindplot.RelationshipPivot = new Class({
|
||||
|
||||
this._pivot = new web2d.CurvedLine();
|
||||
this._pivot.setStyle(web2d.CurvedLine.SIMPLE_LINE);
|
||||
this._pivot.setFrom(sourcePos.x, sourcePos.y);
|
||||
|
||||
var fromPos = this._calculateFromPosition(sourcePos);
|
||||
this._pivot.setFrom(fromPos.x, fromPos.y);
|
||||
|
||||
this._pivot.setTo(targetPos.x, targetPos.y);
|
||||
this._pivot.setStroke(2, 'solid', strokeColor);
|
||||
@@ -54,7 +56,6 @@ mindplot.RelationshipPivot = new Class({
|
||||
this._startArrow.setStrokeWidth(2);
|
||||
this._startArrow.setFrom(sourcePos.x, sourcePos.y);
|
||||
|
||||
|
||||
this._workspace.appendChild(this._pivot);
|
||||
this._workspace.appendChild(this._startArrow);
|
||||
|
||||
@@ -99,8 +100,13 @@ mindplot.RelationshipPivot = new Class({
|
||||
var pos = screen.getWorkspaceMousePosition(event);
|
||||
|
||||
// Leave the arrow a couple of pixels away from the cursor.
|
||||
var gapDistance = Math.sign(pos.x - this._sourceTopic.getPosition().x) * 5;
|
||||
var sourcePosition = this._sourceTopic.getPosition();
|
||||
var gapDistance = Math.sign(pos.x - sourcePosition.x) * 5;
|
||||
|
||||
var sPos = this._calculateFromPosition(pos);
|
||||
this._pivot.setFrom(sPos.x, sPos.y);
|
||||
|
||||
// Update target position ...
|
||||
this._pivot.setTo(pos.x - gapDistance, pos.y);
|
||||
|
||||
var controlPoints = this._pivot.getControlPoints();
|
||||
@@ -118,6 +124,21 @@ mindplot.RelationshipPivot = new Class({
|
||||
event.stopPropagation();
|
||||
},
|
||||
|
||||
_calculateFromPosition:function (toPosition) {
|
||||
|
||||
// Calculate origin position ...
|
||||
var sourcePosition = this._sourceTopic.getPosition();
|
||||
if (this._sourceTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
sourcePosition = mindplot.util.Shape.workoutIncomingConnectionPoint(this._sourceTopic, toPosition);
|
||||
}
|
||||
var controlPoint = mindplot.util.Shape.calculateDefaultControlPoints(sourcePosition, toPosition);
|
||||
|
||||
var spoint = new core.Point();
|
||||
spoint.x = parseInt(controlPoint[0].x) + parseInt(sourcePosition.x);
|
||||
spoint.y = parseInt(controlPoint[0].y) + parseInt(sourcePosition.y);
|
||||
return mindplot.util.Shape.calculateRelationShipPointCoordinates(this._sourceTopic, spoint);
|
||||
},
|
||||
|
||||
_connectOnFocus:function (targetTopic) {
|
||||
var sourceTopic = this._sourceTopic;
|
||||
var mindmap = this._designer.getMindmap();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -18,15 +18,22 @@
|
||||
|
||||
mindplot.RESTPersistenceManager = new Class({
|
||||
Extends:mindplot.PersistenceManager,
|
||||
initialize:function (saveUrl, revertUrl) {
|
||||
initialize:function (options) {
|
||||
this.parent();
|
||||
$assert(saveUrl, "saveUrl can not be null");
|
||||
$assert(revertUrl, "revertUrl can not be null");
|
||||
this.saveUrl = saveUrl;
|
||||
this.revertUrl = revertUrl;
|
||||
$assert(options.documentUrl, "documentUrl can not be null");
|
||||
$assert(options.revertUrl, "revertUrl can not be null");
|
||||
$assert(options.lockUrl, "lockUrl can not be null");
|
||||
$assert(options.session, "session can not be null");
|
||||
$assert(options.timestamp, "timestamp can not be null");
|
||||
|
||||
this.documentUrl = options.documentUrl;
|
||||
this.revertUrl = options.revertUrl;
|
||||
this.lockUrl = options.lockUrl;
|
||||
this.timestamp = options.timestamp;
|
||||
this.session = options.session;
|
||||
},
|
||||
|
||||
saveMapXml:function (mapId, mapXml, pref, saveHistory, events) {
|
||||
saveMapXml:function (mapId, mapXml, pref, saveHistory, events, sync) {
|
||||
|
||||
var data = {
|
||||
id:mapId,
|
||||
@@ -34,25 +41,73 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
properties:pref
|
||||
};
|
||||
|
||||
var request = new Request({
|
||||
url:this.saveUrl.replace("{id}", mapId) + "?minor=" + !saveHistory,
|
||||
method:'put',
|
||||
onSuccess:function (responseText, responseXML) {
|
||||
events.onSuccess();
|
||||
var persistence = this;
|
||||
var query = "minor=" + !saveHistory;
|
||||
query = query + "×tamp=" + this.timestamp;
|
||||
query = query + "&session=" + this.session;
|
||||
|
||||
},
|
||||
onException:function (headerName, value) {
|
||||
events.onError();
|
||||
},
|
||||
onFailure:function (xhr) {
|
||||
var responseText = xhr.responseText;
|
||||
events.onError(JSON.decode(responseText));
|
||||
},
|
||||
headers:{"Content-Type":"application/json", "Accept":"application/json"},
|
||||
emulation:false,
|
||||
urlEncoded:false
|
||||
});
|
||||
request.put(JSON.encode(data));
|
||||
if (!persistence.onSave) {
|
||||
|
||||
// Mark save in process and fire a event unlocking the save ...
|
||||
persistence.onSave = true;
|
||||
persistence.clearTimeout = setTimeout(function () {
|
||||
persistence.clearTimeout = null;
|
||||
persistence.onSave = false;
|
||||
}, 10000);
|
||||
|
||||
var request = new Request({
|
||||
url:this.documentUrl.replace("{id}", mapId) + "?" + query,
|
||||
method:'put',
|
||||
async:!sync,
|
||||
|
||||
onSuccess:function (responseText, responseXML) {
|
||||
persistence.timestamp = responseText;
|
||||
events.onSuccess();
|
||||
},
|
||||
|
||||
onException:function (headerName, value) {
|
||||
events.onError(persistence._buildError());
|
||||
},
|
||||
|
||||
onComplete:function () {
|
||||
// Clear event timeout ...
|
||||
if (persistence.clearTimeout) {
|
||||
clearTimeout(persistence.clearTimeout);
|
||||
}
|
||||
persistence.onSave = false;
|
||||
},
|
||||
|
||||
onFailure:function (xhr) {
|
||||
|
||||
var responseText = xhr.responseText;
|
||||
var userMsg = {severity:"SEVERE", message:$msg('SAVE_COULD_NOT_BE_COMPLETED')};
|
||||
|
||||
var contentType = this.getHeader("Content-Type");
|
||||
if (contentType != null && contentType.indexOf("application/json") != -1) {
|
||||
var serverMsg = null;
|
||||
try {
|
||||
serverMsg = JSON.decode(responseText);
|
||||
serverMsg = serverMsg.globalSeverity ? serverMsg : null;
|
||||
} catch (e) {
|
||||
// Message could not be decoded ...
|
||||
}
|
||||
userMsg = persistence._buildError(serverMsg);
|
||||
|
||||
} else {
|
||||
if (this.status == 405) {
|
||||
userMsg = {severity:"SEVERE", message:$msg('SESSION_EXPIRED')};
|
||||
}
|
||||
}
|
||||
events.onError(userMsg);
|
||||
persistence.onSave = false;
|
||||
},
|
||||
|
||||
headers:{"Content-Type":"application/json; charset=utf-8", "Accept":"application/json"},
|
||||
emulation:false,
|
||||
urlEncoded:false
|
||||
});
|
||||
request.put(JSON.encode(data));
|
||||
}
|
||||
},
|
||||
|
||||
discardChanges:function (mapId) {
|
||||
@@ -66,13 +121,69 @@ mindplot.RESTPersistenceManager = new Class({
|
||||
},
|
||||
onFailure:function () {
|
||||
},
|
||||
headers:{"Content-Type":"application/json", "Accept":"application/json"},
|
||||
headers:{"Content-Type":"application/json; charset=utf-8", "Accept":"application/json"},
|
||||
emulation:false,
|
||||
urlEncoded:false
|
||||
});
|
||||
request.post();
|
||||
}
|
||||
},
|
||||
|
||||
unlockMap:function (mindmap) {
|
||||
var mapId = mindmap.getId();
|
||||
var request = new Request({
|
||||
url:this.lockUrl.replace("{id}", mapId),
|
||||
async:false,
|
||||
method:'put',
|
||||
onSuccess:function () {
|
||||
|
||||
},
|
||||
onException:function () {
|
||||
},
|
||||
onFailure:function () {
|
||||
},
|
||||
headers:{"Content-Type":"text/plain"},
|
||||
emulation:false,
|
||||
urlEncoded:false
|
||||
});
|
||||
request.put("false");
|
||||
},
|
||||
|
||||
_buildError:function (jsonSeverResponse) {
|
||||
var message = jsonSeverResponse ? jsonSeverResponse.globalErrors[0] : null;
|
||||
var severity = jsonSeverResponse ? jsonSeverResponse.globalSeverity : null;
|
||||
|
||||
if (!message) {
|
||||
message = $msg('SAVE_COULD_NOT_BE_COMPLETED');
|
||||
}
|
||||
|
||||
if (!severity) {
|
||||
severity = "INFO";
|
||||
}
|
||||
return {severity:severity, message:message};
|
||||
},
|
||||
|
||||
loadMapDom:function (mapId) {
|
||||
// Let's try to open one from the local directory ...
|
||||
var xml;
|
||||
var xmlRequest = new Request({
|
||||
url:this.documentUrl.replace("{id}", mapId) + "/xml",
|
||||
method:'get',
|
||||
async:false,
|
||||
headers:{"Content-Type":"text/plain","Accept":"application/xml"},
|
||||
onSuccess:function (responseText) {
|
||||
xml = responseText;
|
||||
}
|
||||
});
|
||||
xmlRequest.send();
|
||||
|
||||
// If I could not load it from a file, hard code one.
|
||||
if (xml == null) {
|
||||
throw new Error("Map could not be loaded");
|
||||
}
|
||||
|
||||
var parser = new DOMParser();
|
||||
return parser.parseFromString(xml, "text/xml");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -43,14 +43,16 @@ mindplot.ScreenManager = new Class({
|
||||
if (event == 'click')
|
||||
this._clickEvents.push(listener);
|
||||
else
|
||||
$(this._divContainer).addEvent(event, listener);
|
||||
this._divContainer.addEvent(event, listener);
|
||||
},
|
||||
|
||||
removeEvent : function(event, listener) {
|
||||
if (event == 'click')
|
||||
if (event == 'click') {
|
||||
this._clickEvents.remove(listener);
|
||||
else
|
||||
$(this._divContainer).removeEvent(event, listener);
|
||||
}
|
||||
else{
|
||||
this._divContainer.removeEvent(event, listener);
|
||||
}
|
||||
},
|
||||
|
||||
fireEvent : function(type, event) {
|
||||
@@ -60,7 +62,7 @@ mindplot.ScreenManager = new Class({
|
||||
});
|
||||
}
|
||||
else {
|
||||
$(this._divContainer).fireEvent(type, event);
|
||||
this._divContainer.fireEvent(type, event);
|
||||
}
|
||||
},
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -83,6 +83,7 @@ mindplot.StandaloneActionDispatcher = new Class({
|
||||
topic.setText(value);
|
||||
return result;
|
||||
};
|
||||
commandFunc.commandType = "changeTextToTopic";
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, text);
|
||||
this.execute(command);
|
||||
@@ -242,18 +243,26 @@ mindplot.CommandContext = new Class({
|
||||
}
|
||||
|
||||
var designerTopics = this._designer.getModel().getTopics();
|
||||
return designerTopics.filter(function (topic) {
|
||||
var result = designerTopics.filter(function (topic) {
|
||||
return topicsIds.contains(topic.getId());
|
||||
});
|
||||
|
||||
if (result.length != topicsIds.length) {
|
||||
var ids = designerTopics.map(function (topic) {
|
||||
return topic.getId();
|
||||
});
|
||||
$assert(result.length == topicsIds.length, "Could not find topic. Result:" + result + ", Filter Criteria:" + topicsIds + ", Current Topics: [" + ids + "]");
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
deleteTopic:function (topic) {
|
||||
this._designer._removeTopic(topic);
|
||||
},
|
||||
|
||||
createTopic:function (model, isVisible) {
|
||||
createTopic:function (model) {
|
||||
$assert(model, "model can not be null");
|
||||
return this._designer._nodeModelToNodeGraph(model, isVisible);
|
||||
return this._designer._nodeModelToNodeGraph(model);
|
||||
},
|
||||
|
||||
createModel:function () {
|
||||
@@ -261,8 +270,13 @@ mindplot.CommandContext = new Class({
|
||||
return mindmap.createNode(mindplot.NodeModel.MAIN_TOPIC_TYPE);
|
||||
},
|
||||
|
||||
connect:function (childTopic, parentTopic, isVisible) {
|
||||
childTopic.connectTo(parentTopic, this._designer._workspace, isVisible);
|
||||
addTopic:function (topic) {
|
||||
var mindmap = this._designer.getMindmap();
|
||||
return mindmap.addBranch(topic.getModel());
|
||||
},
|
||||
|
||||
connect:function (childTopic, parentTopic) {
|
||||
childTopic.connectTo(parentTopic, this._designer._workspace);
|
||||
},
|
||||
|
||||
disconnect:function (topic) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -29,7 +29,7 @@ mindplot.Topic = new Class({
|
||||
|
||||
// Position a topic ....
|
||||
var pos = model.getPosition();
|
||||
if (pos != null && model.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
if (pos != null && this.isCentralTopic()) {
|
||||
this.setPosition(pos);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
var result = model.getShapeType();
|
||||
if (!$defined(result)) {
|
||||
result = this._defaultShapeType();
|
||||
result = mindplot.TopicStyle.defaultShapeType(this);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
@@ -134,7 +134,7 @@ mindplot.Topic = new Class({
|
||||
this._setBorderColor(brColor, false);
|
||||
|
||||
// Define the pointer ...
|
||||
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE && !this.isReadOnly()) {
|
||||
if (!this.isCentralTopic() && !this.isReadOnly()) {
|
||||
this._innerShape.setCursor('move');
|
||||
} else {
|
||||
this._innerShape.setCursor('default');
|
||||
@@ -259,7 +259,7 @@ mindplot.Topic = new Class({
|
||||
_buildIconGroup:function () {
|
||||
var textHeight = this.getTextShape().getFontHeight();
|
||||
var result = new mindplot.IconGroup(this.getId(), textHeight);
|
||||
var padding = this._getInnerPadding();
|
||||
var padding = mindplot.TopicStyle.getInnerPadding(this);
|
||||
result.setPosition(padding, padding);
|
||||
|
||||
// Load topic features ...
|
||||
@@ -274,22 +274,16 @@ mindplot.Topic = new Class({
|
||||
return result;
|
||||
},
|
||||
|
||||
addFeature:function (type, attributes, featureId) {
|
||||
addFeature:function (featureModel) {
|
||||
var iconGroup = this.getOrBuildIconGroup();
|
||||
this.closeEditors();
|
||||
|
||||
var model = this.getModel();
|
||||
|
||||
// Update model ...
|
||||
var feature = model.createFeature(type, attributes);
|
||||
if ($defined(featureId)) {
|
||||
feature.setId(featureId);
|
||||
}
|
||||
model.addFeature(feature);
|
||||
var model = this.getModel();
|
||||
model.addFeature(featureModel);
|
||||
|
||||
|
||||
var result = mindplot.TopicFeature.createIcon(this, feature, this.isReadOnly());
|
||||
iconGroup.addIcon(result, type == mindplot.TopicFeature.Icon.id && !this.isReadOnly());
|
||||
var result = mindplot.TopicFeature.createIcon(this, featureModel, this.isReadOnly());
|
||||
iconGroup.addIcon(result, featureModel.getType() == mindplot.TopicFeature.Icon.id && !this.isReadOnly());
|
||||
|
||||
this._adjustShapes();
|
||||
return result;
|
||||
@@ -340,7 +334,7 @@ mindplot.Topic = new Class({
|
||||
|
||||
if (!readOnly) {
|
||||
// Propagate mouse events ...
|
||||
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
if (!this.isCentralTopic()) {
|
||||
result.setCursor('move');
|
||||
} else {
|
||||
result.setCursor('default');
|
||||
@@ -350,10 +344,6 @@ mindplot.Topic = new Class({
|
||||
return result;
|
||||
},
|
||||
|
||||
_getInnerPadding:function () {
|
||||
throw "this must be implemented";
|
||||
},
|
||||
|
||||
setFontFamily:function (value, updateModel) {
|
||||
var textShape = this.getTextShape();
|
||||
textShape.setFontFamily(value);
|
||||
@@ -401,7 +391,7 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
var result = model.getFontWeight();
|
||||
if (!$defined(result)) {
|
||||
var font = this._defaultFontStyle();
|
||||
var font = mindplot.TopicStyle.defaultFontStyle(this);
|
||||
result = font.weight;
|
||||
}
|
||||
return result;
|
||||
@@ -411,7 +401,7 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
var result = model.getFontFamily();
|
||||
if (!$defined(result)) {
|
||||
var font = this._defaultFontStyle();
|
||||
var font = mindplot.TopicStyle.defaultFontStyle(this);
|
||||
result = font.font;
|
||||
}
|
||||
return result;
|
||||
@@ -421,7 +411,7 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
var result = model.getFontColor();
|
||||
if (!$defined(result)) {
|
||||
var font = this._defaultFontStyle();
|
||||
var font = mindplot.TopicStyle.defaultFontStyle(this);
|
||||
result = font.color;
|
||||
}
|
||||
return result;
|
||||
@@ -431,7 +421,7 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
var result = model.getFontStyle();
|
||||
if (!$defined(result)) {
|
||||
var font = this._defaultFontStyle();
|
||||
var font = mindplot.TopicStyle.defaultFontStyle(this);
|
||||
result = font.style;
|
||||
}
|
||||
return result;
|
||||
@@ -441,7 +431,7 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
var result = model.getFontSize();
|
||||
if (!$defined(result)) {
|
||||
var font = this._defaultFontStyle();
|
||||
var font = mindplot.TopicStyle.defaultFontStyle(this);
|
||||
result = font.size;
|
||||
}
|
||||
return result;
|
||||
@@ -458,7 +448,7 @@ mindplot.Topic = new Class({
|
||||
|
||||
_setText:function (text, updateModel) {
|
||||
var textShape = this.getTextShape();
|
||||
textShape.setText(text == null ? this._defaultText() : text);
|
||||
textShape.setText(text == null ? mindplot.TopicStyle.defaultText(this) : text);
|
||||
|
||||
if ($defined(updateModel) && updateModel) {
|
||||
var model = this.getModel();
|
||||
@@ -480,7 +470,7 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
var result = model.getText();
|
||||
if (!$defined(result)) {
|
||||
result = this._defaultText();
|
||||
result = mindplot.TopicStyle.defaultText(this);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
@@ -508,7 +498,7 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
var result = model.getBackgroundColor();
|
||||
if (!$defined(result)) {
|
||||
result = this._defaultBackgroundColor();
|
||||
result = mindplot.TopicStyle.defaultBackgroundColor(this);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
@@ -536,7 +526,7 @@ mindplot.Topic = new Class({
|
||||
var model = this.getModel();
|
||||
var result = model.getBorderColor();
|
||||
if (!$defined(result)) {
|
||||
result = this._defaultBorderColor();
|
||||
result = mindplot.TopicStyle.defaultBorderColor(this);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
@@ -608,7 +598,7 @@ mindplot.Topic = new Class({
|
||||
|
||||
areChildrenShrunken:function () {
|
||||
var model = this.getModel();
|
||||
return model.areChildrenShrunken();
|
||||
return model.areChildrenShrunken() && !this.isCentralTopic();
|
||||
},
|
||||
|
||||
isCollapsed:function () {
|
||||
@@ -637,9 +627,20 @@ mindplot.Topic = new Class({
|
||||
var elements = this._flatten2DElements(this);
|
||||
var fade = new mindplot.util.FadeEffect(elements, !value);
|
||||
fade.addEvent('complete', function () {
|
||||
// Set focus on the parent node ...
|
||||
if (value) {
|
||||
this.setOnFocus(true);
|
||||
}
|
||||
|
||||
});
|
||||
// Set focus in false for all the children ...
|
||||
elements.forEach(function (elem) {
|
||||
if (elem.setOnFocus) {
|
||||
elem.setOnFocus(false);
|
||||
}
|
||||
});
|
||||
}.bind(this));
|
||||
fade.start();
|
||||
|
||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeShrinkEvent, model);
|
||||
|
||||
},
|
||||
@@ -829,7 +830,7 @@ mindplot.Topic = new Class({
|
||||
setBranchVisibility:function (value) {
|
||||
var current = this;
|
||||
var parent = this;
|
||||
while (parent != null && parent.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
while (parent != null && !parent.isCentralTopic()) {
|
||||
current = parent;
|
||||
parent = current.getParent();
|
||||
}
|
||||
@@ -843,7 +844,14 @@ mindplot.Topic = new Class({
|
||||
// Hide all children...
|
||||
this._setChildrenVisibility(value);
|
||||
|
||||
// If there there are connection to the node, topic must be hidden.
|
||||
this._setRelationshipLinesVisibility(value);
|
||||
|
||||
// If it's connected, the connection must be rendered.
|
||||
var outgoingLine = this.getOutgoingLine();
|
||||
if (outgoingLine) {
|
||||
outgoingLine.setVisibility(value);
|
||||
}
|
||||
},
|
||||
|
||||
moveToBack:function () {
|
||||
@@ -880,7 +888,12 @@ mindplot.Topic = new Class({
|
||||
|
||||
_setRelationshipLinesVisibility:function (value) {
|
||||
this._relationships.each(function (relationship) {
|
||||
relationship.setVisibility(value);
|
||||
var sourceTopic = relationship.getSourceTopic();
|
||||
var targetTopic = relationship.getTargetTopic();
|
||||
|
||||
var targetParent = targetTopic.getModel().getParent();
|
||||
var sourceParent = sourceTopic.getModel().getParent();
|
||||
relationship.setVisibility(value && (targetParent == null || !targetParent.areChildrenShrunken()) && (sourceParent == null || !sourceParent.areChildrenShrunken()));
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1023,7 +1036,7 @@ mindplot.Topic = new Class({
|
||||
model.setOrder(value);
|
||||
},
|
||||
|
||||
connectTo:function (targetTopic, workspace, isVisible) {
|
||||
connectTo:function (targetTopic, workspace) {
|
||||
$assert(!this._outgoingLine, 'Could not connect an already connected node');
|
||||
$assert(targetTopic != this, 'Circular connection are not allowed');
|
||||
$assert(targetTopic, 'Parent Graph can not be null');
|
||||
@@ -1040,9 +1053,8 @@ mindplot.Topic = new Class({
|
||||
|
||||
// Create a connection line ...
|
||||
var outgoingLine = new mindplot.ConnectionLine(this, targetTopic);
|
||||
if ($defined(isVisible)) {
|
||||
outgoingLine.setVisibility(isVisible);
|
||||
}
|
||||
outgoingLine.setVisibility(false);
|
||||
|
||||
this._outgoingLine = outgoingLine;
|
||||
workspace.appendChild(outgoingLine);
|
||||
|
||||
@@ -1074,7 +1086,6 @@ mindplot.Topic = new Class({
|
||||
if (this.isInWorkspace()) {
|
||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeConnectEvent, {parentNode:targetTopic.getModel(), childNode:this.getModel()});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
appendChild:function (child) {
|
||||
@@ -1111,7 +1122,7 @@ mindplot.Topic = new Class({
|
||||
var elem = this.get2DElement();
|
||||
workspace.appendChild(elem);
|
||||
if (!this.isInWorkspace()) {
|
||||
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
if (!this.isCentralTopic()) {
|
||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeAdded, this.getModel());
|
||||
}
|
||||
|
||||
@@ -1154,7 +1165,7 @@ mindplot.Topic = new Class({
|
||||
var textHeight = textShape.getHeight();
|
||||
textHeight = textHeight != 0 ? textHeight : 20;
|
||||
|
||||
var topicPadding = this._getInnerPadding();
|
||||
var topicPadding = mindplot.TopicStyle.getInnerPadding(this);
|
||||
|
||||
// Adjust the icon size to the size of the text ...
|
||||
var iconGroup = this.getOrBuildIconGroup();
|
||||
@@ -1197,8 +1208,10 @@ mindplot.Topic = new Class({
|
||||
var relationships = child.getRelationships();
|
||||
result = result.concat(relationships);
|
||||
|
||||
var innerChilds = this._flatten2DElements(child);
|
||||
result = result.concat(innerChilds);
|
||||
if (!child.areChildrenShrunken()) {
|
||||
var innerChilds = this._flatten2DElements(child);
|
||||
result = result.concat(innerChilds);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
@@ -1216,7 +1229,13 @@ mindplot.Topic = new Class({
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
isCentralTopic:function () {
|
||||
return this.getModel().getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -41,12 +41,12 @@ mindplot.TopicFeature = {
|
||||
});
|
||||
},
|
||||
|
||||
createModel:function (id, attributes) {
|
||||
$assert(id, 'type can not be null');
|
||||
createModel:function (type, attributes) {
|
||||
$assert(type, 'type can not be null');
|
||||
$assert(attributes, 'attributes can not be null');
|
||||
|
||||
var model = mindplot.TopicFeature._featuresMetadataById.filter(function (elem) {
|
||||
return elem.id == id;
|
||||
return elem.id == type;
|
||||
})[0].model;
|
||||
return new model(attributes);
|
||||
},
|
||||
|
132
mindplot/src/main/javascript/TopicStyle.js
Normal file
132
mindplot/src/main/javascript/TopicStyle.js
Normal file
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
mindplot.TopicStyle = new Class({
|
||||
Static:{
|
||||
_getStyles:function (topic) {
|
||||
$assert(topic, "topic can not be null");
|
||||
|
||||
var result;
|
||||
if (topic.isCentralTopic()) {
|
||||
result = mindplot.TopicStyle.STYLES.CENTRAL_TOPIC;
|
||||
} else {
|
||||
var targetTopic = topic.getOutgoingConnectedTopic();
|
||||
if ($defined(targetTopic)) {
|
||||
if (targetTopic.isCentralTopic()) {
|
||||
result = mindplot.TopicStyle.STYLES.MAIN_TOPIC;
|
||||
} else {
|
||||
result = mindplot.TopicStyle.STYLES.SUB_TOPIC;
|
||||
}
|
||||
} else {
|
||||
result = mindplot.TopicStyle.STYLES.ISOLATED_TOPIC;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
defaultText:function (topic) {
|
||||
var msgKey = this._getStyles(topic).msgKey;
|
||||
return $msg(msgKey);
|
||||
},
|
||||
|
||||
defaultFontStyle:function (topic) {
|
||||
return this._getStyles(topic).fontStyle;
|
||||
},
|
||||
|
||||
defaultBackgroundColor:function (topic) {
|
||||
return this._getStyles(topic).backgroundColor;
|
||||
},
|
||||
|
||||
defaultBorderColor:function (topic) {
|
||||
return this._getStyles(topic).borderColor;
|
||||
},
|
||||
|
||||
getInnerPadding:function (topic) {
|
||||
return this._getStyles(topic).innerPadding;
|
||||
},
|
||||
|
||||
defaultShapeType:function (topic) {
|
||||
return this._getStyles(topic).shapeType;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mindplot.TopicStyle.STYLES =
|
||||
{
|
||||
CENTRAL_TOPIC:{
|
||||
borderColor:'rgb(57,113,177)',
|
||||
backgroundColor:'rgb(80,157,192)',
|
||||
fontStyle:{
|
||||
font:"Verdana",
|
||||
size:10,
|
||||
style:"normal",
|
||||
weight:"bold",
|
||||
color:"#ffffff"
|
||||
},
|
||||
msgKey:'CENTRAL_TOPIC',
|
||||
innerPadding:11,
|
||||
shapeType:mindplot.model.TopicShape.ROUNDED_RECT
|
||||
},
|
||||
|
||||
MAIN_TOPIC:{
|
||||
borderColor:'rgb(2,59,185)',
|
||||
backgroundColor:'rgb(224,229,239)',
|
||||
fontStyle:{
|
||||
font:"Arial",
|
||||
size:8,
|
||||
style:"normal",
|
||||
weight:"normal",
|
||||
color:"rgb(82,92,97)"
|
||||
},
|
||||
msgKey:'MAIN_TOPIC',
|
||||
innerPadding:3,
|
||||
shapeType:mindplot.model.TopicShape.LINE
|
||||
|
||||
},
|
||||
|
||||
SUB_TOPIC:{
|
||||
borderColor:'rgb(2,59,185)',
|
||||
backgroundColor:'rgb(224,229,239)',
|
||||
fontStyle:{
|
||||
font:"Arial",
|
||||
size:6,
|
||||
style:"normal",
|
||||
weight:"normal",
|
||||
color:"rgb(82,92,97)"
|
||||
},
|
||||
msgKey:'SUB_TOPIC',
|
||||
innerPadding:3,
|
||||
shapeType:mindplot.model.TopicShape.LINE
|
||||
},
|
||||
|
||||
ISOLATED_TOPIC:{
|
||||
borderColor:'rgb(2,59,185)',
|
||||
backgroundColor:'rgb(224,229,239)',
|
||||
fontStyle:{
|
||||
font:"Verdana",
|
||||
size:8,
|
||||
style:"normal",
|
||||
weight:"normal",
|
||||
color:"rgb(82,92,97)"
|
||||
},
|
||||
msgKey:'ISOLATED_TOPIC',
|
||||
innerPadding:4,
|
||||
shapeType:mindplot.model.TopicShape.LINE
|
||||
}
|
||||
};
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.collaboration.CollaborationManager = new Class({
|
||||
initialize:function() {
|
||||
this.collaborativeModelReady = false;
|
||||
this.collaborativeModelReady = null;
|
||||
},
|
||||
|
||||
setCollaborativeFramework : function(framework) {
|
||||
this._collaborativeFramework = framework;
|
||||
},
|
||||
|
||||
buildMindmap: function() {
|
||||
return this._collaborativeFramework.buildMindmap();
|
||||
},
|
||||
|
||||
getCollaborativeFramework:function() {
|
||||
return this._collaborativeFramework;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
mindplot.collaboration.CollaborationManager.getInstance = function() {
|
||||
if (!$defined(mindplot.collaboration.CollaborationManager.__collaborationManager)) {
|
||||
mindplot.collaboration.CollaborationManager.__collaborationManager = new mindplot.collaboration.CollaborationManager();
|
||||
}
|
||||
return mindplot.collaboration.CollaborationManager.__collaborationManager;
|
||||
};
|
||||
mindplot.collaboration.CollaborationManager.getInstance();
|
@@ -1,54 +0,0 @@
|
||||
mindplot.collaboration.framework.AbstractCollaborativeFramework = new Class({
|
||||
initialize: function(model) {
|
||||
$assert(model, "model can not be null");
|
||||
this._model = model;
|
||||
this._actionDispatcher = null;
|
||||
},
|
||||
|
||||
getModel : function() {
|
||||
return this._model;
|
||||
},
|
||||
|
||||
buildMindmap : function() {
|
||||
|
||||
var cmind = this.getModel();
|
||||
var mmind = new mindplot.model.Mindmap();
|
||||
cmind.copyTo(mmind);
|
||||
return mmind;
|
||||
},
|
||||
|
||||
_findTopic : function(nodes, id) {
|
||||
var result;
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var node = nodes[i];
|
||||
if (node.getId() == id) {
|
||||
result = node;
|
||||
} else {
|
||||
var children = node.getChildren();
|
||||
result = this._findTopic(children, id)
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
getTopic:function(id) {
|
||||
$assert($defined(id), "id can not be null");
|
||||
var branches = this.getModel().getBranches();
|
||||
var result = this._findTopic(branches, id);
|
||||
$assert(result, "Could not find topic:" + id);
|
||||
return result;
|
||||
},
|
||||
|
||||
getActionDispatcher:function() {
|
||||
if (this._actionDispatcher == null) {
|
||||
var context = mindplot.ActionDispatcher.getInstance()._commandContext;
|
||||
this._actionDispatcher = new mindplot.StandaloneActionDispatcher(context);
|
||||
}
|
||||
return this._actionDispatcher;
|
||||
}
|
||||
|
||||
});
|
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.collaboration.framework.AbstractCollaborativeModelFactory = new Class({
|
||||
createNewMindmap:function() {
|
||||
throw "Unsupported operation";
|
||||
},
|
||||
buildMindmap:function(model) {
|
||||
throw "Unsupported operation";
|
||||
}
|
||||
});
|
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.collaboration.framework.brix.BrixCollaborativeModelFactory = new Class({
|
||||
Extends:mindplot.collaboration.framework.AbstractCollaborativeModelFactory,
|
||||
initialize:function(brixFramework) {
|
||||
$assert(brixFramework, 'brixFramework can not be null');
|
||||
this._brixFramework = brixFramework;
|
||||
},
|
||||
|
||||
createNewMindmap : function() {
|
||||
var mindmap = new mindplot.collaboration.framework.brix.model.Mindmap(this._brixFramework);
|
||||
var node = mindmap.createNode(mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE, 0);
|
||||
mindmap.setVersion('pela-brix');
|
||||
mindmap.addBranch(node);
|
||||
return mindmap;
|
||||
},
|
||||
|
||||
buildMindmap : function(model) {
|
||||
return new mindplot.collaboration.framework.brix.model.Mindmap(this._brixFramework, model);
|
||||
}
|
||||
});
|
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.collaboration.framework.brix.BrixFramework = new Class({
|
||||
Extends: mindplot.collaboration.framework.AbstractCollaborativeFramework,
|
||||
initialize: function(model, app) {
|
||||
this._app = app;
|
||||
var factory = new mindplot.collaboration.framework.brix.BrixCollaborativeModelFactory(this);
|
||||
var root = this.getBrixModel().getRoot();
|
||||
var cmodel = null;
|
||||
var brixMap = root.get("mindmap");
|
||||
if (brixMap != null) {
|
||||
cmodel = factory.buildMindmap(brixMap);
|
||||
} else {
|
||||
cmodel = factory.createNewMindmap();
|
||||
root.put("mindmap", cmodel.getBrixModel());
|
||||
}
|
||||
this.parent(cmodel);
|
||||
console.log("cmodel:" + cmodel.inspect());
|
||||
},
|
||||
|
||||
getBrixModel:function() {
|
||||
return this._app.getModel();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
instanciated = false;
|
||||
mindplot.collaboration.framework.brix.BrixFramework.init = function(onload) {
|
||||
$assert(onload, "load function can not be null");
|
||||
|
||||
if (!instanciated) {
|
||||
var app = new goog.collab.CollaborativeApp();
|
||||
mindplot.collaboration.framework.brix.BrixFramework.buildMenu(app);
|
||||
app.start();
|
||||
|
||||
app.addListener('modelLoad', function(model) {
|
||||
var framework = new mindplot.collaboration.framework.brix.BrixFramework(model, app);
|
||||
mindplot.collaboration.CollaborationManager.getInstance().setCollaborativeFramework(framework);
|
||||
onload();
|
||||
}.bind(this));
|
||||
instanciated = true;
|
||||
}
|
||||
};
|
||||
|
||||
mindplot.collaboration.framework.brix.BrixFramework.buildMenu = function(app) {
|
||||
var menuBar = new goog.collab.ui.MenuBar();
|
||||
|
||||
// Configure toolbar menu ...
|
||||
var fileMenu = menuBar.addSubMenu("File");
|
||||
fileMenu.addItem("Save", function() {
|
||||
});
|
||||
fileMenu.addItem("Export", function() {
|
||||
});
|
||||
|
||||
var editMenu = menuBar.addSubMenu("Edit");
|
||||
editMenu.addItem("Undo", function() {
|
||||
});
|
||||
editMenu.addItem("Redo", function() {
|
||||
});
|
||||
|
||||
var formatMenu = menuBar.addSubMenu("Format");
|
||||
formatMenu.addItem("Bold", function() {
|
||||
});
|
||||
|
||||
var helpMenu = menuBar.addSubMenu("Help");
|
||||
helpMenu.addItem("Shortcuts", function() {
|
||||
});
|
||||
|
||||
app.setMenuBar(menuBar);
|
||||
};
|
||||
|
||||
|
@@ -1,106 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
mindplot.collaboration.framework.brix.model.Mindmap = new Class({
|
||||
Extends:mindplot.model.IMindmap,
|
||||
initialize:function(brixFramework, brixModel) {
|
||||
$assert(brixFramework, 'brixFramework can not be null');
|
||||
|
||||
this._brixFramework = brixFramework;
|
||||
if (!$defined(brixModel)) {
|
||||
this._brixModel = this._createBrixModel();
|
||||
} else {
|
||||
this._brixModel = brixModel;
|
||||
}
|
||||
},
|
||||
|
||||
getVersion: function() {
|
||||
return this._brixModel.get('version');
|
||||
},
|
||||
|
||||
setVersion: function(value) {
|
||||
this._brixModel.put('version', value);
|
||||
},
|
||||
|
||||
getDescription: function() {
|
||||
return this._brixModel.get('description');
|
||||
},
|
||||
|
||||
setDescription: function(value) {
|
||||
this._brixModel.put('description', value);
|
||||
},
|
||||
|
||||
_createBrixModel:function() {
|
||||
var model = this._brixFramework.getBrixModel().create("Map");
|
||||
var branches = this._brixFramework.getBrixModel().create("List");
|
||||
model.put("branches", branches);
|
||||
return model;
|
||||
},
|
||||
|
||||
getBrixModel:function() {
|
||||
return this._brixModel;
|
||||
},
|
||||
|
||||
getBranches : function() {
|
||||
var result = [];
|
||||
var branches = this._brixModel.get("branches");
|
||||
for (var i = 0; i < branches.size(); i++) {
|
||||
var node = branches.get(i);
|
||||
if (node != null) {
|
||||
var nodeModel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, node, this);
|
||||
result.push(nodeModel);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
addBranch : function(nodeModel) {
|
||||
$assert(nodeModel, "nodeModel can not be null");
|
||||
var branches = this._brixModel.get("branches");
|
||||
|
||||
// @Todo: Hack ?
|
||||
var newModel = mindplot.collaboration.framework.brix.model.NodeModel.create(this._brixFramework, this, nodeModel.getType(), nodeModel.getId());
|
||||
nodeModel.copyTo(newModel);
|
||||
|
||||
branches.add(newModel);
|
||||
},
|
||||
|
||||
removeBranch : function(nodeModel) {
|
||||
$assert(nodeModel, "nodeModel can not be null");
|
||||
$assert(nodeModel.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE, "central topic can not be removed");
|
||||
|
||||
var branches = this._brixModel.get("branches");
|
||||
for (var i = 0; i < branches.size(); i++) {
|
||||
|
||||
// @Todo: remove should remove null elements ...
|
||||
var branch = branches.get(i);
|
||||
if (branch != null) {
|
||||
if (branch == nodeModel.getBrixModel()) {
|
||||
branches.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
createNode : function(type, id) {
|
||||
return mindplot.collaboration.framework.brix.model.NodeModel.create(this._brixFramework, this, type, id);
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
@@ -1,168 +0,0 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.collaboration.framework.brix.model.NodeModel = new Class({
|
||||
Extends: mindplot.model.INodeModel,
|
||||
initialize : function(brixFramework, brixModel, mindmap) {
|
||||
$assert(brixFramework, "brixFramework can not null");
|
||||
$assert(brixModel, "brixModel can not null");
|
||||
$assert(mindmap && mindmap.getBranches, "mindmap can not null");
|
||||
|
||||
this.parent(mindmap);
|
||||
this._brixModel = brixModel;
|
||||
this._brixFramework = brixFramework;
|
||||
this._addBrixListeners();
|
||||
},
|
||||
|
||||
_addBrixListeners : function() {
|
||||
|
||||
// Nodes creation should be cached ...
|
||||
if (!this._brixModel.__registered) {
|
||||
// Register listener for properties changes ....
|
||||
var actionDispatcher = this._brixFramework.getActionDispatcher();
|
||||
this._brixModel.addListener("valueChanged", function(event) {
|
||||
var key = event.getProperty();
|
||||
var value = event.getNewValue();
|
||||
|
||||
var funName = 'change' + key.capitalize() + 'ToTopic';
|
||||
if (!$defined(actionDispatcher[funName])) {
|
||||
throw "No implementation for:" + funName;
|
||||
}
|
||||
console.log("This action dispatcher:" + funName);
|
||||
|
||||
actionDispatcher[funName]([this.getId()], value);
|
||||
}.bind(this));
|
||||
|
||||
var children = this._brixModel.get("children");
|
||||
children.addListener("valuesAdded", function(event) {
|
||||
try {
|
||||
|
||||
var brixChildren = event.getValues();
|
||||
for (var i = 0; i < brixChildren.size(); i++) {
|
||||
var brixNodeModel = brixChildren.get(0);
|
||||
|
||||
var cmodel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, brixNodeModel, this.getMindmap());
|
||||
|
||||
// @Todo: This is not ok. Is using designer global variable.
|
||||
var model = new mindplot.model.NodeModel(cmodel.getType(), designer.getMindmap(), this.getId());
|
||||
cmodel.copyTo(model);
|
||||
|
||||
actionDispatcher.addTopics([model], [this.getId()]);
|
||||
}
|
||||
} catch(e) {
|
||||
console.trace();
|
||||
}
|
||||
|
||||
}.bind(this));
|
||||
|
||||
children.addListener("valuesRemoved", function(event) {
|
||||
try {
|
||||
var brixChildren = event.getValues();
|
||||
for (var i = 0; i < brixChildren.size(); i++) {
|
||||
var brixNodeModel = brixChildren.get(i);
|
||||
var cmodel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, brixNodeModel, this.getMindmap());
|
||||
actionDispatcher.deleteEntities([cmodel.getId()]);
|
||||
}
|
||||
} catch(e) {
|
||||
console.trace();
|
||||
}
|
||||
|
||||
}.bind(this));
|
||||
this._brixModel.__registered = true;
|
||||
}
|
||||
},
|
||||
|
||||
getChildren : function() {
|
||||
var result = [];
|
||||
var children = this._brixModel.get("children");
|
||||
for (var i = 0; i < children.size(); i++) {
|
||||
var node = children.get(i);
|
||||
var nodeModel = new mindplot.collaboration.framework.brix.model.NodeModel(this._brixFramework, node, this.getMindmap());
|
||||
nodeModel.setParent(this);
|
||||
result.push(nodeModel);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
|
||||
getBrixModel:function() {
|
||||
return this._brixModel;
|
||||
},
|
||||
|
||||
putProperty : function(key, value) {
|
||||
$defined(key, 'key can not be null');
|
||||
this._brixModel.put(key, value);
|
||||
},
|
||||
|
||||
getProperty : function(key) {
|
||||
$defined(key, 'key can not be null');
|
||||
return this._brixModel.get(key);
|
||||
},
|
||||
|
||||
getPropertiesKeys : function() {
|
||||
var keys = this._brixModel.getKeys();
|
||||
keys.erase('children');
|
||||
keys.erase('icons');
|
||||
keys.erase('links');
|
||||
keys.erase('notes');
|
||||
return keys;
|
||||
},
|
||||
|
||||
getParent : function() {
|
||||
return this._brixModel._parent;
|
||||
},
|
||||
|
||||
setParent : function(parent) {
|
||||
this._brixModel._parent = parent;
|
||||
},
|
||||
|
||||
appendChild : function(node) {
|
||||
$assert(node && node.isNodeModel(), 'Only NodeModel can be appended to Mindmap object');
|
||||
var children = this._brixModel.get("children");
|
||||
children.add(node.getBrixModel());
|
||||
this.setParent(this);
|
||||
},
|
||||
|
||||
removeChild : function(child) {
|
||||
$assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object.');
|
||||
var children = this._brixModel.get("children");
|
||||
for (var i = 0; i < children.size(); i++) {
|
||||
if (children.get(i) == child.getBrixModel()) {
|
||||
children.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.setParent(null);
|
||||
}
|
||||
});
|
||||
|
||||
mindplot.collaboration.framework.brix.model.NodeModel.create = function(brixFramework, mindmap, type, id) {
|
||||
$assert(brixFramework, 'brixFramework can not be null');
|
||||
$assert(mindmap, 'mindmap can not be null');
|
||||
$assert(type, 'type can not be null');
|
||||
$assert($defined(id), 'id can not be null');
|
||||
|
||||
var brixModel = brixFramework.getBrixModel().create("Map");
|
||||
brixModel.put("type", type);
|
||||
brixModel.put("id", id);
|
||||
|
||||
var children = brixFramework.getBrixModel().create("List");
|
||||
brixModel.put("children", children);
|
||||
|
||||
return new mindplot.collaboration.framework.brix.model.NodeModel(brixFramework, brixModel, mindmap);
|
||||
};
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
mindplot.commands.AddFeatureToTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicId, featureType, attributes) {
|
||||
initialize:function (topicId, featureType, attributes) {
|
||||
|
||||
$assert($defined(topicId), 'topicId can not be null');
|
||||
$assert(featureType, 'featureType can not be null');
|
||||
@@ -28,15 +28,21 @@ mindplot.commands.AddFeatureToTopicCommand = new Class({
|
||||
this._topicId = topicId;
|
||||
this._featureType = featureType;
|
||||
this._attributes = attributes;
|
||||
this._featureModel = null;
|
||||
},
|
||||
|
||||
execute: function(commandContext) {
|
||||
execute:function (commandContext) {
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var icon = topic.addFeature(this._featureType, this._attributes);
|
||||
this._featureModel = icon.getModel();
|
||||
|
||||
// Feature must be created only one time.
|
||||
if (!this._featureModel) {
|
||||
var model = topic.getModel();
|
||||
this._featureModel = model.createFeature(this._featureType, this._attributes);
|
||||
}
|
||||
topic.addFeature(this._featureModel);
|
||||
},
|
||||
|
||||
undoExecute: function(commandContext) {
|
||||
undoExecute:function (commandContext) {
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
topic.removeFeature(this._featureModel);
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -32,7 +32,7 @@ mindplot.commands.AddTopicCommand = new Class({
|
||||
this._models.each(function (model, index) {
|
||||
|
||||
// Add a new topic ...
|
||||
var topic = commandContext.createTopic(model, false);
|
||||
var topic = commandContext.createTopic(model);
|
||||
|
||||
// Connect to topic ...
|
||||
if (this._parentsIds) {
|
||||
@@ -41,26 +41,36 @@ mindplot.commands.AddTopicCommand = new Class({
|
||||
var parentTopic = commandContext.findTopics(parentId)[0];
|
||||
commandContext.connect(topic, parentTopic);
|
||||
}
|
||||
}else {
|
||||
commandContext.addTopic(topic);
|
||||
}
|
||||
|
||||
// Finally, focus ...
|
||||
// Select just created node ...
|
||||
var designer = commandContext._designer;
|
||||
var fade = new mindplot.util.FadeEffect([topic, topic.getOutgoingLine()], true);
|
||||
fade.addEvent('complete', function () {
|
||||
designer.onObjectFocusEvent(topic);
|
||||
topic.setOnFocus(true);
|
||||
});
|
||||
fade.start();
|
||||
designer.onObjectFocusEvent(topic);
|
||||
topic.setOnFocus(true);
|
||||
|
||||
// Render node ...
|
||||
topic.setVisibility(true);
|
||||
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
undoExecute:function (commandContext) {
|
||||
// Finally, delete the topic from the workspace ...
|
||||
// Delete disconnected the nodes. Create a copy of the topics ...
|
||||
var clonedModel = [];
|
||||
this._models.each(function (model) {
|
||||
clonedModel.push(model.clone());
|
||||
});
|
||||
|
||||
// Finally, remove the nodes ...
|
||||
this._models.each(function (model) {
|
||||
|
||||
var topicId = model.getId();
|
||||
var topic = commandContext.findTopics(topicId)[0];
|
||||
commandContext.deleteTopic(topic);
|
||||
}.bind(this));
|
||||
|
||||
this._models = clonedModel;
|
||||
}
|
||||
});
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -34,9 +34,11 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
// If a parent has been selected for deletion, the children must be excluded from the delete ...
|
||||
var topics = this._filterChildren(this._topicIds, commandContext);
|
||||
|
||||
|
||||
if (topics.length > 0) {
|
||||
topics.each(function (topic) {
|
||||
// In case that it's editing text node, force close without update ...
|
||||
topic.closeEditors();
|
||||
|
||||
var model = topic.getModel();
|
||||
|
||||
// Delete relationships
|
||||
@@ -76,24 +78,40 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
|
||||
undoExecute:function (commandContext) {
|
||||
|
||||
var parent = commandContext.findTopics(this._parentTopicIds);
|
||||
this._deletedTopicModels.each(function (model, index) {
|
||||
var topic = commandContext.createTopic(model);
|
||||
|
||||
// Was the topic connected?
|
||||
var parentTopic = parent[index];
|
||||
if (parentTopic != null) {
|
||||
commandContext.connect(topic, parentTopic);
|
||||
topic.setOnFocus(true);
|
||||
}
|
||||
|
||||
// Add all the topics ...
|
||||
this._deletedTopicModels.each(function (model) {
|
||||
commandContext.createTopic(model);
|
||||
}, this);
|
||||
|
||||
// Do they need to be connected ?
|
||||
this._deletedTopicModels.each(function (topicModel, index) {
|
||||
var topics = commandContext.findTopics(topicModel.getId());
|
||||
|
||||
var parentId = this._parentTopicIds[index];
|
||||
if (parentId) {
|
||||
var parentTopics = commandContext.findTopics(parentId);
|
||||
commandContext.connect(topics[0], parentTopics[0]);
|
||||
}
|
||||
}, this);
|
||||
|
||||
// Add rebuild relationships ...
|
||||
this._deletedRelModel.each(function (model) {
|
||||
commandContext.addRelationship(model);
|
||||
}.bind(this));
|
||||
|
||||
// Finally display the topics ...
|
||||
this._deletedTopicModels.each(function (topicModel) {
|
||||
var topics = commandContext.findTopics(topicModel.getId());
|
||||
topics[0].setBranchVisibility(true);
|
||||
}, this);
|
||||
|
||||
// Focus on last recovered topic ..
|
||||
if (this._deletedTopicModels.length > 0) {
|
||||
var firstTopic = this._deletedTopicModels[0];
|
||||
var topic = commandContext.findTopics(firstTopic.getId())[0];
|
||||
topic.setOnFocus(true);
|
||||
}
|
||||
|
||||
this._deletedTopicModels = [];
|
||||
this._parentTopicIds = [];
|
||||
this._deletedRelModel = [];
|
||||
@@ -124,14 +142,26 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
|
||||
_collectInDepthRelationships:function (topic) {
|
||||
var result = [];
|
||||
result.append(topic.getRelationships());
|
||||
|
||||
var children = topic.getChildren();
|
||||
if (children.length > 0) {
|
||||
var rels = children.map(function (topic) {
|
||||
return this._collectInDepthRelationships(topic);
|
||||
}, this);
|
||||
result.append(rels.flatten());
|
||||
} else {
|
||||
result.append(topic.getRelationships());
|
||||
var rels = children.map(function (topic) {
|
||||
return this._collectInDepthRelationships(topic);
|
||||
}, this);
|
||||
result.append(rels.flatten());
|
||||
|
||||
if (result.length > 0) {
|
||||
// Filter for unique ...
|
||||
result = result.sort(function (a, b) {
|
||||
return a.getModel().getId() - b.getModel().getId();
|
||||
});
|
||||
var ret = [result[0]];
|
||||
for (var i = 1; i < result.length; i++) { // start loop at 1 as element 0 can never be a duplicate
|
||||
if (result[i - 1] !== result[i]) {
|
||||
ret.push(result[i]);
|
||||
}
|
||||
}
|
||||
result = ret;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -18,22 +18,22 @@
|
||||
|
||||
mindplot.commands.DragTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize:function (topicIds, position, order, parentTopic) {
|
||||
$assert(topicIds, "topicIds must be defined");
|
||||
initialize:function (topicId, position, order, parentTopic) {
|
||||
$assert(topicId, "topicId must be defined");
|
||||
|
||||
this._topicsIds = topicIds;
|
||||
this._topicsId = topicId;
|
||||
if ($defined(parentTopic))
|
||||
this._parentId = parentTopic.getId();
|
||||
|
||||
this.parent();
|
||||
this._position = position;
|
||||
this._order = order;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
|
||||
execute:function (commandContext) {
|
||||
|
||||
var topic = commandContext.findTopics([this._topicsIds])[0];
|
||||
var topic = commandContext.findTopics(this._topicsId)[0];
|
||||
topic.setVisibility(false);
|
||||
|
||||
// Save old position ...
|
||||
var origParentTopic = topic.getOutgoingConnectedTopic();
|
||||
@@ -60,7 +60,7 @@ mindplot.commands.DragTopicCommand = new Class({
|
||||
if (origParentTopic != this._parentId) {
|
||||
|
||||
if ($defined(this._parentId)) {
|
||||
var parentTopic = commandContext.findTopics([this._parentId])[0];
|
||||
var parentTopic = commandContext.findTopics(this._parentId)[0];
|
||||
commandContext.connect(topic, parentTopic);
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ mindplot.commands.DragTopicCommand = new Class({
|
||||
this._parentId = origParentTopic.getId();
|
||||
}
|
||||
}
|
||||
topic.setVisibility(true);
|
||||
|
||||
// Store for undo ...
|
||||
this._order = origOrder;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -18,35 +18,51 @@
|
||||
|
||||
mindplot.commands.GenericFunctionCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(commandFunc, topicsIds,value) {
|
||||
initialize:function (commandFunc, topicsIds, value) {
|
||||
$assert(commandFunc, "commandFunc must be defined");
|
||||
$assert($defined(topicsIds), "topicsIds must be defined");
|
||||
|
||||
this.parent();
|
||||
this._value = value;
|
||||
this._topicsIds = topicsIds;
|
||||
this._topicsId = topicsIds;
|
||||
this._commandFunc = commandFunc;
|
||||
this._oldValues = [];
|
||||
},
|
||||
|
||||
execute: function(commandContext) {
|
||||
execute:function (commandContext) {
|
||||
if (!this.applied) {
|
||||
var topics = commandContext.findTopics(this._topicsIds);
|
||||
topics.each(function(topic) {
|
||||
var oldValue = this._commandFunc(topic, this._value);
|
||||
this._oldValues.push(oldValue);
|
||||
}.bind(this));
|
||||
|
||||
var topics = null;
|
||||
try {
|
||||
topics = commandContext.findTopics(this._topicsId);
|
||||
} catch (e) {
|
||||
if (this._commandFunc.commandType != "changeTextToTopic") {
|
||||
// Workaround: For some reason, there is a combination of events that involves
|
||||
// making some modification and firing out of focus event. This is causing
|
||||
// that a remove node try to be removed. In some other life, I will come with the solution.
|
||||
// Almost aways occurs with IE9. I could be related with some change of order in sets o something similar.
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
if (topics != null) {
|
||||
topics.each(function (topic) {
|
||||
var oldValue = this._commandFunc(topic, this._value);
|
||||
this._oldValues.push(oldValue);
|
||||
}.bind(this));
|
||||
}
|
||||
this.applied = true;
|
||||
|
||||
} else {
|
||||
throw "Command can not be applied two times in a row.";
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
undoExecute: function(commandContext) {
|
||||
undoExecute:function (commandContext) {
|
||||
if (this.applied) {
|
||||
var topics = commandContext.findTopics(this._topicsIds);
|
||||
topics.each(function(topic, index) {
|
||||
var topics = commandContext.findTopics(this._topicsId);
|
||||
topics.each(function (topic, index) {
|
||||
this._commandFunc(topic, this._oldValues[index]);
|
||||
|
||||
}.bind(this));
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -30,7 +30,6 @@ mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
|
||||
|
||||
execute:function (commandContext) {
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
|
||||
var feature = topic.findFeatureById(this._featureId);
|
||||
topic.removeFeature(feature);
|
||||
this._oldFeature = feature;
|
||||
@@ -38,9 +37,7 @@ mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
|
||||
|
||||
undoExecute:function (commandContext) {
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
|
||||
var feature = this._oldFeature;
|
||||
topic.addFeature(feature.getType(), feature.getAttributes(), this._featureId);
|
||||
topic.addFeature(this._oldFeature);
|
||||
this._oldFeature = null;
|
||||
}
|
||||
});
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -84,7 +84,7 @@ mindplot.layout.RootedTreeSet = new Class({
|
||||
}
|
||||
}
|
||||
validate = !$defined(validate) ? true : validate;
|
||||
$assert(validate ? result : true, 'node could not be found id:' + id);
|
||||
$assert(validate ? result : true, 'node could not be found id:' + id + "\n,RootedTreeSet" + this.dump());
|
||||
return result;
|
||||
|
||||
},
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
* Copyright [2012] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
@@ -17,58 +17,60 @@
|
||||
*/
|
||||
|
||||
mindplot.model.FeatureModel = new Class({
|
||||
initialize:function(type) {
|
||||
$assert(type, 'type can not be null');
|
||||
Static:{
|
||||
_nextUUID:function () {
|
||||
if (!$defined(mindplot.model.FeatureModel._uuid)) {
|
||||
mindplot.model.FeatureModel._uuid = 0;
|
||||
}
|
||||
|
||||
mindplot.model.FeatureModel._uuid = mindplot.model.FeatureModel._uuid + 1;
|
||||
return mindplot.model.FeatureModel._uuid;
|
||||
}
|
||||
},
|
||||
|
||||
initialize:function (type) {
|
||||
$assert(type, 'type can not be null');
|
||||
this._id = mindplot.model.FeatureModel._nextUUID();
|
||||
|
||||
this._type = type;
|
||||
this._attributes = {};
|
||||
|
||||
// Create type method ...
|
||||
this['is' + type.camelCase() + 'Model'] = function() {
|
||||
this['is' + type.camelCase() + 'Model'] = function () {
|
||||
return true;
|
||||
};
|
||||
},
|
||||
|
||||
getAttributes : function() {
|
||||
getAttributes:function () {
|
||||
return Object.clone(this._attributes);
|
||||
},
|
||||
|
||||
setAttributes : function(attributes) {
|
||||
setAttributes:function (attributes) {
|
||||
for (key in attributes) {
|
||||
this["set" + key.capitalize()](attributes[key]);
|
||||
}
|
||||
},
|
||||
|
||||
setAttribute : function(key, value) {
|
||||
setAttribute:function (key, value) {
|
||||
$assert(key, 'key id can not be null');
|
||||
this._attributes[key] = value;
|
||||
},
|
||||
|
||||
getAttribute : function(key) {
|
||||
getAttribute:function (key) {
|
||||
$assert(key, 'key id can not be null');
|
||||
|
||||
return this._attributes[key];
|
||||
},
|
||||
|
||||
getId : function() {
|
||||
getId:function () {
|
||||
return this._id;
|
||||
},
|
||||
|
||||
setId : function(id) {
|
||||
setId:function (id) {
|
||||
this._id = id;
|
||||
},
|
||||
|
||||
getType:function() {
|
||||
getType:function () {
|
||||
return this._type;
|
||||
}
|
||||
});
|
||||
|
||||
mindplot.model.FeatureModel._nextUUID = function() {
|
||||
if (!$defined(this._uuid)) {
|
||||
this._uuid = 0;
|
||||
}
|
||||
|
||||
this._uuid = this._uuid + 1;
|
||||
return this._uuid;
|
||||
};
|
||||
});
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user