Commit 53e251f5 authored by Fabiano Sluzarski's avatar Fabiano Sluzarski
Browse files

Footer chances, link to search sapos added, upload files for the search

added and bug in statements courses fixed
parent 50f544f4
......@@ -61,15 +61,26 @@
</pluginRepository>
</pluginRepositories>
<dependencies>
<!-- General dependencies for standard applications -->
<!-- General dependencies for standard applications -->
<dependency>
<artifactId>solr-solrj</artifactId>
<groupId>org.apache.solr</groupId>
<version>1.4.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.0.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
......
......@@ -8,6 +8,7 @@ import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;
......@@ -110,6 +111,7 @@ public class Registration {
private String pageNumbers;
@Column(columnDefinition="alter table Registration change resume resume text")
private String resume;
private String jobKind;
......
......@@ -59,13 +59,16 @@ public class SectionPos {
public static Object findSectionPosesByProfessor(String prof, String year, String period) {
String periodPart = "";
if (!(period.isEmpty()))
periodPart = "((section_year >= "+year+" and period >= "+period+") or (section_year >= "+(new Integer(year)+1)+"))";
else
periodPart = "section_year >= "+year;
if (!(period.isEmpty()) && !(year.isEmpty()))
periodPart = "and ((section_year >= "+year+" and period >= "+period+") or (section_year >= "+(new Integer(year)+1)+"))";
else if ((period.isEmpty()) && !(year.isEmpty()))
periodPart = "and section_year >= "+year;
else if (!(period.isEmpty()) && (year.isEmpty()))
periodPart = "and period >= "+period;
return entityManager().createNativeQuery("select * from Section_Pos " +
" where professor = "+prof+" and "+periodPart+
// " and ((section_year >= "+year+" and period >= "+period+") or (section_year >= "+(new Integer(year)+1)+"))"+
" where professor = "+prof+" "+periodPart+
" order by section_year, period", SectionPos.class).getResultList();
}
......
package br.ufpr.c3sl.sapos.web;
package br.ufpr.c3sl.sapos.web;
import br.ufpr.c3sl.sapos.models.customization.Configuration;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
import org.apache.solr.client.solrj.request.AbstractUpdateRequest;
import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.springframework.roo.addon.web.mvc.controller.RooWebScaffold;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import br.ufpr.c3sl.sapos.models.customization.Configuration;
@RooWebScaffold(path = "configurations", formBackingObject = Configuration.class)
@RequestMapping("/configurations")
@Controller
public class ConfigurationController {
@RequestMapping(value = "upload", method = RequestMethod.GET)
public String upload() {
return "configurations/upload";
}
@RequestMapping(value = "uploads", method = RequestMethod.POST)
public String uploads(HttpServletRequest request) throws IOException {
if (request instanceof MultipartHttpServletRequest) {
if (((MultipartHttpServletRequest)request).getFile("file").isEmpty())
return "people/error";
else {
long formDataLength = ((MultipartHttpServletRequest)request).getFile("file").getSize();
byte dataBytes[] = new byte[(int)formDataLength];
String fileName = ((MultipartHttpServletRequest)request).getFile("file").getOriginalFilename();
fileName = fileName.substring(fileName.lastIndexOf("/")+1);
dataBytes = ((MultipartHttpServletRequest)request).getFile("file").getBytes();
//String file = new String(dataBytes);
//System.out.println("--------------------------------------\n"+
// file+
// "\n------------------------------------------------");
String path = Configuration.findConfigValueByName("search.path");
FileOutputStream fileOut = new FileOutputStream(path+fileName);
fileOut.write(dataBytes);
fileOut.flush();
fileOut.close();
CommonsHttpSolrServer server = new CommonsHttpSolrServer(Configuration.findConfigValueByName("search.url"));
ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update/extract");
up.addFile(new File(path+fileName));
up.setParam("commit", "true");
up.setParam("literal.id", fileName);
up.setParam("literal.stream_name", fileName);
up.setParam("uprefix", "attr_");
up.setParam("fmap.content", "attr_content");
//up.setParam("resource.name", fileName);
//up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
try {
server.request(up);
} catch (SolrServerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// rsp = server.query( new SolrQuery( "*:*") );
// Assert.assertEquals( 1, rsp.getResults().getNumFound() );
}
}
return "people/accepted";
}
}
......@@ -9,7 +9,7 @@ global_menu_statement_student_grant=Student grant statement
global_menu_statement_acceptance=Acceptance statement
global_menu_statement_courses=Ministered Courses statement
global_menu_candidates_to_grant=Candidates to grant
global_menu_blank_proposal=Blank Proposal
global_menu_blank_proposal=Open Proposal
global_menu_find=Find by {0}
global_menu_statement=Statement
global_menu_history=History
......@@ -21,8 +21,10 @@ global_theme_alt=alt
global_theme_standard=standard
global_menu_transcript_section=Transcripts per section
global_generic={0}
global_menu_load_meeting_minutes=Load meeting minutes
global_menu_search_meeting_minutes=Search meeting minutes
change_password=Change Password
search_sapos=Search Sapos
#welcome page
welcome_titlepane=Welcome to {0}
......
......@@ -20,8 +20,10 @@ global_menu_statement_courses=Declara
global_menu_candidates_to_grant=Candidatos a bolsa
global_menu_blank_proposal=Proposta em Aberto
global_generic={0}
global_menu_load_meeting_minutes=Carregar atas colegiado
global_menu_search_meeting_minutes=Procura atas colegiado
change_password=Trocar Senha
search_sapos=Pesquisa Sapos
#welcome page
welcome_titlepane=Bem vindo ao {0}
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<div xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:page="urn:jsptagdir:/WEB-INF/tags/form" version="2.0">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<jsp:output omit-xml-declaration="yes"/>
<!-- modelAttribute="file" name="upload" size="chars" -->
<form action="uploads" method="post" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" value="Submit" />
</form>
</div>
......@@ -13,4 +13,8 @@
<definition extends="default" name="configurations/update">
<put-attribute name="body" value="/WEB-INF/views/configurations/update.jspx"/>
</definition>
<definition extends="default" name="configurations/upload">
<put-attribute name="body" value="/WEB-INF/views/configurations/upload.jspx"/>
</definition>
</tiles-definitions>
......@@ -17,6 +17,13 @@
<spring:message code="change_password"/>
</a>
</span>
<c:out value=" | "/>
<spring:url value="http://sapos.c3sl.ufpr.br:8080/search_sapos/searchSapos.html" var="search_sapos"/>
<span>
<a href="${search_sapos}">
<spring:message code="search_sapos"/>
</a>
</span>
<c:out value=" | "/>
<span>
<spring:url value="/resources/j_spring_security_logout" var="logout"/>
......@@ -30,9 +37,10 @@
<c:out value=" | "/>
<spring:message code="global_language"/>
<c:out value=": "/>
<util:language label="Portugues" locale="pt_BR"/>
<util:language label="English" locale="en"/>
</span>
<util:theme/>
<!--<util:theme/>
<spring:url value="/resources/images/springsource-logo.png" var="logo"/>
<spring:message code="global_sponsored" var="sponsored"/>
......@@ -40,5 +48,5 @@
<a href="http://springsource.com" title="${fn:escapeXml(sponsored)}">
<img align="right" alt="${fn:escapeXml(sponsored)}" src="${logo}"/>
</a>
</span>
</span> -->
</div>
......@@ -89,6 +89,7 @@
<menu:category id="c_configuration" z="ex6zSpCyqSksY2xxo+2yaACAxic=">
<menu:item id="i_configuration_new" messageCode="global_menu_new" url="/configurations?form" z="PpKhRYSLF3fMvOlr5J8dEALoaF8="/>
<menu:item id="i_configuration_list" messageCode="global_menu_list" url="/configurations" z="user-managed"/>
<menu:item id="i_configuration_list" messageCode="global_menu_load_meeting_minutes" url="/configurations/upload" z="user-managed"/>
</menu:category>
<!-- <menu:category id="c_services" z="usermanaged"> -->
<!-- <menu:item id="i_search_meeting_minutes" messageCode="global_menu_search_meeting_minutes" url="/searchMeetingMinutes" z="user-managed"/> -->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment