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

Equipe 6 - Atividade 7 #340

Open
wants to merge 88 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 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
c239a0e
Update Config.groovy
Jan 21, 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
3 changes: 2 additions & 1 deletion grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ grails {
//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",
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
87 changes: 86 additions & 1 deletion 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,13 +10,16 @@ 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)
Expand All @@ -41,7 +45,6 @@ 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]]
}

Expand Down Expand Up @@ -90,6 +93,27 @@ class MemberController {
flash.message = message(code: 'default.created.message', args: [message(code: 'member.label', default: 'Member'), memberInstance.id])
redirect(action: "show", id: memberInstance.id)
}

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

for (i in members) {
def user = User.findByAuthor(i)
if (user)
userMemberList.add([user: user, member: i])
else
userMemberList.add([member: i])
}
}

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






def show = {
Expand Down Expand Up @@ -175,6 +199,9 @@ class MemberController {
}

def delete = {
Member.class
Member.deleteAll();
Member.dele
def memberInstance = Member.get(params.id)
def userInstance = User.findByAuthor(memberInstance)
if (!memberInstance) {
Expand All @@ -201,6 +228,44 @@ class MemberController {
}
}

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





for (i in members) {
def user = User.findByAuthor(i)
if (user)
userMemberList.add([user: user, member: i])
else
userMemberList.add([member: i])
}
}
[userMemberInstanceList: userMemberList, memberInstanceTotal: Member.count()]
}

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


for (i in members) {
def user = User.findByAuthor(i)
if (user)
userMemberList.add([user: user, member: i])
else
userMemberList.add([member: i])
}
}
[userMemberInstanceList: userMemberList, memberInstanceTotal: Member.count()]
}


private void saveHistory(def memberInstance, String status) {

def hist = new Record(start: new Date(), status_H: status)
Expand All @@ -220,4 +285,24 @@ class MemberController {
def user = User.findByAuthor(memberInstance)
[userMemberInstanceList: [memberInstance: memberInstance, userInstance: user]]
}


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


for (i in members) {
def user = User.findByAuthor(i)
if (user)
userMemberList.add([user: user, member: i])
else
userMemberList.add([member: i])
}
}
[userMemberInstanceList: userMemberList, memberInstanceTotal: Member.count()]
}


}
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()]
}

}
}
6 changes: 5 additions & 1 deletion grails-app/domain/rgms/news/News.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class News {
researchGroup nullable: false
}


static List getCurrentNews(researchGroup) {
def list
list = News.findAllByResearchGroup(researchGroup)
Expand All @@ -26,4 +25,9 @@ class News {
return getCurrentNews(researchGroup).sort{a , b -> b.date <=> a.date}
}

static List findAll() {
List<News> list = new ArrayList<>()
return list
}

}
5 changes: 5 additions & 0 deletions grails-app/domain/rgms/publication/Book.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ class Book extends Publication {
return new BibtexExport().generateBibtexBook(this)
}
//#end

Book findByTitle(){
return null;
}

}
7 changes: 7 additions & 0 deletions grails-app/domain/rgms/publication/Dissertacao.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ package rgms.publication

class Dissertacao extends TeseOrDissertacao {

String title

//#if($Bibtex)
String generateBib() {
return new BibtexExport().generateBibtexDissertacao(this)
}


List findByTitle(String title){
return new ArrayList<Dissertacao>()
}

//#end
}
1 change: 1 addition & 0 deletions grails-app/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ member.start.label=Start
member.end.label=End
member.status_H.label=Status H
member.email.unique=Email already registered, you can not create another user with the same email.
member.slabel =
#end

#if($record)
Expand Down
6 changes: 5 additions & 1 deletion grails-app/i18n/messages_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ default.new.label=Novo {0}
default.create.label=Criar {0}
default.show.label=Ver {0}
default.edit.label=Editar {0}
default.search.label=Buscar {0}
default.searchByUniversity.label= Procurar por universidade {0}
default.searchByTitle.label= RGMS
default.searchByEmail.label=Procurar por email {0}

default.button.create.label=Criar
default.button.edit.label=Editar
Expand Down Expand Up @@ -223,4 +227,4 @@ default.researchproject.import.flashmessage.success = "Os Projetos de Pesquisa n

