Commit 9360fafb40ff44212507ea840dac40827df0ee38
1 parent
2a5ac236
Exists in
master
and in
1 other branch
Feito correção na classe AvaliacaoBusinesImpl.java e na página detalhesAvaliacao.jsp
git-svn-id: https://svn.bento.ifrs.edu.br/default/ASES/ASES%20-%20Web/ASES%20-%20Web/Fontes/avaliador-web@10691 c2178572-b5ca-4887-91d2-9e3a90c7d55b
Showing
3 changed files
with
20 additions
and
11 deletions
Show diff stats
src/main/java/br/com/ases/business/impl/AvaliacaoBusinessImpl.java
@@ -12,6 +12,7 @@ import java.util.regex.Matcher; | @@ -12,6 +12,7 @@ import java.util.regex.Matcher; | ||
12 | import java.util.regex.Pattern; | 12 | import java.util.regex.Pattern; |
13 | 13 | ||
14 | import javax.servlet.ServletContext; | 14 | import javax.servlet.ServletContext; |
15 | +import javax.swing.text.StyledEditorKit.BoldAction; | ||
15 | 16 | ||
16 | import org.apache.jasper.tagplugins.jstl.core.ForEach; | 17 | import org.apache.jasper.tagplugins.jstl.core.ForEach; |
17 | 18 | ||
@@ -39,18 +40,22 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ | @@ -39,18 +40,22 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ | ||
39 | 40 | ||
40 | //private static String CSS_VALIDATOR_URL = "http://www.css-validator.org/validator?uri=#{url}&warning=0&output=soap12"; | 41 | //private static String CSS_VALIDATOR_URL = "http://www.css-validator.org/validator?uri=#{url}&warning=0&output=soap12"; |
41 | private static String CSS_VALIDATOR_URL = "http://jigsaw.w3.org/css-validator/validator?uri=#{url}&warning=0&output=soap12"; | 42 | private static String CSS_VALIDATOR_URL = "http://jigsaw.w3.org/css-validator/validator?uri=#{url}&warning=0&output=soap12"; |
42 | - private static String HTML_VALIDATOR_URL = "https://validator.w3.org/nu/?doc=#{url}&out=json"; | 43 | + //private static String HTML_VALIDATOR_URL = "https://validator.w3.org/nu/?doc=#{url}&out=json"; |
44 | + private static String HTML_VALIDATOR_URL = "https://validator.w3.org/check?uri=#{url}&output=json"; | ||
43 | 45 | ||
44 | public Nota obterNota(List<SummarizedOccurrence> occurrences,String url) { | 46 | public Nota obterNota(List<SummarizedOccurrence> occurrences,String url) { |
45 | Nota nota = null; | 47 | Nota nota = null; |
46 | try { | 48 | try { |
47 | 49 | ||
50 | + | ||
51 | + | ||
48 | WebChecker.PostParams postParams = WebChecker.from(this.eseloProperties.getUrl("url")).withPostRequest(); | 52 | WebChecker.PostParams postParams = WebChecker.from(this.eseloProperties.getUrl("url")).withPostRequest(); |
49 | 53 | ||
50 | //Relatorio de Avaliacao | 54 | //Relatorio de Avaliacao |
51 | postParams.addParam("relatorioAvaliacao.date", new Date().toString()) | 55 | postParams.addParam("relatorioAvaliacao.date", new Date().toString()) |
52 | .addParam("relatorioAvaliacao.url", url); | 56 | .addParam("relatorioAvaliacao.url", url); |
53 | - | 57 | + |
58 | + | ||
54 | TreeSet<Integer> rns = new TreeSet<Integer>(); | 59 | TreeSet<Integer> rns = new TreeSet<Integer>(); |
55 | 60 | ||
56 | for(SummarizedOccurrence occurence : occurrences){ | 61 | for(SummarizedOccurrence occurence : occurrences){ |
@@ -65,6 +70,8 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ | @@ -65,6 +70,8 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ | ||
65 | for(Integer rn : rns){ | 70 | for(Integer rn : rns){ |
66 | //Recomenda��o Avaliada | 71 | //Recomenda��o Avaliada |
67 | postParams.addParam("relatorioAvaliacao.recomendacoes["+countReq+"].idRecomendacao", Integer.toString(rn)); | 72 | postParams.addParam("relatorioAvaliacao.recomendacoes["+countReq+"].idRecomendacao", Integer.toString(rn)); |
73 | + | ||
74 | + | ||
68 | int qtdErros = 0; | 75 | int qtdErros = 0; |
69 | 76 | ||
70 | 77 | ||
@@ -80,9 +87,10 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ | @@ -80,9 +87,10 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ | ||
80 | if(rn == Integer.parseInt(idRec[0])){ | 87 | if(rn == Integer.parseInt(idRec[0])){ |
81 | qtdErros = qtdErros + Integer.parseInt(occurence.isError()?occurence.getNumberOfOccurrences():"0"); | 88 | qtdErros = qtdErros + Integer.parseInt(occurence.isError()?occurence.getNumberOfOccurrences():"0"); |
82 | postParams.addParam("relatorioAvaliacao.recomendacoes["+countReq+"].criterios["+countCriterio+"].idCriterio",idRec[1]) | 89 | postParams.addParam("relatorioAvaliacao.recomendacoes["+countReq+"].criterios["+countCriterio+"].idCriterio",idRec[1]) |
83 | - .addParam("relatorioAvaliacao.recomendacoes["+countReq+"].criterios["+countCriterio+"].qtdeErros",occurence.isError()?occurence.getNumberOfOccurrences():"0") | 90 | + .addParam("relatorioAvaliacao.recomendacoes["+countReq+"].criterios["+countCriterio+"].qtdeErros", occurence.isError()?occurence.getNumberOfOccurrences():"0") |
84 | .addParam("relatorioAvaliacao.recomendacoes["+countReq+"].criterios["+countCriterio+"].qtdeItens", Integer.toString(occurence.getLines().size())); | 91 | .addParam("relatorioAvaliacao.recomendacoes["+countReq+"].criterios["+countCriterio+"].qtdeItens", Integer.toString(occurence.getLines().size())); |
85 | - | 92 | + |
93 | + | ||
86 | }else countCriterio = 0; | 94 | }else countCriterio = 0; |
87 | 95 | ||
88 | countCriterio++; | 96 | countCriterio++; |
@@ -90,16 +98,17 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ | @@ -90,16 +98,17 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ | ||
90 | 98 | ||
91 | postParams.addParam("relatorioAvaliacao.recomendacoes["+countReq+"].totalErros", Integer.toString(qtdErros)); | 99 | postParams.addParam("relatorioAvaliacao.recomendacoes["+countReq+"].totalErros", Integer.toString(qtdErros)); |
92 | //postParams.addParam("relatorioAvaliacao.qtdeLinhas", Integer.toString(qtdLinhas)); | 100 | //postParams.addParam("relatorioAvaliacao.qtdeLinhas", Integer.toString(qtdLinhas)); |
93 | - countReq++; | 101 | + countReq++; |
94 | 102 | ||
95 | - | ||
96 | } | 103 | } |
97 | 104 | ||
98 | postParams.addParam("relatorioAvaliacao.qtdeLinhas", Integer.toString(qtdLinhas)); | 105 | postParams.addParam("relatorioAvaliacao.qtdeLinhas", Integer.toString(qtdLinhas)); |
99 | 106 | ||
100 | Gson g = new GsonBuilder().create(); | 107 | Gson g = new GsonBuilder().create(); |
101 | nota = g.fromJson(postParams.execute().getContent(), Nota.class); | 108 | nota = g.fromJson(postParams.execute().getContent(), Nota.class); |
102 | - | 109 | + |
110 | + | ||
111 | + | ||
103 | }catch(Exception e){ | 112 | }catch(Exception e){ |
104 | nota = new EseloController(null).new Nota(url, "---" , "0.0"); | 113 | nota = new EseloController(null).new Nota(url, "---" , "0.0"); |
105 | 114 |
src/main/webapp/WEB-INF/jsp/avaliacao/detalhesAvaliacao.jsp
@@ -103,15 +103,15 @@ | @@ -103,15 +103,15 @@ | ||
103 | <c:if test="${fn:contains(aReqIsCss, req)}"> | 103 | <c:if test="${fn:contains(aReqIsCss, req)}"> |
104 | <a | 104 | <a |
105 | href=" http://jigsaw.w3.org/css-validator/validator?uri=${url}" | 105 | href=" http://jigsaw.w3.org/css-validator/validator?uri=${url}" |
106 | - target="_blanck"> | 106 | + target="_blank"> |
107 | Serviço de validação de CSS do W3C (link para um novo sitio) | 107 | Serviço de validação de CSS do W3C (link para um novo sitio) |
108 | </a> | 108 | </a> |
109 | </c:if> | 109 | </c:if> |
110 | 110 | ||
111 | <c:if test="${!fn:contains(aReqIsCss, req)}"> | 111 | <c:if test="${!fn:contains(aReqIsCss, req)}"> |
112 | <a | 112 | <a |
113 | - href="https://validator.w3.org/nu/?doc=http%3A%2F%2F${url}" | ||
114 | - target="_blanck"> | 113 | + href="http://validator.w3.org/check?uri=http%3A%2F%2F${url}" |
114 | + target="_blank"> | ||
115 | Serviço de validação de HTML do W3C (link para um novo sitio) | 115 | Serviço de validação de HTML do W3C (link para um novo sitio) |
116 | </a> | 116 | </a> |
117 | </c:if> | 117 | </c:if> |
target/m2e-wtp/web-resources/META-INF/maven/br.com.ases/ases/pom.properties