From 31580e270179a16c9b0ab359d5060369ac7c6b8a Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 04:36:31 +0200 Subject: [PATCH 01/57] New translations updates.md (Spanish) --- .../docusaurus-plugin-content-docs/version-20/Notes/updates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/Notes/updates.md b/i18n/es/docusaurus-plugin-content-docs/version-20/Notes/updates.md index 2baa81e494ea4c..b3728efa113318 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/Notes/updates.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/Notes/updates.md @@ -25,7 +25,7 @@ Por razones internas, la versión de los clientes remotos que se conectan a 4D S #### Cambios de comportamiento -- As of 4D **20.7 HF2**, the [`Time`](https://doc.4d.com/4dv20/help/command/en/page179.html) command returns a negative time expression when the *timeValue* parameter is negative. For instance, `Time("-01:02:03")` will now return -01:02:03. In previous releases, the negative sign was ignored. +- As of 4D **20.7 HF2**, the [`Time`](https://doc.4d.com/4dv20/help/command/en/page179.html) command returns a negative time expression when the *timeValue* parameter is negative. For instance, `Time("-01:02:03")` will now return -01:02:03. En versiones anteriores, se ignoraba el signo negativo. ## 4D 20.6 LTS From 1d5568c241699e54407973085a55e2f28ccccb9b Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 06:03:04 +0200 Subject: [PATCH 02/57] New translations forms.md (Spanish) --- .../current/FormEditor/forms.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/FormEditor/forms.md b/i18n/es/docusaurus-plugin-content-docs/current/FormEditor/forms.md index dd34615ea6612d..3372865a4eb79b 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/FormEditor/forms.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/FormEditor/forms.md @@ -147,27 +147,27 @@ En este caso, el modo de renderizado Fluent UI se utilizará por defecto en Wind Cada formulario puede definir su propio renderizado a través de la propiedad **Apariencia de los Widgets**. Las siguientes opciones están disponibles: - **Heredado**: hereda las propiedades globales de la aplicación (por defecto), -- **Classic**: uses the classic Windows style, -- **Fluent UI**: enables the modern rendering based on Fluent UI.
+- **Classic**: utiliza el estilo clásico de Windows, +- **Fluent UI**: permite el renderizado moderno basado en Fluent UI.
![](../assets/en/FormObjects/fluentui-form.png) -The corresponding [JSON form property](./properties_JSONref.md) is `fluentUI` with value undefined (i.e. inherited, default value), "true" or "false". +La [propiedad de formulario JSON](./properties_JSONref.md) correspondiente es `fluentUI` con el valor undefined (es decir, heredado, valor por defecto), "true" o "false". ### Comportamientos específicos -When using 4D forms with Fluent UI rendering, you need to pay attention to the following points: +Cuando utilice los formularios 4D con el renderizado Fluent UI, debe prestar atención a los siguientes puntos: -- El nuevo comando `FORM Windows theme` devuelve el tema de visualización actual del formulario. Possible values: "Classic" or "FluentUI". If there is no current form or the command is called on macOS, and empty string is returned. -- If [`GET STYLE SHEET INFO`](../commands-legacy/get-style-sheet-info.md) is called in the context of a form, the information returned relates to the current appearance of the form (Classic or FluentUI). If the command is called outside the context of a form, the information returned relates to the [global project settings](#application-setting). -- [`SET MENU ITEM STYLE`](../commands-legacy/set-menu-item-style.md) with `Underline` *itemStyle* parameter is not supported (ignored) for pop up menus. -- [Stepper](../FormObjects/stepper.md) form object does not support [double-click event](../Events/onDoubleClicked.md). -- [Circle buttons](../FormObjects/button_overview.md#circle) are supported (similar as macOS). -- The [`WA ZOOM IN`](../commands-legacy/wa-zoom-in.md) / [`WA ZOOM OUT`](../commands-legacy/wa-zoom-out.md) commands are not supported in Web areas with system rendering engine. -- A focus ring can be added to picture and text [inputs](../FormObjects/input_overview.md). +- El nuevo comando `FORM Windows theme` devuelve el tema de visualización actual del formulario. Valores posibles: "Classic" o "FluentUI". Si no existe un formulario actual o el comando se ejecuta en macOS, se devuelve una cadena vacía. +- Si [`GET STYLE SHEET INFO`](../commands-legacy/get-style-sheet-info.md) es llamado en el contexto de un formulario, la información devuelta se refiere a la apariencia actual del formulario (Classic o FluentUI). Si se llama al comando fuera del contexto de un formulario, la información devuelta se refiere a las [propiedades globales del proyecto](#application-setting). +- [`SET MENU ITEM STYLE`](../commands-legacy/set-menu-item-style.md) con el parámetro *itemStyle* `Underline` no es soportado (ignorado) para los menús emergentes. +- El objeto de formulario [Stepper](../FormObjects/stepper.md) no admite el [evento doble clic](../Events/onDoubleClicked.md). +- Los [botones circulares](../FormObjects/button_overview.md#circle) son soportados (como en macOS). +- Los comandos [`WA ZOOM IN`](../commands-legacy/wa-zoom-in.md) / [`WA ZOOM OUT`](../commands-legacy/wa-zoom-out.md) no son compatibles en áreas Web con motor de renderizado sistema. +- Se puede añadir rectángulo de foco a las [entradas](../FormObjects/input_overview.md) imagen y texto. -:::info Limitations +:::info Limitaciones -This **Developer preview** includes some limitations, which are [listed in the related blog post](https://blog.4d.com/modernize-your-4d-interfaces-with-fluent-ui). +Esta **Vista previa para desarrolladores** incluye algunas limitaciones, que se [enumeran en la entrada del blog relacionado](https://blog.4d.com/modernize-your-4d-interfaces-with-fluent-ui). ::: From 295e7d8b9445ab9ed873b8c908aa44b9f8180c06 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 06:10:16 +0200 Subject: [PATCH 03/57] New translations updates.md (Spanish) --- .../current/Notes/updates.md | 106 +++++++++--------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md b/i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md index 65292b41b776d6..d12bff4e120eb8 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md @@ -9,50 +9,50 @@ Lea [**Novedades en 4D 21**](https://blog.4d.com/en-whats-new-in-4d-21/), la ent #### Lo más destacado -- Support of AI Vector Searches in the [`query()`](../API/DataClassClass.md#query-by-vector-similarity) function and in the [`$filter`](../REST/$filter.md#vector-similarity) REST API. -- Support of TLS encryption for the [4D.TCPConnection](../API/TCPConnectionClass.md#4dtcpconnectionnew) class. +- Soporte de búsquedas vectoriales de IA en la función [`query()`](../API/DataClassClass.md#query-by-vector-similarity) y en la API REST [`$filter`](../REST/$filter.md#vector-similarity). +- Soporte de encriptación TLS para la clase [4D.TCPConnection](../API/TCPConnectionClass.md#4dtcpconnectionnew). - Servidor Web: - - new [HTTP rules](../WebServer/http-rules.md) to customize HTTP response headers, - - ability to set [HTTP request handlers](../WebServer/http-request-handler.md) using a `handlers` property in the *settings* parameter of the Web server [`start()`](../API/WebServerClass.md#start) function, - - the Web server object contains new [`rules`](../API/WebServerClass.md#rules) and [`handlers`](../API/WebServerClass.md#handlers) properties. -- New [ORDA events on data](../ORDA/orda-events.md): validateSave, saving, afterSave, validateDrop, dropping, afterDrop. -- New option allowing to use certificates from Windows Certificate Store instead of a local certificates folder in [`HTTPRequest`](../API/HTTPRequestClass.md#4dhttprequestnew) and [`HTTPAgent`](../API/HTTPAgentClass.md#4dhttpagentnew) classes. + - nuevas [reglas HTTP](../WebServer/http-rules.md) para personalizar los encabezados de respuesta HTTP, + - posibilidad para definir los [gestores de peticiones HTTP](../WebServer/http-request-handler.md) utilizando una propiedad `handlers` en el parámetro *settings* de la función [`start()`](../API/WebServerClass.md#start) del servidor Web, + - el objeto servidor Web contiene nuevas propiedades [`rules`](../API/WebServerClass.md#rules) y [`handlers`](../API/WebServerClass.md#handlers). +- Nuevos [eventos ORDA sobre los datos](../ORDA/orda-events.md): validateSave, saving, afterSave, validateDrop, dropping, afterDrop. +- Nueva opción que permite utilizar certificados de Windows Certificate Store en lugar de una carpeta local de certificados en las clases [`HTTPRequest`](../API/HTTPRequestClass.md#4dhttprequestnew) y [`HTTPAgent`](../API/HTTPAgentClass.md#4dhttpagentnew). - Cliente/servidor: - - You can display Qodly pages in Web areas and [share the remote client session](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). - - The [QUIC network layer](../settings/client-server.md#network-layer) has been enhanced to handle network interface changes transparently, for example when you travel with your laptop. See [this blog post](https://blog.4d.com/work-and-move-with-quic-and-network-switching). -- You can now [create components directly from the host project](../Extensions/develop-components.md#creating-components) and [edit their code from a dedicated tab](../Extensions/develop-components.md#editing-all-component-code) in the 4D Explorer without leaving or restarting the project. -- The 4D product activation step has been simplified and automated during [sign-in](../GettingStarted/Installation.md#sign-in). -- 4D AIKit component: new features to [invoke a specific tool automatically](../aikit/Classes/OpenAIChatHelper.md#registertool) and [specify a response format](../aikit/Classes/OpenAIChatCompletionsParameters.md#response-format). + - Puede mostrar las páginas Qodly en las áreas Web y [compartir la sesión del cliente remoto](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). + - La [capa red QUIC](../settings/client-server.md#network-layer) se ha mejorado para gestionar los cambios de interfaz de red de forma transparente, por ejemplo, cuando viajas co su ordenador portátil. Ver [esta entrada del blog](https://blog.4d.com/work-and-move-with-quic-and-network-switching). +- Ahora puede [crear componentes directamente desde el proyecto local](../Extensions/develop-components.md#creating-components) y [editar su código desde una pestaña dedicada](../Extensions/develop-components.md#editing-all-component-code) en el Explorador 4D sin salir o reiniciar el proyecto. +- La etapa de activación del producto 4D se ha simplificado y automatizado durante la [conexión](../GettingStarted/Installation.md#sign-in). +- Componente 4D AIKit: nuevas funcionalidades para [invocar automáticamente una herramienta específica](../aikit/Classes/OpenAIChatHelper.md#registertool) y [especificar un formato de respuesta](../aikit/Classes/OpenAIChatCompletionsParameters.md#response-format). - Lenguaje 4D: - - New "trim" commands to remove leading and trailing spaces from a string: [`Trim`](../commands/trim.md), [`Trim start`](../commands/trim-start.md), and [`Trim end`](../commands/trim-end.md). + - Nuevos comandos "trim" para eliminar los espacios iniciales y finales de una cadena: [`Trim`](../commands/trim.md), [`Trim start`](../commands/trim-start.md) y [`Trim end`](../commands/trim-end.md). - Los comandos [`Num`](../commands/num.md) y [`String`](../commands/string.md) han sido actualizados para soportar conversiones en diferentes bases (radix). -- [**Fixed bug list**](https://bugs.4d.fr/fixedbugslist?version=21): list of all bugs that have been fixed in 4D 21. +- [**Lista de bugs corregidos**](https://bugs.4d.fr/fixedbugslist?version=21): lista de todos los bugs que se han corregido en 4D 21. #### Vista previa para desarrolladores -[**Fluent UI** rendering for 4D forms](../FormEditor/forms.md#fluent-ui-rendering-developer-preview) is proposed in Developer Preview during the beta test program. +El [renderizado **Fluent UI** para los formularios 4D](../FormEditor/forms.md#fluent-ui-rendering-developer-preview) está disponible en Developer Preview durante el programa de pruebas beta. #### Cambios de comportamiento -:::caution Index rebuild +:::caution Reconstrucción del índice -4D 21 includes an ICU library update ([see below](#library-table)) which will force an automatic rebuild of indexes of type alpha, text, and object. Dependiendo del tamaño del archivo de datos, esta operación puede llevar un tiempo y puede ser necesario planificarla. +4D 21 incluye una actualización de la librería ICU ([ver abajo](#library-table)) que forzará una reconstrucción automática de los índices de tipo alfa, texto y objeto. Dependiendo del tamaño del archivo de datos, esta operación puede llevar un tiempo y puede ser necesario planificarla. ::: -- Web services (SOAP): when [scalable sessions](../WebServer/sessions.md#enabling-web-sessions) are enabled, web services now run in [**preemptive processes**](../Develop/preemptive.md) in compiled mode. Make sure your SOAP code is thread-safe. -- Web server: the support of deprecated `4DSYNC/` and `4DCGI/` URLs is removed. Ya no se realiza ningún tratamiento específico en estas URL. +- Servicios web (SOAP): cuando las [sesiones escalables](../WebServer/sessions.md#enabling-web-sessions) están activadas, los servicios web se ejecutan ahora en [**procesos apropiativos**](../Develop/preemptive.md) en modo compilado. Asegúrese de que su código SOAP es hilo seguro. +- Servidor web: se elimina la compatibilidad con las URL obsoletas `4DSYNC/` y `4DCGI/`. Ya no se realiza ningún tratamiento específico en estas URL. - Las sesiones usuario web ahora son devueltas por [`Process activity`](../commands/process-activity.md). -- The [`HIGHLIGHT TEXT`](../commands/highlight-text) command is now supported in the context of subforms. -- **Components no longer embedded**: starting with 4D 21, components developed by 4D (4D NetKit, 4D SVG..., see [this list](../Extensions/overview.md#components-developed-by-4d)) are no longer embedded in the 4D application. When upgrading a project to 4D 21 or higher, a dialog box is displayed:
+- El comando [`HIGHLIGHT TEXT`](../commands/highlight-text) es ahora compatible en el contexto de los subformularios. +- **Componentes ya no integrados**: a partir de 4D 21, los componentes desarrollados por 4D (4D NetKit, 4D SVG..., ver [esta lista](../Extensions/overview.md#components-developed-by-4d)) ya no están integrados en la aplicación 4D. Cuando se actualiza un proyecto a 4D 21 o superior, se muestra un cuadro de diálogo:
![alt-text](../assets/en/getStart/convert.png)
- \- **Import**: import automatically 4D components as dependencies to the project
- \- **Ignore**: do not import components and let you [manage components manually](../Project/components.md)
- \- **Ask later**: do not import components and display the dialog at the next project opening. + \- **Importar**: importar automáticamente componentes 4D como dependencias del proyecto
+ \- **Ignorar**: no importar componentes y dejar que [gestione los componentes manualmente](../Project/components.md)
+ \- **Preguntar más tarde**: no importar componentes y mostrar el cuadro de diálogo en la próxima apertura del proyecto. :::note -In binary databases, you need to select the required components in the 4D installer or download them from the [4D Product Download portal](https://product-download.4d.com/?type=components). +En las bases de datos binarias, debe seleccionar los componentes necesarios en el programa de instalación de 4D o descargarlos del [portal de descarga de productos 4D](https://product-download.4d.com/?type=components). ::: @@ -67,12 +67,12 @@ Lea las [**Novedades en 4D 20 R10**](https://blog.4d.com/en-whats-new-in-4d-20-R - Nueva clase [`4D.Vector`](../API/VectorClass.md) para procesar y comparar vectores, normalmente calculados por IAs. - Nuevas opciones para generar UUIDs en **versión 7** para el comando [4D automatic fields](../settings/database.md#auto-uuid-version) y [`Generate UUID`](../commands/generate-uuid). - Nuevas clases [`UDPSocket`](../API/UDPSocketClass.md) y [`UDPEvent`](../API/UDPEventClass.md) para enviar datos utilizando sockets UDP. Soporte de registro detallado para eventos UDP en el archivo de registro [`4DTCPUDPLog.txt`](../Debugging/debugLogFiles.md#4dtcpudplogtxt) (renombrado de `4DTCPLog.txt`). -- New [`.promote()`](../API/SessionClass.md#promote) and [`.demote()`](../API/SessionClass.md#demote) functions in the [Session class](../API/SessionClass.md) to dynamically add/remove privileges in a web process. -- [Automatic selection of licenses to embed](../Desktop/building.md#application-automatically-embedding-available-licenses) in the Build application dialog box, modified [`Create deployment license`](../commands/create-deployment-license.md) command, new [`AutomaticLicenseIntegration`](https://doc.4d.com/4Dv20R10/4D/20-R10/AutomaticLicenseIntegration.300-7611090.en.html) BuildApplication xml key. +- Nuevas funciones [`.promote()`](../API/SessionClass.md#promote) y [`.demote()`](../API/SessionClass.md#demote) en la [clase Session](../API/SessionClass.md) para añadir/eliminar privilegios dinámicamente en un proceso web. +- [Selección automática de licencias a integrar](../Desktop/building.md#application-automatically-embedding-available-licenses) en el cuadro de diálogo del Generador de aplicaciones, modificación del comando [`Create deployment license`](../commands/create-deployment-license.md), nueva llave xml BuildApplication [`AutomaticLicenseIntegration`](https://doc.4d.com/4Dv20R10/4D/20-R10/AutomaticLicenseIntegration.300-7611090.en.html). - Seguridad mejorada para copiar/pegar fórmulas en [4D Write Pro](../WritePro/managing-formulas.md) y [áreas de texto con estilo](../FormObjects/input_overview.md): las fórmulas copiadas desde fuera de la aplicación 4D actual se pegan ahora siempre sólo como valores. -- 4D AIKit component: new [OpenAIEmbeddingsAPI class](../aikit/Classes/OpenAIEmbeddingsAPI.md) to create embeddings using OpenAI's API. -- You can now [associate a class](../Develop/field-properties.md) to an object field in the structure editor. -- Automatic handling of [recursive dependencies](../Project/components.md#automatic-dependency-resolution). +- Componente 4D AIKit: nueva [clase OpenAIEmbeddingsAPI](../aikit/Classes/OpenAIEmbeddingsAPI.md) para crear embeddings utilizando la API OpenAI. +- Ahora puede [asociar una clase](../Develop/field-properties.md) a un campo objeto en el editor de estructura. +- Gestión automática de [dependencias recursivas](../Project/components.md#automatic-dependency-resolution). - Lenguaje 4D: - Por coherencia, los comandos [`Create entity selection`](../commands/create-entity-selection.md) y [`USE ENTITY SELECTION`](../commands/use-entity-selection.md) han sido movidos del tema ["4D Environment"](../commands/theme/4D_Environment.md) al ["Selection"](../commands/theme/Selection.md). - Nuevos comandos [`OBJECT SET DATA SOURCE FORMULA`](../commands/object-set-data-source-formula.md) y [`OBJECT Get data source formula`](../commands/object-get-data-source-formula.md) para asignar y leer los objetos `Formula` como fuentes de datos para los objetos de formulario. @@ -85,7 +85,7 @@ Lea las [**Novedades en 4D 20 R10**](https://blog.4d.com/en-whats-new-in-4d-20-R - Se ha eliminado la biblioteca *MeCab*. Este cambio sólo afecta al tratamiento del texto en japonés. - Cuando una variable o parámetro objeto se declara con un tipo ["cs" class](../Concepts/classes.md#cs), asignarlo con una instancia de objeto de una clase diferente genera ahora un error de sintaxis. - [`.hasPrivilege()`](../API/SessionClass.md#hasprivilege) devuelve True para privilegios promovidos en el proceso web. -- The [`Time`](../commands/time) command now returns a negative time expression when the *timeValue* parameter is negative. Por ejemplo, `Time("-01:02:03")` devolverá **-01:02:03**. In previous releases, the negative sign was ignored. +- El comando [`Time`](../commands/time) devuelve ahora una expresión de tiempo negativa cuando el parámetro *timeValue* es negativo. Por ejemplo, `Time("-01:02:03")` devolverá **-01:02:03**. En versiones anteriores, se ignoraba el signo negativo. ## 4D 20 R9 @@ -96,7 +96,7 @@ Lea [**Novedades en 4D 20 R9**](https://blog.4d.com/en-whats-new-in-4d-20-R9/), - La biblioteca [*MeCab*](../settings/database.md#support-of-mecab-japanese-version) está obsoleta y se eliminará en la próxima versión. - Soporte de [token de sesión](../WebServer/sessions.md#session-token-otp) manejado con las nuevas funciones [`Session.createOTP()`](../API/SessionClass.md#createotp) y [`Session.restore()`](../API/SessionClass.md#restore). - El asistente de etiqueta ahora utiliza el editor de Fórmula para añadir o editar fórmulas en el [área de diseño de etiquetas](../Desktop/labels.md#label-preview). -- New [`TCPListener`](../API/TCPListenerClass.md) class to create TCP server connections; new properties in related classes: `address`, `listener` and `port` in [`TCPConnection`](../API/TCPConnectionClass.md) class, `address` and `port` in [`TCPEvent`](../API/TCPEventClass.md) class. +- Nueva clase [`TCPListener`](../API/TCPListenerClass.md) para crear conexiones del servidor TCP; nuevas propiedades en las clases relacionadas: `address`, `listener` y `port` en la clase [`TCPConnection`](../API/TCPConnectionClass.md), `address` y `port` en la clase [`TCPEvent`](../API/TCPEventClass.md). - Comandos y constantes obsoletos ahora generan advertencias específicas en el [Live checker y el compilador](../code-editor/write-class-method.md#warnings-and-errors). Puede saber si un comando está obsoleto utilizando el comando [`Command name`](../commands/command-name.md). - Nuevos comandos [WA SET CONTEXT](../commands/wa-set-context.md) y [WA Get context](../commands/wa-get-context.md) para controlar los contenidos [$4d](../FormObjects/webArea_overview.md#4d-object) en áreas web. - Nuevo [parámetro de base de datos `RDP optimization`](../commands-legacy/set-database-parameter.md#rdp-optimization-133) para optimizar por ejemplo el portapapeles compartidos cuando se usa el protocolo de escritorio remoto con 4D. @@ -157,7 +157,7 @@ Lea [**Novedades en 4D 20 R7**](https://blog.4d.com/en-whats-new-in-4d-20-R7/), - Lenguaje 4D: - Nuevos comandos: [Process info](../commands/process-info.md), [Session info](../commands/session-info.md), [SET WINDOW DOCUMENT ICON](../commands/set-window-document-icon.md) - Comandos modificados: [Process activity](../commands/process-activity.md), [Process number](../commands/process-number.md) - - Deprecated commands (replacement): `GET LAST ERROR STACK` ([Last errors](../commands/last-errors.md)), `GET SERIAL INFORMATION` ([License info](../commands/license-info.md)), `PROCESS PROPERTIES` ([Process info](../commands/process-info.md)), `SET SCREEN DEPTH`, `C_XXX` commands ([var](../Concepts/variables.md#declaring-variables) and [#DECLARE/Function](../Concepts/parameters.md#declaring-parameters) declarations). Los comandos obsoletos llevan el prefijo "\*o\*". + - Comandos obsoletos (reemplazo): `GET LAST ERROR STACK` ([Last errors](../commands/last-errors.md)), `GET SERIAL INFORMATION` ([License info](../commands/license-info.md)), `PROCESS PROPERTIES` ([Process info](../commands/process-info.md)), `SET SCREEN DEPTH`, `C_XXX` commands ([var](../Concepts/variables.md#declaring-variables) y [#DECLARE/declaraciones Function](../Concepts/parameters.md#declaring-parameters)). Los comandos obsoletos llevan el prefijo "\*o\*". - 4D Write Pro: - Nuevo comando: [WP DELETE SECTION](../WritePro/commands/wp-delete-section.md) - Comandos modificados: [WP DELETE SUBSECTION](../WritePro/commands/wp-delete-subsection.md) y [WP RESET ATTRIBUTES](../WritePro/commands/wp-reset-attributes.md) @@ -292,23 +292,23 @@ Ver [**Notas de lanzamiento para LTS 4D 20.x**](../../versioned_docs/version-20/ ## Tabla de la librería -| Librería | Versión actual | Actualizado en 4D | Comentario | -| --------- | -------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -| BoringSSL | fa47b1d | **21** | Utilizado para QUIC | -| CEF | 7258 | **21** | Chromium 139 | -| Hunspell | 1.7.2 | 20 | Utilizado para la corrección ortográfica en formularios 4D y 4D Write Pro | -| ICU | 77.1 | **21** | This upgrade forces an automatic rebuild of alphanumeric, text and object indexes. | -| libldap | 2.6.10 | **21** | | -| libsasl | 2.1.28 | 20 | | -| Liblsquic | 4.2.0 | 20 R10 | Utilizado para QUIC | -| Libuv | 1.51.0 | **21** | Utilizado para QUIC | -| libZip | 1.11.4 | **21** | Utilizado por los componentes zip class, 4D Write Pro, svg y serverNet | -| LZMA | 5.8.1 | **21** | | -| ngtcp2 | 1.16.0 | **21** | Utilizado para QUIC | -| OpenSSL | 3.5.2 | **21** | | -| PDFWriter | 4.7.0 | **21** | Used for [`WP Export document`](../WritePro/commands/wp-export-document.md) and [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | -| PHP | 8.2.4 | 20 | | -| SpreadJS | 17.1.0 | 20 R7 | Consulte [esta entrada de blog](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) para obtener una visión general de las nuevas funciones | -| webKit | WKWebView | 19 | | -| Xerces | 3.3.0 | **21** | Utilizado para comandos XML | -| Zlib | 1.3.1 | **21** | | +| Librería | Versión actual | Actualizado en 4D | Comentario | +| --------- | -------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| BoringSSL | fa47b1d | **21** | Utilizado para QUIC | +| CEF | 7258 | **21** | Chromium 139 | +| Hunspell | 1.7.2 | 20 | Utilizado para la corrección ortográfica en formularios 4D y 4D Write Pro | +| ICU | 77.1 | **21** | Esta actualización fuerza una reconstrucción automática de los índices alfanuméricos, textos y objetos. | +| libldap | 2.6.10 | **21** | | +| libsasl | 2.1.28 | 20 | | +| Liblsquic | 4.2.0 | 20 R10 | Utilizado para QUIC | +| Libuv | 1.51.0 | **21** | Utilizado para QUIC | +| libZip | 1.11.4 | **21** | Utilizado por los componentes zip class, 4D Write Pro, svg y serverNet | +| LZMA | 5.8.1 | **21** | | +| ngtcp2 | 1.16.0 | **21** | Utilizado para QUIC | +| OpenSSL | 3.5.2 | **21** | | +| PDFWriter | 4.7.0 | **21** | Utilizado para [`WP Export document`](../WritePro/commands/wp-export-document.md) y [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | +| PHP | 8.2.4 | 20 | | +| SpreadJS | 17.1.0 | 20 R7 | Consulte [esta entrada de blog](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) para obtener una visión general de las nuevas funciones | +| webKit | WKWebView | 19 | | +| Xerces | 3.3.0 | **21** | Utilizado para comandos XML | +| Zlib | 1.3.1 | **21** | | From 54afe42183d698026d5bd93b902bba6e539619e0 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 07:43:54 +0200 Subject: [PATCH 04/57] New translations openai.md (Spanish) --- .../current/aikit/Classes/OpenAI.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAI.md b/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAI.md index a2a69675bf98f7..a56241b39b33dc 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAI.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAI.md @@ -29,9 +29,9 @@ The `OpenAI` class provides a client for accessing various OpenAI API resources. Crear una instancia de la clase cliente OpenAI. -| Nombre del argumento | Tipo | Descripción | -| ------------------------- | -------------- | ------------------------------------------------------- | -| `apiKey or configuration` | Texto u objeto | apiKey if Text or configuration Object. | +| Nombre del argumento | Tipo | Descripción | +| ------------------------- | -------------- | --------------------------------------------------------- | +| `apiKey or configuration` | Texto u objeto | apiKey si Text u objeto de configuración. | #### Llave API From f2bdbe66a25e4f376859c3bf3b8ed611f15dfa13 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 07:44:39 +0200 Subject: [PATCH 05/57] New translations openaichatcompletionsparameters.md (Spanish) --- .../current/aikit/Classes/OpenAIChatCompletionsParameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatCompletionsParameters.md b/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatCompletionsParameters.md index 23279b40c9c82a..53bb4b8143fd98 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatCompletionsParameters.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatCompletionsParameters.md @@ -79,7 +79,7 @@ $messages.push({ \ $result := $client.chat.completions.create($messages; $params) ``` -#### 3. JSON Schema Format (Structured Outputs) +#### 3. Formato de esquema JSON (salidas estructuradas) For precise control over the JSON structure, you can define a schema: From 2ab24cbc4121e2f538ad23d2744086512ca2b032 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 07:47:03 +0200 Subject: [PATCH 06/57] New translations orda-events.md (French) --- .../current/ORDA/orda-events.md | 246 ++++++------------ 1 file changed, 84 insertions(+), 162 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/ORDA/orda-events.md b/i18n/fr/docusaurus-plugin-content-docs/current/ORDA/orda-events.md index 641f0bf6dda050..10a47f8f80a131 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/ORDA/orda-events.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/ORDA/orda-events.md @@ -18,7 +18,7 @@ Vous ne pouvez pas déclencher directement l'exécution d'une fonction d'événe :::tip Article(s) de blog sur le sujet -[ORDA - Gérer une logique événementielle lors des actions de persistance des données](https://blog.4d.com/orda-handle-an-event-driven-logic-during-data-persistence-actions) +[ORDA - Gérer une logique événementielle lors des actions de persistance des données](https://blog.4d.com/orda-handle-an-event-driven-logic-during-database-operations) ::: @@ -52,7 +52,7 @@ Les fonctions ORDA [`constructor()`](./ordaClasses.md#class-constructor) sont to ::: -Avec d'autres configurations distantes (i.e. applications Qodly, [requêtes via l'API REST](../REST/REST_requests.md), ou requêtes via [`Open datastore`](../commands/open-datastore.md)), la fonction d'événement `touched()` est toujours exécutée **côté serveur**. Cela signifie que vous devez vous assurer que le serveur peut "voir" qu'un attribut a été touché pour déclencher l'événement (voir ci-dessous). +With other remote configurations (i.e. [Qodly applications](https://developer.4d.com/qodly), [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. Cela signifie que vous devez vous assurer que le serveur peut "voir" qu'un attribut a été touché pour déclencher l'événement (voir ci-dessous). ### Tableau de synthèse @@ -139,7 +139,7 @@ Cet événement est déclenché dès que le moteur de 4D Server / 4D détecte un - l'utilisateur saisit une valeur dans un formulaire 4D, - le code 4D effectue une assignation avec l'opérateur `:=`. L'événement est également déclenché en cas d'auto-assignation (`$entity.attribute:=$entity.attribute`). - en **client/serveur sans le mot-clé `local`** : du code 4D effectue une assignation avec l'opérateur `:=` est [exécuté sur le serveur](../commands-legacy/execute-on-server.md). -- en **client/serveur sans le mot-clé `local`**, une **[application Qodly](https://developer.qodly.com/docs)** ou **[datastore distant](../commands/open-datastore.md)** : l'entité est reçue sur le serveur 4D lors de l'appel d'une fonction ORDA (sur l'entité ou avec l'entité en tant que paramètre). Cela signifie que vous devrez peut-être mettre en place une fonction *refresh* ou *preview* sur l'application distante qui envoie une requête ORDA au serveur et déclenche l'événement. +- en **client/serveur sans le mot-clé `local`**, une **[application Qodly](https://developer.4d.com/qodly)** ou **[datastore distant](../commands/open-datastore.md)** : l'entité est reçue sur le serveur 4D lors de l'appel d'une fonction ORDA (sur l'entité ou avec l'entité en tant que paramètre). Cela signifie que vous devrez peut-être mettre en place une fonction *refresh* ou *preview* sur l'application distante qui envoie une requête ORDA au serveur et déclenche l'événement. - avec le serveur REST : la valeur est reçue sur le serveur REST avec une [requête REST](../REST/$method.md#methodupdate) (`$method=update`) La fonction reçoit un objet [*event*](#event-parameter) en paramètre. @@ -348,26 +348,21 @@ It is not recommended to update the entity within this function (using `This`). #### Exemple -In this example, the user is not allowed to save a product with a margin lower than the average. In case of an invalid price attribute, you return an error object and thus, stop the save action. +In this example, it is not allowed to save a product with a margin lower than 50%. In case of an invalid price attribute, you return an error object and thus, stop the save action. ```4d // ProductsEntity class +// +// validateSave event at attribute level Function event validateSave margin($event : Object) : Object var $result : Object -var $marginAverage : Real -$marginAverage:=ds.Products.query("category= :1"; This.category).average("margin") - -If (This.margin<$marginAverage) - $result:={\ - errCode: 1; \ - message: "The margin of this product ("+String(This.margin)+") is under the average"; \ - extraDescription: {\ - info: "For the "+This.category+" category the margin average is: "+String($marginAverage)};\ - fatalError: False} +//The user can't create a product whose margin is < 50% +If (This.margin<50) + $result:={errCode: 1; message: "The validation of this product failed"; \ + extraDescription: {info: "The margin of this product ("+String(This.margin)+") is lower than 50%"}; seriousError: False} End if - return $result ``` @@ -408,32 +403,35 @@ To stop the action, the code of the function must return an [error object](#erro #### Exemple -When a product is saved, some information is logged to an external system which may be unavailable. +When a file is saved on disk, catch errors related to disk space for example. ```4d -Function event saving($event : Object) : Object +// ProductsEntity class +// saving event at attribute level +Function event saving userManualPath($event : Object) : Object -var $result; $status : Object -var $log : cs.Entity -var $remote : 4D.DataStoreImplementation - -Try - $remote:=Open datastore({hostname: "events@acme.com"}; "logs") - $log:=$remote.Logs.new() - $log.productId:=This.ID - $log.stamp:=Timestamp - $log.event:="Created by "+Current user() - $status:=$log.save() -Catch - $result:={\ - errCode: Last errors.last().errCode;\ - message: Last errors.last().message; \ - extraDescription: {info: "The external Logs can't be reached"}} -End try +var $result : Object +var $userManualFile : 4D.File +var $fileCreated : Boolean + +If (This.userManualPath#"") + $userManualFile:=File(This.userManualPath) + + // The user manual document file is created on the disk + // This may fail if no more space is available + Try + $fileCreated:=$userManualFile.create() + Catch + // No more room on disk for example + $result:={/ + errCode: 1; message: "Error during the save action for this product"; / + extraDescription: {info: "There is no available space on disk to store the user manual"}/ + } + End try +End if return $result - ``` ### `Function event afterSave` @@ -454,29 +452,25 @@ La fonction reçoit un objet [*event*](#event-parameter) en paramètre. - To avoid infinite loops, calling a [`save()`](../API/EntityClass.md#save) on the current entity (through `This`) in this function is **not allowed**. It will raise an error. - Throwing an [error object](#error-object) is **not supported** by this function. -#### Exemple 1 +#### Exemple -If an error occurred in the above saving event, the product is recorded in the ProductsInFailure dataclass so an employee can review it later. +If an error occurred in the above saving event, the attribute value is reset accordingly in the `afterSave` event: ```4d // ProductsEntity class Function event afterSave($event : Object) -var $failure : cs.ProductsInFailureEntity -var $status : Object - - // $event.status.errors is filled if the error comes from a validateSave event If (($event.status.success=False) && ($event.status.errors=Null)) - $failure:=ds.ProductsInFailure.new() - $failure.name:=This.name - $failure.category:=This.category - $failure.costPrice:=This.costPrice - $failure.retailPrice:=This.retailPrice - $failure.reason:="Error during the save action" - $failure.stamp:=Timestamp - $status:=$failure.save() -End if - + // $event.status.errors is filled if the error comes from the validateSave event + + // The userManualPath attribute has not been properly saved + // Its value is reset + If ($event.savedAttributes.indexOf("userManualPath")=-1) + This.userManualPath:="" + This.status:="KO" + End if + +End if ``` ### `Function event validateDrop` @@ -506,44 +500,24 @@ This event is triggered **before** the entity is actually dropped, allowing you To stop the action, the code of the function must return an [error object](#error-object). -#### Exemple 1 +#### Exemple -Products can be deleted only if they have been flagged TO DELETE. +In this example, it is not allowed to drop a product that is not labelled "TO DELETE". In this case, you return an error object and thus, stop the drop action. ```4d - //ProductsEntity class -Function event validateDrop status($event : Object) : Object - -If (This.status != "TO DELETE") - - var $result:= New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={attribute; $event.attributeName; info: "The status must be TO DELETE"} - $result.fatalError:=False - return $result -End if -``` +// ProductsEntity class -#### Exemple 2 +Function event validateDrop status($event : Object) : Object -The user can delete products if they are flagged as "TO DELETE" and if their creation year is < current year -3. +var $result : Object -```4d - //ProductsEntity class -Function event validateDrop($event : Object) : Object - -var $yearOffSet : Integer -$yearOffSet:=Year of(Current date)-3 - -If ((This.status != "TO DELETE") || (Year of(This.creationDate) >= $yearOffSet)) - var $result:=New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={info: "The status must be TO DELETE and the creation year must be lower than " + String($yearOffSet)} - $result.fatalError:=False - return $result +// Products must be marked as TO DELETE to be dropped +If (This.status#"TO DELETE") + $result:={errCode: 1; message: "You can't drop this product"; \ + extraDescription: {info: "This product must be marked as To Delete"}; seriousError: False} End if + +return $result ``` ### `Function event dropping` @@ -579,54 +553,31 @@ The business logic should raise errors which cannot be detected during the `vali To stop the action, the code of the function must return an [error object](#error-object). -#### Exemple 1 +#### Exemple -When dropping an order with *totalPrice >= 500*, a log file is updated. +Here is an example of `dropping` event at entity level: ```4d - //OrderEntity class -Function event dropping totalPrice ($event : Object) - -var $log : cs.LogEntity -var $status: Object - -If (This.totalPrice >= 500) - - $log:=ds.Log.new() - $log.orderID:=This.ID - $log.orderPrice:=This.totalPrice - $log.event:="Drop" - $log.creationDate:=Current date() - $status:=$log.save() - - If($status.success=False) - throw ({errCode: 1; message: "Error while updating the log file"}) - End if -End if - -``` - -#### Exemple 2 - -When a product is dropped, a log file is updated. +// ProductsEntity class +Function event dropping($event : Object) : Object -```4d - //ProductsEntity class -Function event dropping ($event : Object) +var $result : Object +var $userManualFile : 4D.File -var $log : cs.LogEntity -var $status: Object +$userManualFile:=File(This.userManualPath) -$log:=ds.Log.new() -$log.productID:=This.ID -$log.productPrice:=This.price -$log.event:="Drop" -$log.creationDate:=Current date() -$status:=$log.save() + // When dropping a product, its user manual is also deleted on the disk + // This action may fail +Try + If ($userManualFile.exists) + $userManualFile.delete() + End if +Catch + // Dropping the user manual failed + $result:={errCode: 1; message: "Drop failed"; extraDescription: {info: "The user manual can't be dropped"}} +End try -If($status.success=False) - throw ({errCode: 1; message:"Error while updating the log file"}) -End if +return $result ``` ### `Function event afterDrop` @@ -653,50 +604,21 @@ The dropped entity is referenced by `This` and still exists in memory. ::: -#### Exemple 1 +#### Exemple -Send a mail to the customer with the details of the dropped order. +If the drop action failed, then the product must be checked manually: ```4d - //OrderEntity class -Function event afterDrop ($event : Object) - -var $oAuth2 : cs.NetKit.OAuth2Provider -var $google : cs.NetKit.Google - - //$param contains clientId, secretId... -$oAuth2:=cs.NetKit.OAuth2Provider.new($param) -$google:=cs.NetKit.Google.new($oAuth2; {mailType: "JMAP"}) - - //Email creation -$email:=New object -$email.from:="youremail@gmail.com" -$email.to:="destinationmail@mail.com" -$email.subject:="Your order is cancelled" -$email.textBody:="Products numbers: " + This.products.number.join("-") - - //Email sending -$status:=$google.mail.send($email) -``` - -#### Exemple 2 +Function event afterDrop($event : Object) -Create an action to do because there were errors in the [`dropping()`](#function-event-dropping) event. +var $status : Object -```4d - //ProductEntity class -Function event afterDrop ($event : Object) - -var $action: cs.ActionEntity -var $status: Object - - // The drop action failed -If($event.dropStatus = "failed") - $action:=ds.Action.new() - $action.label:=Last errors.first().message //message is "Error while dropping product XXX" - $action.status:="TO CHECK" - $status:=$action.save() -End if +If (($event.status.success=False) && ($event.status.errors=Null)) + //$event.status.errors is filled + //if the error comes from the validateDrop event + This.status:="Check this product - Drop action failed" + $status:=This.save() +End if ``` From 48039190a0d644fe9708be8eb76055def9e27b06 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 07:47:18 +0200 Subject: [PATCH 07/57] New translations orda-events.md (Spanish) --- .../current/ORDA/orda-events.md | 246 ++++++------------ 1 file changed, 84 insertions(+), 162 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/ORDA/orda-events.md b/i18n/es/docusaurus-plugin-content-docs/current/ORDA/orda-events.md index 12b7b0d036ccbd..329dec884c4263 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/ORDA/orda-events.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/ORDA/orda-events.md @@ -18,7 +18,7 @@ No se puede activar directamente la ejecución de la función de evento. Events :::tip Entrada de blog relacionada -[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-data-persistence-actions) +[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-database-operations) ::: @@ -52,7 +52,7 @@ ORDA [`constructor()`](./ordaClasses.md#class-constructor) functions are always ::: -Con otras configuraciones remotas (p. ej. Qodly applications, [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). +With other remote configurations (i.e. [Qodly applications](https://developer.4d.com/qodly), [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). ### Tabla resumen @@ -139,7 +139,7 @@ This event is triggered as soon as the 4D Server / 4D engine can detect a modifi - el usuario define un valor en un formulario 4D, - el código 4D realiza una asignación con el operador `:=`. El evento también se activa en caso de autoasignación (`$entity.attribute:=$entity.attribute`). - in **client/server without the `local` keyword**: some 4D code that makes an assignment with the `:=` operator is [executed on the server](../commands-legacy/execute-on-server.md). -- in **client/server without the `local` keyword**, in **[Qodly application](https://developer.qodly.com/docs)** and **[remote datastore](../commands/open-datastore.md)**: the entity is received on 4D Server while calling an ORDA function (on the entity or with the entity as parameter). It means that you might have to implement a *refresh* or *preview* function on the remote application that sends an ORDA request to the server and triggers the event. +- in **client/server without the `local` keyword**, in **[Qodly application](https://developer.4d.com/qodly)** and **[remote datastore](../commands/open-datastore.md)**: the entity is received on 4D Server while calling an ORDA function (on the entity or with the entity as parameter). It means that you might have to implement a *refresh* or *preview* function on the remote application that sends an ORDA request to the server and triggers the event. - with the REST server: the value is received on the REST server with a [REST request](../REST/$method.md#methodupdate) (`$method=update`) The function receives an [*event* object](#event-parameter) as parameter. @@ -348,26 +348,21 @@ It is not recommended to update the entity within this function (using `This`). #### Ejemplo -In this example, the user is not allowed to save a product with a margin lower than the average. In case of an invalid price attribute, you return an error object and thus, stop the save action. +In this example, it is not allowed to save a product with a margin lower than 50%. In case of an invalid price attribute, you return an error object and thus, stop the save action. ```4d // ProductsEntity class +// +// validateSave event at attribute level Function event validateSave margin($event : Object) : Object var $result : Object -var $marginAverage : Real -$marginAverage:=ds.Products.query("category= :1"; This.category).average("margin") - -If (This.margin<$marginAverage) - $result:={\ - errCode: 1; \ - message: "The margin of this product ("+String(This.margin)+") is under the average"; \ - extraDescription: {\ - info: "For the "+This.category+" category the margin average is: "+String($marginAverage)};\ - fatalError: False} +//The user can't create a product whose margin is < 50% +If (This.margin<50) + $result:={errCode: 1; message: "The validation of this product failed"; \ + extraDescription: {info: "The margin of this product ("+String(This.margin)+") is lower than 50%"}; seriousError: False} End if - return $result ``` @@ -408,32 +403,35 @@ To stop the action, the code of the function must return an [error object](#erro #### Ejemplo -When a product is saved, some information is logged to an external system which may be unavailable. +When a file is saved on disk, catch errors related to disk space for example. ```4d -Function event saving($event : Object) : Object +// ProductsEntity class +// saving event at attribute level +Function event saving userManualPath($event : Object) : Object -var $result; $status : Object -var $log : cs.Entity -var $remote : 4D.DataStoreImplementation - -Try - $remote:=Open datastore({hostname: "events@acme.com"}; "logs") - $log:=$remote.Logs.new() - $log.productId:=This.ID - $log.stamp:=Timestamp - $log.event:="Created by "+Current user() - $status:=$log.save() -Catch - $result:={\ - errCode: Last errors.last().errCode;\ - message: Last errors.last().message; \ - extraDescription: {info: "The external Logs can't be reached"}} -End try +var $result : Object +var $userManualFile : 4D.File +var $fileCreated : Boolean + +If (This.userManualPath#"") + $userManualFile:=File(This.userManualPath) + + // The user manual document file is created on the disk + // This may fail if no more space is available + Try + $fileCreated:=$userManualFile.create() + Catch + // No more room on disk for example + $result:={/ + errCode: 1; message: "Error during the save action for this product"; / + extraDescription: {info: "There is no available space on disk to store the user manual"}/ + } + End try +End if return $result - ``` ### `Function event afterSave` @@ -454,29 +452,25 @@ The function receives an [*event* object](#event-parameter) as parameter. - To avoid infinite loops, calling a [`save()`](../API/EntityClass.md#save) on the current entity (through `This`) in this function is **not allowed**. Se producirá un error. - Throwing an [error object](#error-object) is **not supported** by this function. -#### Ejemplo 1 +#### Ejemplo -If an error occurred in the above saving event, the product is recorded in the ProductsInFailure dataclass so an employee can review it later. +If an error occurred in the above saving event, the attribute value is reset accordingly in the `afterSave` event: ```4d // ProductsEntity class Function event afterSave($event : Object) -var $failure : cs.ProductsInFailureEntity -var $status : Object - - // $event.status.errors is filled if the error comes from a validateSave event If (($event.status.success=False) && ($event.status.errors=Null)) - $failure:=ds.ProductsInFailure.new() - $failure.name:=This.name - $failure.category:=This.category - $failure.costPrice:=This.costPrice - $failure.retailPrice:=This.retailPrice - $failure.reason:="Error during the save action" - $failure.stamp:=Timestamp - $status:=$failure.save() -End if - + // $event.status.errors is filled if the error comes from the validateSave event + + // The userManualPath attribute has not been properly saved + // Its value is reset + If ($event.savedAttributes.indexOf("userManualPath")=-1) + This.userManualPath:="" + This.status:="KO" + End if + +End if ``` ### `Function event validateDrop` @@ -506,44 +500,24 @@ This event is triggered **before** the entity is actually dropped, allowing you To stop the action, the code of the function must return an [error object](#error-object). -#### Ejemplo 1 +#### Ejemplo -Products can be deleted only if they have been flagged TO DELETE. +In this example, it is not allowed to drop a product that is not labelled "TO DELETE". In this case, you return an error object and thus, stop the drop action. ```4d - //ProductsEntity class -Function event validateDrop status($event : Object) : Object - -If (This.status != "TO DELETE") - - var $result:= New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={attribute; $event.attributeName; info: "The status must be TO DELETE"} - $result.fatalError:=False - return $result -End if -``` +// ProductsEntity class -#### Ejemplo 2 +Function event validateDrop status($event : Object) : Object -The user can delete products if they are flagged as "TO DELETE" and if their creation year is < current year -3. +var $result : Object -```4d - //ProductsEntity class -Function event validateDrop($event : Object) : Object - -var $yearOffSet : Integer -$yearOffSet:=Year of(Current date)-3 - -If ((This.status != "TO DELETE") || (Year of(This.creationDate) >= $yearOffSet)) - var $result:=New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={info: "The status must be TO DELETE and the creation year must be lower than " + String($yearOffSet)} - $result.fatalError:=False - return $result +// Products must be marked as TO DELETE to be dropped +If (This.status#"TO DELETE") + $result:={errCode: 1; message: "You can't drop this product"; \ + extraDescription: {info: "This product must be marked as To Delete"}; seriousError: False} End if + +return $result ``` ### `Function event dropping` @@ -579,54 +553,31 @@ The business logic should raise errors which cannot be detected during the `vali To stop the action, the code of the function must return an [error object](#error-object). -#### Ejemplo 1 +#### Ejemplo -When dropping an order with *totalPrice >= 500*, a log file is updated. +Here is an example of `dropping` event at entity level: ```4d - //OrderEntity class -Function event dropping totalPrice ($event : Object) - -var $log : cs.LogEntity -var $status: Object - -If (This.totalPrice >= 500) - - $log:=ds.Log.new() - $log.orderID:=This.ID - $log.orderPrice:=This.totalPrice - $log.event:="Drop" - $log.creationDate:=Current date() - $status:=$log.save() - - If($status.success=False) - throw ({errCode: 1; message: "Error while updating the log file"}) - End if -End if - -``` - -#### Ejemplo 2 - -When a product is dropped, a log file is updated. +// ProductsEntity class +Function event dropping($event : Object) : Object -```4d - //ProductsEntity class -Function event dropping ($event : Object) +var $result : Object +var $userManualFile : 4D.File -var $log : cs.LogEntity -var $status: Object +$userManualFile:=File(This.userManualPath) -$log:=ds.Log.new() -$log.productID:=This.ID -$log.productPrice:=This.price -$log.event:="Drop" -$log.creationDate:=Current date() -$status:=$log.save() + // When dropping a product, its user manual is also deleted on the disk + // This action may fail +Try + If ($userManualFile.exists) + $userManualFile.delete() + End if +Catch + // Dropping the user manual failed + $result:={errCode: 1; message: "Drop failed"; extraDescription: {info: "The user manual can't be dropped"}} +End try -If($status.success=False) - throw ({errCode: 1; message:"Error while updating the log file"}) -End if +return $result ``` ### `Function event afterDrop` @@ -653,50 +604,21 @@ The dropped entity is referenced by `This` and still exists in memory. ::: -#### Ejemplo 1 +#### Ejemplo -Send a mail to the customer with the details of the dropped order. +If the drop action failed, then the product must be checked manually: ```4d - //OrderEntity class -Function event afterDrop ($event : Object) - -var $oAuth2 : cs.NetKit.OAuth2Provider -var $google : cs.NetKit.Google - - //$param contains clientId, secretId... -$oAuth2:=cs.NetKit.OAuth2Provider.new($param) -$google:=cs.NetKit.Google.new($oAuth2; {mailType: "JMAP"}) - - //Email creation -$email:=New object -$email.from:="youremail@gmail.com" -$email.to:="destinationmail@mail.com" -$email.subject:="Your order is cancelled" -$email.textBody:="Products numbers: " + This.products.number.join("-") - - //Email sending -$status:=$google.mail.send($email) -``` - -#### Ejemplo 2 +Function event afterDrop($event : Object) -Create an action to do because there were errors in the [`dropping()`](#function-event-dropping) event. +var $status : Object -```4d - //ProductEntity class -Function event afterDrop ($event : Object) - -var $action: cs.ActionEntity -var $status: Object - - // The drop action failed -If($event.dropStatus = "failed") - $action:=ds.Action.new() - $action.label:=Last errors.first().message //message is "Error while dropping product XXX" - $action.status:="TO CHECK" - $status:=$action.save() -End if +If (($event.status.success=False) && ($event.status.errors=Null)) + //$event.status.errors is filled + //if the error comes from the validateDrop event + This.status:="Check this product - Drop action failed" + $status:=This.save() +End if ``` From 9a7dde63c12ded2e5792189087fdcaa1f6b676dc Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 07:47:31 +0200 Subject: [PATCH 08/57] New translations orda-events.md (Japanese) --- .../current/ORDA/orda-events.md | 246 ++++++------------ 1 file changed, 84 insertions(+), 162 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ORDA/orda-events.md b/i18n/ja/docusaurus-plugin-content-docs/current/ORDA/orda-events.md index 605811450b1c29..55806fa7ab68bf 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ORDA/orda-events.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ORDA/orda-events.md @@ -18,7 +18,7 @@ You cannot directly trigger event function execution. Events are called automati :::tip Related blog post -[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-data-persistence-actions) +[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-database-operations) ::: @@ -52,7 +52,7 @@ ORDA [`constructor()`](./ordaClasses.md#class-constructor) functions are always ::: -With other remote configurations (i.e. Qodly applications, [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). +With other remote configurations (i.e. [Qodly applications](https://developer.4d.com/qodly), [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). ### Summary table @@ -139,7 +139,7 @@ This event is triggered as soon as the 4D Server / 4D engine can detect a modifi - the user sets a value on a 4D form, - the 4D code makes an assignment with the `:=` operator. The event is also triggered in case of self-assignment (`$entity.attribute:=$entity.attribute`). - in **client/server without the `local` keyword**: some 4D code that makes an assignment with the `:=` operator is [executed on the server](../commands-legacy/execute-on-server.md). -- in **client/server without the `local` keyword**, in **[Qodly application](https://developer.qodly.com/docs)** and **[remote datastore](../commands/open-datastore.md)**: the entity is received on 4D Server while calling an ORDA function (on the entity or with the entity as parameter). It means that you might have to implement a *refresh* or *preview* function on the remote application that sends an ORDA request to the server and triggers the event. +- in **client/server without the `local` keyword**, in **[Qodly application](https://developer.4d.com/qodly)** and **[remote datastore](../commands/open-datastore.md)**: the entity is received on 4D Server while calling an ORDA function (on the entity or with the entity as parameter). It means that you might have to implement a *refresh* or *preview* function on the remote application that sends an ORDA request to the server and triggers the event. - with the REST server: the value is received on the REST server with a [REST request](../REST/$method.md#methodupdate) (`$method=update`) The function receives an [*event* object](#event-parameter) as parameter. @@ -348,26 +348,21 @@ It is not recommended to update the entity within this function (using `This`). #### 例題 -In this example, the user is not allowed to save a product with a margin lower than the average. In case of an invalid price attribute, you return an error object and thus, stop the save action. +In this example, it is not allowed to save a product with a margin lower than 50%. In case of an invalid price attribute, you return an error object and thus, stop the save action. ```4d // ProductsEntity class +// +// validateSave event at attribute level Function event validateSave margin($event : Object) : Object var $result : Object -var $marginAverage : Real -$marginAverage:=ds.Products.query("category= :1"; This.category).average("margin") - -If (This.margin<$marginAverage) - $result:={\ - errCode: 1; \ - message: "The margin of this product ("+String(This.margin)+") is under the average"; \ - extraDescription: {\ - info: "For the "+This.category+" category the margin average is: "+String($marginAverage)};\ - fatalError: False} +//The user can't create a product whose margin is < 50% +If (This.margin<50) + $result:={errCode: 1; message: "The validation of this product failed"; \ + extraDescription: {info: "The margin of this product ("+String(This.margin)+") is lower than 50%"}; seriousError: False} End if - return $result ``` @@ -408,32 +403,35 @@ To stop the action, the code of the function must return an [error object](#erro #### 例題 -When a product is saved, some information is logged to an external system which may be unavailable. +When a file is saved on disk, catch errors related to disk space for example. ```4d -Function event saving($event : Object) : Object +// ProductsEntity class +// saving event at attribute level +Function event saving userManualPath($event : Object) : Object -var $result; $status : Object -var $log : cs.Entity -var $remote : 4D.DataStoreImplementation - -Try - $remote:=Open datastore({hostname: "events@acme.com"}; "logs") - $log:=$remote.Logs.new() - $log.productId:=This.ID - $log.stamp:=Timestamp - $log.event:="Created by "+Current user() - $status:=$log.save() -Catch - $result:={\ - errCode: Last errors.last().errCode;\ - message: Last errors.last().message; \ - extraDescription: {info: "The external Logs can't be reached"}} -End try +var $result : Object +var $userManualFile : 4D.File +var $fileCreated : Boolean + +If (This.userManualPath#"") + $userManualFile:=File(This.userManualPath) + + // The user manual document file is created on the disk + // This may fail if no more space is available + Try + $fileCreated:=$userManualFile.create() + Catch + // No more room on disk for example + $result:={/ + errCode: 1; message: "Error during the save action for this product"; / + extraDescription: {info: "There is no available space on disk to store the user manual"}/ + } + End try +End if return $result - ``` ### `Function event afterSave` @@ -454,29 +452,25 @@ The function receives an [*event* object](#event-parameter) as parameter. - To avoid infinite loops, calling a [`save()`](../API/EntityClass.md#save) on the current entity (through `This`) in this function is **not allowed**. It will raise an error. - Throwing an [error object](#error-object) is **not supported** by this function. -#### 例題 1 +#### 例題 -If an error occurred in the above saving event, the product is recorded in the ProductsInFailure dataclass so an employee can review it later. +If an error occurred in the above saving event, the attribute value is reset accordingly in the `afterSave` event: ```4d // ProductsEntity class Function event afterSave($event : Object) -var $failure : cs.ProductsInFailureEntity -var $status : Object - - // $event.status.errors is filled if the error comes from a validateSave event If (($event.status.success=False) && ($event.status.errors=Null)) - $failure:=ds.ProductsInFailure.new() - $failure.name:=This.name - $failure.category:=This.category - $failure.costPrice:=This.costPrice - $failure.retailPrice:=This.retailPrice - $failure.reason:="Error during the save action" - $failure.stamp:=Timestamp - $status:=$failure.save() -End if - + // $event.status.errors is filled if the error comes from the validateSave event + + // The userManualPath attribute has not been properly saved + // Its value is reset + If ($event.savedAttributes.indexOf("userManualPath")=-1) + This.userManualPath:="" + This.status:="KO" + End if + +End if ``` ### `Function event validateDrop` @@ -506,44 +500,24 @@ This event is triggered **before** the entity is actually dropped, allowing you To stop the action, the code of the function must return an [error object](#error-object). -#### 例題 1 +#### 例題 -Products can be deleted only if they have been flagged TO DELETE. +In this example, it is not allowed to drop a product that is not labelled "TO DELETE". In this case, you return an error object and thus, stop the drop action. ```4d - //ProductsEntity class -Function event validateDrop status($event : Object) : Object - -If (This.status != "TO DELETE") - - var $result:= New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={attribute; $event.attributeName; info: "The status must be TO DELETE"} - $result.fatalError:=False - return $result -End if -``` +// ProductsEntity class -#### 例題 2 +Function event validateDrop status($event : Object) : Object -The user can delete products if they are flagged as "TO DELETE" and if their creation year is < current year -3. +var $result : Object -```4d - //ProductsEntity class -Function event validateDrop($event : Object) : Object - -var $yearOffSet : Integer -$yearOffSet:=Year of(Current date)-3 - -If ((This.status != "TO DELETE") || (Year of(This.creationDate) >= $yearOffSet)) - var $result:=New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={info: "The status must be TO DELETE and the creation year must be lower than " + String($yearOffSet)} - $result.fatalError:=False - return $result +// Products must be marked as TO DELETE to be dropped +If (This.status#"TO DELETE") + $result:={errCode: 1; message: "You can't drop this product"; \ + extraDescription: {info: "This product must be marked as To Delete"}; seriousError: False} End if + +return $result ``` ### `Function event dropping` @@ -579,54 +553,31 @@ The business logic should raise errors which cannot be detected during the `vali To stop the action, the code of the function must return an [error object](#error-object). -#### 例題 1 +#### 例題 -When dropping an order with *totalPrice >= 500*, a log file is updated. +Here is an example of `dropping` event at entity level: ```4d - //OrderEntity class -Function event dropping totalPrice ($event : Object) - -var $log : cs.LogEntity -var $status: Object - -If (This.totalPrice >= 500) - - $log:=ds.Log.new() - $log.orderID:=This.ID - $log.orderPrice:=This.totalPrice - $log.event:="Drop" - $log.creationDate:=Current date() - $status:=$log.save() - - If($status.success=False) - throw ({errCode: 1; message: "Error while updating the log file"}) - End if -End if - -``` - -#### 例題 2 - -When a product is dropped, a log file is updated. +// ProductsEntity class +Function event dropping($event : Object) : Object -```4d - //ProductsEntity class -Function event dropping ($event : Object) +var $result : Object +var $userManualFile : 4D.File -var $log : cs.LogEntity -var $status: Object +$userManualFile:=File(This.userManualPath) -$log:=ds.Log.new() -$log.productID:=This.ID -$log.productPrice:=This.price -$log.event:="Drop" -$log.creationDate:=Current date() -$status:=$log.save() + // When dropping a product, its user manual is also deleted on the disk + // This action may fail +Try + If ($userManualFile.exists) + $userManualFile.delete() + End if +Catch + // Dropping the user manual failed + $result:={errCode: 1; message: "Drop failed"; extraDescription: {info: "The user manual can't be dropped"}} +End try -If($status.success=False) - throw ({errCode: 1; message:"Error while updating the log file"}) -End if +return $result ``` ### `Function event afterDrop` @@ -653,50 +604,21 @@ The dropped entity is referenced by `This` and still exists in memory. ::: -#### 例題 1 +#### 例題 -Send a mail to the customer with the details of the dropped order. +If the drop action failed, then the product must be checked manually: ```4d - //OrderEntity class -Function event afterDrop ($event : Object) - -var $oAuth2 : cs.NetKit.OAuth2Provider -var $google : cs.NetKit.Google - - //$param contains clientId, secretId... -$oAuth2:=cs.NetKit.OAuth2Provider.new($param) -$google:=cs.NetKit.Google.new($oAuth2; {mailType: "JMAP"}) - - //Email creation -$email:=New object -$email.from:="youremail@gmail.com" -$email.to:="destinationmail@mail.com" -$email.subject:="Your order is cancelled" -$email.textBody:="Products numbers: " + This.products.number.join("-") - - //Email sending -$status:=$google.mail.send($email) -``` - -#### 例題 2 +Function event afterDrop($event : Object) -Create an action to do because there were errors in the [`dropping()`](#function-event-dropping) event. +var $status : Object -```4d - //ProductEntity class -Function event afterDrop ($event : Object) - -var $action: cs.ActionEntity -var $status: Object - - // The drop action failed -If($event.dropStatus = "failed") - $action:=ds.Action.new() - $action.label:=Last errors.first().message //message is "Error while dropping product XXX" - $action.status:="TO CHECK" - $status:=$action.save() -End if +If (($event.status.success=False) && ($event.status.errors=Null)) + //$event.status.errors is filled + //if the error comes from the validateDrop event + This.status:="Check this product - Drop action failed" + $status:=This.save() +End if ``` From aa47fc9418f3137cc4c5c19cf14bba24c91114e7 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 07:47:44 +0200 Subject: [PATCH 09/57] New translations orda-events.md (Portuguese, Brazilian) --- .../current/ORDA/orda-events.md | 246 ++++++------------ 1 file changed, 84 insertions(+), 162 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/ORDA/orda-events.md b/i18n/pt/docusaurus-plugin-content-docs/current/ORDA/orda-events.md index cd035c693e740d..d95347972ed07a 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/ORDA/orda-events.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/ORDA/orda-events.md @@ -18,7 +18,7 @@ You cannot directly trigger event function execution. Events are called automati :::tip Related blog post -[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-data-persistence-actions) +[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-database-operations) ::: @@ -52,7 +52,7 @@ ORDA [`constructor()`](./ordaClasses.md#class-constructor) functions are always ::: -With other remote configurations (i.e. Qodly applications, [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). +With other remote configurations (i.e. [Qodly applications](https://developer.4d.com/qodly), [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). ### Summary table @@ -139,7 +139,7 @@ This event is triggered as soon as the 4D Server / 4D engine can detect a modifi - the user sets a value on a 4D form, - the 4D code makes an assignment with the `:=` operator. The event is also triggered in case of self-assignment (`$entity.attribute:=$entity.attribute`). - in **client/server without the `local` keyword**: some 4D code that makes an assignment with the `:=` operator is [executed on the server](../commands-legacy/execute-on-server.md). -- in **client/server without the `local` keyword**, in **[Qodly application](https://developer.qodly.com/docs)** and **[remote datastore](../commands/open-datastore.md)**: the entity is received on 4D Server while calling an ORDA function (on the entity or with the entity as parameter). It means that you might have to implement a *refresh* or *preview* function on the remote application that sends an ORDA request to the server and triggers the event. +- in **client/server without the `local` keyword**, in **[Qodly application](https://developer.4d.com/qodly)** and **[remote datastore](../commands/open-datastore.md)**: the entity is received on 4D Server while calling an ORDA function (on the entity or with the entity as parameter). It means that you might have to implement a *refresh* or *preview* function on the remote application that sends an ORDA request to the server and triggers the event. - with the REST server: the value is received on the REST server with a [REST request](../REST/$method.md#methodupdate) (`$method=update`) The function receives an [*event* object](#event-parameter) as parameter. @@ -348,26 +348,21 @@ It is not recommended to update the entity within this function (using `This`). #### Exemplo -In this example, the user is not allowed to save a product with a margin lower than the average. In case of an invalid price attribute, you return an error object and thus, stop the save action. +In this example, it is not allowed to save a product with a margin lower than 50%. In case of an invalid price attribute, you return an error object and thus, stop the save action. ```4d // ProductsEntity class +// +// validateSave event at attribute level Function event validateSave margin($event : Object) : Object var $result : Object -var $marginAverage : Real -$marginAverage:=ds.Products.query("category= :1"; This.category).average("margin") - -If (This.margin<$marginAverage) - $result:={\ - errCode: 1; \ - message: "The margin of this product ("+String(This.margin)+") is under the average"; \ - extraDescription: {\ - info: "For the "+This.category+" category the margin average is: "+String($marginAverage)};\ - fatalError: False} +//The user can't create a product whose margin is < 50% +If (This.margin<50) + $result:={errCode: 1; message: "The validation of this product failed"; \ + extraDescription: {info: "The margin of this product ("+String(This.margin)+") is lower than 50%"}; seriousError: False} End if - return $result ``` @@ -408,32 +403,35 @@ To stop the action, the code of the function must return an [error object](#erro #### Exemplo -When a product is saved, some information is logged to an external system which may be unavailable. +When a file is saved on disk, catch errors related to disk space for example. ```4d -Function event saving($event : Object) : Object +// ProductsEntity class +// saving event at attribute level +Function event saving userManualPath($event : Object) : Object -var $result; $status : Object -var $log : cs.Entity -var $remote : 4D.DataStoreImplementation - -Try - $remote:=Open datastore({hostname: "events@acme.com"}; "logs") - $log:=$remote.Logs.new() - $log.productId:=This.ID - $log.stamp:=Timestamp - $log.event:="Created by "+Current user() - $status:=$log.save() -Catch - $result:={\ - errCode: Last errors.last().errCode;\ - message: Last errors.last().message; \ - extraDescription: {info: "The external Logs can't be reached"}} -End try +var $result : Object +var $userManualFile : 4D.File +var $fileCreated : Boolean + +If (This.userManualPath#"") + $userManualFile:=File(This.userManualPath) + + // The user manual document file is created on the disk + // This may fail if no more space is available + Try + $fileCreated:=$userManualFile.create() + Catch + // No more room on disk for example + $result:={/ + errCode: 1; message: "Error during the save action for this product"; / + extraDescription: {info: "There is no available space on disk to store the user manual"}/ + } + End try +End if return $result - ``` ### `Function event afterSave` @@ -454,29 +452,25 @@ The function receives an [*event* object](#event-parameter) as parameter. - To avoid infinite loops, calling a [`save()`](../API/EntityClass.md#save) on the current entity (through `This`) in this function is **not allowed**. It will raise an error. - Throwing an [error object](#error-object) is **not supported** by this function. -#### Exemplo 1 +#### Exemplo -If an error occurred in the above saving event, the product is recorded in the ProductsInFailure dataclass so an employee can review it later. +If an error occurred in the above saving event, the attribute value is reset accordingly in the `afterSave` event: ```4d // ProductsEntity class Function event afterSave($event : Object) -var $failure : cs.ProductsInFailureEntity -var $status : Object - - // $event.status.errors is filled if the error comes from a validateSave event If (($event.status.success=False) && ($event.status.errors=Null)) - $failure:=ds.ProductsInFailure.new() - $failure.name:=This.name - $failure.category:=This.category - $failure.costPrice:=This.costPrice - $failure.retailPrice:=This.retailPrice - $failure.reason:="Error during the save action" - $failure.stamp:=Timestamp - $status:=$failure.save() -End if - + // $event.status.errors is filled if the error comes from the validateSave event + + // The userManualPath attribute has not been properly saved + // Its value is reset + If ($event.savedAttributes.indexOf("userManualPath")=-1) + This.userManualPath:="" + This.status:="KO" + End if + +End if ``` ### `Function event validateDrop` @@ -506,44 +500,24 @@ This event is triggered **before** the entity is actually dropped, allowing you To stop the action, the code of the function must return an [error object](#error-object). -#### Exemplo 1 +#### Exemplo -Products can be deleted only if they have been flagged TO DELETE. +In this example, it is not allowed to drop a product that is not labelled "TO DELETE". In this case, you return an error object and thus, stop the drop action. ```4d - //ProductsEntity class -Function event validateDrop status($event : Object) : Object - -If (This.status != "TO DELETE") - - var $result:= New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={attribute; $event.attributeName; info: "The status must be TO DELETE"} - $result.fatalError:=False - return $result -End if -``` +// ProductsEntity class -#### Exemplo 2 +Function event validateDrop status($event : Object) : Object -The user can delete products if they are flagged as "TO DELETE" and if their creation year is < current year -3. +var $result : Object -```4d - //ProductsEntity class -Function event validateDrop($event : Object) : Object - -var $yearOffSet : Integer -$yearOffSet:=Year of(Current date)-3 - -If ((This.status != "TO DELETE") || (Year of(This.creationDate) >= $yearOffSet)) - var $result:=New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={info: "The status must be TO DELETE and the creation year must be lower than " + String($yearOffSet)} - $result.fatalError:=False - return $result +// Products must be marked as TO DELETE to be dropped +If (This.status#"TO DELETE") + $result:={errCode: 1; message: "You can't drop this product"; \ + extraDescription: {info: "This product must be marked as To Delete"}; seriousError: False} End if + +return $result ``` ### `Function event dropping` @@ -579,54 +553,31 @@ The business logic should raise errors which cannot be detected during the `vali To stop the action, the code of the function must return an [error object](#error-object). -#### Exemplo 1 +#### Exemplo -When dropping an order with *totalPrice >= 500*, a log file is updated. +Here is an example of `dropping` event at entity level: ```4d - //OrderEntity class -Function event dropping totalPrice ($event : Object) - -var $log : cs.LogEntity -var $status: Object - -If (This.totalPrice >= 500) - - $log:=ds.Log.new() - $log.orderID:=This.ID - $log.orderPrice:=This.totalPrice - $log.event:="Drop" - $log.creationDate:=Current date() - $status:=$log.save() - - If($status.success=False) - throw ({errCode: 1; message: "Error while updating the log file"}) - End if -End if - -``` - -#### Exemplo 2 - -When a product is dropped, a log file is updated. +// ProductsEntity class +Function event dropping($event : Object) : Object -```4d - //ProductsEntity class -Function event dropping ($event : Object) +var $result : Object +var $userManualFile : 4D.File -var $log : cs.LogEntity -var $status: Object +$userManualFile:=File(This.userManualPath) -$log:=ds.Log.new() -$log.productID:=This.ID -$log.productPrice:=This.price -$log.event:="Drop" -$log.creationDate:=Current date() -$status:=$log.save() + // When dropping a product, its user manual is also deleted on the disk + // This action may fail +Try + If ($userManualFile.exists) + $userManualFile.delete() + End if +Catch + // Dropping the user manual failed + $result:={errCode: 1; message: "Drop failed"; extraDescription: {info: "The user manual can't be dropped"}} +End try -If($status.success=False) - throw ({errCode: 1; message:"Error while updating the log file"}) -End if +return $result ``` ### `Function event afterDrop` @@ -653,50 +604,21 @@ The dropped entity is referenced by `This` and still exists in memory. ::: -#### Exemplo 1 +#### Exemplo -Send a mail to the customer with the details of the dropped order. +If the drop action failed, then the product must be checked manually: ```4d - //OrderEntity class -Function event afterDrop ($event : Object) - -var $oAuth2 : cs.NetKit.OAuth2Provider -var $google : cs.NetKit.Google - - //$param contains clientId, secretId... -$oAuth2:=cs.NetKit.OAuth2Provider.new($param) -$google:=cs.NetKit.Google.new($oAuth2; {mailType: "JMAP"}) - - //Email creation -$email:=New object -$email.from:="youremail@gmail.com" -$email.to:="destinationmail@mail.com" -$email.subject:="Your order is cancelled" -$email.textBody:="Products numbers: " + This.products.number.join("-") - - //Email sending -$status:=$google.mail.send($email) -``` - -#### Exemplo 2 +Function event afterDrop($event : Object) -Create an action to do because there were errors in the [`dropping()`](#function-event-dropping) event. +var $status : Object -```4d - //ProductEntity class -Function event afterDrop ($event : Object) - -var $action: cs.ActionEntity -var $status: Object - - // The drop action failed -If($event.dropStatus = "failed") - $action:=ds.Action.new() - $action.label:=Last errors.first().message //message is "Error while dropping product XXX" - $action.status:="TO CHECK" - $status:=$action.save() -End if +If (($event.status.success=False) && ($event.status.errors=Null)) + //$event.status.errors is filled + //if the error comes from the validateDrop event + This.status:="Check this product - Drop action failed" + $status:=This.save() +End if ``` From 967bbea101200a162d2f9f92d8b952c838d0c856 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 07:49:42 +0200 Subject: [PATCH 10/57] New translations entityclass.md (Spanish) --- .../version-20-R10/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/EntityClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/EntityClass.md index ac489e35bd61c7..36b6aaf3f75cb6 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/EntityClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/EntityClass.md @@ -396,7 +396,7 @@ El objeto devuelto por `.drop()` contiene las siguientes propiedades: | ----------------------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `dk status entity does not exist anymore` | 5 | La entidad ya no existe en los datos. Este error puede ocurrir en los siguientes casos:
  • la entidad ha sido eliminada (el marcador ha cambiado y ahora el espacio de memoria está libre)
  • la entidad ha sido eliminada y reemplazada por otra con otra clave primaria (el marcador ha cambiado y una nueva entidad ahora utiliza el espacio memoria). Cuando se utiliza entity.drop( ), este error puede ser devuelto cuando se utiliza la opción dk force drop if stamp changed. Cuando se utiliza entity.lock(), se puede devolver este error cuando la opción dk reload if stamp changed es utilizada
  • **statusText asociado**: "Entity does not exist anymore" | | `dk status locked` | 3 | La entidad está bloqueada por un bloqueo pesimista.
    **statusText asociado**: "Already locked" | -| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.
    **Associated statusText**: "Other error" | +| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.
    **statusText asociado**\*: "Other error" | | `dk status stamp has changed` | 2 | The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).
  • with `.save( )`: error only if the `dk auto merge` option is not used
  • with `.drop( )`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock()`: error only if the `dk reload if stamp changed` option is not used
  • **Associated statusText**: "Stamp has changed"
  • | | `dk status wrong permission` | 1 | Los privilegios actuales no permiten suprimir la entidad. **Associated statusText**: "Permission Error" | From 06ec4cfd058961f62999973995571cf306127484 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 07:52:39 +0200 Subject: [PATCH 11/57] New translations webserverclass.md (Japanese) --- .../version-20-R10/API/WebServerClass.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/WebServerClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/WebServerClass.md index 17424e7687aaaa..355622d42cb192 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/WebServerClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/WebServerClass.md @@ -318,7 +318,7 @@ The HTTPリクエストログファ **.isRunning** : Boolean -*内容* +*読み取り専用プロパティ* Webサーバーで旧式セッションが有効されている場合に true、それ以外は false。 @@ -417,7 +417,7 @@ The HTTPリクエストログファ **.name** : Text -*内容* +*読み取り専用プロパティ* Webサーバーアプリケーションの名称。 @@ -429,7 +429,7 @@ The HTTPリクエストログファ **.openSSLVersion** : Text -*内容* +*読み取り専用プロパティ* 使用されている OpenSSLライブラリのバージョン。 @@ -441,7 +441,7 @@ The HTTPリクエストログファ **.perfectForwardSecrecy** : Boolean -*内容* +*読み取り専用プロパティ* サーバーの PFS利用可否状況。 @@ -489,7 +489,7 @@ The HTTPリクエストログファ セッションID の保存に使用されるセッションcookie の名称。 -*内容* +*読み取り専用プロパティ* From c0ce36d69b48dd531d232061019a81417e1f5cb5 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 08:09:49 +0200 Subject: [PATCH 12/57] New translations updates.md (Spanish) --- .../version-20-R10/Notes/updates.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Notes/updates.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Notes/updates.md index d82ec8269a7b3a..5ec31955dfa4ec 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Notes/updates.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Notes/updates.md @@ -14,12 +14,12 @@ Lea las [**Novedades en 4D 20 R10**](https://blog.4d.com/en-whats-new-in-4d-20-R - Nueva clase [`4D.Vector`](../API/VectorClass.md) para procesar y comparar vectores, normalmente calculados por IAs. - Nuevas opciones para generar UUIDs en **versión 7** para el comando [4D automatic fields](../settings/database.md#auto-uuid-version) y [`Generate UUID`](../commands/generate-uuid). - Nuevas clases [`UDPSocket`](../API/UDPSocketClass.md) y [`UDPEvent`](../API/UDPEventClass.md) para enviar datos utilizando sockets UDP. Soporte de registro detallado para eventos UDP en el archivo de registro [`4DTCPUDPLog.txt`](../Debugging/debugLogFiles.md#4dtcpudplogtxt) (renombrado de `4DTCPLog.txt`). -- New [`.promote()`](../API/SessionClass.md#promote) and [`.demote()`](../API/SessionClass.md#demote) functions in the [Session class](../API/SessionClass.md) to dynamically add/remove privileges in a web process. -- [Automatic selection of licenses to embed](../Desktop/building.md#application-automatically-embedding-available-licenses) in the Build application dialog box, modified [`Create deployment license`](../commands/create-deployment-license.md) command, new [`AutomaticLicenseIntegration`](https://doc.4d.com/4Dv20R10/4D/20-R10/AutomaticLicenseIntegration.300-7611090.en.html) BuildApplication xml key. +- Nuevas funciones [`.promote()`](../API/SessionClass.md#promote) y [`.demote()`](../API/SessionClass.md#demote) en la [clase Session](../API/SessionClass.md) para añadir/eliminar privilegios dinámicamente en un proceso web. +- [Selección automática de licencias a integrar](../Desktop/building.md#application-automatically-embedding-available-licenses) en el cuadro de diálogo del Generador de aplicaciones, modificación del comando [`Create deployment license`](../commands/create-deployment-license.md), nueva llave xml BuildApplication [`AutomaticLicenseIntegration`](https://doc.4d.com/4Dv20R10/4D/20-R10/AutomaticLicenseIntegration.300-7611090.en.html). - Seguridad mejorada para copiar/pegar fórmulas en [4D Write Pro](../WritePro/managing-formulas.md) y [áreas de texto con estilo](../FormObjects/input_overview.md): las fórmulas copiadas desde fuera de la aplicación 4D actual se pegan ahora siempre sólo como valores. -- 4D AIKit component: new [OpenAIEmbeddingsAPI class](../aikit/Classes/OpenAIEmbeddingsAPI.md) to create embeddings using OpenAI's API. -- You can now [associate a class](../Develop/field-properties.md) to an object field in the structure editor. -- Automatic handling of [recursive dependencies](../Project/components.md#automatic-dependency-resolution). +- Componente 4D AIKit: nueva [clase OpenAIEmbeddingsAPI](../aikit/Classes/OpenAIEmbeddingsAPI.md) para crear embeddings utilizando la API OpenAI. +- Ahora puede [asociar una clase](../Develop/field-properties.md) a un campo objeto en el editor de estructura. +- Gestión automática de [dependencias recursivas](../Project/components.md#automatic-dependency-resolution). - Lenguaje 4D: - Por coherencia, los comandos [`Create entity selection`](../commands/create-entity-selection.md) y [`USE ENTITY SELECTION`](../commands/use-entity-selection.md) han sido movidos del tema ["4D Environment"](../commands/theme/4D_Environment.md) al ["Selection"](../commands/theme/Selection.md). - Nuevos comandos [`OBJECT SET DATA SOURCE FORMULA`](../commands/object-set-data-source-formula.md) y [`OBJECT Get data source formula`](../commands/object-get-data-source-formula.md) para asignar y leer los objetos `Formula` como fuentes de datos para los objetos de formulario. @@ -31,7 +31,7 @@ Lea las [**Novedades en 4D 20 R10**](https://blog.4d.com/en-whats-new-in-4d-20-R - En Windows, las fuentes de impresora actuales destinadas únicamente a la impresión (es decir, no se pueden utilizar en pantalla) ya no son cargadas al inicio por 4D. - Se ha eliminado la biblioteca *MeCab*. Este cambio sólo afecta al tratamiento del texto en japonés. - Cuando una variable o parámetro objeto se declara con un tipo ["cs" class](../Concepts/classes.md#cs), asignarlo con una instancia de objeto de una clase diferente genera ahora un error de sintaxis. -- The [`Time`](../commands/time) command now returns a negative time expression when the *timeValue* parameter is negative. Por ejemplo, `Time("-01:02:03")` devolverá **-01:02:03**. In previous releases, the negative sign was ignored. +- El comando [`Time`](../commands/time) devuelve ahora una expresión de tiempo negativa cuando el parámetro *timeValue* es negativo. Por ejemplo, `Time("-01:02:03")` devolverá **-01:02:03**. En versiones anteriores, se ignoraba el signo negativo. ## 4D 20 R9 @@ -103,7 +103,7 @@ Lea [**Novedades en 4D 20 R7**](https://blog.4d.com/en-whats-new-in-4d-20-R7/), - Lenguaje 4D: - Nuevos comandos: [Process info](../commands/process-info.md), [Session info](../commands/session-info.md), [SET WINDOW DOCUMENT ICON](../commands/set-window-document-icon.md) - Comandos modificados: [Process activity](../commands/process-activity.md), [Process number](../commands/process-number.md) - - Deprecated commands (replacement): `GET LAST ERROR STACK` ([Last errors](../commands/last-errors.md)), `GET SERIAL INFORMATION` ([License info](../commands/license-info.md)), `PROCESS PROPERTIES` ([Process info](../commands/process-info.md)), `SET SCREEN DEPTH`, `C_XXX` commands ([var](../Concepts/variables.md#declaring-variables) and [#DECLARE/Function](../Concepts/parameters.md#declaring-parameters) declarations). Deprecated commands are prefixed with "\*O\*". + - Comandos obsoletos (reemplazo): `GET LAST ERROR STACK` ([Last errors](../commands/last-errors.md)), `GET SERIAL INFORMATION` ([License info](../commands/license-info.md)), `PROCESS PROPERTIES` ([Process info](../commands/process-info.md)), `SET SCREEN DEPTH`, `C_XXX` commands ([var](../Concepts/variables.md#declaring-variables) y [#DECLARE/declaraciones Function](../Concepts/parameters.md#declaring-parameters)). Deprecated commands are prefixed with "\*O\*". - 4D Write Pro: - Nuevo comando: [WP DELETE SECTION](../WritePro/commands/wp-delete-section.md) - Comandos modificados: [WP DELETE SUBSECTION](../WritePro/commands/wp-delete-subsection.md) y [WP RESET ATTRIBUTES](../WritePro/commands/wp-reset-attributes.md) From 9b89f657a123d908a6275130451f8350245979f6 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 08:28:00 +0200 Subject: [PATCH 13/57] New translations openai.md (Spanish) --- .../version-20-R10/aikit/Classes/OpenAI.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/aikit/Classes/OpenAI.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/aikit/Classes/OpenAI.md index b218df5a79d550..098b4d13d45456 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/aikit/Classes/OpenAI.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/aikit/Classes/OpenAI.md @@ -29,9 +29,9 @@ The `OpenAI` class provides a client for accessing various OpenAI API resources. Crear una instancia de la clase cliente OpenAI. -| Nombre del argumento | Tipo | Descripción | -| ------------------------- | -------------- | ------------------------------------------------------- | -| `apiKey or configuration` | Texto u objeto | apiKey if Text or configuration Object. | +| Nombre del argumento | Tipo | Descripción | +| ------------------------- | -------------- | --------------------------------------------------------- | +| `apiKey or configuration` | Texto u objeto | apiKey si Text u objeto de configuración. | #### Llave API From 8fd31e1a9e1143bc9cf08e7036e6cba86a88aca6 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 10:10:23 +0200 Subject: [PATCH 14/57] New translations entityclass.md (Spanish) --- .../version-21/API/EntityClass.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/API/EntityClass.md b/i18n/es/docusaurus-plugin-content-docs/version-21/API/EntityClass.md index 235b647126aa6e..c2aa39d0888d53 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/API/EntityClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/API/EntityClass.md @@ -398,7 +398,7 @@ El objeto devuelto por `.drop()` contiene las siguientes propiedades: | `dk status entity does not exist anymore` | 5 | La entidad ya no existe en los datos. Este error puede ocurrir en los siguientes casos:
  • la entidad ha sido eliminada (el marcador ha cambiado y ahora el espacio de memoria está libre)
  • la entidad ha sido eliminada y reemplazada por otra con otra clave primaria (el marcador ha cambiado y una nueva entidad ahora utiliza el espacio memoria). When using entity.drop(), this error can be returned when dk force drop if stamp changed option is used. When using entity.lock(), this error can be returned when dk reload if stamp changed option is used.
  • **Associated statusText**: "Entity does not exist anymore" | | `dk status locked` | 3 | La entidad está bloqueada por un bloqueo pesimista.
    **statusText asociado**: "Already locked" | | `dk status validation failed` | 7 | Non fatal error sent by the developer for a [validate event](../ORDA/orda-events.md). **Associated statusText**: "Mild Validation Error" | -| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.
    **Associated statusText**: "Other error" | +| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.
    **statusText asociado**\*: "Other error" | | `dk status serious validation error` | 8 | Fatal error sent by the developer for a [validate event](../ORDA/orda-events.md). **Associated statusText**: "Serious Validation Error" | | `dk status stamp has changed` | 2 | The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).
  • with `.save()`: error only if the `dk auto merge` option is not used
  • with `.drop()`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock()`: error only if the `dk reload if stamp changed` option is not used
  • **Associated statusText**: "Stamp has changed"
  • | | `dk status wrong permission` | 1 | Los privilegios actuales no permiten suprimir la entidad. **Associated statusText**: "Permission Error" | @@ -1019,7 +1019,7 @@ El objeto devuelto por `.lock()` contiene las siguientes propiedades: | ----------------------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `dk status entity does not exist anymore` | 5 | La entidad ya no existe en los datos. Este error puede ocurrir en los siguientes casos:
  • la entidad ha sido eliminada (el marcador ha cambiado y ahora el espacio de memoria está libre)
  • la entidad ha sido eliminada y reemplazada por otra con otra clave primaria (el marcador ha cambiado y una nueva entidad ahora utiliza el espacio memoria). Cuando se utiliza `.drop()`, este error puede devolverse cuando se utiliza la opción dk force drop if stamp changed. Cuando se utiliza `.lock()`, este error puede ser devuelto cuando se utiliza la opción `dk reload if stamp changed`

  • **statusText asociado**: "Entity does not exist anymore" | | `dk status locked` | 3 | La entidad está bloqueada por un bloqueo pesimista. **statusText asociado**: "Already locked" | -| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.
    **Associated statusText**: "Other error" | +| `dk status serious error` | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc.
    **statusText asociado**\*: "Other error" | | `dk status stamp has changed` | 2 | The internal stamp value of the entity does not match the one of the entity stored in the data (optimistic lock).
  • with `.save()`: error only if the `dk auto merge` option is not used
  • with `.drop()`: error only if the `dk force drop if stamp changed` option is not used
  • with `.lock()`: error only if the `dk reload if stamp changed` option is not used

  • **Associated statusText**: "Stamp has changed" | #### Ejemplo 1 From e9797dfce5bfba38617d0a53cbe5b69234629344 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 10:25:49 +0200 Subject: [PATCH 15/57] New translations forms.md (Spanish) --- .../version-21/FormEditor/forms.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/FormEditor/forms.md b/i18n/es/docusaurus-plugin-content-docs/version-21/FormEditor/forms.md index 62fd87c2f3ffa9..8c272c69a56671 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/FormEditor/forms.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/FormEditor/forms.md @@ -147,27 +147,27 @@ En este caso, el modo de renderizado Fluent UI se utilizará por defecto en Wind Cada formulario puede definir su propio renderizado a través de la propiedad **Apariencia de los Widgets**. Las siguientes opciones están disponibles: - **Heredado**: hereda las propiedades globales de la aplicación (por defecto), -- **Classic**: uses the classic Windows style, -- **Fluent UI**: enables the modern rendering based on Fluent UI.
    +- **Classic**: utiliza el estilo clásico de Windows, +- **Fluent UI**: permite el renderizado moderno basado en Fluent UI.
    ![](../assets/en/FormObjects/fluentui-form.png) -The corresponding [JSON form property](./properties_JSONref.md) is `fluentUI` with value undefined (i.e. inherited, default value), "true" or "false". +La [propiedad de formulario JSON](./properties_JSONref.md) correspondiente es `fluentUI` con el valor undefined (es decir, heredado, valor por defecto), "true" o "false". ### Comportamientos específicos -When using 4D forms with Fluent UI rendering, you need to pay attention to the following points: +Cuando utilice los formularios 4D con el renderizado Fluent UI, debe prestar atención a los siguientes puntos: -- El nuevo comando `FORM Windows theme` devuelve el tema de visualización actual del formulario. Possible values: "Classic" or "FluentUI". If there is no current form or the command is called on macOS, and empty string is returned. -- If [`GET STYLE SHEET INFO`](../commands-legacy/get-style-sheet-info.md) is called in the context of a form, the information returned relates to the current appearance of the form (Classic or FluentUI). If the command is called outside the context of a form, the information returned relates to the [global project settings](#application-setting). -- [`SET MENU ITEM STYLE`](../commands-legacy/set-menu-item-style.md) with `Underline` *itemStyle* parameter is not supported (ignored) for pop up menus. -- [Stepper](../FormObjects/stepper.md) form object does not support [double-click event](../Events/onDoubleClicked.md). -- [Circle buttons](../FormObjects/button_overview.md#circle) are supported (similar as macOS). -- The [`WA ZOOM IN`](../commands-legacy/wa-zoom-in.md) / [`WA ZOOM OUT`](../commands-legacy/wa-zoom-out.md) commands are not supported in Web areas with system rendering engine. -- A focus ring can be added to picture and text [inputs](../FormObjects/input_overview.md). +- El nuevo comando `FORM Windows theme` devuelve el tema de visualización actual del formulario. Valores posibles: "Classic" o "FluentUI". Si no existe un formulario actual o el comando se ejecuta en macOS, se devuelve una cadena vacía. +- Si [`GET STYLE SHEET INFO`](../commands-legacy/get-style-sheet-info.md) es llamado en el contexto de un formulario, la información devuelta se refiere a la apariencia actual del formulario (Classic o FluentUI). Si se llama al comando fuera del contexto de un formulario, la información devuelta se refiere a las [propiedades globales del proyecto](#application-setting). +- [`SET MENU ITEM STYLE`](../commands-legacy/set-menu-item-style.md) con el parámetro *itemStyle* `Underline` no es soportado (ignorado) para los menús emergentes. +- El objeto de formulario [Stepper](../FormObjects/stepper.md) no admite el [evento doble clic](../Events/onDoubleClicked.md). +- Los [botones circulares](../FormObjects/button_overview.md#circle) son soportados (como en macOS). +- Los comandos [`WA ZOOM IN`](../commands-legacy/wa-zoom-in.md) / [`WA ZOOM OUT`](../commands-legacy/wa-zoom-out.md) no son compatibles en áreas Web con motor de renderizado sistema. +- Se puede añadir rectángulo de foco a las [entradas](../FormObjects/input_overview.md) imagen y texto. -:::info Limitations +:::info Limitaciones -This **Developer preview** includes some limitations, which are [listed in the related blog post](https://blog.4d.com/modernize-your-4d-interfaces-with-fluent-ui). +Esta **Vista previa para desarrolladores** incluye algunas limitaciones, que se [enumeran en la entrada del blog relacionado](https://blog.4d.com/modernize-your-4d-interfaces-with-fluent-ui). ::: From 6c42ab51f71432184832312519fcde53d9c36c45 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 11:32:54 +0200 Subject: [PATCH 16/57] New translations orda-events.md (French) --- .../version-21/ORDA/orda-events.md | 244 ++++++------------ 1 file changed, 83 insertions(+), 161 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md index ce305436ea120e..ee558cb7612b7b 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md @@ -18,7 +18,7 @@ Vous ne pouvez pas déclencher directement l'exécution d'une fonction d'événe :::tip Article(s) de blog sur le sujet -[ORDA - Gérer une logique événementielle lors des actions de persistance des données](https://blog.4d.com/orda-handle-an-event-driven-logic-during-data-persistence-actions) +[ORDA - Gérer une logique événementielle lors des actions de persistance des données](https://blog.4d.com/orda-handle-an-event-driven-logic-during-database-operations) ::: @@ -52,7 +52,7 @@ Les fonctions ORDA [`constructor()`](./ordaClasses.md#class-constructor) sont to ::: -Avec d'autres configurations distantes (i.e. applications Qodly, [requêtes via l'API REST](../REST/REST_requests.md), ou requêtes via [`Open datastore`](../commands/open-datastore.md)), la fonction d'événement `touched()` est toujours exécutée **côté serveur**. Cela signifie que vous devez vous assurer que le serveur peut "voir" qu'un attribut a été touché pour déclencher l'événement (voir ci-dessous). +With other remote configurations (i.e. [Qodly applications](https://developer.4d.com/qodly), [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. Cela signifie que vous devez vous assurer que le serveur peut "voir" qu'un attribut a été touché pour déclencher l'événement (voir ci-dessous). ### Tableau de synthèse @@ -348,26 +348,21 @@ It is not recommended to update the entity within this function (using `This`). #### Exemple -In this example, the user is not allowed to save a product with a margin lower than the average. In case of an invalid price attribute, you return an error object and thus, stop the save action. +In this example, it is not allowed to save a product with a margin lower than 50%. In case of an invalid price attribute, you return an error object and thus, stop the save action. ```4d // ProductsEntity class +// +// validateSave event at attribute level Function event validateSave margin($event : Object) : Object var $result : Object -var $marginAverage : Real -$marginAverage:=ds.Products.query("category= :1"; This.category).average("margin") - -If (This.margin<$marginAverage) - $result:={\ - errCode: 1; \ - message: "The margin of this product ("+String(This.margin)+") is under the average"; \ - extraDescription: {\ - info: "For the "+This.category+" category the margin average is: "+String($marginAverage)};\ - fatalError: False} +//The user can't create a product whose margin is < 50% +If (This.margin<50) + $result:={errCode: 1; message: "The validation of this product failed"; \ + extraDescription: {info: "The margin of this product ("+String(This.margin)+") is lower than 50%"}; seriousError: False} End if - return $result ``` @@ -408,32 +403,35 @@ To stop the action, the code of the function must return an [error object](#erro #### Exemple -When a product is saved, some information is logged to an external system which may be unavailable. +When a file is saved on disk, catch errors related to disk space for example. ```4d -Function event saving($event : Object) : Object +// ProductsEntity class +// saving event at attribute level +Function event saving userManualPath($event : Object) : Object -var $result; $status : Object -var $log : cs.Entity -var $remote : 4D.DataStoreImplementation - -Try - $remote:=Open datastore({hostname: "events@acme.com"}; "logs") - $log:=$remote.Logs.new() - $log.productId:=This.ID - $log.stamp:=Timestamp - $log.event:="Created by "+Current user() - $status:=$log.save() -Catch - $result:={\ - errCode: Last errors.last().errCode;\ - message: Last errors.last().message; \ - extraDescription: {info: "The external Logs can't be reached"}} -End try +var $result : Object +var $userManualFile : 4D.File +var $fileCreated : Boolean + +If (This.userManualPath#"") + $userManualFile:=File(This.userManualPath) + + // The user manual document file is created on the disk + // This may fail if no more space is available + Try + $fileCreated:=$userManualFile.create() + Catch + // No more room on disk for example + $result:={/ + errCode: 1; message: "Error during the save action for this product"; / + extraDescription: {info: "There is no available space on disk to store the user manual"}/ + } + End try +End if return $result - ``` ### `Function event afterSave` @@ -454,29 +452,25 @@ La fonction reçoit un objet [*event*](#event-parameter) en paramètre. - To avoid infinite loops, calling a [`save()`](../API/EntityClass.md#save) on the current entity (through `This`) in this function is **not allowed**. It will raise an error. - Throwing an [error object](#error-object) is **not supported** by this function. -#### Exemple 1 +#### Exemple -If an error occurred in the above saving event, the product is recorded in the ProductsInFailure dataclass so an employee can review it later. +If an error occurred in the above saving event, the attribute value is reset accordingly in the `afterSave` event: ```4d // ProductsEntity class Function event afterSave($event : Object) -var $failure : cs.ProductsInFailureEntity -var $status : Object - - // $event.status.errors is filled if the error comes from a validateSave event If (($event.status.success=False) && ($event.status.errors=Null)) - $failure:=ds.ProductsInFailure.new() - $failure.name:=This.name - $failure.category:=This.category - $failure.costPrice:=This.costPrice - $failure.retailPrice:=This.retailPrice - $failure.reason:="Error during the save action" - $failure.stamp:=Timestamp - $status:=$failure.save() -End if - + // $event.status.errors is filled if the error comes from the validateSave event + + // The userManualPath attribute has not been properly saved + // Its value is reset + If ($event.savedAttributes.indexOf("userManualPath")=-1) + This.userManualPath:="" + This.status:="KO" + End if + +End if ``` ### `Function event validateDrop` @@ -506,44 +500,24 @@ This event is triggered **before** the entity is actually dropped, allowing you To stop the action, the code of the function must return an [error object](#error-object). -#### Exemple 1 +#### Exemple -Products can be deleted only if they have been flagged TO DELETE. +In this example, it is not allowed to drop a product that is not labelled "TO DELETE". In this case, you return an error object and thus, stop the drop action. ```4d - //ProductsEntity class -Function event validateDrop status($event : Object) : Object - -If (This.status != "TO DELETE") - - var $result:= New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={attribute; $event.attributeName; info: "The status must be TO DELETE"} - $result.fatalError:=False - return $result -End if -``` +// ProductsEntity class -#### Exemple 2 +Function event validateDrop status($event : Object) : Object -The user can delete products if they are flagged as "TO DELETE" and if their creation year is < current year -3. +var $result : Object -```4d - //ProductsEntity class -Function event validateDrop($event : Object) : Object - -var $yearOffSet : Integer -$yearOffSet:=Year of(Current date)-3 - -If ((This.status != "TO DELETE") || (Year of(This.creationDate) >= $yearOffSet)) - var $result:=New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={info: "The status must be TO DELETE and the creation year must be lower than " + String($yearOffSet)} - $result.fatalError:=False - return $result +// Products must be marked as TO DELETE to be dropped +If (This.status#"TO DELETE") + $result:={errCode: 1; message: "You can't drop this product"; \ + extraDescription: {info: "This product must be marked as To Delete"}; seriousError: False} End if + +return $result ``` ### `Function event dropping` @@ -579,54 +553,31 @@ The business logic should raise errors which cannot be detected during the `vali To stop the action, the code of the function must return an [error object](#error-object). -#### Exemple 1 +#### Exemple -When dropping an order with *totalPrice >= 500*, a log file is updated. +Here is an example of `dropping` event at entity level: ```4d - //OrderEntity class -Function event dropping totalPrice ($event : Object) - -var $log : cs.LogEntity -var $status: Object - -If (This.totalPrice >= 500) - - $log:=ds.Log.new() - $log.orderID:=This.ID - $log.orderPrice:=This.totalPrice - $log.event:="Drop" - $log.creationDate:=Current date() - $status:=$log.save() - - If($status.success=False) - throw ({errCode: 1; message: "Error while updating the log file"}) - End if -End if - -``` - -#### Exemple 2 - -When a product is dropped, a log file is updated. +// ProductsEntity class +Function event dropping($event : Object) : Object -```4d - //ProductsEntity class -Function event dropping ($event : Object) +var $result : Object +var $userManualFile : 4D.File -var $log : cs.LogEntity -var $status: Object +$userManualFile:=File(This.userManualPath) -$log:=ds.Log.new() -$log.productID:=This.ID -$log.productPrice:=This.price -$log.event:="Drop" -$log.creationDate:=Current date() -$status:=$log.save() + // When dropping a product, its user manual is also deleted on the disk + // This action may fail +Try + If ($userManualFile.exists) + $userManualFile.delete() + End if +Catch + // Dropping the user manual failed + $result:={errCode: 1; message: "Drop failed"; extraDescription: {info: "The user manual can't be dropped"}} +End try -If($status.success=False) - throw ({errCode: 1; message:"Error while updating the log file"}) -End if +return $result ``` ### `Function event afterDrop` @@ -653,50 +604,21 @@ The dropped entity is referenced by `This` and still exists in memory. ::: -#### Exemple 1 +#### Exemple -Send a mail to the customer with the details of the dropped order. +If the drop action failed, then the product must be checked manually: ```4d - //OrderEntity class -Function event afterDrop ($event : Object) - -var $oAuth2 : cs.NetKit.OAuth2Provider -var $google : cs.NetKit.Google - - //$param contains clientId, secretId... -$oAuth2:=cs.NetKit.OAuth2Provider.new($param) -$google:=cs.NetKit.Google.new($oAuth2; {mailType: "JMAP"}) - - //Email creation -$email:=New object -$email.from:="youremail@gmail.com" -$email.to:="destinationmail@mail.com" -$email.subject:="Your order is cancelled" -$email.textBody:="Products numbers: " + This.products.number.join("-") - - //Email sending -$status:=$google.mail.send($email) -``` - -#### Exemple 2 +Function event afterDrop($event : Object) -Create an action to do because there were errors in the [`dropping()`](#function-event-dropping) event. +var $status : Object -```4d - //ProductEntity class -Function event afterDrop ($event : Object) - -var $action: cs.ActionEntity -var $status: Object - - // The drop action failed -If($event.dropStatus = "failed") - $action:=ds.Action.new() - $action.label:=Last errors.first().message //message is "Error while dropping product XXX" - $action.status:="TO CHECK" - $status:=$action.save() -End if +If (($event.status.success=False) && ($event.status.errors=Null)) + //$event.status.errors is filled + //if the error comes from the validateDrop event + This.status:="Check this product - Drop action failed" + $status:=This.save() +End if ``` From 58427c15d897970f909ebe9997cb653f43288dcf Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 11:33:05 +0200 Subject: [PATCH 17/57] New translations updates.md (Spanish) --- .../version-21/Notes/updates.md | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/Notes/updates.md b/i18n/es/docusaurus-plugin-content-docs/version-21/Notes/updates.md index 65292b41b776d6..32d9b34d2cdefe 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/Notes/updates.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/Notes/updates.md @@ -9,50 +9,50 @@ Lea [**Novedades en 4D 21**](https://blog.4d.com/en-whats-new-in-4d-21/), la ent #### Lo más destacado -- Support of AI Vector Searches in the [`query()`](../API/DataClassClass.md#query-by-vector-similarity) function and in the [`$filter`](../REST/$filter.md#vector-similarity) REST API. -- Support of TLS encryption for the [4D.TCPConnection](../API/TCPConnectionClass.md#4dtcpconnectionnew) class. +- Soporte de búsquedas vectoriales de IA en la función [`query()`](../API/DataClassClass.md#query-by-vector-similarity) y en la API REST [`$filter`](../REST/$filter.md#vector-similarity). +- Soporte de encriptación TLS para la clase [4D.TCPConnection](../API/TCPConnectionClass.md#4dtcpconnectionnew). - Servidor Web: - - new [HTTP rules](../WebServer/http-rules.md) to customize HTTP response headers, - - ability to set [HTTP request handlers](../WebServer/http-request-handler.md) using a `handlers` property in the *settings* parameter of the Web server [`start()`](../API/WebServerClass.md#start) function, - - the Web server object contains new [`rules`](../API/WebServerClass.md#rules) and [`handlers`](../API/WebServerClass.md#handlers) properties. -- New [ORDA events on data](../ORDA/orda-events.md): validateSave, saving, afterSave, validateDrop, dropping, afterDrop. -- New option allowing to use certificates from Windows Certificate Store instead of a local certificates folder in [`HTTPRequest`](../API/HTTPRequestClass.md#4dhttprequestnew) and [`HTTPAgent`](../API/HTTPAgentClass.md#4dhttpagentnew) classes. + - nuevas [reglas HTTP](../WebServer/http-rules.md) para personalizar los encabezados de respuesta HTTP, + - posibilidad para definir los [gestores de peticiones HTTP](../WebServer/http-request-handler.md) utilizando una propiedad `handlers` en el parámetro *settings* de la función [`start()`](../API/WebServerClass.md#start) del servidor Web, + - el objeto servidor Web contiene nuevas propiedades [`rules`](../API/WebServerClass.md#rules) y [`handlers`](../API/WebServerClass.md#handlers). +- Nuevos [eventos ORDA sobre los datos](../ORDA/orda-events.md): validateSave, saving, afterSave, validateDrop, dropping, afterDrop. +- Nueva opción que permite utilizar certificados de Windows Certificate Store en lugar de una carpeta local de certificados en las clases [`HTTPRequest`](../API/HTTPRequestClass.md#4dhttprequestnew) y [`HTTPAgent`](../API/HTTPAgentClass.md#4dhttpagentnew). - Cliente/servidor: - - You can display Qodly pages in Web areas and [share the remote client session](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). - - The [QUIC network layer](../settings/client-server.md#network-layer) has been enhanced to handle network interface changes transparently, for example when you travel with your laptop. See [this blog post](https://blog.4d.com/work-and-move-with-quic-and-network-switching). -- You can now [create components directly from the host project](../Extensions/develop-components.md#creating-components) and [edit their code from a dedicated tab](../Extensions/develop-components.md#editing-all-component-code) in the 4D Explorer without leaving or restarting the project. -- The 4D product activation step has been simplified and automated during [sign-in](../GettingStarted/Installation.md#sign-in). -- 4D AIKit component: new features to [invoke a specific tool automatically](../aikit/Classes/OpenAIChatHelper.md#registertool) and [specify a response format](../aikit/Classes/OpenAIChatCompletionsParameters.md#response-format). + - Puede mostrar las páginas Qodly en las áreas Web y [compartir la sesión del cliente remoto](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). + - La [capa red QUIC](../settings/client-server.md#network-layer) se ha mejorado para gestionar los cambios de interfaz de red de forma transparente, por ejemplo, cuando viajas co su ordenador portátil. Ver [esta entrada del blog](https://blog.4d.com/work-and-move-with-quic-and-network-switching). +- Ahora puede [crear componentes directamente desde el proyecto local](../Extensions/develop-components.md#creating-components) y [editar su código desde una pestaña dedicada](../Extensions/develop-components.md#editing-all-component-code) en el Explorador 4D sin salir o reiniciar el proyecto. +- La etapa de activación del producto 4D se ha simplificado y automatizado durante la [conexión](../GettingStarted/Installation.md#sign-in). +- Componente 4D AIKit: nuevas funcionalidades para [invocar automáticamente una herramienta específica](../aikit/Classes/OpenAIChatHelper.md#registertool) y [especificar un formato de respuesta](../aikit/Classes/OpenAIChatCompletionsParameters.md#response-format). - Lenguaje 4D: - - New "trim" commands to remove leading and trailing spaces from a string: [`Trim`](../commands/trim.md), [`Trim start`](../commands/trim-start.md), and [`Trim end`](../commands/trim-end.md). + - Nuevos comandos "trim" para eliminar los espacios iniciales y finales de una cadena: [`Trim`](../commands/trim.md), [`Trim start`](../commands/trim-start.md) y [`Trim end`](../commands/trim-end.md). - Los comandos [`Num`](../commands/num.md) y [`String`](../commands/string.md) han sido actualizados para soportar conversiones en diferentes bases (radix). -- [**Fixed bug list**](https://bugs.4d.fr/fixedbugslist?version=21): list of all bugs that have been fixed in 4D 21. +- [**Lista de bugs corregidos**](https://bugs.4d.fr/fixedbugslist?version=21): lista de todos los bugs que se han corregido en 4D 21. #### Vista previa para desarrolladores -[**Fluent UI** rendering for 4D forms](../FormEditor/forms.md#fluent-ui-rendering-developer-preview) is proposed in Developer Preview during the beta test program. +El [renderizado **Fluent UI** para los formularios 4D](../FormEditor/forms.md#fluent-ui-rendering-developer-preview) está disponible en Developer Preview durante el programa de pruebas beta. #### Cambios de comportamiento -:::caution Index rebuild +:::caution Reconstrucción del índice -4D 21 includes an ICU library update ([see below](#library-table)) which will force an automatic rebuild of indexes of type alpha, text, and object. Dependiendo del tamaño del archivo de datos, esta operación puede llevar un tiempo y puede ser necesario planificarla. +4D 21 incluye una actualización de la librería ICU ([ver abajo](#library-table)) que forzará una reconstrucción automática de los índices de tipo alfa, texto y objeto. Dependiendo del tamaño del archivo de datos, esta operación puede llevar un tiempo y puede ser necesario planificarla. ::: -- Web services (SOAP): when [scalable sessions](../WebServer/sessions.md#enabling-web-sessions) are enabled, web services now run in [**preemptive processes**](../Develop/preemptive.md) in compiled mode. Make sure your SOAP code is thread-safe. -- Web server: the support of deprecated `4DSYNC/` and `4DCGI/` URLs is removed. Ya no se realiza ningún tratamiento específico en estas URL. +- Servicios web (SOAP): cuando las [sesiones escalables](../WebServer/sessions.md#enabling-web-sessions) están activadas, los servicios web se ejecutan ahora en [**procesos apropiativos**](../Develop/preemptive.md) en modo compilado. Asegúrese de que su código SOAP es hilo seguro. +- Servidor web: se elimina la compatibilidad con las URL obsoletas `4DSYNC/` y `4DCGI/`. Ya no se realiza ningún tratamiento específico en estas URL. - Las sesiones usuario web ahora son devueltas por [`Process activity`](../commands/process-activity.md). -- The [`HIGHLIGHT TEXT`](../commands/highlight-text) command is now supported in the context of subforms. -- **Components no longer embedded**: starting with 4D 21, components developed by 4D (4D NetKit, 4D SVG..., see [this list](../Extensions/overview.md#components-developed-by-4d)) are no longer embedded in the 4D application. When upgrading a project to 4D 21 or higher, a dialog box is displayed:
    +- El comando [`HIGHLIGHT TEXT`](../commands/highlight-text) es ahora compatible en el contexto de los subformularios. +- **Componentes ya no integrados**: a partir de 4D 21, los componentes desarrollados por 4D (4D NetKit, 4D SVG..., ver [esta lista](../Extensions/overview.md#components-developed-by-4d)) ya no están integrados en la aplicación 4D. Cuando se actualiza un proyecto a 4D 21 o superior, se muestra un cuadro de diálogo:
    ![alt-text](../assets/en/getStart/convert.png)
    - \- **Import**: import automatically 4D components as dependencies to the project
    - \- **Ignore**: do not import components and let you [manage components manually](../Project/components.md)
    - \- **Ask later**: do not import components and display the dialog at the next project opening. + \- **Importar**: importar automáticamente componentes 4D como dependencias del proyecto
    + \- **Ignorar**: no importar componentes y dejar que [gestione los componentes manualmente](../Project/components.md)
    + \- **Preguntar más tarde**: no importar componentes y mostrar el cuadro de diálogo en la próxima apertura del proyecto. :::note -In binary databases, you need to select the required components in the 4D installer or download them from the [4D Product Download portal](https://product-download.4d.com/?type=components). +En las bases de datos binarias, debe seleccionar los componentes necesarios en el programa de instalación de 4D o descargarlos del [portal de descarga de productos 4D](https://product-download.4d.com/?type=components). ::: @@ -67,12 +67,12 @@ Lea las [**Novedades en 4D 20 R10**](https://blog.4d.com/en-whats-new-in-4d-20-R - Nueva clase [`4D.Vector`](../API/VectorClass.md) para procesar y comparar vectores, normalmente calculados por IAs. - Nuevas opciones para generar UUIDs en **versión 7** para el comando [4D automatic fields](../settings/database.md#auto-uuid-version) y [`Generate UUID`](../commands/generate-uuid). - Nuevas clases [`UDPSocket`](../API/UDPSocketClass.md) y [`UDPEvent`](../API/UDPEventClass.md) para enviar datos utilizando sockets UDP. Soporte de registro detallado para eventos UDP en el archivo de registro [`4DTCPUDPLog.txt`](../Debugging/debugLogFiles.md#4dtcpudplogtxt) (renombrado de `4DTCPLog.txt`). -- New [`.promote()`](../API/SessionClass.md#promote) and [`.demote()`](../API/SessionClass.md#demote) functions in the [Session class](../API/SessionClass.md) to dynamically add/remove privileges in a web process. -- [Automatic selection of licenses to embed](../Desktop/building.md#application-automatically-embedding-available-licenses) in the Build application dialog box, modified [`Create deployment license`](../commands/create-deployment-license.md) command, new [`AutomaticLicenseIntegration`](https://doc.4d.com/4Dv20R10/4D/20-R10/AutomaticLicenseIntegration.300-7611090.en.html) BuildApplication xml key. +- Nuevas funciones [`.promote()`](../API/SessionClass.md#promote) y [`.demote()`](../API/SessionClass.md#demote) en la [clase Session](../API/SessionClass.md) para añadir/eliminar privilegios dinámicamente en un proceso web. +- [Selección automática de licencias a integrar](../Desktop/building.md#application-automatically-embedding-available-licenses) en el cuadro de diálogo del Generador de aplicaciones, modificación del comando [`Create deployment license`](../commands/create-deployment-license.md), nueva llave xml BuildApplication [`AutomaticLicenseIntegration`](https://doc.4d.com/4Dv20R10/4D/20-R10/AutomaticLicenseIntegration.300-7611090.en.html). - Seguridad mejorada para copiar/pegar fórmulas en [4D Write Pro](../WritePro/managing-formulas.md) y [áreas de texto con estilo](../FormObjects/input_overview.md): las fórmulas copiadas desde fuera de la aplicación 4D actual se pegan ahora siempre sólo como valores. -- 4D AIKit component: new [OpenAIEmbeddingsAPI class](../aikit/Classes/OpenAIEmbeddingsAPI.md) to create embeddings using OpenAI's API. -- You can now [associate a class](../Develop/field-properties.md) to an object field in the structure editor. -- Automatic handling of [recursive dependencies](../Project/components.md#automatic-dependency-resolution). +- Componente 4D AIKit: nueva [clase OpenAIEmbeddingsAPI](../aikit/Classes/OpenAIEmbeddingsAPI.md) para crear embeddings utilizando la API OpenAI. +- Ahora puede [asociar una clase](../Develop/field-properties.md) a un campo objeto en el editor de estructura. +- Gestión automática de [dependencias recursivas](../Project/components.md#automatic-dependency-resolution). - Lenguaje 4D: - Por coherencia, los comandos [`Create entity selection`](../commands/create-entity-selection.md) y [`USE ENTITY SELECTION`](../commands/use-entity-selection.md) han sido movidos del tema ["4D Environment"](../commands/theme/4D_Environment.md) al ["Selection"](../commands/theme/Selection.md). - Nuevos comandos [`OBJECT SET DATA SOURCE FORMULA`](../commands/object-set-data-source-formula.md) y [`OBJECT Get data source formula`](../commands/object-get-data-source-formula.md) para asignar y leer los objetos `Formula` como fuentes de datos para los objetos de formulario. @@ -85,7 +85,7 @@ Lea las [**Novedades en 4D 20 R10**](https://blog.4d.com/en-whats-new-in-4d-20-R - Se ha eliminado la biblioteca *MeCab*. Este cambio sólo afecta al tratamiento del texto en japonés. - Cuando una variable o parámetro objeto se declara con un tipo ["cs" class](../Concepts/classes.md#cs), asignarlo con una instancia de objeto de una clase diferente genera ahora un error de sintaxis. - [`.hasPrivilege()`](../API/SessionClass.md#hasprivilege) devuelve True para privilegios promovidos en el proceso web. -- The [`Time`](../commands/time) command now returns a negative time expression when the *timeValue* parameter is negative. Por ejemplo, `Time("-01:02:03")` devolverá **-01:02:03**. In previous releases, the negative sign was ignored. +- El comando [`Time`](../commands/time) devuelve ahora una expresión de tiempo negativa cuando el parámetro *timeValue* es negativo. Por ejemplo, `Time("-01:02:03")` devolverá **-01:02:03**. En versiones anteriores, se ignoraba el signo negativo. ## 4D 20 R9 @@ -157,7 +157,7 @@ Lea [**Novedades en 4D 20 R7**](https://blog.4d.com/en-whats-new-in-4d-20-R7/), - Lenguaje 4D: - Nuevos comandos: [Process info](../commands/process-info.md), [Session info](../commands/session-info.md), [SET WINDOW DOCUMENT ICON](../commands/set-window-document-icon.md) - Comandos modificados: [Process activity](../commands/process-activity.md), [Process number](../commands/process-number.md) - - Deprecated commands (replacement): `GET LAST ERROR STACK` ([Last errors](../commands/last-errors.md)), `GET SERIAL INFORMATION` ([License info](../commands/license-info.md)), `PROCESS PROPERTIES` ([Process info](../commands/process-info.md)), `SET SCREEN DEPTH`, `C_XXX` commands ([var](../Concepts/variables.md#declaring-variables) and [#DECLARE/Function](../Concepts/parameters.md#declaring-parameters) declarations). Los comandos obsoletos llevan el prefijo "\*o\*". + - Comandos obsoletos (reemplazo): `GET LAST ERROR STACK` ([Last errors](../commands/last-errors.md)), `GET SERIAL INFORMATION` ([License info](../commands/license-info.md)), `PROCESS PROPERTIES` ([Process info](../commands/process-info.md)), `SET SCREEN DEPTH`, `C_XXX` commands ([var](../Concepts/variables.md#declaring-variables) y [#DECLARE/declaraciones Function](../Concepts/parameters.md#declaring-parameters)). Los comandos obsoletos llevan el prefijo "\*o\*". - 4D Write Pro: - Nuevo comando: [WP DELETE SECTION](../WritePro/commands/wp-delete-section.md) - Comandos modificados: [WP DELETE SUBSECTION](../WritePro/commands/wp-delete-subsection.md) y [WP RESET ATTRIBUTES](../WritePro/commands/wp-reset-attributes.md) @@ -292,23 +292,23 @@ Ver [**Notas de lanzamiento para LTS 4D 20.x**](../../versioned_docs/version-20/ ## Tabla de la librería -| Librería | Versión actual | Actualizado en 4D | Comentario | -| --------- | -------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -| BoringSSL | fa47b1d | **21** | Utilizado para QUIC | -| CEF | 7258 | **21** | Chromium 139 | -| Hunspell | 1.7.2 | 20 | Utilizado para la corrección ortográfica en formularios 4D y 4D Write Pro | -| ICU | 77.1 | **21** | This upgrade forces an automatic rebuild of alphanumeric, text and object indexes. | -| libldap | 2.6.10 | **21** | | -| libsasl | 2.1.28 | 20 | | -| Liblsquic | 4.2.0 | 20 R10 | Utilizado para QUIC | -| Libuv | 1.51.0 | **21** | Utilizado para QUIC | -| libZip | 1.11.4 | **21** | Utilizado por los componentes zip class, 4D Write Pro, svg y serverNet | -| LZMA | 5.8.1 | **21** | | -| ngtcp2 | 1.16.0 | **21** | Utilizado para QUIC | -| OpenSSL | 3.5.2 | **21** | | -| PDFWriter | 4.7.0 | **21** | Used for [`WP Export document`](../WritePro/commands/wp-export-document.md) and [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | -| PHP | 8.2.4 | 20 | | -| SpreadJS | 17.1.0 | 20 R7 | Consulte [esta entrada de blog](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) para obtener una visión general de las nuevas funciones | -| webKit | WKWebView | 19 | | -| Xerces | 3.3.0 | **21** | Utilizado para comandos XML | -| Zlib | 1.3.1 | **21** | | +| Librería | Versión actual | Actualizado en 4D | Comentario | +| --------- | -------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| BoringSSL | fa47b1d | **21** | Utilizado para QUIC | +| CEF | 7258 | **21** | Chromium 139 | +| Hunspell | 1.7.2 | 20 | Utilizado para la corrección ortográfica en formularios 4D y 4D Write Pro | +| ICU | 77.1 | **21** | Esta actualización fuerza una reconstrucción automática de los índices alfanuméricos, textos y objetos. | +| libldap | 2.6.10 | **21** | | +| libsasl | 2.1.28 | 20 | | +| Liblsquic | 4.2.0 | 20 R10 | Utilizado para QUIC | +| Libuv | 1.51.0 | **21** | Utilizado para QUIC | +| libZip | 1.11.4 | **21** | Utilizado por los componentes zip class, 4D Write Pro, svg y serverNet | +| LZMA | 5.8.1 | **21** | | +| ngtcp2 | 1.16.0 | **21** | Utilizado para QUIC | +| OpenSSL | 3.5.2 | **21** | | +| PDFWriter | 4.7.0 | **21** | Utilizado para [`WP Export document`](../WritePro/commands/wp-export-document.md) y [`WP Export variable`](../WritePro/commands/wp-export-variable.md) | +| PHP | 8.2.4 | 20 | | +| SpreadJS | 17.1.0 | 20 R7 | Consulte [esta entrada de blog](https://blog.4d.com/4d-view-pro-whats-new-in-4d-20-r7/) para obtener una visión general de las nuevas funciones | +| webKit | WKWebView | 19 | | +| Xerces | 3.3.0 | **21** | Utilizado para comandos XML | +| Zlib | 1.3.1 | **21** | | From a28eb2a722993161b9935d1153af55535b17a2d8 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 11:33:15 +0200 Subject: [PATCH 18/57] New translations orda-events.md (Spanish) --- .../version-21/ORDA/orda-events.md | 244 ++++++------------ 1 file changed, 83 insertions(+), 161 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md b/i18n/es/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md index bdaddd77019819..82555980c41cae 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md @@ -18,7 +18,7 @@ No se puede activar directamente la ejecución de la función de evento. Events :::tip Entrada de blog relacionada -[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-data-persistence-actions) +[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-database-operations) ::: @@ -52,7 +52,7 @@ ORDA [`constructor()`](./ordaClasses.md#class-constructor) functions are always ::: -Con otras configuraciones remotas (p. ej. Qodly applications, [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). +With other remote configurations (i.e. [Qodly applications](https://developer.4d.com/qodly), [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). ### Tabla resumen @@ -348,26 +348,21 @@ It is not recommended to update the entity within this function (using `This`). #### Ejemplo -In this example, the user is not allowed to save a product with a margin lower than the average. In case of an invalid price attribute, you return an error object and thus, stop the save action. +In this example, it is not allowed to save a product with a margin lower than 50%. In case of an invalid price attribute, you return an error object and thus, stop the save action. ```4d // ProductsEntity class +// +// validateSave event at attribute level Function event validateSave margin($event : Object) : Object var $result : Object -var $marginAverage : Real -$marginAverage:=ds.Products.query("category= :1"; This.category).average("margin") - -If (This.margin<$marginAverage) - $result:={\ - errCode: 1; \ - message: "The margin of this product ("+String(This.margin)+") is under the average"; \ - extraDescription: {\ - info: "For the "+This.category+" category the margin average is: "+String($marginAverage)};\ - fatalError: False} +//The user can't create a product whose margin is < 50% +If (This.margin<50) + $result:={errCode: 1; message: "The validation of this product failed"; \ + extraDescription: {info: "The margin of this product ("+String(This.margin)+") is lower than 50%"}; seriousError: False} End if - return $result ``` @@ -408,32 +403,35 @@ To stop the action, the code of the function must return an [error object](#erro #### Ejemplo -When a product is saved, some information is logged to an external system which may be unavailable. +When a file is saved on disk, catch errors related to disk space for example. ```4d -Function event saving($event : Object) : Object +// ProductsEntity class +// saving event at attribute level +Function event saving userManualPath($event : Object) : Object -var $result; $status : Object -var $log : cs.Entity -var $remote : 4D.DataStoreImplementation - -Try - $remote:=Open datastore({hostname: "events@acme.com"}; "logs") - $log:=$remote.Logs.new() - $log.productId:=This.ID - $log.stamp:=Timestamp - $log.event:="Created by "+Current user() - $status:=$log.save() -Catch - $result:={\ - errCode: Last errors.last().errCode;\ - message: Last errors.last().message; \ - extraDescription: {info: "The external Logs can't be reached"}} -End try +var $result : Object +var $userManualFile : 4D.File +var $fileCreated : Boolean + +If (This.userManualPath#"") + $userManualFile:=File(This.userManualPath) + + // The user manual document file is created on the disk + // This may fail if no more space is available + Try + $fileCreated:=$userManualFile.create() + Catch + // No more room on disk for example + $result:={/ + errCode: 1; message: "Error during the save action for this product"; / + extraDescription: {info: "There is no available space on disk to store the user manual"}/ + } + End try +End if return $result - ``` ### `Function event afterSave` @@ -454,29 +452,25 @@ The function receives an [*event* object](#event-parameter) as parameter. - To avoid infinite loops, calling a [`save()`](../API/EntityClass.md#save) on the current entity (through `This`) in this function is **not allowed**. Se producirá un error. - Throwing an [error object](#error-object) is **not supported** by this function. -#### Ejemplo 1 +#### Ejemplo -If an error occurred in the above saving event, the product is recorded in the ProductsInFailure dataclass so an employee can review it later. +If an error occurred in the above saving event, the attribute value is reset accordingly in the `afterSave` event: ```4d // ProductsEntity class Function event afterSave($event : Object) -var $failure : cs.ProductsInFailureEntity -var $status : Object - - // $event.status.errors is filled if the error comes from a validateSave event If (($event.status.success=False) && ($event.status.errors=Null)) - $failure:=ds.ProductsInFailure.new() - $failure.name:=This.name - $failure.category:=This.category - $failure.costPrice:=This.costPrice - $failure.retailPrice:=This.retailPrice - $failure.reason:="Error during the save action" - $failure.stamp:=Timestamp - $status:=$failure.save() -End if - + // $event.status.errors is filled if the error comes from the validateSave event + + // The userManualPath attribute has not been properly saved + // Its value is reset + If ($event.savedAttributes.indexOf("userManualPath")=-1) + This.userManualPath:="" + This.status:="KO" + End if + +End if ``` ### `Function event validateDrop` @@ -506,44 +500,24 @@ This event is triggered **before** the entity is actually dropped, allowing you To stop the action, the code of the function must return an [error object](#error-object). -#### Ejemplo 1 +#### Ejemplo -Products can be deleted only if they have been flagged TO DELETE. +In this example, it is not allowed to drop a product that is not labelled "TO DELETE". In this case, you return an error object and thus, stop the drop action. ```4d - //ProductsEntity class -Function event validateDrop status($event : Object) : Object - -If (This.status != "TO DELETE") - - var $result:= New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={attribute; $event.attributeName; info: "The status must be TO DELETE"} - $result.fatalError:=False - return $result -End if -``` +// ProductsEntity class -#### Ejemplo 2 +Function event validateDrop status($event : Object) : Object -The user can delete products if they are flagged as "TO DELETE" and if their creation year is < current year -3. +var $result : Object -```4d - //ProductsEntity class -Function event validateDrop($event : Object) : Object - -var $yearOffSet : Integer -$yearOffSet:=Year of(Current date)-3 - -If ((This.status != "TO DELETE") || (Year of(This.creationDate) >= $yearOffSet)) - var $result:=New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={info: "The status must be TO DELETE and the creation year must be lower than " + String($yearOffSet)} - $result.fatalError:=False - return $result +// Products must be marked as TO DELETE to be dropped +If (This.status#"TO DELETE") + $result:={errCode: 1; message: "You can't drop this product"; \ + extraDescription: {info: "This product must be marked as To Delete"}; seriousError: False} End if + +return $result ``` ### `Function event dropping` @@ -579,54 +553,31 @@ The business logic should raise errors which cannot be detected during the `vali To stop the action, the code of the function must return an [error object](#error-object). -#### Ejemplo 1 +#### Ejemplo -When dropping an order with *totalPrice >= 500*, a log file is updated. +Here is an example of `dropping` event at entity level: ```4d - //OrderEntity class -Function event dropping totalPrice ($event : Object) - -var $log : cs.LogEntity -var $status: Object - -If (This.totalPrice >= 500) - - $log:=ds.Log.new() - $log.orderID:=This.ID - $log.orderPrice:=This.totalPrice - $log.event:="Drop" - $log.creationDate:=Current date() - $status:=$log.save() - - If($status.success=False) - throw ({errCode: 1; message: "Error while updating the log file"}) - End if -End if - -``` - -#### Ejemplo 2 - -When a product is dropped, a log file is updated. +// ProductsEntity class +Function event dropping($event : Object) : Object -```4d - //ProductsEntity class -Function event dropping ($event : Object) +var $result : Object +var $userManualFile : 4D.File -var $log : cs.LogEntity -var $status: Object +$userManualFile:=File(This.userManualPath) -$log:=ds.Log.new() -$log.productID:=This.ID -$log.productPrice:=This.price -$log.event:="Drop" -$log.creationDate:=Current date() -$status:=$log.save() + // When dropping a product, its user manual is also deleted on the disk + // This action may fail +Try + If ($userManualFile.exists) + $userManualFile.delete() + End if +Catch + // Dropping the user manual failed + $result:={errCode: 1; message: "Drop failed"; extraDescription: {info: "The user manual can't be dropped"}} +End try -If($status.success=False) - throw ({errCode: 1; message:"Error while updating the log file"}) -End if +return $result ``` ### `Function event afterDrop` @@ -653,50 +604,21 @@ The dropped entity is referenced by `This` and still exists in memory. ::: -#### Ejemplo 1 +#### Ejemplo -Send a mail to the customer with the details of the dropped order. +If the drop action failed, then the product must be checked manually: ```4d - //OrderEntity class -Function event afterDrop ($event : Object) - -var $oAuth2 : cs.NetKit.OAuth2Provider -var $google : cs.NetKit.Google - - //$param contains clientId, secretId... -$oAuth2:=cs.NetKit.OAuth2Provider.new($param) -$google:=cs.NetKit.Google.new($oAuth2; {mailType: "JMAP"}) - - //Email creation -$email:=New object -$email.from:="youremail@gmail.com" -$email.to:="destinationmail@mail.com" -$email.subject:="Your order is cancelled" -$email.textBody:="Products numbers: " + This.products.number.join("-") - - //Email sending -$status:=$google.mail.send($email) -``` - -#### Ejemplo 2 +Function event afterDrop($event : Object) -Create an action to do because there were errors in the [`dropping()`](#function-event-dropping) event. +var $status : Object -```4d - //ProductEntity class -Function event afterDrop ($event : Object) - -var $action: cs.ActionEntity -var $status: Object - - // The drop action failed -If($event.dropStatus = "failed") - $action:=ds.Action.new() - $action.label:=Last errors.first().message //message is "Error while dropping product XXX" - $action.status:="TO CHECK" - $status:=$action.save() -End if +If (($event.status.success=False) && ($event.status.errors=Null)) + //$event.status.errors is filled + //if the error comes from the validateDrop event + This.status:="Check this product - Drop action failed" + $status:=This.save() +End if ``` From 12bc99af29ddcca910bf12b47508eafaaba290cf Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 11:34:24 +0200 Subject: [PATCH 19/57] New translations orda-events.md (Japanese) --- .../version-21/ORDA/orda-events.md | 244 ++++++------------ 1 file changed, 83 insertions(+), 161 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md index 926a1d5f6e87d0..55806fa7ab68bf 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md @@ -18,7 +18,7 @@ You cannot directly trigger event function execution. Events are called automati :::tip Related blog post -[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-data-persistence-actions) +[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-database-operations) ::: @@ -52,7 +52,7 @@ ORDA [`constructor()`](./ordaClasses.md#class-constructor) functions are always ::: -With other remote configurations (i.e. Qodly applications, [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). +With other remote configurations (i.e. [Qodly applications](https://developer.4d.com/qodly), [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). ### Summary table @@ -348,26 +348,21 @@ It is not recommended to update the entity within this function (using `This`). #### 例題 -In this example, the user is not allowed to save a product with a margin lower than the average. In case of an invalid price attribute, you return an error object and thus, stop the save action. +In this example, it is not allowed to save a product with a margin lower than 50%. In case of an invalid price attribute, you return an error object and thus, stop the save action. ```4d // ProductsEntity class +// +// validateSave event at attribute level Function event validateSave margin($event : Object) : Object var $result : Object -var $marginAverage : Real -$marginAverage:=ds.Products.query("category= :1"; This.category).average("margin") - -If (This.margin<$marginAverage) - $result:={\ - errCode: 1; \ - message: "The margin of this product ("+String(This.margin)+") is under the average"; \ - extraDescription: {\ - info: "For the "+This.category+" category the margin average is: "+String($marginAverage)};\ - fatalError: False} +//The user can't create a product whose margin is < 50% +If (This.margin<50) + $result:={errCode: 1; message: "The validation of this product failed"; \ + extraDescription: {info: "The margin of this product ("+String(This.margin)+") is lower than 50%"}; seriousError: False} End if - return $result ``` @@ -408,32 +403,35 @@ To stop the action, the code of the function must return an [error object](#erro #### 例題 -When a product is saved, some information is logged to an external system which may be unavailable. +When a file is saved on disk, catch errors related to disk space for example. ```4d -Function event saving($event : Object) : Object +// ProductsEntity class +// saving event at attribute level +Function event saving userManualPath($event : Object) : Object -var $result; $status : Object -var $log : cs.Entity -var $remote : 4D.DataStoreImplementation - -Try - $remote:=Open datastore({hostname: "events@acme.com"}; "logs") - $log:=$remote.Logs.new() - $log.productId:=This.ID - $log.stamp:=Timestamp - $log.event:="Created by "+Current user() - $status:=$log.save() -Catch - $result:={\ - errCode: Last errors.last().errCode;\ - message: Last errors.last().message; \ - extraDescription: {info: "The external Logs can't be reached"}} -End try +var $result : Object +var $userManualFile : 4D.File +var $fileCreated : Boolean + +If (This.userManualPath#"") + $userManualFile:=File(This.userManualPath) + + // The user manual document file is created on the disk + // This may fail if no more space is available + Try + $fileCreated:=$userManualFile.create() + Catch + // No more room on disk for example + $result:={/ + errCode: 1; message: "Error during the save action for this product"; / + extraDescription: {info: "There is no available space on disk to store the user manual"}/ + } + End try +End if return $result - ``` ### `Function event afterSave` @@ -454,29 +452,25 @@ The function receives an [*event* object](#event-parameter) as parameter. - To avoid infinite loops, calling a [`save()`](../API/EntityClass.md#save) on the current entity (through `This`) in this function is **not allowed**. It will raise an error. - Throwing an [error object](#error-object) is **not supported** by this function. -#### 例題 1 +#### 例題 -If an error occurred in the above saving event, the product is recorded in the ProductsInFailure dataclass so an employee can review it later. +If an error occurred in the above saving event, the attribute value is reset accordingly in the `afterSave` event: ```4d // ProductsEntity class Function event afterSave($event : Object) -var $failure : cs.ProductsInFailureEntity -var $status : Object - - // $event.status.errors is filled if the error comes from a validateSave event If (($event.status.success=False) && ($event.status.errors=Null)) - $failure:=ds.ProductsInFailure.new() - $failure.name:=This.name - $failure.category:=This.category - $failure.costPrice:=This.costPrice - $failure.retailPrice:=This.retailPrice - $failure.reason:="Error during the save action" - $failure.stamp:=Timestamp - $status:=$failure.save() -End if - + // $event.status.errors is filled if the error comes from the validateSave event + + // The userManualPath attribute has not been properly saved + // Its value is reset + If ($event.savedAttributes.indexOf("userManualPath")=-1) + This.userManualPath:="" + This.status:="KO" + End if + +End if ``` ### `Function event validateDrop` @@ -506,44 +500,24 @@ This event is triggered **before** the entity is actually dropped, allowing you To stop the action, the code of the function must return an [error object](#error-object). -#### 例題 1 +#### 例題 -Products can be deleted only if they have been flagged TO DELETE. +In this example, it is not allowed to drop a product that is not labelled "TO DELETE". In this case, you return an error object and thus, stop the drop action. ```4d - //ProductsEntity class -Function event validateDrop status($event : Object) : Object - -If (This.status != "TO DELETE") - - var $result:= New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={attribute; $event.attributeName; info: "The status must be TO DELETE"} - $result.fatalError:=False - return $result -End if -``` +// ProductsEntity class -#### 例題 2 +Function event validateDrop status($event : Object) : Object -The user can delete products if they are flagged as "TO DELETE" and if their creation year is < current year -3. +var $result : Object -```4d - //ProductsEntity class -Function event validateDrop($event : Object) : Object - -var $yearOffSet : Integer -$yearOffSet:=Year of(Current date)-3 - -If ((This.status != "TO DELETE") || (Year of(This.creationDate) >= $yearOffSet)) - var $result:=New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={info: "The status must be TO DELETE and the creation year must be lower than " + String($yearOffSet)} - $result.fatalError:=False - return $result +// Products must be marked as TO DELETE to be dropped +If (This.status#"TO DELETE") + $result:={errCode: 1; message: "You can't drop this product"; \ + extraDescription: {info: "This product must be marked as To Delete"}; seriousError: False} End if + +return $result ``` ### `Function event dropping` @@ -579,54 +553,31 @@ The business logic should raise errors which cannot be detected during the `vali To stop the action, the code of the function must return an [error object](#error-object). -#### 例題 1 +#### 例題 -When dropping an order with *totalPrice >= 500*, a log file is updated. +Here is an example of `dropping` event at entity level: ```4d - //OrderEntity class -Function event dropping totalPrice ($event : Object) - -var $log : cs.LogEntity -var $status: Object - -If (This.totalPrice >= 500) - - $log:=ds.Log.new() - $log.orderID:=This.ID - $log.orderPrice:=This.totalPrice - $log.event:="Drop" - $log.creationDate:=Current date() - $status:=$log.save() - - If($status.success=False) - throw ({errCode: 1; message: "Error while updating the log file"}) - End if -End if - -``` - -#### 例題 2 - -When a product is dropped, a log file is updated. +// ProductsEntity class +Function event dropping($event : Object) : Object -```4d - //ProductsEntity class -Function event dropping ($event : Object) +var $result : Object +var $userManualFile : 4D.File -var $log : cs.LogEntity -var $status: Object +$userManualFile:=File(This.userManualPath) -$log:=ds.Log.new() -$log.productID:=This.ID -$log.productPrice:=This.price -$log.event:="Drop" -$log.creationDate:=Current date() -$status:=$log.save() + // When dropping a product, its user manual is also deleted on the disk + // This action may fail +Try + If ($userManualFile.exists) + $userManualFile.delete() + End if +Catch + // Dropping the user manual failed + $result:={errCode: 1; message: "Drop failed"; extraDescription: {info: "The user manual can't be dropped"}} +End try -If($status.success=False) - throw ({errCode: 1; message:"Error while updating the log file"}) -End if +return $result ``` ### `Function event afterDrop` @@ -653,50 +604,21 @@ The dropped entity is referenced by `This` and still exists in memory. ::: -#### 例題 1 +#### 例題 -Send a mail to the customer with the details of the dropped order. +If the drop action failed, then the product must be checked manually: ```4d - //OrderEntity class -Function event afterDrop ($event : Object) - -var $oAuth2 : cs.NetKit.OAuth2Provider -var $google : cs.NetKit.Google - - //$param contains clientId, secretId... -$oAuth2:=cs.NetKit.OAuth2Provider.new($param) -$google:=cs.NetKit.Google.new($oAuth2; {mailType: "JMAP"}) - - //Email creation -$email:=New object -$email.from:="youremail@gmail.com" -$email.to:="destinationmail@mail.com" -$email.subject:="Your order is cancelled" -$email.textBody:="Products numbers: " + This.products.number.join("-") - - //Email sending -$status:=$google.mail.send($email) -``` - -#### 例題 2 +Function event afterDrop($event : Object) -Create an action to do because there were errors in the [`dropping()`](#function-event-dropping) event. +var $status : Object -```4d - //ProductEntity class -Function event afterDrop ($event : Object) - -var $action: cs.ActionEntity -var $status: Object - - // The drop action failed -If($event.dropStatus = "failed") - $action:=ds.Action.new() - $action.label:=Last errors.first().message //message is "Error while dropping product XXX" - $action.status:="TO CHECK" - $status:=$action.save() -End if +If (($event.status.success=False) && ($event.status.errors=Null)) + //$event.status.errors is filled + //if the error comes from the validateDrop event + This.status:="Check this product - Drop action failed" + $status:=This.save() +End if ``` From 09c146178ec98b93c11ab0d082e07e66f8346877 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 11:34:43 +0200 Subject: [PATCH 20/57] New translations orda-events.md (Portuguese, Brazilian) --- .../version-21/ORDA/orda-events.md | 244 ++++++------------ 1 file changed, 83 insertions(+), 161 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md index 22f3ae5c7dd484..d95347972ed07a 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-21/ORDA/orda-events.md @@ -18,7 +18,7 @@ You cannot directly trigger event function execution. Events are called automati :::tip Related blog post -[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-data-persistence-actions) +[ORDA – Handle an event-driven logic during data persistence actions](https://blog.4d.com/orda-handle-an-event-driven-logic-during-database-operations) ::: @@ -52,7 +52,7 @@ ORDA [`constructor()`](./ordaClasses.md#class-constructor) functions are always ::: -With other remote configurations (i.e. Qodly applications, [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). +With other remote configurations (i.e. [Qodly applications](https://developer.4d.com/qodly), [REST API requests](../REST/REST_requests.md), or requests through [`Open datastore`](../commands/open-datastore.md)), the `touched()` event function is always executed **server-side**. It means that you have to make sure the server can "see" that an attribute has been touched to trigger the event (see below). ### Summary table @@ -348,26 +348,21 @@ It is not recommended to update the entity within this function (using `This`). #### Exemplo -In this example, the user is not allowed to save a product with a margin lower than the average. In case of an invalid price attribute, you return an error object and thus, stop the save action. +In this example, it is not allowed to save a product with a margin lower than 50%. In case of an invalid price attribute, you return an error object and thus, stop the save action. ```4d // ProductsEntity class +// +// validateSave event at attribute level Function event validateSave margin($event : Object) : Object var $result : Object -var $marginAverage : Real -$marginAverage:=ds.Products.query("category= :1"; This.category).average("margin") - -If (This.margin<$marginAverage) - $result:={\ - errCode: 1; \ - message: "The margin of this product ("+String(This.margin)+") is under the average"; \ - extraDescription: {\ - info: "For the "+This.category+" category the margin average is: "+String($marginAverage)};\ - fatalError: False} +//The user can't create a product whose margin is < 50% +If (This.margin<50) + $result:={errCode: 1; message: "The validation of this product failed"; \ + extraDescription: {info: "The margin of this product ("+String(This.margin)+") is lower than 50%"}; seriousError: False} End if - return $result ``` @@ -408,32 +403,35 @@ To stop the action, the code of the function must return an [error object](#erro #### Exemplo -When a product is saved, some information is logged to an external system which may be unavailable. +When a file is saved on disk, catch errors related to disk space for example. ```4d -Function event saving($event : Object) : Object +// ProductsEntity class +// saving event at attribute level +Function event saving userManualPath($event : Object) : Object -var $result; $status : Object -var $log : cs.Entity -var $remote : 4D.DataStoreImplementation - -Try - $remote:=Open datastore({hostname: "events@acme.com"}; "logs") - $log:=$remote.Logs.new() - $log.productId:=This.ID - $log.stamp:=Timestamp - $log.event:="Created by "+Current user() - $status:=$log.save() -Catch - $result:={\ - errCode: Last errors.last().errCode;\ - message: Last errors.last().message; \ - extraDescription: {info: "The external Logs can't be reached"}} -End try +var $result : Object +var $userManualFile : 4D.File +var $fileCreated : Boolean + +If (This.userManualPath#"") + $userManualFile:=File(This.userManualPath) + + // The user manual document file is created on the disk + // This may fail if no more space is available + Try + $fileCreated:=$userManualFile.create() + Catch + // No more room on disk for example + $result:={/ + errCode: 1; message: "Error during the save action for this product"; / + extraDescription: {info: "There is no available space on disk to store the user manual"}/ + } + End try +End if return $result - ``` ### `Function event afterSave` @@ -454,29 +452,25 @@ The function receives an [*event* object](#event-parameter) as parameter. - To avoid infinite loops, calling a [`save()`](../API/EntityClass.md#save) on the current entity (through `This`) in this function is **not allowed**. It will raise an error. - Throwing an [error object](#error-object) is **not supported** by this function. -#### Exemplo 1 +#### Exemplo -If an error occurred in the above saving event, the product is recorded in the ProductsInFailure dataclass so an employee can review it later. +If an error occurred in the above saving event, the attribute value is reset accordingly in the `afterSave` event: ```4d // ProductsEntity class Function event afterSave($event : Object) -var $failure : cs.ProductsInFailureEntity -var $status : Object - - // $event.status.errors is filled if the error comes from a validateSave event If (($event.status.success=False) && ($event.status.errors=Null)) - $failure:=ds.ProductsInFailure.new() - $failure.name:=This.name - $failure.category:=This.category - $failure.costPrice:=This.costPrice - $failure.retailPrice:=This.retailPrice - $failure.reason:="Error during the save action" - $failure.stamp:=Timestamp - $status:=$failure.save() -End if - + // $event.status.errors is filled if the error comes from the validateSave event + + // The userManualPath attribute has not been properly saved + // Its value is reset + If ($event.savedAttributes.indexOf("userManualPath")=-1) + This.userManualPath:="" + This.status:="KO" + End if + +End if ``` ### `Function event validateDrop` @@ -506,44 +500,24 @@ This event is triggered **before** the entity is actually dropped, allowing you To stop the action, the code of the function must return an [error object](#error-object). -#### Exemplo 1 +#### Exemplo -Products can be deleted only if they have been flagged TO DELETE. +In this example, it is not allowed to drop a product that is not labelled "TO DELETE". In this case, you return an error object and thus, stop the drop action. ```4d - //ProductsEntity class -Function event validateDrop status($event : Object) : Object - -If (This.status != "TO DELETE") - - var $result:= New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={attribute; $event.attributeName; info: "The status must be TO DELETE"} - $result.fatalError:=False - return $result -End if -``` +// ProductsEntity class -#### Exemplo 2 +Function event validateDrop status($event : Object) : Object -The user can delete products if they are flagged as "TO DELETE" and if their creation year is < current year -3. +var $result : Object -```4d - //ProductsEntity class -Function event validateDrop($event : Object) : Object - -var $yearOffSet : Integer -$yearOffSet:=Year of(Current date)-3 - -If ((This.status != "TO DELETE") || (Year of(This.creationDate) >= $yearOffSet)) - var $result:=New object() - $result.errCode:=1 - $result.message:="The record can't be deleted" - $result.extraDescription:={info: "The status must be TO DELETE and the creation year must be lower than " + String($yearOffSet)} - $result.fatalError:=False - return $result +// Products must be marked as TO DELETE to be dropped +If (This.status#"TO DELETE") + $result:={errCode: 1; message: "You can't drop this product"; \ + extraDescription: {info: "This product must be marked as To Delete"}; seriousError: False} End if + +return $result ``` ### `Function event dropping` @@ -579,54 +553,31 @@ The business logic should raise errors which cannot be detected during the `vali To stop the action, the code of the function must return an [error object](#error-object). -#### Exemplo 1 +#### Exemplo -When dropping an order with *totalPrice >= 500*, a log file is updated. +Here is an example of `dropping` event at entity level: ```4d - //OrderEntity class -Function event dropping totalPrice ($event : Object) - -var $log : cs.LogEntity -var $status: Object - -If (This.totalPrice >= 500) - - $log:=ds.Log.new() - $log.orderID:=This.ID - $log.orderPrice:=This.totalPrice - $log.event:="Drop" - $log.creationDate:=Current date() - $status:=$log.save() - - If($status.success=False) - throw ({errCode: 1; message: "Error while updating the log file"}) - End if -End if - -``` - -#### Exemplo 2 - -When a product is dropped, a log file is updated. +// ProductsEntity class +Function event dropping($event : Object) : Object -```4d - //ProductsEntity class -Function event dropping ($event : Object) +var $result : Object +var $userManualFile : 4D.File -var $log : cs.LogEntity -var $status: Object +$userManualFile:=File(This.userManualPath) -$log:=ds.Log.new() -$log.productID:=This.ID -$log.productPrice:=This.price -$log.event:="Drop" -$log.creationDate:=Current date() -$status:=$log.save() + // When dropping a product, its user manual is also deleted on the disk + // This action may fail +Try + If ($userManualFile.exists) + $userManualFile.delete() + End if +Catch + // Dropping the user manual failed + $result:={errCode: 1; message: "Drop failed"; extraDescription: {info: "The user manual can't be dropped"}} +End try -If($status.success=False) - throw ({errCode: 1; message:"Error while updating the log file"}) -End if +return $result ``` ### `Function event afterDrop` @@ -653,50 +604,21 @@ The dropped entity is referenced by `This` and still exists in memory. ::: -#### Exemplo 1 +#### Exemplo -Send a mail to the customer with the details of the dropped order. +If the drop action failed, then the product must be checked manually: ```4d - //OrderEntity class -Function event afterDrop ($event : Object) - -var $oAuth2 : cs.NetKit.OAuth2Provider -var $google : cs.NetKit.Google - - //$param contains clientId, secretId... -$oAuth2:=cs.NetKit.OAuth2Provider.new($param) -$google:=cs.NetKit.Google.new($oAuth2; {mailType: "JMAP"}) - - //Email creation -$email:=New object -$email.from:="youremail@gmail.com" -$email.to:="destinationmail@mail.com" -$email.subject:="Your order is cancelled" -$email.textBody:="Products numbers: " + This.products.number.join("-") - - //Email sending -$status:=$google.mail.send($email) -``` - -#### Exemplo 2 +Function event afterDrop($event : Object) -Create an action to do because there were errors in the [`dropping()`](#function-event-dropping) event. +var $status : Object -```4d - //ProductEntity class -Function event afterDrop ($event : Object) - -var $action: cs.ActionEntity -var $status: Object - - // The drop action failed -If($event.dropStatus = "failed") - $action:=ds.Action.new() - $action.label:=Last errors.first().message //message is "Error while dropping product XXX" - $action.status:="TO CHECK" - $status:=$action.save() -End if +If (($event.status.success=False) && ($event.status.errors=Null)) + //$event.status.errors is filled + //if the error comes from the validateDrop event + This.status:="Check this product - Drop action failed" + $status:=This.save() +End if ``` From 186922c77d9e37e57a5603732dba3c0f6a3f376f Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 11:54:32 +0200 Subject: [PATCH 21/57] New translations openai.md (Spanish) --- .../version-21/aikit/Classes/OpenAI.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAI.md b/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAI.md index b218df5a79d550..098b4d13d45456 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAI.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAI.md @@ -29,9 +29,9 @@ The `OpenAI` class provides a client for accessing various OpenAI API resources. Crear una instancia de la clase cliente OpenAI. -| Nombre del argumento | Tipo | Descripción | -| ------------------------- | -------------- | ------------------------------------------------------- | -| `apiKey or configuration` | Texto u objeto | apiKey if Text or configuration Object. | +| Nombre del argumento | Tipo | Descripción | +| ------------------------- | -------------- | --------------------------------------------------------- | +| `apiKey or configuration` | Texto u objeto | apiKey si Text u objeto de configuración. | #### Llave API From edf5ec353d192846354a4aef96498203a9e17893 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 11:54:42 +0200 Subject: [PATCH 22/57] New translations openaichatcompletionsparameters.md (Spanish) --- .../version-21/aikit/Classes/OpenAIChatCompletionsParameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAIChatCompletionsParameters.md b/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAIChatCompletionsParameters.md index 23279b40c9c82a..53bb4b8143fd98 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAIChatCompletionsParameters.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/aikit/Classes/OpenAIChatCompletionsParameters.md @@ -79,7 +79,7 @@ $messages.push({ \ $result := $client.chat.completions.create($messages; $params) ``` -#### 3. JSON Schema Format (Structured Outputs) +#### 3. Formato de esquema JSON (salidas estructuradas) For precise control over the JSON structure, you can define a schema: From ee2c9723994372e30cd42069a7d0082deaea8555 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 18:05:53 +0200 Subject: [PATCH 23/57] New translations components.md (French) --- .../version-20/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20/Concepts/components.md b/i18n/fr/docusaurus-plugin-content-docs/version-20/Concepts/components.md index a0f92dbd5a7934..f9416e730d822d 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20/Concepts/components.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20/Concepts/components.md @@ -7,7 +7,7 @@ Un composant 4D est un ensemble de code et de formulaires 4D représentant une o ## Où se trouvent les composants ? -Plusieurs composants sont [préinstallés dans l'environnement de développement 4D](Extensions/overview.md), mais de nombreux composants 4D de la communauté 4D [sont disponibles sur GitHub](https://github.com/search?q=4d-component&type=Repositories). De plus, vous pouvez [développer vos propres composants 4D](Extensions/develop-components.md). +Several components are [preinstalled in the 4D development environment](Extensions/overview.md), but a lot of 4D components from the 4D community [can be found on GitHub](https://github.com/topics/4d-component). De plus, vous pouvez [développer vos propres composants 4D](Extensions/develop-components.md). ## Installation des composants From 2924173a5ce2e600a80b3f45fc910b8f150cfd98 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 18:06:10 +0200 Subject: [PATCH 24/57] New translations components.md (Spanish) --- .../version-20/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/Concepts/components.md b/i18n/es/docusaurus-plugin-content-docs/version-20/Concepts/components.md index d3c8a52fc7bba5..effaefdaa08b7e 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/Concepts/components.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/Concepts/components.md @@ -7,7 +7,7 @@ Un componente 4D es un conjunto de código y de formularios 4D que representan u ## ¿Dónde encontrar los componentes? -Varios componentes están [preinstalados en el entorno de desarrollo 4D](Extensions/overview.md), pero muchos componentes 4D de la comunidad 4D [están disponibles en GitHub](https://github.com/search?q=4d-component&type=Repositories). Adicionalmente, puede [desarrollar sus propios componentes 4D](Extensions/develop-components.md). +Several components are [preinstalled in the 4D development environment](Extensions/overview.md), but a lot of 4D components from the 4D community [can be found on GitHub](https://github.com/topics/4d-component). Adicionalmente, puede [desarrollar sus propios componentes 4D](Extensions/develop-components.md). ## Instalación de los componentes From 4004e2bf3cc5add3ee14e2bf231e0971604ecac7 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 18:06:28 +0200 Subject: [PATCH 25/57] New translations components.md (Japanese) --- .../version-20/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/Concepts/components.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/Concepts/components.md index 638238501fa66e..2e3049c4d4bb7a 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20/Concepts/components.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/Concepts/components.md @@ -7,7 +7,7 @@ title: コンポーネント ## コンポーネントの見つけ方 -いくつかのコンポーネントは [4D開発環境にプリインストール](Extensions/overview.md) されていますが、4Dコミュニティによる多くの 4Dコンポーネントが [GitHub 上に公開](https://github.com/search?q=4d-component&type=Repositories) されています。 また、[独自の 4Dコンポーネントを開発](Extensions/develop-components.md) することもできます。 +Several components are [preinstalled in the 4D development environment](Extensions/overview.md), but a lot of 4D components from the 4D community [can be found on GitHub](https://github.com/topics/4d-component). また、[独自の 4Dコンポーネントを開発](Extensions/develop-components.md) することもできます。 ## コンポーネントのインストール From 8f88d76950af4c1b3beedfdd3d3e7162fe2b6580 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 18:06:45 +0200 Subject: [PATCH 26/57] New translations components.md (Portuguese, Brazilian) --- .../version-20/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/Concepts/components.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/Concepts/components.md index c695c30ff0d90b..84eb7b918d34f7 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/Concepts/components.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/Concepts/components.md @@ -7,7 +7,7 @@ Um componente 4D é um conjunto de código 4D e formulários que representam uma ## Onde encontrar componentes? -Criar e instalar componentes 4D é realizado diretamente a partir de 4D. Basicamente, os componentes são geridos como [plug-ins](Concepts/plug-ins.md) de acordo com os seguintes princípios: Além disso, pode [desenvolver os seus próprios componentes 4D](Extensions/develop-components.md). +Several components are [preinstalled in the 4D development environment](Extensions/overview.md), but a lot of 4D components from the 4D community [can be found on GitHub](https://github.com/topics/4d-component). Basicamente, os componentes são geridos como [plug-ins](Concepts/plug-ins.md) de acordo com os seguintes princípios: Além disso, pode [desenvolver os seus próprios componentes 4D](Extensions/develop-components.md). ## Instalação de componentes From 64080c4840ee22ed741f10c950022f5b040206fa Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 19:24:05 +0200 Subject: [PATCH 27/57] New translations components.md (French) --- .../current/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/Concepts/components.md b/i18n/fr/docusaurus-plugin-content-docs/current/Concepts/components.md index 1a124b4e2246f9..b086a5b4e4092b 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/Concepts/components.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/Concepts/components.md @@ -9,7 +9,7 @@ Un composant 4D est un ensemble de code et de formulaires 4D représentant une o L'installation et le chargement des composants dans vos projets 4D sont gérés par le [Gestionnaire de dépendances de 4D](../Project/components.md). -Plusieurs composants sont [développés par 4D](../Extensions/overview.md#components-developed-by-4d), mais de nombreux composants de la communauté 4D [sont publiés sur GitHub](https://github.com/search?q=4d-component&type=Repositories). De plus, vous pouvez [développer vos propres composants 4D](../Extensions/develop-components.md). +Plusieurs composants sont [développés par 4D](../Extensions/overview.md#components-developed-by-4d), mais de nombreux composants de la communauté 4D [sont publiés sur GitHub](https://github.com/topics/4d-component). De plus, vous pouvez [développer vos propres composants 4D](../Extensions/develop-components.md). ## Utilisation des composants From 15cffe579f91b7230ebfdd0fa548b858d18d61e9 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 19:24:22 +0200 Subject: [PATCH 28/57] New translations components.md (Spanish) --- .../current/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/Concepts/components.md b/i18n/es/docusaurus-plugin-content-docs/current/Concepts/components.md index 16edac0f404e2c..fe6ae7e719caec 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/Concepts/components.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/Concepts/components.md @@ -9,7 +9,7 @@ Un componente 4D es un conjunto de código y de formularios 4D que representan u Installation and loading of components in your 4D projects are handled through the [4D Dependency manager](../Project/components.md). -Varios componentes son [desarrollados por 4D](../Extensions/overview.md#components-developed-by-4d), pero muchos componentes 4D de la comunidad 4D [se pueden encontrar en GitHub](https://github.com/search?q=4d-component&type=Repositories). Adicionalmente, puede [desarrollar sus propios componentes 4D](../Extensions/develop-components.md). +Varios componentes son [desarrollados por 4D](../Extensions/overview.md#components-developed-by-4d), pero muchos componentes 4D de la comunidad 4D [se pueden encontrar en GitHub](https://github.com/topics/4d-component). Adicionalmente, puede [desarrollar sus propios componentes 4D](../Extensions/develop-components.md). ## Utilización de los componentes From 2df98635c39178f47c9ef110380f9db0968e2191 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 19:24:40 +0200 Subject: [PATCH 29/57] New translations components.md (Japanese) --- .../current/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/Concepts/components.md b/i18n/ja/docusaurus-plugin-content-docs/current/Concepts/components.md index 024694520c74aa..22368f829aff95 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/Concepts/components.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/Concepts/components.md @@ -9,7 +9,7 @@ title: コンポーネント 4D プロジェクト内へのコンポーネントのインストールとロードは、[4D 依存関係マネージャー](../Project/components.md) を通して管理されます。 -いくつかのコンポーネントが[4D によって開発](../Extensions/overview.md#components-developed-by-4d)されていますが、それ以外にも4D コミュニティによるたくさんの4D コンポーネントが[GitHub 上で公開されています](https://github.com/search?q=4d-component&type=Repositories)。 また、[独自の 4Dコンポーネントを開発](../Extensions/develop-components.md) することもできます。 +いくつかのコンポーネントが[4D によって開発](../Extensions/overview.md#components-developed-by-4d)されていますが、それ以外にも4D コミュニティによるたくさんの4D コンポーネントが[GitHub 上で公開されています](https://github.com/topics/4d-component)。 また、[独自の 4Dコンポーネントを開発](../Extensions/develop-components.md) することもできます。 ## コンポーネントの使い方 From 5ccf407ecffcd3bb6581143c01ccc4e12a7f16ab Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 19:24:55 +0200 Subject: [PATCH 30/57] New translations components.md (Portuguese, Brazilian) --- .../current/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/Concepts/components.md b/i18n/pt/docusaurus-plugin-content-docs/current/Concepts/components.md index f68e3abde1e8ad..0fc243a77163dd 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/Concepts/components.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/Concepts/components.md @@ -9,7 +9,7 @@ Um componente 4D é um conjunto de código 4D e formulários que representam uma Installation and loading of components in your 4D projects are handled through the [4D Dependency manager](../Project/components.md). -Several components are [developed by 4D](../Extensions/overview.md#components-developed-by-4d), but a lot of 4D components from the 4D community [can be found on GitHub](https://github.com/search?q=4d-component&type=Repositories). Além disso, você pode [desenvolver seus próprios componentes 4D](../Extensions/develop-components.md). +Several components are [developed by 4D](../Extensions/overview.md#components-developed-by-4d), but a lot of 4D components from the 4D community [can be found on GitHub](https://github.com/topics/4d-component). Além disso, você pode [desenvolver seus próprios componentes 4D](../Extensions/develop-components.md). ## Utilização de componentes From 507aaa841010c8c15399301a48cf5210975c90c0 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 19:41:29 +0200 Subject: [PATCH 31/57] New translations components.md (French) --- .../current/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/Project/components.md b/i18n/fr/docusaurus-plugin-content-docs/current/Project/components.md index 1dff99a10fce34..f18f0d6bc25387 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/Project/components.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/Project/components.md @@ -5,7 +5,7 @@ title: Dépendances [L'architecture des projets](../Project/architecture.md) 4D est modulaire. Vous pouvez ajouter des fonctionnalités supplémentaires dans vos projets 4D en installant des [**composants**](Concepts/components.md) et des [**plug-ins**](../Concepts/plug-ins.md). Les composants sont constitués de code 4D, tandis que les plug-ins peuvent être [construits à l'aide de n'importe quel langage](../Extensions/develop-plug-ins.md). -Vous pouvez [développer](../Extensions/develop-components.md) et [construire](../Desktop/building.md) vos propres composants 4D, ou télécharger des composants publics partagés par la communauté 4D [sur GitHub](https://github.com/search?q=4d-component&type=Repositories). +Vous pouvez [développer](../Extensions/develop-components.md) et [construire](../Desktop/building.md) vos propres composants 4D, ou télécharger des composants publics partagés par la communauté 4D [sur GitHub](https://github.com/topics/4d-component). Une fois installées dans votre environnement 4D, les extensions sont traitées comme des **dépendances** avec des propriétés spécifiques. From a6b7c02323241bad6c8204067b1f4c670a72e0a9 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 19:41:46 +0200 Subject: [PATCH 32/57] New translations components.md (Spanish) --- .../current/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/Project/components.md b/i18n/es/docusaurus-plugin-content-docs/current/Project/components.md index 05ff3c96923e4a..de12a84917a83c 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/Project/components.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/Project/components.md @@ -5,7 +5,7 @@ title: Dependencias [La arquitectura de los proyectos](../Project/architecture.md) 4D es modular. Puede ofrecer funcionalidades adicionales a sus proyectos 4D instalando [**componentes**](Concepts/components.md) y [**plug-ins**](../Concepts/plug-ins.md). Los componentes están hechos de código 4D, mientras que los plug-ins pueden [construirse utilizando cualquier lenguaje](../Extensions/develop-plug-ins.md). -Puede [desarrollar](../Extensions/develop-components.md) y [crear](../Desktop/building.md) sus propios componentes 4D, o descargar componentes públicos compartidos por la comunidad 4D que [se pueden encontrar en GitHub](https://github.com/search?q=4d-component\\\\\\\\\\&type=Repositories). +Puede [desarrollar](../Extensions/develop-components.md) y [crear](../Desktop/building.md) sus propios componentes 4D, o descargar componentes públicos compartidos por la comunidad 4D que [se pueden encontrar en GitHub](https://github.com/topics/4d-component). Una vez instalados en su entorno 4D, las extensiones se manejan como **dependencias** con propiedades específicas. From 3a61a538f85bdecfb5835b9e7d42078ce9689943 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 19:42:05 +0200 Subject: [PATCH 33/57] New translations components.md (Japanese) --- .../current/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/Project/components.md b/i18n/ja/docusaurus-plugin-content-docs/current/Project/components.md index ec4b08fc2b4273..a7bd810462640c 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/Project/components.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/Project/components.md @@ -5,7 +5,7 @@ title: 依存関係 4D [プロジェクトアーキテクチャー](../Project/architecture.md) はモジュール式です。 [**コンポーネント**](../Concepts/components.md) や [**プラグイン**](../Concepts/plug-ins.md) をインストールすることで、4Dプロジェクトに追加機能を持たせることができます。 コンポーネントは4D コードで書かれていますが、プラグインは[あらゆる言語を使用してビルドすることができます](../Extensions/develop-plug-ins.md)。 -独自の 4Dコンポーネントを [開発](../Extensions/develop-components.md) し、[ビルド](../Desktop/building.md) することもできますし、4Dコミュニティによって共有されているパブリックコンポーネントを [GitHubで見つけて](https://github.com/search?q=4d-component\\\\\\&type=Repositories) ダウンロードすることもできます。 +独自の 4Dコンポーネントを [開発](../Extensions/develop-components.md) し、[ビルド](../Desktop/building.md) することもできますし、4Dコミュニティによって共有されているパブリックコンポーネントを [GitHubで見つけて](https://github.com/topics/4d-component) ダウンロードすることもできます。 4D 環境にインストールされると、拡張機能は特別なプロパティを持つ**依存関係** として扱われます。 From 01b2acf88a3bcb66715f7851d145ea22262acadc Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 19:42:21 +0200 Subject: [PATCH 34/57] New translations components.md (Portuguese, Brazilian) --- .../current/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/Project/components.md b/i18n/pt/docusaurus-plugin-content-docs/current/Project/components.md index 0e1b416ff79da9..95b98dbb8e7fa1 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/Project/components.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/Project/components.md @@ -5,7 +5,7 @@ title: Dependencies A [arquitetura dos projetos](../Project/architecture.md) 4D é modular. Você pode fornecer funcionalidades adicionais aos seus projetos 4D instalando [**componentes**](Concepts/components.md) e [**plug-ins**](Concepts/plug-ins.md). Components are made of 4D code, while plug-ins can be [built using any language](../Extensions/develop-plug-ins.md). -Você pode [desenvolver](../Extensions/develop-components.md) e [construir](../Desktop/building.md) seus próprios componentes 4D, ou baixar componentes públicos compartilhados pela comunidade 4D que [podem ser encontrados no GitHub](https://github.com/search?q=4d-component&type=Repositories). +Você pode [desenvolver](../Extensions/develop-components.md) e [construir](../Desktop/building.md) seus próprios componentes 4D, ou baixar componentes públicos compartilhados pela comunidade 4D que [podem ser encontrados no GitHub](https://github.com/topics/4d-component). Once installed in your 4D environment, extensions are handled as **dependencies** with specific properties. From 4596e3c7e1d665d988586fb3ae644b244f0a2aec Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 21:12:09 +0200 Subject: [PATCH 35/57] New translations http-request-handler.md (Spanish) --- .../current/WebServer/http-request-handler.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-request-handler.md b/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-request-handler.md index 72aff3bfa10d5a..5fa1e23208cd95 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-request-handler.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-request-handler.md @@ -5,47 +5,47 @@ title: HTTP Request handler Por defecto, las peticiones HTTP recibidas por el servidor web 4D se gestionan a través de [funciones de procesamiento integradas](httpRequests.md) o del [servidor REST](../REST/REST_requests.md). -In addition, 4D supports the implementation of **custom HTTP Request handlers**, allowing you to intercept specific incoming HTTP requests and process them using your own code. +Además, 4D soporta la implementación de **gestores de peticiones HTTP personalizadas**, permitiéndole interceptar peticiones HTTP entrantes específicas y procesarlas utilizando su propio código. Cuando un manejador de peticiones HTTP personalizado intercepta una solicitud, se procesa directamente y no hay otras funcionalidades de procesamiento (por ejemplo, son llamados métodos base [On Web authentication](./authentication.md#on-web-authentication) o [On Web connection](./httpRequests.md#on-web-connection). -Custom HTTP request handlers meet various needs, including: +Los gestores de peticiones HTTP personalizados satisfacen diversas necesidades, entre ellas: -- using a given URL as a resource provider or a file-uploading box (to download or upload various files), -- redirecting on specific pages according to a context (user authenticated, privileges granted...), +- la utilización de una URL dedicada como proveedor de recursos o como cuadro de carga de archivos (para descargar o cargar varios archivos), +- la redirección en páginas específicas en función de un contexto (usuario autentificado, privilegios otorgados...), - gestionar una autenticación a través de oAuth 2.0. ## Requisitos -Custom HTTP Request handlers are supported in the following context: +Los manejadores de peticiones HTTP personalizadas están soportados en el siguiente contexto: -- [scalable sessions](./sessions.md#enabling-web-sessions) or [no sessions](../settings/web.md#no-sessions) are enabled, -- a web server run locally by 4D or 4D Server, including those [run by components](./webServerObject.md). +- las [sesiones escalables](./sessions.md#enabling-web-sessions) o [sin sesiones](../settings/web.md#no-sessions) están activadas, +- un servidor web ejecutado localmente por 4D o 4D Server, incluyendo aquellos [ejecutados por componentes](./webServerObject.md). :::warning -For security reasons, external access to the datastore can be disallowed in 4D. You need to configure the [ORDA privileges](../ORDA/privileges.md) to allow HTTP requests. +Por razones de seguridad, el acceso externo al datastore puede ser desautorizado en 4D. Necesita configurar los [privilegios ORDA](../ORDA/privileges.md) para permitir peticiones HTTP. ::: -## Cómo definir los manejadores +## Cómo definir los gestores -You can declare HTTP Request handlers: +Puede declarar gestores de peticiones HTTP: -- in a configuration file named **HTTPHandlers.json** stored in the [`Project/Sources`](../Project/architecture.md#sources) folder of the project. HTTP Request handlers are loaded and applied in the main Web server once it is started. -- using a [`.handlers`](../API/WebServerClass.md#handlers) property set in the *settings* parameter of the [start()](../API/WebServerClass.md#start) function, for any web server object: +- en un archivo de configuración llamado **HTTPHandlers.json** almacenado en la carpeta [`Project/Sources`](../Project/architecture.md#sources) del proyecto. Los gestores de peticiones HTTP se cargan y aplican en el servidor Web principal una vez se inicia. +- utilizando una propiedad [`.handlers`](../API/WebServerClass.md#handlers) definida en el parámetro *settings* de la función [start()](../API/WebServerClass.md#start), para todo objeto servidor web: ```4d -WEB Server.start($settings.handlers) //set rules at web server startup +WEB Server.start($settings.handlers) //definir reglas al inicio del servidor web ``` -If both a **HTTPHandlers.json** file and a call to the [`WEB Server`](../commands/web-server.md) command with a valid `$settings.handlers` are used, the `WEB Server` command has priority. +Si se utiliza tanto un archivo **HTTPHandlers.json** como una llamada al comando [`WEB Server`](../commands/web-server.md) con un `$settings.handlers` válido, el comando `WEB Server` tiene prioridad. -The json file (or the object in the *settings* parameter) contains all listened URL patterns, the handled verbs, and the code to be called. +El archivo json (o el objeto en el parámetro *settings*) contiene todos los modelos URL escuchados, los verbos manejados y el código a llamar. -Handlers are provided as a collection. +Los *handlers* se proporcionan como una colección. -At runtime, the first pattern matching the URL is executed, the others are ignored. +Al momento de la ejecución, se ejecuta el primer patrón que coincida con la URL, los demás se ignoran. Este es un ejemplo del contenido de un archivo *HTTPHandlers.json*: @@ -61,11 +61,11 @@ Este es un ejemplo del contenido de un archivo *HTTPHandlers.json*: ] ``` -This handler declaration can be read as: when any request starting by `/start/` with a `GET` or `POST` verb is received by the server, the `gettingStarted` function of the `GeneralHandling` singleton is executed. +Esta declaración de handler puede leerse como: cuando cualquier petición que comience por `/start/` con un verbo `GET` o `POST` es recibida por el servidor, se ejecuta la función `gettingStarted` del singleton `GeneralHandling`. :::note -You must restart the Web server so that modifications made in this file are taken into account. +Debe reiniciar el servidor Web para que se tengan en cuenta las modificaciones realizadas en este archivo. ::: @@ -74,7 +74,7 @@ You must restart the Web server so that modifications made in this file are take Un manejador está definido por: - un patrón de URL a interceptar -- a function and its class where the code is implemented to handle the listened URL pattern +- una función y su clase donde se implementa el código para manejar el patrón URL escuchado - the verbs with which the URL can be called to trigger the handler The handler identifier is the couple [pattern + a verb among the verbs list]. @@ -225,7 +225,7 @@ En este ejemplo, debe implementar las siguientes funciones: - *handleDocs* en la clase *DocsHandling* - *handleTheInvoice* / *handleDetails* / *handleInvoices* en la clase *InvoicesHandling* -Examples of URLs triggering the handlers: +Ejemplos de URL que activan los gestores personalizados: `IP:port/info/` con un verbo GET `IP:port/info/general` con un verbo GET From b3c0d6c1358036b881d87da5ab48b7c4be9456aa Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 21:32:46 +0200 Subject: [PATCH 36/57] New translations components.md (French) --- .../version-20-R10/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md index 7db6e099377e5b..88689190e4c61a 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md @@ -7,7 +7,7 @@ Un composant 4D est un ensemble de code et de formulaires 4D représentant une o ## Installation des composants -Plusieurs composants sont [préinstallés dans l'environnement de développement 4D](Extensions/overview.md), mais de nombreux composants 4D de la communauté 4D sont disponibles sur GitHub. De plus, vous pouvez développer vos propres composants 4D. +Plusieurs composants sont [préinstallés dans l'environnement de développement 4D](Extensions/overview.md), mais de nombreux composants 4D de la communauté 4D [sont disponibles sur GitHub](https://github.com/topics/4d-component). De plus, vous pouvez développer vos propres composants 4D. L'installation et le chargement des composants dans vos projets 4D sont gérés par le [Gestionnaire de dépendances de 4D](../Project/components.md). From ec43c7c0a662bfc35d5a982144372c55cec6ab05 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 21:33:04 +0200 Subject: [PATCH 37/57] New translations components.md (Spanish) --- .../version-20-R10/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md index b58f64c736ee2c..adcaaac1e2b4ee 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md @@ -7,7 +7,7 @@ Un componente 4D es un conjunto de código y de formularios 4D que representan u ## Instalación de los componentes -Varios componentes están [preinstalados en el entorno de desarrollo 4D](Extensions/overview.md), pero muchos componentes 4D de la comunidad 4D [están disponibles en GitHub](https://github.com/search?q=4d-component&type=Repositories). Adicionalmente, puede [desarrollar sus propios componentes 4D](Extensions/develop-components.md). +Varios componentes están [preinstalados en el entorno de desarrollo 4D](Extensions/overview.md), pero muchos componentes 4D de la comunidad 4D [están disponibles en GitHub](https://github.com/topics/4d-component). Adicionalmente, puede [desarrollar sus propios componentes 4D](Extensions/develop-components.md). La instalación y carga de componentes en sus proyectos 4D se manejan a través del [gestor de dependencias de 4D](../Project/components.md). From d7fc490d2d22093bd79d74c8b4c13fd4260fc492 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 21:33:21 +0200 Subject: [PATCH 38/57] New translations components.md (Japanese) --- .../version-20-R10/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md index b7c42db2785c20..8855875dcf17ae 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md @@ -7,7 +7,7 @@ title: コンポーネント ## コンポーネントのインストール -いくつかのコンポーネントは [4D開発環境にプリインストール](Extensions/overview.md) されていますが、4Dコミュニティによる多くの 4Dコンポーネントが [GitHub 上に公開](https://github.com/search?q=4d-component&type=Repositories) されています。 また、[独自の 4Dコンポーネントを開発](Extensions/develop-components.md) することもできます。 +いくつかのコンポーネントは [4D開発環境にプリインストール](Extensions/overview.md) されていますが、4Dコミュニティによる多くの 4Dコンポーネントが [GitHub 上に公開](https://github.com/topics/4d-component) されています。 また、[独自の 4Dコンポーネントを開発](Extensions/develop-components.md) することもできます。 4Dプロジェクトのコンポーネントのインストールとロードは、[4D依存関係マネージャー](../Project/components.md) を介しておこなわれます。 From fa5860b2762b76462e2ad03a697107482bd490b8 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 21:33:37 +0200 Subject: [PATCH 39/57] New translations components.md (Portuguese, Brazilian) --- .../version-20-R10/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md index 2232b0ee3396be..7a4eddbb6334c8 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/Concepts/components.md @@ -7,7 +7,7 @@ Um componente 4D é um conjunto de código 4D e formulários que representam uma ## Instalação de componentes -Vários componentes são [pré-instalados no ambiente de desenvolvimento 4D](Extensions/overview.md), mas muitos componentes 4D da comunidade 4D [podem ser encontrados no GitHub](https://github.com/search?q=4d-component&type=Repositories). Além disso, você pode [desenvolver seus próprios componentes 4D](Extensions/develop-components.md). +Vários componentes são [pré-instalados no ambiente de desenvolvimento 4D](Extensions/overview.md), mas muitos componentes 4D da comunidade 4D [podem ser encontrados no GitHub](https://github.com/topics/4d-component). Além disso, você pode [desenvolver seus próprios componentes 4D](Extensions/develop-components.md). A instalação e o carregamento de componentes em seus projetos 4D são feitos por meio do [gerenciador de dependências 4D](../Project/components.md). From a72d3a5d31f4cbbe46cf6209d4cbfb4ad170ea03 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 21:49:22 +0200 Subject: [PATCH 40/57] New translations components.md (French) --- .../version-20-R10/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/Project/components.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/Project/components.md index 1fbd39997f849f..785281501ef4cd 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/Project/components.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/Project/components.md @@ -5,7 +5,7 @@ title: Dépendances Un composant 4D est un ensemble de code 4D et de formulaires représentant une ou plusieurs fonctionnalité(s) que vous pouvez installer et utiliser dans vos projets. Par exemple, le composant [4D SVG](https://github.com/4d/4D-SVG) ajoute des commandes avancées et un moteur de rendu intégré qui peut être utilisé pour afficher des fichiers SVG. -Vous pouvez [développer](../Extensions/develop-components.md) et [construire](../Desktop/building.md) vos propres composants 4D, ou télécharger des composants publics partagés par la communauté 4D [sur GitHub](https://github.com/search?q=4d-component&type=Repositories). +Vous pouvez [développer](../Extensions/develop-components.md) et [construire](../Desktop/building.md) vos propres composants 4D, ou télécharger des composants publics partagés par la communauté 4D [sur GitHub](https://github.com/topics/4d-component). Lorsque vous développez dans 4D, les fichiers de composants peuvent être stockés de manière transparente sur votre ordinateur ou sur un dépôt Github. From 5e2b92130ad1229ca801c9255c9d49c627f00f42 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 21:49:39 +0200 Subject: [PATCH 41/57] New translations components.md (Spanish) --- .../version-20-R10/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Project/components.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Project/components.md index 4278b5bd24df39..689c99155f4d23 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Project/components.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/Project/components.md @@ -5,7 +5,7 @@ title: Dependencias Un componente 4D es un conjunto de código y/o de formularios 4D que representan una o varias funcionalidades que pueden añadirse y utilizarse en sus proyectos. Por ejemplo, el componente [4D SVG](https://github.com/4d/4D-SVG) añade comandos avanzados y un motor de renderizado integrado que puede utilizarse para visualizar archivos SVG. -Puede [desarrollar](../Extensions/develop-components.md) y [crear](../Desktop/building.md) sus propios componentes 4D, o descargar componentes públicos compartidos por la comunidad 4D que [se pueden encontrar en GitHub](https://github.com/search?q=4d-component\\\\\\\\\\&type=Repositories). +Puede [desarrollar](../Extensions/develop-components.md) y [crear](../Desktop/building.md) sus propios componentes 4D, o descargar componentes públicos compartidos por la comunidad 4D que [se pueden encontrar en GitHub](https://github.com/topics/4d-component). Al desarrollar en 4D, los archivos de los componentes pueden almacenarse de forma transparente en su ordenador o en un repositorio Github. From 74e3da5d71911b2a1178132e3b5e40d3c4d1c1ea Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 21:49:55 +0200 Subject: [PATCH 42/57] New translations components.md (Japanese) --- .../version-20-R10/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Project/components.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Project/components.md index ac467cef8235cb..0318156284d0d5 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Project/components.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Project/components.md @@ -5,7 +5,7 @@ title: 依存関係 4D のコンポーネントとは、プロジェクトに追加可能な、1つ以上の機能を持つ 4Dコードや 4Dフォームの一式です。 たとえば、[4D SVG](https://github.com/4d/4D-SVG)コンポーネント は、SVGファイルの表示するための高度なコマンドと統合されたレンダリングエンジンを追加します。 -独自の 4Dコンポーネントを [開発](../Extensions/develop-components.md) し、[ビルド](../Desktop/building.md) することもできますし、4Dコミュニティによって共有されているパブリックコンポーネントを [GitHubで見つけて](https://github.com/search?q=4d-component\\\\\\&type=Repositories) ダウンロードすることもできます。 +独自の 4Dコンポーネントを [開発](../Extensions/develop-components.md) し、[ビルド](../Desktop/building.md) することもできますし、4Dコミュニティによって共有されているパブリックコンポーネントを [GitHubで見つけて](https://github.com/topics/4d-component) ダウンロードすることもできます。 4D で開発する際、コンポーネントファイルはコンピューター上または Githubリポジトリ上に、透過的に保存することができます。 From 06be2d4b6e6b69d92c6bb09026fc87f152a4a9a5 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 21:50:11 +0200 Subject: [PATCH 43/57] New translations components.md (Portuguese, Brazilian) --- .../version-20-R10/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/Project/components.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/Project/components.md index ed14c5233d5e9e..ad35a6ee75ce9a 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/Project/components.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/Project/components.md @@ -5,7 +5,7 @@ title: Dependencies Um componente 4D é um conjunto de código 4D e/ou formulários que representam uma ou mais funcionalidades que pode adicionar e usar nos seus projetos. Por exemplo, o componente [4D SVG](https://github.com/4d/4D-SVG) adiciona comandos avançados e um mecanismo de renderização integrado que pode ser usado para exibir arquivos SVG. -Você pode [desenvolver](../Extensions/develop-components.md) e [construir](../Desktop/building.md) seus próprios componentes 4D, ou baixar componentes públicos compartilhados pela comunidade 4D que [podem ser encontrados no GitHub](https://github.com/search?q=4d-component&type=Repositories). +Você pode [desenvolver](../Extensions/develop-components.md) e [construir](../Desktop/building.md) seus próprios componentes 4D, ou baixar componentes públicos compartilhados pela comunidade 4D que [podem ser encontrados no GitHub](https://github.com/topics/4d-component). Ao desenvolver em 4D, os arquivos de componentes podem ser armazenados de forma transparente no seu computador ou em um repositório do Github. From eb0af35ca5d9fd6131325071a6a53bbfeca99b9d Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 22:04:21 +0200 Subject: [PATCH 44/57] New translations http-request-handler.md (Spanish) --- .../WebServer/http-request-handler.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/WebServer/http-request-handler.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/WebServer/http-request-handler.md index 5a5143056222b6..4b65edea626737 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/WebServer/http-request-handler.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/WebServer/http-request-handler.md @@ -5,14 +5,14 @@ title: HTTP Request handler Por defecto, las peticiones HTTP recibidas por el servidor web 4D se gestionan a través de [funciones de procesamiento integradas](httpRequests.md) o del [servidor REST](../REST/REST_requests.md). -In addition, 4D supports the implementation of **custom HTTP Request handlers**, allowing you to intercept specific incoming HTTP requests and process them using your own code. +Además, 4D soporta la implementación de **gestores de peticiones HTTP personalizadas**, permitiéndole interceptar peticiones HTTP entrantes específicas y procesarlas utilizando su propio código. Cuando un manejador de peticiones HTTP personalizado intercepta una solicitud, se procesa directamente y no hay otras funcionalidades de procesamiento (por ejemplo, son llamados métodos base [On Web authentication](./authentication.md#on-web-authentication) o [On Web connection](./httpRequests.md#on-web-connection). -Custom HTTP request handlers meet various needs, including: +Los gestores de peticiones HTTP personalizados satisfacen diversas necesidades, entre ellas: -- using a given URL as a resource provider or a file-uploading box (to download or upload various files), -- redirecting on specific pages according to a context (user authenticated, privileges granted...), +- la utilización de una URL dedicada como proveedor de recursos o como cuadro de carga de archivos (para descargar o cargar varios archivos), +- la redirección en páginas específicas en función de un contexto (usuario autentificado, privilegios otorgados...), - gestionar una autenticación a través de oAuth 2.0. ## Requisitos @@ -24,7 +24,7 @@ Se soportan gestores de solicitudes HTTP personalizados: :::warning -[Por defecto](../ORDA/privileges.md#default-file) por razones de seguridad, el acceso externo al datastore no está permitido en 4D. You need to configure the [ORDA privileges](../ORDA/privileges.md) to allow HTTP requests. +[Por defecto](../ORDA/privileges.md#default-file) por razones de seguridad, el acceso externo al datastore no está permitido en 4D. Necesita configurar los [privilegios ORDA](../ORDA/privileges.md) para permitir peticiones HTTP. ::: @@ -34,7 +34,7 @@ Define sus manejadores de petición HTTP personalizados en un archivo de configu This file contains all listened URL patterns, the handled verbs, and the code to be called. Los administradores se proporcionan en forma de colección en formato JSON. -At runtime, the first pattern matching the URL is executed, the others are ignored. +Al momento de la ejecución, se ejecuta el primer patrón que coincida con la URL, los demás se ignoran. Este es un ejemplo del contenido de un archivo *HTTPHandlers.json*: @@ -50,11 +50,11 @@ Este es un ejemplo del contenido de un archivo *HTTPHandlers.json*: ] ``` -This handler declaration can be read as: when any request starting by `/start/` with a `GET` or `POST` verb is received by the server, the `gettingStarted` function of the `GeneralHandling` singleton is executed. +Esta declaración de handler puede leerse como: cuando cualquier petición que comience por `/start/` con un verbo `GET` o `POST` es recibida por el servidor, se ejecuta la función `gettingStarted` del singleton `GeneralHandling`. :::note -You must restart the Web server so that modifications made in this file are taken into account. +Debe reiniciar el servidor Web para que se tengan en cuenta las modificaciones realizadas en este archivo. ::: @@ -63,7 +63,7 @@ You must restart the Web server so that modifications made in this file are take Un manejador está definido por: - un patrón de URL a interceptar -- a function and its class where the code is implemented to handle the listened URL pattern +- una función y su clase donde se implementa el código para manejar el patrón URL escuchado - the verbs with which the URL can be called to trigger the handler The handler identifier is the couple [pattern + a verb among the verbs list]. @@ -214,7 +214,7 @@ En este ejemplo, debe implementar las siguientes funciones: - *handleDocs* en la clase *DocsHandling* - *handleTheInvoice* / *handleDetails* / *handleInvoices* en la clase *InvoicesHandling* -Examples of URLs triggering the handlers: +Ejemplos de URL que activan los gestores personalizados: `IP:port/info/` con un verbo GET `IP:port/info/general` con un verbo GET From 3bd3d81791b6cb4925646f5112dd528e8c18a068 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 23:35:37 +0200 Subject: [PATCH 45/57] New translations http-rules.md (Spanish) --- .../current/WebServer/http-rules.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-rules.md b/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-rules.md index c362533f28a3d9..4a997b5f1b63da 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-rules.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-rules.md @@ -3,7 +3,7 @@ id: http-rules title: Reglas HTTP --- -You can define HTTP rules to control HTTP response headers for any requests received by the 4D web server, including REST requests. You can add, modify, or remove HTTP headers, send redirections or set the HTTP status. This feature is useful to implement security policies based upon the handling of headers. +Puede definir reglas HTTP para controlar los encabezados de respuesta HTTP para toda petición recibida por el servidor web 4D, incluyendo las peticiones REST. Puede añadir, modificar o eliminar los encabezados HTTP, enviar redirecciones o establecer el estado HTTP. This feature is useful to implement security policies based upon the handling of headers. To define HTTP rules, you just need to write some RegEx to declare the URL patterns you want to control, as well as how to modify response headers. You can set these rules using a `HTTPRules.json` file stored in the project folder, or using the *settings* parameter [`start()`](../API/WebServerClass.md#start) function of the web server object. @@ -82,7 +82,7 @@ Puede conocer las reglas actuales utilizando la propiedad [`.rules` del objeto W ``` var $rules : Collection -$rules:=WEB Server.rules //current rules +$rules:=WEB Server.rules //reglas actuales ``` ## Ejemplos From 6bbd4c55a15e4f9d7b490c02a81387c00748be19 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 23:41:36 +0200 Subject: [PATCH 46/57] New translations components.md (French) --- .../version-21/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/Concepts/components.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/Concepts/components.md index 1a124b4e2246f9..b086a5b4e4092b 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/Concepts/components.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-21/Concepts/components.md @@ -9,7 +9,7 @@ Un composant 4D est un ensemble de code et de formulaires 4D représentant une o L'installation et le chargement des composants dans vos projets 4D sont gérés par le [Gestionnaire de dépendances de 4D](../Project/components.md). -Plusieurs composants sont [développés par 4D](../Extensions/overview.md#components-developed-by-4d), mais de nombreux composants de la communauté 4D [sont publiés sur GitHub](https://github.com/search?q=4d-component&type=Repositories). De plus, vous pouvez [développer vos propres composants 4D](../Extensions/develop-components.md). +Plusieurs composants sont [développés par 4D](../Extensions/overview.md#components-developed-by-4d), mais de nombreux composants de la communauté 4D [sont publiés sur GitHub](https://github.com/topics/4d-component). De plus, vous pouvez [développer vos propres composants 4D](../Extensions/develop-components.md). ## Utilisation des composants From 5e4e0fe2824da1020bb79adac7aa263234a0ea51 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 23:41:53 +0200 Subject: [PATCH 47/57] New translations components.md (Spanish) --- .../version-21/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/Concepts/components.md b/i18n/es/docusaurus-plugin-content-docs/version-21/Concepts/components.md index 16edac0f404e2c..fe6ae7e719caec 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/Concepts/components.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/Concepts/components.md @@ -9,7 +9,7 @@ Un componente 4D es un conjunto de código y de formularios 4D que representan u Installation and loading of components in your 4D projects are handled through the [4D Dependency manager](../Project/components.md). -Varios componentes son [desarrollados por 4D](../Extensions/overview.md#components-developed-by-4d), pero muchos componentes 4D de la comunidad 4D [se pueden encontrar en GitHub](https://github.com/search?q=4d-component&type=Repositories). Adicionalmente, puede [desarrollar sus propios componentes 4D](../Extensions/develop-components.md). +Varios componentes son [desarrollados por 4D](../Extensions/overview.md#components-developed-by-4d), pero muchos componentes 4D de la comunidad 4D [se pueden encontrar en GitHub](https://github.com/topics/4d-component). Adicionalmente, puede [desarrollar sus propios componentes 4D](../Extensions/develop-components.md). ## Utilización de los componentes From 3dbd55f1ef5f245eb8a273b7ea5f40a6ec881f7a Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 23:42:10 +0200 Subject: [PATCH 48/57] New translations components.md (Japanese) --- .../version-21/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/Concepts/components.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/Concepts/components.md index 024694520c74aa..22368f829aff95 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/Concepts/components.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-21/Concepts/components.md @@ -9,7 +9,7 @@ title: コンポーネント 4D プロジェクト内へのコンポーネントのインストールとロードは、[4D 依存関係マネージャー](../Project/components.md) を通して管理されます。 -いくつかのコンポーネントが[4D によって開発](../Extensions/overview.md#components-developed-by-4d)されていますが、それ以外にも4D コミュニティによるたくさんの4D コンポーネントが[GitHub 上で公開されています](https://github.com/search?q=4d-component&type=Repositories)。 また、[独自の 4Dコンポーネントを開発](../Extensions/develop-components.md) することもできます。 +いくつかのコンポーネントが[4D によって開発](../Extensions/overview.md#components-developed-by-4d)されていますが、それ以外にも4D コミュニティによるたくさんの4D コンポーネントが[GitHub 上で公開されています](https://github.com/topics/4d-component)。 また、[独自の 4Dコンポーネントを開発](../Extensions/develop-components.md) することもできます。 ## コンポーネントの使い方 From eb2157726b840fb12ebb4acb2fb9441d64bbdac5 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Thu, 23 Oct 2025 23:42:25 +0200 Subject: [PATCH 49/57] New translations components.md (Portuguese, Brazilian) --- .../version-21/Concepts/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/Concepts/components.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/Concepts/components.md index f68e3abde1e8ad..0fc243a77163dd 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/Concepts/components.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-21/Concepts/components.md @@ -9,7 +9,7 @@ Um componente 4D é um conjunto de código 4D e formulários que representam uma Installation and loading of components in your 4D projects are handled through the [4D Dependency manager](../Project/components.md). -Several components are [developed by 4D](../Extensions/overview.md#components-developed-by-4d), but a lot of 4D components from the 4D community [can be found on GitHub](https://github.com/search?q=4d-component&type=Repositories). Além disso, você pode [desenvolver seus próprios componentes 4D](../Extensions/develop-components.md). +Several components are [developed by 4D](../Extensions/overview.md#components-developed-by-4d), but a lot of 4D components from the 4D community [can be found on GitHub](https://github.com/topics/4d-component). Além disso, você pode [desenvolver seus próprios componentes 4D](../Extensions/develop-components.md). ## Utilização de componentes From 392bb8384c2093abf4ea02dc4133a6d11002e6a7 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Fri, 24 Oct 2025 00:45:17 +0200 Subject: [PATCH 50/57] New translations components.md (French) --- .../version-21/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-21/Project/components.md b/i18n/fr/docusaurus-plugin-content-docs/version-21/Project/components.md index d0bac014d46a03..e2e93c1843a937 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-21/Project/components.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-21/Project/components.md @@ -5,7 +5,7 @@ title: Dépendances [L'architecture des projets](../Project/architecture.md) 4D est modulaire. Vous pouvez ajouter des fonctionnalités supplémentaires dans vos projets 4D en installant des [**composants**](Concepts/components.md) et des [**plug-ins**](../Concepts/plug-ins.md). Les composants sont constitués de code 4D, tandis que les plug-ins peuvent être [construits à l'aide de n'importe quel langage](../Extensions/develop-plug-ins.md). -Vous pouvez [développer](../Extensions/develop-components.md) et [construire](../Desktop/building.md) vos propres composants 4D, ou télécharger des composants publics partagés par la communauté 4D [sur GitHub](https://github.com/search?q=4d-component&type=Repositories). +Vous pouvez [développer](../Extensions/develop-components.md) et [construire](../Desktop/building.md) vos propres composants 4D, ou télécharger des composants publics partagés par la communauté 4D [sur GitHub](https://github.com/topics/4d-component). Une fois installées dans votre environnement 4D, les extensions sont traitées comme des **dépendances** avec des propriétés spécifiques. From 50ee94b5950cc4a83059f316dd6464805262fcf6 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Fri, 24 Oct 2025 00:45:34 +0200 Subject: [PATCH 51/57] New translations components.md (Spanish) --- .../version-21/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/Project/components.md b/i18n/es/docusaurus-plugin-content-docs/version-21/Project/components.md index 9c9aa3644752e3..b0d39e3af03167 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/Project/components.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/Project/components.md @@ -5,7 +5,7 @@ title: Dependencias [La arquitectura de los proyectos](../Project/architecture.md) 4D es modular. Puede ofrecer funcionalidades adicionales a sus proyectos 4D instalando [**componentes**](Concepts/components.md) y [**plug-ins**](../Concepts/plug-ins.md). Los componentes están hechos de código 4D, mientras que los plug-ins pueden [construirse utilizando cualquier lenguaje](../Extensions/develop-plug-ins.md). -Puede [desarrollar](../Extensions/develop-components.md) y [crear](../Desktop/building.md) sus propios componentes 4D, o descargar componentes públicos compartidos por la comunidad 4D que [se pueden encontrar en GitHub](https://github.com/search?q=4d-component\\\\\\\\\\&type=Repositories). +Puede [desarrollar](../Extensions/develop-components.md) y [crear](../Desktop/building.md) sus propios componentes 4D, o descargar componentes públicos compartidos por la comunidad 4D que [se pueden encontrar en GitHub](https://github.com/topics/4d-component). Una vez instalados en su entorno 4D, las extensiones se manejan como **dependencias** con propiedades específicas. From 5dfce6c54215b091736a8dff3b8720386adf3197 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Fri, 24 Oct 2025 00:45:51 +0200 Subject: [PATCH 52/57] New translations components.md (Japanese) --- .../version-21/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-21/Project/components.md b/i18n/ja/docusaurus-plugin-content-docs/version-21/Project/components.md index 76f679bb238d05..2b43e0d03225a0 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-21/Project/components.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-21/Project/components.md @@ -5,7 +5,7 @@ title: 依存関係 4D [プロジェクトアーキテクチャー](../Project/architecture.md) はモジュール式です。 [**コンポーネント**](../Concepts/components.md) や [**プラグイン**](../Concepts/plug-ins.md) をインストールすることで、4Dプロジェクトに追加機能を持たせることができます。 コンポーネントは4D コードで書かれていますが、プラグインは[あらゆる言語を使用してビルドすることができます](../Extensions/develop-plug-ins.md)。 -独自の 4Dコンポーネントを [開発](../Extensions/develop-components.md) し、[ビルド](../Desktop/building.md) することもできますし、4Dコミュニティによって共有されているパブリックコンポーネントを [GitHubで見つけて](https://github.com/search?q=4d-component\\\\\\&type=Repositories) ダウンロードすることもできます。 +独自の 4Dコンポーネントを [開発](../Extensions/develop-components.md) し、[ビルド](../Desktop/building.md) することもできますし、4Dコミュニティによって共有されているパブリックコンポーネントを [GitHubで見つけて](https://github.com/topics/4d-component) ダウンロードすることもできます。 4D 環境にインストールされると、拡張機能は特別なプロパティを持つ**依存関係** として扱われます。 From 8c92af262878b2366584cf2fec965229189c6af4 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Fri, 24 Oct 2025 00:46:06 +0200 Subject: [PATCH 53/57] New translations components.md (Portuguese, Brazilian) --- .../version-21/Project/components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-21/Project/components.md b/i18n/pt/docusaurus-plugin-content-docs/version-21/Project/components.md index 4abdc5190be21e..26d5677b930cd9 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-21/Project/components.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-21/Project/components.md @@ -5,7 +5,7 @@ title: Dependencies A [arquitetura dos projetos](../Project/architecture.md) 4D é modular. Você pode fornecer funcionalidades adicionais aos seus projetos 4D instalando [**componentes**](Concepts/components.md) e [**plug-ins**](Concepts/plug-ins.md). Components are made of 4D code, while plug-ins can be [built using any language](../Extensions/develop-plug-ins.md). -Você pode [desenvolver](../Extensions/develop-components.md) e [construir](../Desktop/building.md) seus próprios componentes 4D, ou baixar componentes públicos compartilhados pela comunidade 4D que [podem ser encontrados no GitHub](https://github.com/search?q=4d-component&type=Repositories). +Você pode [desenvolver](../Extensions/develop-components.md) e [construir](../Desktop/building.md) seus próprios componentes 4D, ou baixar componentes públicos compartilhados pela comunidade 4D que [podem ser encontrados no GitHub](https://github.com/topics/4d-component). Once installed in your 4D environment, extensions are handled as **dependencies** with specific properties. From 4192f9ecc180f85e4817bab9c7f4cac9e0447d13 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Fri, 24 Oct 2025 00:58:45 +0200 Subject: [PATCH 54/57] New translations http-request-handler.md (Spanish) --- .../WebServer/http-request-handler.md | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/http-request-handler.md b/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/http-request-handler.md index 72aff3bfa10d5a..fa31f6b403cfc2 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/http-request-handler.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/http-request-handler.md @@ -5,47 +5,47 @@ title: HTTP Request handler Por defecto, las peticiones HTTP recibidas por el servidor web 4D se gestionan a través de [funciones de procesamiento integradas](httpRequests.md) o del [servidor REST](../REST/REST_requests.md). -In addition, 4D supports the implementation of **custom HTTP Request handlers**, allowing you to intercept specific incoming HTTP requests and process them using your own code. +Además, 4D soporta la implementación de **gestores de peticiones HTTP personalizadas**, permitiéndole interceptar peticiones HTTP entrantes específicas y procesarlas utilizando su propio código. Cuando un manejador de peticiones HTTP personalizado intercepta una solicitud, se procesa directamente y no hay otras funcionalidades de procesamiento (por ejemplo, son llamados métodos base [On Web authentication](./authentication.md#on-web-authentication) o [On Web connection](./httpRequests.md#on-web-connection). -Custom HTTP request handlers meet various needs, including: +Los gestores de peticiones HTTP personalizados satisfacen diversas necesidades, entre ellas: -- using a given URL as a resource provider or a file-uploading box (to download or upload various files), -- redirecting on specific pages according to a context (user authenticated, privileges granted...), +- la utilización de una URL dedicada como proveedor de recursos o como cuadro de carga de archivos (para descargar o cargar varios archivos), +- la redirección en páginas específicas en función de un contexto (usuario autentificado, privilegios otorgados...), - gestionar una autenticación a través de oAuth 2.0. ## Requisitos -Custom HTTP Request handlers are supported in the following context: +Los manejadores de peticiones HTTP personalizadas están soportados en el siguiente contexto: - [scalable sessions](./sessions.md#enabling-web-sessions) or [no sessions](../settings/web.md#no-sessions) are enabled, - a web server run locally by 4D or 4D Server, including those [run by components](./webServerObject.md). :::warning -For security reasons, external access to the datastore can be disallowed in 4D. You need to configure the [ORDA privileges](../ORDA/privileges.md) to allow HTTP requests. +Por razones de seguridad, el acceso externo al datastore puede ser desautorizado en 4D. Necesita configurar los [privilegios ORDA](../ORDA/privileges.md) para permitir peticiones HTTP. ::: -## Cómo definir los manejadores +## Cómo definir los gestores -You can declare HTTP Request handlers: +Puede declarar gestores de peticiones HTTP: -- in a configuration file named **HTTPHandlers.json** stored in the [`Project/Sources`](../Project/architecture.md#sources) folder of the project. HTTP Request handlers are loaded and applied in the main Web server once it is started. -- using a [`.handlers`](../API/WebServerClass.md#handlers) property set in the *settings* parameter of the [start()](../API/WebServerClass.md#start) function, for any web server object: +- en un archivo de configuración llamado **HTTPHandlers.json** almacenado en la carpeta [`Project/Sources`](../Project/architecture.md#sources) del proyecto. Los gestores de peticiones HTTP se cargan y aplican en el servidor Web principal una vez se inicia. +- utilizando una propiedad [`.handlers`](../API/WebServerClass.md#handlers) definida en el parámetro *settings* de la función [start()](../API/WebServerClass.md#start), para todo objeto servidor web: ```4d -WEB Server.start($settings.handlers) //set rules at web server startup +WEB Server.start($settings.handlers) //definir reglas al inicio del servidor web ``` -If both a **HTTPHandlers.json** file and a call to the [`WEB Server`](../commands/web-server.md) command with a valid `$settings.handlers` are used, the `WEB Server` command has priority. +Si se utiliza tanto un archivo **HTTPHandlers.json** como una llamada al comando [`WEB Server`](../commands/web-server.md) con un `$settings.handlers` válido, el comando `WEB Server` tiene prioridad. -The json file (or the object in the *settings* parameter) contains all listened URL patterns, the handled verbs, and the code to be called. +El archivo json (o el objeto en el parámetro *settings*) contiene todos los modelos URL escuchados, los verbos manejados y el código a llamar. -Handlers are provided as a collection. +Los *handlers* se proporcionan como una colección. -At runtime, the first pattern matching the URL is executed, the others are ignored. +Al momento de la ejecución, se ejecuta el primer patrón que coincida con la URL, los demás se ignoran. Este es un ejemplo del contenido de un archivo *HTTPHandlers.json*: @@ -61,11 +61,11 @@ Este es un ejemplo del contenido de un archivo *HTTPHandlers.json*: ] ``` -This handler declaration can be read as: when any request starting by `/start/` with a `GET` or `POST` verb is received by the server, the `gettingStarted` function of the `GeneralHandling` singleton is executed. +Esta declaración de handler puede leerse como: cuando cualquier petición que comience por `/start/` con un verbo `GET` o `POST` es recibida por el servidor, se ejecuta la función `gettingStarted` del singleton `GeneralHandling`. :::note -You must restart the Web server so that modifications made in this file are taken into account. +Debe reiniciar el servidor Web para que se tengan en cuenta las modificaciones realizadas en este archivo. ::: @@ -74,31 +74,31 @@ You must restart the Web server so that modifications made in this file are take Un manejador está definido por: - un patrón de URL a interceptar -- a function and its class where the code is implemented to handle the listened URL pattern -- the verbs with which the URL can be called to trigger the handler +- una función y su clase donde se implementa el código para manejar el patrón URL escuchado +- los verbos con los que se puede llamar a la URL para activar el gestor -The handler identifier is the couple [pattern + a verb among the verbs list]. +El identificador del gestor es la pareja [patrón + un verbo de la lista de verbos]. ### Patrones de la URL -URL patterns can be given as **prefixes** or using **regular expressions**. +Los patrones de URL pueden indicarse como **prefijos** o utilizando **expresiones regulares**. -- To declare a prefix pattern, use the "pattern" property name in the HTTPHandlers.json file. Los prefijos son considerados como expresiones regulares que ya contienen un `/` inicial y final. +- Para declarar un patrón de prefijo, utilice el nombre de propiedad "pattern" en el archivo HTTPHandlers.json. Los prefijos son considerados como expresiones regulares que ya contienen un `/` inicial y final. Ej: `"pattern": "docs"` o `"pattern": "docs/invoices"` -- To declare a regular expression pattern, use the "regexPattern" property name in the HTTPHandlers.json file. Los modelos de expresiones regulares se manejan directamente. +- Para declarar un patrón de expresión regular, utilice el nombre de propiedad "regexPattern" en el archivo HTTPHandlers.json. Los modelos de expresiones regulares se manejan directamente. Ej: `"regexPattern" : "/docs/.+/index\.html"` -"Pattern" and "regexPattern" properties cannot be used in the same handler definition (in this case, only the "regexPattern" property is taken into account). +Las propiedades "Pattern" y "regexPattern" no pueden utilizarse en la misma definición de gestor (en este caso, sólo se tiene en cuenta la propiedad "regexPattern"). -#### Concordancia de modelos +#### Correspondencia de modelos Los modelos de URL se activan en el orden indicado: - se ejecuta el primer modelo coincidente - los siguientes patrones no se ejecutan aunque coincidan con la URL -As a consequence, you need to apply a accurate strategy when writing your handlers: the most detailed patterns must be written before the more general patterns. +En consecuencia, debe aplicar una estrategia precisa al escribir sus gestores: los patrones más detallados deben escribirse antes que los patrones más generales. ```json [ @@ -126,7 +126,7 @@ As a consequence, you need to apply a accurate strategy when writing your handle #### Patrones prohibidos -URL patterns matching 4D built-in HTTP processing features are not allowed in custom HTTP handlers. Por ejemplo, los siguientes modelos no pueden ser manejados: +Los patrones URL que coincidan con las funciones de procesamiento HTTP integradas en 4D no están permitidos en los gestores HTTP personalizados. Por ejemplo, los siguientes modelos no pueden ser manejados: - `/4DACTION` - `/rest` @@ -135,7 +135,7 @@ URL patterns matching 4D built-in HTTP processing features are not allowed in cu ### Clase y método -You declare the code to be executed when a defined URL pattern is intercepted using the "class" and "method" properties. +Declare el código a ejecutar cuando se intercepte un patrón de URL definido utilizando las propiedades "class" y "method". - "class": nombre de la clase sin `cs.`, por ejemplo, "UsersHandling" para la clase usuario `cs.UsersHandling`. Debe ser una clase [**compartida**](../Concepts/classes.md#shared-singleton) y [**singleton**](../Concepts/classes.md#singleton-classes). - "method": función de clase perteneciente a la clase. @@ -144,19 +144,19 @@ You declare the code to be executed when a defined URL pattern is intercepted us ### Verbs -You can use the "verbs" property in the handler definition to declare HTTP verbs that are supported in incoming requests for this handler. A request that uses a verb that is not explicitely allowed is automatically rejected by the server. +Puede utilizar la propiedad "verbs" en la definición del manejador para declarar los verbos HTTP que se admiten en las peticiones entrantes para este manejador. Una solicitud que utiliza un verbo no permitido explícitamente es rechazada automáticamente por el servidor. -You can declare several verbs, separated by a comma. Los nombres de verbos no distinguen entre mayúsculas y minúsculas. +Puede declarar varios verbos, separados por una coma. Los nombres de verbos no distinguen entre mayúsculas y minúsculas. Ej: `"verbs" : "PUT, POST"` :::note -No control is done on verb names. Se pueden utilizar todos los nombres. +No se hace ningún control sobre los nombres de los verbos. Se pueden utilizar todos los nombres. ::: -By default, if the "verbs" property is not used for a handler, **all** HTTP verbs are supported in incoming requests for this handler (except those possibly used beforehand in a more detailed pattern, as shown in the example above). +Por defecto, si la propiedad "verbs" no se utiliza para un manejador, **todos** los verbos HTTP son soportados en las peticiones entrantes para este manejador (excepto aquellos posiblemente utilizados de antemano en un patrón más detallado, como se muestra en el ejemplo anterior). :::note @@ -225,7 +225,7 @@ En este ejemplo, debe implementar las siguientes funciones: - *handleDocs* en la clase *DocsHandling* - *handleTheInvoice* / *handleDetails* / *handleInvoices* en la clase *InvoicesHandling* -Examples of URLs triggering the handlers: +Ejemplos de URL que activan los gestores personalizados: `IP:port/info/` con un verbo GET `IP:port/info/general` con un verbo GET @@ -246,11 +246,11 @@ Examples of URLs triggering the handlers: ### Configuración de funciones -The HTTP Request handler code must be implemented in a function of a [**Shared**](../Concepts/classes.md#shared-singleton) [**singleton class**](../Concepts/classes.md#singleton-classes). +El código del gestor de peticiones HTTP debe implementarse en una función de una clase [**Compartida**](../Concepts/classes.md#shared-singleton) [**clase singleton**](../Concepts/classes.md#singleton-classes). -If the singleton is missing or not shared, an error "Cannot find singleton" is returned by the server. If the class or the function [defined as handler](#handler-definition) in the HTTPHandlers.json file is not found, an error "Cannot find singleton function" is returned by the server. +Si el singleton no se encuentra o no está compartido, el servidor devuelve un error "No se puede encontrar singleton". Si la clase o la función [definida como manejador](#handler-definition) en el archivo HTTPHandlers.json no se encuentra, el servidor devuelve un error "No se puede encontrar la función singleton". -Request handler functions are not necessarily shared, unless some request handler properties are updated by the functions. En este caso, necesita declarar sus funciones con la [palabra clave 'shared'](../Concepts/classes.md#shared-functions). +Las funciones del gestor de peticiones no son necesariamente compartidas, a menos que algunas propiedades del gestor de peticiones sean actualizadas por las funciones. En este caso, necesita declarar sus funciones con la [palabra clave 'shared'](../Concepts/classes.md#shared-functions). :::note @@ -262,13 +262,13 @@ Request handler functions are not necessarily shared, unless some request handle Cuando una solicitud ha sido interceptada por el manejador, se recibe en el servidor como una instancia de la [clase 4D.IncomingMessage](../API/IncomingMessageClass.md). -All necessary information about the request are available in this object, including the request url, verb, headers, and, if any, parameters (put in the URL) and body. +Toda la información necesaria sobre la petición está disponible en este objeto, incluyendo la url de la petición, el verbo, los encabezados y, si los hay, los parámetros (puestos en la URL) y el cuerpo de la petición. -Then, the request handler can use this information to trigger appropriate business logic. +A continuación, el gestor de solicitudes puede utilizar esta información para activar la lógica de negocio adecuada. -### Output: an instance of the 4D.OutgoingMessage class +### Salida: una instancia de la clase 4D.OutgoingMessage -The request handler can return an object instance of the [4D.OutGoingMessage class](../API/OutgoingMessageClass.md), i.e. some full web content ready for a browser to handle, such as a file content. +El gestor de peticiones puede devolver una instancia de objeto de la clase [4D.OutGoingMessage](../API/OutgoingMessageClass.md), es decir, algún contenido web completo listo para que un navegador lo maneje, como un contenido de archivo. ### Ejemplo @@ -291,7 +291,7 @@ El archivo **HTTPHandlers.json**: La URL llamada es: http://127.0.0.1:8044/putFile?fileName=testFile -The binary content of the file is put in the body of the request and a POST verb is used. El nombre del archivo se da como parámetro (*fileName*) en la URL. Se recibe en el objeto [`urlQuery`](../API/IncomingMessageClass.md#urlquery) en la petición. +El contenido binario del archivo se coloca en el cuerpo de la petición y se utiliza un verbo POST. El nombre del archivo se da como parámetro (*fileName*) en la URL. Se recibe en el objeto [`urlQuery`](../API/IncomingMessageClass.md#urlquery) en la petición. ```4d //UploadFile class @@ -336,4 +336,4 @@ Function uploadFile($request : 4D.IncomingMessage) : 4D.OutgoingMessage ## Ver también -[Perfect mastery of your back end business logic thanks to HTTP requests handlers](https://blog.4d.com/master-http-requests-with-4d-request-handlers/) (blog post) \ No newline at end of file +[Maestría de las peticiones HTTP con los gestores de peticiones 4D](https://blog.4d.com/master-http-requests-with-4d-request-handlers/) (entrada del blog) \ No newline at end of file From 8f292af0cb339b4c64b242a46b8434b9b4ca43e9 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Fri, 24 Oct 2025 00:59:35 +0200 Subject: [PATCH 55/57] New translations http-rules.md (Spanish) --- .../version-21/WebServer/http-rules.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/http-rules.md b/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/http-rules.md index c362533f28a3d9..4a997b5f1b63da 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/http-rules.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-21/WebServer/http-rules.md @@ -3,7 +3,7 @@ id: http-rules title: Reglas HTTP --- -You can define HTTP rules to control HTTP response headers for any requests received by the 4D web server, including REST requests. You can add, modify, or remove HTTP headers, send redirections or set the HTTP status. This feature is useful to implement security policies based upon the handling of headers. +Puede definir reglas HTTP para controlar los encabezados de respuesta HTTP para toda petición recibida por el servidor web 4D, incluyendo las peticiones REST. Puede añadir, modificar o eliminar los encabezados HTTP, enviar redirecciones o establecer el estado HTTP. This feature is useful to implement security policies based upon the handling of headers. To define HTTP rules, you just need to write some RegEx to declare the URL patterns you want to control, as well as how to modify response headers. You can set these rules using a `HTTPRules.json` file stored in the project folder, or using the *settings* parameter [`start()`](../API/WebServerClass.md#start) function of the web server object. @@ -82,7 +82,7 @@ Puede conocer las reglas actuales utilizando la propiedad [`.rules` del objeto W ``` var $rules : Collection -$rules:=WEB Server.rules //current rules +$rules:=WEB Server.rules //reglas actuales ``` ## Ejemplos From 6c8eab1133ea0eff900e33a7919206773b1bf2a4 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Fri, 24 Oct 2025 05:29:13 +0200 Subject: [PATCH 56/57] New translations http-request-handler.md (Spanish) --- .../current/WebServer/http-request-handler.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-request-handler.md b/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-request-handler.md index 5fa1e23208cd95..7a727201020ac8 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-request-handler.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/WebServer/http-request-handler.md @@ -75,30 +75,30 @@ Un manejador está definido por: - un patrón de URL a interceptar - una función y su clase donde se implementa el código para manejar el patrón URL escuchado -- the verbs with which the URL can be called to trigger the handler +- los verbos con los que se puede llamar a la URL para activar el gestor -The handler identifier is the couple [pattern + a verb among the verbs list]. +El identificador del gestor es la pareja [patrón + un verbo de la lista de verbos]. ### Patrones de la URL -URL patterns can be given as **prefixes** or using **regular expressions**. +Los patrones de URL pueden indicarse como **prefijos** o utilizando **expresiones regulares**. -- To declare a prefix pattern, use the "pattern" property name in the HTTPHandlers.json file. Los prefijos son considerados como expresiones regulares que ya contienen un `/` inicial y final. +- Para declarar un patrón de prefijo, utilice el nombre de propiedad "pattern" en el archivo HTTPHandlers.json. Los prefijos son considerados como expresiones regulares que ya contienen un `/` inicial y final. Ej: `"pattern": "docs"` o `"pattern": "docs/invoices"` -- To declare a regular expression pattern, use the "regexPattern" property name in the HTTPHandlers.json file. Los modelos de expresiones regulares se manejan directamente. +- Para declarar un patrón de expresión regular, utilice el nombre de propiedad "regexPattern" en el archivo HTTPHandlers.json. Los modelos de expresiones regulares se manejan directamente. Ej: `"regexPattern" : "/docs/.+/index\.html"` -"Pattern" and "regexPattern" properties cannot be used in the same handler definition (in this case, only the "regexPattern" property is taken into account). +Las propiedades "Pattern" y "regexPattern" no pueden utilizarse en la misma definición de gestor (en este caso, sólo se tiene en cuenta la propiedad "regexPattern"). -#### Concordancia de modelos +#### Correspondencia de modelos Los modelos de URL se activan en el orden indicado: - se ejecuta el primer modelo coincidente - los siguientes patrones no se ejecutan aunque coincidan con la URL -As a consequence, you need to apply a accurate strategy when writing your handlers: the most detailed patterns must be written before the more general patterns. +En consecuencia, debe aplicar una estrategia precisa al escribir sus gestores: los patrones más detallados deben escribirse antes que los patrones más generales. ```json [ @@ -126,7 +126,7 @@ As a consequence, you need to apply a accurate strategy when writing your handle #### Patrones prohibidos -URL patterns matching 4D built-in HTTP processing features are not allowed in custom HTTP handlers. Por ejemplo, los siguientes modelos no pueden ser manejados: +Los patrones URL que coincidan con las funciones de procesamiento HTTP integradas en 4D no están permitidos en los gestores HTTP personalizados. Por ejemplo, los siguientes modelos no pueden ser manejados: - `/4DACTION` - `/rest` @@ -135,7 +135,7 @@ URL patterns matching 4D built-in HTTP processing features are not allowed in cu ### Clase y método -You declare the code to be executed when a defined URL pattern is intercepted using the "class" and "method" properties. +Declare el código a ejecutar cuando se intercepte un patrón de URL definido utilizando las propiedades "class" y "method". - "class": nombre de la clase sin `cs.`, por ejemplo, "UsersHandling" para la clase usuario `cs.UsersHandling`. Debe ser una clase [**compartida**](../Concepts/classes.md#shared-singleton) y [**singleton**](../Concepts/classes.md#singleton-classes). - "method": función de clase perteneciente a la clase. @@ -144,19 +144,19 @@ You declare the code to be executed when a defined URL pattern is intercepted us ### Verbs -You can use the "verbs" property in the handler definition to declare HTTP verbs that are supported in incoming requests for this handler. A request that uses a verb that is not explicitely allowed is automatically rejected by the server. +Puede utilizar la propiedad "verbs" en la definición del manejador para declarar los verbos HTTP que se admiten en las peticiones entrantes para este manejador. Una solicitud que utiliza un verbo no permitido explícitamente es rechazada automáticamente por el servidor. -You can declare several verbs, separated by a comma. Los nombres de verbos no distinguen entre mayúsculas y minúsculas. +Puede declarar varios verbos, separados por una coma. Los nombres de verbos no distinguen entre mayúsculas y minúsculas. Ej: `"verbs" : "PUT, POST"` :::note -No control is done on verb names. Se pueden utilizar todos los nombres. +No se hace ningún control sobre los nombres de los verbos. Se pueden utilizar todos los nombres. ::: -By default, if the "verbs" property is not used for a handler, **all** HTTP verbs are supported in incoming requests for this handler (except those possibly used beforehand in a more detailed pattern, as shown in the example above). +Por defecto, si la propiedad "verbs" no se utiliza para un manejador, **todos** los verbos HTTP son soportados en las peticiones entrantes para este manejador (excepto aquellos posiblemente utilizados de antemano en un patrón más detallado, como se muestra en el ejemplo anterior). :::note @@ -246,11 +246,11 @@ Ejemplos de URL que activan los gestores personalizados: ### Configuración de funciones -The HTTP Request handler code must be implemented in a function of a [**Shared**](../Concepts/classes.md#shared-singleton) [**singleton class**](../Concepts/classes.md#singleton-classes). +El código del gestor de peticiones HTTP debe implementarse en una función de una clase [**Compartida**](../Concepts/classes.md#shared-singleton) [**clase singleton**](../Concepts/classes.md#singleton-classes). -If the singleton is missing or not shared, an error "Cannot find singleton" is returned by the server. If the class or the function [defined as handler](#handler-definition) in the HTTPHandlers.json file is not found, an error "Cannot find singleton function" is returned by the server. +Si el singleton no se encuentra o no está compartido, el servidor devuelve un error "No se puede encontrar singleton". Si la clase o la función [definida como manejador](#handler-definition) en el archivo HTTPHandlers.json no se encuentra, el servidor devuelve un error "No se puede encontrar la función singleton". -Request handler functions are not necessarily shared, unless some request handler properties are updated by the functions. En este caso, necesita declarar sus funciones con la [palabra clave 'shared'](../Concepts/classes.md#shared-functions). +Las funciones del gestor de peticiones no son necesariamente compartidas, a menos que algunas propiedades del gestor de peticiones sean actualizadas por las funciones. En este caso, necesita declarar sus funciones con la [palabra clave 'shared'](../Concepts/classes.md#shared-functions). :::note @@ -262,13 +262,13 @@ Request handler functions are not necessarily shared, unless some request handle Cuando una solicitud ha sido interceptada por el manejador, se recibe en el servidor como una instancia de la [clase 4D.IncomingMessage](../API/IncomingMessageClass.md). -All necessary information about the request are available in this object, including the request url, verb, headers, and, if any, parameters (put in the URL) and body. +Toda la información necesaria sobre la petición está disponible en este objeto, incluyendo la url de la petición, el verbo, los encabezados y, si los hay, los parámetros (puestos en la URL) y el cuerpo de la petición. -Then, the request handler can use this information to trigger appropriate business logic. +A continuación, el gestor de solicitudes puede utilizar esta información para activar la lógica de negocio adecuada. -### Output: an instance of the 4D.OutgoingMessage class +### Salida: una instancia de la clase 4D.OutgoingMessage -The request handler can return an object instance of the [4D.OutGoingMessage class](../API/OutgoingMessageClass.md), i.e. some full web content ready for a browser to handle, such as a file content. +El gestor de peticiones puede devolver una instancia de objeto de la clase [4D.OutGoingMessage](../API/OutgoingMessageClass.md), es decir, algún contenido web completo listo para que un navegador lo maneje, como un contenido de archivo. ### Ejemplo @@ -291,7 +291,7 @@ El archivo **HTTPHandlers.json**: La URL llamada es: http://127.0.0.1:8044/putFile?fileName=testFile -The binary content of the file is put in the body of the request and a POST verb is used. El nombre del archivo se da como parámetro (*fileName*) en la URL. Se recibe en el objeto [`urlQuery`](../API/IncomingMessageClass.md#urlquery) en la petición. +El contenido binario del archivo se coloca en el cuerpo de la petición y se utiliza un verbo POST. El nombre del archivo se da como parámetro (*fileName*) en la URL. Se recibe en el objeto [`urlQuery`](../API/IncomingMessageClass.md#urlquery) en la petición. ```4d //UploadFile class @@ -336,4 +336,4 @@ Function uploadFile($request : 4D.IncomingMessage) : 4D.OutgoingMessage ## Ver también -[Perfect mastery of your back end business logic thanks to HTTP requests handlers](https://blog.4d.com/master-http-requests-with-4d-request-handlers/) (blog post) \ No newline at end of file +[Maestría de las peticiones HTTP con los gestores de peticiones 4D](https://blog.4d.com/master-http-requests-with-4d-request-handlers/) (entrada del blog) \ No newline at end of file From 97e725a8d9a12a4cca143eee8cb75f1e62239337 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Fri, 24 Oct 2025 05:29:15 +0200 Subject: [PATCH 57/57] New translations http-request-handler.md (Spanish) --- .../WebServer/http-request-handler.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/WebServer/http-request-handler.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/WebServer/http-request-handler.md index 4b65edea626737..8ac073255275ca 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/WebServer/http-request-handler.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/WebServer/http-request-handler.md @@ -64,30 +64,30 @@ Un manejador está definido por: - un patrón de URL a interceptar - una función y su clase donde se implementa el código para manejar el patrón URL escuchado -- the verbs with which the URL can be called to trigger the handler +- los verbos con los que se puede llamar a la URL para activar el gestor -The handler identifier is the couple [pattern + a verb among the verbs list]. +El identificador del gestor es la pareja [patrón + un verbo de la lista de verbos]. ### Patrones de la URL -URL patterns can be given as **prefixes** or using **regular expressions**. +Los patrones de URL pueden indicarse como **prefijos** o utilizando **expresiones regulares**. -- To declare a prefix pattern, use the "pattern" property name in the HTTPHandlers.json file. Los prefijos son considerados como expresiones regulares que ya contienen un `/` inicial y final. +- Para declarar un patrón de prefijo, utilice el nombre de propiedad "pattern" en el archivo HTTPHandlers.json. Los prefijos son considerados como expresiones regulares que ya contienen un `/` inicial y final. Ej: `"pattern": "docs"` o `"pattern": "docs/invoices"` -- To declare a regular expression pattern, use the "regexPattern" property name in the HTTPHandlers.json file. Los modelos de expresiones regulares se manejan directamente. +- Para declarar un patrón de expresión regular, utilice el nombre de propiedad "regexPattern" en el archivo HTTPHandlers.json. Los modelos de expresiones regulares se manejan directamente. Ej: `"regexPattern" : "/docs/.+/index\.html"` -"Pattern" and "regexPattern" properties cannot be used in the same handler definition (in this case, only the "regexPattern" property is taken into account). +Las propiedades "Pattern" y "regexPattern" no pueden utilizarse en la misma definición de gestor (en este caso, sólo se tiene en cuenta la propiedad "regexPattern"). -#### Concordancia de modelos +#### Correspondencia de modelos Los modelos de URL se activan en el orden indicado: - se ejecuta el primer modelo coincidente - los siguientes patrones no se ejecutan aunque coincidan con la URL -As a consequence, you need to apply a accurate strategy when writing your handlers: the most detailed patterns must be written before the more general patterns. +En consecuencia, debe aplicar una estrategia precisa al escribir sus gestores: los patrones más detallados deben escribirse antes que los patrones más generales. ```json [ @@ -115,7 +115,7 @@ As a consequence, you need to apply a accurate strategy when writing your handle #### Patrones prohibidos -URL patterns matching 4D built-in HTTP processing features are not allowed in custom HTTP handlers. Por ejemplo, los siguientes modelos no pueden ser manejados: +Los patrones URL que coincidan con las funciones de procesamiento HTTP integradas en 4D no están permitidos en los gestores HTTP personalizados. Por ejemplo, los siguientes modelos no pueden ser manejados: - `/4DACTION` - `/rest` @@ -124,7 +124,7 @@ URL patterns matching 4D built-in HTTP processing features are not allowed in cu ### Clase y método -You declare the code to be executed when a defined URL pattern is intercepted using the "class" and "method" properties. +Declare el código a ejecutar cuando se intercepte un patrón de URL definido utilizando las propiedades "class" y "method". - "class": nombre de la clase sin `cs.`, por ejemplo, "UsersHandling" para la clase usuario `cs.UsersHandling`. Debe ser una clase [**compartida**](../Concepts/classes.md#shared-singleton) y [**singleton**](../Concepts/classes.md#singleton-classes). - "method": función de clase perteneciente a la clase. @@ -133,19 +133,19 @@ You declare the code to be executed when a defined URL pattern is intercepted us ### Verbs -You can use the "verbs" property in the handler definition to declare HTTP verbs that are supported in incoming requests for this handler. A request that uses a verb that is not explicitely allowed is automatically rejected by the server. +Puede utilizar la propiedad "verbs" en la definición del manejador para declarar los verbos HTTP que se admiten en las peticiones entrantes para este manejador. Una solicitud que utiliza un verbo no permitido explícitamente es rechazada automáticamente por el servidor. -You can declare several verbs, separated by a comma. Los nombres de verbos no distinguen entre mayúsculas y minúsculas. +Puede declarar varios verbos, separados por una coma. Los nombres de verbos no distinguen entre mayúsculas y minúsculas. Ej: `"verbs" : "PUT, POST"` :::note -No control is done on verb names. Se pueden utilizar todos los nombres. +No se hace ningún control sobre los nombres de los verbos. Se pueden utilizar todos los nombres. ::: -By default, if the "verbs" property is not used for a handler, **all** HTTP verbs are supported in incoming requests for this handler (except those possibly used beforehand in a more detailed pattern, as shown in the example above). +Por defecto, si la propiedad "verbs" no se utiliza para un manejador, **todos** los verbos HTTP son soportados en las peticiones entrantes para este manejador (excepto aquellos posiblemente utilizados de antemano en un patrón más detallado, como se muestra en el ejemplo anterior). :::note @@ -235,11 +235,11 @@ Ejemplos de URL que activan los gestores personalizados: ### Configuración de funciones -The HTTP Request handler code must be implemented in a function of a [**Shared**](../Concepts/classes.md#shared-singleton) [**singleton class**](../Concepts/classes.md#singleton-classes). +El código del gestor de peticiones HTTP debe implementarse en una función de una clase [**Compartida**](../Concepts/classes.md#shared-singleton) [**clase singleton**](../Concepts/classes.md#singleton-classes). -If the singleton is missing or not shared, an error "Cannot find singleton" is returned by the server. If the class or the function [defined as handler](#handler-definition) in the HTTPHandlers.json file is not found, an error "Cannot find singleton function" is returned by the server. +Si el singleton no se encuentra o no está compartido, el servidor devuelve un error "No se puede encontrar singleton". Si la clase o la función [definida como manejador](#handler-definition) en el archivo HTTPHandlers.json no se encuentra, el servidor devuelve un error "No se puede encontrar la función singleton". -Request handler functions are not necessarily shared, unless some request handler properties are updated by the functions. En este caso, necesita declarar sus funciones con la [palabra clave 'shared'](../Concepts/classes.md#shared-functions). +Las funciones del gestor de peticiones no son necesariamente compartidas, a menos que algunas propiedades del gestor de peticiones sean actualizadas por las funciones. En este caso, necesita declarar sus funciones con la [palabra clave 'shared'](../Concepts/classes.md#shared-functions). :::note @@ -251,13 +251,13 @@ Request handler functions are not necessarily shared, unless some request handle Cuando una solicitud ha sido interceptada por el manejador, se recibe en el servidor como una instancia de la [clase 4D.IncomingMessage](../API/IncomingMessageClass.md). -All necessary information about the request are available in this object, including the request url, verb, headers, and, if any, parameters (put in the URL) and body. +Toda la información necesaria sobre la petición está disponible en este objeto, incluyendo la url de la petición, el verbo, los encabezados y, si los hay, los parámetros (puestos en la URL) y el cuerpo de la petición. -Then, the request handler can use this information to trigger appropriate business logic. +A continuación, el gestor de solicitudes puede utilizar esta información para activar la lógica de negocio adecuada. -### Output: an instance of the 4D.OutgoingMessage class +### Salida: una instancia de la clase 4D.OutgoingMessage -The request handler can return an object instance of the [4D.OutGoingMessage class](../API/OutgoingMessageClass.md), i.e. some full web content ready for a browser to handle, such as a file content. +El gestor de peticiones puede devolver una instancia de objeto de la clase [4D.OutGoingMessage](../API/OutgoingMessageClass.md), es decir, algún contenido web completo listo para que un navegador lo maneje, como un contenido de archivo. ### Ejemplo @@ -280,7 +280,7 @@ El archivo **HTTPHandlers.json**: La URL llamada es: http://127.0.0.1:8044/putFile?fileName=testFile -The binary content of the file is put in the body of the request and a POST verb is used. El nombre del archivo se da como parámetro (*fileName*) en la URL. Se recibe en el objeto [`urlQuery`](../API/IncomingMessageClass.md#urlquery) en la petición. +El contenido binario del archivo se coloca en el cuerpo de la petición y se utiliza un verbo POST. El nombre del archivo se da como parámetro (*fileName*) en la URL. Se recibe en el objeto [`urlQuery`](../API/IncomingMessageClass.md#urlquery) en la petición. ```4d //UploadFile class @@ -325,4 +325,4 @@ Function uploadFile($request : 4D.IncomingMessage) : 4D.OutgoingMessage ## Ver también -[Perfect mastery of your back end business logic thanks to HTTP requests handlers](https://blog.4d.com/master-http-requests-with-4d-request-handlers/) (blog post) \ No newline at end of file +[Maestría de las peticiones HTTP con los gestores de peticiones 4D](https://blog.4d.com/master-http-requests-with-4d-request-handlers/) (entrada del blog) \ No newline at end of file