### Start PGPOOL Service (Alternative) Source: https://docs.pje.jus.br/servicos-infraestrutura/balanceamento-de-banco-de-dados-pgpool An alternative command to start the PGPOOL service. This command might be used in environments where 'service pgpool start' is the standard way to manage the service, potentially after configuration changes. ```bash service pgpool start ``` -------------------------------- ### Initialize PJE2-WEB Frontend Application Source: https://docs.pje.jus.br/manuais-de-inicializacao/configurando-ambiente-desenvolvimento Initializes the PJE2-WEB frontend application using npm, typically starting the development server on port 4200. This command should be run from the root of the cloned PJE2-WEB directory. ```bash ng serve ``` -------------------------------- ### Start PGPOOL-II Service Source: https://docs.pje.jus.br/servicos-infraestrutura/balanceamento-de-banco-de-dados-pgpool Command to start the PGPOOL-II service. This initiates the PGPOOL-II middleware, which then begins managing connections and potentially replication based on its configuration. ```bash service pgpool-II-11 start ``` -------------------------------- ### Resource-Oriented URL Examples Source: https://docs.pje.jus.br/manuais-basicos/padroes-de-api-do-pje Demonstrates correct and incorrect ways to structure URLs for APIs, emphasizing business granularity over database table structure. Incorrect examples often reflect direct database relationships, while correct examples represent higher-level business concepts. ```shell /processos/{id-processo}/documentos ``` ```shell /processos/{id-processo}/processos-documentos ``` -------------------------------- ### Clonar Repositório Sample-Service com Git Source: https://docs.pje.jus.br/manuais-de-inicializacao/exemplo-criacao-de-frontend-e-backend-para-o-pje-2-1 Este snippet de comando Git demonstra como clonar o repositório 'sample-service' de um URL específico. O repositório serve como um template para microsserviços do PJe, contendo funcionalidades básicas e configurações. ```bash git clone git@git.cnj.jus.br:pje2/pje2-servicos/sample-service.git ``` -------------------------------- ### Eclipse SonarLint Plugin Installation and Usage Source: https://docs.pje.jus.br/manuais-de-inicializacao/configurando-ambiente-desenvolvimento Guide to installing and using the SonarLint plugin in Eclipse for real-time code analysis and error detection. It also covers binding SonarLint to SonarQube for consistent rule application. ```text SonarLint assists developers in detecting and correcting code issues as they code. How to install: In Eclipse, click Help → Eclipse Marketplace. In the Search tab, type SonarLint and press Enter. Click Install to proceed with the installation process. * During coding, the user can request an analysis of the produced code. Right-click on the project and select **SonarLint → Analyze changed files** * There is also the possibility to perform a bind (link) with CNJ's SonarQube. Right-click on the project and select **SonarLint → Bind to SonarQube or SonarCloud**. This association allows the same rules applied to the project during analysis by SonarQube to be present in Eclipse. ``` -------------------------------- ### PJE API Response - Successful Request Source: https://docs.pje.jus.br/manuais-basicos/padroes-de-api-do-pje Example of a successful API response for a GET request to '/orgaos-julgadores/'. It includes a 'status' of 'ok', an HTTP status code '200', an empty 'messages' array, and the requested data in the 'result' field. ```json { "status": "ok", "code": "200", "messages": [], "result": [ { "id": "1", "nome": "GAB. DESEMB. FULANO DE TAL", "ativo": "true" }, { "id": "2", "nome": "GAB. DESEMB. CICRANO DE TAL", "ativo": "true" } ] } ``` -------------------------------- ### Environment Variables for PJe Legacy Source: https://docs.pje.jus.br/manuais-de-inicializacao/guia-rapido-implantacao-pje-2-1 This file specifies the environment variables required for the PJe legacy service when running within the Docker Compose setup. These variables configure database connections, network settings, and other PJe-specific parameters. Ensure these values match your local Docker host and database configuration before starting the services. ```env DOCKER_HOST=172.20.18.41 POSTGRES_DB_HOST=172.20.18.41 POSTGRES_DB_PORT=5432 POSTGRES_DB_NAME=pje POSTGRES_DB_LOG_NAME=pje-log POSTGRES_DB_BIN_NAME=pje-bin POSTGRES_DB_USER=postgres POSTGRES_DB_PASSWORD=P123456 ``` -------------------------------- ### Configuração do PJe 2.1 com Variáveis do Maven Source: https://docs.pje.jus.br/manuais-de-inicializacao/guia-rapido-implantacao-pje-2-1 Este snippet demonstra como configurar o PJe 2.1 durante o processo de build utilizando variáveis do Maven. É necessário informar parâmetros como ID do tribunal, URLs de cliente e serviço, e credenciais para o RabbitMQ. O comando `mvn clean package` é utilizado com perfis específicos como `jcr-storage` e `UseEhCache`. ```bash mvn clean package -P jcr-storage -P UseEhCache \ -Dpje2.cloud.appName= \ -Dpje2.cliente.urlCliente=https://frontend.stg.cnj.cloud -Deureka.serviceUrl.default=https://discovery.stg.cnj.cloud/eureka \ -Dpje2.cloud.registrar=true \ -Dpje2.cloud.rabbit.publishMessages=true \ -Dpje2.cloud.rabbit.host=mq.stg.cnj.cloud \ -Dpje2.cloud.rabbit.username= \ -Dpje2.cloud.rabbit.password= ``` -------------------------------- ### Eclipse JbossTools Plugin Installation Source: https://docs.pje.jus.br/manuais-de-inicializacao/configurando-ambiente-desenvolvimento Steps to install the JBoss Tools plugin in Eclipse via the Eclipse Marketplace. After installation, the JBoss Tools icon will be available in Help > About Eclipse IDE. ```text Install the JBoss Tools plugins for Eclipse. Click Help > Eclipse Marketplace: Type Jboss Tools in the Find field and click Install. Proceed with the installation by clicking confirm: After restarting Eclipse, the JBoss Tools icon will appear in Help > About Eclipse IDE: ``` -------------------------------- ### Copiar Arquivo de Configuração PCP (Bash) Source: https://docs.pje.jus.br/servicos-infraestrutura/balanceamento-de-banco-de-dados-pgpool Copia o arquivo de configuração de exemplo 'pcp.conf.sample' para 'pcp.conf' no diretório de configuração do PGPOOL-II. Este arquivo é usado para autenticação da interface de gerenciamento. ```bash cd /etc/pgpool-II-11/ cp pcp.conf.sample pcp.conf ``` -------------------------------- ### Install Project Dependencies with pip Source: https://docs.pje.jus.br/servicos-auxiliares/servico-sinapses-inteligencia-artificial These commands install the necessary Python packages for the project from a requirements.txt file. Additional packages are installed for users planning to work with Jupyter Notebook, including specific extensions. The second snippet is for users working with Eclipse. ```bash pip install -r requirements.txt pip install sinapses-nbextension pip install jupyter ``` ```bash pip install -r requirements.txt ``` -------------------------------- ### Adicionar Dependências Spring Boot JPA e PostgreSQL no Maven Source: https://docs.pje.jus.br/manuais-de-inicializacao/exemplo-criacao-de-frontend-e-backend-para-o-pje-2-1 Este snippet XML mostra como incluir as dependências 'spring-boot-starter-data-jpa' e 'postgresql' no arquivo pom.xml de um projeto Maven. Essas dependências são necessárias para a persistência de dados com JPA e a conexão com bancos de dados PostgreSQL. ```xml org.postgresql postgresql ``` -------------------------------- ### Visualizar Arquivo PCP (Bash) Source: https://docs.pje.jus.br/servicos-infraestrutura/balanceamento-de-banco-de-dados-pgpool Exibe o conteúdo do arquivo 'pcp.conf' que contém as credenciais de autenticação para a interface de gerenciamento do PGPOOL-II. Cada linha deve conter um nome de usuário e sua senha criptografada. ```bash cat pcp.conf ``` -------------------------------- ### Adicionar Repositório PGPOOL-II (Bash) Source: https://docs.pje.jus.br/servicos-infraestrutura/balanceamento-de-banco-de-dados-pgpool Configura o arquivo 'pgpool.repo' para adicionar o repositório oficial do PGPOOL-II, permitindo a instalação de pacotes via YUM. Especifica o nome, URL base e habilita o repositório. ```bash vi /etc/yum.repos.d/pgpool.repo [pgpool] name=PgPoolRepo baseurl=https://www.pgpool.net/yum/rpms/4.1/redhat/rhel-$releasever-$basearch/ enabled=1 gpgcheck=0 ``` -------------------------------- ### Configuração do servidor de e-mail para PJe Push Source: https://docs.pje.jus.br/configura%C3%A7%C3%B5es-do-pje/Configura%C3%A7%C3%B5es%20iniciais Exemplo de configuração para o arquivo 'components.xml' do PJe Push, definindo os parâmetros necessários para conexão com um servidor de e-mail. Inclui host, porta, credenciais de usuário e senha, além de configurações de segurança como TLS e debug. Adapte os valores de host, usuário e senha conforme as especificações do seu servidor de e-mail. ```json {"tls": "false", "debug": "false", "host":"correio.TRIBUNAL.jus.br", "password": "SENHA", "port": "25", "username": "USUARIO"} ``` -------------------------------- ### Install and Activate Python Virtual Environment with pyenv Source: https://docs.pje.jus.br/servicos-auxiliares/servico-sinapses-inteligencia-artificial This snippet demonstrates how to install a specific Python version (3.6.8), create a virtual environment named 'cranium' based on that version, and activate it using pyenv. This ensures an isolated environment for project development. ```bash cd ~ pyenv install 3.6.8 pyenv virtualenv 3.6.8 cranium pyenv activate cranium ``` -------------------------------- ### XML Configuration for 'Preparar ato de comunicação' Process Source: https://docs.pje.jus.br/configura%C3%A7%C3%B5es-do-pje/Fluxos%20da%20tramita%C3%A7%C3%A3o%20dos%20processos%20do%20CNJ/Preparar%20ato%20de%20comunica%C3%A7%C3%A3o This XML file defines the workflow for 'Preparar ato de comunicação'. It includes swimlanes for assignments, states like 'Início', 'Preparar comunicação', and 'ForkComunicacao', along with transitions and event-driven actions. Manual configuration is required for task events. ```xml ``` -------------------------------- ### Sinapses API Request JSON Example Source: https://docs.pje.jus.br/servicos-auxiliares/servico-sinapses-inteligencia-artificial An example of the JSON payload sent to the Sinapses API for model execution. It specifies the type and content of the input data, along with the expected number of prediction classes. This structure is used to provide the necessary input for the model. ```json { "mensagem": { "tipo": "TEXTO", "conteudo": "TmEgbm9pdGUgZXNjdXJhIGV1IHNvdSBv" }, "quantidadeClasses": 3 } ``` -------------------------------- ### Sinapses API Response JSON Example Source: https://docs.pje.jus.br/servicos-auxiliares/servico-sinapses-inteligencia-artificial An example of the JSON response received from the Sinapses API after a model has executed a prediction. It includes the most confident class prediction and a list of all predicted classes with their respective confidence scores. This output allows users to interpret the model's results. ```json { "classeConvicto":{ "codigo":"BATMAN", "descricao":"BATMAN" }, "resultados":[ { "classe":{ "codigo":"BATMAN", "descricao":"BATMAN" }, "conviccao":33.39008464003392 }, { "classe":{ "codigo":"SUPER_HOMEM", "descricao":"SUPER_HOMEM" }, "conviccao":33.35604335701127 }, { "classe":{ "codigo":"MULHER_MARAVILHA", "descricao":"MULHER_MARAVILHA" }, "conviccao":33.25387200295481 } ] } ``` -------------------------------- ### Configurar bytea_output no PostgreSQL Source: https://docs.pje.jus.br/configura%C3%A7%C3%B5es-do-pje/Configura%C3%A7%C3%B5es%20iniciais Comando SQL para definir a variável 'bytea_output' como 'escape' no PostgreSQL. É essencial para o correto funcionamento do PJe, especialmente na manipulação de dados binários. Certifique-se de substituir `` e `` pelos nomes reais dos seus bancos de dados. ```sql ALTER DATABASE SET bytea_output='escape'; ALTER DATABASE SET bytea_output='escape'; ``` -------------------------------- ### Run Docker Compose Services Source: https://docs.pje.jus.br/manuais-de-inicializacao/configurando-ambiente-desenvolvimento Starts the services defined in the docker-compose.yml file in detached mode. This command should be executed in the same directory as the docker-compose.yml file. ```bash docker-compose up -d ```