From 5ec3b6cce115fa1d2c6848d8a7489fb6e428de0b Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Wed, 16 Apr 2014 02:38:33 -0300 Subject: [PATCH] label attribute icon to iconName refactor (because of eze code review) --- config/database/hsql/apopulate-schemas.sql | 6 +++--- config/database/hsql/create-schemas.sql | 2 +- config/database/mysql/apopulate-schemas.sql | 6 +++--- config/database/mysql/create-schemas.sql | 2 +- .../src/main/java/com/wisemapping/model/Label.java | 10 +++++----- .../java/com/wisemapping/rest/model/RestLabel.java | 8 ++++---- .../main/resources/com/wisemapping/model/Label.hbm.xml | 2 +- .../com/wisemapping/test/rest/RestLabelITCase.java | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/config/database/hsql/apopulate-schemas.sql b/config/database/hsql/apopulate-schemas.sql index 092acc82..0d4e071f 100644 --- a/config/database/hsql/apopulate-schemas.sql +++ b/config/database/hsql/apopulate-schemas.sql @@ -30,7 +30,7 @@ INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_i 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, icon) VALUES (1, 'test label', 1, NULL, '#ff0000', 'glyphicon glyphicon-tag'); +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) @@ -38,9 +38,9 @@ INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition 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, icon) VALUES (2, 'admin label', 2, NULL, '#0000ff', 'glyphicon glyphicon-star'); +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, icon) VALUES (3, 'mindmap shared', 2, NULL, '#00ff00', 'glyphicon glyphicon-share'); +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; diff --git a/config/database/hsql/create-schemas.sql b/config/database/hsql/create-schemas.sql index 92322877..30a919bb 100644 --- a/config/database/hsql/create-schemas.sql +++ b/config/database/hsql/create-schemas.sql @@ -38,7 +38,7 @@ CREATE TABLE LABEL ( creator_id INTEGER NOT NULL, parent_label_id INTEGER, color VARCHAR(7) NOT NULL, - icon VARCHAR(255) NOT NULL + iconName VARCHAR(50) NOT NULL --FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id) ); diff --git a/config/database/mysql/apopulate-schemas.sql b/config/database/mysql/apopulate-schemas.sql index 076cf61d..8db7865a 100644 --- a/config/database/mysql/apopulate-schemas.sql +++ b/config/database/mysql/apopulate-schemas.sql @@ -34,7 +34,7 @@ INSERT INTO COLLABORATION (id, colaborator_id, properties_id, mindmap_id, role_i 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, icon) VALUES (1, 'test label', 1, NULL, '#ff0000', 'glyphicon glyphicon-tag'); +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) @@ -42,9 +42,9 @@ INSERT INTO MINDMAP (id, title, xml, description, public, creation_date, edition 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, icon) VALUES (2, 'admin label', 2, NULL, '#0000ff', 'glyphicon glyphicon-star'); +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, icon) VALUES (3, 'mindmap shared', 2, NULL, '#00ff00', 'glyphicon glyphicon-share'); +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; diff --git a/config/database/mysql/create-schemas.sql b/config/database/mysql/create-schemas.sql index 8aaaf0db..eba00226 100644 --- a/config/database/mysql/create-schemas.sql +++ b/config/database/mysql/create-schemas.sql @@ -58,7 +58,7 @@ CREATE TABLE LABEL ( creator_id INTEGER NOT NULL, parent_label_id INTEGER, color VARCHAR(7) NOT NULL, - icon VARCHAR(255) 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 diff --git a/wise-webapp/src/main/java/com/wisemapping/model/Label.java b/wise-webapp/src/main/java/com/wisemapping/model/Label.java index 654bbaf9..a2319771 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/Label.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/Label.java @@ -12,7 +12,7 @@ public class Label { @NotNull private User creator; @Nullable private Label parent; @NotNull private String color; - @NotNull private String icon; + @NotNull private String iconName; public void setParent(@Nullable Label parent) { this.parent = parent; @@ -59,12 +59,12 @@ public class Label { } @NotNull - public String getIcon() { - return icon; + public String getIconName() { + return iconName; } - public void setIcon(@NotNull String icon) { - this.icon = icon; + public void setIconName(@NotNull String iconName) { + this.iconName = iconName; } @Override diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java index 14ad2abc..14fc8512 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestLabel.java @@ -65,16 +65,16 @@ public class RestLabel { label.setColor(color); } - public void setIcon(@NotNull final String icon) { - label.setIcon(icon); + public void setIconName(@NotNull final String iconName) { + label.setIconName(iconName); } @Nullable public String getColor() { return label.getColor(); } - @Nullable public String getIcon() { - return label.getIcon(); + @Nullable public String getIconName() { + return label.getIconName(); } @JsonIgnore diff --git a/wise-webapp/src/main/resources/com/wisemapping/model/Label.hbm.xml b/wise-webapp/src/main/resources/com/wisemapping/model/Label.hbm.xml index b0589623..046bf515 100644 --- a/wise-webapp/src/main/resources/com/wisemapping/model/Label.hbm.xml +++ b/wise-webapp/src/main/resources/com/wisemapping/model/Label.hbm.xml @@ -11,7 +11,7 @@ - + diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelITCase.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelITCase.java index 0a35304f..8e38f746 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelITCase.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelITCase.java @@ -138,7 +138,7 @@ public class RestLabelITCase { restLabel.setColor(color); } if (icon != null) { - restLabel.setIcon(icon); + restLabel.setIconName(icon); } // Create a new label ...