diff --git a/backoffice/pom.xml b/backoffice/pom.xml index a08d24c03efd121ea6173f72f8956a45a8591519..f4bf4d24f7ce2be95f870de7819c9fbae8b8abc9 100644 --- a/backoffice/pom.xml +++ b/backoffice/pom.xml @@ -42,7 +42,7 @@ <dependency> <groupId>org.jboss.spec.javax.faces</groupId> - <artifactId>jboss-jsf-api_2.2_spec</artifactId> + <artifactId>jboss-jsf-api_2.3_spec</artifactId> <scope>provided</scope> </dependency> @@ -88,14 +88,6 @@ <warName>backoffice</warName> </configuration> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>5</source> - <target>5</target> - </configuration> - </plugin> </plugins> </build> diff --git a/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java b/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java index b358919357c2067776dfd9ecfb8b4243aa9339fc..172e08d8267a91048f372ee7f9e4f7c6c4b9fe81 100644 --- a/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java +++ b/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java @@ -1,109 +1,21 @@ package uy.edu.fing.tse.jsf; -import uy.edu.fing.tse.dto.NoticiaDTO; -import uy.edu.fing.tse.dto.PublicacionDTO; -import uy.edu.fing.tse.practico.business.BusinessLocal; + +import uy.edu.fing.tse.central.business.BusinessLocal; import javax.ejb.EJB; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ManagedProperty; -import javax.faces.bean.RequestScoped; -import java.util.List; -import java.util.Optional; +import javax.enterprise.context.RequestScoped; +import javax.inject.Named; +import javax.jms.MessageProducer; +@Named @RequestScoped -@ManagedBean(name = "noticiaBean") public class RequestBean { @EJB private BusinessLocal negocio; @EJB - private uy.edu.fing.tse.practico.business.mq.JMSProducer jms; - - @ManagedProperty(value = "#{Session}") - private SessionBean session; - - - private Optional<String> tipo = Optional.empty(); - private Optional<String> url = Optional.empty(); - - private Optional<String> titulo = Optional.empty(); - private Optional<String> descripcion = Optional.empty(); - - public List<NoticiaDTO> getNoticias() { - return negocio.getNoticias(); - } - - public String getTipo() { - return tipo.orElse(""); - } - - public void setTipo(String tipo) { - this.tipo = Optional.ofNullable(tipo); - } - - public String getUrl() { - return url.orElse(""); - } - - public void setUrl(String url) { - this.url = Optional.ofNullable(url); - } - - public String getTitulo() { - return titulo.orElse(""); - } - - public void setTitulo(String titulo) { - this.titulo = Optional.ofNullable(titulo); - } - - public String getDescripcion() { - return descripcion.orElse(""); - } - - public void setDescripcion(String descripcion) { - this.descripcion = Optional.ofNullable(descripcion); - } - - public SessionBean getSession() { - return session; - } - - public void setSession(SessionBean session) { - this.session = session; - } - - public String add(long idN) { - final PublicacionDTO dtoP = new PublicacionDTO(null, tipo.get(), url.get()); - final NoticiaDTO noticiaDTO = negocio.addPublicacionANoticia(dtoP, idN); - session.setNoticia(noticiaDTO); - tipo = url = Optional.empty(); - return "noticia"; - } - - public String addNoticia() { - final int cant = negocio.getNoticias().size(); - jms.altaNoticia(new NoticiaDTO(null, titulo.get(), descripcion.get())); - - for (int i = 0; i < 50; i++) { - if (cant == negocio.getNoticias().size()) { - sleep(); - } else { - break; - } - } - - titulo = descripcion = Optional.empty(); - return "getNoticias"; - } + private MessageProducer mq; - private void sleep() { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } } diff --git a/backoffice/src/main/java/uy/edu/fing/tse/jsf/SessionBean.java b/backoffice/src/main/java/uy/edu/fing/tse/jsf/SessionBean.java deleted file mode 100644 index c780223fbac134fb39bcf60ae1db1076d1d833fd..0000000000000000000000000000000000000000 --- a/backoffice/src/main/java/uy/edu/fing/tse/jsf/SessionBean.java +++ /dev/null @@ -1,33 +0,0 @@ -package uy.edu.fing.tse.jsf; - -import uy.edu.fing.tse.dto.NoticiaDTO; - -import javax.annotation.PostConstruct; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.SessionScoped; - -@SessionScoped -@ManagedBean(name = "Session") -public class SessionBean { - - private NoticiaDTO selected; - - @PostConstruct - public void init() { - - } - - public NoticiaDTO getNoticia() { - return selected; - } - - public void setNoticia(NoticiaDTO selected) { - this.selected = selected; - } - - public String seleccionar(NoticiaDTO n) { - selected = n; - return "noticia"; - } - -} diff --git a/backoffice/src/main/java/uy/edu/fing/tse/jsp/MyServlet.java b/backoffice/src/main/java/uy/edu/fing/tse/jsp/MyServlet.java deleted file mode 100644 index b117d3bf3e5dc98b86fdde7397d258fc0eba455f..0000000000000000000000000000000000000000 --- a/backoffice/src/main/java/uy/edu/fing/tse/jsp/MyServlet.java +++ /dev/null @@ -1,77 +0,0 @@ -package uy.edu.fing.tse.jsp; - -import uy.edu.fing.tse.dto.NoticiaDTO; -import uy.edu.fing.tse.dto.PublicacionDTO; -import uy.edu.fing.tse.practico.business.BusinessLocal; - -import javax.ejb.EJB; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -@WebServlet(name = "Controller", urlPatterns = "/jsp/controlador") -public class MyServlet extends HttpServlet { - private static final long serialVersionUID = -964003102417352102L; - - @EJB - private BusinessLocal negocio; - - @EJB - private uy.edu.fing.tse.practico.business.mq.JMSProducer jms; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - final String noticia = req.getParameter("noticia"); - if (noticia == null) { - req.setAttribute("noticias", negocio.getNoticias()); - req.getRequestDispatcher("getNoticias.jsp").forward(req, resp); - } else { - req.setAttribute("noticia", negocio.findNoticia(Long.parseLong(noticia))); - req.getRequestDispatcher("verPublicacionesNoticia.jsp").forward(req, resp); - } - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - final String idNoticia = req.getParameter("idNoticia"); - - if (idNoticia == null) { - - final int cant = negocio.getNoticias().size(); - final String descripcion = req.getParameter("descripcion"); - final String titulo = req.getParameter("titulo"); - - jms.altaNoticia(new NoticiaDTO(null, titulo, descripcion)); - - for (int i = 0; i < 10; i++) { - if (cant == negocio.getNoticias().size()) { - sleep(); - } else { - break; - } - } - - req.setAttribute("noticias", negocio.getNoticias()); - req.getRequestDispatcher("getNoticias.jsp").forward(req, resp); - } else { - final String tipo = req.getParameter("tipo"); - final String url = req.getParameter("url"); - final NoticiaDTO noticia = negocio.addPublicacionANoticia(new PublicacionDTO(null, tipo, url), Long.parseLong(idNoticia)); - - req.setAttribute("noticia", noticia); - req.getRequestDispatcher("verPublicacionesNoticia.jsp").forward(req, resp); - } - - } - - private void sleep() { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } -} diff --git a/backoffice/src/main/webapp/WEB-INF/faces-config.xml b/backoffice/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index ffc7e8122b43c698e0e9a855f4637de1bac6a43e..0000000000000000000000000000000000000000 --- a/backoffice/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0"?> -<!-- Marker file indicating JSF 2.2 should be enabled in the application --> -<faces-config version="2.2" - xmlns="http://xmlns.jcp.org/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://xmlns.jcp.org/xml/ns/javaee - http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"> -</faces-config> diff --git a/backoffice/src/main/webapp/WEB-INF/web.xml b/backoffice/src/main/webapp/WEB-INF/web.xml index cb4b2e4e3255c61affb7d042d7f0c71058c15325..891e0f2315abf4fb902d2f758246a4c75b616c0d 100644 --- a/backoffice/src/main/webapp/WEB-INF/web.xml +++ b/backoffice/src/main/webapp/WEB-INF/web.xml @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<web-app xmlns="http://java.sun.com/xml/ns/javaee" +<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-app_3_0.xsd" - version="3.0"> + xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"> - <display-name>Practico TSE</display-name> + <display-name>Backoffice TSE</display-name> <!-- Change to "Production" when you are ready to deploy --> <context-param> @@ -53,13 +52,12 @@ <url-pattern>*.xhtml</url-pattern> </servlet-mapping> + <welcome-file-list> + <welcome-file>index.xhtml</welcome-file> + </welcome-file-list> + <session-config> <session-timeout>15</session-timeout> - <cookie-config> - <!-- Prevents session cookie from being read by clientside scripts --> - <!--<http-only>true</http-only>--> - <!--<secure>true</secure>--> - </cookie-config> - <tracking-mode>COOKIE</tracking-mode> + <tracking-mode>URL</tracking-mode> </session-config> </web-app> \ No newline at end of file diff --git a/backoffice/src/main/webapp/jsp/getNoticias.jsp b/backoffice/src/main/webapp/jsp/getNoticias.jsp deleted file mode 100644 index 974dc0a0dbeadfee293dc558d9b6632b4b7f01b2..0000000000000000000000000000000000000000 --- a/backoffice/src/main/webapp/jsp/getNoticias.jsp +++ /dev/null @@ -1,38 +0,0 @@ -<%@ page import="uy.edu.fing.tse.dto.NoticiaDTO" %> -<%@ page import="java.util.List" %> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<html> -<head> - <title>TSE 2019 - Practico JSP</title> -</head> -<body> -<h1>TSE 2019 - Practico JSP</h1> -<br> - -<% - final List noticias = (List) request.getAttribute("noticias"); - - for (Object noticia : noticias) { - final NoticiaDTO noti = (NoticiaDTO) noticia; -%> -<h2><a href="controlador?noticia=<%= noti.getId()%>"><%= noti.getTitulo()%> -</a></h2> - -<%= noti.getDescripcion()%> -<br/> -<hr/> -<%}%> - -<hr/> - -<form action="controlador" method="post"> - <label for="titulo">Titulo:</label> - <input id="titulo" name="titulo"> - <br/> - <label for="descripcion">Descripcion:</label> - <textarea id="descripcion" name="descripcion"></textarea> - <br/> - <input value="Agregar" type="submit"> -</form> -</body> -</html> diff --git a/backoffice/src/main/webapp/jsp/index.html b/backoffice/src/main/webapp/jsp/index.html deleted file mode 100644 index dbfdd688bb1d87ac54964deb5adbb630e26ebe48..0000000000000000000000000000000000000000 --- a/backoffice/src/main/webapp/jsp/index.html +++ /dev/null @@ -1,15 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>TSE 2019 - Practico JSP</title> - <meta http-equiv="refresh" content="0; url=controlador"> -</head> -<body> - -<h1>TSE 2019 - Practico JSP</h1> -<br> -<meta> -<a href="controlador">getNoticias</a> -</body> -</html> \ No newline at end of file diff --git a/backoffice/src/main/webapp/jsp/verPublicacionesNoticia.jsp b/backoffice/src/main/webapp/jsp/verPublicacionesNoticia.jsp deleted file mode 100644 index 2ea3f72d3f4fef6120e21db40b39202d4cb79f12..0000000000000000000000000000000000000000 --- a/backoffice/src/main/webapp/jsp/verPublicacionesNoticia.jsp +++ /dev/null @@ -1,43 +0,0 @@ -<%@ page import="uy.edu.fing.tse.dto.NoticiaDTO" %> -<%@ page import="uy.edu.fing.tse.dto.PublicacionDTO" %> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<html> -<head> - <title>TSE 2019 - Practico JSP</title> -</head> -<body> -<h1>TSE 2019 - Practico JSP</h1> -<br> - -<% - final NoticiaDTO noticia = (NoticiaDTO) request.getAttribute("noticia"); -%> -<h2><%= noticia.getTitulo()%> -</h2> -<%= noticia.getDescripcion()%> -<br/> -<hr/> - -<% - for (Object pObject : noticia.getPublicaciones()) { - PublicacionDTO publicacion = (PublicacionDTO) pObject; -%> - -Id: <%=publicacion.getId()%> -<br/> -Tipo: <%=publicacion.getTipo()%> -<br/> -<a href="<%=publicacion.getUrl()%>">LINK</a> -<br/> -<%}%> - - -<form action="controlador" method="post"> - <input id="idNoticia" name="idNoticia" type="hidden" value="<%=noticia.getId()%>"> - Tipo: <input id="tipo" name="tipo" placeholder="Tweet"> - URL: <input id="url" name="url" placeholder="www.google.com"> - <input type="submit"> -</form> - -</body> -</html> diff --git a/backoffice/src/main/webapp/resources/soapui/TSE-API-soapui-project.xml b/backoffice/src/main/webapp/resources/soapui/TSE-API-soapui-project.xml deleted file mode 100644 index 2b4ced18efbda55f4943345c6c9674a0ba2dca82..0000000000000000000000000000000000000000 --- a/backoffice/src/main/webapp/resources/soapui/TSE-API-soapui-project.xml +++ /dev/null @@ -1,333 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<con:soapui-project id="36d9e2e5-cd71-41e6-a125-aec8926345a8" activeEnvironment="Default" name="TSE API" resourceRoot="" - soapui-version="5.5.0" xmlns:con="http://eviware.com/soapui/config"> - <con:settings/> - <con:interface xsi:type="con:RestService" id="9e519c47-0d19-4949-953a-114533b1ceb5" - wadlVersion="http://wadl.dev.java.net/2009/02" name="http://localhost:8080" type="rest" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <con:settings/> - <con:definitionCache/> - <con:endpoints> - <con:endpoint>http://localhost:8080</con:endpoint> - </con:endpoints> - <con:resource name="Publicacion" path="/practico-api/rest/noticia/{id}/publicacion" - id="8f67d9ef-e987-4e58-9f1f-32dd05a7f74a"> - <con:settings/> - <con:parameters> - <con:parameter> - <con:name>tipo</con:name> - <con:value>rest</con:value> - <con:style>QUERY</con:style> - <con:default>rest</con:default> - <con:path xsi:nil="true"/> - <con:description xsi:nil="true"/> - </con:parameter> - <con:parameter> - <con:name>url</con:name> - <con:value>www.sss.fb</con:value> - <con:style>QUERY</con:style> - <con:default>www.sss.fb</con:default> - <con:path xsi:nil="true"/> - <con:description xsi:nil="true"/> - </con:parameter> - <con:parameter> - <con:name>id</con:name> - <con:value/> - <con:style>TEMPLATE</con:style> - <con:default/> - <con:description xsi:nil="true"/> - </con:parameter> - </con:parameters> - <con:method name="Publicacion 1" id="9524c72a-cc60-48be-8834-a98887285109" method="POST"> - <con:settings/> - <con:parameters/> - <con:representation type="RESPONSE"> - <con:mediaType>application/json</con:mediaType> - <con:status>200</con:status> - <con:params/> - <con:element xmlns:pub="http://localhost/practico-api/rest/noticia/1/publicacion">pub:Response - </con:element> - </con:representation> - <con:representation type="REQUEST"> - <con:mediaType>application/json</con:mediaType> - <con:params/> - </con:representation> - <con:request name="Request 1" id="2c322e32-fb13-4f8d-9c99-06c71f6de9af" mediaType="application/json" - postQueryString="false"> - <con:settings> - <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/> - </con:setting> - </con:settings> - <con:endpoint>http://localhost:8080</con:endpoint> - <con:request/> - <con:originalUri>http://localhost/practico-api/rest/noticia/1/publicacion</con:originalUri> - <con:credentials> - <con:authType>No Authorization</con:authType> - </con:credentials> - <con:jmsConfig JMSDeliveryMode="PERSISTENT"/> - <con:jmsPropertyConfig/> - <con:parameters> - <con:entry key="tipo" value="rest"/> - <con:entry key="id" value="1"/> - <con:entry key="url" value="www.sss.fb"/> - </con:parameters> - <con:parameterOrder> - <con:entry>tipo</con:entry> - <con:entry>url</con:entry> - <con:entry>id</con:entry> - </con:parameterOrder> - </con:request> - </con:method> - </con:resource> - <con:resource name="publicaciones" path="/practico-api/rest/noticia/{id}/publicaciones" - id="aaea0758-01a9-40be-9fa0-5ae0fea29651"> - <con:settings/> - <con:parameters> - <con:parameter> - <con:name>id</con:name> - <con:value/> - <con:style>TEMPLATE</con:style> - <con:default/> - <con:description xsi:nil="true"/> - </con:parameter> - </con:parameters> - <con:method name="Method 1" id="087fbea6-05a0-4d26-a699-8e716fc6bb06" method="GET"> - <con:settings/> - <con:parameters/> - <con:representation type="RESPONSE"> - <con:mediaType>application/json</con:mediaType> - <con:status>200</con:status> - <con:params/> - <con:element>Response</con:element> - </con:representation> - <con:request name="Request 1" id="46277185-9bfa-4836-b1b1-008b03bb23b2" mediaType="application/json"> - <con:settings> - <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/> - </con:setting> - </con:settings> - <con:endpoint>http://localhost:8080</con:endpoint> - <con:request/> - <con:originalUri>http://localhost/practico-api/rest/noticia/1/publicaciones</con:originalUri> - <con:credentials> - <con:authType>No Authorization</con:authType> - </con:credentials> - <con:jmsConfig JMSDeliveryMode="PERSISTENT"/> - <con:jmsPropertyConfig/> - <con:parameters> - <entry key="id" value="1" xmlns="http://eviware.com/soapui/config"/> - </con:parameters> - <con:parameterOrder> - <con:entry>id</con:entry> - </con:parameterOrder> - </con:request> - </con:method> - </con:resource> - <con:resource name="noticias" path="/practico-api/rest/noticias" id="9bf57d07-edc8-4794-bed8-8e64e394bba6"> - <con:settings/> - <con:parameters/> - <con:method name="Method 1" id="07302d11-f397-4f3d-853e-c1f918be7c08" method="GET"> - <con:settings/> - <con:parameters/> - <con:representation type="RESPONSE"> - <con:mediaType>application/json</con:mediaType> - <con:status>200</con:status> - <con:params/> - <con:element>Response</con:element> - </con:representation> - <con:request name="Request 1" id="a527c0f7-4f39-49f5-9516-902a14056a2f" mediaType="application/json"> - <con:settings> - <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/> - </con:setting> - </con:settings> - <con:endpoint>http://localhost:8080</con:endpoint> - <con:request/> - <con:originalUri>http://localhost/practico-api/rest/noticias</con:originalUri> - <con:credentials> - <con:authType>No Authorization</con:authType> - </con:credentials> - <con:jmsConfig JMSDeliveryMode="PERSISTENT"/> - <con:jmsPropertyConfig/> - <con:parameters/> - </con:request> - </con:method> - </con:resource> - </con:interface> - <con:interface xsi:type="con:WsdlInterface" id="06180e4e-0acf-4ad2-a9fc-80d0d8c8a033" wsaVersion="NONE" - name="SoapAPIServiceSoapBinding" type="wsdl" - bindingName="{http://soap.ws.tse.fing.edu.uy/}SoapAPIServiceSoapBinding" soapVersion="1_1" - anonymous="optional" definition="http://localhost:8080/practico-api/SoapAPI?wsdl" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <con:settings/> - <con:definitionCache type="TEXT" rootPart="http://localhost:8080/practico-api/SoapAPI?wsdl"> - <con:part> - <con:url>http://localhost:8080/practico-api/SoapAPI?wsdl</con:url> - <con:content><![CDATA[<wsdl:definitions name="SoapAPIService" targetNamespace="http://soap.ws.tse.fing.edu.uy/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://soap.ws.tse.fing.edu.uy/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http"> - <wsdl:types> - <xs:schema targetNamespace="http://soap.ws.tse.fing.edu.uy/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:element name="noticia" type="tns:noticiaDT"/> - <xs:element name="noticias" type="tns:noticiasDT"/> - <xs:element name="publicacion" type="tns:publicacionDT"/> - <xs:element name="publicaciones" type="tns:publicacionesDT"/> - <xs:complexType final="extension restriction" name="noticiasDT"> - <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="noticia" type="tns:noticiaDT"/> - </xs:sequence> - </xs:complexType> - <xs:complexType final="extension restriction" name="noticiaDT"> - <xs:sequence> - <xs:element minOccurs="0" name="id" type="xs:long"/> - <xs:element minOccurs="0" name="titulo" type="xs:string"/> - <xs:element minOccurs="0" name="descripcion" type="xs:string"/> - <xs:element minOccurs="0" name="publicaciones" type="tns:publicacionesDT"/> - </xs:sequence> - </xs:complexType> - <xs:complexType final="extension restriction" name="publicacionesDT"> - <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="publicacion" type="tns:publicacionDT"/> - </xs:sequence> - </xs:complexType> - <xs:complexType final="extension restriction" name="publicacionDT"> - <xs:sequence> - <xs:element minOccurs="0" name="id" type="xs:long"/> - <xs:element minOccurs="0" name="tipo" type="xs:string"/> - <xs:element minOccurs="0" name="url" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:schema> - </wsdl:types> - <wsdl:message name="getNoticiasResponse"> - <wsdl:part name="return" type="tns:noticiasDT"></wsdl:part> - </wsdl:message> - <wsdl:message name="getPublicaciones"> - <wsdl:part name="idNoticia" type="xsd:long"></wsdl:part> - </wsdl:message> - <wsdl:message name="getNoticias"></wsdl:message> - <wsdl:message name="getPublicacionesResponse"> - <wsdl:part name="return" type="tns:publicacionesDT"></wsdl:part> - </wsdl:message> - <wsdl:message name="addPublicacion"> - <wsdl:part name="tipo" type="xsd:string"></wsdl:part> - <wsdl:part name="url" type="xsd:string"></wsdl:part> - <wsdl:part name="idNoticia" type="xsd:long"></wsdl:part> - </wsdl:message> - <wsdl:portType name="API"> - <wsdl:operation name="getNoticias"> - <wsdl:input message="tns:getNoticias" name="getNoticias"></wsdl:input> - <wsdl:output message="tns:getNoticiasResponse" name="getNoticiasResponse"></wsdl:output> - </wsdl:operation> - <wsdl:operation name="getPublicaciones"> - <wsdl:input message="tns:getPublicaciones" name="getPublicaciones"></wsdl:input> - <wsdl:output message="tns:getPublicacionesResponse" name="getPublicacionesResponse"></wsdl:output> - </wsdl:operation> - <wsdl:operation name="addPublicacion"> - <wsdl:input message="tns:addPublicacion" name="addPublicacion"></wsdl:input> - </wsdl:operation> - </wsdl:portType> - <wsdl:binding name="SoapAPIServiceSoapBinding" type="tns:API"> - <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> - <wsdl:operation name="getNoticias"> - <soap:operation soapAction="" style="rpc"/> - <wsdl:input name="getNoticias"> - <soap:body namespace="http://soap.ws.tse.fing.edu.uy/" use="literal"/> - </wsdl:input> - <wsdl:output name="getNoticiasResponse"> - <soap:body namespace="http://soap.ws.tse.fing.edu.uy/" use="literal"/> - </wsdl:output> - </wsdl:operation> - <wsdl:operation name="getPublicaciones"> - <soap:operation soapAction="" style="rpc"/> - <wsdl:input name="getPublicaciones"> - <soap:body namespace="http://soap.ws.tse.fing.edu.uy/" use="literal"/> - </wsdl:input> - <wsdl:output name="getPublicacionesResponse"> - <soap:body namespace="http://soap.ws.tse.fing.edu.uy/" use="literal"/> - </wsdl:output> - </wsdl:operation> - <wsdl:operation name="addPublicacion"> - <soap:operation soapAction="" style="rpc"/> - <wsdl:input name="addPublicacion"> - <soap:body namespace="http://soap.ws.tse.fing.edu.uy/" use="literal"/> - </wsdl:input> - </wsdl:operation> - </wsdl:binding> - <wsdl:service name="SoapAPIService"> - <wsdl:port binding="tns:SoapAPIServiceSoapBinding" name="APIPort"> - <soap:address location="http://localhost:8080/practico-api/SoapAPI"/> - </wsdl:port> - </wsdl:service> -</wsdl:definitions>]]></con:content> - <con:type>http://schemas.xmlsoap.org/wsdl/</con:type> - </con:part> - </con:definitionCache> - <con:endpoints> - <con:endpoint>http://localhost:8080/practico-api/SoapAPI</con:endpoint> - </con:endpoints> - <con:operation id="1f3552e6-5141-4cb5-872d-100142f636e6" isOneWay="false" action="" name="addPublicacion" - bindingOperationName="addPublicacion" type="One-Way" inputName="addPublicacion" - sendsAttachments="false" anonymous="optional"> - <con:settings/> - <con:call id="03c9de75-7570-4189-9db9-5bebdf72fef3" name="Request 1"> - <con:settings/> - <con:encoding>UTF-8</con:encoding> - <con:endpoint>http://localhost:8080/practico-api/SoapAPI</con:endpoint> - <con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.ws.tse.fing.edu.uy/">\r - <soapenv:Header/>\r - <soapenv:Body>\r - <soap:addPublicacion>\r - <tipo>?</tipo>\r - <url>?</url>\r - <idNoticia>?</idNoticia>\r - </soap:addPublicacion>\r - </soapenv:Body>\r -</soapenv:Envelope>]]></con:request> - <con:wsaConfig mustUnderstand="NONE" version="200508" - action="http://soap.ws.tse.fing.edu.uy/API/addPublicacion"/> - </con:call> - </con:operation> - <con:operation id="16734cb9-e5ef-46df-bff1-938e09e09b1a" isOneWay="false" action="" name="getNoticias" - bindingOperationName="getNoticias" type="Request-Response" outputName="getNoticiasResponse" - inputName="getNoticias" receivesAttachments="false" sendsAttachments="false" - anonymous="optional"> - <con:settings/> - <con:call id="31718689-d64c-4c91-937d-5b8ddb75f8ae" name="Request 1"> - <con:settings/> - <con:encoding>UTF-8</con:encoding> - <con:endpoint>http://localhost:8080/practico-api/SoapAPI</con:endpoint> - <con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.ws.tse.fing.edu.uy/">\r - <soapenv:Header/>\r - <soapenv:Body>\r - <soap:getNoticias/>\r - </soapenv:Body>\r -</soapenv:Envelope>]]></con:request> - <con:wsaConfig mustUnderstand="NONE" version="200508" - action="http://soap.ws.tse.fing.edu.uy/API/getNoticias"/> - </con:call> - </con:operation> - <con:operation id="569dba5f-41fc-4946-ab48-986e33d3c621" isOneWay="false" action="" name="getPublicaciones" - bindingOperationName="getPublicaciones" type="Request-Response" - outputName="getPublicacionesResponse" inputName="getPublicaciones" receivesAttachments="false" - sendsAttachments="false" anonymous="optional"> - <con:settings/> - <con:call id="b197d238-991b-462e-8c8c-4880bfad35d3" name="Request 1"> - <con:settings/> - <con:encoding>UTF-8</con:encoding> - <con:endpoint>http://localhost:8080/practico-api/SoapAPI</con:endpoint> - <con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.ws.tse.fing.edu.uy/">\r - <soapenv:Header/>\r - <soapenv:Body>\r - <soap:getPublicaciones>\r - <idNoticia>?</idNoticia>\r - </soap:getPublicaciones>\r - </soapenv:Body>\r -</soapenv:Envelope>]]></con:request> - <con:wsaConfig mustUnderstand="NONE" version="200508" - action="http://soap.ws.tse.fing.edu.uy/API/getPublicaciones"/> - </con:call> - </con:operation> - </con:interface> - <con:properties/> - <con:wssContainer/> - <con:oAuth2ProfileContainer/> - <con:oAuth1ProfileContainer/> - <con:sensitiveInformation/> -</con:soapui-project> \ No newline at end of file diff --git a/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccess.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccess.java new file mode 100644 index 0000000000000000000000000000000000000000..2dd45d29bcf241071fc979f2f49cb24f28081941 --- /dev/null +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccess.java @@ -0,0 +1,6 @@ +package uy.edu.fing.tse.central.db; + +public interface DataAccess { + + void metodo(); +} diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessBean.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessBean.java similarity index 61% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessBean.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessBean.java index b03f08e353c6dfc59914d17a44a981a2754086d6..2b2dff6738cf912a4bf837047f9eceef75400a87 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessBean.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessBean.java @@ -1,17 +1,11 @@ -package uy.edu.fing.tse.practico.db; +package uy.edu.fing.tse.central.db; import javax.annotation.PostConstruct; -import javax.ejb.Local; -import javax.ejb.LocalBean; -import javax.ejb.Remote; -import javax.ejb.Singleton; +import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -@Singleton -@Local({DataAccessLocal.class}) -@Remote({DataAccessRemote.class}) -@LocalBean +@Stateless public class DataAccessBean implements DataAccessLocal, DataAccessRemote { @PersistenceContext(unitName = "central") @@ -22,4 +16,9 @@ public class DataAccessBean implements DataAccessLocal, DataAccessRemote { //Despues del constructor hace esto } + + @Override + public void metodo() { + System.out.println("asd"); + } } diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessLocal.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessLocal.java similarity index 70% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessLocal.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessLocal.java index 8af9685aabd4393aca233fef779b2e8ff0acb549..29223926c56c635c9efaf831fdbac02c702b7299 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessLocal.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessLocal.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db; +package uy.edu.fing.tse.central.db; import javax.ejb.Local; diff --git a/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessRemote.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..0d7ca2bf3c3d3d68720e04557449c0611ab65ffd --- /dev/null +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessRemote.java @@ -0,0 +1,6 @@ +package uy.edu.fing.tse.central.db; + +//@Remote +public interface DataAccessRemote extends DataAccess { + +} diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Calificacion.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Calificacion.java similarity index 93% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Calificacion.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Calificacion.java index acdb4d097fb308a6a2f782f6610abb6a79fe0a48..7a9167040073525421e90c89d865012f7e54f5c2 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Calificacion.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Calificacion.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Categoria.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Categoria.java similarity index 95% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Categoria.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Categoria.java index 8c7099bcc7931c29dea71dffb04ab204912760f2..fee53dcaed5136fb0c25ba9accde8f905ee98f10 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Categoria.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Categoria.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Estado.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Estado.java similarity index 93% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Estado.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Estado.java index 5bbd79681bd5420c407af385ec2b08e53faa9261..efd22ce88927f9c8576685c7be8570e4ed5467cf 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Estado.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Estado.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Hecho.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Hecho.java similarity index 95% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Hecho.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Hecho.java index 3cfaa62024f9190f90849ec5f36acc407b03bb38..9f843f06015815840ac90a94f9864e7e0bda7bde 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Hecho.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Hecho.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; import java.util.ArrayList; @@ -19,8 +19,7 @@ public final class Hecho { private String title; private String description; - @ManyToOne - @Column(nullable = false) + @ManyToOne(optional = false) private Estado actualState; @ManyToOne diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Mecanismo.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Mecanismo.java similarity index 94% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Mecanismo.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Mecanismo.java index 1729e0397a9d640d81bd21bc7910c53fce145124..0a53e026a2100abf3f92b32ca2687db25be18a88 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Mecanismo.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Mecanismo.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/MecanismoInterno.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/MecanismoInterno.java similarity index 68% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/MecanismoInterno.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/MecanismoInterno.java index 48adddc6f34ae7829ea8054ae0ebea34bc95d38e..b451ff7ce1e1eb68871ab6a8d4e46e583e666cd7 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/MecanismoInterno.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/MecanismoInterno.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.Entity; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Periferico.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Periferico.java similarity index 96% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Periferico.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Periferico.java index e320c728b63ad578eb43bea1304bf39806f06e77..996cef3b211514f4fbca9cb1a085a9a9287e5eae 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Periferico.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Periferico.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; import java.util.ArrayList; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Rol.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Rol.java similarity index 90% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Rol.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Rol.java index 2f0ab9b88fc670d6dedccf17eb6fb0d65380e28a..2eaa425a3649b864b3c5c54f969005a4cb032b1d 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Rol.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Rol.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/TransicionEstado.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/TransicionEstado.java similarity index 95% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/TransicionEstado.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/TransicionEstado.java index bb404bf5616080667f5c9e8a559a375d6af3ec3a..e5497fe24c945d95cae98d3234fac6b0ad99d283 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/TransicionEstado.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/TransicionEstado.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; import java.util.Date; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Usuario.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Usuario.java similarity index 92% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Usuario.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Usuario.java index c80987f584bd81d270a0bbd4b43ad109bb9d17aa..59f512cdc7bf39db698585c59c148fd09df0f0e0 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Usuario.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Usuario.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioBO.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioBO.java similarity index 94% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioBO.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioBO.java index c1d5cfbb00e8598952f4715e44f16527a8a06e01..6d7cbb05314c1711928f0679570c77a8c9f5bcbc 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioBO.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioBO.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioFO.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioFO.java similarity index 66% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioFO.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioFO.java index a99a7b49d774f13c8e946853c1c55e03bebe6737..a3918ee65142136f1159d193c82cf5f0588a1136 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioFO.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioFO.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.Entity; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionChecker.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionChecker.java similarity index 88% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionChecker.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionChecker.java index acfb4205b99e378dd111202019c77e5986dec48b..4439d23e1431932322cdaee8957f8ef48dec931d 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionChecker.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionChecker.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; @@ -9,12 +9,10 @@ public class VerificacionChecker { @GeneratedValue(strategy = GenerationType.AUTO) private Long id; - @ManyToOne - @Column(nullable = false) + @ManyToOne(optional = false) private UsuarioBO checker; - @ManyToOne - @Column(nullable = false) + @ManyToOne(optional = false) private Hecho fact; @Column(nullable = false) diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionMecanismo.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionMecanismo.java similarity index 90% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionMecanismo.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionMecanismo.java index d1c1e386347b60b7cca3bb29b8f25123f9727c51..0ac4dfa0379e3772fe25d38749a85de59dc3ca55 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionMecanismo.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionMecanismo.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; import java.util.Date; @@ -10,12 +10,10 @@ public class VerificacionMecanismo { @GeneratedValue(strategy = GenerationType.AUTO) private Long id; - @ManyToOne - @Column(nullable = false) + @ManyToOne(optional = false) private Periferico peripheral; - @ManyToOne - @Column(nullable = false) + @ManyToOne(optional = false) private Hecho fact; @Column(nullable = false) diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/mapper/MyMapper.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/mapper/MyMapper.java similarity index 94% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/mapper/MyMapper.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/mapper/MyMapper.java index 59e05fc74a9b905c2ee8f7957af7b6eb6cb55fe9..b164d083c9a5ff6206cd4a74959c050bf2b11c37 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/mapper/MyMapper.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/mapper/MyMapper.java @@ -1,9 +1,9 @@ -package uy.edu.fing.tse.practico.db.mapper; +package uy.edu.fing.tse.central.db.mapper; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; +import uy.edu.fing.tse.central.db.entity.*; import uy.edu.fing.tse.dto.*; -import uy.edu.fing.tse.practico.db.entity.*; import java.util.List; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/startup/Config.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/startup/Config.java similarity index 69% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/startup/Config.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/startup/Config.java index c14edb1e951fddc9c640d5803052388d0087e845..4415d904a53f84cf68e44e28485ac0bb5541e734 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/startup/Config.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/startup/Config.java @@ -1,6 +1,6 @@ -package uy.edu.fing.tse.practico.db.startup; +package uy.edu.fing.tse.central.db.startup; -import uy.edu.fing.tse.practico.db.DataAccessBean; +import uy.edu.fing.tse.central.db.DataAccessLocal; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; @@ -13,7 +13,7 @@ import javax.ejb.Startup; public class Config { @EJB - private DataAccessBean dataAccess; + private DataAccessLocal dataAccess; @PostConstruct public void start() { diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccess.java b/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccess.java deleted file mode 100644 index b60074db2c032f9b17f278da5dda8006ad8dfb7f..0000000000000000000000000000000000000000 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccess.java +++ /dev/null @@ -1,6 +0,0 @@ -package uy.edu.fing.tse.practico.db; - -public interface DataAccess { - - -} diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessRemote.java b/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessRemote.java deleted file mode 100644 index ede5aaab97ca5641c2417f80d7e6c7e981c00eb2..0000000000000000000000000000000000000000 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessRemote.java +++ /dev/null @@ -1,8 +0,0 @@ -package uy.edu.fing.tse.practico.db; - -import javax.ejb.Remote; - -@Remote -public interface DataAccessRemote extends DataAccess { - -} diff --git a/central-db/src/main/resources/META-INF/persistence.xml b/central-db/src/main/resources/META-INF/persistence.xml index 002cb41844b347ad4d3d2c0bf99a687b59e82a0b..cf1d2734eedf4b6ab09dbf199423d62ae5364b7b 100644 --- a/central-db/src/main/resources/META-INF/persistence.xml +++ b/central-db/src/main/resources/META-INF/persistence.xml @@ -5,7 +5,7 @@ xsi:schemaLocation=" http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> - <persistence-unit name="practico"> + <persistence-unit name="central"> <!--OpenShift--> <jta-data-source>java:jboss/datasources/centralDS</jta-data-source> <!--Local--> diff --git a/central-db/src/test/java/uy/edu/fing/tse/practico/db/mapper/MyMapperTest.java b/central-db/src/test/java/uy/edu/fing/tse/central/db/mapper/MyMapperTest.java similarity index 97% rename from central-db/src/test/java/uy/edu/fing/tse/practico/db/mapper/MyMapperTest.java rename to central-db/src/test/java/uy/edu/fing/tse/central/db/mapper/MyMapperTest.java index 1f4e4eae9bb55d212c243a22a0c8498fbd7735b4..a38e2e09864ae86b8277476103362241bd21288c 100644 --- a/central-db/src/test/java/uy/edu/fing/tse/practico/db/mapper/MyMapperTest.java +++ b/central-db/src/test/java/uy/edu/fing/tse/central/db/mapper/MyMapperTest.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.mapper; +package uy.edu.fing.tse.central.db.mapper; import org.junit.Assert; import org.junit.Test; diff --git a/central-ear/src/main/application/META-INF/practico-ds.xml b/central-ear/src/main/application/META-INF/central-ds.xml similarity index 94% rename from central-ear/src/main/application/META-INF/practico-ds.xml rename to central-ear/src/main/application/META-INF/central-ds.xml index 9492e36123cc639e3f1c28039c40778f403a7d10..96a473fd0b38cddefa45ea48c953e9200a7520bc 100644 --- a/central-ear/src/main/application/META-INF/practico-ds.xml +++ b/central-ear/src/main/application/META-INF/central-ds.xml @@ -4,8 +4,7 @@ xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd"> <!-- The datasource is bound into JNDI at this location. We reference this in META-INF/persistence.xml --> - <datasource jndi-name="java:jboss/datasources/centralDS" pool-name="central" - enabled="true" use-java-context="true"> + <datasource jndi-name="java:jboss/datasources/centralDS" pool-name="central" enabled="true" use-java-context="true"> <connection-url>jdbc:h2:file:./central</connection-url> <driver>h2</driver> <security> @@ -13,6 +12,7 @@ <password>sa</password> </security> </datasource> + <!--https://data.heroku.com/datastores/30b15fdc-4667-493f-b244-cdfea47f071f#administration--> <datasource jndi-name="java:jboss/datasources/herokuDS" pool-name="heroku" enabled="true" use-java-context="true"> <connection-url>jdbc:postgresql://ec2-23-23-92-204.compute-1.amazonaws.com:5432/dd1clqkconunk4</connection-url> diff --git a/central-ear/src/main/application/META-INF/jboss-deployment-descriptor.xml b/central-ear/src/main/application/META-INF/jboss-deployment-descriptor.xml index 5a0fce3aed14a0c003819a674b6c6ca00bf27c44..713e8084ca00b6142647c1c49fe9b76ad121f789 100644 --- a/central-ear/src/main/application/META-INF/jboss-deployment-descriptor.xml +++ b/central-ear/src/main/application/META-INF/jboss-deployment-descriptor.xml @@ -1,11 +1,11 @@ <jboss> <enterprise-beans> <service> - <ejb-class>uy.edu.fing.tse.practico.business.BusinessBean</ejb-class> - <local>uy.edu.fing.tse.practico.business.BusinessLocal</local> - <remote>uy.edu.fing.tse.practico.business.BusinessRemote</remote> - <jndi-name>practico/remote</jndi-name> - <local-jndi-name>practico/local</local-jndi-name> + <ejb-class>uy.edu.fing.tse.central.business.BusinessBean</ejb-class> + <local>uy.edu.fing.tse.central.business.BusinessLocal</local> + <remote>uy.edu.fing.tse.central.business.BusinessRemote</remote> + <jndi-name>central-ear/remote</jndi-name> + <local-jndi-name>central-ear/local</local-jndi-name> </service> </enterprise-beans> </jboss> \ No newline at end of file diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/Business.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/Business.java similarity index 83% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/Business.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/Business.java index 3a650f5f18a79de35aba6d3b1961cff80c19ce14..97909c83f2c8aa24df8a99eb162c5edd1a9f1da7 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/Business.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/Business.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business; +package uy.edu.fing.tse.central.business; import uy.edu.fing.tse.dto.CheckMechanism; diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessBean.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessBean.java similarity index 66% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessBean.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessBean.java index b3d2c3f43535aec7e695ccae168d4935b81d98d0..d150c47df83e2977b05e935d602c7f2915cf646f 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessBean.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessBean.java @@ -1,21 +1,19 @@ -package uy.edu.fing.tse.practico.business; +package uy.edu.fing.tse.central.business; +import uy.edu.fing.tse.central.db.DataAccessLocal; import uy.edu.fing.tse.dto.CheckMechanism; import uy.edu.fing.tse.dto.Peripherical; -import uy.edu.fing.tse.practico.db.DataAccessBean; import javax.annotation.PostConstruct; -import javax.ejb.*; +import javax.ejb.EJB; +import javax.ejb.Stateless; @Stateless -@Local({BusinessLocal.class}) -@Remote({BusinessRemote.class}) -@LocalBean public class BusinessBean implements BusinessLocal, BusinessRemote { @EJB - private DataAccessBean dataAccess; + private DataAccessLocal dataAccess; @PostConstruct void init() { diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessLocal.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessLocal.java similarity index 66% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessLocal.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessLocal.java index af4e40371cb8c068dd02f052acc1ff53a5061922..20bac99ba5c3804b881c7000cf4c336e478bd9c7 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessLocal.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessLocal.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business; +package uy.edu.fing.tse.central.business; import javax.ejb.Local; diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessRemote.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..33b5bf8df50eb313a9ecd7de57ba13b3aca58436 --- /dev/null +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessRemote.java @@ -0,0 +1,5 @@ +package uy.edu.fing.tse.central.business; + +//@Remote +public interface BusinessRemote extends Business { +} diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/common/Propiedades.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/common/Propiedades.java similarity index 97% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/common/Propiedades.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/common/Propiedades.java index a0b19d5f5d7ad9225a636679e660543c4ab18f63..8c87788d9adeb83c73b31799ca1e1b67a63246ee 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/common/Propiedades.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/common/Propiedades.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business.common; +package uy.edu.fing.tse.central.business.common; import java.io.File; import java.io.FileInputStream; diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageConsumer.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageConsumer.java similarity index 95% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageConsumer.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageConsumer.java index fc6a8fe05fb431574ee880c3e781bf69b9cca1b8..f1fdd9af983e76d0afa46884a95be7d6c94fc6f2 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageConsumer.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageConsumer.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business.mq; +package uy.edu.fing.tse.central.business.mq; import com.fasterxml.jackson.databind.ObjectMapper; import com.rabbitmq.client.AMQP; @@ -7,9 +7,9 @@ import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.Envelope; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import uy.edu.fing.tse.central.business.BusinessLocal; import uy.edu.fing.tse.dto.CheckMechanism; import uy.edu.fing.tse.dto.Peripherical; -import uy.edu.fing.tse.practico.business.BusinessBean; import javax.annotation.PostConstruct; import javax.ejb.EJB; @@ -27,7 +27,7 @@ public class MessageConsumer { private Channel channel; @EJB - private BusinessBean negocio; + private BusinessLocal negocio; @PostConstruct public void init() { diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageProducer.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageProducer.java similarity index 95% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageProducer.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageProducer.java index cc264e1dddb0d67a82b527f731ccea6371b4c6ab..db1b550d63cd303b720063cc1a2da48e378b8ac5 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageProducer.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageProducer.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business.mq; +package uy.edu.fing.tse.central.business.mq; import com.fasterxml.jackson.databind.ObjectMapper; import com.rabbitmq.client.Channel; diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/Queue.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/Queue.java similarity index 89% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/Queue.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/Queue.java index f5f1daea43e905d88ff05745dab0f2aac45e122d..db14dee6eaecf538dcfde61212b4fb982340527f 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/Queue.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/Queue.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business.mq; +package uy.edu.fing.tse.central.business.mq; public enum Queue { REQUEST("request"), diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/RabbitConfig.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/RabbitConfig.java similarity index 92% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/RabbitConfig.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/RabbitConfig.java index f7bc956ffe06035356418d20dd3f8c7bc24edf67..222443fb13e3e62e512dfbf70d2688cbac7be0da 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/RabbitConfig.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/RabbitConfig.java @@ -1,9 +1,9 @@ -package uy.edu.fing.tse.practico.business.mq; +package uy.edu.fing.tse.central.business.mq; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; -import uy.edu.fing.tse.practico.business.common.Propiedades; +import uy.edu.fing.tse.central.business.common.Propiedades; import java.io.IOException; import java.util.concurrent.TimeoutException; diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessRemote.java b/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessRemote.java deleted file mode 100644 index 735cb9db435f154d90c8c88ddbc260d80a6443c2..0000000000000000000000000000000000000000 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessRemote.java +++ /dev/null @@ -1,7 +0,0 @@ -package uy.edu.fing.tse.practico.business; - -import javax.ejb.Remote; - -@Remote -public interface BusinessRemote extends Business { -} diff --git a/pom.xml b/pom.xml index d907081fafca8843e7b5a2d564029f86023ed9f1..ab3e01014ded050165debebb3d622b8212be9f1c 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ <module>central-db</module> <module>central-ejb</module> <module>central-ear</module> - <!-- <module>backoffice</module>--> + <module>backoffice</module> </modules> <properties> @@ -193,10 +193,11 @@ <dependency> <groupId>org.jboss.spec.javax.faces</groupId> - <artifactId>jboss-jsf-api_2.2_spec</artifactId> - <version>2.2.14</version> + <artifactId>jboss-jsf-api_2.3_spec</artifactId> + <version>2.3.9.SP02</version> </dependency> + <dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId>