Commit 1f6d435fe06cafd6d865b95cc6628996ff4b571f

Authored by rogerio.costa
1 parent f13dc9e1
Exists in master

#268 Pesquisar Documentos e Processos

cit-ecm-api/pom.xml
... ... @@ -90,6 +90,11 @@
90 90 <groupId>com.googlecode.json-simple</groupId>
91 91 <artifactId>json-simple</artifactId>
92 92 <version>1.1</version>
  93 + </dependency>
  94 + <dependency>
  95 + <groupId>org.jsoup</groupId>
  96 + <artifactId>jsoup</artifactId>
  97 + <version>1.8.3</version>
93 98 </dependency>
94 99 </dependencies>
95 100 </project>
... ...
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/AnexoGedServiceImpl.java
... ... @@ -105,9 +105,9 @@ public class AnexoGedServiceImpl extends GenericServiceImpl&lt;AnexoGed, Long&gt; impl
105 105  
106 106 // FAZ OCR DO DOCUMENTO ANEXADO E JÁ MANDA PARA INDEXAÇÃO
107 107  
108   -// documentoGed.setConteudo(this.gedFileService.doOcr(anexo));
  108 + documentoGed.setConteudo(this.gedFileService.doOcr(anexo));
109 109  
110   -// this.solrService.addDocumento(documentoGed);
  110 + this.solrService.addDocumento(documentoGed);
111 111  
112 112 anexo.setDocumentoGed(documentoGed);
113 113  
... ...
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/DocumentoGedServiceImpl.java
... ... @@ -222,8 +222,11 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
222 222 private void saveSolr(DocumentoGed entity) {
223 223  
224 224 try {
  225 + // Verifica se o documento é sigiloso
  226 + if (!UtilObjeto.isReferencia(entity.getSigilo())) {
225 227  
226   -// this.solrService.addDocumento(entity);
  228 + this.solrService.addDocumento(entity);
  229 + }
227 230  
228 231 } catch (Exception e) {
229 232  
... ... @@ -572,7 +575,7 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
572 575  
573 576 this.validarEntidade(entity, this.validator);
574 577 AnexoGed anexo = null;
575   -
  578 +
576 579 if (entity.getAnexo() != null) {
577 580 anexo = this.anexoGedService.getReference(entity.getAnexo().getId());
578 581 }
... ... @@ -595,7 +598,7 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
595 598  
596 599 entity.setConteudo(this.decrypted(entity.getConteudoCriptografado()));
597 600  
598   - // this.saveSolr(entity);
  601 + this.saveSolr(entity);
599 602  
600 603 try {
601 604 if (anexo != null) {
... ... @@ -839,11 +842,10 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
839 842 */
840 843 private void vincularAnexo(DocumentoGed documentoGedOrigem, Processo processoDestinoAnexo, Processo processoOrigem) {
841 844  
842   -/* Processo processoDestinoAnexo = this.processoService.getReference(anexarProcessoVH.getProcesso().getId());*/
  845 + /* Processo processoDestinoAnexo = this.processoService.getReference(anexarProcessoVH.getProcesso().getId()); */
843 846  
844 847 AnexoGed anexoDocumentoOrigem = null;
845 848  
846   -
847 849 DocumentoGed documentoGed = new DocumentoGed();
848 850  
849 851 documentoGed = documentoGedOrigem.clone();
... ... @@ -857,26 +859,26 @@ public class DocumentoGedServiceImpl extends GenericServiceImpl&lt;DocumentoGed, Lo
857 859  
858 860 documentoGed.setInteressados(new LinkedList<InteressadoDocumento>());
859 861  
860   - //Monta os dados do novo interessado para o novo documento.
861   - for(InteressadoDocumento interessadoDocumento : documentoGedOrigem.getInteressados()){
862   -
  862 + // Monta os dados do novo interessado para o novo documento.
  863 + for (InteressadoDocumento interessadoDocumento : documentoGedOrigem.getInteressados()) {
  864 +
863 865 InteressadoDocumento interessadoDocumentoDestino = new InteressadoDocumento();
864 866 interessadoDocumentoDestino.setInteressado(interessadoDocumento.getInteressado());
865 867 interessadoDocumentoDestino.setDocumentoGed(documentoGed);
866 868 documentoGed.getInteressados().add(interessadoDocumentoDestino);
867 869 }
868   -
  870 +
869 871 }
870 872  
871 873 documentoGed = super.save(documentoGed);
872 874  
873 875 if (documentoGedOrigem.getFormaCriacao() != null && !documentoGedOrigem.getFormaCriacao().getCodigo().equals(1L)) {
874   -
  876 +
875 877 if (documentoGedOrigem.getAnexo() != null) {
876 878 anexoDocumentoOrigem = this.anexoGedService.getReference(documentoGedOrigem.getAnexo().getId());
877 879 }
878 880 }
879   -
  881 +
880 882 try {
881 883 if (anexoDocumentoOrigem != null) {
882 884 File file = this.gedFileService.restoreFile(anexoDocumentoOrigem);
... ...
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/ProcessoServiceImpl.java
... ... @@ -166,13 +166,8 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
166 166 this.gerarNUP(processo);
167 167 }
168 168  
169   - try {
170   -
171   - this.solrService.addProcesso(processo);
172   - } catch (final Exception e) {
  169 + this.saveSolr(processo);
173 170  
174   - e.printStackTrace();
175   - }
176 171 if (entity.getSigilo() == null) {
177 172 this.startBusinessProcess(processo);
178 173 }
... ... @@ -181,6 +176,36 @@ public class ProcessoServiceImpl extends GenericServiceImpl&lt;Processo, Long&gt; impl
181 176 }
182 177  
183 178 /**
  179 + * <p>
  180 + * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
  181 + * </p>
  182 + *
  183 + * <p>
  184 + * <b>Regra(s) de negócio:</b> <a href="LINK_PORTAL">NUMERO_REGRA_DE_NEGOCIO</a>
  185 + * </p>
  186 + *
  187 + * Método responsável por indexar processo
  188 + *
  189 + * @author rogerio.costa
  190 + *
  191 + * @param processo
  192 + */
  193 + private void saveSolr(Processo processo) {
  194 +
  195 + try {
  196 +
  197 + if (!UtilObjeto.isReferencia(processo.getSigilo())) {
  198 +
  199 + this.solrService.addProcesso(processo);
  200 + }
  201 +
  202 + } catch (final Exception e) {
  203 +
  204 + e.printStackTrace();
  205 + }
  206 + }
  207 +
  208 + /**
184 209 *
185 210 * <p>
186 211 * <b>Iniciativa(s):</b> <a href="LINK_PORTAL">NUMERO_INICIATIVA</a>
... ...
cit-ecm-api/src/main/java/br/com/centralit/api/service/impl/SolrServiceImpl.java
... ... @@ -7,12 +7,14 @@ import org.apache.solr.client.solrj.SolrClient;
7 7 import org.apache.solr.client.solrj.SolrServerException;
8 8 import org.apache.solr.client.solrj.impl.HttpSolrClient;
9 9 import org.apache.solr.common.SolrInputDocument;
  10 +import org.jsoup.Jsoup;
10 11 import org.springframework.beans.factory.annotation.Value;
11 12 import org.springframework.stereotype.Service;
12 13  
13 14 import br.com.centralit.api.model.DocumentoGed;
14 15 import br.com.centralit.api.model.Processo;
15 16 import br.com.centralit.api.service.SolrService;
  17 +import br.com.centralit.framework.util.UtilObjeto;
16 18  
17 19 /**
18 20 * <p>
... ... @@ -87,7 +89,6 @@ public class SolrServiceImpl implements SolrService {
87 89 processoDoc.setField("unidadeGeradora", processo.getUnidade().getNome());
88 90 processoDoc.setField("dataCriacao", out.format(processo.getDataCriacao().getTime()));
89 91 processoDoc.setField("situacao", "");
90   -
91 92 processoDoc.setField("nivelAcesso", processo.getNivelAcesso().getNivelAcesso().getDescricao());
92 93 processoDoc.setField("formatoDocumento", "");
93 94  
... ... @@ -108,31 +109,33 @@ public class SolrServiceImpl implements SolrService {
108 109 SolrClient solrClient = new HttpSolrClient(solrServer);
109 110  
110 111 // Add some example docs
111   - SolrInputDocument processoDoc = new SolrInputDocument();
  112 + SolrInputDocument documentoDoc = new SolrInputDocument();
112 113  
113 114 StringBuilder sb = new StringBuilder();
114 115  
115 116 sb.append("doc_").append(documentoGed.getIdRaiz() != null ? documentoGed.getIdRaiz() : documentoGed.getId());
116 117  
117   - processoDoc.setField("id", "doc_" + sb.toString());
118   - processoDoc.setField("nup", documentoGed.getNumero());
119   - processoDoc.setField("objeto", "Documento");
120   - processoDoc.setField("tipoProcesso", "");
121   - processoDoc.setField("tipoDocumento", documentoGed.getTipoDocumento().getNome());
122   - processoDoc.setField("assunto", documentoGed.getPlanoClassificacao().getNome());
123   - processoDoc.setField("assuntoComplementar", documentoGed.getAssuntoComplementar());
124   - processoDoc.setField("autor", documentoGed.getAutor().getUsername());
125   - processoDoc.setField("destinatario", "");
126   - processoDoc.setField("atribuidoA", "");
127   - processoDoc.setField("unidadeGeradora", documentoGed.getUnidade().getNome());
128   - processoDoc.setField("dataCriacao", out.format(documentoGed.getDataCriacao().getTime()));
129   - processoDoc.setField("situacao", "");
130   -
131   - // processoDoc.setField("nivelAcesso", documentoGed.getNivelAcesso().getNivelAcessoDescricao());
132   - processoDoc.setField("formatoDocumento", "");
133   - processoDoc.setField("conteudo", documentoGed.getConteudo());
134   -
135   - solrClient.add(processoDoc);
  118 + documentoDoc.setField("id", "doc_" + sb.toString());
  119 + documentoDoc.setField("nup", documentoGed.getNumero());
  120 + documentoDoc.setField("objeto", "Documento");
  121 + documentoDoc.setField("tipoDocumento", documentoGed.getTipoDocumento().getNome());
  122 + documentoDoc.setField("assunto", documentoGed.getPlanoClassificacao().getNome());
  123 + documentoDoc.setField("assuntoComplementar", documentoGed.getAssuntoComplementar());
  124 + documentoDoc.setField("autor", documentoGed.getAutor().getUsername());
  125 + documentoDoc.setField("destinatario", UtilObjeto.isReferencia(documentoGed.getDestinatario()) ? documentoGed.getDestinatario().getNome() : "");
  126 + documentoDoc.setField("atribuidoA", "");
  127 + documentoDoc.setField("unidadeGeradora", documentoGed.getUnidade().getNome());
  128 + documentoDoc.setField("dataCriacao", out.format(documentoGed.getDataCriacao().getTime()));
  129 + documentoDoc.setField("situacao", "");
  130 + documentoDoc.setField("nivelAcesso", documentoGed.getNivelAcesso().getNivelAcesso().getDescricao());
  131 + documentoDoc.setField("formatoDocumento", documentoGed.getFormaCriacao().getDescricao());
  132 + //verifica se o nivel de acesso é restrito
  133 + if(!documentoGed.getNivelAcesso().getNivelAcesso().getCodigo().equals(1L)){
  134 +
  135 + documentoDoc.setField("conteudo", documentoGed.getFormaCriacao().getCodigo().equals(1L) ? Jsoup.parse(documentoGed.getConteudo()).text() : documentoGed.getConteudo());
  136 + }
  137 +
  138 + solrClient.add(documentoDoc);
136 139  
137 140 // Make the docs we just added searchable using a "hard" commit
138 141 solrClient.commit(true, true);
... ...
cit-ecm-web/src/main/java/br/com/centralit/listener/StartupListenerEcm.java
... ... @@ -402,6 +402,8 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen
402 402 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NOME_NOVO_SUPORTE ", "Nome do suporte", dominio, modulo));
403 403 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.NOVO_TIPO_SUPORTE ", "Novo tipo suporte de documento", dominio, modulo));
404 404 internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.TIPO_SUPORTE_DOCUMENTO ", "Tipo suporte de documento", dominio, modulo));
  405 + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.UNIDADE_GESTORA ", "Unidade gestora", dominio, modulo));
  406 + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.DATA_CRIACAO ", "Data criação", dominio, modulo));
405 407  
406 408  
407 409 }
... ...
cit-ecm-web/src/main/webapp/assets/css/gerenciarProcesso.css
... ... @@ -93,6 +93,13 @@
93 93 vertical-align: middle;
94 94 }
95 95  
  96 +.profile-info-label {
  97 +
  98 + font-weight: 400;
  99 + color: #667E99;
  100 + background-color: transparent;
  101 +}
  102 +
96 103 .profile-info-row:first-child .profile-info-name,.profile-info-row:first-child .profile-info-value
97 104 {
98 105 border-top: none;
... ... @@ -143,3 +150,47 @@
143 150 margin-top: 10px;
144 151 }
145 152  
  153 +.filters{
  154 + border-radius: .3em;
  155 + background-clip: padding-box;
  156 + background: #fff;
  157 + left: 0;
  158 + top: -0.1em;
  159 + display: block;
  160 + content: "";
  161 +}
  162 +
  163 +.itens{
  164 + color: #757575;
  165 + padding: 0
  166 +}
  167 +
  168 +.qtd{
  169 +
  170 + background: #fff;
  171 + border-radius: 5px;
  172 + background-clip: padding-box;
  173 + float: right;
  174 + font-size: 1em;
  175 + font-weight: normal;
  176 + color: #ccc;
  177 + text-align: right;
  178 +}
  179 +
  180 +.filters_list {
  181 + color: #757575;
  182 + margin: 0;
  183 + list-style: none;
  184 + padding: 0 0 1em 0;
  185 +}
  186 +
  187 +.result_pesquisa{
  188 +
  189 + color: #545454;
  190 + padding-bottom: 20px;
  191 + padding-top: 20px;
  192 +}
  193 +
  194 +.result_metadado{
  195 + font-weight: bold;
  196 +}
146 197 \ No newline at end of file
... ...
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/SolrSearchController.js
... ... @@ -26,8 +26,8 @@
26 26 * @param Utils
27 27 */
28 28  
29   -citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route','$routeParams','$window','$timeout','SolrSearchService','Utils',
30   - function SolrSearchController($scope, $attrs, $location, $route, $routeParams, $window, $timeout, SolrSearchService, Utils) {
  29 +citApp.controller('SolrSearchController', ['$scope','$attrs','$location','$route','$routeParams','$window','$timeout','SolrSearchService','Utils', "$compile",
  30 + function SolrSearchController($scope, $attrs, $location, $route, $routeParams, $window, $timeout, SolrSearchService, Utils, $compile) {
31 31  
32 32 $scope.searchHintsField = 'tipoProcesso,tipoDocumento,objeto,assunto,autor,atribuidoA,destinatario,unidadeGeradora,situacao,nivelAcesso,dataCriacao';
33 33  
... ... @@ -152,6 +152,7 @@ citApp.controller(&#39;SolrSearchController&#39;, [&#39;$scope&#39;,&#39;$attrs&#39;,&#39;$location&#39;,&#39;$route
152 152 // get new results
153 153 var results = SolrSearchService.getResponse($scope.queryName);
154 154 if (results && results.docs) {
  155 +
155 156 $scope.totalResults = results.numFound;
156 157 // calculate the total number of pages and sets
157 158 $scope.totalPages = Math.ceil($scope.totalResults / $scope.documentsPerPage);
... ... @@ -161,6 +162,24 @@ citApp.controller(&#39;SolrSearchController&#39;, [&#39;$scope&#39;,&#39;$attrs&#39;,&#39;$location&#39;,&#39;$route
161 162 // clean up document fields
162 163 results.docs[i].fromDate = Utils.formatDate(results.docs[i].fromDate);
163 164 results.docs[i].toDate = Utils.formatDate(results.docs[i].toDate);
  165 +
  166 + if(results.docs[i].objeto == 'Documento' && SolrSearchService.queries.defaultQuery.highlighting){
  167 +
  168 + var object = results.docs[i].id;
  169 +
  170 + if(SolrSearchService.queries.defaultQuery.highlighting[object]){
  171 +
  172 + var highlightings = SolrSearchService.queries.defaultQuery.highlighting[object];
  173 +
  174 + results.docs[i].conteudo = "";
  175 +
  176 + angular.forEach(highlightings, function (item) {
  177 + results.docs[i].conteudo = results.docs[i].conteudo + item;
  178 + });
  179 +
  180 + }
  181 + }
  182 +
164 183 // add to result list
165 184 $scope.documents.push(results.docs[i]);
166 185 }
... ... @@ -187,23 +206,37 @@ citApp.controller(&#39;SolrSearchController&#39;, [&#39;$scope&#39;,&#39;$attrs&#39;,&#39;$location&#39;,&#39;$route
187 206 if (result) {
188 207 var myArray = new Array();
189 208 for (var i = 0; i < result.length; i += 2) {
190   - var hint = {
  209 + //Verifica se o filtro está vazio
  210 + if(result[i] != "" && result[i + 1] > 0){
  211 + var hint = {
191 212 name: Object.keys(results.facet_fields)[j],
192 213 title: result[i],
193 214 quantidade: result[i + 1],
194 215 selected: false
195   - };
196   - myArray.push(hint);
  216 + };
  217 + myArray.push(hint);
  218 + }
197 219 }
198 220  
199 221 $scope.hints[$scope.hintFields[j]] = myArray;
200 222 }
201 223 }
202 224 }
  225 +
203 226 }else{
204 227  
205 228 $scope.apresentarMsgSemResultado = true;
206 229 }
  230 + $timeout(function(){
  231 + angular.forEach($scope.documents, function (item) {
  232 +
  233 + if(item.objeto == 'Documento'){
  234 +
  235 + document.getElementById(item.id).innerHTML = item.conteudo ;
  236 + }
  237 +
  238 + });
  239 + });
207 240  
208 241 // update the page index
209 242 $scope.updatePageIndex();
... ... @@ -404,12 +437,36 @@ citApp.controller(&#39;SolrSearchController&#39;, [&#39;$scope&#39;,&#39;$attrs&#39;,&#39;$location&#39;,&#39;$route
404 437 SolrSearchService.updateQuery($scope.queryName);
405 438 }, 350);
406 439  
407   - console.log("ally "+ query)
408 440 };
409 441  
410 442 $scope.selectHint = function (nameIndex, index) {
411 443 var hint = $scope.hints[nameIndex][index];
412   - $scope.userQuery = hint.title;
  444 + var userQuery = hint.title;
  445 + $scope.aplicarFilter(userQuery);
  446 + };
  447 +
  448 + $scope.aplicarFilter = function(valueFilter){
  449 + // clean up the user query
  450 + var trimmed = Utils.trim(valueFilter);
  451 + if (trimmed === '') {
  452 + valueFilter = "*:*";
  453 + }
  454 + $scope.timeout = $timeout(function () {
  455 + var query = SolrSearchService.createQuery("https://localhost:8983/solr/jcg");
  456 + query.setOption("rows", "10");
  457 + query.setOption("facet", "true");
  458 + query.setOption("facet.limit", $scope.maxHints);
  459 +
  460 + var hints = $scope.searchHintsField.split(',');
  461 + for(var i = 0; i < hints.length; i++){
  462 + query.setOption("facet.field#" + i, hints[i]);
  463 + }
  464 +
  465 + query.setNearMatch($scope.nearMatch);
  466 + query.setUserQuery(valueFilter);
  467 + SolrSearchService.setQuery($scope.queryName, query);
  468 + SolrSearchService.updateQuery($scope.queryName);
  469 + }, 350);
413 470 };
414 471  
415 472 $scope.init();
... ...
cit-ecm-web/src/main/webapp/assets/js/angular/custom/service/solr.js
... ... @@ -611,6 +611,7 @@ citApp.provider(&#39;SolrSearchService&#39;, function solrSearchServiceProvider() {
611 611 // get the named query, reset error state, get the query url
612 612 var query = svc.queries[QueryName];
613 613 var url = query.getSolrQueryUrl();
  614 + url = url + "&hl=true&hl.fl=conteudo&hl.fragsize=300"
614 615 $log.debug("GET " + QueryName + ": " + url);
615 616 // execute the query
616 617 return $http.jsonp(url).then(
... ...
cit-ecm-web/src/main/webapp/html/gerenciarProcesso/gerenciarProcessoList.html
... ... @@ -4,8 +4,8 @@
4 4 <div class="bar-buttons-action fixed">
5 5 <div class="row">
6 6 <div class="col-sm-12 text-left">
7   - <div ng-include src="urlCabecalho" /> </div>
8   -
  7 + <div ng-include src="urlCabecalho" />
  8 + </div>
9 9 </div>
10 10 </div>
11 11 </div>
... ...
cit-ecm-web/src/main/webapp/html/pesquisa/pesquisa.html
  1 +<link rel="stylesheet" href="/cit-ecm-web/assets/css/gerenciarProcesso.css" />
1 2 <div id="searchProcesso" class="page-content" ng-controller="SolrSearchController as solrController">
2 3 <div class="bar-buttons-action fixed">
3 4 <div class="row">
4 5 <div class="col-sm-8 text-left"></div>
5   - <!-- .col -->
6 6  
7 7 <div class="col-sm-4 text-right">
8 8 <favorito />
9 9 <help-button workspace="workspace" />
10 10 </div>
11   - <!-- .col -->
  11 +
12 12 </div>
13   - <!-- .row -->
  13 +
14 14 </div>
15   - <!-- .bar-buttons-action -->
16 15  
17   - <h1 class="title" align="center">
18   - <translate>ECM.LABEL.SOLR_SEARCH_INTERFACE</translate>
19   - </h1>
  16 + <breadcrumb ng-workspace="workspace"></breadcrumb>
  17 +
  18 + <fieldset>
  19 + <legend>
  20 + <translate>ECM.LABEL.SOLR_SEARCH_INTERFACE</translate>
  21 + </legend>
20 22  
21   - <div class="row">
22   - <div class="col-sm-12">
23   - <form class="searchbox" name="solrForm">
24   - <div class="input-group" id="inputs">
25   - <input type="text" class="form-control" id="query" type="text" placeholder="{{placeHolder}}" ng-model="userQuery" autocomplete="off" ng-focus="onfocus()" ng-blur="onblur()"
26   - ng-keyup="onkeyup($event)">
27   - <div class="input-group-btn">
28   - <button class="btn btn-default" type="button" id="submit" name="submit" ng-click="handleSubmit()">
29   - <i class="ace-icon fa fa-search icon-on-right bigger-110"></i>
30   - </button>
  23 + <div class="row">
  24 + <div class="col-sm-12">
  25 + <form class="searchbox" name="solrForm">
  26 + <div class="input-group" id="inputs">
  27 + <input type="text" class="form-control" id="query" type="text" placeholder="{{placeHolder}}" ng-model="userQuery" autocomplete="off" ng-focus="onfocus()" ng-blur="onblur()"
  28 + ng-keyup="onkeyup($event)">
  29 + <div class="input-group-btn">
  30 + <button class="btn btn-default" type="button" id="submit" name="submit" ng-click="handleSubmit()">
  31 + <i class="ace-icon fa fa-search icon-on-right bigger-110"></i>
  32 + </button>
  33 + </div>
31 34 </div>
32   - </div>
33   -
34   - <div class="row">
35   - <div class="col-md-8" ng-show='userQuery != "" && apresentarMsgSemResultado'>
36   - </p><translate>ECM.LABEL.SUA_PESQUISA</translate>: <label style="font-weight: bold;">{{userQuery}} </label>
37   - </p><translate>ECM.LABEL.NENHUM_DOCUMENTO_CORRESPONDENTE</translate>
38   - </p><translate>ECM.LABEL.SUGESTOES</translate>
39   - <ul>
40   - <li style="list-style-type: disc;"><translate>ECM.LABEL.CERTIFIQUE_PALAVRAS_ESCRITAS_CORRETAMENTE</translate></li>
41   - <li style="list-style-type: disc;"> <translate>ECM.LABEL.TENTE_PALAVRAS_CHAVES_DIFERENTE</translate></li>
42   - <li style="list-style-type: disc;"><translate>ECM.LABEL.TENTE_PALAVRAS_CHAVES_MAIS_GENERICAS</translate></li>
43   - <li style="list-style-type: disc;"><translate>ECM.LABEL.TENTE_MENOS_PALAVRAS_CHAVES</translate></li>
44   - </ul>
  35 +
  36 + <div class="row">
  37 + <div class="col-md-8" ng-show='userQuery != "" && apresentarMsgSemResultado'>
  38 + </p>
  39 + <translate>ECM.LABEL.SUA_PESQUISA</translate>
  40 + : <label style="font-weight: bold;">{{userQuery}} </label>
  41 + </p>
  42 + <translate>ECM.LABEL.NENHUM_DOCUMENTO_CORRESPONDENTE</translate>
  43 + </p>
  44 + <translate>ECM.LABEL.SUGESTOES</translate>
  45 + <ul>
  46 + <li style="list-style-type: disc;"><translate>ECM.LABEL.CERTIFIQUE_PALAVRAS_ESCRITAS_CORRETAMENTE</translate></li>
  47 + <li style="list-style-type: disc;"><translate>ECM.LABEL.TENTE_PALAVRAS_CHAVES_DIFERENTE</translate></li>
  48 + <li style="list-style-type: disc;"><translate>ECM.LABEL.TENTE_PALAVRAS_CHAVES_MAIS_GENERICAS</translate></li>
  49 + <li style="list-style-type: disc;"><translate>ECM.LABEL.TENTE_MENOS_PALAVRAS_CHAVES</translate></li>
  50 + </ul>
  51 + </div>
45 52 </div>
46   - </div>
47   -
48   - <!-- div class="alert alert-warning" ng-show="loading" ng-cloak>
  53 +
  54 + <!-- div class="alert alert-warning" ng-show="loading" ng-cloak>
49 55 <img
50 56 src="http://upload.wikimedia.org/wikipedia/commons/4/42/Loading.gif"
51 57 class="icon" />
... ... @@ -64,164 +70,216 @@
64 70 <div class="alert alert-info" ng-show="message">{{message}}</div>
65 71 </div-->
66 72  
67   - </form>
  73 + </form>
  74 + </div>
68 75 </div>
69   - </div>
70 76  
71   - <div class="row">
72   - <div class="col-sm-2">
73   - <div class="ecm-search-wrapper">
74   - <div class="ecm-content-wrapper">
75   - <ul class="list-group">
76   - <li class="list-group-item document" ng-show="hints['tipoProcesso']">
77   - <h5>
78   - <b translate>ECM.LABEL.DATACRIACAO</b>
79   - </h5>
80   - <ul>
81   - <li ng-repeat="hint in hints['dataCriacao']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('dataCriacao',$index);handleSubmit()">{{hint.title | date:'dd/MM/yyyy
82   - HH:mm:ss'}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}</li>
83   - </ul>
84   - </li>
85   - <li class="list-group-item document" ng-show="hints['tipoProcesso']">
86   - <h5>
87   - <b translate>ECM.LABEL.TIPOPROCESSO</b>
88   - </h5>
89   - <ul>
90   - <li ng-repeat="hint in hints['tipoProcesso']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('tipoProcesso',$index);handleSubmit()">{{hint.title}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}
91   - </li>
92   - </ul>
93   - </li>
94   - <li class="list-group-item document" ng-show="hints['tipoDocumento']">
95   - <h5>
96   - <b translate>ECM.LABEL.DADOS_TIPODOCUMENTO</b>
97   - </h5>
98   - <ul>
99   - <li ng-repeat="hint in hints['tipoDocumento']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('tipoDocumento',$index);handleSubmit()">{{hint.title}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}
100   - </li>
101   - </ul>
102   - </li>
103   - <li class="list-group-item document" ng-show="hints['objeto']">
104   - <h5>
105   - <b translate>ECM.LABEL.OBJETO</b>
106   - </h5>
107   - <ul>
108   - <li ng-repeat="hint in hints['objeto']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('objeto',$index);handleSubmit()">{{hint.title}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}
109   - </li>
110   - </ul>
111   - </li>
112   - <li class="list-group-item document" ng-show="hints['assunto']">
113   - <h5>
114   - <b translate>ECM.LABEL.ASSUNTO</b>
115   - </h5>
116   - <ul>
117   - <li ng-repeat="hint in hints['assunto']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('assunto',$index);handleSubmit()">{{hint.title}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}
118   - </li>
119   - </ul>
120   - </li>
121   - <li class="list-group-item document" ng-show="hints['autor']">
122   - <h5>
123   - <b translate>ECM.LABEL.AUTOR</b>
124   - </h5>
125   - <ul>
126   - <li ng-repeat="hint in hints['autor']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('autor',$index);handleSubmit()">{{hint.title}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}
127   - </li>
128   - </ul>
129   - </li>
130   - <li class="list-group-item document" ng-show="hints['atribuidoA']">
131   - <h5>
132   - <b translate>ECM.LABEL.ATRIBUIDOA</b>
133   - </h5>
134   - <ul>
135   - <li ng-repeat="hint in hints['atribuidoA']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('atribuidoA',$index);handleSubmit()">{{hint.title}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}
136   - </li>
137   - </ul>
138   - </li>
139   - <li class="list-group-item document" ng-show="hints['destinatario']">
140   - <h5>
141   - <b translate>ECM.LABEL.DESTINATARIO</b>
142   - </h5>
143   - <ul>
144   - <li ng-repeat="hint in hints['destinatario']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('destinatario',$index);handleSubmit()">{{hint.title}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}
145   - </li>
146   - </ul>
147   - </li>
148   - <li class="list-group-item document" ng-show="hints['unidadeGeradora']">
149   - <h5>
150   - <b translate>ECM.LABEL.UNIDADE_GERADORA</b>
151   - </h5>
152   - <ul>
153   - <li ng-repeat="hint in hints['unidadeGeradora']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('unidadeGeradora',$index);handleSubmit()">{{hint.title}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}
154   - </li>
155   - </ul>
156   - </li>
157   - <li class="list-group-item document" ng-show="hints['situacao']">
158   - <h5>
159   - <b translate>LABEL.SITUACAO</b>
160   - </h5>
161   - <ul>
162   - <li ng-repeat="hint in hints['situacao']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('situacao',$index);handleSubmit()">{{hint.title}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}
163   - </li>
164   - </ul>
165   - </li>
166   - <li class="list-group-item document" ng-show="hints['nivelAcesso']">
167   - <h5>
168   - <b translate>ECM.LABEL.NIVELACESSO</b>
169   - </h5>
170   - <ul>
171   - <li ng-repeat="hint in hints['nivelAcesso']" ng-class="{'selected' : hint.selected}"><a ng-click="selectHint('nivelAcesso',$index);handleSubmit()">{{hint.title}}</a>&nbsp;&nbsp;&nbsp;{{hint.quantidade}}
172   - </li>
173   - </ul>
174   - </li>
175   - </ul>
  77 + <div class="row">
  78 + <div class="col-sm-2">
  79 + <div class="ecm-search-wrapper">
  80 + <div class="ecm-content-wrapper">
  81 + <ul class="list-group">
  82 +
  83 + <li class="list-group-item document" ng-show="hints['objeto']">
  84 + <h5>
  85 + <b translate>ECM.LABEL.OBJETO</b>
  86 + </h5>
  87 + <ul class="filters_list">
  88 + <li ng-repeat="hint in hints['objeto']" ng-class="{'selected' : hint.selected}">
  89 + <a href="javascript: return false" ng-click="selectHint('objeto',$index);" class="filters" ng-show="hint.quantidade > 0">
  90 + <span class="itens">{{hint.title}}</span>
  91 + <span class="qtd">{{hint.quantidade}}</span>
  92 + </a>
  93 + </li>
  94 + </ul>
  95 + </li>
  96 +
  97 + <li class="list-group-item document" ng-show="hints['tipoProcesso'].length > 0">
  98 + <h5>
  99 + <b translate>ECM.LABEL.TIPOPROCESSO</b>
  100 + </h5>
  101 + <ul class="filters_list">
  102 + <li ng-repeat="hint in hints['tipoProcesso']" ng-class="{'selected' : hint.selected}">
  103 + <a href="javascript: return false" ng-click="selectHint('tipoProcesso',$index);" class="filters">
  104 + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span>
  105 + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span>
  106 + </a>
  107 + </li>
  108 + </ul>
  109 + </li>
  110 +
  111 + <li class="list-group-item document" ng-show="hints['tipoDocumento'].length > 0">
  112 + <h5>
  113 + <b translate>ECM.LABEL.TIPODOCUMENTO</b>
  114 + </h5>
  115 + <ul class="filters_list">
  116 + <li ng-repeat="hint in hints['tipoDocumento']" ng-class="{'selected' : hint.selected}">
  117 + <a href="javascript: return false" ng-click="selectHint('tipoDocumento',$index);" class="filters">
  118 + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span>
  119 + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span>
  120 + </a>
  121 + </li>
  122 + </ul>
  123 + </li>
  124 +
  125 + <li class="list-group-item document" ng-show="hints['assunto'].length > 0">
  126 + <h5>
  127 + <b translate>ECM.LABEL.ASSUNTO</b>
  128 + </h5>
  129 + <ul class="filters_list">
  130 + <li ng-repeat="hint in hints['assunto']" ng-class="{'selected' : hint.selected}">
  131 + <a href="javascript: return false" ng-click="selectHint('assunto',$index)" class="filters">
  132 + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span>
  133 + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span>
  134 + </a>
  135 + </li>
  136 + </ul>
  137 + </li>
  138 +
  139 + <li class="list-group-item document" ng-show="hints['autor'].length > 0">
  140 + <h5>
  141 + <b translate>ECM.LABEL.AUTOR</b>
  142 + </h5>
  143 + <ul class="filters_list">
  144 + <li ng-repeat="hint in hints['autor']" ng-class="{'selected' : hint.selected}">
  145 + <a href="javascript: return false" ng-click="selectHint('autor',$index)" class="filters">
  146 + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span>
  147 + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span>
  148 + </a>
  149 + </li>
  150 + </ul>
  151 + </li>
  152 +
  153 + <li class="list-group-item document" ng-show="hints['destinatario'].length > 0">
  154 + <h5>
  155 + <b translate>ECM.LABEL.DESTINATARIO</b>
  156 + </h5>
  157 + <ul class="filters_list">
  158 + <li ng-repeat="hint in hints['destinatario']" ng-class="{'selected' : hint.selected}">
  159 + <a href="javascript: return false" ng-click="selectHint('destinatario',$index)" class="filters">
  160 + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span>
  161 + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span>
  162 + </a>
  163 + </li>
  164 + </ul>
  165 + </li>
  166 +
  167 + <li class="list-group-item document" ng-show="hints['atribuidoA'].length > 0">
  168 + <h5>
  169 + <b translate>ECM.LABEL.ATRIBUIDOA</b>
  170 + </h5>
  171 + <ul class="filters_list">
  172 + <li ng-repeat="hint in hints['atribuidoA']" ng-class="{'selected' : hint.selected}">
  173 + <a href="javascript: return false" ng-click="selectHint('atribuidoA',$index)" class="filters">
  174 + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span>
  175 + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span>
  176 + </a>
  177 + </li>
  178 + </ul>
  179 + </li>
  180 +
  181 + <li class="list-group-item document" ng-show="hints['unidadeGeradora'].length > 0">
  182 + <h5>
  183 + <b translate>ECM.LABEL.UNIDADE_GERADORA</b>
  184 + </h5>
  185 + <ul class="filters_list">
  186 + <li ng-repeat="hint in hints['unidadeGeradora']" ng-class="{'selected' : hint.selected}">
  187 + <a href="javascript: return false" ng-click="selectHint('unidadeGeradora',$index)" class="filters">
  188 + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span>
  189 + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span>
  190 + </a>
  191 + </li>
  192 + </ul>
  193 + </li>
  194 +
  195 + <li class="list-group-item document" ng-show="hints['situacao'].length > 0">
  196 + <h5>
  197 + <b translate>LABEL.SITUACAO</b>
  198 + </h5>
  199 + <ul class="filters_list">
  200 + <li ng-repeat="hint in hints['situacao']" ng-class="{'selected' : hint.selected}">
  201 + <a href="javascript: return false" ng-click="selectHint('situacao',$index)" class="filters">
  202 + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span>
  203 + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span>
  204 + </a>
  205 + </li>
  206 + </ul>
  207 + </li>
  208 +
  209 + <li class="list-group-item document" ng-show="hints['nivelAcesso'].length > 0">
  210 + <h5>
  211 + <b translate>ECM.LABEL.NIVELACESSO</b>
  212 + </h5>
  213 + <ul class="filters_list">
  214 + <li ng-repeat="hint in hints['nivelAcesso']" ng-class="{'selected' : hint.selected}">
  215 + <a href="javascript: return false" ng-click="selectHint('nivelAcesso',$index)" class="filters">
  216 + <span class="itens" ng-show="hint.quantidade > 0">{{hint.title}}</span>
  217 + <span class="qtd" ng-show="hint.quantidade > 0">{{hint.quantidade}}</span>
  218 + </a>
  219 + </li>
  220 + </ul>
  221 + </li>
  222 +
  223 + </ul>
  224 + </div>
176 225 </div>
177 226 </div>
178   - </div>
179   - <div id="search-results" class="col-sm-10" ng-cloak>
180   - <!--Show documents-->
181   - <div class="ecm-content-wrapper">
182   - <ul class="list-group">
183   - <li class="list-group-item document" ng-repeat="doc in documents" ng-cloak>
184   - <div class="row">
185   - <div class="col-md-12">
186   - <a href="">{{doc.objeto == 'Documento' ? doc.numero : doc.nup}} - {{doc.objeto == 'Documento' ? doc.tipoDocumento : doc.tipoProcesso}}</a>&nbsp; <span class="label label-success pull-right"
187   - ng-show="doc.nivelAcesso == 'Publico' || doc.nivelAcesso == 'Público'">{{doc.nivelAcesso}}</span> <span class="label label-warning pull-right" ng-show="doc.nivelAcesso =='Restrito'">{{doc.nivelAcesso}}</span>
188   - <span class="label label-danger pull-right" ng-show="doc.nivelAcesso == 'Secreto'">{{doc.nivelAcesso}}</span> <span class="label label-gray pull-right" ng-show="doc.nivelAcesso == 'Reservado'">{{doc.nivelAcesso}}</span>
189   - <span class="label label-black pull-right" ng-show="doc.nivelAcesso == 'Ultrassecreto'">{{doc.nivelAcesso}}</span>
  227 + <div id="search-results" class="col-sm-10" ng-cloak>
  228 + <!--Show documents-->
  229 + <div class="ecm-content-wrapper">
  230 + <ul class="list-group">
  231 + <li class="list-group-item document" ng-repeat="doc in documents" ng-cloak>
  232 + <div class="row">
  233 + <div class="col-md-12">
  234 + <label class="result_metadado">{{doc.nup}} - {{doc.objeto == 'Documento' ? doc.tipoDocumento : doc.tipoProcesso}}</label>&nbsp;
  235 + <span class="label label-success pull-right" style="font-size: 13px; important" ng-show="doc.nivelAcesso == 'Publico' || doc.nivelAcesso == 'Público'">{{doc.nivelAcesso}}</span>
  236 + <span class="label label-warning pull-right" style="font-size: 13px; important" ng-show="doc.nivelAcesso =='Restrito'">{{doc.nivelAcesso}}</span>
  237 + <span class="label label-danger pull-right" style="font-size: 13px; important" ng-show="doc.nivelAcesso == 'Secreto'">{{doc.nivelAcesso}}</span>
  238 + <span class="label label-gray pull-right" style="font-size: 13px; important" ng-show="doc.nivelAcesso == 'Reservado'">{{doc.nivelAcesso}}</span>
  239 + <span class="label label-black pull-right" style="font-size: 13px; important" ng-show="doc.nivelAcesso == 'Ultrassecreto'">{{doc.nivelAcesso}}</span>
  240 + </div>
190 241 </div>
191   - </div>
192   - <div class="row">
193   - <div class="col-md-12">
194   - <a href="">{{doc.assunto}}</a>
  242 + <div class="row">
  243 + <div class="col-md-12">
  244 + <label class="result_metadado">{{doc.assunto}}</label>
  245 + </div>
195 246 </div>
196   - </div>
197   - <div class="row">
198   - <div class="col-md-12">
199   - <pre>{{doc.objeto == 'Documento' ? doc.conteudo :doc.assuntoComplementar}}</pre>
  247 + <div class="row">
  248 + <div class="col-md-12">
  249 + <div ng-show="doc.objeto == 'Processo'">{{doc.assuntoComplementar}}</div>
  250 +<!-- <iframe id="doc.id" class="iframe_pesquisa" ng-show="doc.objeto == 'Documento' && doc.conteudo.length > 0" srcdoc="{{doc.conteudo}}" ></iframe> -->
  251 + <div class="result_pesquisa" id="{{doc.id}}" ></div>
  252 + </div>
200 253 </div>
201   - </div>
202   -
203 254  
204   - <div class="row">
205   - <div class="col-md-6">Unidade Geradora</div>
206   - <div class="col-md-4">Autor</div>
207   - <div class='col-sm-2'>Data Criação</div>
208   - </div> <!-- .row -->
209   - <div class="row">
210   - <div class="col-md-6">{{doc.unidadeGeradora}}</div>
211   - <div class="col-md-4">{{doc.autor}}</div>
212   - <div class='col-sm-2'>{{doc.dataCriacao | date:'dd/MM/yyyy HH:mm:ss'}}</div>
213   - </div> <!-- .row -->
214   - </li>
215   - </ul>
216   - </div>
  255 + <div class="row">
  256 + <div class="col-md-6">
  257 + <label class="profile-info-label"><translate>ECM.LABEL.UNIDADE_GESTORA</translate></label>
  258 + </div>
  259 + <div class="col-md-4">
  260 + <label class="profile-info-label"><translate>ECM.LABEL.AUTOR</translate></label>
  261 + </div>
  262 + <div class='col-sm-2'>
  263 + <label class="profile-info-label"><translate>ECM.LABEL.DATA_CRIACAO</translate></label>
  264 + </div>
  265 + </div> <!-- .row -->
  266 + <div class="row">
  267 + <div class="col-md-6">{{doc.unidadeGeradora}}</div>
  268 + <div class="col-md-4">{{doc.autor}}</div>
  269 + <div class='col-sm-2'>{{doc.dataCriacao | date:'dd/MM/yyyy HH:mm:ss'}}</div>
  270 + </div> <!-- .row -->
  271 + </li>
  272 + </ul>
  273 + </div>
217 274  
218   - <!--Show Pagination-->
219   - <div class="col-sm-6 text-right" ng-show="totalPages > 1">
220   - <pagination rotate="true" max-size="10" total-items="totalResults" num-pages="totalPages" ng-model="start" items-per-page="10" class="pagination-sm" boundary-links="true"
221   - ng-change="handleSetPage()" previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></pagination>
  275 + <!--Show Pagination-->
  276 + <div class="col-sm-6 text-right" ng-show="totalPages > 1">
  277 + <pagination rotate="true" max-size="10" total-items="totalResults" num-pages="totalPages" ng-model="start" items-per-page="10" class="pagination-sm" boundary-links="true"
  278 + ng-change="handleSetPage()" previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></pagination>
  279 + </div>
  280 + <!-- .col -->
222 281 </div>
223   - <!-- .col -->
224 282 </div>
225   - </div>
  283 + </fieldset>
226 284 </div>
227 285 <!-- .page-content -->
228 286 \ No newline at end of file
... ...