#if($researchLine)
default.researchline.import.flashmessage.success = "As linhas de pesquisa que não existiam foram importadas com sucesso"
#end
#end
26 changes: 23 additions & 3 deletions grails-app/views/member/list.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<div class="nav">
<span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
<span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
<span class="menuButton"><g:link class="search" action="search"><g:message code="default.search.label" args="[entityName]" /></g:link></span>
<span class="menuButton"><g:link class="search" action="searchByUniversity"><g:message code="default.search.label" args="[entityName]" /> por universidade</g:link></span>
<span class="menuButton"><g:link class="search" action="searchByEmail"><g:message code="default.search.label" args="[entityName]" /> por email</g:link></span>

</div>
<div class="body">
<h1><g:message code="default.list.label" args="[entityName]" /></h1>
Expand All @@ -31,11 +35,14 @@
<g:sortableColumn property="enabled" title="${message(code: 'member.enabled.label', default: 'Enabled')}" />

<g:sortableColumn property="email" title="${message(code: 'member.email.label', default: 'Email')}" />



<th>${message(code: 'member.roles.label', default: 'Roles')}</th>

<th>${message(code: 'member.permissions.label', default: 'Permissions')}</th>


<th>${message(code: 'member.university.label', default: 'University')}</th>

</tr>
</thead>
<tbody>
Expand All @@ -57,7 +64,9 @@
<td>${fieldValue(bean: userMemberInstance?.user, field: "roles")}</td>

<td>${fieldValue(bean: userMemberInstance?.user, field: "permissions")}</td>


<td>${fieldValue(bean: userMemberInstance?.user, field: "author.university")}</td>

</tr>
</g:each>
</tbody>
Expand All @@ -67,5 +76,16 @@
<g:paginate total="${memberInstanceTotal}" />
</div>
</div>

<script>
$('.sam').click(function(){
$('.odd').hide();
$('.even').hide();

});

</script>


</body>
</html>
88 changes: 88 additions & 0 deletions grails-app/views/member/search.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName" value="${message(code: 'member.label', default: 'Member')}" />
<title><g:message code="default.search.label" args="[entityName]" /></title>
</head>
<body>
<div class="nav">
<span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
<span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>

<g:form controller="member" action="search">
<div>
<label for="name">Buscar membro:</label>
<input type="text" name="name" />
</div>

<input type="submit" class="search" value="<g:message code="default.search.label"/>">
</g:form>
</div>
<div class="body">
<h1><g:message code="default.search.label" args="[entityName]" /></h1>
<g:if test="${flash.message}">
<div class="message">${flash.message}</div>
</g:if>

<g:if test="${params.name}">

<div class="list">
<table>
<thead>
<tr>

<g:sortableColumn property="id" title="${message(code: 'member.id.label', default: 'Id')}" />

<g:sortableColumn property="name" title="${message(code: 'member.name.label', default: 'Name')}" />

<g:sortableColumn property="username" title="${message(code: 'member.username.label', default: 'Username')}" />

<g:sortableColumn property="enabled" title="${message(code: 'member.enabled.label', default: 'Enabled')}" />

<g:sortableColumn property="email" title="${message(code: 'member.email.label', default: 'Email')}" />

<th>${message(code: 'member.roles.label', default: 'Roles')}</th>

<th>${message(code: 'member.permissions.label', default: 'Permissions')}</th>

</tr>
</thead>
<tbody>
<g:each in="${userMemberInstanceList}" status="i" var="userMemberInstance">
<tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

<td><g:link action="show" id="${userMemberInstance.member.id}">${fieldValue(bean: userMemberInstance.member, field: "id")}</g:link></td>

<td>${fieldValue(bean: userMemberInstance.member, field: "name")}</td>

<!-- <td>{fieldValue(bean: memberInstance, field: "lastName")}</td>-->

<td>${fieldValue(bean: userMemberInstance.user, field: "username")}</td>

<td>${fieldValue(bean: userMemberInstance?.user, field: "enabled")}</td>

<td><a href="mailto:${fieldValue(bean: userMemberInstance.member, field: "email")}">${fieldValue(bean: userMemberInstance.member, field: "email")}</a></td>

<td>${fieldValue(bean: userMemberInstance?.user, field: "roles")}</td>

<td>${fieldValue(bean: userMemberInstance?.user, field: "permissions")}</td>

</tr>
</g:each>
</tbody>
</table>
</div>
<div class="paginateButtons">
<g:paginate total="${memberInstanceTotal}" />
</div>

</g:if>
<g:else>
Digite um nome de membro no campo acima para efetuar a buscar.
</g:else>
</div>
</body>
</html>
Loading