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 | 12 | import java.util.regex.Pattern; |
13 | 13 | |
14 | 14 | import javax.servlet.ServletContext; |
15 | +import javax.swing.text.StyledEditorKit.BoldAction; | |
15 | 16 | |
16 | 17 | import org.apache.jasper.tagplugins.jstl.core.ForEach; |
17 | 18 | |
... | ... | @@ -39,18 +40,22 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ |
39 | 40 | |
40 | 41 | //private static String CSS_VALIDATOR_URL = "http://www.css-validator.org/validator?uri=#{url}&warning=0&output=soap12"; |
41 | 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 | 46 | public Nota obterNota(List<SummarizedOccurrence> occurrences,String url) { |
45 | 47 | Nota nota = null; |
46 | 48 | try { |
47 | 49 | |
50 | + | |
51 | + | |
48 | 52 | WebChecker.PostParams postParams = WebChecker.from(this.eseloProperties.getUrl("url")).withPostRequest(); |
49 | 53 | |
50 | 54 | //Relatorio de Avaliacao |
51 | 55 | postParams.addParam("relatorioAvaliacao.date", new Date().toString()) |
52 | 56 | .addParam("relatorioAvaliacao.url", url); |
53 | - | |
57 | + | |
58 | + | |
54 | 59 | TreeSet<Integer> rns = new TreeSet<Integer>(); |
55 | 60 | |
56 | 61 | for(SummarizedOccurrence occurence : occurrences){ |
... | ... | @@ -65,6 +70,8 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ |
65 | 70 | for(Integer rn : rns){ |
66 | 71 | //Recomenda��o Avaliada |
67 | 72 | postParams.addParam("relatorioAvaliacao.recomendacoes["+countReq+"].idRecomendacao", Integer.toString(rn)); |
73 | + | |
74 | + | |
68 | 75 | int qtdErros = 0; |
69 | 76 | |
70 | 77 | |
... | ... | @@ -80,9 +87,10 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ |
80 | 87 | if(rn == Integer.parseInt(idRec[0])){ |
81 | 88 | qtdErros = qtdErros + Integer.parseInt(occurence.isError()?occurence.getNumberOfOccurrences():"0"); |
82 | 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 | 91 | .addParam("relatorioAvaliacao.recomendacoes["+countReq+"].criterios["+countCriterio+"].qtdeItens", Integer.toString(occurence.getLines().size())); |
85 | - | |
92 | + | |
93 | + | |
86 | 94 | }else countCriterio = 0; |
87 | 95 | |
88 | 96 | countCriterio++; |
... | ... | @@ -90,16 +98,17 @@ public class AvaliacaoBusinessImpl implements AvaliacaoBusiness{ |
90 | 98 | |
91 | 99 | postParams.addParam("relatorioAvaliacao.recomendacoes["+countReq+"].totalErros", Integer.toString(qtdErros)); |
92 | 100 | //postParams.addParam("relatorioAvaliacao.qtdeLinhas", Integer.toString(qtdLinhas)); |
93 | - countReq++; | |
101 | + countReq++; | |
94 | 102 | |
95 | - | |
96 | 103 | } |
97 | 104 | |
98 | 105 | postParams.addParam("relatorioAvaliacao.qtdeLinhas", Integer.toString(qtdLinhas)); |
99 | 106 | |
100 | 107 | Gson g = new GsonBuilder().create(); |
101 | 108 | nota = g.fromJson(postParams.execute().getContent(), Nota.class); |
102 | - | |
109 | + | |
110 | + | |
111 | + | |
103 | 112 | }catch(Exception e){ |
104 | 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 | 103 | <c:if test="${fn:contains(aReqIsCss, req)}"> |
104 | 104 | <a |
105 | 105 | href=" http://jigsaw.w3.org/css-validator/validator?uri=${url}" |
106 | - target="_blanck"> | |
106 | + target="_blank"> | |
107 | 107 | Serviço de validação de CSS do W3C (link para um novo sitio) |
108 | 108 | </a> |
109 | 109 | </c:if> |
110 | 110 | |
111 | 111 | <c:if test="${!fn:contains(aReqIsCss, req)}"> |
112 | 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 | 115 | Serviço de validação de HTML do W3C (link para um novo sitio) |
116 | 116 | </a> |
117 | 117 | </c:if> | ... | ... |