Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cenários da Equipe 6 #326

Open
wants to merge 101 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
47c44ff
Adicionando cenário GUI para criação de um livrou e download do aqruivo
tomersimis Oct 27, 2014
3a080e4
Adicionando cenário de controller para a ordenação de livros por data…
tomersimis Oct 27, 2014
c157964
Adicionando cenario de busca para feature de membros
tomersimis Oct 27, 2014
8e33dc9
Modificacao de cenario da feature de artigos
tomersimis Oct 27, 2014
52710b3
Modificacao de cenario da feature de teses
tomersimis Oct 27, 2014
92f7877
Modificacao de cenario da feature de grupos de pesquisa
tomersimis Oct 27, 2014
ed74281
Modificacao de cenario da feature de linha de pesquisa
tomersimis Oct 27, 2014
604a7b9
Adicionando cenário de controller para a ordenação de News
marlonwc3 Oct 27, 2014
5dda019
Adicionando cenário GUI para download de uma Dissertacao
marlonwc3 Oct 27, 2014
3aaecc6
Adicionando cenário GUI para download de uma Conferencia
marlonwc3 Oct 27, 2014
d0624f0
Adicionando cenário de controller para a ordenação de Orientation's
marlonwc3 Oct 27, 2014
1d1c38d
Modificação de cenário da feature Member
marlonwc3 Oct 27, 2014
d5fbc76
Modificação de cenário da feature Dissertacao
marlonwc3 Oct 27, 2014
02d6323
Modificação no cenário da feature Orientation, adicionando And
marlonwc3 Oct 27, 2014
9fc6ca8
Modificação no cenário da feature Ferramenta
Oct 27, 2014
b4eea18
Task 1
lrexxx Oct 27, 2014
7e71262
Resolvendo conflitos
marlonwc3 Oct 28, 2014
d668c9f
Resolvendo conflitos
marlonwc3 Oct 28, 2014
1133a33
Resolvendo conflitos nas features
marlonwc3 Oct 28, 2014
ddd7f61
Modificando feature de busca de membros
tomersimis Nov 22, 2014
fca37c8
Adicionando steps da feature de busca de membros
tomersimis Nov 22, 2014
40bfc83
Modificando feature de download de livro para coincidir com os steps …
tomersimis Nov 22, 2014
3f5483b
adicionando nomes dos cenários para implementação de testes
mucapaz Nov 22, 2014
d9494f7
Adicionando steps da feature de download de livro
tomersimis Nov 22, 2014
119024f
Update BookSteps.groovy
tomersimis Nov 22, 2014
e1b6dea
Adicionando steps da feature de download de funder
mucapaz Nov 22, 2014
e0eca92
removendo implementação de download de funder
mucapaz Nov 22, 2014
8ee9f1d
adicionando implementação de download de lista de members
mucapaz Nov 22, 2014
2bc97d9
adicionando implementação de download de lista de thesis
mucapaz Nov 22, 2014
07e8123
adicionando steps para download de arquivo thesis
mucapaz Nov 22, 2014
39631ea
Inserindo steps para ordenação de livros
mucapaz Nov 22, 2014
93fa300
Inserindo steps para implementação do cenário de filtragem de funder …
mucapaz Nov 22, 2014
203bb1e
Merge branch 'spm2'
mucapaz Nov 22, 2014
34648a0
Resolving conflict when merging master with mras branch
marlonwc3 Nov 22, 2014
6289eb3
resolving conflicts
lrexxx Nov 22, 2014
b858be9
Resolving conflicts
lrexxx Nov 22, 2014
b54e9e3
Adding files to resolve conflicts
lrexxx Nov 22, 2014
6d7ab6d
Resolving merge conflict
lrexxx Nov 22, 2014
339ad13
Update ConferenciaSteps.groovy
lrexxx Nov 22, 2014
80222e2
Update Thesis.feature
lrexxx Nov 22, 2014
f2be793
Update Thesis.feature
lrexxx Nov 22, 2014
fb3c61b
Update ThesisSteps.groovy
lrexxx Nov 22, 2014
1736b18
Update Thesis.feature
lrexxx Nov 22, 2014
e219baf
Adicionando steps para criação de livro e ordenação
tomersimis Nov 23, 2014
44af04b
Update Book.feature
tomersimis Nov 23, 2014
fa87fde
Update Config.groovy
tomersimis Nov 23, 2014
cf82b96
Update News.groovy
marlonwc3 Nov 23, 2014
53aff34
Correcting Samuel's original commit...
tomersimis Jan 17, 2015
2ef1c6a
Removendo import de uma classe não existente
tomersimis Jan 17, 2015
a9cf977
Alterando definição de step para evitar conflitos
tomersimis Jan 17, 2015
fd4a5c6
Resolvendo conflitos no merge da branch spm2
tomersimis Jan 17, 2015
e21278a
Resolvendo conflitos
mucapaz Jan 17, 2015
706dba7
Marlon e Samuel tests
mucapaz Jan 18, 2015
0b8aac1
Correção das steps para busca de um membro
tomersimis Jan 18, 2015
5d33731
Criação da page para a o scenario de busca de membros
tomersimis Jan 18, 2015
d3e8267
Adição de label para busca de entidades
tomersimis Jan 18, 2015
18fd548
Criação de action no controller para busca de membros
tomersimis Jan 18, 2015
b893f09
Criação de view para scenario de busca de membros
tomersimis Jan 18, 2015
9d78a1d
Adição de link para página de busca de membros
tomersimis Jan 18, 2015
6c567e6
Criação de operação para adição de membro
tomersimis Jan 18, 2015
2cb3c2d
Modificações das steps para scenario GUI de criação de livros
tomersimis Jan 18, 2015
e4d4091
Modificações das steps para scenario GUI de criação de livros
tomersimis Jan 18, 2015
b0e5a46
Modificando steps para busca de membro
tomersimis Jan 19, 2015
11c41c7
Corrigindo linha comentada por engano no commit 706dba7fb109479a34603…
tomersimis Jan 19, 2015
3309668
Update Book.feature
tomersimis Jan 19, 2015
9208d1d
Features e testes de Marlon e Samuel
mucapaz Jan 19, 2015
716cf84
Marlon e Samuel adicao de busca por email e novos testes para control…
mucapaz Jan 20, 2015
c1cd319
Update BookSteps.groovy
tomersimis Jan 20, 2015
37b1924
Adição de função relacionada ao download de livro
tomersimis Jan 20, 2015
68800dc
Criação de métodos para ordenação de livros
tomersimis Jan 20, 2015
664bcb4
Update Book.feature
tomersimis Jan 20, 2015
97214af
Alteração de step para ordenação de livros
tomersimis Jan 20, 2015
90b69ee
Features e testes de busca
mucapaz Jan 20, 2015
14c3f96
Corrigindo feature dissertacao duplicada - marlon
mucapaz Jan 20, 2015
5b302db
Mudando dissertacao duplicated feature - marlon
mucapaz Jan 20, 2015
67e62e3
Adicionando novo cénario para busca de tese
lrexxx Jan 21, 2015
264493f
Adicionando testes para busca de tese
lrexxx Jan 21, 2015
5632551
Adicionando metodos auxiliares para teste
lrexxx Jan 21, 2015
405ed3a
Criando page para teste de busca de tese
lrexxx Jan 21, 2015
d19fc06
Criando view para busca de tese
lrexxx Jan 21, 2015
3a6ae19
Rename TeseSearchByTitlePage to TeseSearchByTitlePage.groovy.
lrexxx Jan 21, 2015
f266e58
Rename TeseSearchByTitlePage.groovy. to TeseSearchByTitlePage.groovy
lrexxx Jan 21, 2015
709421f
Adicionando action para controller de busca
lrexxx Jan 21, 2015
b5ffb4a
Adicionando button de search em tese views
lrexxx Jan 21, 2015
5316c2b
Merge pull request #3 from tomersimis/lre-testes
Jan 21, 2015
c00c4c6
Correções de problemas gerados pelo commit 264493f82481c3de81b5ecc3d0…
tomersimis Jan 21, 2015
2c83245
Update Member.feature
tomersimis Jan 21, 2015
7a49633
Elimina duplicação nos metodos edit e show
lrexxx Feb 6, 2015
a98dee1
Removendo método duplicado em MemberController
mucapaz Feb 6, 2015
e6a8d78
Eliminação de if's desnecessários
lrexxx Feb 6, 2015
c6f39e3
Merge branch 'master' of https://github.com/tomersimis/rgms
mucapaz Feb 6, 2015
80b78fc
Retirando if's desnecessários
lrexxx Feb 6, 2015
4243da8
Removendo código duplicado através da adição de método generazante
mucapaz Feb 6, 2015
3e84e1b
Merge branch 'master' of https://github.com/tomersimis/rgms
mucapaz Feb 6, 2015
8537135
Criação de classe com funções compartilhadas com outras classes da pa…
tomersimis Feb 6, 2015
38ba9d6
Extract method em pontos duplicados do código
tomersimis Feb 6, 2015
e2f78db
Retoracao - Marlon
mucapaz Feb 7, 2015
5bbd83a
Merge branch 'master' of https://github.com/tomersimis/rgms
mucapaz Feb 7, 2015
1fc255f
Criação de função que realiza a verificação de compatibilidade entre …
tomersimis Feb 7, 2015
05c5202
Substituição de código duplicado por método geral
tomersimis Feb 7, 2015
88085db
Substituição de código duplicado por método geral
tomersimis Feb 7, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified chromedrivers/chromedriver
Binary file not shown.
1 change: 1 addition & 0 deletions grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ grails.project.dependency.resolution = {
compile('lib:itext-pdfa:5.4.0')
compile('lib:itext-xtra:5.4.0')
compile('lib:twitter4j-core:4.0.1')
compile('commons-codec:commons-codec:1.6')

compile(group: 'org.apache.poi', name: 'poi', version: '3.7') {
excludes 'xmlbeans'
Expand Down
7 changes: 4 additions & 3 deletions grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ grails {
port = 465
//TODO: Before running, make sure that your email login and password appear below
//TODO: Before committing, make sure that the strings "LOGIN" and "PASSWORD" appear in place of your login and password
username = "LOGIN"
password = "PASSWORD"
props = ["mail.smtp.auth": "true",
username = "[email protected]"
password = "testeteste"
props = [
"mail.smtp.auth": "true",
"mail.smtp.socketFactory.port": "465",
"mail.smtp.socketFactory.class": "javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback": "false"]
Expand Down
106 changes: 84 additions & 22 deletions grails-app/controllers/rgms/member/MemberController.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package rgms.member

import grails.converters.JSON
import org.apache.shiro.crypto.hash.Sha256Hash
import org.springframework.dao.DataIntegrityViolationException
import rgms.EmailService
Expand All @@ -9,27 +10,28 @@ import java.security.SecureRandom

class MemberController {


static allowedMethods = [save: "POST", update: "POST", delete: "POST"]


def index = {
redirect(action: "list", params: params)
}



def list = {

params.max = Math.min(params.max ? params.int('max') : 10, 100)
def userMemberList = []
def members = Member.list(params)
for (i in members) {
def user = User.findByAuthor(i)
if (user)
userMemberList.add([user: user, member: i])
else
userMemberList.add([member: i])
}
generateMemberList(userMemberList,members)

[userMemberInstanceList: userMemberList, memberInstanceTotal: Member.count()]
}



def create = {
def member = new Member(params)
def user = new User(params)
Expand All @@ -41,14 +43,18 @@ class MemberController {
member.setUniversity(params.university ?: grailsApplication.getConfig().getProperty("defaultUniversity") as String);
member.setCity(params.city ?: grailsApplication.getConfig().getProperty("defaultCity") as String);
//#end

[userMemberInstanceList: [memberInstance: member, userInstance: user]]
}

def renderCreateMember(){
render(view: "create", model: [userMemberInstanceList: [memberInstance: memberInstance, userInstance: userInstance]])
return
}

def save = {
//#if($Auth)
if (!grailsApplication.config.grails.mail.username) {
throw new RuntimeException(message(code: 'mail.plugin.not.configured', 'default': 'Mail plugin not configured'))
// throw new RuntimeException(message(code: 'mail.plugin.not.configured', 'default': 'Mail plugin not configured'))
}
//#end

Expand All @@ -65,8 +71,7 @@ class MemberController {
userInstance.passwordChangeRequiredOnNextLogon = true

if (!memberInstance.save(flush: true)) {
render(view: "create", model: [userMemberInstanceList: [memberInstance: memberInstance, userInstance: userInstance]])
return
renderCreateMember()
}

userInstance.author = memberInstance;
Expand All @@ -75,8 +80,7 @@ class MemberController {
println it
}
memberInstance.delete(flush: true)
render(view: "create", model: [userMemberInstanceList: [memberInstance: memberInstance, userInstance: userInstance]])
return
renderCreateMember()
}

def email = memberInstance.email
Expand All @@ -91,6 +95,21 @@ class MemberController {
redirect(action: "show", id: memberInstance.id)
}

def search = {
def userMemberList = []
if(params.name){
def members = Member.findAllByName(params.name)

generateMemberList(userMemberList,members)
}

[userMemberInstanceList: userMemberList, memberInstanceTotal: Member.count()]
}






def show = {
Get_MemberInstance()
Expand Down Expand Up @@ -174,18 +193,22 @@ class MemberController {
redirect(action: "show", id: memberInstance.id)
}

def redirectNotFound(){
flash.message = message(code: 'default.not.found.message', args: [message(code: 'member.label', default: 'Member'), params.id])
redirect(action: "list")
}

def delete = {
Member.class
Member.deleteAll();
Member.dele
def memberInstance = Member.get(params.id)
def userInstance = User.findByAuthor(memberInstance)
if (!memberInstance) {
flash.message = message(code: 'default.not.found.message', args: [message(code: 'member.label', default: 'Member'), params.id])
redirect(action: "list")
if(!isMemberInstance(memberInstance)) {
return
}

if (!userInstance) {
flash.message = message(code: 'default.not.found.message', args: [message(code: 'member.label', default: 'Member'), params.id])
redirect(action: "list")
redirectNotFound()
return
}

Expand All @@ -201,6 +224,18 @@ class MemberController {
}
}

def searchByUniversity = {
def userMemberList = []
if(params.name){
def members = Member.findAllByUniversity(params.name)


generateMemberList(userMemberList,members)
}
[userMemberInstanceList: userMemberList, memberInstanceTotal: Member.count()]
}


private void saveHistory(def memberInstance, String status) {

def hist = new Record(start: new Date(), status_H: status)
Expand All @@ -210,14 +245,41 @@ class MemberController {
memberInstance.save()
}



def isMemberInstance(memberInstance){
if (!memberInstance) {
redirectNotFound()
}
}

def Get_MemberInstance() {
def memberInstance = Member.get(params.id)
if (!memberInstance) {
flash.message = message(code: 'default.not.found.message', args: [message(code: 'member.label', default: 'Member'), params.id])
redirect(action: "list")
if(!isMemberInstance(memberInstance)) {
return
}
def user = User.findByAuthor(memberInstance)
[userMemberInstanceList: [memberInstance: memberInstance, userInstance: user]]
}


def searchByEmail = {
def userMemberList = []
if(params.name){
def members = Member.findAllByEmail(params.name)

generateMemberList(userMemberList,members)
}
[userMemberInstanceList: userMemberList, memberInstanceTotal: Member.count()]
}

private void generateMemberList(userMemberList, members){
for (i in members) {
def user = User.findByAuthor(i)
if (user)
userMemberList.add([user: user, member: i])
else
userMemberList.add([member: i])
}
}
}
16 changes: 6 additions & 10 deletions grails-app/controllers/rgms/publication/BookController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,15 @@ class BookController {

def show(Long id) {
def bookInstance = Book.get(id)
if (!bookInstance) {
flash.message = message(code: 'default.not.found.message', args: [message(code: 'book.label', default: 'Book'), id])
redirect(action: "list")
return
}

[bookInstance: bookInstance]
bookInstanceRedirectIfItsNull(id, bookInstance)
}

def edit(Long id) {
def bookInstance = Book.get(id)
bookInstanceRedirectIfItsNull(id, bookInstance)
}

private def bookInstanceRedirectIfItsNull(Long id, Book bookInstance) {
if (!bookInstance) {
flash.message = message(code: 'default.not.found.message', args: [message(code: 'book.label', default: 'Book'), id])
redirect(action: "list")
Expand All @@ -68,14 +66,12 @@ class BookController {
return
}

if (version != null) {
if (bookInstance.version > version) {
if (version != null && bookInstance.version > version) {
bookInstance.errors.rejectValue("version", "default.optimistic.locking.failure",
[message(code: 'book.label', default: 'Book')] as Object[],
"Another user has updated this Book while you were editing")
render(view: "edit", model: [bookInstance: bookInstance])
return
}
}

bookInstance.properties = params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class ResearchLineController {
if(member.getName() == params.member)
{
lista.add(researchline.getName())


}
}
[researchLineInstanceList: lista]
Expand Down Expand Up @@ -94,11 +92,9 @@ class ResearchLineController {
old_members = getOldMembers(params.id)
//#end
def researchLineInstance = getInstance(params)
if (!researchLineInstance)
if (!researchLineInstance || !checkInstanceVersion(params, researchLineInstance))
return

if (!checkInstanceVersion(params, researchLineInstance))
return
researchLineInstance.properties = params
if (!params.members) {
researchLineInstance.properties.members = []
Expand Down Expand Up @@ -181,19 +177,22 @@ class ResearchLineController {
researchLineInstance.errors.rejectValue("version", "default.optimistic.locking.failure",
[message(code: 'researchLine.label', default: 'ResearchLine')] as Object[],
message(code: 'default.warningwhileedting.message'))
render(view: "edit", model: [researchLineInstance: researchLineInstance])
return false
render()
}
}
return true
}

def renderEdit(){
render(view: "edit", model: [researchLineInstance: researchLineInstance])
return false
}

def editPublications(researchLineInstance) {
for (p in researchLineInstance?.publications) {
p.researchLine = null;
if (!p.save(flush: true)) {
render(view: "edit", model: [researchLineInstance: researchLineInstance])
return false
renderEdit()
}
}
true
Expand Down Expand Up @@ -239,4 +238,4 @@ class ResearchLineController {
researchLineInstance
}
}
//#end
//#end
14 changes: 13 additions & 1 deletion grails-app/controllers/rgms/publication/TeseController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,17 @@ class TeseController extends ThesisOrDissertationController {
def delete() {
deleteThesisOrDissertation("Tese", params)
}

def search = {
def teseList = []
if(params.title){
def teses = Tese.findAllByTitle(params.title)
for (i in teses) {
teseList.add([tese: i])
}
}

[teseInstanceList: teseList, teseInstanceTotal: Tese.count()]
}

}
}
32 changes: 15 additions & 17 deletions grails-app/controllers/rgms/researchProject/FunderController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,19 @@ class FunderController {
redirect(action: "show", id: funderInstance.id)
}

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
}
def getFunderInstance(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]
}

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]
def show(Long id) {
getFunderInstance(id)
}

def update(Long id, Long version) {
Expand Down Expand Up @@ -82,6 +75,10 @@ class FunderController {
redirect(action: "show", id: funderInstance.id)
}

def edit(Long id) {
getFunderInstance(id)
}

def delete(Long id) {
def funderInstance = Funder.get(id)
if (!funderInstance) {
Expand All @@ -101,4 +98,5 @@ class FunderController {
}
}
}
//#end
//#end

Loading