Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
//#if($researchProject)
package rgms.researchProject

import org.apache.shiro.SecurityUtils
import org.springframework.dao.DataIntegrityViolationException
import rgms.authentication.User
import rgms.member.Member

class ResearchProjectController {

Expand All @@ -20,6 +23,17 @@ class ResearchProjectController {
[researchProjectInstance: new ResearchProject(params)]
}

def myProjects() {
User user = User.findByUsername(SecurityUtils.subject.principal);
List<ResearchProject> listP = ResearchProject.findAllByResponsible(user.getAuthor().getName());
render(view: '/researchProject/list', model: [researchProjectInstanceList: listP, researchProjectInstanceTotal: listP.size()]);
}

def filter(String projectName) {
List<ResearchProject> listP = ResearchProject.findAllByProjectName(projectName);
render(view: '/researchProject/list', model: [researchProjectInstanceList: listP, researchProjectInstanceTotal: listP.size()]);
}

def save() {
def researchProjectInstance = new ResearchProject(params)
saveInstance(researchProjectInstance,"create",'default.created.message')
Expand Down
1 change: 1 addition & 0 deletions grails-app/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ orientation.tituloTese.unique = Orientation title already registered, you can no

#if($researchProject)
default.researchProject.label = "ResearchProject"
default.researchproject.myProjects = My Research Projects
researchProject.label = ResearchProject
default.researchproject.import.flashmessage.success = "The non existent Research Project were successfully imported"
#end
Expand Down
2 changes: 1 addition & 1 deletion grails-app/i18n/messages_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ default.article.imported.message = As article não existentes foram importadas c
default.article.checkVersion.message = Um outro usuário atualizou este orientation enquanto você estava editando

default.reseachproject.label = Grupo de Pesquisa

default.researchproject.myProjects = Meus Projetos de Pesquisa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

altera o arquivo inglês também


conferencia.title.label=Título
conferencia.author.label=Autor
Expand Down
8 changes: 4 additions & 4 deletions grails-app/views/researchProject/_form.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@



<div class="fieldcontain ${hasErrors(bean: researchProjectInstance, field: 'projectName', 'error')} required">
<div class="fieldcontain ${hasErrors(bean: researchProjectInstance, field: 'projectName', 'error')}">
<label for="projectName">
<g:message code="researchProject.projectName.label" default="Project Name" />
<span class="required-indicator">*</span>
</label>
<g:textArea name="projectName" cols="40" rows="5" maxlength="300" required="" value="${researchProjectInstance?.projectName}"/>
<g:textArea name="projectName" cols="40" rows="5" maxlength="300" value="${researchProjectInstance?.projectName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: researchProjectInstance, field: 'description', 'error')} required">
<div class="fieldcontain ${hasErrors(bean: researchProjectInstance, field: 'description', 'error')}">
<label for="description">
<g:message code="researchProject.description.label" default="Description" />
<span class="required-indicator">*</span>
</label>
<g:textArea name="description" cols="40" rows="5" maxlength="3000" required="" value="${researchProjectInstance?.description}"/>
<g:textArea name="description" cols="40" rows="5" maxlength="3000" value="${researchProjectInstance?.description}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: researchProjectInstance, field: 'status', 'error')} required">
Expand Down
12 changes: 12 additions & 0 deletions grails-app/views/researchProject/list.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ul>
<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
<li><g:link class="myProjects" action="myProjects"><g:message code="default.researchproject.myProjects"/></g:link></li>
</ul>
</div>

Expand All @@ -29,6 +30,17 @@
</div>
<!-- #end -->

<div class="filter" role="filter">
<ul>
<br>
<g:form controller="ResearchProject" action="filter" method="post" enctype="multipart/form-data">
<label for="projectName">&nbsp;&nbsp;&nbsp;&nbsp;Filtrar por nome:</label>
<input type="text" name="projectName" id="projectName"/>
<input class="save" type="submit" value="Filtrar"/>
</g:form>
</ul>
</div>

<div id="list-researchProject" class="content scaffold-list" role="main">
<h1><g:message code="default.list.label" args="[entityName]" /></h1>
<g:if test="${flash.message}">
Expand Down
118 changes: 60 additions & 58 deletions test/cucumber/ResearchProject.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Feature: research project
Then the research project "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is properly stored by the system

Scenario: duplicated research project
Given the system has a research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
Given the system has a research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
When I try to create a research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
Then the research project "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is not stored twice
And no research project stored is affected

Scenario: remove research project
Given the system has a research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
And I am logged into the system as administrator of the research group named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
And I am logged into the system as administrator
When I remove the research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
Then the research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is properly removed by the system

Expand All @@ -27,8 +27,8 @@ Feature: research project

#if($XMLUpload)
Scenario: upload research project with a file
Given the system has some research project stored
And I am logged in the system
Given I am logged into the system as administrator
And the system has some research project stored
When I upload new research projects from the file "testelattes2.xml"
Then the system has more research projects now

Expand All @@ -39,76 +39,78 @@ Feature: research project
Then I'm still on the research project page
And the system shows an error message at the research project page
#end

Scenario: list research projects where I am a member
Given I am at the research project list page
When I select the "Meus Projetos de Pesquisa" option at research project menu
Then the system shows a list with the research projects where I am a member

Scenario: filter research projects by name
Given I am at the research projects list page
When I fill the project name field
And select the option "Filtrar Projetos de Pesquisa"
Then the system shows the research projects listed by the research projects name

Scenario: remove research project that does not exist
Given the system has no research projects named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
And I am logged into the system as administrator
When I try to remove a research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
Then nothing happens to the research projects stored

Scenario: edit existing research project
Given the research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is stored in the system
And I am logged into the system as administrator of the research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
When I try to edit the research project "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" in the system
And I changed the data of the research project
Then the data of the research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is updated in the system

Scenario: new invalid research project with blank name
Given the research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is stored in the system
Given the system has a research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
When I try to create a research project named as ""
Then the research project "" is not stored by the system because it is invalid
And no research project stored is affected

Scenario: new invalid research project with blank description
Given the system has no research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
When I try to create a research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" with description field blank
Then the research project "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is not stored by the system because it is invalid
Given the system has no research project named as "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas"
When I try to create a research project named as "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas" with description field blank
Then the research project "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas" is not stored by the system because it is invalid
And no research project stored is affected

Scenario: new research project with duplicated members
Given the system has no research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
When I create a research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" with member field duplicated
Then the research project "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is properly stored by the system
And the stored member list does not have duplicated members
Given the system has no research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas members duplicated"
When I create a research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas members duplicated" with member field duplicated
Then the research project "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas members duplicated" is properly stored by the system
And the research project "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas members duplicated" does not have duplicated members

Scenario: new research project web
Given I am at new research project page
And the system has no research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
When I create the research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
Then the research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is stored by the system
And it is shown in the research project list with name "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
Given I am at the publications menu
And I go to new research project page
And the system has no research project named as "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas web"
When I create a research project named as "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas web" with all required data filled on the web
Then it is shown in the research project list with name "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas web"

Scenario: new invalid research project with blank name web
Given I am at new research project page
And the research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is stored in the system
When I try to create the research project named ""
Then the research project named "" is not stored by the system because it is invalid
And the system shows an error message at the research project page
And no research project stored is affected
Given I am at the publications menu
And I go to new research project page
And the system has a research project named as "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas web" created on web
When I try to create a research project named as "" on the web
Then the research project "" is not stored by the system because it is invalid
And the system shows an error message at the new research project page
And I'm still on the new research project page
And no research project stored is affected

Scenario: new invalid research project with blank description web
Given I am at new research project page
And the system has no research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
When I try to create the research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" with description field blank
Then the research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is not stored by the system because it is invalid
And the system shows an error message at the research project page
Given I am at the publications menu
And I go to new research project page
And the system has no research project named as "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas web 2"
When I try to create a research project named as "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas web 2" with description field blank on the web
Then the research project "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas web 2" is not stored by the system because it is invalid
And I'm still on the new research project page
And the system shows an error message at the new research project page
And no research project stored is affected

Scenario: duplicated research project web
Given I am at new research project page
And the system has a research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
When I try to create the research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
Then the research project "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is not stored twice
And it is not shown duplicated in the research project list
And the system shows an warning message at the research project page
Given I am at the publications menu
And I go to new research project page
And the system has a research project named as "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas web" created on web
When I try to create a research project named as "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas web" on the web
Then the system shows an error message at the new research project page
And the research project "Implementação Progressiva de Aplicações Orientadas a Aspectos Complexas web" is not shown duplicated in the research project list

Scenario: list research projects where I am a member
Given I am at the research project list page
When I select the option to show my research projects
Then the system shows a list with the research projects where I am a member

Scenario: filter research projects by name
Given I am at the research project list page
When I fill the project name filter field with "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
And select the option to filter the research projects
Then the system shows the research projects with the name "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"

Scenario: remove research project that does not exist
Given the system has no research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
And I am logged into the system as administrator
When I remove the research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
Then no research project stored is affected

Scenario: edit existing research project
Given the system has a research project named as "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas"
When I edit the research project "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" in the system
Then the data of the research project named "Implementação Progressiva de Aplicações Orientadas a Objetos Complexas" is updated in the system
Loading