forked from Coded/SIPRP
parent
1da8d52f59
commit
f4129178b4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
#Tue, 22 Apr 2014 18:47:35 +0100
|
||||
#Tue, 29 Apr 2014 17:33:15 +0100
|
||||
|
||||
timestamp=2014/04/22 18\:47
|
||||
timestamp=2014/04/29 17\:33
|
||||
user=rsantos
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,71 @@
|
||||
package shst.medicina.fichasclinicas.beans;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
public class FichaResumeBean
|
||||
{
|
||||
|
||||
private int id;
|
||||
|
||||
private Date data;
|
||||
|
||||
private String tipo;
|
||||
|
||||
private String responsavel;
|
||||
|
||||
private boolean editable;
|
||||
|
||||
private boolean concluido;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Date getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Date data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getTipo() {
|
||||
return tipo;
|
||||
}
|
||||
|
||||
public void setTipo(String tipo) {
|
||||
this.tipo = tipo;
|
||||
}
|
||||
|
||||
public String getResponsavel() {
|
||||
return responsavel;
|
||||
}
|
||||
|
||||
public void setResponsavel(String responsavel) {
|
||||
this.responsavel = responsavel;
|
||||
}
|
||||
|
||||
public boolean isEditable() {
|
||||
return editable;
|
||||
}
|
||||
|
||||
public void setEditable(boolean editable) {
|
||||
this.editable = editable;
|
||||
}
|
||||
|
||||
public boolean isConcluido() {
|
||||
return concluido;
|
||||
}
|
||||
|
||||
public void setConcluido(boolean concluido) {
|
||||
this.concluido = concluido;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package shst.medicina.fichasclinicas.beans;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import shst.medicina.fichasclinicas.beans.fichasclinicas.FcFichaBeanData;
|
||||
|
||||
public class TrabalhadorResumeBean
|
||||
{
|
||||
private FcFichaBeanData dadosTrabalhador;
|
||||
|
||||
private List<FichaResumeBean> fichas;
|
||||
|
||||
public FcFichaBeanData getDadosTrabalhador()
|
||||
{
|
||||
return dadosTrabalhador;
|
||||
}
|
||||
|
||||
public void setDadosTrabalhador(FcFichaBeanData dadosTrabalhador)
|
||||
{
|
||||
this.dadosTrabalhador = dadosTrabalhador;
|
||||
}
|
||||
|
||||
public List<FichaResumeBean> getFichas()
|
||||
{
|
||||
return fichas;
|
||||
}
|
||||
|
||||
public void setFichas(List<FichaResumeBean> fichas)
|
||||
{
|
||||
this.fichas = fichas;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package shst.medicina.fichasclinicas.logic;
|
||||
|
||||
public class LoginLogic
|
||||
{
|
||||
//public boolean doLogin(String username, String password, )
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package shst.medicina.fichasclinicas.webservices;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
|
||||
public interface ILogin<T> {
|
||||
|
||||
//T doLogin(Map<String,Object> auth);
|
||||
|
||||
//T checkLogin();
|
||||
|
||||
//T doLogout();
|
||||
|
||||
Response doLogin(HttpServletRequest req, Map<String, Object> auth);
|
||||
|
||||
Response checkLogin(HttpServletRequest req);
|
||||
|
||||
Response doLogout(HttpServletRequest req);
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
|
||||
package shst.medicina.fichasclinicas.webservices.jaxrs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.Date;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import org.codehaus.jackson.JsonGenerator;
|
||||
import org.codehaus.jackson.JsonProcessingException;
|
||||
import org.codehaus.jackson.map.JsonSerializer;
|
||||
import org.codehaus.jackson.map.SerializerProvider;
|
||||
|
||||
public class JSONSQLDateSerializer extends JsonSerializer<Date>{
|
||||
|
||||
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
|
||||
|
||||
@Override
|
||||
public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) throws IOException, JsonProcessingException
|
||||
{
|
||||
String formattedDate = dateFormat.format(date);
|
||||
gen.writeString(formattedDate);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package shst.medicina.fichasclinicas.webservices.jaxrs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import org.codehaus.jackson.JsonParser;
|
||||
import org.codehaus.jackson.JsonProcessingException;
|
||||
import org.codehaus.jackson.Version;
|
||||
import org.codehaus.jackson.map.DeserializationContext;
|
||||
import org.codehaus.jackson.map.JsonDeserializer;
|
||||
import org.codehaus.jackson.map.Module;
|
||||
import org.codehaus.jackson.map.module.SimpleAbstractTypeResolver;
|
||||
import org.codehaus.jackson.map.module.SimpleDeserializers;
|
||||
import org.codehaus.jackson.map.module.SimpleSerializers;
|
||||
|
||||
public class JSONSQLDateSerializerModule extends Module {
|
||||
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return "JSONSQLDateSerializerModule";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupModule(SetupContext context) {
|
||||
SimpleSerializers ss = new SimpleSerializers();
|
||||
|
||||
ss.addSerializer(java.sql.Date.class, new JSONSQLDateSerializer());
|
||||
|
||||
context.addSerializers(ss);
|
||||
|
||||
|
||||
SimpleDeserializers ds = new SimpleDeserializers();
|
||||
|
||||
ds.addDeserializer(java.util.Date.class, new JsonDeserializer<java.util.Date>(){
|
||||
private final SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
|
||||
private final SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
@Override
|
||||
public Date deserialize(JsonParser arg0, DeserializationContext arg1) throws IOException, JsonProcessingException {
|
||||
|
||||
java.util.Date dd = null;
|
||||
try
|
||||
{
|
||||
dd = dateFormat1.parse(arg0.getText());
|
||||
}
|
||||
catch(ParseException pel1)
|
||||
{
|
||||
try
|
||||
{
|
||||
dd = dateFormat2.parse(arg0.getText());
|
||||
}
|
||||
catch(ParseException pel2)
|
||||
{
|
||||
throw new IOException(arg0.getText());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return dd;
|
||||
}});
|
||||
|
||||
context.addDeserializers(ds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Version version() {
|
||||
return new Version(0, 0, 0, "boot");
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue