459 Commits

Author SHA1 Message Date
Paulo Gustavo Veiga
d6a60636ed Merged feature/WISE-211-iconSupportOnLabels into develop 2014-04-26 15:44:36 -03:00
Paulo Gustavo Veiga
9ca2f6bb1e Merged in ldap-changes (pull request #1)
move 'ou=' from being hardcoded to part of security.ldap.subDn
2014-04-26 15:39:29 -03:00
Michael Magill
b886a5888a removed "ou=" from LDAP user search since it is now integrated with security.ldap.subDn 2014-04-25 20:41:50 +00:00
Michael Magill
cec140b1fd changed default security.ldap.subDn parameter to include "ou=" 2014-04-25 20:36:48 +00:00
Michael Magill
84cffac713 removed extra / from site.baseurl 2014-04-25 20:30:18 +00:00
Ezequiel Bergamaschi
754d4b3dcf fixing wrong reference variable 2014-04-19 14:18:35 -03:00
Paulo Gustavo Veiga
7ee577c400 Update ads codes. 2014-04-18 19:48:09 -03:00
Paulo Gustavo Veiga
c854c1b377 Update analitics tracking code. 2014-04-18 19:13:55 -03:00
Ezequiel Bergamaschi
bfe24b7dfb popovers for icons in label icon chooser 2014-04-17 01:29:44 -03:00
Claudio Barril
85c7e3ce5c fixing tests broken because refactor of label attribute icon 2014-04-16 10:29:36 -03:00
Claudio Barril
27304ea385 label icon list reduced 2014-04-16 03:00:00 -03:00
Claudio Barril
8a994ee6f5 jsp include for label icon list 2014-04-16 02:59:33 -03:00
Claudio Barril
5ec3b6cce1 label attribute icon to iconName refactor (because of eze code review) 2014-04-16 02:38:33 -03:00
Claudio Barril
8cd05ec37e adding icon to tags list (when tagging) and some style 2014-04-16 02:25:07 -03:00
Ezequiel Bergamaschi
5a00229390 adding css for color chooser 2014-04-16 01:57:42 -03:00
Ezequiel Bergamaschi
4b01f7c8ee removing fixme from dialogForm function 2014-04-16 01:48:09 -03:00
Claudio Barril
edb91b92bd fix tests 2014-04-16 00:25:32 -03:00
Claudio Barril
c6ae7be255 import label list from another jsp prototype 2014-04-14 18:14:56 -03:00
Claudio Barril
86ba19c120 sending icon data to api rest 2014-04-14 18:14:32 -03:00
Claudio Barril
183ab33729 add styles 2014-04-14 18:10:16 -03:00
Claudio Barril
9e992a8f61 add label icons back-end (model and database) 2014-04-14 18:09:34 -03:00
Claudio Barril
5d18283285 icon ui selection 2014-04-12 19:04:28 -03:00
Claudio Barril
d66666010d icon dropdown creation dialog 2014-04-12 19:04:19 -03:00
Claudio Barril
bddf867b63 icon message 2014-04-12 19:03:31 -03:00
Claudio Barril
d0d161e8ab fix padding and label in two lines 2014-04-09 00:13:38 -03:00
Claudio Barril
64c7198d50 update mysql schemas population 2014-03-19 23:29:00 -03:00
Claudio Barril
2fae012fd9 update hsql schemas population 2014-03-19 23:28:46 -03:00
Paulo Gustavo Veiga
e8ee76c5f8 Merged feature/WISE-220-mindmapListImprovements into develop 2014-03-16 11:34:38 -03:00
Ezequiel Bergamaschi
3d6df8a143 Revert "new header"
This reverts commit 251f0eca46.

Conflicts:

	wise-webapp/src/main/webapp/jsp/header.jsp
2014-03-14 23:59:16 -03:00
Ezequiel Bergamaschi
dec0fb7aef bootstrap 13px 2014-03-14 23:57:23 -03:00
Ezequiel Bergamaschi
980a984499 bootstrap 12px and 13px 2014-03-14 23:48:05 -03:00
Ezequiel Bergamaschi
1f8e251009 orange buttons new header 2014-03-13 00:41:45 -03:00
Ezequiel Bergamaschi
4729022d6a updating webdefault.xml 2014-03-12 23:42:30 -03:00
Ezequiel Bergamaschi
eb9a28603c updating jetty version and removing old config 2014-03-12 23:42:20 -03:00
Ezequiel Bergamaschi
d191aa9075 reducing delete dialog size 2014-03-12 01:53:47 -03:00
Ezequiel Bergamaschi
e585686bd2 bootstrap recompiled with base font size 12px 2014-03-12 01:41:36 -03:00
Ezequiel Bergamaschi
44b3707005 avoid override bootstrap nav-pills class 2014-03-11 23:43:45 -03:00
Ezequiel Bergamaschi
251f0eca46 new header 2014-03-10 01:22:30 -03:00
Ezequiel Bergamaschi
1bdf75e295 rows clickeables 2014-03-10 00:12:49 -03:00
Ezequiel Bergamaschi
ccdab5257b css and animation fadeIn 2014-03-09 23:41:39 -03:00
Ezequiel Bergamaschi
797a4adfd4 small searcher 2014-03-09 23:41:17 -03:00
Ezequiel Bergamaschi
3b64577d15 small buttons 2014-03-09 23:41:00 -03:00
Ezequiel Bergamaschi
06fc95c454 Revert "rename parameter"
This reverts commit 29894a276e.
2014-03-09 22:08:46 -03:00
Claudio Barril
0c15789c4b force linkLabel to use view security in mindmap service 2014-03-09 02:34:20 -03:00
Claudio Barril
ae31613fdd renaming method addLabel to linkLabel 2014-03-09 02:34:20 -03:00
Paulo Gustavo Veiga
6432fefa67 Merged WISE-217-fixMindmapsAreShowingOtherUserLabels into develop 2014-03-08 23:58:20 -03:00
Claudio Barril
29037e60d8 select only my labels from all mindmap labels 2014-03-08 16:29:43 -03:00
Claudio Barril
29894a276e rename parameter 2014-03-08 16:29:42 -03:00
Claudio Barril
db0595ac7e remove unused exception and class 2014-03-08 16:29:42 -03:00
Paulo Gustavo Veiga
bf8345908b Merge branch 'feature/WISE-15-mindmapListFolderSupport' into develop 2014-03-04 16:11:52 -03:00
Mariela Michalek
d111c54f15 add new label test 2014-02-25 22:19:52 -03:00
Paulo Gustavo Veiga
6a5eb910b5 Fix display lock message. 2014-02-17 09:05:54 -03:00
Ezequiel Bergamaschi
8462e54293 Merge remote-tracking branch 'origin/develop' into feature/WISE-15-mindmapListFolderSupport
Conflicts:
	wise-webapp/src/main/webapp/jsp/mindmapList.jsp
2014-02-14 03:54:36 -03:00
Paulo Gustavo Veiga
7b45b4b633 Remove console.log messsage. 2014-02-12 14:37:04 -03:00
Paulo Gustavo Veiga
b7051d56c0 Fix modal dialogs loading ... 2014-02-12 14:37:04 -03:00
Paulo Gustavo Veiga
8be0f19792 Move adsense location 2014-02-12 01:00:12 -03:00
Paulo Gustavo Veiga
44dbce0801 Fix login color h1. 2014-02-12 00:55:04 -03:00
Paulo Gustavo Veiga
878fe464ea Reference bootstrap min.
Fin export dialog.
2014-02-12 00:20:06 -03:00
Paulo Gustavo Veiga
68fd71d300 Fix no closed div element on account settings. 2014-02-11 23:27:46 -03:00
Paulo Gustavo Veiga
73e955afac Fix table hover issue. 2014-02-11 21:45:29 -03:00
Ezequiel Bergamaschi
ea4684d9c8 get label by id with user and validate label exists on link to mindmap 2014-02-11 02:04:09 -03:00
Ezequiel Bergamaschi
0b021c7602 style change.. 2014-02-11 01:36:19 -03:00
Ezequiel Bergamaschi
1de1a9f55f warning in yellow 2014-02-11 01:05:31 -03:00
Ezequiel Bergamaschi
60d75b6f2d code indendt 2014-02-11 00:48:48 -03:00
Ezequiel Bergamaschi
ae71b1331f fix focus on modal 2014-02-11 00:43:20 -03:00
Ezequiel Bergamaschi
c56698d085 fix color picker on background 2014-02-11 00:43:04 -03:00
Ezequiel Bergamaschi
7299c7d506 fixing ui 2014-02-11 00:18:46 -03:00
Ezequiel Bergamaschi
9e8f73df99 Merge remote-tracking branch 'origin/develop' into feature/WISE-15-mindmapListFolderSupport
Conflicts:
	wise-webapp/src/main/webapp/jsp/mindmapList.jsp
2014-02-10 22:16:48 -03:00
Ezequiel Bergamaschi
572eb44e7a Merge remote-tracking branch 'origin/develop' into feature/WISE-15-mindmapListFolderSupport
Conflicts:
	wise-webapp/src/main/webapp/bootstrap/css/bootstrap.css
	wise-webapp/src/main/webapp/bootstrap/css/bootstrap.min.css
	wise-webapp/src/main/webapp/css/mindmapList.less
	wise-webapp/src/main/webapp/js/mindmapList.js
	wise-webapp/src/main/webapp/jsp/mindmapList.jsp
2014-02-10 01:07:50 -03:00
Ezequiel Bergamaschi
1d6e3ec4bf new tests added 2014-02-10 00:59:13 -03:00
Ezequiel Bergamaschi
83e51a6501 return location on header 2014-02-10 00:58:42 -03:00
Ezequiel Bergamaschi
5733dbf45e color validation 2014-02-10 00:58:29 -03:00
Ezequiel Bergamaschi
b110d338af attributes nullable 2014-02-10 00:58:19 -03:00
Paulo Gustavo Veiga
08a066271b Merged WISE-209-new-map-is-not-working-on-ie-10 into develop 2014-02-09 23:11:38 -03:00
Paulo Gustavo Veiga
8996df4cbb More minor fixes. 2014-02-09 22:44:58 -03:00
Paulo Gustavo Veiga
c5932dc0f8 Fix mindmap list navigator toolbar. 2014-02-09 22:14:53 -03:00
Paulo Gustavo Veiga
832fb6ce52 Enable MYSQL display message. 2014-02-09 22:04:01 -03:00
Paulo Gustavo Veiga
bbc380366f Fix login page. 2014-02-09 21:58:23 -03:00
Paulo Gustavo Veiga
95d9414ae3 Change sd to md styles. 2014-02-09 20:12:24 -03:00
Mariela Michalek
1a31e5ee99 Refactor Imports and Helper 2014-02-09 18:37:10 -03:00
Mariela Michalek
d48abe6121 refactor test - add helper class 2014-02-09 17:50:57 -03:00
Mariela Michalek
f564b4b34a rename test 2014-02-09 15:19:07 -03:00
Mariela Michalek
147a4ec06a adding new suite test 2014-02-09 13:57:00 -03:00
Mariela Michalek
c81439cae8 Revert "deleting unnecessary XML annotation"
This reverts commit f65149c948.
2014-02-09 12:25:21 -03:00
Paulo Gustavo Veiga
06d3f0cd25 Fix publish page. 2014-02-09 04:54:36 -03:00
Paulo Gustavo Veiga
2a37167b01 Fix import dialog... 2014-02-09 04:34:25 -03:00
Paulo Gustavo Veiga
2b89fdccca Fix registration, login 2014-02-09 04:19:39 -03:00
Paulo Gustavo Veiga
6624abb9ed Fix login. 2014-02-09 04:03:43 -03:00
Paulo Gustavo Veiga
726ffcd817 First corrections.
Fix more styling issues.

Conflicts:
	wise-webapp/src/main/webapp/jsp/accountSettings.jsp
2014-02-09 03:26:51 -03:00
Paulo Gustavo Veiga
356ab4b1c1 Created new branch WISE-209-new-map-is-not-working-on-ie-10 2014-02-09 06:18:36 +00:00
Ezequiel Bergamaschi
a9c1d42925 fix animate on delete 2014-02-08 18:54:14 -03:00
Ezequiel Bergamaschi
08a9289893 filter list appears all simultaneously 2014-02-08 18:25:32 -03:00
Ezequiel Bergamaschi
3df00e9e0e dialog modal with focus and submit on enter 2014-02-08 17:54:10 -03:00
Ezequiel Bergamaschi
b3e2e37929 fix animate bug 2014-02-08 17:53:47 -03:00
Ezequiel Bergamaschi
7f6d575c16 animation on bubble hover 2014-02-07 06:08:40 -03:00
Ezequiel Bergamaschi
10b9a4ceb2 bubbles 2014-02-07 06:08:40 -03:00
Ezequiel Bergamaschi
d23595a75c update 2014-02-07 06:08:40 -03:00
Ezequiel Bergamaschi
a3c6ce10c2 animation on create an delete tags 2014-02-07 06:08:40 -03:00
Ezequiel Bergamaschi
1444be36ce Merge remote-tracking branch 'origin/develop' into feature/WISE-15-mindmapListFolderSupport
Conflicts:
	config/database/hsql/drop-schemas.sql
	config/database/mysql/drop-schemas.sql
	wise-webapp/src/main/java/com/wisemapping/rest/MindmapController.java
	wise-webapp/src/main/java/com/wisemapping/rest/model/RestMindmapInfo.java
	wise-webapp/src/main/webapp/js/mindmapList.js
2014-02-06 02:10:54 -03:00
Ezequiel Bergamaschi
ba90addad2 fixing the annoying duplicate key on link label to maps 2014-02-06 00:44:36 -03:00
Ezequiel Bergamaschi
cfa669fe2e adding hibernate config 2014-02-05 21:55:37 -03:00
Ezequiel Bergamaschi
efb7e0cc3b fix add label UI 2014-02-05 21:44:30 -03:00
Ezequiel Bergamaschi
668506ceb8 adding missing msgs 2014-02-05 21:25:59 -03:00
Ezequiel Bergamaschi
105c0544e1 removing comment line 2014-02-05 21:21:37 -03:00
Ezequiel Bergamaschi
29acc46d34 solving merge conflict 2014-02-05 21:21:00 -03:00
Ezequiel Bergamaschi
6fe9dcf578 comment save 2014-02-05 02:27:33 -03:00
Ezequiel Bergamaschi
d555309c22 moving api methods to MindmapController 2014-02-05 02:11:23 -03:00
Ezequiel Bergamaschi
d089b471fc remove classes of relationship 2014-02-05 02:10:12 -03:00
Claudio Barril
7525ba4820 Merge remote-tracking branch 'origin/develop' into feature/WISE-16-remove_user 2014-02-04 22:18:29 -03:00
Claudio Barril
58390dfb92 Merge remote-tracking branch 'origin/develop' into feature/WISE-16-remove_user 2014-02-04 22:18:29 -03:00
Paulo Gustavo Veiga
b765a21369 Bug https://wisemapping.atlassian.net/browse/WISE-209 fixed. 2014-02-03 22:01:38 -03:00
Paulo Gustavo Veiga
560ceffaaf Bug https://wisemapping.atlassian.net/browse/WISE-209 fixed. 2014-02-03 22:01:38 -03:00
Ezequiel Bergamaschi
f3cc90d9d0 removing unnecesaries js 2014-02-03 01:26:05 -03:00
Ezequiel Bergamaschi
434fb4c8f5 remove hex input of color picker 2014-02-03 01:07:24 -03:00
Ezequiel Bergamaschi
57e5fcac3a remove preventDefault 2014-02-03 00:46:51 -03:00
Ezequiel Bergamaschi
b99cb2f8a3 adding icons and change label msg 2014-02-03 00:46:35 -03:00
Ezequiel Bergamaschi
ea95ba0ec7 extract method 2014-02-02 23:34:40 -03:00
Ezequiel Bergamaschi
3cf726f928 fix multiple request (I hope) 2014-02-02 23:34:20 -03:00
Ezequiel Bergamaschi
460d8270c6 remove commented code 2014-02-02 23:33:41 -03:00
Paulo Gustavo Veiga
079606c4e7 Change the unexpecter error message. 2014-02-02 22:56:40 -03:00
Claudio Barril
d67a16f550 ui support of untag mindmap 2014-02-02 04:10:00 -03:00
Claudio Barril
8db7f5015f api for unlink mindmaps 2014-02-02 04:09:28 -03:00
Ezequiel Bergamaschi
734463d233 css on 'x' mouse over 2014-02-02 03:02:01 -03:00
Ezequiel Bergamaschi
fdf041e8b1 adding scrollbar support 2014-02-02 02:22:58 -03:00
Ezequiel Bergamaschi
23611c8d54 fix select all issue 2014-02-02 02:01:37 -03:00
Ezequiel Bergamaschi
729d2e98f7 palette with default value 2014-02-02 01:35:19 -03:00
Ezequiel Bergamaschi
baa8adacda datatype workaround 2014-02-02 01:28:14 -03:00
Ezequiel Bergamaschi
7a535b1dca css and fix jquery problems 2014-02-02 01:26:56 -03:00
Ezequiel Bergamaschi
632a9a6e00 ordering labels on mindmap retreive 2014-02-02 01:26:28 -03:00
Ezequiel Bergamaschi
a4aa1c5436 tag label with x to delete tag from mindmap 2014-02-01 23:33:38 -03:00
Ezequiel Bergamaschi
9a19e2a5eb some button actions 2014-02-01 23:33:38 -03:00
Paulo Gustavo Veiga
6d1a00291e Fix jQuery resturn status. 2014-02-01 22:48:01 -03:00
Paulo Gustavo Veiga
d6656dffc0 Fix jQuery resturn status. 2014-02-01 22:48:01 -03:00
Paulo Gustavo Veiga
3b23fead8e Fix another typo. 2014-02-01 19:54:31 -03:00
Paulo Gustavo Veiga
94b043ecf5 Fix another typo. 2014-02-01 19:54:31 -03:00
Paulo Gustavo Veiga
c8286c26aa Fix minor typo. 2014-02-01 19:50:37 -03:00
Paulo Gustavo Veiga
f567513468 Fix minor typo. 2014-02-01 19:50:37 -03:00
Paulo Gustavo Veiga
472bb38342 Change the unexpecter error message. 2014-02-01 19:47:33 -03:00
Paulo Gustavo Veiga
10fb98cdaa Change the unexpecter error message. 2014-02-01 19:47:33 -03:00
Claudio Barril
f65149c948 deleting unnecessary XML annotation 2014-02-01 19:36:42 -03:00
Claudio Barril
b4857ed99e drop R_LABEL_MINDMAP added 2014-02-01 19:36:42 -03:00
Claudio Barril
131a501508 adding delete on cascade and fixing identation 2014-02-01 19:36:42 -03:00
Paulo Gustavo Veiga
37e9676687 Merge branch 'develop' into feature/WISE-15-mindmapListFolderSupport 2014-02-01 19:18:57 -03:00
Paulo Gustavo Veiga
6ed7bc9154 Update jquery version. 2014-02-01 19:15:19 -03:00
Paulo Gustavo Veiga
d535fcc381 Update jquery version. 2014-02-01 19:15:19 -03:00
Ezequiel Bergamaschi
d28b439e62 remove stopPropagation 2014-02-01 18:54:49 -03:00
Ezequiel Bergamaschi
0738804d88 fix mindmapList filter problem on long labels names 2014-02-01 18:54:37 -03:00
Ezequiel Bergamaschi
f248a8c099 addding on delete cascade to R table 2014-02-01 18:53:54 -03:00
Ezequiel Bergamaschi
0891beeecd fix one click problem on empty input 2014-02-01 18:13:16 -03:00
Ezequiel Bergamaschi
4646ae15c4 adding missing css 2014-02-01 16:25:09 -03:00
Ezequiel Bergamaschi
54fb696090 hack removed 2014-02-01 16:24:57 -03:00
Ezequiel Bergamaschi
e5d9380699 change linkToMindmaps logic 2014-02-01 16:24:48 -03:00
Ezequiel Bergamaschi
5fe892abfd adding private methods 2014-02-01 16:23:30 -03:00
Ezequiel Bergamaschi
12ec295fe0 rename method 2014-02-01 16:22:54 -03:00
Ezequiel Bergamaschi
8936ef5008 btn actions 2014-02-01 15:46:18 -03:00
Ezequiel Bergamaschi
0eaa8c8638 more readable function 2014-02-01 15:46:18 -03:00
Ezequiel Bergamaschi
28010a85aa add label btn with dropdown 2014-02-01 15:46:18 -03:00
Ezequiel Bergamaschi
f1e4b1c8c0 remove add label dialog and btn 2014-02-01 15:46:18 -03:00
Ezequiel Bergamaschi
1a2ba04b76 fix filter by none 2014-02-01 15:46:18 -03:00
Claudio Barril
1ead555e09 fixing tag cascade delete when mindmap tagged is deleted 2014-02-01 04:19:39 -03:00
Claudio Barril
cf246f00c8 fix duplicate tags for a map in ui 2014-02-01 04:10:00 -03:00
Ezequiel Bergamaschi
4200d85cc0 adding delete action 2014-02-01 01:42:54 -03:00
Ezequiel Bergamaschi
a4ae253ae3 adding delete X button 2014-02-01 01:42:36 -03:00
Ezequiel Bergamaschi
640b8d7ed0 delete modal dialog 2014-02-01 01:41:02 -03:00
Ezequiel Bergamaschi
5429178a1c make static public attributes final 2014-02-01 01:38:40 -03:00
Ezequiel Bergamaschi
163bc960b3 Merge remote-tracking branch 'origin/develop' into feature/WISE-15-mindmapListFolderSupport 2014-01-30 04:36:21 -03:00
Ezequiel Bergamaschi
b79930394d remove label api 2014-01-30 04:35:48 -03:00
Ezequiel Bergamaschi
c8e0b92ef5 column name changes 2014-01-30 04:35:06 -03:00
Ezequiel Bergamaschi
7d0e4dc35a replace deprecated live method 2014-01-30 04:34:25 -03:00
Ezequiel Bergamaschi
5f9b98324d css changes 2014-01-30 04:34:08 -03:00
Ezequiel Bergamaschi
95fcbb5888 removing empty lines 2014-01-30 01:54:48 -03:00
Ezequiel Bergamaschi
2f4efde017 add tag on add label to mindmap action 2014-01-30 01:54:36 -03:00
Paulo Gustavo Veiga
a62a053533 Adding Eze email address. 2014-01-30 04:47:14 +00:00
Paulo Gustavo Veiga
2d6a0c3e24 Adding Eze email address. 2014-01-30 04:47:14 +00:00
Paulo Gustavo Veiga
9897e69ee2 Add happily a new individual contributor. Welcome Claudio. 2014-01-30 04:02:57 +00:00
Paulo Gustavo Veiga
01fa9def4a Add happily a new individual contributor. Welcome Claudio. 2014-01-30 04:02:57 +00:00
Paulo Gustavo Veiga
71bba1c5ab Merge branch 'develop' into feature/WISE-16-remove_user 2014-01-30 00:24:06 -03:00
Paulo Gustavo Veiga
708b8eb355 Merge branch 'develop' into feature/WISE-16-remove_user 2014-01-30 00:24:06 -03:00
Claudio Barril
3e7ed53a2d Revert "changing jetty version"
This reverts commit 558aa31516.
2014-01-30 00:03:06 -03:00
Claudio Barril
136dc1154b Revert "changing jetty version"
This reverts commit 558aa31516.
2014-01-30 00:03:06 -03:00
Claudio Barril
301048ecad callback functions and type added to postChange function 2014-01-29 22:17:25 -03:00
Claudio Barril
26138188ea callback functions and type added to postChange function 2014-01-29 22:17:25 -03:00
Claudio Barril
558aa31516 changing jetty version 2014-01-29 22:15:45 -03:00
Claudio Barril
f0e056c298 changing jetty version 2014-01-29 22:15:45 -03:00
Claudio Barril
ccd5eb8e15 deleting user id field and adding collaborator foreing key from access 2014-01-29 22:15:26 -03:00
Claudio Barril
43d5779d5f deleting user id field and adding collaborator foreing key from access 2014-01-29 22:15:26 -03:00
Ezequiel Bergamaschi
148b56aecb refactor MindmapFilter to accept Label Filters 2014-01-29 03:59:42 -03:00
Ezequiel Bergamaschi
684c412e95 hasLabel method for mindmap 2014-01-29 03:59:05 -03:00
Ezequiel Bergamaschi
7d9ccaec91 Merge remote-tracking branch 'origin/develop' into feature/WISE-15-mindmapListFolderSupport 2014-01-29 02:58:10 -03:00
Ezequiel Bergamaschi
b4c69133f5 api rest 2014-01-29 02:56:09 -03:00
Ezequiel Bergamaschi
9edea47dbd add label to mindmap ui logic 2014-01-29 02:55:44 -03:00
Ezequiel Bergamaschi
ed55fd824f insert tag on table load 2014-01-29 02:55:00 -03:00
Ezequiel Bergamaschi
eff063ca37 remove default option 2014-01-29 02:54:33 -03:00
Ezequiel Bergamaschi
a74f4158c6 css changes 2014-01-29 02:52:37 -03:00
Ezequiel Bergamaschi
d601a2818f remove unused method 2014-01-29 02:52:25 -03:00
Ezequiel Bergamaschi
81e9b5f59d add label modal dialog 2014-01-28 02:59:09 -03:00
Ezequiel Bergamaschi
f048d0adb7 fetchLabels with postUpdate callback 2014-01-28 02:58:39 -03:00
Ezequiel Bergamaschi
2ec941e1a0 link label to mindmaps 2014-01-28 02:57:40 -03:00
Ezequiel Bergamaschi
72a46367d6 label validator finished 2014-01-28 02:21:14 -03:00
Ezequiel Bergamaschi
b19ac2c4c3 label with colors in filter 2014-01-28 01:44:56 -03:00
Ezequiel Bergamaschi
acb3782561 js refactor 2014-01-28 01:44:56 -03:00
Ezequiel Bergamaschi
c7b193f43f remove duplicate labels on fetch 2014-01-28 01:44:55 -03:00
Ezequiel Bergamaschi
154db9d9e8 adding color properties to label 2014-01-28 00:13:29 -03:00
Ezequiel Bergamaschi
deb6c4be4d bootstrap color picker plugin 2014-01-27 23:48:11 -03:00
Paulo Gustavo Veiga
8b6ef7536e Bug WISE-205 fixed.
Fix IE 11 browser detection.
2014-01-26 22:09:00 -03:00
Paulo Gustavo Veiga
d0e07269c4 Bug WISE-205 fixed.
Fix IE 11 browser detection.
2014-01-26 22:09:00 -03:00
Paulo Gustavo Veiga
81e3cb590c Add Jira Issue Integration. 2014-01-26 20:12:56 -03:00
Paulo Gustavo Veiga
a70dd1e52e Add Jira Issue Integration. 2014-01-26 20:12:56 -03:00
Ezequiel Bergamaschi
194a7f200e retrieve label list on mindmapList 2014-01-26 18:21:55 -03:00
Ezequiel Bergamaschi
306a2a2ada retrieveList api for labels 2014-01-26 18:21:14 -03:00
Ezequiel Bergamaschi
0c43bb4ad3 adding final statements 2014-01-26 18:18:49 -03:00
Ezequiel Bergamaschi
829815f9e9 Merge remote-tracking branch 'origin/develop' into feature/WISE-15-mindmapListFolderSupport 2014-01-26 12:18:37 -03:00
Claudio Barril
93a8647c6a Merge remote-tracking branch 'origin/develop' into feature/WISE-16-remove_user 2014-01-25 23:53:54 -03:00
Claudio Barril
6ac7948312 Merge remote-tracking branch 'origin/develop' into feature/WISE-16-remove_user 2014-01-25 23:53:54 -03:00
Claudio Barril
0dc426487d fix mysql populate file selected 2014-01-25 23:53:17 -03:00
Claudio Barril
b9e64e20e3 fix mysql populate file selected 2014-01-25 23:53:17 -03:00
Ezequiel Bergamaschi
561fb00ac2 WISE-199 #resolve 2014-01-25 23:39:55 -03:00
Ezequiel Bergamaschi
b774052e1d WISE-199 #close 2014-01-25 23:39:26 -03:00
Ezequiel Bergamaschi
367bcf084d close WISE-199 2014-01-25 23:32:18 -03:00
Ezequiel Bergamaschi
fe2b7225ef close #199 2014-01-25 23:30:34 -03:00
Ezequiel Bergamaschi
49d9820a44 create tag item on left list 2014-01-25 23:25:17 -03:00
Ezequiel Bergamaschi
3f2c687643 bug WISE-199 fixed 2014-01-25 23:24:04 -03:00
Ezequiel Bergamaschi
c68b4c90da removing unnecesary validation 2014-01-25 23:21:44 -03:00
Ezequiel Bergamaschi
1b480b566a rest api for label and hibernate mapping 2014-01-25 23:21:17 -03:00
Ezequiel Bergamaschi
504e3e18e6 sql scripts for label support 2014-01-25 23:07:35 -03:00
Claudio Barril
f2be251c8b Merge remote-tracking branch 'origin/develop' into feature/WISE-16-remove_user 2014-01-25 23:03:21 -03:00
Claudio Barril
cedd12314b Merge remote-tracking branch 'origin/develop' into feature/WISE-16-remove_user 2014-01-25 23:03:21 -03:00
Ezequiel Bergamaschi
02cb53d082 fixing merge conflicts 2014-01-25 19:54:28 -03:00
Claudio Barril
0acd0c097f fix typo 2014-01-25 19:50:46 -03:00
Claudio Barril
9a9dabc0ab fix typo 2014-01-25 19:50:46 -03:00
Paulo Gustavo Veiga
99be712a5f Add JCoco Coverage report. 2014-01-25 18:31:50 -03:00
Paulo Gustavo Veiga
ed4d50724a Add JCoco Coverage report. 2014-01-25 18:31:50 -03:00
Ezequiel Bergamaschi
94812cd96a adding missing db profiles due to a wrong merge 2014-01-25 18:16:21 -03:00
Ezequiel Bergamaschi
f39e82b016 adding missing db profiles due to a wrong merge 2014-01-25 18:16:21 -03:00
Paulo Gustavo Veiga
2f994be98d Remove unsed file. 2014-01-25 15:49:10 -03:00
Paulo Gustavo Veiga
40907bc479 Remove unsed file. 2014-01-25 15:49:10 -03:00
Paulo Gustavo Veiga
d4f9fb1756 Remove unsed files. 2014-01-25 15:47:44 -03:00
Paulo Gustavo Veiga
14d688b9bf Remove unsed files. 2014-01-25 15:47:44 -03:00
Paulo Gustavo Veiga
a745167c75 Minor fix on documentation. 2014-01-25 15:43:46 -03:00
Paulo Gustavo Veiga
2cb7ec9afb Minor fix on documentation. 2014-01-25 15:43:46 -03:00
Paulo Gustavo Veiga
540b575e54 Improve readme documentation. 2014-01-25 15:39:50 -03:00
Paulo Gustavo Veiga
7e5b3c51a8 Improve readme documentation. 2014-01-25 15:39:50 -03:00
Paulo Gustavo Veiga
5d4da27842 Fix Jetty hangs during install. 2014-01-25 15:27:03 -03:00
Paulo Gustavo Veiga
20a786460c Fix Jetty hangs during install. 2014-01-25 15:27:03 -03:00
Paulo Gustavo Veiga
07b18d9527 Improve delete message.
Add unit test.
2014-01-25 12:31:14 -03:00
Paulo Gustavo Veiga
adfc6c08f2 Improve delete message.
Add unit test.
2014-01-25 12:31:14 -03:00
Paulo Gustavo Veiga
9a1c0fe46d Merge branch 'develop' into feature/WISE-16-remove_user
Conflicts:
	wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java
	wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java
2014-01-25 11:33:31 -03:00
Paulo Gustavo Veiga
a8f7d28c11 Merge branch 'develop' into feature/WISE-16-remove_user
Conflicts:
	wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java
	wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java
2014-01-25 11:33:31 -03:00
Paulo Gustavo Veiga
5b1fb27ca2 Add Maven Tomcat Plugin. 2014-01-25 04:53:51 -03:00
Paulo Gustavo Veiga
cf0b3cf80d Add Maven Tomcat Plugin. 2014-01-25 04:53:51 -03:00
Paulo Gustavo Veiga
0493d66daa Fix mindmaping controller tests. 2014-01-25 04:21:59 -03:00
Paulo Gustavo Veiga
f66c476187 Fix mindmaping controller tests. 2014-01-25 04:21:59 -03:00
Paulo Gustavo Veiga
9b3f1c79a6 Enable MindmapController rests. 2014-01-25 03:13:51 -03:00
Paulo Gustavo Veiga
5e62eb3279 Enable MindmapController rests. 2014-01-25 03:13:51 -03:00
Paulo Gustavo Veiga
2ccb4bfb83 Remove HTML support for test ... 2014-01-24 22:58:25 -03:00
Paulo Gustavo Veiga
686e011f9b Remove HTML support for test ... 2014-01-24 22:58:25 -03:00
Paulo Gustavo Veiga
f610bfdfb3 Fix W3ORG logo url location on footer. 2014-01-24 22:42:05 -03:00
Paulo Gustavo Veiga
f0c6d944a8 Fix W3ORG logo url location on footer. 2014-01-24 22:42:05 -03:00
Paulo Gustavo Veiga
ebf4603889 Conflicts:
README.md
	config/database/mysql/apopulate-schemas.sql
	wise-webapp/pom.xml
2014-01-24 20:17:21 -03:00
Paulo Gustavo Veiga
706031a641 Conflicts:
README.md
	config/database/mysql/apopulate-schemas.sql
	wise-webapp/pom.xml
2014-01-24 20:17:21 -03:00
Paulo Gustavo Veiga
25e6e4de4f Bug WISE-190 fixed.
Implement REST Console support.
2014-01-24 09:45:22 -03:00
Paulo Gustavo Veiga
ae604b1c70 Bug WISE-190 fixed.
Implement REST Console support.
2014-01-24 09:45:22 -03:00
Ezequiel Bergamaschi
0d11dee06c format 2014-01-24 02:47:51 -03:00
Ezequiel Bergamaschi
00773ae3b9 adding missing version to tomcat plugin 2014-01-24 02:47:01 -03:00
ezequiel
88fed0af0a api rest call 2014-01-24 00:21:43 -03:00
ezequiel
31aab0bd48 api rest call 2014-01-24 00:21:43 -03:00
ezequiel
4f40431d55 adding warning msg on delete user popup 2014-01-24 00:21:27 -03:00
ezequiel
d1004f2919 adding warning msg on delete user popup 2014-01-24 00:21:27 -03:00
ezequiel
7151aa4e2c more users.. 2014-01-24 00:20:13 -03:00
ezequiel
c3d2739293 more users.. 2014-01-24 00:20:13 -03:00
Ezequiel Bergamaschi
091955255b Merge remote-tracking branch 'origin/develop' into feature/WISE-15-mindmapListFolderSupport 2014-01-21 01:47:39 -03:00
Ezequiel Bergamaschi
2aa68c3d4b Revert "adding directory table to sql scripts"
This reverts commit a7e0ef30fa8a061920c22e4cda6e6e92e83b7a92.
2014-01-21 01:46:04 -03:00
Ezequiel Bergamaschi
f4fb008f1b popup for label 2014-01-21 01:45:12 -03:00
Claudio Barril
da2594292b delete account lash in account settings 2014-01-20 23:10:57 -03:00
Claudio Barril
f30106ab39 delete account lash in account settings 2014-01-20 23:10:57 -03:00
Claudio Barril
8a684519f0 DELETE__ACCOUNT message property (en and es languages) 2014-01-20 23:10:15 -03:00
Claudio Barril
24417d4fd0 DELETE__ACCOUNT message property (en and es languages) 2014-01-20 23:10:15 -03:00
Paulo Gustavo Veiga
9c4dfb7f25 Merged feature-WISE-78-pom-improvements into develop 2014-01-20 19:27:34 -03:00
Paulo Gustavo Veiga
7d6c26539d Merged feature-WISE-78-pom-improvements into develop 2014-01-20 19:27:34 -03:00
Ezequiel Bergamaschi
8bdc5f6b05 new button is now a dropdown in order to support folders 2014-01-20 01:03:32 -03:00
Ezequiel Bergamaschi
91b5a08b11 adding new properties 2014-01-20 01:02:48 -03:00
Ezequiel Bergamaschi
c0b8eb7176 adding directory table to sql scripts 2014-01-19 23:46:02 -03:00
Ezequiel Bergamaschi
871d89a304 blue icon on mindmap list 2014-01-19 22:39:44 -03:00
Claudio Barril
0933786525 fix mysql database and user creation 2014-01-19 22:38:47 -03:00
Claudio Barril
0968549e55 creating mysql and hsql maven profiles 2014-01-19 22:38:46 -03:00
Claudio Barril
bec5a087aa fix mysql test-data statements 2014-01-19 22:38:46 -03:00
Claudio Barril
2528ceb8df add if exists to mysql statements 2014-01-19 22:38:46 -03:00
Claudio Barril
f5c7d63528 select database wisemapping in mysql tables creation 2014-01-19 22:38:46 -03:00
Claudio Barril
af0a62aee9 add if not exists to mysql database creation 2014-01-19 22:38:46 -03:00
Claudio Barril
8e402431b8 add if exists to hsql statements 2014-01-19 22:38:46 -03:00
Ezequiel Bergamaschi
e34f5ce45a adding icon to map name in mindmapList 2014-01-19 21:25:53 -03:00
Ezequiel Bergamaschi
b401a53a21 addding tomcat plugin 2014-01-19 18:26:48 -03:00
Ezequiel Bergamaschi
0c103fc3a2 addding tomcat plugin 2014-01-19 18:26:48 -03:00
Claudio Barril
2e7aa144b2 Merge remote-tracking branch 'origin/feature-WISE-78-pom-improvements' into feature/WISE-16-remove_user 2014-01-19 18:25:03 -03:00
Claudio Barril
4eec745296 Merge remote-tracking branch 'origin/feature-WISE-78-pom-improvements' into feature/WISE-16-remove_user 2014-01-19 18:25:03 -03:00
Ezequiel Bergamaschi
947fd30fa2 removing unnecesary build 2014-01-19 18:22:47 -03:00
Ezequiel Bergamaschi
52cac830ae removing unnecesary build 2014-01-19 18:22:47 -03:00
Ezequiel Bergamaschi
808660cfbb remove wrong js file on standalone-editor.xml 2014-01-19 18:22:13 -03:00
Ezequiel Bergamaschi
9d2cf7e1ff remove wrong js file on standalone-editor.xml 2014-01-19 18:22:13 -03:00
Ezequiel Bergamaschi
5d231249c7 updating jetty plugin on pom 2014-01-19 18:21:38 -03:00
Ezequiel Bergamaschi
242827f7e6 updating jetty plugin on pom 2014-01-19 18:21:38 -03:00
Ezequiel Bergamaschi
3736f48efa adding missing info to README.md 2014-01-19 18:21:18 -03:00
Ezequiel Bergamaschi
9639b9e113 adding missing info to README.md 2014-01-19 18:21:18 -03:00
Claudio Barril
531be52c5b fix mysql database and user creation 2014-01-19 14:33:56 -03:00
Claudio Barril
2e24032d1c fix mysql database and user creation 2014-01-19 14:33:56 -03:00
Claudio Barril
cc9fa543cb creating mysql and hsql maven profiles 2014-01-19 14:33:56 -03:00
Claudio Barril
541d07c46c creating mysql and hsql maven profiles 2014-01-19 14:33:56 -03:00
Claudio Barril
52d3838094 fix mysql test-data statements 2014-01-19 14:33:56 -03:00
Claudio Barril
3828a1afdb fix mysql test-data statements 2014-01-19 14:33:56 -03:00
Claudio Barril
d288787fdc add if exists to mysql statements 2014-01-19 14:33:56 -03:00
Claudio Barril
c6aed4bf6e add if exists to mysql statements 2014-01-19 14:33:56 -03:00
Claudio Barril
2c26c3cdc0 select database wisemapping in mysql tables creation 2014-01-19 14:33:56 -03:00
Claudio Barril
7eda354f8f select database wisemapping in mysql tables creation 2014-01-19 14:33:56 -03:00
Claudio Barril
9b133468e4 add if not exists to mysql database creation 2014-01-19 14:33:56 -03:00
Claudio Barril
f20b3a7a46 add if not exists to mysql database creation 2014-01-19 14:33:56 -03:00
Claudio Barril
953e473ef0 add if exists to hsql statements 2014-01-19 14:33:56 -03:00
Claudio Barril
abede3c010 add if exists to hsql statements 2014-01-19 14:33:56 -03:00
Paulo Gustavo Veiga
f2a5221cbd Merge branch 'develop' into feature/WISE-15-mindmapListFolderSupport 2014-01-15 14:22:55 -03:00
Ezequiel Bergamaschi
e165bbbff6 Created new branch feature/WISE-15-mindmapListFolderSupport 2014-01-15 05:02:20 +00:00
Paulo Gustavo Veiga
3d948a1419 Merge branch 'develop' into feature/WISE-16-remove_user 2014-01-12 23:42:47 -03:00
Paulo Gustavo Veiga
cd02cdb1ce Merge branch 'develop' into feature/WISE-16-remove_user 2014-01-12 23:42:47 -03:00
Paulo Gustavo Veiga
1e90a74ac7 Merge branch 'release/v3.0.2' into develop 2014-01-12 23:13:43 -03:00
Paulo Gustavo Veiga
ae587a037a Merge branch 'release/v3.0.2' into develop 2014-01-12 23:13:43 -03:00
Paulo Gustavo Veiga
703414266e Fix failing uning tests ... 2014-01-12 22:53:42 -03:00
Paulo Gustavo Veiga
22c102917e Fix failing uning tests ... 2014-01-12 22:53:42 -03:00
Paulo Veiga
970e5bd2ed Merge branch 'release/v3.0.2' of bitbucket.org:wisemapping/wisemapping-open-source into release/v3.0.2 2014-01-12 05:55:42 +00:00
Paulo Veiga
0001dff347 Merge branch 'release/v3.0.2' of bitbucket.org:wisemapping/wisemapping-open-source into release/v3.0.2 2014-01-12 05:55:42 +00:00
Paulo Veiga
c525acbad4 Fix jetty download. 2014-01-12 05:54:43 +00:00
Paulo Veiga
a50a96492f Fix jetty download. 2014-01-12 05:54:43 +00:00
Paulo Gustavo Veiga
83d80cadb5 Q!
Bug WISE-22 fixed. Resolve resize node issue.
2014-01-12 05:50:50 +00:00
Paulo Gustavo Veiga
63c063933d Q!
Bug WISE-22 fixed. Resolve resize node issue.
2014-01-12 05:50:50 +00:00
Paulo Veiga
b2adb4f6a6 Merge branch 'release/v3.0.2' into develop 2014-01-12 05:47:21 +00:00
Paulo Veiga
59a57e0b34 Merge branch 'release/v3.0.2' into develop 2014-01-12 05:47:21 +00:00
Paulo Gustavo Veiga
94915bc8e4 Bug WISE-22 fixed. Resolve resize node issue. 2014-01-12 02:17:42 -03:00
Paulo Gustavo Veiga
80dfab3ef4 Bug WISE-22 fixed. Resolve resize node issue. 2014-01-12 02:17:42 -03:00
Paulo Gustavo Veiga
fd73564be2 Merged master into feature/WISE-16-remove_user 2014-01-10 00:27:30 -03:00
Paulo Gustavo Veiga
3679db819a Merged master into feature/WISE-16-remove_user 2014-01-10 00:27:30 -03:00
Paulo Gustavo Veiga
50adfa0053 Revert "Bug WISE-16 fixed. Backed completed."
This reverts commit 9a77ff3bb8.
2014-01-10 00:21:21 -03:00
Paulo Gustavo Veiga
a2db34ae61 Revert "Bug WISE-16 fixed. Backed completed."
This reverts commit 9a77ff3bb8.
2014-01-10 00:21:21 -03:00
Paulo Gustavo Veiga
5f29024559 Bug WISE-16 fixed. Backed completed. 2014-01-10 00:19:56 -03:00
Paulo Gustavo Veiga
9a77ff3bb8 Bug WISE-16 fixed. Backed completed. 2014-01-10 00:19:56 -03:00
Paulo Gustavo Veiga
94ac039390 Bug WISE-16 fixed. Backed completed. 2014-01-10 00:18:00 -03:00
Paulo Gustavo Veiga
805f5eed7f Bug WISE-16 fixed. Backed completed. 2014-01-10 00:18:00 -03:00
Paulo Gustavo Veiga
e4d5425a7d Created new branch develop 2014-01-10 01:37:09 +00:00
Paulo Gustavo Veiga
914e3b508c Created new branch develop 2014-01-10 01:37:09 +00:00
Paulo Gustavo Veiga
86324c6873 Add compile information 2014-01-08 23:33:00 +00:00
Paulo Gustavo Veiga
5e4c1e4357 Add compile information 2014-01-08 23:33:00 +00:00
Paulo Gustavo Veiga
896e299f8f Add compilation details temporally. 2014-01-08 23:28:21 +00:00
Paulo Gustavo Veiga
c87424ae80 Add compilation details temporally. 2014-01-08 23:28:21 +00:00
Paulo Gustavo Veiga
751157815e README.md edited online with Bitbucket 2014-01-08 23:21:30 +00:00
Paulo Gustavo Veiga
fc6b573f86 README.md edited online with Bitbucket 2014-01-08 23:21:30 +00:00
Paulo Gustavo Veiga
9f6ba0b19c Home.textile edited online with Bitbucket 2014-01-08 23:18:24 +00:00
Paulo Gustavo Veiga
175b2f8921 Home.textile edited online with Bitbucket 2014-01-08 23:18:24 +00:00
Paulo Gustavo Veiga
711b673e31 Compiling-and-running.md edited online with Bitbucket 2014-01-08 23:16:06 +00:00
Paulo Gustavo Veiga
f8b25f949a Compiling-and-running.md edited online with Bitbucket 2014-01-08 23:16:06 +00:00
Paulo Gustavo Veiga
fd6d23c513 Fix compile documentation ... 2014-01-08 23:12:53 +00:00
Paulo Gustavo Veiga
55ab430cfe Fix compile documentation ... 2014-01-08 23:12:53 +00:00
Ezequiel Bergamaschi
1dce163782 fix wrong version of jetty-maven-plugin 2014-01-07 16:58:05 -03:00
Ezequiel Bergamaschi
4d3d8daa37 fix wrong version of jetty-maven-plugin 2014-01-07 16:58:05 -03:00
Paulo Gustavo Veiga
efd285eb10 README.md edited online with Bitbucket 2014-01-07 01:52:14 +00:00
Paulo Gustavo Veiga
128052102d README.md edited online with Bitbucket 2014-01-07 01:49:07 +00:00
Paulo Veiga
8f2f9da3da Fix 2014-01-05 22:03:41 +00:00
Paulo Gustavo Veiga
84c96287f3 Hack Chrome text element issue. 2014-01-05 18:57:47 -03:00
Paulo Gustavo Veiga
f75124233b Update part of Maven Pluggins versions. 2014-01-05 18:10:42 -03:00
Paulo Gustavo Veiga
26bd9f8840 Resources moved to https. 2014-01-02 18:34:14 -03:00
Paulo Gustavo Veiga
da8f474c64 Add extra documentation for LDAP configuration 2013-09-25 11:00:54 -03:00
Paulo Gustavo Veiga
5e8c1960e7 Fix postgress schema. 2013-05-19 11:42:06 -03:00
Paulo Gustavo Veiga
35d76ea56f Fix message. 2013-04-20 00:43:19 -03:00
Paulo Gustavo Veiga
a230dd104c Fix unlock issues. 2013-04-07 12:27:45 -03:00
Paulo Gustavo Veiga
31fb342ef1 Fix missing message. 2013-04-05 20:49:17 -03:00
Paulo Gustavo Veiga
65283a0edc Improve text export. 2013-04-04 22:11:59 -03:00
Paulo Gustavo Veiga
9686431874 Fix node export format. 2013-04-04 21:46:54 -03:00
Paulo Gustavo Veiga
96cb014a6e Add firefox 20 support. 2013-04-04 20:39:11 -03:00
Paulo Gustavo Veiga
8915e7eddf Fix rename issues. 2013-03-31 15:33:00 -03:00
Paulo Gustavo Veiga
fd021de86d Mindmap loading is lazy. 2013-03-30 01:09:28 -03:00
Paulo Gustavo Veiga
f5b4cc9ea7 Add debung info for exceptions.... 2013-03-29 22:44:13 -03:00
Paulo Gustavo Veiga
8e66c97aa3 Handle deleted maps propertly. 2013-03-29 21:09:28 -03:00
Paulo Gustavo Veiga
bd80d95d22 Fix NPE on loading maps. 2013-03-29 20:32:52 -03:00
Paulo Gustavo Veiga
4d46864388 Add compress fix. 2013-03-29 15:44:49 -03:00
Paulo Gustavo Veiga
3696e126e3 Fix descriptor. 2013-03-29 15:09:55 -03:00
Paulo Gustavo Veiga
65ee33a09f Fix compile 2013-03-29 14:57:21 -03:00
Paulo Gustavo Veiga
dce29eda19 Fix history bug. 2013-03-29 14:51:21 -03:00
Paulo Gustavo Veiga
81d3d591fa Keep working on mindmanager support. 2013-03-29 14:29:58 -03:00
Paulo Gustavo Veiga
2a2dc7c57f Change mindjet extension. 2013-03-29 12:08:40 -03:00
Paulo Gustavo Veiga
2c355205d0 Complete mindjet integration. 2013-03-29 11:49:59 -03:00
Paulo Gustavo Veiga
ed508d646c Add mindjet support. 2013-03-29 11:28:26 -03:00
Paulo Gustavo Veiga
fcb99490d8 Fix image icon render. 2013-03-28 17:33:26 -03:00
Paulo Gustavo Veiga
fd00a5e0fc Minor text fix. 2013-03-28 17:20:01 -03:00
Paulo Gustavo Veiga
f9d1e869b0 Move to WiseMapping 3.1 2013-03-28 17:06:34 -03:00
Paulo Gustavo Veiga
06210ab95b Add text/plan, open office and xls transformation support. 2013-03-28 17:01:42 -03:00
Paulo Gustavo Veiga
3137f78cce Improve purge. 2013-03-28 12:28:53 -03:00
Paulo Gustavo Veiga
dcd59efc12 Add history purge. 2013-03-26 22:58:45 -03:00
Paulo Gustavo Veiga
2b8972a35a Add delete permission to admin. 2013-03-24 22:57:32 -03:00
Paulo Gustavo Veiga
f961ae578c Add purge to history... 2013-03-24 22:49:55 -03:00
Paulo Gustavo Veiga
0188e15a92 Add more catchs .. 2013-03-24 19:28:20 -03:00
Paulo Gustavo Veiga
c12b73c1ff Add catch ... 2013-03-24 19:24:24 -03:00
Paulo Gustavo Veiga
a60f001f2c Check for more period. 2013-03-24 19:15:37 -03:00
Paulo Gustavo Veiga
04d58533cf Catch all exceptions during purge. 2013-03-24 17:20:41 -03:00
Paulo Gustavo Veiga
ed6d89fb7e Admin can delete maps. 2013-03-24 16:58:18 -03:00
Paulo Gustavo Veiga
3b47ed2e52 Fix string case. 2013-03-24 16:48:14 -03:00
Paulo Gustavo Veiga
abfc06c7d5 Fix classcast. 2013-03-24 16:41:57 -03:00
Paulo Gustavo Veiga
712cc2c60b Fix classcast. 2013-03-24 16:33:58 -03:00
Paulo Gustavo Veiga
057d5bc01f Add admin as permissions for finding. 2013-03-24 16:30:38 -03:00
Paulo Gustavo Veiga
e36b0b8b52 Handle exceptions. 2013-03-24 16:20:56 -03:00
Paulo Gustavo Veiga
4dd7a82e32 Add debug info. 2013-03-24 16:10:30 -03:00
Paulo Gustavo Veiga
580d977aa9 Add purge flag. 2013-03-24 15:57:59 -03:00
Paulo Gustavo Veiga
45c67d6b57 Add purge flag. 2013-03-24 15:42:25 -03:00
Paulo Gustavo Veiga
0b6c8a5977 Add purge action. 2013-03-24 15:11:06 -03:00
Paulo Gustavo Veiga
811cc8a668 Add purge action. 2013-03-24 15:03:19 -03:00
Paulo Gustavo Veiga
f136240591 Minor fix on property. 2013-03-19 23:25:36 -03:00
Paulo Gustavo Veiga
e0a6d15ad0 Initialize OPSS values. 2013-03-19 23:18:19 -03:00
Paulo Gustavo Veiga
617abd9d90 Change exception ... 2013-03-19 22:41:43 -03:00
Paulo Gustavo Veiga
c2e74cb2d4 Fix HTML tests positioning. 2013-03-19 22:21:51 -03:00
Paulo Gustavo Veiga
db70db49a5 Add missing resource. 2013-03-19 21:44:51 -03:00
Paulo Gustavo Veiga
4cc6382043 Fix resources. 2013-03-19 21:39:17 -03:00
Paulo Gustavo Veiga
c8d3d99224 Do not send duplicated emails on bugs. 2013-03-19 21:18:15 -03:00
Paulo Gustavo Veiga
645402e691 Fix property name. 2013-03-18 23:27:05 -03:00
Paulo Gustavo Veiga
8ed1a18280 Minor fixes. 2013-03-18 23:25:49 -03:00
Paulo Gustavo Veiga
0d81db52f1 Add alter table scripts. 2013-03-17 23:40:39 -03:00
Paulo Gustavo Veiga
67398fe07e Add OpenId required colums. 2013-03-17 23:19:29 -03:00
Paulo Gustavo Veiga
9b21c77485 Finish OpenId implementation. 2013-03-17 23:17:55 -03:00
Paulo Gustavo Veiga
94356a5773 Outh working!. Pending:
- Test all databases
- Migration Scripts
- Manage error due to changing of authentication schemas.
- Link from the login page.
- What happend with the logout ?.
2013-03-17 18:51:33 -03:00
Paulo Gustavo Veiga
2f8df725c9 Login page completed. 2013-03-17 16:39:50 -03:00
Paulo Gustavo Veiga
b9e508424c Minor fix. 2013-03-17 13:32:41 -03:00
Paulo Gustavo Veiga
48e211cc2d Escape invalid XML chars during serialization. 2013-03-17 11:22:53 -03:00
Paulo Gustavo Veiga
3578d6e624 Temporal hack for broken maps in Firefox. \r issue. 2013-03-14 21:38:38 -03:00
Paulo Gustavo Veiga
8356906791 Another try to capture serialization issue. 2013-03-14 21:25:02 -03:00
Pablo Luna
9e7f289a9e removing Google Brix... no further comments 2013-03-14 23:57:38 +00:00
Pablo Luna
9e67329703 fixing build 2013-03-14 21:51:17 +00:00
Paulo Gustavo Veiga
8489eaea6d More tests fixed. 2013-03-10 21:25:21 -03:00
Paulo Gustavo Veiga
9fb0ebd8f6 Fix tests. 2013-03-10 21:20:19 -03:00
Paulo Gustavo Veiga
e03f5f632b Fix export unit tests. 2013-03-10 19:57:24 -03:00
Paulo Gustavo Veiga
b6ee7e61b8 Fix SVG export tests... 2013-03-10 19:45:21 -03:00
Paulo Gustavo Veiga
202c3f28a3 Fix open id. 2013-03-10 19:07:52 -03:00
Paulo Gustavo Veiga
a1a28efe49 Minor fix, use db database result. 2013-03-10 19:06:55 -03:00
Paulo Gustavo Veiga
0e5592a0d3 Move database configuration scripts. 2013-03-10 19:05:33 -03:00
Paulo Gustavo Veiga
52efdf729b Try to fix encoding issue on post. 2013-03-07 23:46:07 -03:00
Paulo Gustavo Veiga
ef3e8ae772 Add inheritance of properties con creation. 2013-03-03 02:04:00 -03:00
Paulo Gustavo Veiga
1c1fc2ca96 Fix copy and paste issue. 2013-03-03 00:51:14 -03:00
Paulo Gustavo Veiga
bf3bd5c1c7 Fix save on Opera. 2013-03-02 21:29:26 -03:00
Paulo Gustavo Veiga
9cabfb14a5 Add more debug info. 2013-03-02 18:13:59 -03:00
Paulo Gustavo Veiga
def2034fa0 More debug. 2013-03-02 18:12:32 -03:00
Paulo Gustavo Veiga
b5a7a11920 Check map before save. 2013-02-27 23:08:37 -03:00
Paulo Gustavo Veiga
6155a70c04 Fix Message: 'Uncaught TypeError: Object [object Object] has no method 'retrieve'', line:'4988', url: :http://app.wisemapping.com/js/mindplot-min.js 2013-02-24 18:37:13 -03:00
Paulo Gustavo Veiga
846ad24bf3 Minor fix to enable LDAP customization of first and last name. 2013-02-24 17:46:05 -03:00
Paulo Gustavo Veiga
9ab0637690 Fix scape name with spaces. 2013-02-24 17:34:25 -03:00
Paulo Gustavo Veiga
fe331a5170 Merge branch 'master' of repo.wisemapping.org:wisemapping/wiseorg 2013-02-23 23:14:00 -03:00
Paulo Gustavo Veiga
f4969e11b9 Add mode debug info. 2013-02-23 23:07:21 -03:00
Paulo Gustavo Veiga
312f5447b8 Fix NPE. 2013-02-23 15:39:10 -03:00
Paulo Gustavo Veiga
879fa4c926 Add postgres scripts. 2013-02-23 15:33:09 -03:00
Paulo Gustavo Veiga
5e0c879654 Minor fix on export. 2013-02-23 14:54:51 -03:00
Paulo Gustavo Veiga
9049ca25aa More export issues fixed. 2013-02-23 13:53:56 -03:00
Paulo Gustavo Veiga
76ccc5e6b2 Fix mindmap export. 2013-02-23 13:48:43 -03:00
Paulo Gustavo Veiga
8aa733158c Minor translation fix. 2013-02-23 12:58:34 -03:00
Paulo Gustavo Veiga
0eef3b3251 Add Catalan support for time ... 2013-02-23 12:53:06 -03:00
Paulo Gustavo Veiga
965ba4edaa Space " in customization dialogs. 2013-02-23 12:44:45 -03:00
Paulo Gustavo Veiga
7960c0a419 Finsh CA Integrationb. 2013-02-22 20:49:20 -03:00
Paulo Gustavo Veiga
99a3fa64ec Add Catalan support. 2013-02-22 20:39:51 -03:00
Paulo Gustavo Veiga
a7316d516c Add rest service doc. 2013-02-22 20:08:48 -03:00
457 changed files with 70883 additions and 9904 deletions

View File

@@ -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

View File

@@ -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 ?
Were 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
View File

@@ -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 delegated 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]

View 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;

View 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;

View 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;

View 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;

View 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');

View 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;

View 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;

View 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;

View 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`;

View 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;

View File

@@ -0,0 +1,3 @@
CREATE DATABASE wisemapping;
CREATE USER wisemapping WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE wisemapping TO wisemapping;

View 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;

View File

@@ -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;

View File

@@ -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>

View File

@@ -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>

View File

@@ -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}

View File

@@ -8,7 +8,7 @@ BASE_DIR=`pwd`
TARGET_DIR=$BASE_DIR/target
JETTY_DIR=$TARGET_DIR/wisemapping-$WISE_VERSION
WISE_WEBAPP_DIR=$JETTY_DIR/webapps/wisemapping
JETTY_VERSION=8.1.8.v20121106
JETTY_VERSION=8.1.14.v20131031
JETTY_DIST_DIR=jetty-distribution-${JETTY_VERSION}
JETTY_ZIP=${JETTY_DIST_DIR}.zip
@@ -51,7 +51,7 @@ 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

View File

@@ -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 "#################################################################"

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -1,4 +1,4 @@
Copyright [2012] [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

View File

@@ -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>
@@ -193,9 +193,6 @@
<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>
@@ -233,6 +230,7 @@
<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>

View File

@@ -1,153 +0,0 @@
/*
* 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.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();
});
}
});

View File

@@ -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);
@@ -470,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 ...
@@ -484,6 +522,8 @@ mindplot.Designer = new Class({
var position = result.position;
childModel.setPosition(position.x, position.y);
this._copyNodeProps(parentModel,childModel);
return childModel;
},
@@ -548,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;
},

View File

@@ -102,7 +102,7 @@ mindplot.RESTPersistenceManager = new Class({
persistence.onSave = false;
},
headers:{"Content-Type":"application/json", "Accept":"application/json"},
headers:{"Content-Type":"application/json; charset=utf-8", "Accept":"application/json"},
emulation:false,
urlEncoded:false
});
@@ -121,7 +121,7 @@ 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
});

View File

@@ -1,45 +0,0 @@
/*
* 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.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();

View File

@@ -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;
}
});

View File

@@ -1,26 +0,0 @@
/*
* 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.collaboration.framework.AbstractCollaborativeModelFactory = new Class({
createNewMindmap:function() {
throw "Unsupported operation";
},
buildMindmap:function(model) {
throw "Unsupported operation";
}
});

View File

@@ -1,37 +0,0 @@
/*
* 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.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);
}
});

View File

@@ -1,88 +0,0 @@
/*
* 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.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);
};

View File

@@ -1,106 +0,0 @@
/*
* 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.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);
}
}
);

View File

@@ -1,168 +0,0 @@
/*
* 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.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);
};

View File

@@ -57,12 +57,20 @@ mindplot.commands.AddTopicCommand = new Class({
},
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;
}
});

View File

@@ -167,7 +167,7 @@ mindplot.persistence.XMLSerializer_Beta = new Class({
$assert(documentElement.nodeName != "parsererror", "Error while parsing: '" + documentElement.childNodes[0].nodeValue);
// Is a wisemap?.
$assert(documentElement.tagName == mindplot.persistence.XMLSerializer_Beta.MAP_ROOT_NODE, "This seem not to be a map document. Root Tag: '" + documentElement.tagName);
$assert(documentElement.tagName == mindplot.persistence.XMLSerializer_Beta.MAP_ROOT_NODE, "This seem not to be a map document. Root Tag: '" + documentElement.tagName + ",',HTML:" +dom.innerHTML + ",XML:"+ core.Utils.innerXML(dom));
// Start the loading process ...
var version = documentElement.getAttribute("version");

View File

@@ -18,7 +18,7 @@
mindplot.persistence.XMLSerializer_Pela = new Class({
toXML:function (mindmap) {
toXML: function (mindmap) {
$assert(mindmap, "Can not save a null mindmap");
var document = core.Utils.createDocument();
@@ -27,7 +27,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
var mapElem = document.createElement("map");
var name = mindmap.getId();
if ($defined(name)) {
mapElem.setAttribute('name', name);
mapElem.setAttribute('name', this.rmXmlInv(name));
}
var version = mindmap.getVersion();
if ($defined(version)) {
@@ -61,7 +61,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
return document;
},
_topicToXML:function (document, topic) {
_topicToXML: function (document, topic) {
var parentTopic = document.createElement("topic");
// Set topic attributes...
@@ -149,10 +149,10 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
for (var key in attributes) {
var value = attributes[key];
if (key == 'text') {
var cdata = document.createCDATASection(value);
var cdata = document.createCDATASection(this.rmXmlInv(value));
featureDom.appendChild(cdata);
} else {
featureDom.setAttribute(key, value);
featureDom.setAttribute(key, this.rmXmlInv(value));
}
}
parentTopic.appendChild(featureDom);
@@ -169,18 +169,18 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
return parentTopic;
},
_noteTextToXML:function (document, elem, text) {
_noteTextToXML: function (document, elem, text) {
if (text.indexOf('\n') == -1) {
elem.setAttribute('text', text);
elem.setAttribute('text', this.rmXmlInv(text));
} else {
var textDom = document.createElement("text");
var cdata = document.createCDATASection(text);
var cdata = document.createCDATASection(this.rmXmlInv(text));
textDom.appendChild(cdata);
elem.appendChild(textDom);
}
},
_relationshipToXML:function (document, relationship) {
_relationshipToXML: function (document, relationship) {
var result = document.createElement("relationship");
result.setAttribute("srcTopicId", relationship.getFromNode());
result.setAttribute("destTopicId", relationship.getToNode());
@@ -203,7 +203,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
return result;
},
loadFromDom:function (dom, mapId) {
loadFromDom: function (dom, mapId) {
$assert(dom, "dom can not be null");
$assert(mapId, "mapId can not be null");
@@ -239,7 +239,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
return mindmap;
},
_deserializeNode:function (domElem, mindmap) {
_deserializeNode: function (domElem, mindmap) {
var type = (domElem.getAttribute('central') != null) ? mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE : mindplot.model.INodeModel.MAIN_TOPIC_TYPE;
// Load attributes...
@@ -320,7 +320,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
var isShrink = domElem.getAttribute('shrink');
// Hack: Some production maps has been stored with the central topic collapsed. This is a bug.
if ($defined(isShrink) && type!=mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
if ($defined(isShrink) && type != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
topic.setChildrenShrunken(isShrink);
}
@@ -373,7 +373,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
return topic;
},
_deserializeTextAttr:function (domElem) {
_deserializeTextAttr: function (domElem) {
var value = domElem.getAttribute("text");
if (!$defined(value)) {
var children = domElem.childNodes;
@@ -396,7 +396,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
return value;
},
_deserializeNodeText:function (domElem) {
_deserializeNodeText: function (domElem) {
var children = domElem.childNodes;
var value = null;
for (var i = 0; i < children.length; i++) {
@@ -408,7 +408,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
return value;
},
_deserializeRelationship:function (domElement, mindmap) {
_deserializeRelationship: function (domElement, mindmap) {
var srcId = domElement.getAttribute("srcTopicId");
var destId = domElement.getAttribute("destTopicId");
var lineType = domElement.getAttribute("lineType");
@@ -437,6 +437,36 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
model.setStartArrow('true');
return model;
}
/*
* This method ensures that the output String has only
* valid XML unicode characters as specified by the
* XML 1.0 standard. For reference, please see
* <a href="http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char">the
* standard</a>. This method will return an empty
* String if the input is null or empty.
*
* @param in The String whose non-valid characters we want to remove.
* @return The in String, stripped of non-valid characters.
*/,
rmXmlInv: function (str) {
if (str == null || str == undefined)
return null;
var result = "";
for (var i=0;i<str.length;i++){
var c = str.charCodeAt(i);
if ((c == 0x9) || (c == 0xA) || (c == 0xD)
|| ((c >= 0x20) && (c <= 0xD7FF))
|| ((c >= 0xE000) && (c <= 0xFFFD))
|| ((c >= 0x10000) && (c <= 0x10FFFF))) {
result = result + str.charAt(i);
}
}
return result;
}
});
mindplot.persistence.XMLSerializer_Pela.MAP_ROOT_NODE = 'map';

View File

@@ -66,7 +66,7 @@ mindplot.widget.FloatingTip = new Class({
},
show:function (element) {
var old = element.retrieve('floatingtip');
var old = $(element).retrieve('floatingtip');
if (old){
if (old.getStyle('opacity') == 1) {
clearTimeout(old.retrieve('timeout'));

View File

@@ -67,7 +67,7 @@ mindplot.widget.LinkIconTooltip = new Class({
});
var img = new Element('img', {
src:'http://open.thumbshots.org/image.pxf?url=' + linkIcon.getModel().getUrl(),
src:'http://immediatenet.com/t/m?Size=1024x768&URL=' + linkIcon.getModel().getUrl(),
img:linkIcon.getModel().getUrl(),
alt:linkIcon.getModel().getUrl()
}

View File

@@ -0,0 +1,60 @@
DISCARD_CHANGES=Descartar els canvis
SAVE=Desar
INSERT=Inserir
ZOOM_IN=Apropar
ZOOM_OUT=Allunyar
TOPIC_BORDER_COLOR=Color del bord
TOPIC_SHAPE=Forma del Tòpic
TOPIC_ADD=Afegir Tòpic
TOPIC_DELETE=Esborrar Tòpic
TOPIC_ICON=Afegir Icona
TOPIC_LINK=Afegir Enllaç
TOPIC_NOTE=Afegir Nota
TOPIC_COLOR=Color del Tòpic
TOPIC_RELATIONSHIP=Relació
FONT_FAMILY=Tipus de font
FONT_SIZE=Mida del text
FONT_BOLD=Negreta
FONT_ITALIC=Itàlica
FONT_COLOR=Color del Text
UNDO=Refer
NOTE=Nota
LOADING=Carregant ...
PRINT=Imprimir
PUBLISH=Publicar
REDO=Desfer
ADD_TOPIC=Afegir Tòpic
COLLABORATE=Compartir
EXPORT=Exportar
HISTORY=Història
SAVE_COMPLETE=Desat completat
SAVING=Gravant ...
ONE_TOPIC_MUST_BE_SELECTED=No ha estat possible crear un nou tòpic. Com a mínim ha de seleccionar un tòpic.
ONLY_ONE_TOPIC_MUST_BE_SELECTED=No ha estar possible crear un nou tòpic. Només un tòpic ha d'estar seleccionat.
SAVE_COULD_NOT_BE_COMPLETED=No s'ha pogut desar. Provi més tard.
UNEXPECTED_ERROR_LOADING=Ho sentim, un error ha esdevingut inesperadament. Provi recarregant l'editor, si el problema continua contacti a support@wisemapping.com.
ZOOM_ERROR=No es pot fer més zoom.
ZOOM_IN_ERROR=El zoom és massa creixent.
MAIN_TOPIC=Tòpic principal
SUB_TOPIC=Tòpic secundari
ISOLATED_TOPIC=Tòpic aïllat
CENTRAL_TOPIC=Tòpic central
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE=Els tòpics fills no es poden col·lapsar. Només un tòpic ha d'estar seleccionat.
SHORTCUTS=Accessos directes
ENTITIES_COULD_NOT_BE_DELETED=El tòpic o la relució no poden ser esborrats. Com a mínim ha de seleccionar un.
AT_LEAST_ONE_TOPIC_MUST_BE_SELECTED=Com a mínim ha de seleccionar un tòpic.
CLIPBOARD_IS_EMPTY=Res a copiar.
CENTRAL_TOPIC_CAN_NOT_BE_DELETED=El tòpic central no pot esborrar-se.
RELATIONSHIP_COULD_NOT_BE_CREATED=La relució no s'ha pout drear. Primer has de seleccionar una relució pare.
SELECTION_COPIED_TO_CLIPBOARD=Tòpics copiats
WRITE_YOUR_TEXT_HERE=Escriu aquí la teva nota ...
REMOVE=Esborrar
ACCEPT=Acceptar
CANCEL=Cancel·lar
LINK=Enllaç
OPEN_LINK=Obrir Enllaç
SESSION_EXPIRED=La seva sessió ha finalitzat. Si us plau, torni a connectar-se.

18
pom.xml
View File

@@ -4,14 +4,15 @@
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<properties>
<com.wisemapping.version>3.0-SNAPSHOT</com.wisemapping.version>
<com.wisemapping.version>3.1-SNAPSHOT</com.wisemapping.version>
<superpom.dir>${project.basedir}/wise-webapps</superpom.dir>
</properties>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wisemapping</groupId>
<artifactId>wisemapping</artifactId>
<name>WiseMapping Project</name>
<version>3.0-SNAPSHOT</version>
<version>3.1-SNAPSHOT</version>
<packaging>pom</packaging>
<licenses>
@@ -47,17 +48,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<version>2.16</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<version>3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -101,12 +102,11 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<inherited>true</inherited>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>

3
setup.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
export MAVEN_OPTS="-XX:MaxPermSize=128M"

View File

@@ -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>

View File

@@ -153,11 +153,21 @@ web2d.peer.svg.TextPeer = new Class({
},
getWidth : function () {
var computedWidth;
// Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround
try {
var computedWidth = this._native.getBBox().width;
computedWidth = this._native.getBBox().width;
// Chrome bug is producing this error, oly during page loading. Remove the hack if it works. The issue seems to be
// caused when the element is hidden. I don't know why, but it works ...
if(computedWidth==0){
var bbox = this._native.getBBox();
computedWidth = bbox.width;
}
} catch(e) {
computedWidth = 10;
}
var width = parseInt(computedWidth);

View File

@@ -0,0 +1,71 @@
JS Editor Integration
---------------------
## Running the JS only version
Start by creating the .zip file:
`mvn assembly:assembly -Dmaven.test.skip=true`
To test the javascript frontend you then do:
ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>".").start'
Now open a browser using the URL http://localhost:8000/wise-editor/src/main/webapp/
### Attaching drag and drop events.
1) Support for dragging TextNodes:
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();
// 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);
// Add link ...
var link = node.createFeature(mindplot.TopicFeature.Link.id, {url:"http://www.wisemapping.com"});
node.addFeature(link);
// Add Note ...
var note = node.createFeature(mindplot.TopicFeature.Note.id, {text:"This is a note"});
node.addFeature(note);
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 delegated 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);
} });

View File

@@ -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>
@@ -27,62 +27,5 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webApp>${project.build.directory}/wise-editor-${com.wisemapping.version}.war</webApp>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<warSourceExcludes>js/mindplot-min.js</warSourceExcludes>
<overlays>
<overlay>
<groupId>org.wisemapping</groupId>
<artifactId>core-js</artifactId>
<type>jar</type>
<targetPath>js</targetPath>
<includes>
<include>*.js</include>
</includes>
</overlay>
<overlay>
<groupId>org.wisemapping</groupId>
<artifactId>mindplot</artifactId>
<type>jar</type>
<targetPath>css</targetPath>
<includes>
<include>**/*.css</include>
<include>**/*.html</include>
</includes>
</overlay>
<overlay>
<groupId>org.wisemapping</groupId>
<artifactId>mindplot</artifactId>
<type>jar</type>
<targetPath>js</targetPath>
<includes>
<include>*.js</include>
</includes>
</overlay>
</overlays>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,48 +0,0 @@
<html>
<body>
<script type="text/javascript" src="http://docs.google.com/brix/static/api/js/jsapi.nocache.js"></script>
<script type="text/javascript">
var collabOnLoad = function() {
app = new goog.collab.CollaborativeApp();
app.start();
app.addListener('modelLoad', function(model) {
var root = app.getModel().getRoot();
var myList = root.get("myList");
if (!myList) {
myList = app.getModel().create("List");
root.put("myList", myList);
}
myList.addListener('valuesAdded', function(event) {
console.log("value added:" + myList.size());
});
myList.addListener('valuesRemoved', function(event) {
console.log("value removed:" + myList.size());
});
});
removedAction = function() {
var root = app.getModel().getRoot();
var myList = root.get("myList");
myList.remove(myList.size() - 1);
};
addAction = function() {
var root = app.getModel().getRoot();
var myList = root.get("myList");
myList.add("Some elem " + myList.size());
console.log("Click on adding...");
};
};
</script>
Funca?
<input style="font-size:20px;width:50px;height:50px;" type="button" value="Add" id="a2" onclick="addAction(this)"/>
<input style="font-size:20px;width:50px;height:50px;" type="button" value="Remove" id="a2"
onclick="removedAction(this)"/>
</body>
</html>

View File

@@ -1,5 +1,5 @@
@import "compatibility.less";
@import "css/libraries/moodialog/css/MooDialog.css";
@import "libraries/moodialog/css/MooDialog.css";
/********************************************************************************/
/* Header & Toolbar Styles */
/********************************************************************************/

1
wise-webapp/config Symbolic link
View File

@@ -0,0 +1 @@
../config/

View File

@@ -5,14 +5,22 @@ Introduction
-------------
All WiseMapping services are exposed as REST services. Those services are the same used by the WiseMapping when you are using it.
In the following section, all supported services are listed. The following variables should be replaced:
In the following section, all supported services are listed.
REST Console
-------------
You can learn how what are WiseMapping REST API's from using our interactive console. You can access it from here: http://localhost:8080/doc/rest/index.html.
Important: Don't forget to configure your server host url in /WEB-INF/app.properties. By default it's configure to http://localhost:8080/wisemapping/</p>
CURL Usage Examples
-------------
The following variables should be replaced:
- host.name: Host name where WiseMapping is deployed. Default Value: localhost
- host.post: Post number where WiseMapping is deployed. Default Value: 8080
- context.path: Context Path name where the application is deployed. Default Value: wisemapping
Supported Operations
----------------------
- context.path: Context Path name where the application is deployed. Default Value: wisemapping
Obtaining user information by email:
* Template Path: /service/admin/users/email/{user.email}.json
@@ -25,3 +33,10 @@ Deleting a based on the user id:
Changing Password:
Template Path: /service/admin/users/{userId}/password
* curl "http://{host.name}:{host.port}/{context.path}/service/admin/users/{userId}/password" --request put --basic -u "admin@wisemapping.org:admin" -H "Content-Type:text/plain" --data "<new_password>"
Creating a new user:
* Template Path: /service/admin/users/
* Method: Post
* curl "http://{host.name}:{host.port}/{context.path}/service/admin/users" --request post --basic -u "admin@wisemapping.org:admin" -H "Content-Type:application/json" --data '{"email": "te2@mydomain.de", "lastname": "lastname", "firstname":"myfirstname","password":"password"}'

View File

@@ -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>
<repositories>
@@ -83,6 +83,12 @@
<version>${org.springframework.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-openid</artifactId>
<version>${org.springframework.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
@@ -113,16 +119,6 @@
<version>${org.springframework.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jsr173_api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
@@ -182,12 +178,6 @@
<version>${org.springframework.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.0.1B</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
@@ -230,21 +220,15 @@
<version>1.7</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
@@ -282,7 +266,6 @@
<artifactId>jackson-core-asl</artifactId>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
@@ -313,86 +296,156 @@
<artifactId>jsoup</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>com.mangofactory</groupId>
<artifactId>swagger-springmvc</artifactId>
<version>0.6.6</version>
</dependency>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations_2.9.1</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.4.201312101107</version>
<executions>
<!--
Prepares the property pointing to the JaCoCo runtime agent which
is passed as VM argument when Maven the Surefire plugin is executed.
-->
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!--
Ensures that the code coverage report for unit tests is created after
unit tests have been run.
-->
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>hsqldb</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
<configuration>
<driver>org.hsqldb.jdbc.JDBCDriver</driver>
<url>jdbc:hsqldb:file:${project.build.directory}/db/wisemapping</url>
<username>sa</username>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.5</version>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.2.8</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>drop-schemas</id>
<phase>prepare-package</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<onError>continue</onError>
<orderFile>descending</orderFile>
<fileset>
<basedir>${project.basedir}</basedir>
<includes>
<include>config/database/hsql/drop-schemas.sql</include>
<include>config/database/hsql/create-schemas.sql</include>
<include>config/database/hsql/apopulate-schemas.sql</include>
</includes>
</fileset>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>mysqldb</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.5</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>init-schema</id>
<goals>
<goal>execute</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
<configuration>
<driver>com.mysql.jdbc.Driver</driver>
<username>root</username>
<password></password>
<url>jdbc:mysql://127.0.0.1:3306/?useUnicode=true&amp;characterEncoding=UTF-8</url>
<autocommit>false</autocommit>
<srcFiles>
<srcFile>config/database/mysql/create-database.sql</srcFile>
<srcFile>config/database/mysql/create-schemas.sql</srcFile>
<srcFile>config/database/mysql/apopulate-schemas.sql</srcFile>
</srcFiles>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
<configuration>
<driver>org.hsqldb.jdbc.JDBCDriver</driver>
<url>jdbc:hsqldb:file:${project.build.directory}/db/wisemapping</url>
<username>sa</username>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.5</version>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.2.8</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>drop-schemas</id>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<onError>continue</onError>
<orderFile>ascending</orderFile>
<fileset>
<basedir>${project.basedir}</basedir>
<includes>
<include>src/test/sql/hsql/drop-schemas.sql</include>
</includes>
</fileset>
</configuration>
</execution>
<execution>
<id>create-schema</id>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<orderFile>ascending</orderFile>
<fileset>
<basedir>${project.basedir}</basedir>
<includes>
<include>src/test/sql/hsql/create-schemas.sql</include>
</includes>
</fileset>
</configuration>
</execution>
<execution>
<id>create-data</id>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<orderFile>ascending</orderFile>
<fileset>
<basedir>${project.basedir}</basedir>
<includes>
<include>src/test/sql/hsql/test-data.sql</include>
</includes>
</fileset>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native2ascii-maven-plugin</artifactId>
@@ -410,8 +463,6 @@
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
@@ -475,16 +526,30 @@
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<path>/wisemapping</path>
<warFile>${project.build.directory}/wisemapping.war</warFile>
<mode>war</mode>
<update>true</update>
<systemProperties>
<database.base.url>${project.build.directory}</database.base.url>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.4.v20120524</version>
<version>9.1.1.v20140108</version>
<configuration>
<stopKey>foo</stopKey>
<stopPort>9999</stopPort>
@@ -494,20 +559,11 @@
<overrideDescriptor>${project.basedir}/webdefault.xml</overrideDescriptor>
</webAppConfig>
<systemProperties>
<systemProperty>
<name>org.mortbay.util.FileResource.checkAliases</name>
<value>false</value>
</systemProperty>
<systemProperty>
<name>org.mortbay.util.FileResource.checkAliases</name>
<value>false</value>
</systemProperty>
<systemProperty>
<name>database.base.url</name>
<value>${project.build.directory}</value>
</systemProperty>
</systemProperties>
<!--<scanIntervalSeconds>10</scanIntervalSeconds>-->
</configuration>
<executions>
<execution>
@@ -530,7 +586,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
@@ -543,9 +598,9 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.mortbay.jetty</groupId>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-runner</artifactId>
<version>7.4.5.v20110725</version>
<version>9.1.3.v20140225</version>
<destFileName>jetty-runner.jar</destFileName>
</artifactItem>
</artifactItems>

View File

@@ -0,0 +1,26 @@
package com.wisemapping.dao;
import com.wisemapping.model.Label;
import com.wisemapping.model.User;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public interface LabelManager {
void addLabel(@NotNull final Label label);
void saveLabel(@NotNull final Label label);
@NotNull
List<Label> getAllLabels(@NotNull final User user);
@Nullable
Label getLabelById(int id, @NotNull final User user);
@Nullable
Label getLabelByTitle(@NotNull final String title, @NotNull final User user);
void removeLabel(@NotNull final Label label);
}

View File

@@ -0,0 +1,57 @@
package com.wisemapping.dao;
import com.wisemapping.model.Label;
import com.wisemapping.model.User;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import java.util.List;
public class LabelManagerImpl extends HibernateDaoSupport
implements LabelManager {
@Override
public void addLabel(@NotNull final Label label) {
saveLabel(label);
}
@Override
public void saveLabel(@NotNull final Label label) {
getSession().save(label);
}
@NotNull
@Override
public List<Label> getAllLabels(@NotNull final User user) {
return getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where creator_id=?", user.getId());
}
@Nullable
@Override
public Label getLabelById(int id, @NotNull final User user) {
List<Label> labels = getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where id=? and creator=?", new Object[]{id, user});
return getFirst(labels);
}
@Nullable
@Override
public Label getLabelByTitle(@NotNull String title, @NotNull final User user) {
final List<Label> labels = getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where title=? and creator=?", new Object[]{title, user});
return getFirst(labels);
}
@Override
public void removeLabel(@NotNull Label label) {
getHibernateTemplate().delete(label);
}
@Nullable private Label getFirst(List<Label> labels) {
Label result = null;
if (labels != null && !labels.isEmpty()) {
result = labels.get(0);
}
return result;
}
}

View File

@@ -22,6 +22,7 @@ import com.wisemapping.model.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.util.List;
public interface MindmapManager {
@@ -38,7 +39,7 @@ public interface MindmapManager {
List<Mindmap> getAllMindmaps();
@NotNull
@Nullable
Mindmap getMindmapById(int mindmapId);
Mindmap getMindmapByTitle(final String name, final User user);
@@ -66,4 +67,6 @@ public interface MindmapManager {
public MindMapHistory getHistory(int historyId);
void updateCollaboration(@NotNull Collaboration collaboration);
void purgeHistory(int mapId) throws IOException;
}

View File

@@ -19,7 +19,9 @@
package com.wisemapping.dao;
import com.wisemapping.model.*;
import com.wisemapping.util.ZipUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.hibernate.criterion.Restrictions;
import org.hibernate.criterion.SimpleExpression;
@@ -27,6 +29,7 @@ import org.hibernate.criterion.Junction;
import org.hibernate.criterion.Order;
import org.hibernate.Criteria;
import java.io.IOException;
import java.util.List;
import java.util.Calendar;
@@ -57,9 +60,10 @@ public class MindmapManagerImpl
final Criteria hibernateCriteria = getSession().createCriteria(MindMapHistory.class);
hibernateCriteria.add(Restrictions.eq("mindmapId", mindmapId));
hibernateCriteria.addOrder(Order.desc("creationTime"));
// This line throws errors in some environments, so getting all history and taking firsts 10 records
hibernateCriteria.setMaxResults(30);
return hibernateCriteria.list();
return hibernateCriteria.list();
}
@Override
@@ -72,6 +76,38 @@ public class MindmapManagerImpl
getHibernateTemplate().save(collaboration);
}
@Override
public void purgeHistory(int mapId) throws IOException {
final Criteria hibernateCriteria = getSession().createCriteria(MindMapHistory.class);
hibernateCriteria.add(Restrictions.eq("mindmapId", mapId));
hibernateCriteria.addOrder(Order.desc("creationTime"));
final List<MindMapHistory> historyList = hibernateCriteria.list();
final Mindmap mindmap = this.getMindmapById(mapId);
if (mindmap != null) {
final Calendar yearAgo = Calendar.getInstance();
yearAgo.add(Calendar.MONTH, -12);
// If the map has not been modified in the last months, it means that I don't need to keep all the history ...
int max = mindmap.getLastModificationTime().before(yearAgo) ? 10 : 25;
for (MindMapHistory history : historyList) {
byte[] zippedXml = history.getZippedXml();
if (new String(zippedXml).startsWith("<map")) {
history.setZippedXml(ZipUtils.bytesToZip(zippedXml));
getHibernateTemplate().update(history);
}
}
if (historyList.size() > max) {
for (int i = max; i < historyList.size(); i++) {
getHibernateTemplate().delete(historyList.get(i));
}
}
}
}
@Override
public List<Mindmap> search(MindMapCriteria criteria, int maxResult) {
final Criteria hibernateCriteria = getSession().createCriteria(Mindmap.class);
@@ -162,7 +198,7 @@ public class MindmapManagerImpl
}
@Override
@NotNull
@Nullable
public Mindmap getMindmapById(int id) {
return getHibernateTemplate().get(Mindmap.class, id);
}
@@ -214,7 +250,7 @@ public class MindmapManagerImpl
private void saveHistory(@NotNull final Mindmap mindMap) {
final MindMapHistory history = new MindMapHistory();
history.setXml(mindMap.getXml());
history.setZippedXml(mindMap.getZippedXml());
history.setCreationTime(Calendar.getInstance());
history.setEditor(mindMap.getLastEditor());
history.setMindmapId(mindMap.getId());

View File

@@ -45,6 +45,6 @@ public interface UserManager {
public User createUser(User user, Collaborator col);
public void deleteUser(User user);
public void removeUser(@NotNull User user);
}

View File

@@ -22,7 +22,9 @@ import com.wisemapping.model.Collaboration;
import com.wisemapping.model.Collaborator;
import com.wisemapping.model.User;
import com.wisemapping.model.AccessAuditory;
import org.hibernate.ObjectNotFoundException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.security.authentication.encoding.PasswordEncoder;
//import org.acegisecurity.providers.encoding.PasswordEncoder;
@@ -69,8 +71,15 @@ public class UserManagerImpl
return cola;
}
@Nullable
public User getUserBy(long id) {
return getHibernateTemplate().get(User.class, id);
User user = null;
try{
user = getHibernateTemplate().get(User.class, id);
} catch (ObjectNotFoundException e){
// Ignore ...
}
return user;
}
@Override
@@ -101,11 +110,8 @@ public class UserManagerImpl
}
@Override
public void deleteUser(@NotNull User user) {
final Collaborator collaborator = this.getCollaboratorBy(user.getEmail());
getHibernateTemplate().delete(collaborator);
public void removeUser(@NotNull final User user) {
getHibernateTemplate().delete(user);
getHibernateTemplate().flush();
}
public void auditLogin(@NotNull AccessAuditory accessAuditory) {

View File

@@ -18,7 +18,11 @@ abstract public class ClientException extends WiseMappingException {
String getMsgBundleKey();
public String getMessage(@NotNull final MessageSource messageSource, final @NotNull Locale locale) {
return messageSource.getMessage(this.getMsgBundleKey(), this.getMsgBundleArgs(), locale);
String message = messageSource.getMessage(this.getMsgBundleKey(), this.getMsgBundleArgs(), locale);
if(message==null){
message = this.getMessage();
}
return message;
}
protected Object[] getMsgBundleArgs(){

View File

@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
public class EditionSessionExpiredException
extends ClientException
{
public static final String MSG_KEY = "MINDMAP_TIMESTAMP_OUTDATED";
private static final String MSG_KEY = "MINDMAP_TIMESTAMP_OUTDATED";
public EditionSessionExpiredException(@NotNull String msg)
{

View File

@@ -0,0 +1,19 @@
package com.wisemapping.exceptions;
import org.jetbrains.annotations.NotNull;
public class LabelCouldNotFoundException extends ClientException {
private static final String MSG_KEY = "LABEL_CAN_NOT_BE_FOUND";
public LabelCouldNotFoundException(@NotNull String msg)
{
super(msg,Severity.FATAL);
}
@NotNull
@Override
protected String getMsgBundleKey() {
return MSG_KEY;
}
}

View File

@@ -20,9 +20,11 @@ package com.wisemapping.exceptions;
import org.jetbrains.annotations.NotNull;
public class LockException
extends ClientException
{
private static final String MSG_KEY = "MINDMAP_IS_LOCKED";
public LockException(@NotNull String message) {
super(message,Severity.INFO);
}
@@ -30,6 +32,6 @@ public class LockException
@NotNull
@Override
protected String getMsgBundleKey() {
return null; //To change body of implemented methods use File | Settings | File Templates.
return MSG_KEY;
}
}

View File

@@ -0,0 +1,38 @@
/*
* 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.
*/
package com.wisemapping.exceptions;
import org.jetbrains.annotations.NotNull;
public class MapCouldNotFoundException
extends ClientException
{
private static final String MSG_KEY = "MAP_CAN_NOT_BE_FOUND";
public MapCouldNotFoundException(@NotNull String msg)
{
super(msg,Severity.FATAL);
}
@NotNull
@Override
protected String getMsgBundleKey() {
return MSG_KEY;
}
}

View File

@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
public class MultipleSessionsOpenException
extends ClientException
{
public static final String MSG_KEY = "MINDMAP_OUTDATED_BY_YOU";
private static final String MSG_KEY = "MINDMAP_OUTDATED_BY_YOU";
public MultipleSessionsOpenException(@NotNull String techInfo)
{

View File

@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
public class SessionExpiredException
extends ClientException {
public static final String MSG_KEY = "MINDMAP_TIMESTAMP_OUTDATED";
private static final String MSG_KEY = "MINDMAP_TIMESTAMP_OUTDATED";
private User lastUpdater;
public SessionExpiredException(@NotNull String debugInfo, @NotNull User lastUpdater) {

View File

@@ -26,6 +26,11 @@ public enum ExportFormat {
PNG("image/png", "png"),
PDF("application/pdf", "pdf"),
FREEMIND("application/freemind", "mm"),
TEXT("text/plain", "txt"),
MICROSOFT_EXCEL("application/vnd.ms-excel", "xls"),
MICROSOFT_WORD("application/msword", "doc"),
OPEN_OFFICE_WRITER("application/vnd.oasis.opendocument.text", "odt"),
MINDJET("application/vnd.mindjet.mindmanager", "mmap"),
WISEMAPPING("application/wisemapping+xml", "wxml");

View File

@@ -19,10 +19,11 @@
package com.wisemapping.exporter;
import com.wisemapping.model.Mindmap;
import org.jetbrains.annotations.NotNull;
import java.io.OutputStream;
public interface Exporter {
public void export(byte[] xml, OutputStream outputStream) throws ExportException;
public void export(@NotNull byte[] xml, @NotNull OutputStream outputStream) throws ExportException;
public void export(Mindmap map, OutputStream outputStream) throws ExportException;
}

View File

@@ -54,6 +54,7 @@ public class ExporterFactory {
private static final String GROUP_NODE_NAME = "g";
private static final String IMAGE_NODE_NAME = "image";
public static final int MARGING = 50;
public static final String UTF_8_CHARSET_NAME = "UTF-8";
private File baseImgDir;
public ExporterFactory(@NotNull final ServletContext servletContext) throws ParserConfigurationException {
@@ -121,12 +122,32 @@ public class ExporterFactory {
}
case SVG: {
final String svgString = normalizeSvg(mapSvg, true);
output.write(svgString.getBytes("UTF-8"));
output.write(svgString.getBytes(UTF_8_CHARSET_NAME));
break;
}
case TEXT: {
final Exporter exporter = XSLTExporter.create(XSLTExporter.Type.TEXT);
exporter.export(xml.getBytes(UTF_8_CHARSET_NAME), output);
break;
}
case OPEN_OFFICE_WRITER: {
final Exporter exporter = XSLTExporter.create(XSLTExporter.Type.OPEN_OFFICE);
exporter.export(xml.getBytes(UTF_8_CHARSET_NAME), output);
break;
}
case MICROSOFT_EXCEL: {
final Exporter exporter = XSLTExporter.create(XSLTExporter.Type.MICROSOFT_EXCEL);
exporter.export(xml.getBytes(UTF_8_CHARSET_NAME), output);
break;
}
case FREEMIND: {
final FreemindExporter exporter = new FreemindExporter();
exporter.export(xml.getBytes("UTF-8"), output);
exporter.export(xml.getBytes(UTF_8_CHARSET_NAME), output);
break;
}
case MINDJET: {
final Exporter exporter = XSLTExporter.create(XSLTExporter.Type.MINDJET);
exporter.export(xml.getBytes(UTF_8_CHARSET_NAME), output);
break;
}
default:
@@ -140,9 +161,7 @@ public class ExporterFactory {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilder documentBuilder = factory.newDocumentBuilder();
if (!svgXml.trim().startsWith("<svg xmlns=\"http://www.w3.org/2000/svg\"")) {
svgXml = svgXml.replaceFirst("<svg ", "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ");
} else {
if (!svgXml.contains("xmlns:xlink=\"http://www.w3.org/1999/xlink\"")) {
svgXml = svgXml.replaceFirst("<svg ", "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" ");
}
@@ -222,30 +241,32 @@ public class ExporterFactory {
Element elem = (Element) node;
// Cook image href ...
// If the image is a external URL, embeed it...
String imgUrl = elem.getAttribute("href");
elem.removeAttribute("href");
if (!imgUrl.startsWith("image/png;base64") ||!imgUrl.startsWith("data:image/png;base64") ) {
elem.removeAttribute("href");
if (imgUrl == null || imgUrl.isEmpty()) {
imgUrl = elem.getAttribute("xlink:href"); // Do not support namespaces ...
elem.removeAttribute("xlink:href");
}
FileInputStream fis = null;
if (imgUrl == null || imgUrl.isEmpty()) {
imgUrl = elem.getAttribute("xlink:href"); // Do not support namespaces ...
elem.removeAttribute("xlink:href");
}
FileInputStream fis = null;
// Obtains file name ...
try {
final File iconFile = iconFile(imgUrl);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
fis = new FileInputStream(iconFile);
BASE64Encoder encoder = new BASE64Encoder();
encoder.encode(fis, bos);
// Obtains file name ...
try {
final File iconFile = iconFile(imgUrl);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
fis = new FileInputStream(iconFile);
BASE64Encoder encoder = new BASE64Encoder();
encoder.encode(fis, bos);
elem.setAttribute("xlink:href", "data:image/png;base64," + bos.toString("8859_1"));
elem.appendChild(document.createTextNode(" "));
} catch (IOException e) {
e.printStackTrace();
} finally {
close(fis);
elem.setAttribute("xlink:href", "data:image/png;base64," + bos.toString("8859_1"));
elem.appendChild(document.createTextNode(" "));
} catch (IOException e) {
e.printStackTrace();
} finally {
close(fis);
}
}
}
}

View File

@@ -57,7 +57,7 @@ public class FreemindExporter
private Map<String, Node> nodesMap = null;
public void export(Mindmap map, OutputStream outputStream) throws ExportException {
export(map.getXml(), outputStream);
export(map.getUnzipXml(), outputStream);
}
public void export(byte[] xml, @NotNull OutputStream outputStream) throws ExportException {
@@ -267,7 +267,6 @@ public class FreemindExporter
/*
* MindmapFont format : fontName ; size ; color ; bold; italic;
* eg: Verdana;10;#ffffff;bold;italic;
*
*/
private void addFontNode(@NotNull com.wisemapping.jaxb.freemind.Node freemindNode, com.wisemapping.jaxb.wisemap.TopicType mindmapTopic) {
final String fontStyle = mindmapTopic.getFontStyle();
@@ -289,15 +288,22 @@ public class FreemindExporter
// Font size
if (idx < countParts && part[idx].length() != 0) {
String size = part[idx];
font.setSIZE(new BigInteger(size));
updated = true;
final String size = part[idx];
if (size != null && !size.isEmpty()) {
int freeSize = Integer.parseInt(size);
Integer fsize = wiseToFreeFontSize.get(freeSize);
if(fsize!=null){
font.setSIZE(BigInteger.valueOf(fsize));
updated = true;
}
}
}
idx++;
// Font Color
if (idx < countParts && part[idx].length() != 0) {
freemindNode.setCOLOR(part[idx]);
updated = true;
}
idx++;
@@ -319,4 +325,21 @@ public class FreemindExporter
}
}
}
// Freemind size goes from 10 to 28
// WiseMapping:
// 6 Small
// 8 Normal
// 10 Large
// 15 Huge
static private Map<Integer, Integer> wiseToFreeFontSize = new HashMap<Integer, Integer>();
static {
wiseToFreeFontSize.put(6, 10);
wiseToFreeFontSize.put(8, 12);
wiseToFreeFontSize.put(10, 18);
wiseToFreeFontSize.put(15, 24);
}
}

View File

@@ -0,0 +1,84 @@
package com.wisemapping.exporter;
import com.wisemapping.model.Mindmap;
import org.jetbrains.annotations.NotNull;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.*;
public class XSLTExporter implements Exporter {
private Type type;
public XSLTExporter(@NotNull Type type) {
this.type = type;
}
@Override
public void export(@NotNull byte[] xml, @NotNull OutputStream outputStream) throws ExportException {
final ByteArrayOutputStream mmos = new ByteArrayOutputStream();
// Convert to freemind ...
final FreemindExporter exporter = new FreemindExporter();
exporter.export(xml, mmos);
// Convert to xslt transform ...
final InputStream xsltis = this.getClass().getResourceAsStream("/com/wisemapping/export/xslt/" + type.getXsltName());
if (xsltis == null) {
throw new IllegalStateException("XSLT could not be resolved.");
}
try {
final TransformerFactory factory = TransformerFactory.newInstance();
final Source xslt = new StreamSource(xsltis);
Transformer transformer = factory.newTransformer(xslt);
final CharArrayReader reader = new CharArrayReader(mmos.toString("iso-8859-1").toCharArray());
final Source mmSource = new StreamSource(reader);
transformer.transform(mmSource, new StreamResult(outputStream));
} catch (TransformerException e) {
throw new ExportException(e);
} catch (UnsupportedEncodingException e) {
throw new ExportException(e);
}
}
@Override
public void export(@NotNull Mindmap map, OutputStream outputStream) throws ExportException {
throw new UnsupportedOperationException();
}
@NotNull
public static Exporter create(@NotNull Type type) {
return new XSLTExporter(type);
}
public static enum Type {
TEXT("mm2text.xsl"),
WORD("mm2wordml_utf8.xsl"),
CSV("mm2csv.xsl"),
LATEX("mm2latex.xsl"),
MICROSOFT_EXCEL("mm2xls_utf8.xsl"),
MINDJET("mm2mj.xsl"),
OPEN_OFFICE("mm2oowriter.xsl");
public String getXsltName() {
return xsltName;
}
private String xsltName;
Type(@NotNull String xstFile) {
this.xsltName = xstFile;
}
}
}

View File

@@ -45,6 +45,9 @@ public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter {
@Value("${security.type}")
private String securityType;
@Value("${security.openid.enabled}")
private Boolean openIdEnabled;
public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, Object object) throws Exception {
request.setAttribute("google.analytics.enabled", analyticsEnabled);
@@ -52,6 +55,7 @@ public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter {
request.setAttribute("google.ads.enabled", adsEnabled);
request.setAttribute("site.homepage", siteHomepage);
request.setAttribute("security.type", securityType);
request.setAttribute("security.openid.enabled", openIdEnabled);
// If the property could not be resolved, try to infer one from the request...

View File

@@ -46,7 +46,8 @@ public class SupportedUserAgent implements Serializable {
final int majorVersion = version != null ? Integer.parseInt(version.getMajorVersion()) : -1;
boolean result = browser == Browser.FIREFOX && majorVersion >= 10;
result = result || browser == Browser.IE8 || browser == Browser.IE9;
result = result || browser == Browser.FIREFOX2 && majorVersion >= 17;
result = result || browser == Browser.IE8 || browser == Browser.IE9 || browser == Browser.IE11 ;
result = result || browser == Browser.IE && majorVersion >= 8;
result = result || browser == Browser.OPERA10 && majorVersion >= 11;
result = result || browser == Browser.CHROME && majorVersion >= 18;

View File

@@ -0,0 +1,44 @@
package com.wisemapping.listener;
import com.wisemapping.exceptions.AccessDeniedSecurityException;
import com.wisemapping.exceptions.LockException;
import com.wisemapping.model.User;
import com.wisemapping.security.Utils;
import com.wisemapping.service.LockManager;
import com.wisemapping.service.MindmapService;
import org.jetbrains.annotations.NotNull;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
public class UnlockOnExpireListener implements HttpSessionListener {
@Override
public void sessionCreated(@NotNull HttpSessionEvent event) {
}
@Override
public void sessionDestroyed(@NotNull HttpSessionEvent event) {
final ServletContext servletContext = event.getSession().getServletContext();
final WebApplicationContext wc = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
final MindmapService mindmapService = (MindmapService) wc.getBean("mindmapService");
final LockManager lockManager = mindmapService.getLockManager();
final User user = Utils.getUser(false);
if (user != null) {
try {
lockManager.unlockAll(user);
} catch (LockException e) {
e.printStackTrace();
} catch (AccessDeniedSecurityException e) {
e.printStackTrace();
}
}
}
}

View File

@@ -154,12 +154,12 @@ final public class NotificationService {
// }
}
public void reportJavascriptException(@NotNull Mindmap mindmap, @Nullable User user, @Nullable String jsErrorMsg, @NotNull HttpServletRequest request) {
public void reportJavascriptException(@Nullable Mindmap mindmap, @Nullable User user, @Nullable String jsErrorMsg, @NotNull HttpServletRequest request) {
final Map<String, String> model = new HashMap<String, String>();
model.put("errorMsg", jsErrorMsg);
try {
model.put("mapXML", StringEscapeUtils.escapeXml(mindmap.getXmlStr()));
model.put("mapXML", StringEscapeUtils.escapeXml(mindmap == null ? "map not found" : mindmap.getXmlStr()));
} catch (UnsupportedEncodingException e) {
// Ignore ...
}

View File

@@ -19,9 +19,11 @@ public class NotifierFilter {
final StringBuilder buff = new StringBuilder();
for (String key : model.keySet()) {
buff.append(key);
buff.append("=");
buff.append(model.get(key));
if (!key.equals("mapXML")) {
buff.append(key);
buff.append("=");
buff.append(model.get(key));
}
}
final String digest = DigestUtils.md5DigestAsHex(buff.toString().getBytes());

View File

@@ -0,0 +1,37 @@
package com.wisemapping.model;
import org.jetbrains.annotations.NotNull;
public enum AuthenticationType {
DATABASE('D'),
LDAP('L'),
OPENID('O');
private final char schemaCode;
AuthenticationType(char schemaCode) {
this.schemaCode = schemaCode;
}
public char getCode() {
return schemaCode;
}
@NotNull
public static AuthenticationType valueOf(char code) {
AuthenticationType result = null;
AuthenticationType[] values = AuthenticationType.values();
for (AuthenticationType value : values) {
if (value.getCode() == code) {
result = value;
break;
}
}
if (result == null) {
throw new IllegalStateException("Could not find auth with code:" + code);
}
return result;
}
}

View File

@@ -21,6 +21,7 @@ package com.wisemapping.model;
public class Constants {
public static final int MAX_MAP_NAME_LENGTH = 512;
public static final int MAX_LABEL_NAME_LENGTH = 30;
public static final int MAX_MAP_DESCRIPTION_LENGTH = 512;
public static final int MAX_USER_LASTNAME_LENGTH = 255;
public static final int MAX_USER_FIRSTNAME_LENGTH = 255;

View File

@@ -0,0 +1,90 @@
package com.wisemapping.model;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class Label {
//~ Instance fields ......................................................................................
private int id;
@NotNull private String title;
@NotNull private User creator;
@Nullable private Label parent;
@NotNull private String color;
@NotNull private String iconName;
public void setParent(@Nullable Label parent) {
this.parent = parent;
}
@Nullable
public Label getParent() {
return parent;
}
public void setCreator(@NotNull User creator) {
this.creator = creator;
}
@NotNull
public User getCreator() {
return creator;
}
@Nullable
public String getTitle() {
return title;
}
public void setTitle(@NotNull String title) {
this.title = title;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@NotNull
public String getColor() {
return color;
}
public void setColor(@NotNull String color) {
this.color = color;
}
@NotNull
public String getIconName() {
return iconName;
}
public void setIconName(@NotNull String iconName) {
this.iconName = iconName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Label)) return false;
Label label = (Label) o;
return id == label.id && creator.getId() == label.creator.getId()
&& !(parent != null ? !parent.equals(label.parent) : label.parent != null);
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + title.hashCode();
result = 31 * result + creator.hashCode();
result = 31 * result + (parent != null ? parent.hashCode() : 0);
return result;
}
}

View File

@@ -19,6 +19,7 @@
package com.wisemapping.model;
import com.wisemapping.util.ZipUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
@@ -29,7 +30,7 @@ public class MindMapHistory {
private int id;
private Calendar creationTime;
private User editor;
private byte[] xml;
private byte[] zippedXml;
private int mindmapId;
public MindMapHistory() {
@@ -52,6 +53,7 @@ public class MindMapHistory {
this.mindmapId = id;
}
@NotNull
public Calendar getCreationTime() {
return creationTime;
}
@@ -69,15 +71,15 @@ public class MindMapHistory {
this.editor = editor;
}
public byte[] getXml() {
return xml;
public byte[] getZippedXml() {
return zippedXml;
}
public void setXml(byte[] value) {
xml = value;
public void setZippedXml(byte[] value) {
zippedXml = value;
}
public byte[] getUnzipXml() throws IOException {
return ZipUtils.zipToBytes(xml);
return ZipUtils.zipToBytes(getZippedXml());
}
}

View File

@@ -29,6 +29,7 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Calendar;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
public class Mindmap {
@@ -44,11 +45,12 @@ public class Mindmap {
private User lastEditor;
private Set<Collaboration> collaborations = new HashSet<Collaboration>();
private Set<Label> labels = new LinkedHashSet<>();
private User creator;
private String tags;
private String title;
private byte[] xml;
private byte[] zippedXml;
//~ Constructors .........................................................................................
@@ -57,39 +59,49 @@ public class Mindmap {
//~ Methods ..............................................................................................
public void setXml(byte[] xml) {
this.xml = xml;
public void setUnzipXml(@NotNull byte[] value) {
try {
final byte[] zip = ZipUtils.bytesToZip(value);
this.setZippedXml(zip);
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
public void setXmlStr(@NotNull String xml)
throws IOException {
this.xml = xml.getBytes(UTF_8);
public void setXmlStr(@NotNull String xml) {
try {
this.setUnzipXml(xml.getBytes(UTF_8));
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException(e);
}
}
public byte[] getXml() {
return xml;
@NotNull
public byte[] getUnzipXml() {
byte[] result = new byte[]{};
if (zippedXml != null) {
try {
final byte[] zip = this.getZippedXml();
result = ZipUtils.zipToBytes(zip);
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
return result;
}
@NotNull
public String getXmlStr() throws UnsupportedEncodingException {
String result = null;
if (this.xml != null) {
result = new String(this.xml, UTF_8);
}
return result;
return new String(this.getUnzipXml(), UTF_8);
}
public byte[] getZippedXml()
throws IOException {
byte[] result = this.xml;
if (result != null) {
result = ZipUtils.bytesToZip(result);
}
return result;
@NotNull
public byte[] getZippedXml() {
return zippedXml;
}
public void setZippedXml(byte[] xml)
throws IOException {
this.xml = ZipUtils.zipToBytes(xml);
public void setZippedXml(@NotNull byte[] value) {
this.zippedXml = value;
}
public Set<Collaboration> getCollaborations() {
@@ -108,6 +120,18 @@ public class Mindmap {
collaborations.add(collaboration);
}
@NotNull public Set<Label> getLabels() {
return labels;
}
public void setLabels(@NotNull final Set<Label> labels) {
this.labels = labels;
}
public void addLabel(@NotNull final Label label) {
this.labels.add(label);
}
@Nullable
public Collaboration findCollaboration(@NotNull Collaborator collaborator) {
Collaboration result = null;
@@ -140,6 +164,7 @@ public class Mindmap {
this.isPublic = isPublic;
}
@NotNull
public Calendar getLastModificationTime() {
return lastModificationTime;
}
@@ -218,9 +243,6 @@ public class Mindmap {
}
public void setCreator(@NotNull User creator) {
if (creator == null) {
throw new IllegalArgumentException("Owner can not be null");
}
this.creator = creator;
}
@@ -279,7 +301,7 @@ public class Mindmap {
final Mindmap result = new Mindmap();
result.setDescription(this.getDescription());
result.setTitle(this.getTitle());
result.setXml(this.getXml());
result.setUnzipXml(this.getUnzipXml());
result.setTags(this.getTags());
return result;
@@ -296,4 +318,28 @@ public class Mindmap {
return result;
}
//creo que no se usa mas
public boolean hasLabel(@NotNull final String name) {
for (Label label : this.labels) {
if (label.getTitle().equals(name)) {
return true;
}
}
return false;
}
@Nullable public Label findLabel(int labelId) {
Label result = null;
for (Label label : this.labels) {
if (label.getId() == labelId) {
result = label;
break;
}
}
return result;
}
public void removeLabel(@NotNull final Label label) {
this.labels.remove(label);
}
}

View File

@@ -18,6 +18,7 @@
package com.wisemapping.model;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.Serializable;
@@ -37,8 +38,11 @@ public class User
private Set<String> tags = new HashSet<String>();
private boolean allowSendEmail = false;
private String locale;
private AuthenticationType authenticationType;
private String authenticatorUri;
public User() {
}
@@ -114,4 +118,35 @@ public class User
public void setLocale(@Nullable String locale) {
this.locale = locale;
}
public char getAutheticationTypeCode() {
// Default authentication is database ....
return this.authenticationType != null ? this.authenticationType.getCode() : AuthenticationType.DATABASE.getCode();
}
public void setAutheticationTypeCode(char code) {
this.authenticationType = AuthenticationType.valueOf(code);
}
public AuthenticationType getAuthenticationType() {
return authenticationType;
}
public void setAuthenticationType(@NotNull AuthenticationType authenticationType) {
this.authenticationType = authenticationType;
}
public boolean isDatabaseSchema(){
return this.authenticationType == AuthenticationType.DATABASE;
}
public String getAuthenticatorUri() {
return authenticatorUri;
}
public void setAuthenticatorUri(String authenticatorUri) {
this.authenticatorUri = authenticatorUri;
}
}

View File

@@ -18,23 +18,32 @@
package com.wisemapping.rest;
import com.mangofactory.swagger.annotations.ApiIgnore;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.mail.NotificationService;
import com.wisemapping.model.Collaboration;
import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestLogItem;
import com.wisemapping.security.Utils;
import com.wisemapping.service.MindmapService;
import com.wisemapping.service.UserService;
import com.wordnik.swagger.annotations.Api;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Api(value="UserApi",description = "Account Account Related Objects.")
@Controller
public class AccountController extends BaseController {
@Qualifier("userService")
@@ -58,7 +67,7 @@ public class AccountController extends BaseController {
throw new IllegalArgumentException("Password can not be null");
}
final User user = Utils.getUser();
final User user = Utils.getUser(true);
user.setPassword(password);
userService.changePassword(user);
}
@@ -70,7 +79,7 @@ public class AccountController extends BaseController {
throw new IllegalArgumentException("Firstname can not be null");
}
final User user = Utils.getUser();
final User user = Utils.getUser(true);
user.setFirstname(firstname);
userService.updateUser(user);
}
@@ -82,7 +91,7 @@ public class AccountController extends BaseController {
throw new IllegalArgumentException("lastname can not be null");
}
final User user = Utils.getUser();
final User user = Utils.getUser(true);
user.setLastname(lastname);
userService.updateUser(user);
}
@@ -95,14 +104,30 @@ public class AccountController extends BaseController {
}
final User user = Utils.getUser();
final User user = Utils.getUser(true);
user.setLocale(language);
userService.updateUser(user);
}
@RequestMapping(method = RequestMethod.DELETE, value = "account")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void deleteUser() throws WiseMappingException
{
final User user = Utils.getUser(true);
final List<Collaboration> collaborations = mindmapService.findCollaborations(user);
for (Collaboration collaboration : collaborations) {
final Mindmap mindmap = collaboration.getMindMap();
mindmapService.removeMindmap(mindmap,user);
}
userService.removeUser(user);
}
@ApiIgnore
@RequestMapping(method = RequestMethod.POST, value = "logger/editor", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void changePassword(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) {
public void logError(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) {
final Mindmap mindmap = mindmapService.findMindmapById(item.getMapId());
final User user = Utils.getUser();
logger.error("Unexpected editor error - " + item.getJsErrorMsg());

View File

@@ -18,50 +18,74 @@
package com.wisemapping.rest;
import com.wisemapping.exceptions.ClientException;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.AuthenticationType;
import com.wisemapping.model.Collaboration;
import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestUser;
import com.wisemapping.service.MindmapService;
import com.wisemapping.service.UserService;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Calendar;
import java.util.List;
import java.util.regex.Pattern;
@Api(value = "AdminApi", description = "Administrative Related Objects.")
@Controller
public class AdminController extends BaseController {
@Qualifier("userService")
@Autowired
private UserService userService;
@RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json", "text/html", "application/xml"})
@Qualifier("mindmapService")
@Autowired
private MindmapService mindmapService;
@ApiOperation("Note: Administration permissions required.")
@RequestMapping(method = RequestMethod.GET, value = "admin/users/{id}", produces = {"application/json", "application/xml"})
@ResponseBody
public ModelAndView getUserById(@PathVariable long id) throws IOException {
public RestUser getUserById(@PathVariable @ApiParam(required = true, value = "User Id", allowableValues = "range[1," + Long.MAX_VALUE + "]") long id) throws IOException {
final User userBy = userService.getUserBy(id);
if (userBy == null) {
throw new IllegalArgumentException("User could not be found");
}
return new ModelAndView("userView", "user", new RestUser(userBy));
return new RestUser(userBy);
}
@RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email}", produces = {"application/json", "text/html", "application/xml"})
@ApiOperation("Note: Administration permissions required.")
@RequestMapping(method = RequestMethod.GET, value = "admin/users/email/{email}", produces = {"application/json", "application/xml"})
@ResponseBody
public ModelAndView getUserByEmail(@PathVariable String email) throws IOException {
public RestUser getUserByEmail(@PathVariable String email) throws IOException {
final User user = userService.getUserBy(email);
if (user == null) {
throw new IllegalArgumentException("User '" + email + "' could not be found");
}
return new ModelAndView("userView", "user", new RestUser(user));
return new RestUser(user);
}
@RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
@ApiOperation("Note: Administration permissions required.")
@RequestMapping(method = RequestMethod.POST, value = "admin/users", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.CREATED)
public void createUser(@RequestBody RestUser user, HttpServletResponse response) throws WiseMappingException {
public void createUser(@RequestBody @ApiParam(required = true) RestUser user, HttpServletResponse response) throws WiseMappingException {
if (user == null) {
throw new IllegalArgumentException("User could not be found");
}
@@ -85,13 +109,15 @@ public class AdminController extends BaseController {
}
// Finally create the user ...
userService.createUser(delegated, false,true);
delegated.setAuthenticationType(AuthenticationType.DATABASE);
userService.createUser(delegated, false, true);
response.setHeader("Location", "/service/admin/users/" + user.getId());
}
@ApiOperation("Note: Administration permissions required.")
@RequestMapping(method = RequestMethod.PUT, value = "admin/users/{id}/password", consumes = {"text/plain"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void changePassword(@RequestBody String password, @PathVariable long id) throws WiseMappingException {
public void changePassword(@RequestBody @ApiParam(required = true) String password, @PathVariable @ApiParam(required = true, value = "User Id", allowableValues = "range[1," + Long.MAX_VALUE + "]") long id) throws WiseMappingException {
if (password == null) {
throw new IllegalArgumentException("Password can not be null");
}
@@ -104,14 +130,96 @@ public class AdminController extends BaseController {
userService.changePassword(user);
}
@RequestMapping(method = RequestMethod.DELETE,value = "admin/users/{id}")
@ApiOperation("Note: Administration permissions required.")
@RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void getUserByEmail(@PathVariable long id) throws WiseMappingException {
public void deleteUserByEmail(@PathVariable long id) throws WiseMappingException {
final User user = userService.getUserBy(id);
if (user == null) {
throw new IllegalArgumentException("User '" + id + "' could not be found");
}
userService.deleteUser(user);
final List<Collaboration> collaborations = mindmapService.findCollaborations(user);
for (Collaboration collaboration : collaborations) {
final Mindmap mindmap = collaboration.getMindMap();
mindmapService.removeMindmap(mindmap,user);
}
userService.removeUser(user);
}
@ApiOperation("Note: Administration permissions required.")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
@RequestMapping(method = RequestMethod.GET, value = "admin/database/purge")
public void purgeDB(@RequestParam(required = true) Integer minUid, @RequestParam(required = true) Integer maxUid, @RequestParam(required = true) Boolean apply) throws WiseMappingException, UnsupportedEncodingException {
for (int i = minUid; i < maxUid; i++) {
try {
System.out.println("Looking for user:" + i);
final User user = userService.getUserBy(i);
if (user != null) {
// Do not process admin accounts ...
if (user.getEmail().contains("wisemapping")) {
continue;
}
// Iterate over the list of maps ...
final List<Collaboration> collaborations = mindmapService.findCollaborations(user);
for (Collaboration collaboration : collaborations) {
final Mindmap mindmap = collaboration.getMindMap();
if (MindmapFilter.MY_MAPS.accept(mindmap, user)) {
final Calendar yearAgo = Calendar.getInstance();
yearAgo.add(Calendar.MONTH, -4);
// The use has only two maps... When they have been modified ..
System.out.println("Checking map id:" + mindmap.getId());
if (mindmap.getLastModificationTime().before(yearAgo) && !mindmap.isPublic()) {
System.out.println("Old map months map:" + mindmap.getId());
if (isWelcomeMap(mindmap) || isSimpleMap(mindmap)) {
System.out.println("Purged map id:" + mindmap.getId() + ", userId:" + user.getId());
if (apply) {
mindmapService.removeMindmap(mindmap, user);
}
}
}
// Purge history ...
mindmapService.purgeHistory(mindmap.getId());
}
}
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (WiseMappingException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (RuntimeException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
}
@ApiOperation("Note: Administration permissions required.")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
@RequestMapping(method = RequestMethod.GET, value = "admin/database/purge/history")
public void purgeHistory(@RequestParam(required = true) Integer mapId) throws WiseMappingException, IOException {
mindmapService.purgeHistory(mapId);
}
private boolean isWelcomeMap(@NotNull Mindmap mindmap) throws UnsupportedEncodingException {
// Is welcome map ?
final String xmlStr = mindmap.getXmlStr();
boolean oldWelcomeMap = xmlStr.contains("Welcome to WiseMapping") && xmlStr.contains("My Wisemaps");
return oldWelcomeMap;
}
public boolean isSimpleMap(@NotNull Mindmap mindmap) throws UnsupportedEncodingException {
String xmlStr = mindmap.getXmlStr();
String[] topics = xmlStr.split(Pattern.quote("<topic"));
return topics.length <= 3;
}
}

View File

@@ -60,16 +60,6 @@ public class BaseController {
return new RestErrors(ex.getMessage(),Severity.WARNING);
}
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseBody
public RestErrors handleServerErrors(@NotNull Exception ex, @NotNull HttpServletRequest request) {
final User user = Utils.getUser();
notificationService.reportJavaException(ex, user, request);
return new RestErrors(ex.getMessage(),Severity.SEVERE);
}
@ExceptionHandler(ImportUnexpectedException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseBody
@@ -110,4 +100,16 @@ public class BaseController {
final Locale locale = LocaleContextHolder.getLocale();
return new RestErrors(ex.getMessage(messageSource, locale),ex.getSeverity(),ex.getTechInfo());
}
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
@ResponseBody
public RestErrors handleServerErrors(@NotNull Exception ex, @NotNull HttpServletRequest request) {
final User user = Utils.getUser(false);
notificationService.reportJavaException(ex, user, request);
ex.printStackTrace();
return new RestErrors(ex.getMessage(),Severity.SEVERE);
}
}

View File

@@ -0,0 +1,96 @@
package com.wisemapping.rest;
import com.wisemapping.exceptions.LabelCouldNotFoundException;
import com.wisemapping.exceptions.MapCouldNotFoundException;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.Label;
import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestLabel;
import com.wisemapping.rest.model.RestLabelList;
import com.wisemapping.rest.model.RestMindmapInfo;
import com.wisemapping.rest.model.RestMindmapList;
import com.wisemapping.security.Utils;
import com.wisemapping.service.LabelService;
import com.wisemapping.service.MindmapService;
import com.wisemapping.validator.LabelValidator;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Controller
public class LabelController extends BaseController {
@Qualifier("labelService")
@Autowired
private LabelService labelService;
@RequestMapping(method = RequestMethod.POST, value = "/labels", consumes = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.CREATED)
public void createLabel(@RequestBody RestLabel restLabel, @NotNull HttpServletResponse response, @RequestParam(required = false) String title) throws WiseMappingException {
// Overwrite title if it was specified by parameter.
if (title != null && !title.isEmpty()) {
restLabel.setTitle(title);
}
// Validate ...
validate(restLabel);
final Label label = createLabel(restLabel);
// Return the new created label ...
response.setHeader("Location", "/service/labels/" + label.getId());
response.setHeader("ResourceId", Integer.toString(label.getId()));
}
@RequestMapping(method = RequestMethod.GET, value = "/labels", produces = {"application/json", "application/xml"})
public RestLabelList retrieveList() {
final User user = Utils.getUser();
assert user != null;
final List<Label> all = labelService.getAll(user);
return new RestLabelList(all);
}
@RequestMapping(method = RequestMethod.DELETE, value = "/labels/{id}")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void deleteLabelById(@PathVariable int id) throws WiseMappingException {
final User user = Utils.getUser();
final Label label = labelService.getLabelById(id, user);
if (label == null) {
throw new LabelCouldNotFoundException("Label could not be found. Id: " + id);
}
assert user != null;
labelService.removeLabel(label, user);
}
@NotNull private Label createLabel(@NotNull final RestLabel restLabel) throws WiseMappingException {
final Label label = restLabel.getDelegated();
// Add new label ...
final User user = Utils.getUser();
assert user != null;
labelService.addLabel(label, user);
return label;
}
private void validate(@NotNull final RestLabel restLabel) throws ValidationException {
final BindingResult result = new BeanPropertyBindingResult(restLabel, "");
new LabelValidator(labelService).validate(restLabel.getDelegated(), result);
if (result.hasErrors()) {
throw new ValidationException(result);
}
}
}

View File

@@ -18,20 +18,41 @@
package com.wisemapping.rest;
import com.wisemapping.exceptions.*;
import com.mangofactory.swagger.annotations.ApiIgnore;
import com.wisemapping.exceptions.ImportUnexpectedException;
import com.wisemapping.exceptions.LabelCouldNotFoundException;
import com.wisemapping.exceptions.MapCouldNotFoundException;
import com.wisemapping.exceptions.MultipleSessionsOpenException;
import com.wisemapping.exceptions.SessionExpiredException;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.importer.ImportFormat;
import com.wisemapping.importer.Importer;
import com.wisemapping.importer.ImporterException;
import com.wisemapping.importer.ImporterFactory;
import com.wisemapping.model.*;
import com.wisemapping.rest.model.*;
import com.wisemapping.model.Collaboration;
import com.wisemapping.model.CollaborationProperties;
import com.wisemapping.model.CollaborationRole;
import com.wisemapping.model.Label;
import com.wisemapping.model.MindMapHistory;
import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestCollaboration;
import com.wisemapping.rest.model.RestCollaborationList;
import com.wisemapping.rest.model.RestLabel;
import com.wisemapping.rest.model.RestMindmap;
import com.wisemapping.rest.model.RestMindmapHistory;
import com.wisemapping.rest.model.RestMindmapHistoryList;
import com.wisemapping.rest.model.RestMindmapInfo;
import com.wisemapping.rest.model.RestMindmapList;
import com.wisemapping.security.Utils;
import com.wisemapping.service.CollaborationException;
import com.wisemapping.service.LabelService;
import com.wisemapping.service.LockInfo;
import com.wisemapping.service.LockManager;
import com.wisemapping.service.MindmapService;
import com.wisemapping.validator.MapInfoValidator;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiParam;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -39,15 +60,28 @@ import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Api(value = "mindmap", description = "User Mindmap Objects.")
@Controller
public class MindmapController extends BaseController {
@@ -56,20 +90,22 @@ public class MindmapController extends BaseController {
@Autowired
private MindmapService mindmapService;
@Qualifier("labelService")
@Autowired
private LabelService labelService;
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/json", "application/xml", "text/html"})
@ResponseBody
public ModelAndView retrieve(@PathVariable int id) throws WiseMappingException {
public RestMindmap retrieve(@PathVariable int id) throws WiseMappingException {
final User user = Utils.getUser();
final Mindmap mindMap = mindmapService.findMindmapById(id);
final RestMindmap map = new RestMindmap(mindMap, user);
return new ModelAndView("mapView", "map", map);
final Mindmap mindMap = findMindmapById(id);
return new RestMindmap(mindMap, user);
}
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/wisemapping+xml"}, params = {"download=wxml"})
@ResponseBody
public ModelAndView retrieveAsWise(@PathVariable int id) throws WiseMappingException {
final Mindmap mindMap = mindmapService.findMindmapById(id);
final Mindmap mindMap = findMindmapById(id);
final Map<String, Object> values = new HashMap<String, Object>();
final User user = Utils.getUser();
@@ -80,16 +116,56 @@ public class MindmapController extends BaseController {
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/freemind"}, params = {"download=mm"})
@ResponseBody
public ModelAndView retrieveDocumentAsFreemind(@PathVariable int id) throws IOException {
final Mindmap mindMap = mindmapService.findMindmapById(id);
public ModelAndView retrieveDocumentAsFreemind(@PathVariable int id) throws IOException, MapCouldNotFoundException {
final Mindmap mindMap = findMindmapById(id);
final Map<String, Object> values = new HashMap<String, Object>();
values.put("content", mindMap.getXmlStr());
values.put("filename", mindMap.getTitle());
return new ModelAndView("transformViewFreemind", values);
}
@RequestMapping(method = RequestMethod.GET, value = "/maps/", produces = {"application/json", "text/html", "application/xml"})
public ModelAndView retrieveList(@RequestParam(required = false) String q) throws IOException {
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"text/plain"}, params = {"download=txt"})
@ResponseBody
public ModelAndView retrieveDocumentAsText(@PathVariable int id) throws IOException, MapCouldNotFoundException {
final Mindmap mindMap = findMindmapById(id);
final Map<String, Object> values = new HashMap<String, Object>();
values.put("content", mindMap.getXmlStr());
values.put("filename", mindMap.getTitle());
return new ModelAndView("transformViewTxt", values);
}
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/vnd.mindjet.mindmanager"}, params = {"download=mmap"})
@ResponseBody
public ModelAndView retrieveDocumentAsMindJet(@PathVariable int id) throws IOException, MapCouldNotFoundException {
final Mindmap mindMap = findMindmapById(id);
final Map<String, Object> values = new HashMap<String, Object>();
values.put("content", mindMap.getXmlStr());
values.put("filename", mindMap.getTitle());
return new ModelAndView("transformViewMMap", values);
}
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/vnd.ms-excel"}, params = {"download=xls"})
@ResponseBody
public ModelAndView retrieveDocumentAsExcel(@PathVariable int id) throws IOException, MapCouldNotFoundException {
final Mindmap mindMap = findMindmapById(id);
final Map<String, Object> values = new HashMap<String, Object>();
values.put("content", mindMap.getXmlStr());
values.put("filename", mindMap.getTitle());
return new ModelAndView("transformViewXls", values);
}
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}", produces = {"application/vnd.oasis.opendocument.text"}, params = {"download=odt"})
@ResponseBody
public ModelAndView retrieveDocumentAsOdt(@PathVariable int id) throws IOException, MapCouldNotFoundException {
final Mindmap mindMap = findMindmapById(id);
final Map<String, Object> values = new HashMap<String, Object>();
values.put("content", mindMap.getXmlStr());
values.put("filename", mindMap.getTitle());
return new ModelAndView("transformViewOdt", values);
}
@RequestMapping(method = RequestMethod.GET, value = "/maps/", produces = {"application/json", "application/xml"})
public RestMindmapList retrieveList(@RequestParam(required = false) String q) throws IOException {
final User user = Utils.getUser();
final MindmapFilter filter = MindmapFilter.parse(q);
@@ -102,26 +178,23 @@ public class MindmapController extends BaseController {
mindmaps.add(mindmap);
}
}
final RestMindmapList restMindmapList = new RestMindmapList(mindmaps, user);
return new ModelAndView("mapsView", "list", restMindmapList);
return new RestMindmapList(mindmaps, user);
}
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history", produces = {"application/json", "text/html", "application/xml"})
public ModelAndView retrieveHistory(@PathVariable int id) throws IOException {
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/history", produces = {"application/json", "application/xml"})
public RestMindmapHistoryList retrieveHistory(@PathVariable int id) throws IOException {
final List<MindMapHistory> histories = mindmapService.findMindmapHistory(id);
final RestMindmapHistoryList result = new RestMindmapHistoryList();
for (MindMapHistory history : histories) {
result.addHistory(new RestMindmapHistory(history));
}
return new ModelAndView("historyView", "list", result);
return result;
}
@RequestMapping(value = "maps/{id}/history/{hid}", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateRevertMindmap(@PathVariable int id, @PathVariable String hid) throws WiseMappingException, IOException {
final Mindmap mindmap = mindmapService.findMindmapById(id);
final Mindmap mindmap = findMindmapById(id);
final User user = Utils.getUser();
if (LATEST_HISTORY_REVISION.equals(hid)) {
@@ -129,7 +202,7 @@ public class MindmapController extends BaseController {
List<MindMapHistory> mindmapHistory = mindmapService.findMindmapHistory(id);
if (mindmapHistory.size() > 0) {
final MindMapHistory mindMapHistory = mindmapHistory.get(0);
mindmap.setZippedXml(mindMapHistory.getXml());
mindmap.setZippedXml(mindMapHistory.getZippedXml());
saveMindmapDocument(true, mindmap, user);
}
} else {
@@ -137,11 +210,11 @@ public class MindmapController extends BaseController {
}
}
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/document", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"})
@ResponseBody
public long updateDocument(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor, @RequestParam(required = false) Long timestamp, @RequestParam(required = false) Long session) throws WiseMappingException, IOException {
public Long updateDocument(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor, @RequestParam(required = false) Long timestamp, @RequestParam(required = false) Long session) throws WiseMappingException, IOException {
final Mindmap mindmap = mindmapService.findMindmapById(id);
final Mindmap mindmap = findMindmapById(id);
final User user = Utils.getUser();
// Validate arguments ...
@@ -151,14 +224,16 @@ public class MindmapController extends BaseController {
}
// Could the map be updated ?
verifyLock(mindmap, user, session, timestamp);
if (session != null) {
verifyLock(mindmap, user, session, timestamp);
}
// Update collaboration properties ...
final CollaborationProperties collaborationProperties = mindmap.findCollaborationProperties(user);
collaborationProperties.setMindmapProperties(properties);
// Validate content ...
final String xml = restMindmap.getXml();
String xml = restMindmap.getXml();
if (xml == null) {
throw new IllegalArgumentException("Map xml can not be null");
}
@@ -169,29 +244,51 @@ public class MindmapController extends BaseController {
// Update edition timeout ...
final LockManager lockManager = mindmapService.getLockManager();
final LockInfo lockInfo = lockManager.updateExpirationTimeout(mindmap, user);
return lockInfo.getTimestamp();
long result = -1;
if (session != null) {
final LockInfo lockInfo = lockManager.updateExpirationTimeout(mindmap, user);
result = lockInfo.getTimestamp();
}
return result;
}
@RequestMapping(method = RequestMethod.GET, value = { "/maps/{id}/document/xml","/maps/{id}/document/xml-pub"},consumes = {"text/plain"}, produces = {"application/xml"})
@ApiIgnore
@RequestMapping(method = RequestMethod.GET, value = {"/maps/{id}/document/xml", "/maps/{id}/document/xml-pub"}, consumes = {"text/plain"}, produces = {"application/xml"})
@ResponseBody
public byte[] retrieveDocument(@PathVariable int id, @NotNull HttpServletResponse response) throws WiseMappingException, IOException {
// I should not return byte, but there is some encoding issue here. Further research needed.
response.setCharacterEncoding("UTF-8");
final Mindmap mindmap = mindmapService.findMindmapById(id);
return mindmap.getXmlStr().getBytes("UTF-8");
final Mindmap mindmap = findMindmapById(id);
String xmlStr = mindmap.getXmlStr();
return xmlStr.getBytes("UTF-8");
}
@RequestMapping(method = RequestMethod.GET, value = { "/maps/{id}/{hid}/document/xml"},consumes = {"text/plain"}, produces = {"application/xml"})
@ApiIgnore
@RequestMapping(method = RequestMethod.PUT, value = {"/maps/{id}/document/xml"}, consumes = {"text/plain"})
@ResponseBody
public byte[] retrieveDocument(@PathVariable int id, @PathVariable int hid,@NotNull HttpServletResponse response) throws WiseMappingException, IOException {
public void updateDocument(@PathVariable int id, @RequestBody String xmlDoc) throws WiseMappingException, IOException {
final Mindmap mindmap = findMindmapById(id);
final User user = Utils.getUser();
if (xmlDoc != null && !xmlDoc.isEmpty()) {
mindmap.setXmlStr(xmlDoc);
}
mindmap.setXmlStr(xmlDoc);
saveMindmapDocument(false,mindmap,user);
}
@RequestMapping(method = RequestMethod.GET, value = {"/maps/{id}/{hid}/document/xml"}, consumes = {"text/plain"}, produces = {"application/xml"})
@ResponseBody
public byte[] retrieveDocument(@PathVariable int id, @PathVariable int hid, @NotNull HttpServletResponse response) throws WiseMappingException, IOException {
// I should not return byte, but there is some encoding issue here. Further research needed.
response.setCharacterEncoding("UTF-8");
final MindMapHistory mindmapHistory = mindmapService.findMindmapHistory(id, hid);
return mindmapHistory.getUnzipXml();
}
private void verifyLock(@NotNull Mindmap mindmap, @NotNull User user, long session, long timestamp) throws WiseMappingException {
// The lock was lost, reclaim as the ownership of it.
@@ -222,15 +319,15 @@ public class MindmapController extends BaseController {
/**
* The intention of this method is the update of several properties at once ...
*/
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}", consumes = {"application/xml", "application/json"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void update(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException {
public void updateProperties(@RequestBody RestMindmap restMindmap, @PathVariable int id, @RequestParam(required = false) boolean minor) throws IOException, WiseMappingException {
final Mindmap mindmap = mindmapService.findMindmapById(id);
final Mindmap mindmap = findMindmapById(id);
final User user = Utils.getUser();
final String xml = restMindmap.getXml();
if (xml != null) {
if (xml != null && !xml.isEmpty()) {
mindmap.setXmlStr(xml);
}
@@ -265,12 +362,20 @@ public class MindmapController extends BaseController {
saveMindmapDocument(minor, mindmap, user);
}
@NotNull
private Mindmap findMindmapById(int id) throws MapCouldNotFoundException {
Mindmap result = mindmapService.findMindmapById(id);
if (result == null) {
throw new MapCouldNotFoundException("Map could not be found. Id:" + id);
}
return result;
}
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/title", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateTitle(@RequestBody String title, @PathVariable int id) throws WiseMappingException {
final Mindmap mindMap = mindmapService.findMindmapById(id);
final Mindmap mindMap = findMindmapById(id);
final User user = Utils.getUser();
// Is there a map with the same name ?
@@ -280,15 +385,15 @@ public class MindmapController extends BaseController {
}
// Update map ...
final Mindmap mindmap = mindmapService.findMindmapById(id);
final Mindmap mindmap = findMindmapById(id);
mindmap.setTitle(title);
mindmapService.updateMindmap(mindMap, !true);
}
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs", consumes = {"application/json", "application/xml"}, produces = {"application/json", "text/html", "application/xml"})
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs", consumes = {"application/json", "application/xml"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateCollabs(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException {
final Mindmap mindMap = mindmapService.findMindmapById(id);
public void updateCollabs(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException, MapCouldNotFoundException {
final Mindmap mindMap = findMindmapById(id);
// Only owner can change collaborators...
final User user = Utils.getUser();
@@ -325,10 +430,9 @@ public class MindmapController extends BaseController {
}
}
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json", "text/html", "application/xml"})
public ModelAndView retrieveList(@PathVariable int id) {
final Mindmap mindMap = mindmapService.findMindmapById(id);
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/collabs", produces = {"application/json", "application/xml"})
public RestCollaborationList retrieveList(@PathVariable int id) throws MapCouldNotFoundException {
final Mindmap mindMap = findMindmapById(id);
final Set<Collaboration> collaborations = mindMap.getCollaborations();
final List<RestCollaboration> collabs = new ArrayList<RestCollaboration>();
@@ -336,31 +440,30 @@ public class MindmapController extends BaseController {
collabs.add(new RestCollaboration(collaboration));
}
final RestCollaborationList restCollaborationList = new RestCollaborationList();
restCollaborationList.setCollaborations(collabs);
final RestCollaborationList result = new RestCollaborationList();
result.setCollaborations(collabs);
return new ModelAndView("collabsView", "list", restCollaborationList);
return result;
}
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/description", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateDescription(@RequestBody String description, @PathVariable int id) throws WiseMappingException {
final Mindmap mindMap = mindmapService.findMindmapById(id);
final Mindmap mindMap = findMindmapById(id);
final User user = Utils.getUser();
// Update map ...
final Mindmap mindmap = mindmapService.findMindmapById(id);
final Mindmap mindmap = findMindmapById(id);
mindmap.setDescription(description);
mindmapService.updateMindmap(mindMap, !true);
}
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/publish", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updatePublishState(@RequestBody String value, @PathVariable int id) throws WiseMappingException {
final Mindmap mindMap = mindmapService.findMindmapById(id);
final Mindmap mindMap = findMindmapById(id);
final User user = Utils.getUser();
if (!mindMap.hasPermissions(user, CollaborationRole.OWNER)) {
@@ -377,15 +480,15 @@ public class MindmapController extends BaseController {
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void deleteMapById(@PathVariable int id) throws IOException, WiseMappingException {
final User user = Utils.getUser();
final Mindmap mindmap = mindmapService.findMindmapById(id);
final Mindmap mindmap = findMindmapById(id);
mindmapService.removeMindmap(mindmap, user);
}
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/starred", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateStarredState(@RequestBody String value, @PathVariable int id) throws WiseMappingException {
public void updateStarredState(@RequestBody @ApiParam(defaultValue = "false", allowableValues = "true,false") String value, @PathVariable int id) throws WiseMappingException {
final Mindmap mindmap = mindmapService.findMindmapById(id);
final Mindmap mindmap = findMindmapById(id);
final User user = Utils.getUser();
// Update map status ...
@@ -398,12 +501,13 @@ public class MindmapController extends BaseController {
mindmapService.updateCollaboration(user, collaboration);
}
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/lock", consumes = {"text/plain"}, produces = {"application/json", "text/html", "application/xml"})
@ApiIgnore
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/lock", consumes = {"text/plain"}, produces = {"application/json", "application/xml"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void updateMapLock(@RequestBody String value, @PathVariable int id) throws IOException, WiseMappingException {
final User user = Utils.getUser();
final LockManager lockManager = mindmapService.getLockManager();
final Mindmap mindmap = mindmapService.findMindmapById(id);
final Mindmap mindmap = findMindmapById(id);
final boolean lock = Boolean.parseBoolean(value);
if (!lock) {
@@ -413,13 +517,14 @@ public class MindmapController extends BaseController {
}
}
@ApiIgnore
@RequestMapping(method = RequestMethod.DELETE, value = "/maps/batch")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void batchDelete(@RequestParam(required = true) String ids) throws IOException, WiseMappingException {
final User user = Utils.getUser();
final String[] mapsIds = ids.split(",");
for (final String mapId : mapsIds) {
final Mindmap mindmap = mindmapService.findMindmapById(Integer.parseInt(mapId));
final Mindmap mindmap = findMindmapById(Integer.parseInt(mapId));
mindmapService.removeMindmap(mindmap, user);
}
}
@@ -481,7 +586,7 @@ public class MindmapController extends BaseController {
createMap(new RestMindmap(mindMap, null), response, title, description);
}
@RequestMapping(method = RequestMethod.POST, value = "/maps/{id}", consumes = {"application/xml", "application/json"})
@RequestMapping(method = RequestMethod.POST, value = "/maps/{id}", consumes = {"application/xml", "application/json"},produces = {"application/xml", "application/json","text/plain"})
@ResponseStatus(value = HttpStatus.CREATED)
public void createDuplicate(@RequestBody RestMindmapInfo restMindmap, @PathVariable int id, @NotNull HttpServletResponse response) throws IOException, WiseMappingException {
// Validate ...
@@ -495,7 +600,7 @@ public class MindmapController extends BaseController {
final User user = Utils.getUser();
// Create a shallowCopy of the map ...
final Mindmap mindMap = mindmapService.findMindmapById(id);
final Mindmap mindMap = findMindmapById(id);
final Mindmap clonedMap = mindMap.shallowClone();
clonedMap.setTitle(restMindmap.getTitle());
clonedMap.setDescription(restMindmap.getDescription());
@@ -520,4 +625,37 @@ public class MindmapController extends BaseController {
result.rejectValue(fieldName, "error.not-specified", null, message);
return new ValidationException(result);
}
@RequestMapping(method = RequestMethod.DELETE, value = "/labels/maps/{id}")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void removeLabel(@RequestBody RestLabel restLabel, @PathVariable int id) throws WiseMappingException {
final Mindmap mindmap = findMindmapById(id);
final User currentUser = Utils.getUser();
final Label delegated = restLabel.getDelegated();
assert currentUser != null;
delegated.setCreator(currentUser);
mindmapService.removeLabel(mindmap, delegated);
}
@RequestMapping(method = RequestMethod.POST, value = "/labels/maps", consumes = { "application/xml","application/json"})
@ResponseStatus(value = HttpStatus.OK)
public void addLabel(@RequestBody RestLabel restLabel, @RequestParam(required = true) String ids) throws WiseMappingException {
int labelId = restLabel.getId();
final User user = Utils.getUser();
final Label delegated = restLabel.getDelegated();
delegated.setCreator(user);
final Label found = labelService.getLabelById(labelId, user);
if (found == null) {
throw new LabelCouldNotFoundException("Label could not be found. Id: " + labelId);
}
for (String id : ids.split(",")) {
final int mindmapId = Integer.parseInt(id);
final Mindmap mindmap = findMindmapById(mindmapId);
final Label label = mindmap.findLabel(labelId);
if (label == null) {
mindmapService.linkLabel(mindmap, delegated);
}
}
}
}

View File

@@ -25,57 +25,77 @@ import com.wisemapping.model.User;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public enum MindmapFilter {
ALL("all") {
public abstract class MindmapFilter {
public static final MindmapFilter ALL = new MindmapFilter("all") {
@Override
public boolean accept(@NotNull Mindmap mindmap, @NotNull User user) {
boolean accept(@NotNull Mindmap mindmap, @NotNull User user) {
return true;
}
},
MY_MAPS("my_maps") {
};
public static final MindmapFilter MY_MAPS = new MindmapFilter("my_maps") {
@Override
boolean accept(@NotNull Mindmap mindmap, @NotNull User user) {
return mindmap.getCreator().identityEquality(user);
}
},
STARRED("starred") {
};
public static final MindmapFilter STARRED = new MindmapFilter("starred") {
@Override
boolean accept(@NotNull Mindmap mindmap, @NotNull User user) {
return mindmap.isStarred(user);
}
},
SHARED_WITH_ME("shared_with_me") {
};
public static final MindmapFilter SHARED_WITH_ME = new MindmapFilter("shared_with_me") {
@Override
boolean accept(@NotNull Mindmap mindmap, @NotNull User user) {
return !MY_MAPS.accept(mindmap, user);
}
},
PUBLIC("public") {
};
public static final MindmapFilter PUBLIC = new MindmapFilter("public") {
@Override
boolean accept(@NotNull Mindmap mindmap, @NotNull User user) {
return mindmap.isPublic();
}
};
private String id;
protected String id;
private static MindmapFilter[] values = {ALL, MY_MAPS, PUBLIC, STARRED, SHARED_WITH_ME};
MindmapFilter(@NotNull String id) {
private MindmapFilter(@NotNull String id) {
this.id = id;
}
static public MindmapFilter parse(@Nullable String valueStr) {
MindmapFilter result = ALL;
final MindmapFilter[] values = MindmapFilter.values();
for (MindmapFilter value : values) {
if (value.id.equals(valueStr)) {
result = value;
break;
static public MindmapFilter parse(@Nullable final String valueStr) {
MindmapFilter result = null;
if (valueStr != null) {
for (MindmapFilter value : MindmapFilter.values) {
if (value.id.equals(valueStr)) {
result = value;
break;
}
}
// valueStr is not a default filter
if (result == null) {
result = new LabelFilter(valueStr);
}
} else {
result = ALL;
}
return result;
}
abstract boolean accept(@NotNull Mindmap mindmap, @NotNull User user);
private static final class LabelFilter extends MindmapFilter {
private LabelFilter(@NotNull String id) {
super(id);
}
@Override
boolean accept(@NotNull Mindmap mindmap, @NotNull User user) {
return mindmap.hasLabel(this.id);
}
}
}

View File

@@ -131,7 +131,9 @@ public class TransformerController extends BaseController {
throw new IllegalArgumentException("Unsupported export format");
}
result.getModelMap().put("filename", filename);
if (filename != null) {
result.getModelMap().put("filename", filename);
}
return result;
}
}

View File

@@ -27,7 +27,7 @@ public class ValidationException extends WiseMappingException{
private Errors errors;
public ValidationException(@NotNull Errors errors) {
super("Validation Exceptions");
super("Validation Exceptions:"+errors);
this.errors = errors;
}

View File

@@ -0,0 +1,84 @@
package com.wisemapping.rest.model;
import com.wisemapping.model.Label;
import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.NONE;
import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONLY;
@XmlRootElement(name = "label")
@XmlAccessorType(XmlAccessType.PROPERTY)
@JsonAutoDetect(
fieldVisibility = NONE,
setterVisibility = PUBLIC_ONLY,
isGetterVisibility = NONE,
getterVisibility = PUBLIC_ONLY
)
@JsonIgnoreProperties(ignoreUnknown = true)
public class RestLabel {
@JsonIgnore
private Label label;
public RestLabel() {
this(new Label());
}
public RestLabel(@NotNull final Label label) {
this.label = label;
}
public void setParent(@NotNull final Label parent) {
this.label.setParent(parent);
}
@Nullable
public Label getParent() {
return this.label.getParent();
}
@Nullable
public String getTitle() {
return this.label.getTitle();
}
public int getId() {
return label.getId();
}
public void setId(int id) {
label.setId(id);
}
public void setTitle(String title) {
label.setTitle(title);
}
public void setColor(@NotNull final String color) {
label.setColor(color);
}
public void setIconName(@NotNull final String iconName) {
label.setIconName(iconName);
}
@Nullable public String getColor() {
return label.getColor();
}
@Nullable public String getIconName() {
return label.getIconName();
}
@JsonIgnore
public Label getDelegated() {
return label;
}
}

View File

@@ -0,0 +1,40 @@
package com.wisemapping.rest.model;
import com.wisemapping.model.Label;
import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.jetbrains.annotations.NotNull;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
@XmlRootElement(name = "labels")
@XmlAccessorType(XmlAccessType.PROPERTY)
@JsonAutoDetect(
fieldVisibility = JsonAutoDetect.Visibility.NONE,
getterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY,
isGetterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY)
public class RestLabelList {
@NotNull private final List<RestLabel> restLabels;
public RestLabelList(){
this.restLabels = new ArrayList<>();
}
public RestLabelList(@NotNull final List<Label> labels) {
this.restLabels = new ArrayList<>(labels.size());
for (Label label : labels) {
this.restLabels.add(new RestLabel(label));
}
}
@NotNull @XmlElement(name = "label")
public List<RestLabel> getLabels() {
return restLabels;
}
}

View File

@@ -20,18 +20,23 @@ package com.wisemapping.rest.model;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.*;
import com.wisemapping.model.CollaborationProperties;
import com.wisemapping.model.CollaborationRole;
import com.wisemapping.model.Collaborator;
import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
import com.wisemapping.util.TimeUtils;
import org.codehaus.jackson.annotate.*;
import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
@XmlRootElement(name = "map")
@XmlAccessorType(XmlAccessType.PROPERTY)
@@ -65,6 +70,9 @@ public class RestMindmap {
}
}
public void setCreationTime(final String creationTime){
// Ignore
}
public String getCreationTime() {
final Calendar creationTime = mindmap.getCreationTime();
@@ -79,22 +87,43 @@ public class RestMindmap {
return mindmap.getDescription();
}
public void setDescription(String description) {
mindmap.setDescription(description);
}
public String getTags() {
return mindmap.getTags();
}
public void setTags(String tags) {
mindmap.setTags(tags);
}
public String getTitle() {
return mindmap.getTitle();
}
public void setTitle(String title) {
mindmap.setTitle(title);
}
public int getId() {
return mindmap.getId();
}
public String getCreator() {
return mindmap.getCreator().getEmail();
public void setId(int id) {
mindmap.setId(id);
}
public String getCreator() {
final User creator = mindmap.getCreator();
return creator != null ? creator.getEmail() : null;
}
public void setCreator(String creatorUser) {
}
public RestCollaborator getLastModifierUser() {
final User lastEditor = mindmap.getLastEditor();
@@ -105,6 +134,9 @@ public class RestMindmap {
return result;
}
public void setLastModifierUser(RestUser lastModifierUser) {
}
public String getLastModificationTime() {
final Calendar date = mindmap.getLastModificationTime();
String result = null;
@@ -114,11 +146,13 @@ public class RestMindmap {
return result;
}
public void setLastModificationTime(final String value) {
}
public boolean isPublic() {
return mindmap.isPublic();
}
public void setPublic(boolean value) {
// return mindmap.isPublic();
}
@@ -127,50 +161,19 @@ public class RestMindmap {
return mindmap.getXmlStr();
}
public void setXml(@Nullable String xml) throws IOException {
if (xml != null)
mindmap.setXmlStr(xml);
}
public void setId(int id) {
mindmap.setId(id);
}
public void setTitle(String title) {
mindmap.setTitle(title);
}
public void setTags(String tags) {
mindmap.setTags(tags);
}
public void setDescription(String description) {
mindmap.setDescription(description);
}
public void setOwner(String owner) {
}
public String getOwner() {
final User owner = mindmap.getCreator();
return owner != null ? owner.getEmail() : null;
}
public void setCreator(String creatorUser) {
}
public void setOwner(String owner) {
public void setProperties(@Nullable String properties) {
this.properties = properties;
}
public void setLastModificationTime(final String value) {
}
public void setLastModifierUser(String lastModifierUser) {
}
@Nullable
@@ -178,6 +181,10 @@ public class RestMindmap {
return properties;
}
public void setProperties(@Nullable String properties) {
this.properties = properties;
}
public boolean getStarred() {
boolean result = false;
if (collaborator != null) {

View File

@@ -21,21 +21,24 @@ package com.wisemapping.rest.model;
import com.wisemapping.model.Collaboration;
import com.wisemapping.model.Collaborator;
import com.wisemapping.model.Label;
import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
import com.wisemapping.security.Utils;
import com.wisemapping.util.TimeUtils;
import org.codehaus.jackson.annotate.*;
import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
@XmlRootElement(name = "map")
@XmlAccessorType(XmlAccessType.PROPERTY)
@@ -62,28 +65,63 @@ public class RestMindmapInfo {
this.collaborator = collaborator;
}
public void setCreationTime(String value){
// Ignore
}
public String getCreationTime() {
return TimeUtils.toISO8601(mindmap.getCreationTime().getTime());
final Calendar creationTime = mindmap.getCreationTime();
return creationTime != null ? TimeUtils.toISO8601(creationTime.getTime()) : null;
}
public String getDescription() {
return mindmap.getDescription();
}
public void setDescription(String description) {
mindmap.setDescription(description);
}
public String getTags() {
return mindmap.getTags();
}
public void setTags(String tags) {
mindmap.setTags(tags);
}
public String getTitle() {
return mindmap.getTitle();
}
public void setTitle(String title) {
mindmap.setTitle(title);
}
public Set<RestLabel> getLabels() {
final Set<RestLabel> result = new LinkedHashSet<>();
final User me = Utils.getUser();
for (Label label : mindmap.getLabels()) {
if (label.getCreator().equals(me)) {
result.add(new RestLabel(label));
}
}
return result;
}
public int getId() {
return mindmap.getId();
}
public void setId(int id) {
}
public String getCreator() {
return mindmap.getCreator().getFullName();
final User creator = mindmap.getCreator();
return creator!=null?creator.getFullName():null;
}
public void setCreator(String email) {
}
public void setCreator() {
@@ -95,7 +133,7 @@ public class RestMindmapInfo {
return collaboration != null ? collaboration.getRole().getLabel() : "none";
}
public void setRole() {
public void setRole(String value) {
// Do nothing ...
}
@@ -104,48 +142,29 @@ public class RestMindmapInfo {
return user != null ? user.getFullName() : "unknown";
}
public void setLastModifierUser(String value) {
}
public String getLastModificationTime() {
final Calendar calendar = mindmap.getLastModificationTime();
return TimeUtils.toISO8601(calendar.getTime());
return calendar!=null?TimeUtils.toISO8601(calendar.getTime()):null;
}
public void setLastModificationTime(String value) {
}
public boolean isPublic() {
return mindmap.isPublic();
}
public void setId(int id) {
}
public boolean getStarred() {
return mindmap.isStarred(collaborator);
}
public void setStarred(int value) {
public void setStarred(boolean value) {
}
public void setTitle(String title) {
mindmap.setTitle(title);
}
public void setTags(String tags) {
mindmap.setTags(tags);
}
public void setDescription(String description) {
mindmap.setDescription(description);
}
public void setCreator(String email) {
}
public void setLastModificationTime(String value) {
}
public void setLastModifierUser(String value) {
}
@JsonIgnore
public Mindmap getDelegated() {
return this.mindmap;

View File

@@ -48,7 +48,7 @@ public class RestMindmapList {
}
public RestMindmapList(@NotNull List<Mindmap> mindmaps, @NotNull Collaborator collaborator) {
this.mindmapsInfo = new ArrayList<RestMindmapInfo>();
this.mindmapsInfo = new ArrayList<>(mindmaps.size());
for (Mindmap mindMap : mindmaps) {
this.mindmapsInfo.add(new RestMindmapInfo(mindMap, collaborator));
}

View File

@@ -31,6 +31,8 @@ import javax.xml.bind.annotation.XmlRootElement;
import java.util.Calendar;
import java.util.Set;
@XmlRootElement(name = "user")
@XmlAccessorType(XmlAccessType.PROPERTY)
@JsonAutoDetect(

View File

@@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Map;
public class ImportTransformationView extends AbstractView {
@@ -53,15 +54,32 @@ public class ImportTransformationView extends AbstractView {
final InputStream is = new ByteArrayInputStream(content.getBytes("UTF-8"));
final Mindmap mindMap = importer.importMap("filename", "filename", is);
// Set file name...
// Set file name...:http://stackoverflow.com/questions/5325322/java-servlet-download-filename-special-characters/13359949#13359949
final String fileName = (filename != null ? filename : "map") + "." + "xwise";
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
setContentDisposition(request, response, fileName);
// Write the conversion content ...
final ServletOutputStream outputStream = response.getOutputStream();
outputStream.print(mindMap.getXmlStr());
}
private void setContentDisposition(HttpServletRequest request, HttpServletResponse response, String fileName) {
final String userAgent = request.getHeader("user-agent");
String disposition = fileName;
boolean isInternetExplorer = (userAgent.contains("MSIE"));
try {
byte[] fileNameBytes = fileName.getBytes((isInternetExplorer) ? ("windows-1250") : ("utf-8"));
String dispositionFileName = "";
for (byte b : fileNameBytes) {
dispositionFileName += (char) (b & 0xff);
}
disposition = "attachment; filename=\"" + dispositionFileName + "\"";
} catch (UnsupportedEncodingException ence) {
// ... handle exception ...
}
response.setHeader("Content-disposition", disposition);
}
@Override
public String getContentType() {
return contentType;

View File

@@ -33,6 +33,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.stream.StreamResult;
import java.io.UnsupportedEncodingException;
import java.util.Map;
public class TransformView extends AbstractView {
@@ -67,9 +68,9 @@ public class TransformView extends AbstractView {
final String contentType = exportFormat.getContentType();
response.setContentType(contentType);
// Set file name...
// Set file name...:http://stackoverflow.com/questions/5325322/java-servlet-download-filename-special-characters/13359949#13359949
final String fileName = (filename != null ? filename : "map") + "." + exportFormat.getFileExtension();
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
setContentDisposition(request, response, fileName);
// Change image link URL.
final ServletContext servletContext = request.getSession().getServletContext();
@@ -85,6 +86,9 @@ public class TransformView extends AbstractView {
final Object mindmap = viewMap.get("mindmap");
final StreamResult result = new StreamResult(outputStream);
jaxbMarshaller.marshal(mindmap, result);
} else if (exportFormat == ExportFormat.MICROSOFT_EXCEL || exportFormat == ExportFormat.TEXT || exportFormat == ExportFormat.OPEN_OFFICE_WRITER || exportFormat == ExportFormat.MINDJET) {
response.setCharacterEncoding("UTF-8");
factory.export(properties, content, outputStream, null);
} else {
factory.export(properties, null, outputStream, content);
}
@@ -93,6 +97,24 @@ public class TransformView extends AbstractView {
}
}
private void setContentDisposition(HttpServletRequest request, HttpServletResponse response, String fileName) {
final String userAgent = request.getHeader("user-agent");
boolean isInternetExplorer = (userAgent.contains("MSIE"));
String disposition = fileName;
try {
byte[] fileNameBytes = fileName.getBytes((isInternetExplorer) ? ("windows-1250") : ("utf-8"));
String dispositionFileName = "";
for (byte b : fileNameBytes) {
dispositionFileName += (char) (b & 0xff);
}
disposition = "attachment; filename=\"" + dispositionFileName + "\"";
} catch (UnsupportedEncodingException ence) {
// ... handle exception ...
}
response.setHeader("Content-disposition", disposition);
}
@Override
public String getContentType() {
return contentType;

View File

@@ -19,6 +19,8 @@
package com.wisemapping.security;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.AuthenticationType;
import com.wisemapping.model.User;
import com.wisemapping.service.UserService;
import org.jetbrains.annotations.NotNull;
@@ -26,17 +28,22 @@ import org.jetbrains.annotations.Nullable;
import org.springframework.dao.DataAccessException;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.openid.OpenIDAttribute;
import org.springframework.security.openid.OpenIDAuthenticationToken;
import java.util.Calendar;
import java.util.List;
public class UserDetailsService
implements org.springframework.security.core.userdetails.UserDetailsService {
implements org.springframework.security.core.userdetails.UserDetailsService, org.springframework.security.core.userdetails.AuthenticationUserDetailsService<OpenIDAuthenticationToken> {
private UserService userService;
private String adminUser;
@Override
public UserDetails loadUserByUsername(@NotNull String email) throws UsernameNotFoundException, DataAccessException {
final User user = userService.getUserBy(email);
if (user != null) {
return new UserDetails(user, isAdmin(email));
} else {
@@ -44,6 +51,77 @@ public class UserDetailsService
}
}
@Override
@NotNull
public UserDetails loadUserDetails(@NotNull OpenIDAuthenticationToken token) throws UsernameNotFoundException {
final User tUser = buildUserFromToken(token);
final User dbUser = userService.getUserBy(tUser.getEmail());
final User result;
if (dbUser != null) {
if (!token.getIdentityUrl().equals(dbUser.getAuthenticatorUri())) {
throw new IllegalStateException("Identity url for this user can not change:" + token.getIdentityUrl());
}
result = dbUser;
} else {
try {
tUser.setAuthenticationType(AuthenticationType.OPENID);
tUser.setAuthenticatorUri(token.getIdentityUrl());
result = userService.createUser(tUser, false, false);
} catch (WiseMappingException e) {
throw new IllegalStateException(e);
}
}
return new UserDetails(result, isAdmin(result.getEmail()));
}
@NotNull
private User buildUserFromToken(@NotNull OpenIDAuthenticationToken token) {
final User result = new User();
String lastName = null;
String firstName = null;
String email = null;
String fullName = null;
final List<OpenIDAttribute> attributes = token.getAttributes();
for (OpenIDAttribute attribute : attributes) {
if (attribute.getName().equals("email")) {
email = attribute.getValues().get(0);
}
if (attribute.getName().equals("firstname")) {
firstName = attribute.getValues().get(0);
}
if (attribute.getName().equals("lastname")) {
lastName = attribute.getValues().get(0);
}
if (attribute.getName().equals("fullname")) {
fullName = attribute.getValues().get(0);
}
}
if (lastName == null || firstName == null) {
result.setFirstname(fullName);
result.setLastname("");
} else {
result.setLastname(lastName);
result.setFirstname(firstName);
}
result.setEmail(email);
result.setPassword("");
final Calendar now = Calendar.getInstance();
result.setActivationDate(now);
return result;
}
private boolean isAdmin(@Nullable String email) {
return email != null && adminUser != null && email.trim().endsWith(adminUser);
}
@@ -63,4 +141,5 @@ public class UserDetailsService
public void setAdminUser(String adminUser) {
this.adminUser = adminUser;
}
}

View File

@@ -21,23 +21,20 @@ package com.wisemapping.security;
import com.wisemapping.model.User;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import javax.servlet.http.HttpServletRequest;
final public class Utils {
private Utils() {
}
@SuppressWarnings({"ConstantConditions"})
@NotNull
@Nullable
public static User getUser() {
return getUser(false);
}
@Nullable
@NotNull
public static User getUser(boolean forceCheck) {
User result = null;
final Authentication auth = SecurityContextHolder.getContext().getAuthentication();

View File

@@ -24,6 +24,7 @@ import com.wisemapping.model.User;
import com.wisemapping.exceptions.AccessDeniedSecurityException;
import com.wisemapping.security.Utils;
import com.wisemapping.service.MindmapService;
import com.wisemapping.service.MindmapServiceImpl;
import org.aopalliance.intercept.MethodInvocation;
import org.jetbrains.annotations.Nullable;
@@ -36,12 +37,12 @@ public abstract class BaseSecurityAdvice {
boolean isAllowed;
if (argument instanceof Mindmap) {
isAllowed = isAllowed(user, (Mindmap) argument);
isAllowed = isAllowed(user, (Mindmap) argument) || mindmapService.isAdmin(user);
} else if (argument instanceof Integer) {
isAllowed = isAllowed(user, ((Integer) argument));
isAllowed = isAllowed(user, ((Integer) argument)) || mindmapService.isAdmin(user);
} else if (argument instanceof Collaborator) {
// Read operation find on the user are allowed ...
isAllowed = user.identityEquality((Collaborator) argument);
isAllowed = user.identityEquality((Collaborator) argument) || mindmapService.isAdmin(user);
} else {
throw new IllegalArgumentException("Argument " + argument);
}

View File

@@ -2,6 +2,7 @@ package com.wisemapping.security.ldap;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.AuthenticationType;
import com.wisemapping.model.User;
import com.wisemapping.security.UserDetails;
import com.wisemapping.service.UserService;
@@ -19,6 +20,8 @@ public class LdapUserDetailsContextMapper implements UserDetailsContextMapper {
private UserService userService;
private String adminUser;
private String ldapAttributeFirstName;
private String ldapAttributeLastName;
public UserService getUserService() {
@@ -51,10 +54,10 @@ public class LdapUserDetailsContextMapper implements UserDetailsContextMapper {
user = new User();
user.setEmail(email);
final String firstName = userData.getStringAttribute("givenName");
final String firstName = userData.getStringAttribute(ldapAttributeFirstName);
user.setFirstname(firstName);
final String lastName = userData.getStringAttribute("sn");
final String lastName = userData.getStringAttribute(ldapAttributeLastName);
user.setLastname(lastName);
user.setPassword(email);
@@ -62,7 +65,8 @@ public class LdapUserDetailsContextMapper implements UserDetailsContextMapper {
user.setActivationDate(now);
try {
userService.createUser(user, false,false);
user.setAuthenticationType(AuthenticationType.LDAP);
user = userService.createUser(user, false, false);
} catch (WiseMappingException e) {
throw new IllegalStateException(e);
}
@@ -70,6 +74,22 @@ public class LdapUserDetailsContextMapper implements UserDetailsContextMapper {
return new UserDetails(user, isAdmin(email));
}
public String getLdapAttributeLastName() {
return ldapAttributeLastName;
}
public void setLdapAttributeLastName(String ldapAttributLastName) {
this.ldapAttributeLastName = ldapAttributLastName;
}
public String getLdapAttrbutFirstName() {
return ldapAttributeFirstName;
}
public void setLdapAttributeFirstName(String ldapAttributeFirstName) {
this.ldapAttributeFirstName = ldapAttributeFirstName;
}
@Override
public void mapUserToContext(org.springframework.security.core.userdetails.UserDetails userDetails, DirContextAdapter dirContextAdapter) {
// To be implemented ...

Some files were not shown because too many files have changed in this diff Show More