From 83d80cadb5b92b16472379843870736aaaea689e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 12 Jan 2014 02:17:42 -0300 Subject: [PATCH 1/3] Q! Bug WISE-22 fixed. Resolve resize node issue. --- distribution/package-src.sh | 32 ------------------- .../src/main/javascript/peer/svg/TextPeer.js | 8 +++-- 2 files changed, 6 insertions(+), 34 deletions(-) delete mode 100755 distribution/package-src.sh diff --git a/distribution/package-src.sh b/distribution/package-src.sh deleted file mode 100755 index 505a4bb4..00000000 --- a/distribution/package-src.sh +++ /dev/null @@ -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 "#################################################################" diff --git a/web2d/src/main/javascript/peer/svg/TextPeer.js b/web2d/src/main/javascript/peer/svg/TextPeer.js index 24fb8ba9..538a5bd5 100644 --- a/web2d/src/main/javascript/peer/svg/TextPeer.js +++ b/web2d/src/main/javascript/peer/svg/TextPeer.js @@ -156,16 +156,20 @@ web2d.peer.svg.TextPeer = new Class({ var computedWidth; // Firefox hack for this issue:http://stackoverflow.com/questions/6390065/doing-ajax-updates-in-svg-breaks-getbbox-is-there-a-workaround try { + 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. + // caused when the element is hidden. I don't know why, but it works ... if(computedWidth==0){ - computedWidth = getBoundingClientRect().width - 35; + var bbox = this._native.getBBox(); + computedWidth = bbox.width; } } catch(e) { computedWidth = 10; + } + console.log("Final result:"+computedWidth); var width = parseInt(computedWidth); width = width + this._font.getWidthMargin(); From c525acbad4cdd4765ab1b1f4c9ca8b52984ecc8e Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Sun, 12 Jan 2014 05:54:43 +0000 Subject: [PATCH 2/3] Fix jetty download. --- distribution/package-bin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/package-bin.sh b/distribution/package-bin.sh index b1dd9321..97f4e87a 100755 --- a/distribution/package-bin.sh +++ b/distribution/package-bin.sh @@ -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 From 703414266ed29b9b1d237fdacdb1c9de73b98c0b Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 12 Jan 2014 22:53:42 -0300 Subject: [PATCH 3/3] Fix failing uning tests ... --- config/database/hsql/atest-data.sql | 6 +++--- .../java/com/wisemapping/rest/AdminController.java | 2 +- .../com/wisemapping/test/rest/RestAdminITCase.java | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/database/hsql/atest-data.sql b/config/database/hsql/atest-data.sql index e3eeefbf..746ec7ae 100644 --- a/config/database/hsql/atest-data.sql +++ b/config/database/hsql/atest-data.sql @@ -2,9 +2,9 @@ INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping 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(),authentication_type); -INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,"D") - VALUES (2, 'Admin', 'User', 'admin', 1237, CURDATE(), 1); +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'); COMMIT; diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java index 8cbdd537..f9e3a696 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java @@ -115,7 +115,7 @@ public class AdminController extends BaseController { userService.changePassword(user); } - @RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}", consumes = {"text/plain"}) + @RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}") @ResponseStatus(value = HttpStatus.NO_CONTENT) public void getUserByEmail(@PathVariable long id) throws WiseMappingException { final User user = userService.getUserBy(id); diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAdminITCase.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAdminITCase.java index 12f4a1e7..9e30855c 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAdminITCase.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAdminITCase.java @@ -107,11 +107,11 @@ public class RestAdminITCase { // Check that the user has been created ... ResponseEntity result = findUser(requestHeaders, templateRest, location); - assertEquals(result.getBody(), restUser, "Returned object object seems not be the same."); + assertEquals(result.getBody().getEmail(), restUser.getEmail(), "Returned object object seems not be the same."); // Find by email and check ... result = findUserByEmail(requestHeaders, templateRest, restUser.getEmail()); - assertEquals(result.getBody(), restUser, "Returned object object seems not be the same."); + assertEquals(result.getBody().getEmail(), restUser.getEmail(), "Returned object object seems not be the same."); return restUser.getEmail(); } @@ -144,10 +144,10 @@ public class RestAdminITCase { List acceptableMediaTypes = new ArrayList(); acceptableMediaTypes.add(mediaType); - final HttpHeaders requestHeaders = new HttpHeaders(); - requestHeaders.setAccept(acceptableMediaTypes); - requestHeaders.setContentType(mediaType); - return requestHeaders; + final HttpHeaders result = new HttpHeaders(); + result.setAccept(acceptableMediaTypes); + result.setContentType(mediaType); + return result; } private RestTemplate createTemplate() {