mirror of https://github.com/interlegis/sapl.git
44 changed files with 622 additions and 1062 deletions
@ -1,2 +1,4 @@ |
|||
-r dev-requirements.txt |
|||
GitPython |
|||
mysqlclient==1.3.12 |
|||
pyaml |
|||
|
|||
@ -1,33 +1,13 @@ |
|||
from django.core import management |
|||
from django.core.management.base import BaseCommand |
|||
|
|||
from sapl.legacy.migracao import migrar, migrar_dados |
|||
from sapl.legacy.migracao import migrar |
|||
|
|||
|
|||
class Command(BaseCommand): |
|||
|
|||
help = 'Migração de dados do SAPL 2.5 para o SAPL 3.1' |
|||
|
|||
def add_arguments(self, parser): |
|||
parser.add_argument( |
|||
'--force', |
|||
action='store_true', |
|||
default=False, |
|||
dest='force', |
|||
help='Não interativa: pula confirmação de exclusão dos dados', |
|||
) |
|||
parser.add_argument( |
|||
'--dados', |
|||
action='store_true', |
|||
default=False, |
|||
dest='dados', |
|||
help='migra somente dados', |
|||
) |
|||
|
|||
def handle(self, *args, **options): |
|||
management.call_command('migrate') |
|||
somente_dados, interativo = options['dados'], not options['force'] |
|||
if somente_dados: |
|||
migrar_dados(interativo=interativo) |
|||
else: |
|||
migrar(interativo=interativo) |
|||
migrar(interativo=False) |
|||
|
|||
@ -1,42 +1,75 @@ |
|||
import subprocess |
|||
import tarfile |
|||
from getpass import getpass |
|||
|
|||
from django.conf import settings |
|||
import requests |
|||
from unipath import Path |
|||
|
|||
from sapl.legacy.migracao_dados import migrar_dados |
|||
from sapl.legacy.migracao_dados import (REPO, TAG_MARCO, gravar_marco, info, |
|||
migrar_dados) |
|||
from sapl.legacy.migracao_documentos import migrar_documentos |
|||
from sapl.legacy.migracao_usuarios import migrar_usuarios |
|||
from sapl.legacy.scripts.exporta_zope.variaveis_comuns import TAG_ZOPE |
|||
from sapl.legacy_migration_settings import DIR_REPO, NOME_BANCO_LEGADO |
|||
from sapl.materia.models import Proposicao |
|||
|
|||
|
|||
def migrar(interativo=False): |
|||
migrar_dados(interativo=interativo) |
|||
migrar_usuarios() |
|||
migrar_documentos() |
|||
def adornar_msg(msg): |
|||
return '\n{1}\n{0}\n{1}'.format(msg, '#' * len(msg)) |
|||
|
|||
|
|||
# fonte: https://stackoverflow.com/a/17081026/1877490 |
|||
def make_tarfile(output_filename, source_dir): |
|||
with tarfile.open(output_filename, "w:gz") as tar: |
|||
tar.add(source_dir, arcname=os.path.basename(source_dir)) |
|||
|
|||
def migrar(interativo=False): |
|||
if TAG_MARCO in REPO.tags: |
|||
info('A migração já está feita.') |
|||
return |
|||
assert TAG_ZOPE in REPO.tags, adornar_msg( |
|||
'Antes de migrar ' |
|||
'é necessário fazer a exportação de documentos do zope') |
|||
migrar_dados(interativo=interativo) |
|||
migrar_usuarios(REPO.working_dir) |
|||
migrar_documentos(REPO) |
|||
gravar_marco() |
|||
|
|||
def gerar_pacote(): |
|||
banco = settings.DATABASES['legacy']['NAME'] |
|||
|
|||
# backup do banco |
|||
print('Gerando backup do banco... ', end='', flush=True) |
|||
arq_backup = settings.MEDIA_ROOT.child('{}.backup'.format(banco)) |
|||
backup_cmd = ''' |
|||
pg_dump --host localhost --port 5432 --username postgres --no-password |
|||
--format custom --blobs --verbose --file {} {}'''.format( |
|||
arq_backup, banco) |
|||
subprocess.check_output(backup_cmd.split(), stderr=subprocess.DEVNULL) |
|||
print('SUCESSO') |
|||
def compactar_media(): |
|||
|
|||
# tar de media/sapl |
|||
print('Criando tar de media... ', end='', flush=True) |
|||
tar_media = settings.MEDIA_ROOT.child('{}.media.tgz'.format(banco)) |
|||
dir_media = settings.MEDIA_ROOT.child('sapl') |
|||
with tarfile.open(tar_media, "w:gz") as tar: |
|||
tar.add(dir_media, arcname=dir_media.name) |
|||
arq_tar = DIR_REPO.child('{}.media.tar'.format(NOME_BANCO_LEGADO)) |
|||
arq_tar.remove() |
|||
subprocess.check_output(['tar', 'cfh', arq_tar, '-C', DIR_REPO, 'sapl']) |
|||
print('SUCESSO') |
|||
|
|||
|
|||
PROPOSICAO_UPLOAD_TO = Proposicao._meta.get_field('texto_original').upload_to |
|||
|
|||
|
|||
def salva_conteudo_do_sde(proposicao, conteudo): |
|||
caminho_relativo = PROPOSICAO_UPLOAD_TO( |
|||
proposicao, 'proposicao_sde_{}.xml'.format(proposicao.pk)) |
|||
caminho_absoluto = Path(REPO.working_dir, caminho_relativo) |
|||
caminho_absoluto.parent.mkdir(parents=True) |
|||
with open(caminho_absoluto, 'wb') as arq: |
|||
arq.write(conteudo) |
|||
proposicao.texto_original = caminho_relativo |
|||
proposicao.save() |
|||
|
|||
|
|||
def scrap_sde(url, usuario, senha=None): |
|||
if not senha: |
|||
senha = getpass() |
|||
|
|||
# login |
|||
session = requests.session() |
|||
res = session.post('{}?retry=1'.format(url), |
|||
{'__ac_name': usuario, '__ac_password': senha}) |
|||
assert res.status_code == 200 |
|||
|
|||
url_proposicao = '{}/sapl_documentos/proposicao/{}/renderXML?xsl=__default__' # noqa |
|||
total = Proposicao.objects.count() |
|||
for num, proposicao in enumerate(Proposicao.objects.all()): |
|||
pk = proposicao.pk |
|||
res = session.get(url_proposicao.format(url, pk)) |
|||
print("pk: {} status: {} (progresso: {:.2%})".format( |
|||
pk, res.status_code, num / total)) |
|||
if res.status_code == 200: |
|||
salva_conteudo_do_sde(proposicao, res.content) |
|||
|
|||
@ -1,3 +1,8 @@ |
|||
# ZODB version 3.7.4 |
|||
PyYAML==3.12 |
|||
ZODB==5.3.0 |
|||
PyYAML |
|||
Unipath |
|||
GitPython |
|||
pyaml |
|||
python-magic |
|||
ipython |
|||
|
|||
@ -0,0 +1,4 @@ |
|||
from unipath import Path |
|||
|
|||
DIR_DADOS_MIGRACAO = Path('~/migracao_sapl/').expand() |
|||
TAG_ZOPE = 'zope' |
|||
@ -0,0 +1,40 @@ |
|||
#!/usr/bin/env python |
|||
import re |
|||
import sys |
|||
|
|||
from unipath import Path |
|||
|
|||
cabecalho = ''' |
|||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
|||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
|||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
|||
/*!40101 SET NAMES utf8 */; |
|||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; |
|||
/*!40103 SET TIME_ZONE='+00:00' */; |
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; |
|||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; |
|||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; |
|||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; |
|||
|
|||
/*!40000 DROP DATABASE IF EXISTS `{banco}`*/; |
|||
|
|||
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `{banco}` /*!40100 DEFAULT CHARACTER SET latin1 */; |
|||
|
|||
USE `{banco}`; |
|||
|
|||
''' |
|||
|
|||
|
|||
def normaliza_dump_mysql(nome_arquivo): |
|||
arquivo = Path(nome_arquivo).expand() |
|||
banco = arquivo.stem |
|||
conteudo = arquivo.read_file() |
|||
inicio = re.finditer('--\n-- Table structure for table .*\n--\n', conteudo) |
|||
inicio = next(inicio).start() |
|||
conteudo = cabecalho.format(banco=banco) + conteudo[inicio:] |
|||
arquivo.write_file(conteudo) |
|||
|
|||
|
|||
if __name__ == "__main__": |
|||
nome_aquivo = sys.argv[1] |
|||
normaliza_dump_mysql(nome_aquivo) |
|||
@ -1,28 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
ARQUIVO=$1 |
|||
BANCO=`basename $1 | cut -f1 -d.` |
|||
TMP=__tmp.sql |
|||
|
|||
cat << EOF > $TMP |
|||
|
|||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
|||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
|||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
|||
/*!40101 SET NAMES utf8 */; |
|||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; |
|||
/*!40103 SET TIME_ZONE='+00:00' */; |
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; |
|||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; |
|||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; |
|||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; |
|||
|
|||
/*!40000 DROP DATABASE IF EXISTS \`$BANCO\`*/; |
|||
|
|||
CREATE DATABASE /*!32312 IF NOT EXISTS*/ \`$BANCO\` /*!40100 DEFAULT CHARACTER SET latin1 */; |
|||
|
|||
USE \`$BANCO\`; |
|||
EOF |
|||
|
|||
sed 1,`grep -n '^USE ' $ARQUIVO |cut -f1 -d:`d $ARQUIVO >> $TMP |
|||
mv $TMP $ARQUIVO |
|||
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.9.13 on 2018-04-18 19:29 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('materia', '0027_auto_20180409_1443'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='materialegislativa', |
|||
name='numero_origem_externa', |
|||
field=models.CharField(blank=True, max_length=10, verbose_name='Número'), |
|||
), |
|||
] |
|||
@ -1,11 +0,0 @@ |
|||
estilo.css:DTML Method |
|||
indicacao.xsl:File |
|||
mocao.xsl:File |
|||
mocao2.xsl:File |
|||
parecer.xsl:File |
|||
pedido.xsl:File |
|||
pedido2.xsl:File |
|||
pl.xsl:File |
|||
pl2.xsl:File |
|||
requerimento.xsl:File |
|||
requerimento2.xsl:File |
|||
@ -1,95 +0,0 @@ |
|||
body { |
|||
font-family: Times; |
|||
text-align: justify; |
|||
font-size: 12 pt; |
|||
margin: 5px 1cm 20px 2cm; |
|||
} |
|||
|
|||
p, |
|||
.p{ |
|||
font-family: Times; |
|||
text-align: justify; |
|||
font-size: 12pt; |
|||
text-indent: 1.5cm; |
|||
margin: 40px 0 20px 0; |
|||
} |
|||
|
|||
.pequeno { |
|||
font-family: Times; |
|||
text-align: left; |
|||
font-size: 13pt; |
|||
margin: 0px 0 0px 0; |
|||
} |
|||
|
|||
.cabecalho { |
|||
font-family: Times; |
|||
font-weight:bold; |
|||
text-align: left; |
|||
font-size: 15pt; |
|||
margin: 10px 0 0px 0; |
|||
} |
|||
|
|||
.texto { |
|||
font-family: Times; |
|||
text-align: justify; |
|||
font-size: 12pt; |
|||
margin: 0px 0px 0px 0px; |
|||
} |
|||
|
|||
.data { |
|||
text-align: right; |
|||
} |
|||
|
|||
.autor { |
|||
text-align: center; |
|||
} |
|||
|
|||
.center { |
|||
text-align: center; |
|||
} |
|||
|
|||
.semrecuo { |
|||
text-indent: 0; |
|||
} |
|||
|
|||
.ementa { |
|||
text-align: justify; |
|||
margin-left: 50%; |
|||
text-indent: 0; |
|||
} |
|||
|
|||
.titulos1 { |
|||
text-align: center; |
|||
margin: 10px 0 0px 0; |
|||
} |
|||
|
|||
.titulos2 { |
|||
text-align: center; |
|||
margin: 0px 0 0px 0; |
|||
} |
|||
|
|||
p.artigo { |
|||
text-align: justify; |
|||
text-indent: 1cm; |
|||
margin: 10px 0 0px 0; |
|||
} |
|||
|
|||
|
|||
#imagem { |
|||
float:left; |
|||
} |
|||
|
|||
#autores |
|||
{ |
|||
-moz-column-count:3; /* Firefox */ |
|||
-webkit-column-count:3; /* Safari and Chrome */ |
|||
width:50px; |
|||
|
|||
} |
|||
|
|||
#col1 { width: 33%; float: left; center: 10px; } |
|||
#col2 { width: 33%; float: left; center: 10px; } |
|||
#col3 { width: 33%; float: left; center: 10px; } |
|||
|
|||
|
|||
|
|||
@ -1,51 +0,0 @@ |
|||
<?xml version="1.0" encoding="ISO-8859-1"?> |
|||
<xsl:stylesheet version="1.0" |
|||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|||
xmlns:ind="/XSD/Indicacao"> |
|||
|
|||
|
|||
<xsl:template match="/"> |
|||
<html> |
|||
<head> |
|||
<link href="/XSLT/HTML/estilo.css" rel="stylesheet" type="text/css"/> |
|||
</head> |
|||
<body> |
|||
|
|||
|
|||
<xsl:apply-templates /> |
|||
</body> |
|||
</html> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:ementa_text"> |
|||
<div> |
|||
<div id="imagem"> |
|||
<img border="0" src="http://sapl.agudo.rs.leg.br/generico/sapl_documentos/props_sapl/logo_casa"/><br></br> |
|||
</div><br></br> |
|||
<p class ="cabecalho">Câmara Municipal de Agudo</p> |
|||
<p class ="pequeno"> Estado do Rio Grande do Sul <br></br><br></br><br></br></p> |
|||
</div> |
|||
<p class="autor"><strong><xsl:value-of select="text()" /></strong></p> |
|||
|
|||
</xsl:template> |
|||
<xsl:template match="ind:autoria_text"> |
|||
<p class="semrecuo"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:destinatario_text"> |
|||
<p class="semrecuo"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:indicacao_text"> |
|||
<p><xsl:value-of select="text()" /></p> |
|||
|
|||
</xsl:template> |
|||
<xsl:template match="ind:data_text"> |
|||
<p><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:autor_text"> |
|||
<p class="autor"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
</xsl:stylesheet> |
|||
@ -1,41 +0,0 @@ |
|||
<?xml version="1.0" encoding="ISO-8859-1"?> |
|||
<xsl:stylesheet version="1.0" |
|||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|||
xmlns:moc="/XSD/Mocao"> |
|||
|
|||
<xsl:template match="/"> |
|||
<html> |
|||
<body> |
|||
<table> |
|||
<xsl:apply-templates /> |
|||
</table> |
|||
</body> |
|||
</html> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="moc:ementa_text"> |
|||
<tr> |
|||
<td width="50%"></td> |
|||
<td width="50%" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="moc:mocao_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="moc:data_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="moc:autor_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
</xsl:stylesheet> |
|||
@ -1,45 +0,0 @@ |
|||
<?xml version="1.0" encoding="ISO-8859-1"?> |
|||
<xsl:stylesheet version="1.0" |
|||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|||
xmlns:ind="/XSD/Mocao"> |
|||
|
|||
|
|||
<xsl:template match="/"> |
|||
<html> |
|||
<head> |
|||
<link href="/sapl/XSLT/HTML/estilo.css" rel="stylesheet" type="text/css"/> |
|||
</head> |
|||
<body> |
|||
<div> |
|||
<div id="imagem"> |
|||
<img border="0" src="/sapl/sapl_documentos/props_sapl/logo_casa"/> |
|||
</div><br></br> |
|||
<p class ="cabecalho">Câmara Municipal de Agudo</p> |
|||
<p class ="pequeno">Estado do Rio Grande do Sul<br></br><br></br><br></br> </p> |
|||
</div> |
|||
<xsl:apply-templates /> |
|||
</body> |
|||
</html> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:ementa_text"> |
|||
<p class ="autor"><strong><xsl:value-of select="text()" /></strong></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:mocao_text"> |
|||
<p class ="texto"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:justificativa_text"> |
|||
<p class ="texto"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:data_text"> |
|||
<p><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:autor_text"> |
|||
<p class="autor"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
</xsl:stylesheet> |
|||
@ -1,41 +0,0 @@ |
|||
<?xml version="1.0" encoding="ISO-8859-1"?> |
|||
<xsl:stylesheet version="1.0" |
|||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|||
xmlns:par="/XSD/Parecer"> |
|||
|
|||
<xsl:template match="/"> |
|||
<html> |
|||
<body> |
|||
<table> |
|||
<xsl:apply-templates /> |
|||
</table> |
|||
</body> |
|||
</html> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="par:ementa_text"> |
|||
<tr> |
|||
<td width="50%"></td> |
|||
<td width="50%" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="par:parecer_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="par:data_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="par:autor_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
</xsl:stylesheet> |
|||
@ -1,47 +0,0 @@ |
|||
<?xml version="1.0" encoding="ISO-8859-1"?> |
|||
<xsl:stylesheet version="1.0" |
|||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|||
xmlns:req="/XSD/Requerimento"> |
|||
|
|||
<xsl:template match="/"> |
|||
<html> |
|||
<body> |
|||
<table> |
|||
<xsl:apply-templates /> |
|||
</table> |
|||
</body> |
|||
</html> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="req:ementa_text"> |
|||
<tr> |
|||
<td width="50%"></td> |
|||
<td width="50%" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="req:requisicao_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="req:justificativa_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="req:data_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="req:autor_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
</xsl:stylesheet> |
|||
@ -1,53 +0,0 @@ |
|||
<?xml version="1.0" encoding="ISO-8859-1"?> |
|||
<xsl:stylesheet version="1.0" |
|||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|||
xmlns:ind="/XSD/Pedido"> |
|||
|
|||
|
|||
<xsl:template match="/"> |
|||
<html> |
|||
<head> |
|||
<link href="/sapl/XSLT/HTML/estilo.css" rel="stylesheet" type="text/css"/> |
|||
</head> |
|||
<body> |
|||
<div> |
|||
<div id="imagem"> |
|||
<img border="0" src="/sapl/sapl_documentos/props_sapl/logo_casa"/> |
|||
</div><br></br> |
|||
<p class ="cabecalho">Câmara Municipal de Agudo</p> |
|||
<p class ="pequeno">Estado do Rio Grande do Sul<br></br><br></br><br></br> </p> |
|||
</div> |
|||
<xsl:apply-templates /> |
|||
</body> |
|||
</html> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:ementa_text"> |
|||
<p class ="autor"><strong><xsl:value-of select="text()" /></strong></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:autoria_text"> |
|||
<p class="semrecuo"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:destinatario_text"> |
|||
<p class="semrecuo"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:solicitacao_text"> |
|||
<p class="texto"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:alinea_text"> |
|||
<p class="texto"><xsl:value-of select="concat(../@Rotulo,' ',text())"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:data_text"> |
|||
<p><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:autor_text"> |
|||
<p class="autor"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
</xsl:stylesheet> |
|||
@ -1,105 +0,0 @@ |
|||
<?xml version="1.0" encoding="ISO-8859-1"?> |
|||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pl="/XSD/ProjLei"> |
|||
<xsl:output encoding="ISO-8859-1"/> |
|||
<xsl:template match="/pl:pl"> |
|||
<html> |
|||
<head> |
|||
<title> |
|||
<xsl:value-of select="@id"/> |
|||
</title> |
|||
<style type="text/css"> |
|||
body {margin-left: 2cm; margin-right: 1cm;} |
|||
p {font-family: Times; font-size: 12pt;} |
|||
p.epigrafe {text-align: center; text-transform: uppercase;} |
|||
p.ementa {text-align: justify; margin-left: 50%;} |
|||
p.preambulo {text-transform: uppercase; text-indent: 1cm;} |
|||
p.artigo {text-align: justify; text-indent: 1cm;} |
|||
p.paragrafo {text-align: justify; text-indent: 1cm;} |
|||
p.inciso {text-align: justify; text-indent: 1cm;} |
|||
p.alinea {text-align: justify; text-indent: 1cm;} |
|||
p.item {text-align: justify; text-indent: 1cm;} |
|||
p.justificativa {text-align: justify; text-indent: 1cm;} |
|||
p.mensagem {text-align: justify;} |
|||
p.data_apresentacao {text-align: justify; text-indent: 1cm;} |
|||
p.autor {text-align: center; text-transform: uppercase;} |
|||
h3.cab_secao {text-align: center; font-size: 12pt;} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<xsl:apply-templates/> |
|||
</body> |
|||
</html> |
|||
</xsl:template> |
|||
<xsl:template match="pl:proposicao"> |
|||
<hr/> |
|||
<h3 class="cab_secao">PROPOSIÇÃO</h3> |
|||
<hr/> |
|||
<xsl:apply-templates select="./*"/> |
|||
</xsl:template> |
|||
<xsl:template match="pl:epigrafe"> |
|||
<p class="epigrafe"> |
|||
<xsl:value-of select="pl:epigrafe_text"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:ementa"> |
|||
<p class="ementa"> |
|||
<xsl:value-of select="pl:ementa_text"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:preambulo"> |
|||
<p class="preambulo"> |
|||
<xsl:value-of select="pl:preambulo_text"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:artigo_text"> |
|||
<p class="artigo"> |
|||
<xsl:value-of select="concat(../@Rotulo,' ',text())"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:paragrafo_text"> |
|||
<p class="paragrafo"> |
|||
<xsl:value-of select="concat(../@Rotulo,' ',text())"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:inciso_text"> |
|||
<p class="inciso"> |
|||
<xsl:value-of select="concat(../@Rotulo,' - ',text())"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:alinea_text"> |
|||
<p class="alinea"> |
|||
<xsl:value-of select="concat(../@Rotulo,' ',text())"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:item_text"> |
|||
<p class="item"> |
|||
<xsl:value-of select="concat(../@Rotulo,' ',text())"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:data_apresentacao_text"> |
|||
<p class="data_apresentacao"> |
|||
<xsl:value-of select="text()"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:autor_text"> |
|||
<p class="autor"> |
|||
<xsl:value-of select="text()"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:justificativa"> |
|||
<hr/> |
|||
<h3 class="cab_secao">JUSTIFICATIVA</h3> |
|||
<hr/> |
|||
<p class="justificativa"> |
|||
<xsl:value-of select="pl:justificativa_text"/> |
|||
</p> |
|||
</xsl:template> |
|||
<xsl:template match="pl:mensagem"> |
|||
<hr/> |
|||
<h3 class="cab_secao">MENSAGEM</h3> |
|||
<hr/> |
|||
<p class="mensagem"> |
|||
<xsl:value-of select="pl:mensagem_text"/> |
|||
</p> |
|||
</xsl:template> |
|||
</xsl:stylesheet> |
|||
@ -1,100 +0,0 @@ |
|||
<?xml version="1.0" encoding="ISO-8859-1"?> |
|||
<xsl:stylesheet version="1.0" |
|||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|||
xmlns:ind="/XSD/ProjLei"> |
|||
|
|||
|
|||
<xsl:template match="/"> |
|||
<html> |
|||
<head> |
|||
<link href="/sapl/XSLT/HTML/estilo.css" rel="stylesheet" type="text/css"/> |
|||
</head> |
|||
<body> |
|||
<div> |
|||
<div id="imagem"> |
|||
<img border="0" src="/sapl/sapl_documentos/props_sapl/logo_casa"/> |
|||
</div><br></br> |
|||
<p class ="cabecalho">Câmara Municipal de Agudo</p> |
|||
<p class ="pequeno">Estado do Rio Grande do Sul<br></br><br></br><br></br> </p> |
|||
</div> |
|||
|
|||
<xsl:apply-templates /> |
|||
</body> |
|||
</html> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:epigrafe_text"> |
|||
<p class ="autor"><strong><xsl:value-of select="text()" /></strong></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:ementa_text"> |
|||
<p class ="ementa"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:preambulo_text"> |
|||
<p class ="artigo"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:parte_text"> |
|||
<p class ="titulos1"><xsl:value-of select="concat(../@Rotulo,' ')"/></p> |
|||
<p class ="titulos2"><xsl:value-of select="text()"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:livro_text"> |
|||
<p class ="titulos1"><xsl:value-of select="concat(../@Rotulo,' ')"/></p> |
|||
<p class ="titulos2"><xsl:value-of select="text()"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:titulo_text"> |
|||
<p class ="titulos1"><xsl:value-of select="concat(../@Rotulo,' ')"/></p> |
|||
<p class ="titulos2"><xsl:value-of select="text()"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:capitulo_text"> |
|||
<p class ="titulos1"><xsl:value-of select="concat(../@Rotulo,' ')"/></p> |
|||
<p class ="titulos2"><xsl:value-of select="text()"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:secao_text"> |
|||
<p class ="titulos1"><xsl:value-of select="concat(../@Rotulo,' ')"/></p> |
|||
<p class ="titulos2"><xsl:value-of select="text()"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:subsecao_text"> |
|||
<p class ="titulos1"><xsl:value-of select="concat(../@Rotulo,' ')"/></p> |
|||
<p class ="titulos2"><xsl:value-of select="text()"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:artigo_text"> |
|||
<p class="artigo"><xsl:value-of select="concat(../@Rotulo,' ',text())"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:paragrafo_text"> |
|||
<p class="artigo"><xsl:value-of select="concat(../@Rotulo,' ',text())"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:inciso_text"> |
|||
<p class="artigo"><xsl:value-of select="concat(../@Rotulo,' ',text())"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:alinea_text"> |
|||
<p class="artigo"><xsl:value-of select="concat(../@Rotulo,' ',text())"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:item_text"> |
|||
<p class="artigo"><xsl:value-of select="concat(../@Rotulo,' ',text())"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:data_apresentacao_text"> |
|||
<p class="artigo"><xsl:value-of select="concat(../@Rotulo,' ',text())"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:autor_text"> |
|||
<p class="artigo"><xsl:value-of select="concat(../@Rotulo,' ',text())"/></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:justificativa_text"> |
|||
<p class="artigo"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
</xsl:stylesheet> |
|||
@ -1,52 +0,0 @@ |
|||
<?xml version="1.0" encoding="ISO-8859-1"?> |
|||
<xsl:stylesheet version="1.0" |
|||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|||
xmlns:req="/XSD/Requerimento"> |
|||
|
|||
<xsl:template match="/"> |
|||
<html> |
|||
<body> |
|||
<table> |
|||
<xsl:apply-templates /> |
|||
</table> |
|||
</body> |
|||
</html> |
|||
</xsl:template> |
|||
<xsl:template match="req:destinatario_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="req:ementa_text"> |
|||
<tr> |
|||
<td width="50%"></td> |
|||
<td width="50%" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="req:requisicao_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="req:justificativa_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="req:data_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="req:autor_text"> |
|||
<tr> |
|||
<td colspan="2" align="left"><xsl:value-of select="text()" /></td> |
|||
</tr> |
|||
</xsl:template> |
|||
|
|||
</xsl:stylesheet> |
|||
@ -1,57 +0,0 @@ |
|||
<?xml version="1.0" encoding="ISO-8859-1"?> |
|||
<xsl:stylesheet version="1.0" |
|||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|||
xmlns:ind="/XSD/Requerimento"> |
|||
|
|||
|
|||
<xsl:template match="/"> |
|||
<html> |
|||
<head> |
|||
<link href="/sapl/XSLT/HTML/estilo.css" rel="stylesheet" type="text/css"/> |
|||
</head> |
|||
<body> |
|||
<div> |
|||
<div id="imagem"> |
|||
<img border="0" src="/sapl/sapl_documentos/props_sapl/logo_casa"/> |
|||
</div><br></br> |
|||
<p class ="cabecalho">Câmara Municipal de Agudo</p> |
|||
<p class ="pequeno">Estado do Rio Grande do Sul<br></br><br></br><br></br> </p> |
|||
</div> |
|||
<xsl:apply-templates /> |
|||
</body> |
|||
</html> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:ementa_text"> |
|||
<p class="autor"><strong><xsl:value-of select="text()" /></strong></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:formatratamento_text"> |
|||
<p class="semrecuo"><xsl:value-of select="text()"/> </p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:parlamentar_text"> |
|||
<p class="semrecuo"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:cargofuncao_text"> |
|||
<p class="semrecuo"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:requisicao_text"> |
|||
<p class="texto"><xsl:value-of select="text()" /></p> |
|||
|
|||
</xsl:template> |
|||
<xsl:template match="ind:justificativa_text"> |
|||
<p class="texto"><xsl:value-of select="text()" /></p> |
|||
|
|||
</xsl:template> |
|||
<xsl:template match="ind:data_text"> |
|||
<p><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
<xsl:template match="ind:autor_text"> |
|||
<p class="autor"><xsl:value-of select="text()" /></p> |
|||
</xsl:template> |
|||
|
|||
</xsl:stylesheet> |
|||
Loading…
Reference in new issue