Unit mi.rtl.objects.methods.pageproducer
Descrição
A unit
mi.rtl.objects.methods.pageproducer
implementa as propriedade e métodos para produzir página html, semelhante a unit HTTPProd do Delphi.NOTAS -
VERSÃO
Alpha - 1.0.0
HISTÓRICO
Criado por: Paulo Sérgio da Silva Pacheco e-mail: paulosspacheco@yahoo.com.br
23/07/2023
08:12 a 12:00: Criar a unit
mi.rtl.objects.methods.pageproducer
24/07/2023
08:45 a 12:00: Documento da unit
14:00 a 17:30: Documento da unit
25/07/2023
08:15 a 12:00: Documento da unit
13:30 a 17:30: Documento da unit
10/08/2023
08:10 a 12:00: Implementar componente TPageProducer
16/08/2023
08:00 a 12:00: T12 Criar o componente TPageProducer. A procedure create_css_table() deve criar o arquivo na pasta template/css
13:20 a 17:25: T12 Criar o componente TPageProducer.GetHtmlTable
16/08/2023
08:00 a 12:00 T12 Documentar componente TPageProducer
13:30 a 17:30 T12 Documentar componente TPageProducer
17/08/2023
08:00 a 11:56 T12 Documentar componente TPageProducer
13:30 a 17:17 T12 Documentar componente TPageProducer
18/08/2023
09:55 a 12:00 T12 Documentar componente TPageProducer
14:23 a 17:15 T12 Documentar componente TPageProducer
25/08/2023
09:35 a 12:00 T12 Documentar componente TPageProducer
14:23 a 17:15 T12 Documentar componente TPageProducer
CÓDIGO FONTE:
Uses
- Classes
- SysUtils
- StrUtils
- LResources
- Contnrs
- FPTemplate
- mi.rtl.Consts
- mi.rtl.Objects.Methods
- mi.rtl.miStringlist
- mi.rtl.Objects.Methods.Paramexecucao.Application
Visão Geral
Classes, Interfaces, Objetos e Registros
Nome Descrição Classe TBasePageProducer
Classe TPageProducer
Funções e Procedimentos
procedure register;
Constantes
Template_html_tglink = '<!--# tgLink [- TagName=[a href="˜url" target="_blank" title="˜title"] ˜text [/a] -] #-->';
Tag_html_tgTable = ''+ '<!--# tgTable [- TagName=[Alias="Titulo da tabela";'+TConsts.New_Line+ ' Header="Column1: ",":Column2:",":Column3",":Column4" ;'+TConsts.New_Line+ ' widths="300px" ,"250px" ,"150px" ,"180px" ;'+TConsts.New_Line+ ' OneRow=[" a11 "," a12 "," a13r "," a14 ",/,'+TConsts.New_Line+ ' " a21 "," a22 "," a23r "," a24 ",/,'+TConsts.New_Line+ ' ];'+TConsts.New_Line+ ' Footer="soma Columm1","soma Columm2","soma Columm3","soma Columm4";'+TConsts.New_Line+ ' NotFound="Mensagem em caso de erro";'+TConsts.New_Line+ ' template="<Table id="table">'+TConsts.New_Line+ ' <thead id="theadTagName">'+TConsts.New_Line+ ' <tr><th colspan="4"> <p style="text-align: center"> ˜Alias </p> </th> </tr>'+TConsts.New_Line+ ' <tr>˜HeaderCols</tr>'+TConsts.New_Line+ ' </thead>'+TConsts.New_Line+ ' <tbody id="tbodyTagName">'+TConsts.New_Line+ ' ˜OneRowCols'+TConsts.New_Line+ ' </tbody>'+TConsts.New_Line+ ' <tfoot id="tfootTagName">'+TConsts.New_Line+ ' ˜FooterCols'+TConsts.New_Line+ ' </tfoot>'+TConsts.New_Line+ ' </Table>"'+TConsts.New_Line+ ' ]'+TConsts.New_Line+ ' -]'+TConsts.New_Line+ '#-->'+TConsts.New_Line;
Tag_html_tgImage = ''+ '<!--# tgImage [- $Param(NomeDaFigura)=[<figure>'+TConsts.New_Line+ ' <img src="˜src"'+TConsts.New_Line+ ' alt="˜alt"'+TConsts.New_Line+ ' title="˜title"'+TConsts.New_Line+ ' style="width:10%">'+TConsts.New_Line+ ' <figcaption>˜figcaption</figcaption>'+TConsts.New_Line+ ' </figure>'+TConsts.New_Line+ ' ]'+TConsts.New_Line+ ' -]'+TConsts.New_Line+ '#-->'+TConsts.New_Line;
Tag_html_tgImageMap = ''+ '<!--# tgImageMap [- $Param(NomeDaImagem)=[ src="./img/$Param(NomeDaImagem).jpg";'+TConsts.New_Line+ ' usemap="$Param(NomeDaImagem)";'+TConsts.New_Line+ ' OneRowArea=["$Param(rect)" , "$Param(target)" , "$Param(alt_rect)" , "$Param(title_rect)" , "$Param(href_rect.html)" , "$Param(y1),$Param(y1),$Param(x2),$Param(y2)",/,'+TConsts.New_Line+ ' "$Param(circle)" , "$Param(target)" , "$Param(alt_circle)" , "$Param(title_circle)" , "$Param(href_circle.html)" , "$Param(x1),$Param(y1),$Param(raio)",/,'+TConsts.New_Line+ ' "$Param(poly)" , "$Param(target)" , "$Param(alt_poly)" , "$Param(title_poly)" , "$Param(href_poly.html)" , "$Param(x1),$Param(y1),$Param(x2),$Param(y2),$Param(x3),$Param(y3),$Param(x4),$Param(y4)$Param(..),$Param(xn),$Param(yn)",/,'+TConsts.New_Line+ ' <!-- Adicione aqui ,mais linhas semelhantes a linha acima e apague esse comentário-->'+TConsts.New_Line+ ' ];'+TConsts.New_Line+ ' templateOneRowArea=<area target="˜target" alt="˜alt" title="˜title" href="˜href" coords="˜coords" shape="˜shape">;'+TConsts.New_Line+ ' templateImageMap="< img src="˜src"'+TConsts.New_Line+ ' alt="˜alt"'+TConsts.New_Line+ ' usemap="#˜usemap">'+TConsts.New_Line+ ' <map name="˜usemap">'+TConsts.New_Line+ ' <area shape="default" nohref />'+TConsts.New_Line+ ' ˜OneRowArea'+TConsts.New_Line+ ' </map>"'+TConsts.New_Line+ ' ]'+TConsts.New_Line+ ' -]'+TConsts.New_Line+ '#-->'+TConsts.New_Line;
Descrição
Funções e Procedimentos
procedure register;
Constantes
Template_html_tglink = '<!--# tgLink [- TagName=[a href="˜url" target="_blank" title="˜title"] ˜text [/a] -] #-->';
O recurso
Template_html_tglink
é usado como template para o componente TBasePageProducer com a finalidade de produzir links variáveis.O evento OnHTMLTag_tgLink deve ser usado para preencher as varáveis do template.
PARÂMETROS
TagName = Nome do template.
Deve ser informado no template
˜url = Endereço do link
Deve ser informado no evento OnHTMLTag_tgLink
˜target = Destino onde a página deve ser aberta, se vazio abre na aba atual.
Deve ser informado no evento OnHTMLTag_tgLink
˜title = Documentação do link
Deve ser informado no evento OnHTMLTag_tgLink
˜text = Descrição do link
Deve ser informado no evento OnHTMLTag_tgLink
Exemplo de uso:
<!--# tgLink [- PsspAppBr=[a href="˜url" target="˜target" title="˜title"] ˜text [/a] -] #--> <!--# tgCustom [- ListFilesText=Arquivo:-"˜ListFilesText" -] #-->
Tag_html_tgTable = ''+ '<!--# tgTable [- TagName=[Alias="Titulo da tabela";'+TConsts.New_Line+ ' Header="Column1: ",":Column2:",":Column3",":Column4" ;'+TConsts.New_Line+ ' widths="300px" ,"250px" ,"150px" ,"180px" ;'+TConsts.New_Line+ ' OneRow=[" a11 "," a12 "," a13r "," a14 ",/,'+TConsts.New_Line+ ' " a21 "," a22 "," a23r "," a24 ",/,'+TConsts.New_Line+ ' ];'+TConsts.New_Line+ ' Footer="soma Columm1","soma Columm2","soma Columm3","soma Columm4";'+TConsts.New_Line+ ' NotFound="Mensagem em caso de erro";'+TConsts.New_Line+ ' template="<Table id="table">'+TConsts.New_Line+ ' <thead id="theadTagName">'+TConsts.New_Line+ ' <tr><th colspan="4"> <p style="text-align: center"> ˜Alias </p> </th> </tr>'+TConsts.New_Line+ ' <tr>˜HeaderCols</tr>'+TConsts.New_Line+ ' </thead>'+TConsts.New_Line+ ' <tbody id="tbodyTagName">'+TConsts.New_Line+ ' ˜OneRowCols'+TConsts.New_Line+ ' </tbody>'+TConsts.New_Line+ ' <tfoot id="tfootTagName">'+TConsts.New_Line+ ' ˜FooterCols'+TConsts.New_Line+ ' </tfoot>'+TConsts.New_Line+ ' </Table>"'+TConsts.New_Line+ ' ]'+TConsts.New_Line+ ' -]'+TConsts.New_Line+ '#-->'+TConsts.New_Line;
O recurso
Tag_html_tgTable
é usado para criar tabela em um arquivo de modelo.PARÂMETROS
TagName=[] : Nome da tag
Deve ser informado na tag;
Alias : Título da tabela
Deve ser informado na tag;
Header : Lista os rótulos do título da tabela
Deve ser informado na tag;
widths : Lista as larguras das colunas e alinhamentos onde o : indica se o alinhamento usando as regras do markdown.
Deve ser informado na tag;
OneRow=[] : Matriz do conteúdo com todas as linhas e colunas da tabela, onde o número de colunas deve coincidir o número de elementos do Header e número de elementos do widths e o número de elementos do Footer.
Deve ser informado na tag;
NotFound : String com uma mensagem de erro se existir.
Deve ser informado na tag;
Footer : Lista as somas impressas no rodapé da tabela, podendo ser omitida;
Deve ser informado na tag;
Template : Template de uma tabela onde os parâmetros acima serão inseridos.
Deve ser informado na tag;
Notas:
Parâmetros obrigatórios do template:
id="table", onde o nome table deve ser um elemento .css no heard da página.
Deve ser informado na tag;
id="theadTagName", onde a palavra tagName deve ter o mesmo nome do parâmetro tagName[] acima;
Deve ser informado na tag;
id="tbodyTagName", onde a palavra tagName deve ter o mesmo nome do parâmetro tagName[] acima;
Deve ser informado na tag;
id="tfootTagName", onde a palavra tagName deve ter o mesmo nome do parâmetro tagName[] acima;
Deve ser informado na tag;
colspan="4", onde 4 deve ser substituído pelo número de colunas a ser mesclada para formar a barra de títulos;
Deve ser informado na tag;
˜Alias : Indica a posição onde o título deve ser inserido;
Deve ser informado na tag;
˜HeaderCols : Indica a posição onde a lista de rótulos deve ser inserida;
Deve ser informado na tag;
˜OneRowCols : Indica a posição onde a matriz de linhas e colunas deve ser inserida;
Deve ser informado na tag;
˜FooterCols : Indica a posição onde a lista Footer deve ser inserida;
Deve ser informado na tag;
Exemplo de uso:
<!--# tgTable [- ALUNOS=[Alias="Cadastro de Alunos"; Header="Column1: ",":Column2: ",":Column3 ",":Column4 "; widths="300px" ,"250px" ,"150px" ,"180px"; OneRow=["1 Paulo Sérgio","Marcos Pacheco","George Bruno ","George Bruno",/, "2 José Carlos" ,"Antônio ","Paulo Henrique","George Bruno",/, ]; Footer="soma Columm1","soma Columm2","soma Columm3","soma Columm4"; NotFound="Mensagem em caso de erro"; template="<Table id="table"> <thead id="theadAlunos"> <tr><th colspan="4"> <p style="text-align: center"> ˜Alias </p> </th> </tr> <tr>˜HeaderCols</tr> </thead> <tbody id="tbodyAlunos"> ˜OneRowCols </tbody> <tfoot id="tfootAlunos"> ˜FooterCols </tfoot> </Table>" ] -] #-->
NOTAS
As palavras que começam com o sinal ˜ são substituídas no evento OnHTMLTag_tgTable pelos dados informados na própria tag, porém em caso de omissão do dado, o programa pode inserir uma varável específica.
Tag_html_tgImage = ''+ '<!--# tgImage [- $Param(NomeDaFigura)=[<figure>'+TConsts.New_Line+ ' <img src="˜src"'+TConsts.New_Line+ ' alt="˜alt"'+TConsts.New_Line+ ' title="˜title"'+TConsts.New_Line+ ' style="width:10%">'+TConsts.New_Line+ ' <figcaption>˜figcaption</figcaption>'+TConsts.New_Line+ ' </figure>'+TConsts.New_Line+ ' ]'+TConsts.New_Line+ ' -]'+TConsts.New_Line+ '#-->'+TConsts.New_Line;
Tag_html_tgImageMap = ''+ '<!--# tgImageMap [- $Param(NomeDaImagem)=[ src="./img/$Param(NomeDaImagem).jpg";'+TConsts.New_Line+ ' usemap="$Param(NomeDaImagem)";'+TConsts.New_Line+ ' OneRowArea=["$Param(rect)" , "$Param(target)" , "$Param(alt_rect)" , "$Param(title_rect)" , "$Param(href_rect.html)" , "$Param(y1),$Param(y1),$Param(x2),$Param(y2)",/,'+TConsts.New_Line+ ' "$Param(circle)" , "$Param(target)" , "$Param(alt_circle)" , "$Param(title_circle)" , "$Param(href_circle.html)" , "$Param(x1),$Param(y1),$Param(raio)",/,'+TConsts.New_Line+ ' "$Param(poly)" , "$Param(target)" , "$Param(alt_poly)" , "$Param(title_poly)" , "$Param(href_poly.html)" , "$Param(x1),$Param(y1),$Param(x2),$Param(y2),$Param(x3),$Param(y3),$Param(x4),$Param(y4)$Param(..),$Param(xn),$Param(yn)",/,'+TConsts.New_Line+ ' <!-- Adicione aqui ,mais linhas semelhantes a linha acima e apague esse comentário-->'+TConsts.New_Line+ ' ];'+TConsts.New_Line+ ' templateOneRowArea=<area target="˜target" alt="˜alt" title="˜title" href="˜href" coords="˜coords" shape="˜shape">;'+TConsts.New_Line+ ' templateImageMap="< img src="˜src"'+TConsts.New_Line+ ' alt="˜alt"'+TConsts.New_Line+ ' usemap="#˜usemap">'+TConsts.New_Line+ ' <map name="˜usemap">'+TConsts.New_Line+ ' <area shape="default" nohref />'+TConsts.New_Line+ ' ˜OneRowArea'+TConsts.New_Line+ ' </map>"'+TConsts.New_Line+ ' ]'+TConsts.New_Line+ ' -]'+TConsts.New_Line+ '#-->'+TConsts.New_Line;
Gerado por PasDoc 0.16.0.