diff --git a/COMANDO GEBS b/COMANDO GEBS
index a65afe4a..2751e247 100644
--- a/COMANDO GEBS
+++ b/COMANDO GEBS
@@ -1 +1,4 @@
-Dgeb.env=chrome -Dwebdriver.chrome.driver=/Users/Rodrigo/Documents/workspaces/TAES/gitsource/rgms/chromedrivers/chromedrivermac test-app functional:cucumber
+
+LSA2
+-Dserver.port=8090 -Dgeb.env=chrome -Dwebdriver.chrome.driver="Users\\Targelia Albuquerque\\Documents\\GitHub\\rgms\\chromedrivers\\chromedriverwindows" test-app functional:cucumber
\ No newline at end of file
diff --git a/chromedrivers/chromedriver.exe b/chromedrivers/chromedriver.exe
new file mode 100644
index 00000000..42d553d2
Binary files /dev/null and b/chromedrivers/chromedriver.exe differ
diff --git a/grails-app/conf/BuildConfig.groovy b/grails-app/conf/BuildConfig.groovy
index 42066943..078281bc 100644
--- a/grails-app/conf/BuildConfig.groovy
+++ b/grails-app/conf/BuildConfig.groovy
@@ -53,6 +53,7 @@ grails.project.dependency.resolution = {
compile(group: 'org.apache.poi', name: 'poi-ooxml', version: '3.7') {
excludes 'xmlbeans'
}
+ compile('commons-codec:commons-codec:1.6')
// runtime 'mysql:mysql-connector-java:5.1.16'
}
@@ -61,7 +62,6 @@ grails.project.dependency.resolution = {
compile ":remote-control:1.4"
compile ":codenarc:0.20"
compile ":gmetrics:0.3.1"
-
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.7.1"
runtime ":resources:1.1.6"
diff --git a/grails-app/controllers/rgms/member/MemberController.groovy b/grails-app/controllers/rgms/member/MemberController.groovy
index 9da75bf4..1c91c4ae 100644
--- a/grails-app/controllers/rgms/member/MemberController.groovy
+++ b/grails-app/controllers/rgms/member/MemberController.groovy
@@ -74,7 +74,7 @@ class MemberController {
userInstance.errors.each {
println it
}
- memberInstance.delete(flush: true)
+ memberInstance.delete()
render(view: "create", model: [userMemberInstanceList: [memberInstance: memberInstance, userInstance: userInstance]])
return
}
diff --git a/grails-app/controllers/rgms/member/MembershipController.groovy b/grails-app/controllers/rgms/member/MembershipController.groovy
index 1977f2a4..dd40bfcc 100644
--- a/grails-app/controllers/rgms/member/MembershipController.groovy
+++ b/grails-app/controllers/rgms/member/MembershipController.groovy
@@ -32,25 +32,11 @@ class MembershipController {
}
def show = {
- def membershipInstance = Membership.get(params.id)
- if (!membershipInstance) {
- flash.message = message(code: 'default.not.found.message', args: [message(code: 'membership.label', default: 'Membership'), params.id])
- redirect(action: "list")
- return
- }
-
- [membershipInstance: membershipInstance]
+ showOrEdit();
}
def edit = {
- def membershipInstance = Membership.get(params.id)
- if (!membershipInstance) {
- flash.message = message(code: 'default.not.found.message', args: [message(code: 'membership.label', default: 'Membership'), params.id])
- redirect(action: "list")
- return
- }
-
- [membershipInstance: membershipInstance]
+ showOrEdit();
}
def update = {
@@ -118,4 +104,14 @@ class MembershipController {
}
}
//#end
+ def showOrEdit(){
+ def membershipInstance = Membership.get(params.id)
+ if (!membershipInstance) {
+ flash.message = message(code: 'default.not.found.message', args: [message(code: 'membership.label', default: 'Membership'), params.id])
+ redirect(action: "list")
+ return
+ }
+
+ [membershipInstance: membershipInstance]
+ }
}
diff --git a/grails-app/controllers/rgms/publication/BookController.groovy b/grails-app/controllers/rgms/publication/BookController.groovy
index eab9da7a..1dbe5197 100644
--- a/grails-app/controllers/rgms/publication/BookController.groovy
+++ b/grails-app/controllers/rgms/publication/BookController.groovy
@@ -2,7 +2,7 @@ package rgms.publication
class BookController {
- static allowedMethods = [save: "POST", update: "POST", delete: "POST"]
+ static allowedMethods = [save: "POST", update: "POST", delete: "POST", share: "POST"]
AuxiliarController aux = new AuxiliarController()
def index() {
@@ -23,10 +23,9 @@ class BookController {
}
def save() {
- PublicationController pb = new PublicationController()
def bookInstance = new Book(params)
- bookInstance = pb.extractAuthors(bookInstance)
+ bookInstance = PublicationController.extractAuthors(bookInstance)
if (!bookInstance.save(flush: true)) {
@@ -38,10 +37,10 @@ class BookController {
redirect(action: "show", id: bookInstance.id)
}
- def show(Long id) {
- def bookInstance = Book.get(id)
+ def show() {
+ def bookInstance = Book.get(params.id)
if (!bookInstance) {
- flash.message = message(code: 'default.not.found.message', args: [message(code: 'book.label', default: 'Book'), id])
+ flash.message = message(code: 'default.not.found.message', args: [message(code: 'book.label', default: 'Book'), params.id])
redirect(action: "list")
return
}
@@ -49,10 +48,10 @@ class BookController {
[bookInstance: bookInstance]
}
- def edit(Long id) {
- def bookInstance = Book.get(id)
+ def edit() {
+ def bookInstance = Book.get(params.id)
if (!bookInstance) {
- flash.message = message(code: 'default.not.found.message', args: [message(code: 'book.label', default: 'Book'), id])
+ flash.message = message(code: 'default.not.found.message', args: [message(code: 'book.label', default: 'Book'), params.id])
redirect(action: "list")
return
}
diff --git a/grails-app/controllers/rgms/publication/PublicationController.groovy b/grails-app/controllers/rgms/publication/PublicationController.groovy
index 3f0198ee..04619231 100644
--- a/grails-app/controllers/rgms/publication/PublicationController.groovy
+++ b/grails-app/controllers/rgms/publication/PublicationController.groovy
@@ -75,18 +75,7 @@ class PublicationController {
return false
}
- InputStream inputStream = request.getInputStream()
- OutputStream outputStream = new FileOutputStream(f)
- byte[] buffer = new byte[1024 * 10] //buffer de 10MB
- int length
-
- while ((length = inputStream.read(buffer)) > 0) {
- outputStream.write(buffer, 0, length)
- }
- outputStream.close()
- inputStream.close()
-
- return true
+ uploadFileStream();
}
def static newUpload(Publication publicationInstance, flash, request) {
@@ -100,18 +89,7 @@ class PublicationController {
flash.message = 'File already exists. Please try to use a different file name.'
return false
}
- InputStream inputStream = request.getInputStream()
- OutputStream outputStream = new FileOutputStream(f)
- byte[] buffer = new byte[1024 * 10] //buffer de 10MB
- int length
-
- while ((length = inputStream.read(buffer)) > 0) {
- outputStream.write(buffer, 0, length)
- }
- outputStream.close()
- inputStream.close()
-
- return true
+ uploadFileStream();
}
def static extractAuthors(instance) {
@@ -161,4 +139,18 @@ class PublicationController {
// return statusLine.getStatusCode();
}
//#end
+ def static uploadFileStream() {
+ InputStream inputStream = request.getInputStream()
+ OutputStream outputStream = new FileOutputStream(f)
+ byte[] buffer = new byte[1024 * 10] //buffer de 10MB
+ int length
+
+ while ((length = inputStream.read(buffer)) > 0) {
+ outputStream.write(buffer, 0, length)
+ }
+ outputStream.close()
+ inputStream.close()
+
+ return true
+ }
}
diff --git a/grails-app/controllers/rgms/researchProject/FunderController.groovy b/grails-app/controllers/rgms/researchProject/FunderController.groovy
index 0d845d43..01cc4705 100644
--- a/grails-app/controllers/rgms/researchProject/FunderController.groovy
+++ b/grails-app/controllers/rgms/researchProject/FunderController.groovy
@@ -32,25 +32,11 @@ class FunderController {
}
def show(Long id) {
- def funderInstance = Funder.get(id)
- if (!funderInstance) {
- flash.message = message(code: 'default.not.found.message', args: [message(code: 'funder.label', default: 'Funder'), id])
- redirect(action: "list")
- return
- }
-
- [funderInstance: funderInstance]
+ showOrEdit(id);
}
def edit(Long id) {
- def funderInstance = Funder.get(id)
- if (!funderInstance) {
- flash.message = message(code: 'default.not.found.message', args: [message(code: 'funder.label', default: 'Funder'), id])
- redirect(action: "list")
- return
- }
-
- [funderInstance: funderInstance]
+ showOrEdit(id);
}
def update(Long id, Long version) {
@@ -100,5 +86,15 @@ class FunderController {
redirect(action: "show", id: id)
}
}
+ def showOrEdit(Long id){
+ def funderInstance = Funder.get(id)
+ if (!funderInstance) {
+ flash.message = message(code: 'default.not.found.message', args: [message(code: 'funder.label', default: 'Funder'), id])
+ redirect(action: "list")
+ return
+ }
+
+ [funderInstance: funderInstance]
+ }
}
//#end
\ No newline at end of file
diff --git a/grails-app/views/book/show.gsp b/grails-app/views/book/show.gsp
index 7664a16c..019cea01 100644
--- a/grails-app/views/book/show.gsp
+++ b/grails-app/views/book/show.gsp
@@ -130,6 +130,25 @@
+
+
+
+
+
+
+
+