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

Mfl3 #336

Open
wants to merge 77 commits into
base: master
Choose a base branch
from
Open

Mfl3 #336

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
5eae552
Update Record.feature
mateus-mc2 Oct 22, 2014
5622cc9
Update Dissertacao.feature
fmm4 Oct 27, 2014
896587e
Update Dissertacao.feature
fmm4 Oct 27, 2014
cf2bfbe
Update Conferencia.feature
fmm4 Oct 27, 2014
aab515d
Adicionado feature de filtrar tese por ano de publicacao
Oct 27, 2014
bb8ec98
Adicionado feature de filtrar tese por nome de autor
Oct 27, 2014
3b58fb8
Modificado cenario de controle de adicionar teses
Oct 27, 2014
d631710
Modificado cenario de gui de criar tese
Oct 27, 2014
4acedb8
Modificado new book e new book web para adicionar autor
Oct 27, 2014
f802008
pequenos ajustes nos cenários
Oct 27, 2014
80c16b7
Adicionado cenario de controlador list thesis
Oct 27, 2014
22f408c
Adicionado cenario de controlador list book
Oct 27, 2014
fba2ad9
Adicionando troca de senha,
fmm4 Oct 27, 2014
ad1938f
Erro Cenário: Upload de livro sem arquivo.
fmm4 Oct 27, 2014
614f3bd
Adicionando mensagens a alguns erros.
fmm4 Oct 27, 2014
17dfef9
Update Dissertacao.feature
fmm4 Oct 27, 2014
8329d98
"search by tag", "mouse over information"
fmm4 Oct 27, 2014
e20954f
Adicionado os #if(nome) e #end
Oct 27, 2014
cb853d5
Update BibtexGenerateFile.feature
mateus-mc2 Oct 27, 2014
0a8cfc5
Update Conferencia.feature
Oct 27, 2014
c66b6e5
Update News.feature
mateus-mc2 Oct 27, 2014
c1d2f45
Update News.feature
Oct 27, 2014
0d53e66
Update Book.feature
Oct 27, 2014
1e9949f
Update BookChapter.feature
mateus-mc2 Oct 27, 2014
6d0899d
Update News.feature
mateus-mc2 Oct 27, 2014
d6b27b7
Update Book.feature
Oct 27, 2014
e777a47
Update Book.feature
Oct 27, 2014
a65e9fa
Update BibtexImport.feature
mateus-mc2 Oct 27, 2014
10234cb
Update Dissertacao.feature
Oct 27, 2014
9248ce5
Update Authentication.feature
mateus-mc2 Oct 27, 2014
26d8d74
Update Record.feature
mateus-mc2 Oct 28, 2014
c5453c0
Update Record.feature
mateus-mc2 Oct 28, 2014
24ecc30
Ajuste de conflito em book.feature
Oct 28, 2014
d2984f4
Correcoes da ultima revisao
Nov 22, 2014
75dd20d
And para new thesis
Nov 22, 2014
d1b23b3
Corrigido o local do And
Nov 22, 2014
23a81a1
Ajustado a thesisCreatePage para o And de new thesis e para o when de…
Nov 22, 2014
b40b56b
modificado o BookCreatePage para o evento new book web
Nov 22, 2014
cc0933f
Update BookChapterSteps.groovy
mateus-mc2 Nov 23, 2014
b90781c
Update BibtexImportSteps.groovy
mateus-mc2 Nov 23, 2014
f2f466c
Update RecordSteps.groovy
mateus-mc2 Nov 23, 2014
598c376
Update Record.feature
mateus-mc2 Nov 23, 2014
13e1a1a
Mudanças em dependencies
mateus-mc2 Nov 23, 2014
d8d8baa
Add resources.groovy
mateus-mc2 Nov 23, 2014
d4ecaa2
Solving merge conflicts
mateus-mc2 Nov 24, 2014
d9e9547
Merge branch 'mfl3' of https://github.com/Mateus-mc2/rgms
mateus-mc2 Nov 24, 2014
484cf0f
Update BuildConfig.groovy
Jan 19, 2015
b2d3520
Modificacoes para a revisao
Jan 21, 2015
67fc5e2
Adicionado scenarios pra quando nao adiciona o autor
Jan 21, 2015
0f0b9d0
modificações
Jan 22, 2015
0923387
Update: BookSteps and BuildConfig
mateus-mc2 Jan 22, 2015
fdeccdc
Updating features, steps and BibtexGenerateFilePage.groovy
mateus-mc2 Jan 22, 2015
62d4106
Update BuildConfig.groovy
mateus-mc2 Jan 22, 2015
f908280
Update BuildConfig.groovy
mateus-mc2 Jan 22, 2015
659c47b
Update BuildConfig.groovy and BookChapterSteps.groovy
Jan 23, 2015
1b219f2
Update list.gsp
Jan 23, 2015
bf1bda5
Atualizando a branch
Feb 5, 2015
c7e4741
Ajustes de book e tese
Feb 6, 2015
2869c0a
Adicionado labels que faltavam para tese e fix para possivel nullpointer
Feb 6, 2015
9ca8291
Adicionado labels que faltavam para book e fix para possivel nullpointer
Feb 6, 2015
9e0ba85
Mais fixes
Feb 6, 2015
6cf8157
Analyze/inspect code fix 1
Feb 6, 2015
c8396b9
Analyze/Inspect code Fix de warning
Feb 6, 2015
2b3e32c
Analyze/Inspect code fix de erro
Feb 6, 2015
909d07d
Locate duplicate fix book Controller
Feb 6, 2015
33413ec
Conflitos
Feb 6, 2015
c5983f5
modificações filipe 7/2/2015
Feb 7, 2015
3699fa8
Merge branch 'master' of https://github.com/Mateus-mc2/rgms
Feb 7, 2015
045b7a2
modificações testes
Feb 7, 2015
0ffe489
modificações
Feb 7, 2015
09f85cd
Merge branch 'master' of https://github.com/Mateus-mc2/rgms into Fnj2
Feb 7, 2015
e1a6b10
Merge branch 'Fnj2' of https://github.com/Mateus-mc2/rgms
Feb 7, 2015
2535361
Substituindo trecho de código duplicado --> Given I am at the Add Art…
mateus-mc2 Feb 9, 2015
1bf00ac
Método genérico para verificação do upload da dissertação (trechos de…
mateus-mc2 Feb 9, 2015
aefb68f
Criação de um método genérico para evitar duplicação de código em fil…
mateus-mc2 Feb 9, 2015
a7471b8
Criação de um método para escrever dados em um arquivo (detecção de t…
mateus-mc2 Feb 9, 2015
4b44c2d
Merge branch 'master' of https://github.com/Mateus-mc2/rgms into mfl3
mateus-mc2 Feb 9, 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
4 changes: 3 additions & 1 deletion 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 All @@ -57,10 +58,11 @@ grails.project.dependency.resolution = {
}

plugins {
//compile ":twitter4j:0.3.2"
compile ":twitter4j:0.3.2"
compile ":remote-control:1.4"
compile ":codenarc:0.20"
compile ":gmetrics:0.3.1"
compile ":blueprint:1.0.2"

runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.7.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,25 @@ class BibtexGenerateFileController {
render(bibtex)
}

def generateBibTexByTopic = { String topic ->
String bibtex = ""
List<ResearchGroup> groupList = ResearchGroup.getAll();

for(group in groupList) {
if(group.getId() == (params.id).toInteger()) {
List<Membership> memberList = Membership.getAllMembers(group);

for(member in memberList) {
String toAppend = memberPublications(member.getId())

if(toAppend.contains(topic)) {
bibtex += toAppend
}
}
}
}

render(bibtex)
}

}
80 changes: 68 additions & 12 deletions grails-app/controllers/rgms/publication/BookController.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package rgms.publication

class BookController {

boolean busca= false,v= false,p= false,n = false, a = false;
static allowedMethods = [save: "POST", update: "POST", delete: "POST"]
AuxiliarController aux = new AuxiliarController()

Expand All @@ -11,7 +11,27 @@ class BookController {

def list(Integer max) {
params.max = Math.min(max ?: 10, 100)
[bookInstanceList: Book.list(params), bookInstanceTotal: Book.count()]
if (busca) {
def bookInstanceList = Book.createCriteria().list(params) {
if (params.query) {
System.out.println("penes")
if (v) {
ilike("Volume", "%${params.query}%")
}
if(p){
ilike("Publisher", "%${params.query}%")
}
if(n){
ilike("Title", "%${params.query}%")
}
if(a){
ilike("Autores", "%${params.query}%")
}
}
}
}
[bookInstanceList: Book.list(params), bookInstanceTotal: Book.count()]

}

def create() {
Expand All @@ -38,26 +58,22 @@ class BookController {
redirect(action: "show", id: bookInstance.id)
}

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

def edit(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
}
def showOrEdit(Long id) {
showOrEditAux(id)
}

[bookInstance: bookInstance]
def edit(Long id) {
showOrEditAux(id)
}

def update(Long id, Long version) {
Expand Down Expand Up @@ -93,4 +109,44 @@ class BookController {
def bookInstance = Book.get(id)
aux.delete(id, bookInstance, 'book.label', 'Book');
}
def valores ={
def Input1 = params.Input1
def Input2 = params.Input2
["Input1": Input1, "Input2": Input2]
}

def busca(String tipo){
params.max = Math.min(params.max ? params.int('max') : 5, 100)

def bookList = Book.createCriteria().list (params) {
if ( params.query ) {
ilike(tipo, "%${params.query}%")
}
}

[bookInstanceList: bookList, bookInstanceTotal: bookList.totalCount]
}

def listSearchVolume ()
{
params.max = Math.min(params.max ? params.int('max') : 5, 100)

def bookList = Book.createCriteria().list (params) {
if ( params.query ) {
ilike(tipo, "%${params.query}%")
}
}

[bookInstanceList: bookList, bookInstanceTotal: bookList.totalCount]
}
def listSearchTitle ()
{
busca("title");

}
def listSearchPublisher(){
busca("publisher")
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ class PublicationController {
}
}
//#end
static def write(file, request) {
InputStream inputStream = request.getInputStream()
OutputStream outputStream = new FileOutputStream(file)
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()
}

def write(file) {
write(file, request)
}

def upload(Publication publicationInstance) {

Expand All @@ -75,16 +91,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()
write(f)

return true
}
Expand All @@ -100,16 +107,8 @@ 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()
write(f, request)

return true
}
Expand Down
2 changes: 1 addition & 1 deletion grails-app/domain/rgms/publication/BibtexExport.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class BibtexExport {

public String generateBibtexTese(Tese tese) {

return "@phdthesis{" + "author=\"" + BibtexAux.organizeAuthors(tese.members) + "\",\n title=\"" + tese.title + "\",\n school=\"" + tese.school + "\",\n year=\"" + tese.publicationDate.getAt(Calendar.YEAR) + "\",\n address=\"" + tese.address + "\"}"
return "@phdthesis{" + "author=\"" + BibtexAux.organizeAuthors(tese.members) + "\",\n title=\"" + tese.title + "\",\n school=\"" + tese.school + "\",\n author=\"" + tese.author + "\",\n year=\"" + tese.publicationDate.getAt(Calendar.YEAR) + "\",\n address=\"" + tese.address + "\"}"
}
}

Expand Down
2 changes: 2 additions & 0 deletions grails-app/domain/rgms/publication/Book.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ class Book extends Publication {
String publisher
int volume
String pages
String autores

static constraints = {
publisher nullable: false, blank: false, unique: ['title', 'volume']
volume nullable: false, blank: false, min: 1
pages nullable: false, blank: false
autores nullable:false, blank: false
}

//#if($Bibtex)
Expand Down
2 changes: 1 addition & 1 deletion grails-app/domain/rgms/publication/Publication.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ abstract class Publication {
}

static Set getPublicationsByMembership(membership) {
def publications = membership?.member.publications
def publications = membership?.member?.publications
def query = !membership.dateLeft ?
{ it.publicationDate?.compareTo(membership.dateJoined) > 0 } :
{
Expand Down
2 changes: 2 additions & 0 deletions grails-app/domain/rgms/publication/TeseOrDissertacao.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ abstract class TeseOrDissertacao extends Publication {

String school
String address
String author

static constraints = {
school nullable: false, blank: false
address nullable: false, blank: false
author nullable: false, blank: false
}

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package rgms.publication.strategyBibtexParse;

import org.jbibtex.BibTeXEntry;

import rgms.publication.Publication;


/**
* @author Diogo Vinicius
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public Publication execute(BibTeXEntry entry) {
Tese tese = new Tese();
tese.setTitle(entry.getField(BibTeXEntry.KEY_TITLE).toUserString());
tese.setSchool(entry.getField(BibTeXEntry.KEY_SCHOOL).toUserString());
tese.setAuthor(entry.getField(BibTeXEntry.KEY_AUTHOR).toUserString());
tese.setAddress(entry.getField(BibTeXEntry.KEY_ADDRESS).toUserString());
tese.setPublicationDate(new Date());//TODO transformar o date para setar no objeto
tese.setFile("file");//TODO settar corretamente este atributo
Expand Down
19 changes: 19 additions & 0 deletions grails-app/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ default.button.delete.label=Delete
default.button.list.label = List
default.button.delete.confirm.message=Are you sure?

default.link.skip.label=Skip to content&hellip;


typeMismatch.java.net.URL=Property {0} must be a valid URL
typeMismatch.java.net.URI=Property {0} must be a valid URI
Expand Down Expand Up @@ -73,6 +75,7 @@ default.title.label=Title
default.author.label=Author
default.year.label=Year
default.search.label=Search
default.advancedSearch.label=Advanced Search
default.user.label=Users

user.login.title=Login
Expand Down Expand Up @@ -158,12 +161,28 @@ tese.title.label=Title
tese.school.label=School
tese.year.label=Year
tese.month.label=Month
tese.publicationDate.label=Publication Date
tese.file.label=File
tese.researchLine.label=Research Line
tese.address.label=Adress
tese.members.label=Members
tese.arquivo.label=File
tese.label=Thesis
tese.duplicatetitle.failure = Thesis not stored because there is another one with the same title
#end
#end

book.label=Book
book.title.label=Title
book.publicationDate.label=Publication Date
book.file.label=File
book.researchLine.label=Research Line
book.authors.label=Authors
book.publisher.label=Publishers
book.volume.label=Volume
book.pages.label=Pages
book.members.label=Members

orientation.same.members=Um membro nao pode orientar a si mesmo
default.xml.parserror.message=No file uploaded or it wasn't a valid XML
default.xml.structure.message=The XML struct doesn't comply with Lattes
Expand Down
22 changes: 18 additions & 4 deletions grails-app/views/bibtexGenerateFile/home.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
</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">
<a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a>
</span>
</div>
<div class="body">
<h1><g:message code="default.list.label" args="[entityName]" /></h1>
<g:if test="${flash.message}">
<div class="message">${flash.message}</div>
</g:if>

<div class="list">
<table>
<thead>
Expand All @@ -42,8 +45,13 @@

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

<td><g:link action="generateBibTex" id="${userMember.member.id}">Generate All BibTex</g:link></td>

<td>
<g:link action="generateBibTex" id="${userMember.member.id}">Generate All BibTex</g:link>
<g:form controller="BibtexGenerateFileController" method="post" action="generateBibTexByTopic" enctype="multipart/form-data">
<g:textField name="searchTextField" value="Digite o tópico"/>
<g:actionSubmit value="Generate BibTex" action="generateBibTexByTopic" id="GenerateBibTex"/>
</g:form>
</td>
</tr>
</g:each>
</tbody>
Expand Down Expand Up @@ -77,7 +85,13 @@

<td>${ fieldValue(bean: researchGroupInstance, field: "description") } </td>

<td><g:link action="generateBibTexGroup" id="${researchGroupInstance.id}">Generate All BibTex from Members</g:link></td>
<td>
<g:link action="generateBibTexGroup" id="${researchGroupInstance.id}">Generate All BibTex from Members</g:link>
<g:form controller="BibtexGenerateFileController" method="post" action="generateBibTexByTopic" enctype="multipart/form-data">
<g:textField name="searchTextField" value="Digite o tópico"/>
<g:actionSubmit value="Generate BibTex" action="generateBibTexByTopic" id="GenerateBibTex"/>
</g:form>
</td>
</tr>
</g:each>
</tbody>
Expand Down
Loading