← ClaudeAtlas

advpl-weblisted

Interfaces web no Protheus — ADVPL ASP (.APH/.APW), módulos web Webex, métodos HTTP GET/POST/HTTPSESSION/COOKIE, threads pool JOB_WEBEX no appserver.ini, portais multi-empresa com RpcSetEnv (aceitável aqui, diferente de REST), upload/download, PEs APWEBEX. Use ao construir UI web Protheus server-rendered. Para REST/JSON, veja advpl-webservice.
JoniPraia/plugadvpl · ★ 12 · Web & Frontend · score 66
Install: claude install-skill JoniPraia/plugadvpl
# advpl-web — Desenvolvimento web no Protheus ADVPL Web (ASP-style) permite o **AppServer Protheus** atuar como servidor HTTP servindo páginas dinâmicas — sem precisar de IIS/Apache na frente. Usa arquivos `.APH` (ADVPL HTML) ou `.APW` (ADVPL Web Process) que misturam HTML + tags ADVPL embarcadas. Diferente do REST (skill `[[advpl-webservice]]`), ADVPL Web é **server-rendered**: o servidor monta HTML e devolve ao browser. ## Quando usar - Usuário pede "página web Protheus", "portal", "tela HTML servida pelo AppServer". - Edit em `.APH` (ADVPL HTML) ou `.APW` (ADVPL Web Process). - Funções `ApWebEx*`, `WebPageOpen`, `WebPageProc`, `HTTPGet`, `HTTPPost`. - Portal multi-empresa/filial com login. - Upload/download de arquivos via HTTP no AppServer. - **NÃO** use para API REST/JSON — para isso veja `[[advpl-webservice]]`. ## Arquivos .APH — ADVPL HTML server-rendered ```html <% #include "apwebex.ch" Local cCod := HTTPGet("cod") DbSelectArea("SA1") DbSetOrder(1) DbSeek(xFilial("SA1") + cCod) %> <html> <head><title>Cliente</title></head> <body> <h1>Cliente: <%= SA1->A1_COD %></h1> <p>Nome: <%= AllTrim(SA1->A1_NOME) %></p> <% If !Empty(SA1->A1_CGC) %> <p>CNPJ: <%= SA1->A1_CGC %></p> <% EndIf %> </body> </html> ``` Sintaxe: - `<% código ADVPL %>` — bloco ADVPL (executa, não imprime). - `<%= expressao %>` — escreve resultado da expressão no HTML. > **Include obrigatório:** `#include "apwebex.ch"` — sem ele, o ADVPL compila mas as fun