diff --git a/i18n/es/docusaurus-plugin-content-docs/current/API/CollectionClass.md b/i18n/es/docusaurus-plugin-content-docs/current/API/CollectionClass.md index fcc9101bc417fb..52e214a97ff15e 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/API/CollectionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/API/CollectionClass.md @@ -3148,12 +3148,13 @@ Soporte de fórmula -**.sort**() : Collection
**.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
**.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
**.sort**( *ascOrDesc* : Integer ) : Collection
**.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
**.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection | Parámetros | Tipo | | Descripción | | ---------- | --------------------------- | :-------------------------: | --------------------- | +| ascOrDesc | Integer | -> | Ejemplo 1 | | formula | 4D.Function | -> | Objeto fórmula | | methodName | Text | -> | Nombre de un método | | extraParam | any | -> | Parámetros del método | @@ -3167,7 +3168,19 @@ La función `.sort()` ordena los elemento > Esta función modifica la colección original. -Si se llama a `.sort()` sin parámetros, sólo se ordenan los valores escalares (número, texto, fecha, booleanos). Los elementos se ordenan por defecto de forma ascendente, según su tipo. Si la colección contiene elementos de diferentes tipos, se agrupan primero por tipo y se ordenan después. Si attributePath lleva a una propiedad de objeto que contiene valores de diferentes tipos, primero se agrupan por tipo y se ordenan después. +Si se llama a `.sort()` sin parámetros, sólo se ordenan los valores escalares (número, texto, fecha, booleanos). Los elementos se ordenan por defecto de forma ascendente, según su tipo. +You can also pass one of the following constants in the *ascOrDesc* parameter: + +``` +|Constant| Type|Value|Comment| +|---|---|---|---| +|ck ascending|Integer|0|Elements are ordered in ascending order (default)| +|ck descending|Integer|1|Elements are ordered in descending order| + +This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). +``` + +Si la colección contiene elementos de diferentes tipos, se agrupan primero por tipo y se ordenan después. Si attributePath lleva a una propiedad de objeto que contiene valores de diferentes tipos, primero se agrupan por tipo y se ordenan después. 1. null 2. booleans diff --git a/i18n/es/docusaurus-plugin-content-docs/current/API/SessionClass.md b/i18n/es/docusaurus-plugin-content-docs/current/API/SessionClass.md index 316f5d2393ffd9..86b5ab5c80bb34 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/API/SessionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/API/SessionClass.md @@ -54,9 +54,10 @@ La disponibilidad de las propiedades y funciones del objeto `Session` depende de
Historia -| Lanzamiento | Modificaciones | -| ----------- | -------------- | -| 18 R6 | Añadidos | +| Lanzamiento | Modificaciones | +| ----------- | -------------------------- | +| 21 | Support of remote sessions | +| 18 R6 | Añadidos |
@@ -74,7 +75,7 @@ La disponibilidad de las propiedades y funciones del objeto `Session` depende de :::note -Esta función no hace nada y siempre devuelve **True** con cliente remoto, procedimiento almacenado y sesiones independientes. +This function does nothing and always returns **True** with stored procedure sessions and standalone sessions. ::: @@ -88,6 +89,8 @@ Esta función no elimina los **privilegios promovidos** del proceso web, tanto s ::: +Regarding remote client sessions, the function only impacts [code accessing the web server](../WebServer/preemptiveWeb.md#writing-thread-safe-web-server-code). + #### Ejemplo ```4d @@ -107,9 +110,10 @@ $isGuest:=Session.isGuest() //$isGuest es True
Historia -| Lanzamiento | Modificaciones | -| ----------- | -------------- | -| 20 R9 | Añadidos | +| Lanzamiento | Modificaciones | +| ----------- | -------------------------- | +| 21 | Support of remote sessions | +| 20 R9 | Añadidos |
@@ -120,7 +124,7 @@ $isGuest:=Session.isGuest() //$isGuest es True | Parámetros | Tipo | | Descripción | | ---------- | ------- | :-------------------------: | --------------------------------------------------- | | lifespan | Integer | -> | Duración de la vida del token de sesión en segundos | -| Resultado | Text | <- | UUID de la sesión | +| Resultado | Text | <- | UUID of the token | @@ -128,7 +132,7 @@ $isGuest:=Session.isGuest() //$isGuest es True :::note -Esta función solo está disponible con sesiones usuario web. Devuelve una cadena vacía en otros contextos. +This function is available with web user sessions and remote sessions. It returns an empty string in stored procedure and standalone sessions. ::: @@ -136,9 +140,14 @@ La función `.createOTP()` crea un Para más información sobre los tokens OTP, por favor consulte [esta sección](../WebServer/sessions.md#session-token-otp). -Por defecto, si se omite el parámetro *lifespan*, el token se crea con el mismo tiempo de vida que el [`.idleTimeOut`](#idletimeout) de la sesión. Puede definir un tiempo de espera personalizado pasando un valor en segundos en *lifespan*. Si se utiliza un token caducado para restaurar una sesión de usuario web, se ignora. +Puede definir un tiempo de espera personalizado pasando un valor en segundos en *lifespan*. If an expired token is used to restore a session, it is ignored. By default, if the *lifespan* parameter is omitted: + +- with web user sessions, the token is created with the same lifespan as the [`.idleTimeOut`](#idletimeout) of the session. +- with remote sessions, the token is created with a 10 seconds lifespan. -El token devuelto puede ser utilizado en intercambios con aplicaciones de terceros o sitios web para identificar la sesión de forma segura. Por ejemplo, el token OTP de sesión se puede utilizar con una aplicación de pago. +For **web user sessions**, the returned token can be used in exchanges with third-party applications or websites to securely identify the session. Por ejemplo, el token OTP de sesión se puede utilizar con una aplicación de pago. + +For **remote sessions**, the returned token can be used on 4D Server to identitfy requests coming from a [remote 4D running Qodly forms in a Web area](../Desktop/clientServer.md#remote-user-sessions). #### Ejemplo @@ -253,9 +262,10 @@ $expiration:=Session.expirationDate //eg "2021-11-05T17:10:42Z"
Historia -| Lanzamiento | Modificaciones | -| ----------- | -------------- | -| 20 R6 | Añadidos | +| Lanzamiento | Modificaciones | +| ----------- | --------------------------------- | +| 21 | Support of remote client sessions | +| 20 R6 | Añadidos |
@@ -279,7 +289,9 @@ Esta función devuelve los privilegios asignados a una Sesión utilizando única ::: -Con clientes remotos, procedimientos almacenados y sesiones independientes, esta función devuelve una colección que sólo contiene "WebAdmin". +With remote client sessions, the privileges only concerns the code executed in the context of a [web request sent through a Web area](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). + +With stored procedure sessions and standalone sessions, this function returns a collection only containing "WebAdmin". #### Ejemplo @@ -348,10 +360,10 @@ $privileges := Session.getPrivileges()
Historia -| Lanzamiento | Modificaciones | -| ----------- | --------------------------------------------- | -| 21 | Devuelve True para los privilegios promovidos | -| 18 R6 | Añadidos | +| Lanzamiento | Modificaciones | +| ----------- | ----------------------------------------------------------------------- | +| 21 | Returns True for promoted privileges, Support of remote client sessions | +| 18 R6 | Añadidos |
@@ -376,7 +388,9 @@ Esta función devuelve True para el *privilegio* si se llama desde una función ::: -Con cliente remoto, procedimientos almacenados y sesiones independientes, esta función siempre devuelve True, sea cual sea el *privilege*. +Regarding remote client sessions, the function only impacts [code accessing the web server](../WebServer/preemptiveWeb.md#writing-thread-safe-web-server-code). + +With stored procedure sessions and standalone sessions, this function always returns True, whatever the *privilege*. #### Ejemplo @@ -717,6 +731,7 @@ Function callback($request : 4D.IncomingMessage) : 4D.OutgoingMessage | Lanzamiento | Modificaciones | | ----------- | --------------------------------------------------- | +| 21 | Support of remote client sessions | | 19 R8 | Compatibilidad con la propiedad "roles" en Settings | | 18 R6 | Añadidos | @@ -739,23 +754,21 @@ Function callback($request : 4D.IncomingMessage) : 4D.OutgoingMessage :::note -Esta función no hace nada y siempre devuelve **False** con cliente remoto, procedimiento almacenado y sesiones independientes. +This function does nothing and always returns **False** with stored procedure sessions and standalone sessions. ::: La función `.setPrivileges()` asocia a la sesión los privilegios y/o roles definidos en el parámetro y devuelve **True** si la ejecución se ha realizado correctamente. - En el parámetro *privilege*, pase una cadena que contenga un nombre de privilegio (o varios nombres de privilegio separados por comas). - - En el parámetro *privileges*, pase una colección de cadenas que contengan nombres de privilegios. - - En el parámetro *settings*, pase un objeto que contenga las siguientes propiedades: -| Propiedad | Tipo | Descripción | -| ---------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------- | -| privileges | Text o Collection |
  • Cadena que contiene un nombre de privilegio, o
  • Colección de cadenas que contienen nombres de privilegios
  • | -| roles | Text o Collection |
  • Cadena que contiene un rol, o
  • Colección de cadenas que contienen roles
  • | -| userName | Text | Nombre de usuario para asociar a la sesión (opcional) | +| Propiedad | Tipo | Descripción | +| ---------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| privileges | Text o Collection |
  • Cadena que contiene un nombre de privilegio, o
  • Colección de cadenas que contienen nombres de privilegios
  • | +| roles | Text o Collection |
  • Cadena que contiene un rol, o
  • Colección de cadenas que contienen roles
  • | +| userName | Text | User name to associate to the session (optional, web sessions only). Not available in remote client sessions (ignored). | :::note @@ -769,6 +782,8 @@ Por defecto, cuando no hay ningún privilegio o rol asociado a la sesión, la se La propiedad [`userName`](#username) está disponible a nivel de objeto de sesión (sólo lectura). +Regarding remote client sessions, the function only concerns the code executed in the context of a [web request sent through a Web area](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). + #### Ejemplo En un método de autenticación personalizado, se establece el privilegio "WebAdmin" para el usuario: diff --git a/i18n/es/docusaurus-plugin-content-docs/current/Desktop/clientServer.md b/i18n/es/docusaurus-plugin-content-docs/current/Desktop/clientServer.md index cd3931491d7495..718494ca0cb1f5 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/Desktop/clientServer.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/Desktop/clientServer.md @@ -89,11 +89,19 @@ Sin embargo, debe prestar atención a las siguientes diferencias de comportamien En el servidor, el comando [`Session`](../commands/session.md) devuelve un objeto `session` que describe la sesión de usuario actual. Este objeto se maneja a través de las funciones y propiedades de la [clase `Session`](../API/SessionClass.md). +:::tip Entradas de blog relacionadas + +[Objeto sesión remota 4D con conexión cliente/servidor y procedimiento almacenado](https://blog.4d.com/new-4D-remote-session-object-with-client-server-connection-and-stored-procedure). + +::: + ### Utilización -El objeto `session` permite obtener información sobre la sesión del usuario remoto. Puede compartir datos entre todos los procesos de la sesión del usuario utilizando el objeto compartido [`session.storage`](../API/SessionClass.md#storage). +The `session` object allows you to handle information and privileges for the remote user session. + +Puede compartir datos entre todos los procesos de la sesión del usuario utilizando el objeto compartido [`session.storage`](../API/SessionClass.md#storage). Por ejemplo, puede iniciar un procedimiento de autenticación y verificación de usuario cuando un cliente se conecta al servidor, que involucra ingresar un código enviado por correo electrónico o SMS en la aplicación. A continuación, añada la información de usuario al almacenamiento de sesión, permitiendo al servidor identificar al usuario. De este modo, el servidor 4D puede acceder a la información del usuario para todos los procesos del cliente, lo que permite escribir código personalizado según el rol del usuario. -Por ejemplo, puede iniciar un procedimiento de autenticación y verificación de usuario cuando un cliente se conecta al servidor, que involucra ingresar un código enviado por correo electrónico o SMS en la aplicación. A continuación, añada la información de usuario al almacenamiento de sesión, permitiendo al servidor identificar al usuario. De este modo, el servidor 4D puede acceder a la información del usuario para todos los procesos del cliente, lo que permite escribir código personalizado según el rol del usuario. +You can also assign privileges to a remote user session to control access when the session comes from Qodly pages running in web areas. ### Disponibilidad @@ -110,7 +118,60 @@ Todos los procedimientos almacenados en el servidor comparten la misma sesión d ::: -### Ver también (entrada de blog) +### Sharing the session with Qodly pages in Web areas -[Objeto sesión remota 4D con conexión cliente/servidor y procedimiento almacenado](https://blog.4d.com/new-4D-remote-session-object-with-client-server-connection-and-stored-procedure). +Remote client sessions can be used to handle Client/Server applications where [Qodly pages](https://developer.4d.com/qodly/4DQodlyPro/pageLoaders/pageLoaderOverview) are used for the interface, running on remote machines. With this configuration, your applications have modern CSS-based web interfaces but still benefit from the power and simplicity of integrated client/server development. In such applications, Qodly pages are executed within standard 4D [Web areas](../FormObjects/webArea_overview.md). + +To manage this configuration, you need to use remote client sessions. Actually, requests coming from both the remote 4D application and its Qodly pages loaded in Web areas need to work inside a single user session. You just have to share the same session between the remote client and its web pages so that you can have the same [session storage](../API/SessionClass.md#storage) and client license, whatever the request origin. + +Note that [privileges](../ORDA/privileges.md) should be set in the session before executing a web request from a Web area, so that the user automatically gets their privileges for web access (see example). Keep in mind that privileges only apply to requests coming from the web, not to the 4D code executed in a standard remote session. + +Shared sessions are handled through [OTP tokens](../WebServer/sessions.md#session-token-otp). After you created an OTP token on the server for the user session, you add the token (through the `$4DSID` parameter value) to web requests sent from web areas containing Qodly pages so that the user session on the server is identified and shared. On the web server side, if a web request contains an *OTP id* in the $4DSID parameter, the session corresponding to this OTP token is used. + +:::tip Entrada de blog relacionada + +[Share your 4D remote client session with web accesses](https://blog.4d.com/share-your-4d-remote-client-session-with-web-accesses) + +::: + +#### Ejemplo + +```4d +var $otp : Text + +// Some privileges are put in the remote user session on the server for a further web access +ds.resetPrivileges("basic") + +// An OTP is created on the server for this remote client session +$otp:=ds.getOTP() + + +// The user has already the required privileges for a web access +// and the same session is shared between this remote user and the web Qodly app +WA OPEN URL(*; "Welcome"; "http://127.0.0.1/$lib/renderer/?w=People&$4DSID="+$otp) + +``` + +*resetPrivileges()* function in the Datastore class: + +```4d +// This function is run on the server +// and puts some privileges in the session for a further web access + +exposed Function resetPrivileges($priv : Text) + + Session.clearPrivileges() + Session.setPrivileges($priv) +``` + +*getOTP()* function in the Datastore class: + +```4d +// This function is run on the server +// and generates an OTP able to retrieve this remote user session +exposed Function getOTP(): Text + + return Session.createOTP() + +``` 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 774528e17a71d6..1e8d7f1d484780 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/Notes/updates.md @@ -12,6 +12,7 @@ Lea [**Novedades en 4D 21**](https://blog.4d.com/en-whats-new-in-4d-21/), la ent - 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. - 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. +- In client/server applications, use Qodly pages in Web areas and [share the remote client session](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). - 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). diff --git a/i18n/es/docusaurus-plugin-content-docs/current/ORDA/privileges.md b/i18n/es/docusaurus-plugin-content-docs/current/ORDA/privileges.md index 170f48002e2034..2e61015157e2aa 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/ORDA/privileges.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/ORDA/privileges.md @@ -17,9 +17,11 @@ Si un usuario intenta ejecutar una acción y no tiene los derechos de acceso ade ![schema](../assets/en/ORDA/privileges-schema.png) -### Ver también +:::tip Related Blog posts -Para una descripción detallada de toda la arquitectura de permisos, por favor lea el blog [**Filtrar acceso a sus datos con un sistema completo de permisos**](https://blog.4d.com/filter-access-to-your-data-with-a-complete-system-of-permissions/). +[**Filter access to your data with a complete system of permissions**](https://blog.4d.com/filter-access-to-your-data-with-a-complete-system-of-permissions/) + +::: ## Resources @@ -122,7 +124,7 @@ El archivo por defecto tiene el siguiente contenido: { "privileges": [ { - "privilege": "none", + "privilege": "all", "includes": [] } ], @@ -134,12 +136,12 @@ El archivo por defecto tiene el siguiente contenido: { "applyTo": "ds", "type": "datastore", - "read": ["none"], - "create": ["none"], - "update": ["none"], - "drop": ["none"], - "execute": ["none"], - "promote": ["none"] + "read": ["all"], + "create": ["all"], + "update": ["all"], + "drop": ["all"], + "execute": ["all"], + "promote": ["all"] } ] }, @@ -150,7 +152,8 @@ El archivo por defecto tiene el siguiente contenido: ``` -Para un nivel de seguridad más alto, el privilegio "none" se asigna a todos los permisos en el datastore, por lo tanto el acceso de datos en todo el objeto `ds` está deshabilitado por defecto. Se recomienda no modificar ni utilizar este privilegio de bloqueo, sino agregar permisos específicos a cada recurso que desee poner a disposición desde solicitudes web o REST ([ver ejemplo a continuación](#example-of-privilege-configuration)). +For a highest level of security, the "all" privilege is assigned to all permissions in the datastore, thus data access on the whole `ds` object is disabled by default. The principle is as follows: assigning a permission is like putting a lock on a door. Only sessions with privilege having the corresponding key (i.e., a permission) will be able to open the lock. +Se recomienda no modificar ni utilizar este privilegio de bloqueo, sino agregar permisos específicos a cada recurso que desee poner a disposición desde solicitudes web o REST ([ver ejemplo a continuación](#example-of-privilege-configuration)). :::caution @@ -264,14 +267,14 @@ End if ## Ejemplo de configuración de privilegios -La buena práctica es mantener todos los datos bloqueados por defecto gracias al privilegio "none" y configurar el archivo `roles.json` para abrir sólo las partes controladas a las sesiones autorizadas. Por ejemplo, para permitir algunos accesos a sesiones invitadas: +The good practice is to keep all data access locked by default thanks to the "all" privilege and to configure the `roles.json` file to only open controlled parts to authorized sessions. For example, to allow some accesses to "guest" sessions: ```json title="/Project/Sources/roles.json" { "privileges": [ { - "privilege": "none", + "privilege": "all", "includes": [] } ], @@ -282,22 +285,22 @@ La buena práctica es mantener todos los datos bloqueados por defecto gracias al "applyTo": "ds", "type": "datastore", "read": [ - "none" + "all" ], "create": [ - "none" + "all" ], "update": [ - "none" + "all" ], "drop": [ - "none" + "all" ], "execute": [ - "none" + "all" ], "promote": [ - "none" + "all" ] }, { diff --git a/i18n/es/docusaurus-plugin-content-docs/current/WebServer/sessions.md b/i18n/es/docusaurus-plugin-content-docs/current/WebServer/sessions.md index fe9326d7a213cd..b2a3a87835a17c 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/WebServer/sessions.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/WebServer/sessions.md @@ -213,6 +213,12 @@ El servidor web 4D le permite generar, compartir y utilizar tokens de sesión OT In 4D, OTP session tokens are useful when calling external URLs and being called back in another browser or device (mobile/computer). Typically, a third-party application sends a confirmation email containing a callback link on which the user has to click. The callback link includes the OTP token, so that the session which triggered the callback is loaded along with its data and privileges. This principle allows you to share the same session on multiple devices. Gracias a esta arquitectura, la [cookie de sesión](#session-implementation) no está expuesta en la red, lo que elimina el riesgo de un ataque de hombre en el medio. +:::tips Entradas de blog relacionadas + +[Connect Your Web Apps to Third-Party Systems](https://blog.4d.com/connect-your-web-apps-to-third-party-systems/) + +::: + ### Generalidades La secuencia básica de uso de un testigo de sesión OTP en una aplicación web 4D es la siguiente: @@ -477,8 +483,4 @@ Un testigo de sesión tiene una vida útil, y la propia sesión tiene una vida Una sesión solo se restaura mediante un token si tanto la vida útil del token de sesión como la vida útil de la sesión no han expirado. En otros casos (el testigo de sesión ha caducado y/o la propia sesión ha caducado), se crea una sesión de invitado cuando se recibe una petición web con un testigo de sesión. -:::note - -Para obtener más información, consulte la entrada de blog [Conecte sus aplicaciones web a sistemas de terceros](https://blog.4d.com/connect-your-web-apps-to-third-party-systems/). -::: \ No newline at end of file diff --git a/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md b/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md index f1e97463ac8b55..edea85da744251 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md @@ -65,30 +65,42 @@ $chatHelper.reset() // Clear all previous messages and tools ### registerTool() -**registerTool**(*tool* : Object; *handler* : 4D.Function) +**registerTool**(*tool* : Object; *handler* : Object) -| Parámetros | Tipo | Descripción | -| ---------- | --------------------------- | ---------------------------------------------------------------------------------------- | -| *tool* | Object | The tool definition object (or [OpenAITool](OpenAITool.md) instance) | -| *handler* | 4D.Function | The function to handle tool calls (optional if defined inside *tool*) | +| Parámetros | Tipo | Descripción | +| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| *tool* | Object | The tool definition object (or [OpenAITool](OpenAITool.md) instance) | +| *handler* | Object | The function to handle tool calls ([4D.Function](../../API/FunctionClass.md) or Object), optional if defined inside *tool* as *handler* property | Registers a tool with its handler function for automatic tool call handling. -If the handler is not provided, the tool's `handler` property will be used. + +The *handler* parameter can be: + +- A **4D.Function**: Direct handler function +- An **Object**: An object containing a `formula` property matching the tool function name The handler function receives an object containing the parameters passed from the OpenAI tool call. This object contains key-value pairs where the keys match the parameter names defined in the tool's schema, and the values are the actual arguments provided by the AI model. #### Register Tool Example ```4D -// Define a simple tool +// Example 1: Simple registration with direct handler var $tool:={type: "function"; function: {name: "get_weather"; description: "Get current weather"; parameters: {type: "object"; properties: {location: {type: "string"; description: "City name"}}}}} - -// Define a handler function that receives an argument { location: "a city" } var $handler:=Formula(return "Sunny, 25°C in "+$1.location) $chatHelper.registerTool($tool; $handler) -// or + +// Example 2: Tool with handler property (no second parameter needed) +var $tool:={name: "calculate"; description: "Perform calculations"; handler: Formula(return String(Num($1.expression)))} +$chatHelper.registerTool($tool) + +// Example 3: Using object notation $chatHelper.registerTool({tool: $tool; handler: $handler}) + +// Example 4: Handler as object with formula matching tool name +var $tool:={name: "getTime"; description: "Get current time"} +var $handlerObj:=cs.MyTimeTool.new() // class with a getTime function +$chatHelper.registerTool($tool; $handlerObj) ``` ### registerTools() @@ -99,34 +111,64 @@ $chatHelper.registerTool({tool: $tool; handler: $handler}) | ------------------- | ------- | -------------------------------------------------------- | | *toolsWithHandlers* | Variant | Object or Collection containing tools and their handlers | -Registers multiple tools at once. The parameter can be either an object with function names as keys, or a collection of tool objects. +Registers multiple tools at once. The parameter can be: + +- **Collection**: Array of tool objects (with handlers embedded or separate) +- **Object**: Object with function names as keys mapping to tool definitions +- **Object with `tools` attribute**: Object containing a `tools` collection and formula properties matching tool names #### Register Multiple Tools Example -```4D -// Simple approach: handlers defined directly in tools -var $weatherTool:={type: "function"; function: {name: "get_weather"; description: "Get current weather"; parameters: {type: "object"; properties: {location: {type: "string"; description: "City name"}}}}; \ - handler: Formula(return "Sunny, 25°C in "+$1.location)} -var $calculatorTool:={type: "function"; function: {name: "calculate"; description: "Perform calculations"; parameters: {type: "object"; properties: {expression: {type: "string"; description: "Math expression"}}}}; \ - handler: Formula(return String(Num($1.expression)))} +##### Example 1: Collection format with handlers in tools -var $tools:={} -$tools.get_weather:=$weatherTool -$tools.calculate:=$calculatorTool - -$chatHelper.registerTools($tools) +```4D +var $weatherTool:={name: "getWeather"; description: "Get current weather"; handler: Formula(return "Sunny, 25°C in "+$1.location)} +var $calculatorTool:={name: "calculate"; description: "Perform calculations"; handler: Formula(return String(Num($1.expression)))} -// Using collection format $chatHelper.registerTools([$weatherTool; $calculatorTool]) +``` -// Alternative: separate tool definitions from handlers (useful for better code organization) +##### Example 2: Object format with separate tool and handler + +```4D var $toolsWithSeparateHandlers:={} -$toolsWithSeparateHandlers.get_weather:={tool: $weatherToolDefinition; handler: $weatherHandler} +$toolsWithSeparateHandlers.getWeather:={tool: $weatherToolDefinition; handler: $weatherHandler} $toolsWithSeparateHandlers.calculate:={tool: $calculatorToolDefinition; handler: $calculatorHandler} $chatHelper.registerTools($toolsWithSeparateHandlers) ``` +##### Example 3: Object with tools collection attribute and formula properties + +MyTools class: + +```4D + +Class constructor + this.tools:=[{name: "getWeather"; description: "Get current weather"}; \ + {name: "getTime"; description: "Get current time"}] // Collection of tool definitions + +Function getWeather($parameters: Object) + return "Sunny, 25°C" + +Function getTime($parameters: Object) + return String(Current time) +``` + +```4D +$chatHelper.registerTools(cs.MyTools.new()) +``` + +##### Example 4: Simple object format with tools as properties + +```4D +var $tools:={} +$tools.getWeather:=$weatherTool // Tool with handler property +$tools.calculate:=$calculatorTool // Tool with handler property + +$chatHelper.registerTools($tools) +``` + ### unregisterTool() **unregisterTool**(*functionName* : Text) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/commands/session.md b/i18n/es/docusaurus-plugin-content-docs/current/commands/session.md index 0a3afd2bb9e93f..c7a55da29c5d8a 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/commands/session.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/commands/session.md @@ -57,6 +57,7 @@ El objeto `Session` de las sesiones cliente remotas está disponible desde: - Métodos proyecto que tienen el atributo [Ejecutar en el Servidor](../Project/code-overview.md#execute-on-server) (se ejecutan en el proceso "twinned" del proceso cliente), - Triggers, +- ORDA [funciones del modelo de datos](../ORDA/ordaClasses.md) (excepto las declaradas con la palabra clave [`local`](../ORDA/ordaClasses.md#local-functions), - Los métodos base `On Server Open Connection` y `On Server Shutdown Connection` de la base de datos. Para más información sobre las sesiones usuario remoto, por favor consulte el párrafo [**Sesiones usuario cliente remoto**](../Desktop/clientServer.md#remote-user-sessions). diff --git a/i18n/es/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md b/i18n/es/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md index 46d751b0ae0dd7..06e3a6417575d3 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md @@ -2502,24 +2502,33 @@ Con el siguiente método *NumberGreaterThan0*: -**.sort**() : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection | Parámetros | Tipo | | Descripción | | ---------- | ---------- |:--:| ---------------------------------------------------------------------- | +| ascOrDesc | Integer | -> | `ck ascending` o `ck descending` (valores escalares) | | methodName | Text | -> | Nombre del método utilizado para especificar el orden de clasificación | | extraParam | any | -> | Parámetros del método | -| Resultado | Collection | <- | Colección original ordenada| - -| +| Resultado | Collection | <- | La nueva colección | + #### Descripción La función `.orderBy()` ordena los elementos de la colección original y también devuelve la colección ordenada. > Esta función modifica la colección original. -Si se llama a `.sort()` sin parámetros, sólo se ordenan los valores escalares (número, texto, fecha, booleanos). Los elementos se ordenan por defecto de forma ascendente, según su tipo. Si la colección contiene elementos de diferentes tipos, se agrupan primero por tipo y se ordenan después. Si *attributePath* lleva a una propiedad de objeto que contiene valores de diferentes tipos, primero se agrupan por tipo y se ordenan después. +Si se llama a `.sort()` sin parámetros, sólo se ordenan los valores escalares (número, texto, fecha, booleanos). Los elementos se ordenan por defecto de forma ascendente, según su tipo. You can also pass one of the following constants in the *ascOrDesc* parameter: + + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + + Si la colección contiene elementos de diferentes tipos, se agrupan primero por tipo y se ordenan después. Si *attributePath* lleva a una propiedad de objeto que contiene valores de diferentes tipos, primero se agrupan por tipo y se ordenan después. 1. null 2. booleans diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md index fcc9101bc417fb..de25918e361018 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md @@ -3148,12 +3148,13 @@ Soporte de fórmula -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection | Parámetros | Tipo | | Descripción | | ---------- | --------------------------- | :-------------------------: | --------------------- | +| ascOrDesc | Integer | -> | Ejemplo 1 | | formula | 4D.Function | -> | Objeto fórmula | | methodName | Text | -> | Nombre de un método | | extraParam | any | -> | Parámetros del método | @@ -3167,7 +3168,19 @@ La función `.sort()` ordena los elemento > Esta función modifica la colección original. -Si se llama a `.sort()` sin parámetros, sólo se ordenan los valores escalares (número, texto, fecha, booleanos). Los elementos se ordenan por defecto de forma ascendente, según su tipo. Si la colección contiene elementos de diferentes tipos, se agrupan primero por tipo y se ordenan después. Si attributePath lleva a una propiedad de objeto que contiene valores de diferentes tipos, primero se agrupan por tipo y se ordenan después. +Si se llama a `.sort()` sin parámetros, sólo se ordenan los valores escalares (número, texto, fecha, booleanos). Los elementos se ordenan por defecto de forma ascendente, según su tipo. +You can also pass one of the following constants in the *ascOrDesc* parameter: + + ``` + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + ``` + +Si la colección contiene elementos de diferentes tipos, se agrupan primero por tipo y se ordenan después. Si attributePath lleva a una propiedad de objeto que contiene valores de diferentes tipos, primero se agrupan por tipo y se ordenan después. 1. null 2. booleans diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md index c9b917d7e87c0f..f9fd60a5858123 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md @@ -120,7 +120,7 @@ $isGuest:=Session.isGuest() //$isGuest es True | Parámetros | Tipo | | Descripción | | ---------- | ------- | :-------------------------: | --------------------------------------------------- | | lifespan | Integer | -> | Duración de la vida del token de sesión en segundos | -| Resultado | Text | <- | UUID de la sesión | +| Resultado | Text | <- | UUID of the OTP token | diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md index fcc9101bc417fb..de25918e361018 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md @@ -3148,12 +3148,13 @@ Soporte de fórmula -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection | Parámetros | Tipo | | Descripción | | ---------- | --------------------------- | :-------------------------: | --------------------- | +| ascOrDesc | Integer | -> | Ejemplo 1 | | formula | 4D.Function | -> | Objeto fórmula | | methodName | Text | -> | Nombre de un método | | extraParam | any | -> | Parámetros del método | @@ -3167,7 +3168,19 @@ La función `.sort()` ordena los elemento > Esta función modifica la colección original. -Si se llama a `.sort()` sin parámetros, sólo se ordenan los valores escalares (número, texto, fecha, booleanos). Los elementos se ordenan por defecto de forma ascendente, según su tipo. Si la colección contiene elementos de diferentes tipos, se agrupan primero por tipo y se ordenan después. Si attributePath lleva a una propiedad de objeto que contiene valores de diferentes tipos, primero se agrupan por tipo y se ordenan después. +Si se llama a `.sort()` sin parámetros, sólo se ordenan los valores escalares (número, texto, fecha, booleanos). Los elementos se ordenan por defecto de forma ascendente, según su tipo. +You can also pass one of the following constants in the *ascOrDesc* parameter: + + ``` + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + ``` + +Si la colección contiene elementos de diferentes tipos, se agrupan primero por tipo y se ordenan después. Si attributePath lleva a una propiedad de objeto que contiene valores de diferentes tipos, primero se agrupan por tipo y se ordenan después. 1. null 2. booleans diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md index 063efcfdc668e1..1f4dd660afc52d 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md @@ -117,7 +117,7 @@ $isGuest:=Session.isGuest() //$isGuest es True | Parámetros | Tipo | | Descripción | | ---------- | ------- | :-------------------------: | --------------------------------------------------- | | lifespan | Integer | -> | Duración de la vida del token de sesión en segundos | -| Resultado | Text | <- | UUID de la sesión | +| Resultado | Text | <- | UUID of the OTP token | diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md index 1d782b117b0b2b..589ce2c5986e0a 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md @@ -3249,19 +3249,18 @@ Quiere saber si al menos un valor de la colección es >0. -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection -| Parámetros | Tipo | | Descripción | -| ---------- | ----------- |:--:| ------------------------------------------------------ | -| formula | 4D.Function | -> | Objeto fórmula | -| methodName | Text | -> | Nombre de un método | -| extraParam | any | -> | Parámetros del método | -| Resultado | Collection | <- | Colección original ordenada| - - -| +| Parámetros | Tipo | | Descripción | +| ---------- | ----------- |:--:| ---------------------------------------------------- | +| ascOrDesc | Integer | -> | `ck ascending` o `ck descending` (valores escalares) | +| formula | 4D.Function | -> | Objeto fórmula | +| methodName | Text | -> | Nombre de un método | +| extraParam | any | -> | Parámetros del método | +| Resultado | Collection | <- | La nueva colección | + #### Descripción @@ -3269,7 +3268,16 @@ Quiere saber si al menos un valor de la colección es >0. La función `.orderBy()` ordena los elementos de la colección original y también devuelve la colección ordenada . > Esta función modifica la colección original. -Si se llama a `.sort()` sin parámetros, sólo se ordenan los valores escalares (número, texto, fecha, booleanos). Los elementos se ordenan por defecto de forma ascendente, según su tipo. Si la colección contiene valores escalares de diferentes tipos, se agrupan primero por tipo y se ordenan después. Si *attributePath* lleva a una propiedad de objeto que contiene valores de diferentes tipos, primero se agrupan por tipo y se ordenan después. +Si se llama a `.sort()` sin parámetros, sólo se ordenan los valores escalares (número, texto, fecha, booleanos). Los elementos se ordenan por defecto de forma ascendente, según su tipo. You can also pass one of the following constants in the *ascOrDesc* parameter: + + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + + Si la colección contiene elementos de diferentes tipos, se agrupan primero por tipo y se ordenan después. Si *attributePath* lleva a una propiedad de objeto que contiene valores de diferentes tipos, primero se agrupan por tipo y se ordenan después. 1. null 2. booleans diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/API/CollectionClass.md b/i18n/fr/docusaurus-plugin-content-docs/current/API/CollectionClass.md index d389e8cc2cf92d..5dcf2027434be2 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/API/CollectionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/API/CollectionClass.md @@ -3195,16 +3195,17 @@ Vous voulez savoir si au moins une valeur de la collection est >0. -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection -| Paramètres | Type | | Description | -| ---------- | --------------------------- | :-------------------------: | ----------------------------------------------------- | -| formula | 4D.Function | -> | Objet formule | -| methodName | Text | -> | Nom de méthode | -| extraParam | any | -> | Paramètre(s) à passer à la méthode | -| Résultat | Collection | <- | Collection d'origine triée | +| Paramètres | Type | | Description | +| ---------- | --------------------------- | :-------------------------: | ------------------------------------------------------------------------ | +| ascOrDesc | Integer | -> | `ck ascending` ou `ck descending` (valeurs scalaires) | +| formula | 4D.Function | -> | Objet formule | +| methodName | Text | -> | Nom de méthode | +| extraParam | any | -> | Paramètre(s) à passer à la méthode | +| Résultat | Collection | <- | Collection d'origine triée | @@ -3214,7 +3215,19 @@ La fonction `.sort()` trie les éléments > Cette fonction modifie la collection d'origine. -Si `.sort()` est appelé sans paramètres, seules les valeurs scalaires (nombres, textes, dates, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. Si la collection contient des éléments de différents types, ils sont d'abord groupés par type et triés par la suite. Les types sont renvoyés dans l'ordre suivant : +Si `.sort()` est appelé sans paramètres, seules les valeurs scalaires (nombres, textes, dates, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. +You can also pass one of the following constants in the *ascOrDesc* parameter: + +``` +|Constant| Type|Value|Comment| +|---|---|---|---| +|ck ascending|Integer|0|Elements are ordered in ascending order (default)| +|ck descending|Integer|1|Elements are ordered in descending order| + +This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). +``` + +Si la collection contient des éléments de différents types, ils sont d'abord groupés par type et triés par la suite. Les types sont renvoyés dans l'ordre suivant : 1. Null 2. booléens diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/API/SessionClass.md b/i18n/fr/docusaurus-plugin-content-docs/current/API/SessionClass.md index bc43dfe7a847e2..4299055fd7d87c 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/API/SessionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/API/SessionClass.md @@ -54,9 +54,10 @@ La disponibilité des propriétés et des fonctions de l'objet `Session` dépend
    Historique -| Release | Modifications | -| ------- | ------------- | -| 18 R6 | Ajout | +| Release | Modifications | +| ------- | -------------------------- | +| 21 | Support of remote sessions | +| 18 R6 | Ajout |
    @@ -74,7 +75,7 @@ La disponibilité des propriétés et des fonctions de l'objet `Session` dépend :::note -Cette fonction ne fait rien et retourne toujours **True** avec les sessions client distants, procédure stockée et autonomes. +This function does nothing and always returns **True** with stored procedure sessions and standalone sessions. ::: @@ -88,6 +89,8 @@ Cette fonction ne supprime pas les **privilèges promus** du process web, qu'ils ::: +Regarding remote client sessions, the function only impacts [code accessing the web server](../WebServer/preemptiveWeb.md#writing-thread-safe-web-server-code). + #### Exemple ```4d @@ -107,9 +110,10 @@ $isGuest:=Session.isGuest() //$isGuest est True
    Historique -| Release | Modifications | -| ------- | ------------- | -| 20 R9 | Ajout | +| Release | Modifications | +| ------- | -------------------------- | +| 21 | Support of remote sessions | +| 20 R9 | Ajout |
    @@ -120,7 +124,7 @@ $isGuest:=Session.isGuest() //$isGuest est True | Paramètres | Type | | Description | | ---------- | ------- | :-------------------------: | -------------------------------------------- | | lifespan | Integer | -> | Durée de vie du token de session en secondes | -| Résultat | Text | <- | UUID de la session | +| Résultat | Text | <- | UUID of the token | @@ -128,7 +132,7 @@ $isGuest:=Session.isGuest() //$isGuest est True :::note -Cette fonction est uniquement disponible avec les sessions utilisateur web. Elle retourne une chaîne vide dans les autres contextes. +This function is available with web user sessions and remote sessions. It returns an empty string in stored procedure and standalone sessions. ::: @@ -136,9 +140,14 @@ La fonction `.createOTP()` crée u Pour plus d'informations sur les tokens OTP, veuillez consulter [cette section](../WebServer/sessions.md#session-token-otp). -Par défaut, si le paramètre *lifespan* est omis, le token est créé avec la même durée de vie que le [`.idleTimeOut`](#idletimeout) de la session. Vous pouvez définir un délai personnalisé en passant une valeur en secondes dans *lifespan*. Si un token expiré est utilisé pour restaurer la session d'un utilisateur web, il est ignoré. +Vous pouvez définir un délai personnalisé en passant une valeur en secondes dans *lifespan*. If an expired token is used to restore a session, it is ignored. By default, if the *lifespan* parameter is omitted: + +- with web user sessions, the token is created with the same lifespan as the [`.idleTimeOut`](#idletimeout) of the session. +- with remote sessions, the token is created with a 10 seconds lifespan. -Le token retourné peut ensuite être utilisé lors d'échanges avec des applications tierces ou des sites Web pour identifier la session de manière sécurisée. Par exemple, le token OTP de session peut être utilisé avec une application de paiement. +For **web user sessions**, the returned token can be used in exchanges with third-party applications or websites to securely identify the session. Par exemple, le token OTP de session peut être utilisé avec une application de paiement. + +For **remote sessions**, the returned token can be used on 4D Server to identitfy requests coming from a [remote 4D running Qodly forms in a Web area](../Desktop/clientServer.md#remote-user-sessions). #### Exemple @@ -253,9 +262,10 @@ $expiration:=Session.expirationDate //ex : "2021-11-05T17:10:42Z"
    Historique -| Release | Modifications | -| ------- | ------------- | -| 20 R6 | Ajout | +| Release | Modifications | +| ------- | --------------------------------- | +| 21 | Support of remote client sessions | +| 20 R6 | Ajout |
    @@ -279,7 +289,9 @@ Cette fonction renvoie les privilèges attribués à une session en utilisant la ::: -Avec les sessions client distant, procédures stockées et autonomes, cette fonction retourne une collection contenant uniquement "WebAdmin". +With remote client sessions, the privileges only concerns the code executed in the context of a [web request sent through a Web area](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). + +With stored procedure sessions and standalone sessions, this function returns a collection only containing "WebAdmin". #### Exemple @@ -348,10 +360,10 @@ $privileges := Session.getPrivileges()
    Historique -| Release | Modifications | -| ------- | ---------------------------------------- | -| 21 | Retourne Vrai pour les privilèges promus | -| 18 R6 | Ajout | +| Release | Modifications | +| ------- | ----------------------------------------------------------------------- | +| 21 | Returns True for promoted privileges, Support of remote client sessions | +| 18 R6 | Ajout |
    @@ -376,7 +388,9 @@ Cette fonction renvoie True pour le *privilège* si elle est appelée depuis une ::: -Avec les sessions client distant, procédures stockées et autonomes, cette fonction retourne toujours True, quel que soit le *privilege*. +Regarding remote client sessions, the function only impacts [code accessing the web server](../WebServer/preemptiveWeb.md#writing-thread-safe-web-server-code). + +With stored procedure sessions and standalone sessions, this function always returns True, whatever the *privilege*. #### Exemple @@ -717,6 +731,7 @@ Function callback($request : 4D.IncomingMessage) : 4D.OutgoingMessage | Release | Modifications | | ------- | ----------------------------------------------------- | +| 21 | Support of remote client sessions | | 19 R8 | Prise en charge de la propriété "roles" dans settings | | 18 R6 | Ajout | @@ -739,23 +754,21 @@ Function callback($request : 4D.IncomingMessage) : 4D.OutgoingMessage :::note -Cette fonction ne fait rien et retourne toujours **False** avec les sessions client distants, procédures stockées et autonomes. +This function does nothing and always returns **False** with stored procedure sessions and standalone sessions. ::: La fonction `.setPrivileges()` associe le ou les privilège(s) et/ou rôle(s) défini(s) en paramètre à la session et renvoie **True** si l'exécution a réussi. - Dans le paramètre *privilege*, passez une chaîne contenant un nom de privilège (ou plusieurs noms de privilèges séparés par des virgules). - - Dans le paramètre *privileges*, passez une collection de chaînes contenant des noms de privilèges. - - Dans le paramètre *settings*, passez un objet contenant les propriétés suivantes : -| Propriété | Type | Description | -| ---------- | ------------------ | ---------------------------------------------------------------------------------------------------------------- | -| privileges | Text ou Collection |
  • Chaîne contenant un nom de privilège, ou
  • Collection de chaînes contenant des noms de privilèges
  • | -| roles | Text ou Collection |
  • Chaîne contenant un rôle, ou
  • Collection de chaînes contenant des rôles
  • | -| userName | Text | Nom d'utilisateur à associer à la session (optionnel) | +| Propriété | Type | Description | +| ---------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| privileges | Text ou Collection |
  • Chaîne contenant un nom de privilège, ou
  • Collection de chaînes contenant des noms de privilèges
  • | +| roles | Text ou Collection |
  • Chaîne contenant un rôle, ou
  • Collection de chaînes contenant des rôles
  • | +| userName | Text | User name to associate to the session (optional, web sessions only). Not available in remote client sessions (ignored). | :::note @@ -769,6 +782,8 @@ Par défaut lorsqu'aucun privilège ou rôle n'est associé à la session, la se La propriété [`userName`](#username) est accessible au niveau de l'objet session (lecture seulement). +Regarding remote client sessions, the function only concerns the code executed in the context of a [web request sent through a Web area](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). + #### Exemple Dans une méthode d'authentification personnalisée, vous assignez le privilège "WebAdmin" à l'utilisateur : diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/API/TCPConnectionClass.md b/i18n/fr/docusaurus-plugin-content-docs/current/API/TCPConnectionClass.md index c68ad8f006d45c..9e10d3449e7a19 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/API/TCPConnectionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/API/TCPConnectionClass.md @@ -209,7 +209,7 @@ Un objet [`TCPEvent`](TCPEventClass.md) est renvoyé lorsqu'une [fonction de cal -## .adresse +## .address **address** : Text diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/API/TCPEventClass.md b/i18n/fr/docusaurus-plugin-content-docs/current/API/TCPEventClass.md index d0ecc1eb970799..6d33231b64fbbc 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/API/TCPEventClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/API/TCPEventClass.md @@ -29,7 +29,7 @@ Les propriétés suivantes sont disponibles : -## .adresse +## .address **address** : Text diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/API/UDPEventClass.md b/i18n/fr/docusaurus-plugin-content-docs/current/API/UDPEventClass.md index 1ce4b714169679..73cd0de51fa4ee 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/API/UDPEventClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/API/UDPEventClass.md @@ -28,7 +28,7 @@ Les propriétés suivantes sont disponibles : -## .adresse +## .address **address** : Text diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/Desktop/clientServer.md b/i18n/fr/docusaurus-plugin-content-docs/current/Desktop/clientServer.md index be17a7d3059d2d..7bf8dd021ec8d7 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/Desktop/clientServer.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/Desktop/clientServer.md @@ -89,11 +89,19 @@ Veillez cependant aux différences de comportement suivantes, comparées à [l'a Sur le serveur, la commande [`Session`](../commands/session.md) renvoie un objet `session` décrivant la session utilisateur courante. Cet objet est géré via les fonctions et les propriétés de la classe [`Session`](../API/SessionClass.md). +:::tip Articles de blog sur le sujet + +[Objet session distante 4D avec connexion Client/Serveur et procédure stockée](https://blog.4d.com/new-4D-remote-session-object-with-client-server-connection-and-stored-procedure). + +::: + ### Utilisation -L'objet `session` vous permet d'obtenir des informations sur la session de l'utilisateur distant. Vous pouvez partager des données entre tous les processus de la session utilisateur en utilisant l'objet partagé [`session.storage`](../API/SessionClass.md#storage). +The `session` object allows you to handle information and privileges for the remote user session. + +Vous pouvez partager des données entre tous les processus de la session utilisateur en utilisant l'objet partagé [`session.storage`](../API/SessionClass.md#storage). Par exemple, vous pouvez lancer une procédure d'authentification et de vérification de l'utilisateur lorsqu'un client se connecte au serveur, impliquant la saisie d'un code envoyé par e-mail ou SMS dans l'application. Ensuite, vous ajoutez les informations de l'utilisateur au storage de session, ce qui permet au serveur d'identifier l'utilisateur. De cette façon, le serveur 4D peut accéder aux informations de l'utilisateur pour tous les process clients, permettant l'écriture de code personnalisé en fonction du rôle de l'utilisateur. -Par exemple, vous pouvez lancer une procédure d'authentification et de vérification de l'utilisateur lorsqu'un client se connecte au serveur, impliquant la saisie d'un code envoyé par e-mail ou SMS dans l'application. Ensuite, vous ajoutez les informations de l'utilisateur au storage de session, ce qui permet au serveur d'identifier l'utilisateur. De cette façon, le serveur 4D peut accéder aux informations de l'utilisateur pour tous les process clients, permettant l'écriture de code personnalisé en fonction du rôle de l'utilisateur. +You can also assign privileges to a remote user session to control access when the session comes from Qodly pages running in web areas. ### Disponibilité @@ -110,7 +118,60 @@ Toutes les procédures stockées sur le serveur partagent la même session utili ::: -### Voir aussi (blog post) +### Sharing the session with Qodly pages in Web areas -[Objet session distante 4D avec connexion Client/Serveur et procédure stockée](https://blog.4d.com/new-4D-remote-session-object-with-client-server-connection-and-stored-procedure). +Remote client sessions can be used to handle Client/Server applications where [Qodly pages](https://developer.4d.com/qodly/4DQodlyPro/pageLoaders/pageLoaderOverview) are used for the interface, running on remote machines. With this configuration, your applications have modern CSS-based web interfaces but still benefit from the power and simplicity of integrated client/server development. In such applications, Qodly pages are executed within standard 4D [Web areas](../FormObjects/webArea_overview.md). + +To manage this configuration, you need to use remote client sessions. Actually, requests coming from both the remote 4D application and its Qodly pages loaded in Web areas need to work inside a single user session. You just have to share the same session between the remote client and its web pages so that you can have the same [session storage](../API/SessionClass.md#storage) and client license, whatever the request origin. + +Note that [privileges](../ORDA/privileges.md) should be set in the session before executing a web request from a Web area, so that the user automatically gets their privileges for web access (see example). Keep in mind that privileges only apply to requests coming from the web, not to the 4D code executed in a standard remote session. + +Shared sessions are handled through [OTP tokens](../WebServer/sessions.md#session-token-otp). After you created an OTP token on the server for the user session, you add the token (through the `$4DSID` parameter value) to web requests sent from web areas containing Qodly pages so that the user session on the server is identified and shared. On the web server side, if a web request contains an *OTP id* in the $4DSID parameter, the session corresponding to this OTP token is used. + +:::tip Related blog post + +[Share your 4D remote client session with web accesses](https://blog.4d.com/share-your-4d-remote-client-session-with-web-accesses) + +::: + +#### Exemple + +```4d +var $otp : Text + +// Some privileges are put in the remote user session on the server for a further web access +ds.resetPrivileges("basic") + +// An OTP is created on the server for this remote client session +$otp:=ds.getOTP() + + +// The user has already the required privileges for a web access +// and the same session is shared between this remote user and the web Qodly app +WA OPEN URL(*; "Welcome"; "http://127.0.0.1/$lib/renderer/?w=People&$4DSID="+$otp) + +``` + +*resetPrivileges()* function in the Datastore class: + +```4d +// This function is run on the server +// and puts some privileges in the session for a further web access + +exposed Function resetPrivileges($priv : Text) + + Session.clearPrivileges() + Session.setPrivileges($priv) +``` + +*getOTP()* function in the Datastore class: + +```4d +// This function is run on the server +// and generates an OTP able to retrieve this remote user session +exposed Function getOTP(): Text + + return Session.createOTP() + +``` diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Object.md b/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Object.md index 79fe43241c8fad..5dd305966f4e03 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Object.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Object.md @@ -76,7 +76,7 @@ Voici la liste des objets dont la valeur peut être mémorisée : --- -## Variable or Expression {#variable-or-expression} +## Variable ou expression {#variable-or-expression} > Voir également **[Expression](properties_DataSource.md#expression)** pour les colonnes de list box de type sélection et collection. diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/Notes/updates.md b/i18n/fr/docusaurus-plugin-content-docs/current/Notes/updates.md index 4f4cd9a35fcaad..0cf0dcd5047622 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/Notes/updates.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/Notes/updates.md @@ -12,6 +12,7 @@ Lisez [**Les nouveautés de 4D 21**](https://blog.4d.com/fe-whats-new-in-4d-v21/ - 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. - 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. +- In client/server applications, use Qodly pages in Web areas and [share the remote client session](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). - 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). diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/ORDA/privileges.md b/i18n/fr/docusaurus-plugin-content-docs/current/ORDA/privileges.md index 9623fd1ea8d614..dcd4b4b7f5e46b 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/ORDA/privileges.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/ORDA/privileges.md @@ -17,9 +17,11 @@ Si un utilisateur tente d'exécuter une action et ne dispose pas des droits d'ac ![schema](../assets/en/ORDA/privileges-schema.png) -### Voir également +:::tip Related Blog posts -Pour un aperçu détaillé de l'architecture des permissions, veuillez lire l'article de blog [**Filtrer l'accès à vos données avec un système complet de permissions**](https://blog.4d.com/filter-access-to-your-data-with-a-complete-system-of-permissions/). +[**Filter access to your data with a complete system of permissions**](https://blog.4d.com/filter-access-to-your-data-with-a-complete-system-of-permissions/) + +::: ## Resources @@ -122,7 +124,7 @@ Le fichier par défaut a le contenu suivant : { "privileges": [ { - "privilege": "none", + "privilege": "all", "includes": [] } ], @@ -134,12 +136,12 @@ Le fichier par défaut a le contenu suivant : { "applyTo": "ds", "type": "datastore", - "read": ["none"], - "create": ["none"], - "update": ["none"], - "drop": ["none"], - "execute": ["none"], - "promote": ["none"] + "read": ["all"], + "create": ["all"], + "update": ["all"], + "drop": ["all"], + "execute": ["all"], + "promote": ["all"] } ] }, @@ -150,7 +152,8 @@ Le fichier par défaut a le contenu suivant : ``` -Pour un niveau de sécurité maximal, le privilège "none" est attribué à toutes les permissions du datastore, désactivant ainsi l'accès aux données pour tout l'objet `ds` par défaut. Il est recommandé de ne pas modifier ou utiliser ce privilège de verrouillage, mais d'ajouter des permissions spécifiques à chaque ressource que vous souhaitez rendre disponible à partir de requêtes web ou REST ([voir l'exemple ci-dessous](#example-of-privilege-configuration)). +For a highest level of security, the "all" privilege is assigned to all permissions in the datastore, thus data access on the whole `ds` object is disabled by default. The principle is as follows: assigning a permission is like putting a lock on a door. Only sessions with privilege having the corresponding key (i.e., a permission) will be able to open the lock. +Il est recommandé de ne pas modifier ou utiliser ce privilège de verrouillage, mais d'ajouter des permissions spécifiques à chaque ressource que vous souhaitez rendre disponible à partir de requêtes web ou REST ([voir l'exemple ci-dessous](#example-of-privilege-configuration)). :::caution @@ -264,14 +267,14 @@ End if ## Exemple de configuration de privilèges -La bonne pratique est de garder verrouillés tous les accès aux données par défaut grâce au privilège "none" et de configurer le fichier `roles.json` pour n'ouvrir que les parties contrôlées aux sessions autorisées. Par exemple, pour autoriser certains accès aux sessions guest : +The good practice is to keep all data access locked by default thanks to the "all" privilege and to configure the `roles.json` file to only open controlled parts to authorized sessions. For example, to allow some accesses to "guest" sessions: ```json title="/Project/Sources/roles.json" { "privileges": [ { - "privilege": "none", + "privilege": "all", "includes": [] } ], @@ -282,22 +285,22 @@ La bonne pratique est de garder verrouillés tous les accès aux données par d "applyTo": "ds", "type": "datastore", "read": [ - "none" + "all" ], "create": [ - "none" + "all" ], "update": [ - "none" + "all" ], "drop": [ - "none" + "all" ], "execute": [ - "none" + "all" ], "promote": [ - "none" + "all" ] }, { diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/WebServer/sessions.md b/i18n/fr/docusaurus-plugin-content-docs/current/WebServer/sessions.md index cfbae4d6b9bd89..3524feb00429dd 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/WebServer/sessions.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/WebServer/sessions.md @@ -213,6 +213,12 @@ The 4D web server allows you to generate, share, and use OTP (One-Time Passcode) In 4D, OTP session tokens are useful when calling external URLs and being called back in another browser or device (mobile/computer). Typically, a third-party application sends a confirmation email containing a callback link on which the user has to click. The callback link includes the OTP token, so that the session which triggered the callback is loaded along with its data and privileges. This principle allows you to share the same session on multiple devices. Thanks to this architecture, the [session cookie](#session-implementation) is not exposed on the network, which eliminates the risk of man-in-the-middle attack. +:::tips Articles de blog sur le sujet + +[Connect Your Web Apps to Third-Party Systems](https://blog.4d.com/connect-your-web-apps-to-third-party-systems/) + +::: + ### Vue d’ensemble The basic sequence of an OTP session token use in a 4D web application is the following: @@ -477,8 +483,4 @@ A session token has a lifespan, and the session itself has a lifespan. The sessi A session is only restored by a token if both the session token lifespan and the session lifespan have not expired. In other cases (the session token has expired and/or the session itself has expired), a guest session is created when a web request with a session token is received. -:::note - -For more information, please refer to the [Connect Your Web Apps to Third-Party Systems](https://blog.4d.com/connect-your-web-apps-to-third-party-systems/) blog post. -::: \ No newline at end of file diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/WritePro/commands/wp-import-document.md b/i18n/fr/docusaurus-plugin-content-docs/current/WritePro/commands/wp-import-document.md index b2b19efb404ca3..3d8e094f354071 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/WritePro/commands/wp-import-document.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/WritePro/commands/wp-import-document.md @@ -8,12 +8,12 @@ displayed_sidebar: docs -| Paramètres | Type | | Description | -| ---------- | ----------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| filePath | Text | → | Path to: a 4D Write document (.4w7 or .4wt) or a 4D Write Pro document (.4wp) or a .docx document (.docx) | -| fileObj | 4D.File | → | Objet du fichier à importer | -| option | Integer, Object | → | (Integer) Import option for HTML expressions, (object) Import options for .docx document | -| Résultat | Object | ← | Objet 4D Write Pro | +| Paramètres | Type | | Description | +| ---------- | ----------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| filePath | Text | → | Chemin d'accès : un document 4D Write (.4w7 ou .4wt) ou un document 4D Write Pro (.4wp) ou un document .docx (.docx) | +| fileObj | 4D.File | → | Objet du fichier à importer | +| option | Integer, Object | → | (Integer) Option d'importation pour les expressions HTML, (object) Options d'importation pour les documents .docx | +| Résultat | Object | ← | Objet 4D Write Pro | @@ -76,11 +76,11 @@ You can pass an object to define how the following attributes are handled during ## Exemple 2 -You want to import a .docx document and would like that paragraph borders are collapsed as they are in MS Word: +Vous souhaitez importer un document .docx et aimeriez que les bordures des paragraphes soient réduites comme dans MS Word : ```4d $options:=New object - $options.borderRules:="collapse" //collapse paragraph borders while converting + $options.borderRules:="collapse" //réduire les marges des paragraphes lors de la conversion wpDoc:=WP Import document(«mydoc.docx»;$options) ``` @@ -89,7 +89,7 @@ Vous voulez importer les champs .docx d'origine en tant que texte (pour les cham ```4d $options:=New object - $options.fields:="label" //for unconverted fields, import field references as text between {{ and }} + $options.fields:="label" //pour les champs non convertis, importez les références de champ sous forme de texte entre {{ and }} wpDoc:=WP Import document(«mydoc.docx»;$options) ``` @@ -98,7 +98,7 @@ Vous voulez importer un document .docx dont le texte est principalement en japon ```4d $options:=New object - $options.preferredFontScriptType:="eastAsia" //force conversion to prefer eastAsia font scripts + $options.preferredFontScriptType:="eastAsia" //Forcer la conversion pour privilégier les polices de caractères eastAsia wpDoc:=WP Import document(«mydoc.docx»;$options) ``` diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md b/i18n/fr/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md index 4566fb4ce79e6a..2615cf964acfca 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md @@ -65,30 +65,42 @@ $chatHelper.reset() // Clear all previous messages and tools ### registerTool() -**registerTool**(*tool* : Object; *handler* : 4D.Function) +**registerTool**(*tool* : Object; *handler* : Object) -| Paramètres | Type | Description | -| ---------- | --------------------------- | ---------------------------------------------------------------------------------------- | -| *tool* | Object | The tool definition object (or [OpenAITool](OpenAITool.md) instance) | -| *handler* | 4D.Function | The function to handle tool calls (optional if defined inside *tool*) | +| Paramètres | Type | Description | +| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| *tool* | Object | The tool definition object (or [OpenAITool](OpenAITool.md) instance) | +| *handler* | Object | The function to handle tool calls ([4D.Function](../../API/FunctionClass.md) or Object), optional if defined inside *tool* as *handler* property | Registers a tool with its handler function for automatic tool call handling. -If the handler is not provided, the tool's `handler` property will be used. + +The *handler* parameter can be: + +- A **4D.Function**: Direct handler function +- An **Object**: An object containing a `formula` property matching the tool function name The handler function receives an object containing the parameters passed from the OpenAI tool call. This object contains key-value pairs where the keys match the parameter names defined in the tool's schema, and the values are the actual arguments provided by the AI model. #### Register Tool Example ```4D -// Define a simple tool +// Example 1: Simple registration with direct handler var $tool:={type: "function"; function: {name: "get_weather"; description: "Get current weather"; parameters: {type: "object"; properties: {location: {type: "string"; description: "City name"}}}}} - -// Define a handler function that receives an argument { location: "a city" } var $handler:=Formula(return "Sunny, 25°C in "+$1.location) $chatHelper.registerTool($tool; $handler) -// or + +// Example 2: Tool with handler property (no second parameter needed) +var $tool:={name: "calculate"; description: "Perform calculations"; handler: Formula(return String(Num($1.expression)))} +$chatHelper.registerTool($tool) + +// Example 3: Using object notation $chatHelper.registerTool({tool: $tool; handler: $handler}) + +// Example 4: Handler as object with formula matching tool name +var $tool:={name: "getTime"; description: "Get current time"} +var $handlerObj:=cs.MyTimeTool.new() // class with a getTime function +$chatHelper.registerTool($tool; $handlerObj) ``` ### registerTools() @@ -99,34 +111,64 @@ $chatHelper.registerTool({tool: $tool; handler: $handler}) | ------------------- | ------- | -------------------------------------------------------- | | *toolsWithHandlers* | Variant | Object or Collection containing tools and their handlers | -Registers multiple tools at once. The parameter can be either an object with function names as keys, or a collection of tool objects. +Registers multiple tools at once. The parameter can be: + +- **Collection**: Array of tool objects (with handlers embedded or separate) +- **Object**: Object with function names as keys mapping to tool definitions +- **Object with `tools` attribute**: Object containing a `tools` collection and formula properties matching tool names #### Register Multiple Tools Example -```4D -// Simple approach: handlers defined directly in tools -var $weatherTool:={type: "function"; function: {name: "get_weather"; description: "Get current weather"; parameters: {type: "object"; properties: {location: {type: "string"; description: "City name"}}}}; \ - handler: Formula(return "Sunny, 25°C in "+$1.location)} -var $calculatorTool:={type: "function"; function: {name: "calculate"; description: "Perform calculations"; parameters: {type: "object"; properties: {expression: {type: "string"; description: "Math expression"}}}}; \ - handler: Formula(return String(Num($1.expression)))} +##### Example 1: Collection format with handlers in tools -var $tools:={} -$tools.get_weather:=$weatherTool -$tools.calculate:=$calculatorTool - -$chatHelper.registerTools($tools) +```4D +var $weatherTool:={name: "getWeather"; description: "Get current weather"; handler: Formula(return "Sunny, 25°C in "+$1.location)} +var $calculatorTool:={name: "calculate"; description: "Perform calculations"; handler: Formula(return String(Num($1.expression)))} -// Using collection format $chatHelper.registerTools([$weatherTool; $calculatorTool]) +``` -// Alternative: separate tool definitions from handlers (useful for better code organization) +##### Example 2: Object format with separate tool and handler + +```4D var $toolsWithSeparateHandlers:={} -$toolsWithSeparateHandlers.get_weather:={tool: $weatherToolDefinition; handler: $weatherHandler} +$toolsWithSeparateHandlers.getWeather:={tool: $weatherToolDefinition; handler: $weatherHandler} $toolsWithSeparateHandlers.calculate:={tool: $calculatorToolDefinition; handler: $calculatorHandler} $chatHelper.registerTools($toolsWithSeparateHandlers) ``` +##### Example 3: Object with tools collection attribute and formula properties + +MyTools class: + +```4D + +Class constructor + this.tools:=[{name: "getWeather"; description: "Get current weather"}; \ + {name: "getTime"; description: "Get current time"}] // Collection of tool definitions + +Function getWeather($parameters: Object) + return "Sunny, 25°C" + +Function getTime($parameters: Object) + return String(Current time) +``` + +```4D +$chatHelper.registerTools(cs.MyTools.new()) +``` + +##### Example 4: Simple object format with tools as properties + +```4D +var $tools:={} +$tools.getWeather:=$weatherTool // Tool with handler property +$tools.calculate:=$calculatorTool // Tool with handler property + +$chatHelper.registerTools($tools) +``` + ### unregisterTool() **unregisterTool**(*functionName* : Text) diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/commands/session.md b/i18n/fr/docusaurus-plugin-content-docs/current/commands/session.md index 0772d8d46eb3f3..a2abe5e73f24d4 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/commands/session.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/commands/session.md @@ -57,6 +57,7 @@ L'objet `Session` des sessions client distants est disponible depuis : - Les méthodes projet qui ont l'attribut [Exécuter sur serveur](../Project/code-overview.md#execute-on-server) (elles sont exécutées dans le process jumeau du process client), - Les Triggers, +- Les [fonctions du modèle de données](../ORDA/ordaClasses.md) ORDA (sauf celles déclarées avec le mot-clé [`local`](../ORDA/ordaClasses.md#local-functions), - Les méthodes base `On Server Open Connection` et `On Server Shutdown Connection`. Pour plus d'informations sur les sessions utilisateur distantes, veuillez vous référer au paragraphe [**Sessions utilisateur client distants**](../Desktop/clientServer.md#remote-user-sessions). diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md index fb7c682ef9b753..5ab160b59cdd3b 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md @@ -2493,24 +2493,33 @@ Avec la méthode *NumberGreaterThan0* suivante : -**.sort**() : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection | Paramètres | Type | | Description | | ---------- | ---------- |:--:| ----------------------------------------------------- | +| ascOrDesc | Integer | -> | `ck ascending` ou `ck descending` (valeurs scalaires) | | methodName | Text | -> | Nom de la méthode utilisée pour trier la collection | | extraParam | any | -> | Paramètre(s) à passer à la méthode | -| Résultat | Collection | <- | Collection d'origine triée| - -| +| Résultat | Collection | <- | Collection d'origine triée | + #### Description La fonction `.sort()` trie les éléments de la collection d'origine et retourne aussi la collection triée. > Cette fonction modifie la collection d'origine. -Si `.sort()` est appelé sans paramètre, seules les valeurs scalaires (numérique, texte, date, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. Si la collection contient des éléments de différents types, ils sont d'abord groupés par type et triés par la suite. Les types sont renvoyés dans l'ordre suivant : +Si `.sort()` est appelé sans paramètre, seules les valeurs scalaires (numérique, texte, date, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. You can also pass one of the following constants in the *ascOrDesc* parameter: + + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + + Si la collection contient des éléments de différents types, ils sont d'abord groupés par type et triés par la suite. Les types sont renvoyés dans l'ordre suivant : 1. Null 2. booléens diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md index d389e8cc2cf92d..0f3efe19eef728 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md @@ -3195,16 +3195,17 @@ Vous voulez savoir si au moins une valeur de la collection est >0. -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection -| Paramètres | Type | | Description | -| ---------- | --------------------------- | :-------------------------: | ----------------------------------------------------- | -| formula | 4D.Function | -> | Objet formule | -| methodName | Text | -> | Nom de méthode | -| extraParam | any | -> | Paramètre(s) à passer à la méthode | -| Résultat | Collection | <- | Collection d'origine triée | +| Paramètres | Type | | Description | +| ---------- | --------------------------- | :-------------------------: | ------------------------------------------------------------------------ | +| ascOrDesc | Integer | -> | `ck ascending` ou `ck descending` (valeurs scalaires) | +| formula | 4D.Function | -> | Objet formule | +| methodName | Text | -> | Nom de méthode | +| extraParam | any | -> | Paramètre(s) à passer à la méthode | +| Résultat | Collection | <- | Collection d'origine triée | @@ -3214,7 +3215,19 @@ La fonction `.sort()` trie les éléments > Cette fonction modifie la collection d'origine. -Si `.sort()` est appelé sans paramètres, seules les valeurs scalaires (nombres, textes, dates, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. Si la collection contient des éléments de différents types, ils sont d'abord groupés par type et triés par la suite. Les types sont renvoyés dans l'ordre suivant : +Si `.sort()` est appelé sans paramètres, seules les valeurs scalaires (nombres, textes, dates, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. +You can also pass one of the following constants in the *ascOrDesc* parameter: + + ``` + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + ``` + +Si la collection contient des éléments de différents types, ils sont d'abord groupés par type et triés par la suite. Les types sont renvoyés dans l'ordre suivant : 1. Null 2. booléens diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md index d399a0002fb6e9..75b05496143148 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md @@ -120,7 +120,7 @@ $isGuest:=Session.isGuest() //$isGuest est True | Paramètres | Type | | Description | | ---------- | ------- | :-------------------------: | -------------------------------------------- | | lifespan | Integer | -> | Durée de vie du token de session en secondes | -| Résultat | Text | <- | UUID de la session | +| Résultat | Text | <- | UUID of the OTP token | diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/TCPConnectionClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/TCPConnectionClass.md index 2fe269d318a8fa..a4b8cb51bd9cbe 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/TCPConnectionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/TCPConnectionClass.md @@ -208,7 +208,7 @@ Un objet [`TCPEvent`](TCPEventClass.md) est renvoyé lorsqu'une [fonction de cal -## .adresse +## .address **address** : Text diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/TCPEventClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/TCPEventClass.md index b2e52d17fe7fca..f04cf6f1e16ad7 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/TCPEventClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/TCPEventClass.md @@ -29,7 +29,7 @@ Les propriétés suivantes sont disponibles : -## .adresse +## .address **address** : Text diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/UDPEventClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/UDPEventClass.md index 1ce4b714169679..73cd0de51fa4ee 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/UDPEventClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/API/UDPEventClass.md @@ -28,7 +28,7 @@ Les propriétés suivantes sont disponibles : -## .adresse +## .address **address** : Text diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/FormObjects/properties_Object.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/FormObjects/properties_Object.md index 6f8210ed63cd4b..7f7c70fe75009a 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/FormObjects/properties_Object.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/FormObjects/properties_Object.md @@ -170,7 +170,7 @@ Saisissez une expression qui renvoie une collection ou une entity selection. En La collection ou l'entity selection doit être disponible pour le formulaire lors de son chargement. Chaque élément de la collection ou de chaque entité de l'entity selection sera associé(e) à une ligne de list box et sera disponible en tant qu'objet via le mot-clé [`This`](../Concepts/classes.md#this) : - si vous avez utilisé une collection d'objets, vous pouvez appeler **This** dans l'expression datasource pour accéder à chaque valeur de propriété, par exemple `This.`. -- si vous avez utilisé une entity selection, vous pouvez appeler **This** dans l'expression detasource pour accéder à chaque valeur d'attribut, par exemple `This.`. +- si vous avez utilisé une entity selection, vous pouvez appeler **This** dans l'expression datasource pour accéder à chaque valeur d'attribut, par exemple `This.`. > Si vous avez utilisé une collection de valeurs scalaires (et non des objets), 4D vous permet d'afficher chaque valeur en appelant **This.value** dans l'expression datasource. Cependant, dans ce cas, vous ne pourrez pas modifier les valeurs ou accéder à l'objet courant (voir ci-dessous). diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/WritePro/commands/wp-import-document.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/WritePro/commands/wp-import-document.md index b2b19efb404ca3..3d8e094f354071 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/WritePro/commands/wp-import-document.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R10/WritePro/commands/wp-import-document.md @@ -8,12 +8,12 @@ displayed_sidebar: docs -| Paramètres | Type | | Description | -| ---------- | ----------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| filePath | Text | → | Path to: a 4D Write document (.4w7 or .4wt) or a 4D Write Pro document (.4wp) or a .docx document (.docx) | -| fileObj | 4D.File | → | Objet du fichier à importer | -| option | Integer, Object | → | (Integer) Import option for HTML expressions, (object) Import options for .docx document | -| Résultat | Object | ← | Objet 4D Write Pro | +| Paramètres | Type | | Description | +| ---------- | ----------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| filePath | Text | → | Chemin d'accès : un document 4D Write (.4w7 ou .4wt) ou un document 4D Write Pro (.4wp) ou un document .docx (.docx) | +| fileObj | 4D.File | → | Objet du fichier à importer | +| option | Integer, Object | → | (Integer) Option d'importation pour les expressions HTML, (object) Options d'importation pour les documents .docx | +| Résultat | Object | ← | Objet 4D Write Pro | @@ -76,11 +76,11 @@ You can pass an object to define how the following attributes are handled during ## Exemple 2 -You want to import a .docx document and would like that paragraph borders are collapsed as they are in MS Word: +Vous souhaitez importer un document .docx et aimeriez que les bordures des paragraphes soient réduites comme dans MS Word : ```4d $options:=New object - $options.borderRules:="collapse" //collapse paragraph borders while converting + $options.borderRules:="collapse" //réduire les marges des paragraphes lors de la conversion wpDoc:=WP Import document(«mydoc.docx»;$options) ``` @@ -89,7 +89,7 @@ Vous voulez importer les champs .docx d'origine en tant que texte (pour les cham ```4d $options:=New object - $options.fields:="label" //for unconverted fields, import field references as text between {{ and }} + $options.fields:="label" //pour les champs non convertis, importez les références de champ sous forme de texte entre {{ and }} wpDoc:=WP Import document(«mydoc.docx»;$options) ``` @@ -98,7 +98,7 @@ Vous voulez importer un document .docx dont le texte est principalement en japon ```4d $options:=New object - $options.preferredFontScriptType:="eastAsia" //force conversion to prefer eastAsia font scripts + $options.preferredFontScriptType:="eastAsia" //Forcer la conversion pour privilégier les polices de caractères eastAsia wpDoc:=WP Import document(«mydoc.docx»;$options) ``` diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md index d389e8cc2cf92d..0f3efe19eef728 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md @@ -3195,16 +3195,17 @@ Vous voulez savoir si au moins une valeur de la collection est >0. -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection -| Paramètres | Type | | Description | -| ---------- | --------------------------- | :-------------------------: | ----------------------------------------------------- | -| formula | 4D.Function | -> | Objet formule | -| methodName | Text | -> | Nom de méthode | -| extraParam | any | -> | Paramètre(s) à passer à la méthode | -| Résultat | Collection | <- | Collection d'origine triée | +| Paramètres | Type | | Description | +| ---------- | --------------------------- | :-------------------------: | ------------------------------------------------------------------------ | +| ascOrDesc | Integer | -> | `ck ascending` ou `ck descending` (valeurs scalaires) | +| formula | 4D.Function | -> | Objet formule | +| methodName | Text | -> | Nom de méthode | +| extraParam | any | -> | Paramètre(s) à passer à la méthode | +| Résultat | Collection | <- | Collection d'origine triée | @@ -3214,7 +3215,19 @@ La fonction `.sort()` trie les éléments > Cette fonction modifie la collection d'origine. -Si `.sort()` est appelé sans paramètres, seules les valeurs scalaires (nombres, textes, dates, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. Si la collection contient des éléments de différents types, ils sont d'abord groupés par type et triés par la suite. Les types sont renvoyés dans l'ordre suivant : +Si `.sort()` est appelé sans paramètres, seules les valeurs scalaires (nombres, textes, dates, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. +You can also pass one of the following constants in the *ascOrDesc* parameter: + + ``` + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + ``` + +Si la collection contient des éléments de différents types, ils sont d'abord groupés par type et triés par la suite. Les types sont renvoyés dans l'ordre suivant : 1. Null 2. booléens diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md index 4516fe5c025d3c..b5308f21a6f89e 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md @@ -117,7 +117,7 @@ $isGuest:=Session.isGuest() //$isGuest est True | Paramètres | Type | | Description | | ---------- | ------- | :-------------------------: | -------------------------------------------- | | lifespan | Integer | -> | Durée de vie du token de session en secondes | -| Résultat | Text | <- | UUID de la session | +| Résultat | Text | <- | UUID of the OTP token | diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/TCPConnectionClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/TCPConnectionClass.md index e33173352ced53..237b3c6e61eb66 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/TCPConnectionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/TCPConnectionClass.md @@ -201,7 +201,7 @@ Un objet [`TCPEvent`](TCPEventClass.md) est renvoyé lorsqu'une [fonction de cal -## .adresse +## .address **address** : Text diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/TCPEventClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/TCPEventClass.md index b2e52d17fe7fca..f04cf6f1e16ad7 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/TCPEventClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/API/TCPEventClass.md @@ -29,7 +29,7 @@ Les propriétés suivantes sont disponibles : -## .adresse +## .address **address** : Text diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/WritePro/commands/wp-import-document.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/WritePro/commands/wp-import-document.md index b2b19efb404ca3..3d8e094f354071 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/WritePro/commands/wp-import-document.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R9/WritePro/commands/wp-import-document.md @@ -8,12 +8,12 @@ displayed_sidebar: docs -| Paramètres | Type | | Description | -| ---------- | ----------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| filePath | Text | → | Path to: a 4D Write document (.4w7 or .4wt) or a 4D Write Pro document (.4wp) or a .docx document (.docx) | -| fileObj | 4D.File | → | Objet du fichier à importer | -| option | Integer, Object | → | (Integer) Import option for HTML expressions, (object) Import options for .docx document | -| Résultat | Object | ← | Objet 4D Write Pro | +| Paramètres | Type | | Description | +| ---------- | ----------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| filePath | Text | → | Chemin d'accès : un document 4D Write (.4w7 ou .4wt) ou un document 4D Write Pro (.4wp) ou un document .docx (.docx) | +| fileObj | 4D.File | → | Objet du fichier à importer | +| option | Integer, Object | → | (Integer) Option d'importation pour les expressions HTML, (object) Options d'importation pour les documents .docx | +| Résultat | Object | ← | Objet 4D Write Pro | @@ -76,11 +76,11 @@ You can pass an object to define how the following attributes are handled during ## Exemple 2 -You want to import a .docx document and would like that paragraph borders are collapsed as they are in MS Word: +Vous souhaitez importer un document .docx et aimeriez que les bordures des paragraphes soient réduites comme dans MS Word : ```4d $options:=New object - $options.borderRules:="collapse" //collapse paragraph borders while converting + $options.borderRules:="collapse" //réduire les marges des paragraphes lors de la conversion wpDoc:=WP Import document(«mydoc.docx»;$options) ``` @@ -89,7 +89,7 @@ Vous voulez importer les champs .docx d'origine en tant que texte (pour les cham ```4d $options:=New object - $options.fields:="label" //for unconverted fields, import field references as text between {{ and }} + $options.fields:="label" //pour les champs non convertis, importez les références de champ sous forme de texte entre {{ and }} wpDoc:=WP Import document(«mydoc.docx»;$options) ``` @@ -98,7 +98,7 @@ Vous voulez importer un document .docx dont le texte est principalement en japon ```4d $options:=New object - $options.preferredFontScriptType:="eastAsia" //force conversion to prefer eastAsia font scripts + $options.preferredFontScriptType:="eastAsia" //Forcer la conversion pour privilégier les polices de caractères eastAsia wpDoc:=WP Import document(«mydoc.docx»;$options) ``` diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md index 9b6694c05dd9df..2981dadefa5b67 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md @@ -3246,19 +3246,18 @@ Vous voulez savoir si au moins une valeur de la collection est >0. -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection | Paramètres | Type | | Description | | ---------- | ----------- |:--:| ----------------------------------------------------- | +| ascOrDesc | Integer | -> | `ck ascending` ou `ck descending` (valeurs scalaires) | | formula | 4D.Function | -> | Objet formule | | methodName | Text | -> | Nom de méthode | | extraParam | any | -> | Paramètre(s) à passer à la méthode | -| Résultat | Collection | <- | Collection d'origine triée| - - -| +| Résultat | Collection | <- | Collection d'origine triée | + #### Description @@ -3266,7 +3265,16 @@ Vous voulez savoir si au moins une valeur de la collection est >0. La fonction `.sort()` trie les éléments de la collection d'origine et retourne également une référence vers cette collection triée . > Cette fonction modifie la collection d'origine. -Si `.sort()` est appelé sans paramètre, seules les valeurs scalaires (numérique, texte, date, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. Si la collection contient des valeurs scalaires de différents types, elles sont d'abord groupées par type et triées par la suite. Les types sont renvoyés dans l'ordre suivant : +Si `.sort()` est appelé sans paramètre, seules les valeurs scalaires (numérique, texte, date, booléens) sont triées. Les éléments sont triés par défaut par ordre croissant, en fonction de leur type. You can also pass one of the following constants in the *ascOrDesc* parameter: + + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + + Si la collection contient des éléments de différents types, ils sont d'abord groupés par type et triés par la suite. Les types sont renvoyés dans l'ordre suivant : 1. Null 2. booléens diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/API/CollectionClass.md b/i18n/ja/docusaurus-plugin-content-docs/current/API/CollectionClass.md index af2c9912058cc4..e4e4c9dc5dc0fe 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/API/CollectionClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/API/CollectionClass.md @@ -3199,16 +3199,17 @@ $r:=$c.reduceRight(Formula($1.accumulator*=$1.value); 1) // 戻り値は 86400 -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection -| 引数 | 型 | | 説明 | -| ---------- | --------------------------- | :-------------------------: | ---------------- | -| formula | 4D.Function | -> | フォーミュラオブジェクト | -| methodName | Text | -> | メソッド名 | -| extraParam | any | -> | methodName に渡す引数 | -| 戻り値 | Collection | <- | 並べ替えられた元のコレクション | +| 引数 | 型 | | 説明 | +| ---------- | --------------------------- | :-------------------------: | ------------------------------------------------------------- | +| ascOrDesc | Integer | -> | `ck ascending` または `ck descending` (スカラー値) | +| formula | 4D.Function | -> | フォーミュラオブジェクト | +| methodName | Text | -> | メソッド名 | +| extraParam | any | -> | methodName に渡す引数 | +| 戻り値 | Collection | <- | 並べ替えられた元のコレクション | @@ -3218,7 +3219,19 @@ $r:=$c.reduceRight(Formula($1.accumulator*=$1.value); 1) // 戻り値は 86400 > このコマンドは、元のコレクションを変更します。 -引数もなしに呼び出された場合、`.sort()` はスカラー値 (数値、テキスト、日付、ブール) のみを並べ替えます。 デフォルトでは、要素はそれぞれの型に応じて昇順で並べ替えられます。 コレクションが異なる型の要素を格納している場合、それらはまず型ごとにグループ分けされ、そのあとで並べ替えられます。 型は以下の順番で返されます: +引数もなしに呼び出された場合、`.sort()` はスカラー値 (数値、テキスト、日付、ブール) のみを並べ替えます。 デフォルトでは、要素はそれぞれの型に応じて昇順で並べ替えられます。 +You can also pass one of the following constants in the *ascOrDesc* parameter: + +``` +|Constant| Type|Value|Comment| +|---|---|---|---| +|ck ascending|Integer|0|Elements are ordered in ascending order (default)| +|ck descending|Integer|1|Elements are ordered in descending order| + +This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). +``` + +コレクションが異なる型の要素を格納している場合、それらはまず型ごとにグループ分けされ、そのあとで並べ替えられます。 型は以下の順番で返されます: 1. null 2. ブール diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/API/SessionClass.md b/i18n/ja/docusaurus-plugin-content-docs/current/API/SessionClass.md index fed7cf584a61a0..dbdb9acd8d6eef 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/API/SessionClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/API/SessionClass.md @@ -54,9 +54,10 @@ Session オブジェクトは [`Session`](../commands/session.md) コマンド
    履歴 -| リリース | 内容 | -| ----- | -- | -| 18 R6 | 追加 | +| リリース | 内容 | +| ----- | -------------------------- | +| 21 | Support of remote sessions | +| 18 R6 | 追加 |
    @@ -74,7 +75,7 @@ Session オブジェクトは [`Session`](../commands/session.md) コマンド :::note -この関数は、リモートクライアント、ストアドプロシージャー、およびスタンドアロンのセッションでは何もせず、常に **true** を返します。 +This function does nothing and always returns **True** with stored procedure sessions and standalone sessions. ::: @@ -88,6 +89,8 @@ Session オブジェクトは [`Session`](../commands/session.md) コマンド ::: +Regarding remote client sessions, the function only impacts [code accessing the web server](../WebServer/preemptiveWeb.md#writing-thread-safe-web-server-code). + #### 例題 ```4d @@ -107,9 +110,10 @@ $isGuest:=Session.isGuest() // $isGuest は true
    履歴 -| リリース | 内容 | -| ----- | -- | -| 20 R9 | 追加 | +| リリース | 内容 | +| ----- | -------------------------- | +| 21 | Support of remote sessions | +| 20 R9 | 追加 |
    @@ -120,7 +124,7 @@ $isGuest:=Session.isGuest() // $isGuest は true | 引数 | 型 | | 説明 | | -------- | ------- | :-------------------------: | ------------------------------------ | | lifespan | Integer | -> | セッショントークンの有効期限(秒) | -| 戻り値 | Text | <- | セッションのUUID | +| 戻り値 | Text | <- | UUID of the token | @@ -128,7 +132,7 @@ $isGuest:=Session.isGuest() // $isGuest は true :::note -この関数は、Webユーザーセッションの場合にのみ使用できます。 他のコンテキストにおいては空の文字列を返します。 +This function is available with web user sessions and remote sessions. It returns an empty string in stored procedure and standalone sessions. ::: @@ -136,9 +140,14 @@ $isGuest:=Session.isGuest() // $isGuest は true OTP トークンについてのより詳細な情報については、[こちらの章](../WebServer/sessions.md#セッショントークンotp)を参照して下さい。 -デフォルトで、*lifespan* 引数が省略された場合、トークンはセッションの[`.idleTimeOut`](#idletimeout) と同じ有効期限を持って作成されます。 *lifespan* に秒単位の値を渡すことで、カスタムのタイムアウト時間を設定することができます。 Web ユーザーセッションを復元するために失効したトークンを使用した場合、それは無視されます。 +*lifespan* に秒単位の値を渡すことで、カスタムのタイムアウト時間を設定することができます。 If an expired token is used to restore a session, it is ignored. By default, if the *lifespan* parameter is omitted: + +- with web user sessions, the token is created with the same lifespan as the [`.idleTimeOut`](#idletimeout) of the session. +- with remote sessions, the token is created with a 10 seconds lifespan. -返されたトークンは、サードパーティアプリケーションや他のWebサイトとのやり取りで使用することでセッションを安全に特定することができます。 例えば、セッションOTP トークンは支払いアプリケーションなどにおいて使用することができます。 +For **web user sessions**, the returned token can be used in exchanges with third-party applications or websites to securely identify the session. 例えば、セッションOTP トークンは支払いアプリケーションなどにおいて使用することができます。 + +For **remote sessions**, the returned token can be used on 4D Server to identitfy requests coming from a [remote 4D running Qodly forms in a Web area](../Desktop/clientServer.md#remote-user-sessions). #### 例題 @@ -253,9 +262,10 @@ $expiration:=Session.expirationDate // 例: "2021-11-05T17:10:42Z"
    履歴 -| リリース | 内容 | -| ----- | -- | -| 20 R6 | 追加 | +| リリース | 内容 | +| ----- | --------------------------------- | +| 21 | Support of remote client sessions | +| 20 R6 | 追加 |
    @@ -279,7 +289,9 @@ $expiration:=Session.expirationDate // 例: "2021-11-05T17:10:42Z" ::: -リモートクライアント、ストアドプロシージャーおよびスタンドアロンセッションでは、この関数は "WebAdmin" のみを含むコレクションを返します。 +With remote client sessions, the privileges only concerns the code executed in the context of a [web request sent through a Web area](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). + +With stored procedure sessions and standalone sessions, this function returns a collection only containing "WebAdmin". #### 例題 @@ -348,10 +360,10 @@ $privileges := Session.getPrivileges()
    履歴 -| リリース | 内容 | -| ----- | ---------------------- | -| 21 | 昇格した権限に対しては True を返します | -| 18 R6 | 追加 | +| リリース | 内容 | +| ----- | ----------------------------------------------------------------------- | +| 21 | Returns True for promoted privileges, Support of remote client sessions | +| 18 R6 | 追加 |
    @@ -376,7 +388,9 @@ $privileges := Session.getPrivileges() ::: -リモートクライアント、ストアドプロシージャーおよびスタンドアロンセッションでは、この関数は *privilege* に関係なく、常に True を返します。 +Regarding remote client sessions, the function only impacts [code accessing the web server](../WebServer/preemptiveWeb.md#writing-thread-safe-web-server-code). + +With stored procedure sessions and standalone sessions, this function always returns True, whatever the *privilege*. #### 例題 @@ -714,10 +728,11 @@ Function callback($request : 4D.IncomingMessage) : 4D.OutgoingMessage
    履歴 -| リリース | 内容 | -| ----- | ---------------- | -| 19 R8 | roles プロパティをサポート | -| 18 R6 | 追加 | +| リリース | 内容 | +| ----- | --------------------------------- | +| 21 | Support of remote client sessions | +| 19 R8 | roles プロパティをサポート | +| 18 R6 | 追加 |
    @@ -738,23 +753,21 @@ Function callback($request : 4D.IncomingMessage) : 4D.OutgoingMessage :::note -この関数は、リモートクライアント、ストアドプロシージャー、およびスタンドアロンのセッションでは何もせず、常に **false** を返します。 +This function does nothing and always returns **False** with stored procedure sessions and standalone sessions. ::: `.setPrivileges()` 関数は、引数として渡したアクセス権やロールをセッションと紐づけ、実行が成功した場合に **true** を返します。 - *privilege* には、アクセス権の名称を文字列として渡します (複数の場合はカンマ区切り)。 - - *privileges* には、アクセス権の名称を文字列のコレクションとして渡します。 - - *settings* には、以下のプロパティを持つオブジェクトを渡します: -| プロパティ | 型 | 説明 | -| ---------- | ------------------- | ----------------------------------------- | -| privileges | Text または Collection |
  • アクセス権名の文字列
  • アクセス権名のコレクション
  • | -| roles | Text または Collection |
  • ロールの文字列
  • ロールの文字列のコレクション
  • | -| userName | Text | (任意) セッションと紐づけるユーザー名 | +| プロパティ | 型 | 説明 | +| ---------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| privileges | Text または Collection |
  • アクセス権名の文字列
  • アクセス権名のコレクション
  • | +| roles | Text または Collection |
  • ロールの文字列
  • ロールの文字列のコレクション
  • | +| userName | Text | User name to associate to the session (optional, web sessions only). Not available in remote client sessions (ignored). | :::note @@ -768,6 +781,8 @@ Function callback($request : 4D.IncomingMessage) : 4D.OutgoingMessage [`userName`](#username) プロパティは Session オブジェクトレベルで利用可能です (読み取り専用)。 +Regarding remote client sessions, the function only concerns the code executed in the context of a [web request sent through a Web area](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). + #### 例題 カスタムな認証メソッドにおいて、ユーザーに "WebAdmin" アクセス権を付与します: diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/Desktop/clientServer.md b/i18n/ja/docusaurus-plugin-content-docs/current/Desktop/clientServer.md index 8a9a7ec1030cca..feb67074ec1827 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/Desktop/clientServer.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/Desktop/clientServer.md @@ -89,11 +89,19 @@ title: クライアント/サーバー管理 サーバー上では、[`Session`](../commands/session.md) コマンドはカレントユーザーセッションの情報を格納する `Session` オブジェクトを返します。 このオブジェクトを扱うには、[`Session` クラス](../API/SessionClass.md) の関数とプロパティを使用します。 +:::tip 関連したblog 記事 + +[クライアント/サーバー接続とストアドプロシージャーに対応した新しい 4Dリモートセッションオブジェクト](https://blog.4d.com/ja/new-4d-remote-session-object-with-client-server-connection-and-stored-procedure/)。 + +::: + ### 効果 -`Session`オブジェクトを使用すると、リモートユーザーセッションに関する情報を取得できます。 ユーザーセッションのすべてのプロセス間でデータを共有するには、[`Session.storage`](../API/SessionClass.md#storage) 共有オブジェクトを使用できます。 +The `session` object allows you to handle information and privileges for the remote user session. + +ユーザーセッションのすべてのプロセス間でデータを共有するには、[`Session.storage`](../API/SessionClass.md#storage) 共有オブジェクトを使用できます。 たとえば、クライアントがサーバーに接続する際にユーザー認証手続きを開始し、メールや SMS で送信されたコードをアプリケーションに入力させることができます。 次に、ユーザー情報をセッションの storage に追加し、サーバーがユーザーを識別できるようにします。 この方法により、4Dサーバーはすべてのクライアントプロセスのユーザー情報にアクセスできるため、ユーザーの役割に応じてカスタマイズされたコードを用意することができます。 -たとえば、クライアントがサーバーに接続する際にユーザー認証手続きを開始し、メールや SMS で送信されたコードをアプリケーションに入力させることができます。 次に、ユーザー情報をセッションの storage に追加し、サーバーがユーザーを識別できるようにします。 この方法により、4Dサーバーはすべてのクライアントプロセスのユーザー情報にアクセスできるため、ユーザーの役割に応じてカスタマイズされたコードを用意することができます。 +You can also assign privileges to a remote user session to control access when the session comes from Qodly pages running in web areas. ### 利用可能性 @@ -110,7 +118,60 @@ title: クライアント/サーバー管理 ::: -### 関連項目 (ブログ記事) +### Sharing the session with Qodly pages in Web areas -[クライアント/サーバー接続とストアドプロシージャーに対応した新しい 4Dリモートセッションオブジェクト](https://blog.4d.com/ja/new-4d-remote-session-object-with-client-server-connection-and-stored-procedure/)。 +Remote client sessions can be used to handle Client/Server applications where [Qodly pages](https://developer.4d.com/qodly/4DQodlyPro/pageLoaders/pageLoaderOverview) are used for the interface, running on remote machines. With this configuration, your applications have modern CSS-based web interfaces but still benefit from the power and simplicity of integrated client/server development. In such applications, Qodly pages are executed within standard 4D [Web areas](../FormObjects/webArea_overview.md). + +To manage this configuration, you need to use remote client sessions. Actually, requests coming from both the remote 4D application and its Qodly pages loaded in Web areas need to work inside a single user session. You just have to share the same session between the remote client and its web pages so that you can have the same [session storage](../API/SessionClass.md#storage) and client license, whatever the request origin. + +Note that [privileges](../ORDA/privileges.md) should be set in the session before executing a web request from a Web area, so that the user automatically gets their privileges for web access (see example). Keep in mind that privileges only apply to requests coming from the web, not to the 4D code executed in a standard remote session. + +Shared sessions are handled through [OTP tokens](../WebServer/sessions.md#session-token-otp). After you created an OTP token on the server for the user session, you add the token (through the `$4DSID` parameter value) to web requests sent from web areas containing Qodly pages so that the user session on the server is identified and shared. On the web server side, if a web request contains an *OTP id* in the $4DSID parameter, the session corresponding to this OTP token is used. + +:::tip Related blog post + +[Share your 4D remote client session with web accesses](https://blog.4d.com/share-your-4d-remote-client-session-with-web-accesses) + +::: + +#### 例題 + +```4d +var $otp : Text + +// Some privileges are put in the remote user session on the server for a further web access +ds.resetPrivileges("basic") + +// An OTP is created on the server for this remote client session +$otp:=ds.getOTP() + + +// The user has already the required privileges for a web access +// and the same session is shared between this remote user and the web Qodly app +WA OPEN URL(*; "Welcome"; "http://127.0.0.1/$lib/renderer/?w=People&$4DSID="+$otp) + +``` + +*resetPrivileges()* function in the Datastore class: + +```4d +// This function is run on the server +// and puts some privileges in the session for a further web access + +exposed Function resetPrivileges($priv : Text) + + Session.clearPrivileges() + Session.setPrivileges($priv) +``` + +*getOTP()* function in the Datastore class: + +```4d +// This function is run on the server +// and generates an OTP able to retrieve this remote user session +exposed Function getOTP(): Text + + return Session.createOTP() + +``` diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/Notes/updates.md b/i18n/ja/docusaurus-plugin-content-docs/current/Notes/updates.md index a21280ecd4432d..c326bbb7b7e105 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/Notes/updates.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/Notes/updates.md @@ -12,6 +12,7 @@ Read [**What’s new in 4D 21**](https://blog.4d.com/en-whats-new-in-4d-21/), th - 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. - 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. +- In client/server applications, use Qodly pages in Web areas and [share the remote client session](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). - 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). diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ORDA/privileges.md b/i18n/ja/docusaurus-plugin-content-docs/current/ORDA/privileges.md index 6de57ab1bd06c5..7c132e1778a823 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ORDA/privileges.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ORDA/privileges.md @@ -17,9 +17,11 @@ Webユーザーまたは RESTユーザーがログインすると、そのセッ ![schema](../assets/en/ORDA/privileges-schema.png) -### 参照 +:::tip Related Blog posts -詳細なアクセス権限アーキテクチャーの概要については、[**完全な権限システムでデータアクセスをフィルタリングする**](https://blog.4d.com/ja/filter-access-to-your-data-with-a-complete-system-of-permissions/) ブログ記事を参照ください。 +[**Filter access to your data with a complete system of permissions**](https://blog.4d.com/filter-access-to-your-data-with-a-complete-system-of-permissions/) + +::: ## Resources @@ -77,7 +79,7 @@ Webユーザーまたは RESTユーザーがログインすると、そのセッ 権限は、複数の "リソース+アクション" の組み合わせと関連付けることができます。 また、一つのアクションに複数の権限を関連付けることができます。 権限は、他の権限を含むことができます。 -- 権限やロールの **作成** は `roles.json` ファイル内にておこないます (後述参照)。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 +- 権限やロールの **作成** は `roles.json` ファイル内にておこないます (後述参照)。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 - 各ユーザーセッションに権限やロールを **許可** するには、`Session` クラスの [`.setPrivileges()`](../API/SessionClass.md#setprivileges) 関数を使用します。 @@ -123,7 +125,7 @@ exposed Function authenticate($identifier : Text; $password : Text)->$result : T { "privileges": [ { - "privilege": "none", + "privilege": "all", "includes": [] } ], @@ -135,12 +137,12 @@ exposed Function authenticate($identifier : Text; $password : Text)->$result : T { "applyTo": "ds", "type": "datastore", - "read": ["none"], - "create": ["none"], - "update": ["none"], - "drop": ["none"], - "execute": ["none"], - "promote": ["none"] + "read": ["all"], + "create": ["all"], + "update": ["all"], + "drop": ["all"], + "execute": ["all"], + "promote": ["all"] } ] }, @@ -151,7 +153,8 @@ exposed Function authenticate($identifier : Text; $password : Text)->$result : T ``` -最高レベルのセキュリティのため、データストア ("ds") のすべての許諾アクションに "none" の権限名が割り当てられています。したがって、デフォルトでは `ds` オブジェクト全体へのデータアクセスが無効になっています。 この "none" 権限はセキュリティのため、使用も変更もしないことが推奨されています。Web や RESTリクエストから利用可能にしたい各リソースには、それ専用の権限を新たに追加することが推奨されています ([以下の例を参照](#権限設定の例))。 +For a highest level of security, the "all" privilege is assigned to all permissions in the datastore, thus data access on the whole `ds` object is disabled by default. The principle is as follows: assigning a permission is like putting a lock on a door. Only sessions with privilege having the corresponding key (i.e., a permission) will be able to open the lock. +この "none" 権限はセキュリティのため、使用も変更もしないことが推奨されています。Web や RESTリクエストから利用可能にしたい各リソースには、それ専用の権限を新たに追加することが推奨されています ([以下の例を参照](#権限設定の例))。 :::caution @@ -266,14 +269,14 @@ End if ## 権限設定の例 -グッドプラクティスは、"none" 権限によってすべてのデータアクセスをデフォルトでロックしておき、`roles.json` ファイルを設定して、許可されたセッションにのみ限定的に一部を開放することです。 たとえば、制限されたアクセスをゲストセッションに対して許可する場合: +The good practice is to keep all data access locked by default thanks to the "all" privilege and to configure the `roles.json` file to only open controlled parts to authorized sessions. For example, to allow some accesses to "guest" sessions: ```json title="/Project/Sources/roles.json" { "privileges": [ { - "privilege": "none", + "privilege": "all", "includes": [] } ], @@ -284,22 +287,22 @@ End if "applyTo": "ds", "type": "datastore", "read": [ - "none" + "all" ], "create": [ - "none" + "all" ], "update": [ - "none" + "all" ], "drop": [ - "none" + "all" ], "execute": [ - "none" + "all" ], "promote": [ - "none" + "all" ] }, { diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/WebServer/sessions.md b/i18n/ja/docusaurus-plugin-content-docs/current/WebServer/sessions.md index 2384060e4e9aff..aef3a4ae864205 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/WebServer/sessions.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/WebServer/sessions.md @@ -213,6 +213,12 @@ End if 4D では、OTP セッショントークンは外部URL を呼び出して、それが他のブラウザや他のデバイス(モバイル/PC) でコールバックされる場合に特に有用です。 通常、こういったサードパーティアプリケーションはコールバックリンクが入った確認メールを送信してきて、ユーザーはこれをクリックする必要があります。 コールバックリンクにはOTP トークンが含まれており、そのコールバックをトリガーしたセッションは、そのデータと権限とともにロードされます。 この原理により、同じセッションを複数のデバイス間で共有することができます。 このアーキテクチャーのおかげで、[セッションクッキー](#session-implementation) はネットワークに公開されることはないため、中間者攻撃のリスクを排除することができます。 +:::tips 関連したblog 記事 + +[Connect Your Web Apps to Third-Party Systems](https://blog.4d.com/connect-your-web-apps-to-third-party-systems/) + +::: + ### 概要 4D Web アプリケーションにおけるOTP セッショントークンの利用の基本的なシーケンスは、以下の通りです: @@ -477,8 +483,4 @@ Function validateEmail() : 4D.OutgoingMessage セッショントークンのライフパンと、セッションのライフスパンの両方がどちらも失効していない場合に限り、トークンを使用してセッションを復元することができます。 それ以外の場合(セッショントークンが失効している、またはセッション自身が失効している)には、セッショントークンをもったWeb リクエストが受信されたときにゲストセッションが作成されます。 -:::note - -より詳細な情報に関しては、[Connect Your Web Apps to Third-Party Systems](https://blog.4d.com/connect-your-web-apps-to-third-party-systems/) のblog 記事を参照して下さい。 -::: \ No newline at end of file diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md b/i18n/ja/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md index 977c5bcfec0991..57c10348740857 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md @@ -65,30 +65,42 @@ $chatHelper.reset() // Clear all previous messages and tools ### registerTool() -**registerTool**(*tool* : Object; *handler* : 4D.Function) +**registerTool**(*tool* : Object; *handler* : Object) -| 引数 | 型 | 説明 | -| --------- | --------------------------- | ---------------------------------------------------------------------------------------- | -| *tool* | Object | The tool definition object (or [OpenAITool](OpenAITool.md) instance) | -| *handler* | 4D.Function | The function to handle tool calls (optional if defined inside *tool*) | +| 引数 | 型 | 説明 | +| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| *tool* | Object | The tool definition object (or [OpenAITool](OpenAITool.md) instance) | +| *handler* | Object | The function to handle tool calls ([4D.Function](../../API/FunctionClass.md) or Object), optional if defined inside *tool* as *handler* property | Registers a tool with its handler function for automatic tool call handling. -If the handler is not provided, the tool's `handler` property will be used. + +The *handler* parameter can be: + +- A **4D.Function**: Direct handler function +- An **Object**: An object containing a `formula` property matching the tool function name The handler function receives an object containing the parameters passed from the OpenAI tool call. This object contains key-value pairs where the keys match the parameter names defined in the tool's schema, and the values are the actual arguments provided by the AI model. #### Register Tool Example ```4D -// Define a simple tool +// Example 1: Simple registration with direct handler var $tool:={type: "function"; function: {name: "get_weather"; description: "Get current weather"; parameters: {type: "object"; properties: {location: {type: "string"; description: "City name"}}}}} - -// Define a handler function that receives an argument { location: "a city" } var $handler:=Formula(return "Sunny, 25°C in "+$1.location) $chatHelper.registerTool($tool; $handler) -// or + +// Example 2: Tool with handler property (no second parameter needed) +var $tool:={name: "calculate"; description: "Perform calculations"; handler: Formula(return String(Num($1.expression)))} +$chatHelper.registerTool($tool) + +// Example 3: Using object notation $chatHelper.registerTool({tool: $tool; handler: $handler}) + +// Example 4: Handler as object with formula matching tool name +var $tool:={name: "getTime"; description: "Get current time"} +var $handlerObj:=cs.MyTimeTool.new() // class with a getTime function +$chatHelper.registerTool($tool; $handlerObj) ``` ### registerTools() @@ -99,34 +111,64 @@ $chatHelper.registerTool({tool: $tool; handler: $handler}) | ------------------- | ------- | -------------------------------------------------------- | | *toolsWithHandlers* | Variant | Object or Collection containing tools and their handlers | -Registers multiple tools at once. The parameter can be either an object with function names as keys, or a collection of tool objects. +Registers multiple tools at once. The parameter can be: + +- **Collection**: Array of tool objects (with handlers embedded or separate) +- **Object**: Object with function names as keys mapping to tool definitions +- **Object with `tools` attribute**: Object containing a `tools` collection and formula properties matching tool names #### Register Multiple Tools Example -```4D -// Simple approach: handlers defined directly in tools -var $weatherTool:={type: "function"; function: {name: "get_weather"; description: "Get current weather"; parameters: {type: "object"; properties: {location: {type: "string"; description: "City name"}}}}; \ - handler: Formula(return "Sunny, 25°C in "+$1.location)} -var $calculatorTool:={type: "function"; function: {name: "calculate"; description: "Perform calculations"; parameters: {type: "object"; properties: {expression: {type: "string"; description: "Math expression"}}}}; \ - handler: Formula(return String(Num($1.expression)))} +##### Example 1: Collection format with handlers in tools -var $tools:={} -$tools.get_weather:=$weatherTool -$tools.calculate:=$calculatorTool - -$chatHelper.registerTools($tools) +```4D +var $weatherTool:={name: "getWeather"; description: "Get current weather"; handler: Formula(return "Sunny, 25°C in "+$1.location)} +var $calculatorTool:={name: "calculate"; description: "Perform calculations"; handler: Formula(return String(Num($1.expression)))} -// Using collection format $chatHelper.registerTools([$weatherTool; $calculatorTool]) +``` -// Alternative: separate tool definitions from handlers (useful for better code organization) +##### Example 2: Object format with separate tool and handler + +```4D var $toolsWithSeparateHandlers:={} -$toolsWithSeparateHandlers.get_weather:={tool: $weatherToolDefinition; handler: $weatherHandler} +$toolsWithSeparateHandlers.getWeather:={tool: $weatherToolDefinition; handler: $weatherHandler} $toolsWithSeparateHandlers.calculate:={tool: $calculatorToolDefinition; handler: $calculatorHandler} $chatHelper.registerTools($toolsWithSeparateHandlers) ``` +##### Example 3: Object with tools collection attribute and formula properties + +MyTools class: + +```4D + +Class constructor + this.tools:=[{name: "getWeather"; description: "Get current weather"}; \ + {name: "getTime"; description: "Get current time"}] // Collection of tool definitions + +Function getWeather($parameters: Object) + return "Sunny, 25°C" + +Function getTime($parameters: Object) + return String(Current time) +``` + +```4D +$chatHelper.registerTools(cs.MyTools.new()) +``` + +##### Example 4: Simple object format with tools as properties + +```4D +var $tools:={} +$tools.getWeather:=$weatherTool // Tool with handler property +$tools.calculate:=$calculatorTool // Tool with handler property + +$chatHelper.registerTools($tools) +``` + ### unregisterTool() **unregisterTool**(*functionName* : Text) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/commands/session.md b/i18n/ja/docusaurus-plugin-content-docs/current/commands/session.md index cc3f746f577e25..51566df49d8068 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/commands/session.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/commands/session.md @@ -57,6 +57,7 @@ Web ユーザーセッションに関する詳細な情報については、[Web - [サーバー上で実行](../Project/code-overview.md#サーバー上で実行) 属性を持つプロジェクトメソッド (クライアントプロセスの "双子" プロセスで実行されます) - トリガー +- ORDA [データモデル関数](../ORDA/ordaClasses.md) ([`local`](../ORDA/ordaClasses.md#ローカル関数) キーワードで宣言されたものを除く) - `On Server Open Connection` および `On Server Shutdown Connection` データベースメソッド リモートユーザーセッションの詳細については、[**リモートクライアントユーザーセッション**](../Desktop/clientServer.md#リモートユーザーセッション) の段落を参照ください。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md index 0d6d75fb599cdc..07ab072da0546c 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md @@ -2493,24 +2493,33 @@ propertyPath 比較演算子 値 {logicalOperator propertyPath 比較演算子 -**.sort**() : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection | 引数 | 型 | | 説明 | | ---------- | ---------- |:--:| ------------------------------------------ | +| ascOrDesc | Integer | -> | `ck ascending` または `ck descending` (スカラー値) | | methodName | Text | -> | 並べ替え順の指定に使用するメソッド名 | | extraParam | any | -> | methodName に渡す引数 | -| 戻り値 | Collection | <- | 並べ替えられた元のコレクション| - -| +| 戻り値 | Collection | <- | 並べ替えられた元のコレクション | + #### 説明 `.sort()` 関数は、 コレクションの要素を並べ替えます 。戻り値は並べ替えられた元のコレクションです。 > このコマンドは、元のコレクションを変更します。 -引数もなしに呼び出された場合、`.sort()` はスカラー値 (数値、テキスト、日付、ブール) のみを並べ替えます。 デフォルトでは、要素はそれぞれの型に応じて昇順で並べ替えられます。 コレクションが異なる型の要素を格納している場合、それらはまず型ごとにグループ分けされ、そのあとで並べ替えられます。 型は以下の順番で返されます: +引数もなしに呼び出された場合、`.sort()` はスカラー値 (数値、テキスト、日付、ブール) のみを並べ替えます。 デフォルトでは、要素はそれぞれの型に応じて昇順で並べ替えられます。 You can also pass one of the following constants in the *ascOrDesc* parameter: + + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + + コレクションが異なる型の要素を格納している場合、それらはまず型ごとにグループ分けされ、そのあとで並べ替えられます。 型は以下の順番で返されます: 1. null 2. ブール diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md index af2c9912058cc4..b073eab4be9478 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md @@ -3199,16 +3199,17 @@ $r:=$c.reduceRight(Formula($1.accumulator*=$1.value); 1) // 戻り値は 86400 -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection -| 引数 | 型 | | 説明 | -| ---------- | --------------------------- | :-------------------------: | ---------------- | -| formula | 4D.Function | -> | フォーミュラオブジェクト | -| methodName | Text | -> | メソッド名 | -| extraParam | any | -> | methodName に渡す引数 | -| 戻り値 | Collection | <- | 並べ替えられた元のコレクション | +| 引数 | 型 | | 説明 | +| ---------- | --------------------------- | :-------------------------: | ------------------------------------------------------------- | +| ascOrDesc | Integer | -> | `ck ascending` または `ck descending` (スカラー値) | +| formula | 4D.Function | -> | フォーミュラオブジェクト | +| methodName | Text | -> | メソッド名 | +| extraParam | any | -> | methodName に渡す引数 | +| 戻り値 | Collection | <- | 並べ替えられた元のコレクション | @@ -3218,7 +3219,19 @@ $r:=$c.reduceRight(Formula($1.accumulator*=$1.value); 1) // 戻り値は 86400 > このコマンドは、元のコレクションを変更します。 -引数もなしに呼び出された場合、`.sort()` はスカラー値 (数値、テキスト、日付、ブール) のみを並べ替えます。 デフォルトでは、要素はそれぞれの型に応じて昇順で並べ替えられます。 コレクションが異なる型の要素を格納している場合、それらはまず型ごとにグループ分けされ、そのあとで並べ替えられます。 型は以下の順番で返されます: +引数もなしに呼び出された場合、`.sort()` はスカラー値 (数値、テキスト、日付、ブール) のみを並べ替えます。 デフォルトでは、要素はそれぞれの型に応じて昇順で並べ替えられます。 +You can also pass one of the following constants in the *ascOrDesc* parameter: + + ``` + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + ``` + +コレクションが異なる型の要素を格納している場合、それらはまず型ごとにグループ分けされ、そのあとで並べ替えられます。 型は以下の順番で返されます: 1. null 2. ブール diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md index 270e7a3445365d..8b48ab34a4cdc2 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md @@ -120,7 +120,7 @@ $isGuest:=Session.isGuest() // $isGuest は true | 引数 | 型 | | 説明 | | -------- | ------- | :-------------------------: | ------------------------------------ | | lifespan | Integer | -> | セッショントークンの有効期限(秒) | -| 戻り値 | Text | <- | セッションのUUID | +| 戻り値 | Text | <- | UUID of the OTP token | diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Notes/updates.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Notes/updates.md index 3498d70a8f97a6..cd7d334e1e8858 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Notes/updates.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Notes/updates.md @@ -42,7 +42,7 @@ title: リリースノート - [*MeCab* ライブラリー](../settings/database.md#mecab日本語版のサポート) は今後廃止予定となり、次のリリースでは削除される予定です。 - [`Session.createOTP()`](../API/SessionClass.md#createotp) および[`Session.restore()`](../API/SessionClass.md#restore) の新関数を使用して管理することで、[セッショントークン](../WebServer/sessions.md#session-token-otp) がサポートされるようになりました。 - ラベルウィザードは、[ラベルデザインエリア](../Desktop/labels.md#ラベルプレビューエリア) においてフォーミュラを追加または編集する際にフォーミュラエディターを使用するようになりました。 -- 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. +- TCP サーバー接続を作成するための新しい[`TCPListener`](../API/TCPListenerClass.md) クラス。関連クラスに新しいプロパティが追加されました。[`TCPConnection`](../API/TCPConnectionClass.md) クラスに`address`、`listener` および `port`。[`TCPEvent`](../API/TCPEventClass.md) クラスに `address` および `port`。 - [ライブチェッカーとコンパイラー](../code-editor/write-class-method.md#warnings-and-errors).において、廃止予定のコマンドと定数は、特定の警告を生成するようになりました。 [`Command name`](../commands/command-name.md) コマンドを使用することで、コマンドが廃止予定かどうかを知ることができます。 - 新しいコマンド[WA SET CONTEXT](../commands/wa-set-context.md) および [WA Get context](../commands/wa-get-context.md) を使用して、Web エリア内の[$4d](../FormObjects/webArea_overview.md#4d-object) コンテンツを管理することができるようになります。 - 新しい[`RDP optimization` データベースパラメーター](../commands-legacy/set-database-parameter.md#rdp-optimization-133) を使用して、例えば4D をリモートデスクトッププロトコルを使用している場合の共有クリップボードを最適化することができます。 @@ -104,7 +104,7 @@ title: リリースノート - 4Dランゲージ: - 新コマンド: [Process info](../commands/process-info.md)、 [Session info](../commands/session-info.md)、 [SET WINDOW DOCUMENT ICON](../commands/set-window-document-icon.md) - 変更されたコマンド: [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\*". + - 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). 廃止予定のコマンドには "\*O\*" の接頭辞がつけられます。 - 4D Write Pro: - 新コマンド: [WP DELETE SECTION](../WritePro/commands/wp-delete-section.md) - 変更されたコマンド: [WP DELETE SUBSECTION](../WritePro/commands/wp-delete-subsection.md) および [WP RESET ATTRIBUTES](../WritePro/commands/wp-reset-attributes.md) @@ -123,7 +123,7 @@ title: リリースノート #### ハイライト - [オブジェクト参照](../Concepts/dt_object.md#オブジェクト演算子) と [コレクション参照](../Concepts/dt_collection.md#コレクション演算子) を対象とした比較演算子をサポート。 [`collection.query()`](../API/CollectionClass.md#query) は、[オブジェクト参照やコレクション参照をクエリの値](../API/CollectionClass.md#オブジェクト参照やコレクション参照で検索する) としてサポートするようになりました。 [`collection.query()`](../API/CollectionClass.md#query) は、[オブジェクト参照やコレクション参照をクエリの値](../API/CollectionClass.md#オブジェクト参照やコレクション参照で検索する) としてサポートするようになりました。 -- When a component has a [declared namespace](../Extensions/develop-components.md#declaring-the-component-namespace), its classes are now automatically shared between all loaded components in the host project via [`cs.`](../Concepts/classes.md#cs). +- [宣言された名前空間](../Extensions/develop-components.md#コンポーネント名前空間の宣言) をコンポーネントが持つ場合、そのクラスは [`cs.`](../Concepts/classes.md#cs). - コンポーネントマネージャー: [GitHub に保存されたコンポーネント](../Project/components.md#github-に保存されたコンポーネント) のサポート。 - 新しい [`entitySelection.clean()`](../API/EntitySelectionClass.md#clean) 関数と [`$clean`](../REST/$clean.md) REST API が追加されました。これらは、対象のエンティティセレクションから削除済みエンティティを除外したエンティティセレクションを新規に取得します。 - セッションの権限を確認し、デバッグを容易にするための新しい [`session.getPrivileges()`](../API/SessionClass.md#getprivileges) 関数と [`$info/privileges`](../REST/$info.md) REST API が追加されました。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ORDA/entities.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ORDA/entities.md index 1230651ecf9438..29e1132a0df443 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ORDA/entities.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ORDA/entities.md @@ -572,11 +572,11 @@ ORDA では、以下の二つのロックモードを提供しています: オプティミスティック・ロックの動作は以下ように図解することができます: -1. Two processes load the same entity.

    ![](../assets/en/ORDA/optimisticLock1.png) +1. 二つのプロセスが同じエンティティを読み込んだとします。

    ![](../assets/en/ORDA/optimisticLock1.png) -2. 最初のプロセスがエンティティを編集し、それを保存しようとします。 すると `entity.save()` メソッドが呼び出されます。 4Dエンジンは、編集されたエンティティの内部スタンプ値とデータに保存されているエンティティの内部スタンプ値を自動的に比較します。 Since they match, the entity is saved and its stamp value is incremented.

    ![](../assets/en/ORDA/optimisticLock2.png) +2. 最初のプロセスがエンティティを編集し、それを保存しようとします。 すると `entity.save()` メソッドが呼び出されます。 4Dエンジンは、編集されたエンティティの内部スタンプ値とデータに保存されているエンティティの内部スタンプ値を自動的に比較します。 これは合致しますので、エンティティは保存され、その内部スタンプ値はインクリメントされます。

    ![](../assets/en/ORDA/optimisticLock2.png) -3. 二つ目のプロセスも読み込んだエンティティを編集し、それを保存しようとします。 すると `entity.save()` メソッドが呼び出されます。 Since the stamp value of the modified entity does not match the one of the entity stored in the data, the save is not performed and an error is returned.

    ![](../assets/en/ORDA/optimisticLock3.png) +3. 二つ目のプロセスも読み込んだエンティティを編集し、それを保存しようとします。 すると `entity.save()` メソッドが呼び出されます。 編集されたエンティティの内部スタンプ値はデータに保存されているエンティティの内部スタンプ値と合致しないので、保存は実行されず、エラーが返されます。

    ![](../assets/en/ORDA/optimisticLock3.png) この流れは以下のコードのように分解することもできます: diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ORDA/privileges.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ORDA/privileges.md index 6de57ab1bd06c5..4a1dcab564b42c 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ORDA/privileges.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ORDA/privileges.md @@ -77,7 +77,7 @@ Webユーザーまたは RESTユーザーがログインすると、そのセッ 権限は、複数の "リソース+アクション" の組み合わせと関連付けることができます。 また、一つのアクションに複数の権限を関連付けることができます。 権限は、他の権限を含むことができます。 -- 権限やロールの **作成** は `roles.json` ファイル内にておこないます (後述参照)。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 +- 権限やロールの **作成** は `roles.json` ファイル内にておこないます (後述参照)。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 - 各ユーザーセッションに権限やロールを **許可** するには、`Session` クラスの [`.setPrivileges()`](../API/SessionClass.md#setprivileges) 関数を使用します。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Preferences/methods.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Preferences/methods.md index 104edd687aa66f..e1e76859c3dc67 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Preferences/methods.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/Preferences/methods.md @@ -179,8 +179,8 @@ The corresponding [clipboard shorcuts](../code-editor/write-class-method.md#clip このエリアでは、コードエディターの自動補完メカニズムを設定して、作業習慣に合わせることができます。 -| | 説明 | -| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ウィンドウを自動で開く | 次の要素に関する提案ウィンドウを自動で開くかを指定します:
    • 定数
    • 変数(ローカルまたはインタープロセス)あるいはオブジェクト属性
    • テーブル
    • プロトタイプ (例: クラス関数)

    たとえば、"変数(ローカルまたはインタープロセス)あるいはオブジェクト属性" オプションがチェックされている場合、$ 文字を入力すると提案されるローカル変数のリストが表示されます:

    ![](../assets/en/Preferences/suggestionsAutoOpen.png)

    対応するオプションのチェックを外すことで、要素ごとにこの機能を無効にできます。 | -| 提案の決定 | Sets the entry context that allows the Code Editor to validate automatically the current suggestion displayed in the autocomplete window.
    • **Tab and delimiters**
      When this option is selected, you can validate the current selection with the Tab key or any delimiter that is relevant to the context. たとえば "ALE" と入力して "(" を入力すると、4Dは自動で "ALERT(" とエディターに書き込みます。 区切り文字は以下の通りです:
      ( ; : = < [ {
    • **タブのみ**
      このオプションが選択されていると、現在の提案はタブキーを押したときにのみ受け入れられます。 これは特に ${1} のように、要素名に区切り文字を入力することを容易にします。**注記**: ウィンドウ内をダブルクリックするか、改行キーを押すことで提案を受け入れることもできます。
    | +| | 説明 | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ウィンドウを自動で開く | 次の要素に関する提案ウィンドウを自動で開くかを指定します:
    • 定数
    • 変数(ローカルまたはインタープロセス)あるいはオブジェクト属性
    • テーブル
    • プロトタイプ (例: クラス関数)

    たとえば、"変数(ローカルまたはインタープロセス)あるいはオブジェクト属性" オプションがチェックされている場合、$ 文字を入力すると提案されるローカル変数のリストが表示されます:

    ![](../assets/en/Preferences/suggestionsAutoOpen.png)

    対応するオプションのチェックを外すことで、要素ごとにこの機能を無効にできます。 | +| 提案の決定 | コードエディターで、自動補完ウィンドウに表示されたカレントの提案を受け入れるための、入力コンテキストを設定します。
    • **タブと区切り文字**
      このオプションが選択されていると、タブキーまたは現在のコンテキストに関連する区切り文字で、現在選択されている提案を決定することができます。 たとえば "ALE" と入力して "(" を入力すると、4Dは自動で "ALERT(" とエディターに書き込みます。 区切り文字は以下の通りです:
      ( ; : = < [ {
    • **タブのみ**
      このオプションが選択されていると、現在の提案はタブキーを押したときにのみ受け入れられます。 これは特に ${1} のように、要素名に区切り文字を入力することを容易にします。**注記**: ウィンドウ内をダブルクリックするか、改行キーを押すことで提案を受け入れることもできます。
    | 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 aeb7eb3fec6b9b..c812bdf38cbf0c 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 @@ -31,20 +31,20 @@ title: 依存関係 ::: -## Components made by 4D - -4D includes a set of components developed in-house. They can also be found in the [4D github repository](https://github.com/4d). - -| コンポーネント | 説明 | 主な機能 | -| -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| [4D AiIKit](https://github.com/4d/4D-AIKit) | サードパーティのOpenAI API に接続するためのクラス群 | `OpenAIChat`, `OpenAIImage`... | -| [4D Labels](https://github.com/4d/4D-Labels) | ラベルテンプレートを作成するための内部コンポーネント | | -| [4D NetKit](https://developer.4d.com/4D-NetKit) | サードパーティAPI に接続するためのWeb サービスツール群 | `OAuth2Provider` class, `New OAuth2 provider`, `OAuth2ProviderObject.getToken()` | -| [4D Progress](https://github.com/4d/4D-Progress) | 1つ以上の進捗バーを同じウィンドウで開く | `Progress New`, `Progress SET ON STOP METHOD`, `Progress SET PROGRESS`, ... | -| [4D SVG](https://github.com/4d/4D-SVG) | 一般的な svgグラフィックオブジェクトの作成・操作 | `SVGTool_Display_viewer`, 複数の `SVG_` メソッド | -| [4D ViewPro](ViewPro/getting-started.md) | フォームに追加できる表計算機能 | [4D View Pro ドキュメンテーション](ViewPro/getting-started.md) 参照。 | -| [4D Widgets](https://github.com/4d/4D-Widgets) | DatePicker, TimePicker, SearchPicker 4Dウィジェットの管理 | `DatePicker calendar`, `DateEntry area`, `TimeEntry`, `SearchPicker SET HELP TEXT`, ... | -| [4D WritePro Interface](https://github.com/4d/4D-WritePro-Interface) | Manage [4D Write Pro palettes](https://doc.4d.com/4Dv20R9/4D/20-R9/Entry-areas.300-7543821.en.html) and [table wizard](../WritePro/writeprointerface.md#table-wizard) | `WP PictureSettings`, `WP ShowTabPages`, `WP SwitchToolbar`, `WP UpdateWidget` | +## 4D製のコンポーネント + +4D には、自社で開発されたコンポーネントのセットが含まれています。 これらはすべて、[4D github リポジトリ](https://github.com/4d) にもあります。 + +| コンポーネント | 説明 | 主な機能 | +| -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| [4D AiIKit](https://github.com/4d/4D-AIKit) | サードパーティのOpenAI API に接続するためのクラス群 | `OpenAIChat`, `OpenAIImage`... | +| [4D Labels](https://github.com/4d/4D-Labels) | ラベルテンプレートを作成するための内部コンポーネント | | +| [4D NetKit](https://developer.4d.com/4D-NetKit) | サードパーティAPI に接続するためのWeb サービスツール群 | `OAuth2Provider` class, `New OAuth2 provider`, `OAuth2ProviderObject.getToken()` | +| [4D Progress](https://github.com/4d/4D-Progress) | 1つ以上の進捗バーを同じウィンドウで開く | `Progress New`, `Progress SET ON STOP METHOD`, `Progress SET PROGRESS`, ... | +| [4D SVG](https://github.com/4d/4D-SVG) | 一般的な svgグラフィックオブジェクトの作成・操作 | `SVGTool_Display_viewer`, 複数の `SVG_` メソッド | +| [4D ViewPro](ViewPro/getting-started.md) | フォームに追加できる表計算機能 | [4D View Pro ドキュメンテーション](ViewPro/getting-started.md) 参照。 | +| [4D Widgets](https://github.com/4d/4D-Widgets) | DatePicker, TimePicker, SearchPicker 4Dウィジェットの管理 | `DatePicker calendar`, `DateEntry area`, `TimeEntry`, `SearchPicker SET HELP TEXT`, ... | +| [4D WritePro Interface](https://github.com/4d/4D-WritePro-Interface) | [4D Write Pro](https://doc.4d.com/4Dv20R9/4D/20-R9/Entry-areas.300-7543821.ja.html) パレットと [表ウィザード](../WritePro/writeprointerface.md#表ウィザード) の管理 | `WP PictureSettings`, `WP ShowTabPages`, `WP SwitchToolbar`, `WP UpdateWidget` | ## コンポーネントの読み込み diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-copy-to-object.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-copy-to-object.md index 2b9a4361adb5fd..749f7fa9d1acad 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-copy-to-object.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-copy-to-object.md @@ -31,10 +31,10 @@ title: VP Copy to object 任意の *options* 引数として、以下のプロパティを渡すことができます。 -| プロパティ | 型 | 説明 | -| ----------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| copy | Boolean | コマンド実行後もコピーされた値、書式、数式が保持するには *true* (デフォルト)。 削除するには *false*。 | -| copyOptions | Integer | コピーまたは移動する内容を指定します。 Possible values:

    ValueDescription
    `vk clipboard options all` (default)Copies all data objects, including values, formatting, and formulas.
    `vk clipboard options formatting`Copies only the formatting.
    `vk clipboard options formulas`Copies only the formulas.
    `vk clipboard options formulas and formatting`Copies the formulas and formatting.
    `vk clipboard options values`Copies only the values.
    `vk clipboard options value and formatting`Copies the values and formatting.

    | +| プロパティ | 型 | 説明 | +| ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| copy | Boolean | コマンド実行後もコピーされた値、書式、数式が保持するには *true* (デフォルト)。 削除するには *false*。 | +| copyOptions | Integer | コピーまたは移動する内容を指定します。 取り得る値:

    詳細
    `vk clipboard options all` (デフォルト)値、書式、数式を含め、全てのデータオブジェクトをコピーします。
    `vk clipboard options formatting`書式のみをコピーします。
    `vk clipboard options formulas`数式のみをコピーします。
    `vk clipboard options formulas and formatting`数式と書式をコピーします。
    `vk clipboard options values`値のみをコピーします。
    `vk clipboard options value and formatting`値と書式をコピーします。

    | [ワークブックオプション](vp-set-workbook-options.md) で定義されている貼り付けオプションが考慮されます。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-find.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-find.md index b589bd67a50a0f..c394508d9bed5b 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-find.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-find.md @@ -27,14 +27,14 @@ title: VP Find 任意の *searchCondition* 引数を渡すことで、検索がどのように実行されるかを指定することができます。 以下のプロパティがサポートされています: -| プロパティ | 型 | 説明 | -| ----------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| afterColumn | Integer | 検索を開始するカラムの直前のカラムの番号。 *rangeObj* 引数が統合されたレンジの場合、渡されるカラムの番号は最初のレンジのものでなければなりません。 デフォルト値: -1 (*rangeObj* の最初) | -| afterRow | Integer | 検索を開始する行の直前の行番号。 *rangeObj* 引数が統合されたレンジの場合、渡される行番号は最初のレンジのものでなければなりません。 デフォルト値: -1 (*rangeObj* の最初) | -| all | Boolean |
  • true - *rangeObj* 内で *searchValue* の値に合致するセルはすべて返されます。
  • false - (デフォルト値) *rangeObj* 内で *searchValue* の値に合致する最初のセルのみが返されます。
  • | -| flags | Integer |
    `vk find flag exact match`セルの中身全体が検索値と完全に一致する必要があります
    `vk find flag ignore case`文字の大小は区別されません。 Ex: "a" is the same as "A".
    `vk find flag none`no search flags are considered (default)
    `vk find flag use wild cards`Wildcard characters (\*,?) を使用できます。 ワイルドカードは、すべての文字列の比較に使用することができ、ワイルドカードによって置き換わる文字の数は指定されません:
  • \* は 0 から複数文字に使用可能です (例: "bl*" を検索した場合、"bl"、"black"、"blob" などが合致します)。
  • ? は単一文字に使用可能です (例: "h?t" を検索した場合、"hot"、"hit" などが合致します)。
  • フラグは組み合わせることができます。 例: $search.flags:=vk find flag use wild cards+vk find flag ignore case | -| order | Integer |
    `vk find order by columns`検索がカラムごとに実行されます。 Each row of a column is searched before the search continues to the next column.
    `vk find order by rows`The search is performed by rows. 行の各カラムが検索されたあとに次の行へと移動します (デフォルト)。
    | -| target | Integer |
    `vk find target formula`セルフォーミュラ内で検索がおこなわれます。
    `vk find target tag`セルタグ内で検索がおこなわれます。
    `vk find target text`セルテキスト内で検索がおこなわれます (デフォルト)。

    フラグは組み合わせることができます。 例:$search.target:=vk find target formula+vk find target text

    | +| プロパティ | 型 | 説明 | +| ----------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| afterColumn | Integer | 検索を開始するカラムの直前のカラムの番号。 *rangeObj* 引数が統合されたレンジの場合、渡されるカラムの番号は最初のレンジのものでなければなりません。 デフォルト値: -1 (*rangeObj* の最初) | +| afterRow | Integer | 検索を開始する行の直前の行番号。 *rangeObj* 引数が統合されたレンジの場合、渡される行番号は最初のレンジのものでなければなりません。 デフォルト値: -1 (*rangeObj* の最初) | +| all | Boolean |
  • true - *rangeObj* 内で *searchValue* の値に合致するセルはすべて返されます。
  • false - (デフォルト値) *rangeObj* 内で *searchValue* の値に合致する最初のセルのみが返されます。
  • | +| flags | Integer |
    `vk find flag exact match`セルの中身全体が検索値と完全に一致する必要があります
    `vk find flag ignore case`文字の大小は区別されません。 例: "a" と "A" は同じとみなされます。
    `vk find flag none`検索フラグは指定されていません(デフォルト)
    `vk find flag use wild cards`検索文字列においてワイルドカード文字(\*,?)を使用 を使用できます。 ワイルドカードは、すべての文字列の比較に使用することができ、ワイルドカードによって置き換わる文字の数は指定されません:
  • \* は 0 から複数文字に使用可能です (例: "bl*" を検索した場合、"bl"、"black"、"blob" などが合致します)。
  • ? は単一文字に使用可能です (例: "h?t" を検索した場合、"hot"、"hit" などが合致します)。
  • フラグは組み合わせることができます。 例: $search.flags:=vk find flag use wild cards+vk find flag ignore case | +| order | Integer |
    `vk find order by columns`検索がカラムごとに実行されます。 カラムの各行が検索されたあとに次のカラムへと移動します。
    `vk find order by rows`検索は行ごとに実行されます。 行の各カラムが検索されたあとに次の行へと移動します (デフォルト)。
    | +| target | Integer |
    `vk find target formula`セルフォーミュラ内で検索がおこなわれます。
    `vk find target tag`セルタグ内で検索がおこなわれます。
    `vk find target text`セルテキスト内で検索がおこなわれます (デフォルト)。

    フラグは組み合わせることができます。 例:$search.target:=vk find target formula+vk find target text

    | 任意の *replaceValue* 引数として、*rangeObj* 内で見つかった *searchValue* の値のテキストを置換するテキストを渡すことができます。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-import-document.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-import-document.md index fb5d194e51221b..d2178137e0151b 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-import-document.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-import-document.md @@ -43,33 +43,33 @@ title: VP IMPORT DOCUMENT 任意の *paramObj* 引数を渡すことで、読み込まれるドキュメントのプロパティを定義することができます: -| 引数 | | 型 | 説明 | -| ------------ | ------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| formula | | 4D.Function | 読み込み終了時に実行させるコールバックメソッド。 [`Formula`](../../commands/formula.md) コマンドの戻り値フォーミュラを使用する必要があります。 [コールバックメソッド (フォーミュラ) の渡し方](vp-export-document.md#コールバックメソッド-フォーミュラ-の渡し方) を参照ください。 | -| password | | text | Microsoft Excel のみ (任意) - MS Excel ドキュメントの保護に使用されているパスワード。 | -| csvOptions | | object | CSV読み込みのオプション | -| | range | object | 書き出されるデータの、最初のセルを格納しているセルレンジ。 指定されたレンジがセルレンジではない場合、レンジの最初のセルが使用されます。 | -| | rowDelimiter | text | 行の区切り文字。 渡されなかった場合、区切り文字は 4D によって自動的に定義されます。 | -| | columnDelimiter | text | カラムの区切り文字。 デフォルト: "," | -| sjsOptions | | object | sjs 読み込みのオプション | -| | calcOnDemand | boolean | 要求されたときにだけフォーミュラを計算するかどうか。デフォルトは false。 | -| | dynamicReferences | boolean | 動的参照を含む関数を計算するかどうか。デフォルトは true。 | -| | fullRecalc | boolean | jsonデータを読み込んだ後に計算するかどうか。デフォルトは false。 | -| | includeFormulas | boolean | 読み込み時にフォーミュラを含めるかどうか。デフォルトは true。 | -| | includeStyles | boolean | 読み込み時にスタイルを含めるかどうか。デフォルトは true。 | -| | includeUnusedStyles | boolean | excel xml を json に変換する際、使用されていないカスタム名を含めるかどうか。デフォルトは true。 | -| | openMode | integer |
  • 0 (normal): 通常のオープンモード、レイジーなし、インクリメンタルなし。 When opening file, UI and UI event could be refreshed and responsive at specific time points.
  • 1 (lazy): lazy open mode. ファイルを開くと、アクティブなシートだけが直接読み込まれます。 Other sheets will be loaded only when they are be used.
  • 2 (incremental): incremental open mode. ファイルを開くと、データ読み込み中に UI と UIイベントが更新され、即座に応答します。
  • | -| excelOptions | | object | Excel のみ (任意) - Excel 書き出しのオプション | -| | includeStyles | boolean | Whether to include the style when importing, default true. | -| | includeFormulas | boolean | Whether to include the formula when importing, default true. | -| | frozenColumnsAsRowHeaders | boolean | Whether to treat the frozen columns as row headers when importing, default false. | -| | frozenRowsAsColumnHeaders | boolean | Whether to treat the frozen rows as column headers when importing, default false. | -| | fullRecalc | boolean | jsonデータを読み込んだ後に計算するかどうか。デフォルトは false。 | -| | dynamicReferences | boolean | Whether to calculate functions with dynamic reference, default true. | -| | calcOnDemand | boolean | Whether to calculate formulas only when they are demanded, default false. | -| | includeUnusedStyles | boolean | Whether to include the unused name style when converting excel xml to the json, default true. | -| | password | text | The password to open the workbook. | -| | openMode | text | The open mode of normal, lazy and incremental. By default is normal. | +| 引数 | | 型 | 説明 | +| ------------ | ------------------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| formula | | 4D.Function | 読み込み終了時に実行させるコールバックメソッド。 [`Formula`](../../commands/formula.md) コマンドの戻り値フォーミュラを使用する必要があります。 [コールバックメソッド (フォーミュラ) の渡し方](vp-export-document.md#コールバックメソッド-フォーミュラ-の渡し方) を参照ください。 | +| password | | text | Microsoft Excel のみ (任意) - MS Excel ドキュメントの保護に使用されているパスワード。 | +| csvOptions | | object | CSV読み込みのオプション | +| | range | object | 書き出されるデータの、最初のセルを格納しているセルレンジ。 指定されたレンジがセルレンジではない場合、レンジの最初のセルが使用されます。 | +| | rowDelimiter | text | 行の区切り文字。 渡されなかった場合、区切り文字は 4D によって自動的に定義されます。 | +| | columnDelimiter | text | カラムの区切り文字。 デフォルト: "," | +| sjsOptions | | object | sjs 読み込みのオプション | +| | calcOnDemand | boolean | 要求されたときにだけフォーミュラを計算するかどうか。デフォルトは false。 | +| | dynamicReferences | boolean | 動的参照を含む関数を計算するかどうか。デフォルトは true。 | +| | fullRecalc | boolean | jsonデータを読み込んだ後に計算するかどうか。デフォルトは false。 | +| | includeFormulas | boolean | 読み込み時にフォーミュラを含めるかどうか。デフォルトは true。 | +| | includeStyles | boolean | 読み込み時にスタイルを含めるかどうか。デフォルトは true。 | +| | includeUnusedStyles | boolean | excel xml を json に変換する際、使用されていないカスタム名を含めるかどうか。デフォルトは true。 | +| | openMode | integer |
  • 0 (normal): 通常のオープンモード、レイジーなし、インクリメンタルなし。 ファイルを開くと、特定の時点で UI と UIイベントが更新され、応答します。
  • 1 (lazy): レイジー (遅延) オープンモード。 ファイルを開くと、アクティブなシートだけが直接読み込まれます。 他のシートは使用された場合にのみ読み込まれます。
  • 2 (incremental): インクリメンタル (増分) オープンモード。 ファイルを開くと、データ読み込み中に UI と UIイベントが更新され、即座に応答します。
  • | +| excelOptions | | object | Excel のみ (任意) - Excel 書き出しのオプション | +| | includeStyles | boolean | Whether to include the style when importing, default true. | +| | includeFormulas | boolean | Whether to include the formula when importing, default true. | +| | frozenColumnsAsRowHeaders | boolean | Whether to treat the frozen columns as row headers when importing, default false. | +| | frozenRowsAsColumnHeaders | boolean | Whether to treat the frozen rows as column headers when importing, default false. | +| | fullRecalc | boolean | jsonデータを読み込んだ後に計算するかどうか。デフォルトは false。 | +| | dynamicReferences | boolean | Whether to calculate functions with dynamic reference, default true. | +| | calcOnDemand | boolean | Whether to calculate formulas only when they are demanded, default false. | +| | includeUnusedStyles | boolean | Whether to include the unused name style when converting excel xml to the json, default true. | +| | password | text | The password to open the workbook. | +| | openMode | text | The open mode of normal, lazy and incremental. By default is normal. | :::note 注記 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-move-cells.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-move-cells.md index 27ab6577dddbc8..03f3d2c2bcd672 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-move-cells.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/ViewPro/commands/vp-move-cells.md @@ -35,10 +35,10 @@ title: VP MOVE CELLS *options* は、複数のプロパティを持ちます: -| プロパティ | 型 | 説明 | -| ------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| copy | Boolean | *originRange* のセルの値・書式・フォーミュラをコマンド実行後に削除するかどうかを指定します:
    • 削除するには *false* (デフォルト)。
    • 保持するには *true*。
    | -| pasteOptions | Integer | ペーストする内容を指定します。 Possible values:

    ValueDescription
    `vk clipboard options all` (default)Pastes all data objects, including values, formatting, and formulas.
    `vk clipboard options formatting`Pastes only the formatting.
    `vk clipboard options formulas`Pastes only the formulas.
    `vk clipboard options formulas and formatting`Pastes the formulas and formatting.
    `vk clipboard options values`Pastes only the values.
    `vk clipboard options value and formatting`Pastes the values and formatting.

    | +| プロパティ | 型 | 説明 | +| ------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| copy | Boolean | *originRange* のセルの値・書式・フォーミュラをコマンド実行後に削除するかどうかを指定します:
    • 削除するには *false* (デフォルト)。
    • 保持するには *true*。
    | +| pasteOptions | Integer | ペーストする内容を指定します。 取り得る値:

    詳細
    `vk clipboard options all` (デフォルト)値、書式、数式を含め、全てのデータオブジェクトをペーストします。
    `vk clipboard options formatting`書式のみをペーストします。
    `vk clipboard options formulas`数式のみをペーストします。
    `vk clipboard options formulas and formatting`Pastes the formulas and formatting.
    `vk clipboard options values`Pastes only the values.
    `vk clipboard options value and formatting`Pastes the values and formatting.

    | [ワークブックオプション](vp-set-workbook-options.md) で定義されている貼り付けオプションが考慮されます。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/commands/zip-create-archive.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/commands/zip-create-archive.md index c3c5ff6bb757ff..d50cc6444f93f9 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/commands/zip-create-archive.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R10/commands/zip-create-archive.md @@ -40,14 +40,14 @@ displayed_sidebar: docs - *zipStructure*: ZIPArchive オブジェクトを表すオブジェクトを引数として渡します。 以下のプロパティを利用して、このオブジェクトを定義することが可能です: -| プロパティ | 型 | 説明 | -| ----------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| compression | Integer |
  • `ZIP Compression standard`: Deflate圧縮 (デフォルト)
  • `ZIP Compression LZMA`: LZMA圧縮
  • `ZIP Compression XZ`: XZ圧縮
  • `ZIP Compression none`: 圧縮なし
  • | -| level | Integer | 圧縮レベル。 とりうる値: 1 - 10。 低い値ではファイルが大きくなり、高い値ではファイルが小さくなります。 ただし、圧縮レベルはパフォーマンスに影響します。 デフォルト値 (省略時):
  • `ZIP Compression standard`: 6
  • `ZIP Compression LZMA`: 4
  • `ZIP Compression XZ`: 4
  • | -| encryption | Integer | パスワードが設定されていた場合に使用する暗号化方法:
  • `ZIP Encryption AES128`: 128-bit キーを使用したAES 暗号化。
  • `ZIP Encryption AES192`: AES encryption using 192-bit key.
  • `ZIP Encryption AES256`: AES encryption using 256-bit キーを使用したAES 暗号化 (パスワードが設定されていた場合のデフォルト)。
  • `ZIP Encryption none`: 暗号化なし(パスワードが設定されていない場合のデフォルト)
  • | -| password | Text | 暗号化が必要な場合に使用するパスワード | -| files | Collection |
  • `4D.File` または` 4D.Folder` オブジェクトのコレクション
  • 以下のプロパティを持ったオブジェクトのコレクション:
  • プロパティタイプ説明
    source4D.File または 4D.FolderFile または Folder
    destinationText(任意) - アーカイブのコンテンツ構成を変更するための相対ファイルパス
    optionnumber(任意) - `ZIP Ignore invisible files` で非表示ファイルを無視、0 を渡すと全ファイルを圧縮
    | -| callback | 4D.Function | $1 に圧縮の進捗 (0 - 100) を受け取るコールバックフォーミュラ | +| プロパティ | 型 | 説明 | +| ----------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| compression | Integer |
  • `ZIP Compression standard`: Deflate圧縮 (デフォルト)
  • `ZIP Compression LZMA`: LZMA圧縮
  • `ZIP Compression XZ`: XZ圧縮
  • `ZIP Compression none`: 圧縮なし
  • | +| level | Integer | 圧縮レベル。 とりうる値: 1 - 10。 低い値ではファイルが大きくなり、高い値ではファイルが小さくなります。 ただし、圧縮レベルはパフォーマンスに影響します。 デフォルト値 (省略時):
  • `ZIP Compression standard`: 6
  • `ZIP Compression LZMA`: 4
  • `ZIP Compression XZ`: 4
  • | +| encryption | Integer | パスワードが設定されていた場合に使用する暗号化方法:
  • `ZIP Encryption AES128`: 128-bit キーを使用したAES 暗号化。
  • `ZIP Encryption AES192`: 192-bit キーを使った AES による暗号化。
  • `ZIP Encryption AES256`: AES encryption using 256-bit キーを使用したAES 暗号化 (パスワードが設定されていた場合のデフォルト)。
  • `ZIP Encryption none`: 暗号化なし(パスワードが設定されていない場合のデフォルト)
  • | +| password | Text | 暗号化が必要な場合に使用するパスワード | +| files | Collection |
  • `4D.File` または` 4D.Folder` オブジェクトのコレクション
  • 以下のプロパティを持ったオブジェクトのコレクション:
  • プロパティタイプ説明
    source4D.File または 4D.FolderFile または Folder
    destinationText(任意) - アーカイブのコンテンツ構成を変更するための相対ファイルパス
    optionnumber(任意) - `ZIP Ignore invisible files` で非表示ファイルを無視、0 を渡すと全ファイルを圧縮
    | +| callback | 4D.Function | $1 に圧縮の進捗 (0 - 100) を受け取るコールバックフォーミュラ | *destinationFile* には、作成する ZIPアーカイブ (名前や位置など) を記述する `4D.File` オブジェクトを渡します。 作成した ZIPアーカイブがあらゆるソフトウェアで自動的に処理されるようにするため、".zip" 拡張子の使用が推奨されます。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md index af2c9912058cc4..b073eab4be9478 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md @@ -3199,16 +3199,17 @@ $r:=$c.reduceRight(Formula($1.accumulator*=$1.value); 1) // 戻り値は 86400 -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection -| 引数 | 型 | | 説明 | -| ---------- | --------------------------- | :-------------------------: | ---------------- | -| formula | 4D.Function | -> | フォーミュラオブジェクト | -| methodName | Text | -> | メソッド名 | -| extraParam | any | -> | methodName に渡す引数 | -| 戻り値 | Collection | <- | 並べ替えられた元のコレクション | +| 引数 | 型 | | 説明 | +| ---------- | --------------------------- | :-------------------------: | ------------------------------------------------------------- | +| ascOrDesc | Integer | -> | `ck ascending` または `ck descending` (スカラー値) | +| formula | 4D.Function | -> | フォーミュラオブジェクト | +| methodName | Text | -> | メソッド名 | +| extraParam | any | -> | methodName に渡す引数 | +| 戻り値 | Collection | <- | 並べ替えられた元のコレクション | @@ -3218,7 +3219,19 @@ $r:=$c.reduceRight(Formula($1.accumulator*=$1.value); 1) // 戻り値は 86400 > このコマンドは、元のコレクションを変更します。 -引数もなしに呼び出された場合、`.sort()` はスカラー値 (数値、テキスト、日付、ブール) のみを並べ替えます。 デフォルトでは、要素はそれぞれの型に応じて昇順で並べ替えられます。 コレクションが異なる型の要素を格納している場合、それらはまず型ごとにグループ分けされ、そのあとで並べ替えられます。 型は以下の順番で返されます: +引数もなしに呼び出された場合、`.sort()` はスカラー値 (数値、テキスト、日付、ブール) のみを並べ替えます。 デフォルトでは、要素はそれぞれの型に応じて昇順で並べ替えられます。 +You can also pass one of the following constants in the *ascOrDesc* parameter: + + ``` + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + ``` + +コレクションが異なる型の要素を格納している場合、それらはまず型ごとにグループ分けされ、そのあとで並べ替えられます。 型は以下の順番で返されます: 1. null 2. ブール diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md index 5078f857426cfd..f64c49d0ac63fc 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md @@ -117,7 +117,7 @@ $isGuest:=Session.isGuest() // $isGuest は true | 引数 | 型 | | 説明 | | -------- | ------- | :-------------------------: | ------------------------------------ | | lifespan | Integer | -> | セッショントークンの有効期限(秒) | -| 戻り値 | Text | <- | セッションのUUID | +| 戻り値 | Text | <- | UUID of the OTP token | diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/Concepts/classes.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/Concepts/classes.md index c7be01925afdd3..fd55e231f7dbd0 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/Concepts/classes.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/Concepts/classes.md @@ -613,13 +613,13 @@ Class constructor ($side : Integer) ### `Super` -[`Super`](../commands/super.md) コマンドを使用すると、[`スーパークラス`](../API/ClassClass#superclass)、つまり関数の親クラスを呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 +[`Super`](../commands/super.md) コマンドを使用すると、[`スーパークラス`](../API/ClassClass#superclass)、つまり関数の親クラスを呼び出すことができます。 これは[Class constructor](#class-constructor) またはクラス関数コード内で呼び出すことができます。 詳細な情報については、[`Super`](../commands/super.md) コマンドの説明を参照してください。 ### `This` -[`This`](../commands/this.md) コマンドは現在処理されているオブジェクトへの参照を返します。 多くの場合、`This` の値はクラス関数がどのように呼ばれたかによって決まります。 通常、`This` は、まるでその関数がオブジェクト上にあるかのように、関数が呼ばれたオブジェクトを参照します。 多くの場合、`This` の値はクラス関数がどのように呼ばれたかによって決まります。 通常、`This` は、まるでその関数がオブジェクト上にあるかのように、関数が呼ばれたオブジェクトを参照します。 +[`This`](../commands/this.md) コマンドは現在処理されているオブジェクトへの参照を返します。 多くの場合、`This` の値はクラス関数がどのように呼ばれたかによって決まります。 通常、`This` は、まるでその関数がオブジェクト上にあるかのように、関数が呼ばれたオブジェクトを参照します。 例: @@ -714,7 +714,7 @@ shared Function Bar($value : Integer) ## シングルトンクラス -**シングルトンクラス** とは、インスタンスを一つのみ作成するユーザークラスです。 **シングルトンクラス** とは、インスタンスを一つのみ作成するユーザークラスです。 シングルトンのコンセプトに関する詳細については、[シングルトンに関する Wikipedia のページ](https://ja.wikipedia.org/wiki/Singleton_%E3%83%91%E3%82%BF%E3%83%BC%E3%83%B3) を参照ください。 +**シングルトンクラス** とは、インスタンスを一つのみ作成するユーザークラスです。 シングルトンのコンセプトに関する詳細については、[シングルトンに関する Wikipedia のページ](https://ja.wikipedia.org/wiki/Singleton_%E3%83%91%E3%82%BF%E3%83%BC%E3%83%B3) を参照ください。 ### シングルトンの種類 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/ORDA/privileges.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/ORDA/privileges.md index 4d962ccfb4f47e..74cef86ea5213e 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/ORDA/privileges.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R9/ORDA/privileges.md @@ -74,7 +74,7 @@ Webユーザーまたは RESTユーザーがログインすると、そのセッ 権限は、複数の "リソース+アクション" の組み合わせと関連付けることができます。 また、一つのアクションに複数の権限を関連付けることができます。 権限は、他の権限を含むことができます。 -- 権限やロールの **作成** は `roles.json` ファイル内にておこないます (後述参照)。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 +- 権限やロールの **作成** は `roles.json` ファイル内にておこないます (後述参照)。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 アクセス権の範囲を **設定** するには、リソースに適用される許諾アクションに権限名を割り当てます。 - 各ユーザーセッションに権限やロールを **許可** するには、`Session` クラスの [`.setPrivileges()`](../API/SessionClass.md#setprivileges) 関数を使用します。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md index 580178f6d2f184..77d16eb94ef2ff 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md @@ -3245,19 +3245,18 @@ $r:=$c.reduceRight(Formula($1.accumulator*=$1.value); 1) // 戻り値は 86400 -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection | 引数 | 型 | | 説明 | | ---------- | ----------- |:--:| ------------------------------------------ | +| ascOrDesc | Integer | -> | `ck ascending` または `ck descending` (スカラー値) | | formula | 4D.Function | -> | フォーミュラオブジェクト | | methodName | Text | -> | メソッド名 | | extraParam | any | -> | methodName に渡す引数 | -| 戻り値 | Collection | <- | 並べ替えられた元のコレクション| - - -| +| 戻り値 | Collection | <- | 並べ替えられた元のコレクション | + #### 説明 @@ -3265,7 +3264,16 @@ $r:=$c.reduceRight(Formula($1.accumulator*=$1.value); 1) // 戻り値は 86400 `.sort()` 関数は、 コレクションの要素を並べ替え、並べ替えられた元のコレクションを返します 。 > このコマンドは、元のコレクションを変更します。 -引数もなしに呼び出された場合、`.sort()` はスカラー値 (数値、テキスト、日付、ブール) のみを並べ替えます。 デフォルトでは、要素はそれぞれの型に応じて昇順で並べ替えられます。 コレクションが異なる型のスカラー値を格納している場合、それらはまず型ごとにグループ分けされ、そのあとで並べ替えられます。 型は以下の順番で返されます: +引数もなしに呼び出された場合、`.sort()` はスカラー値 (数値、テキスト、日付、ブール) のみを並べ替えます。 デフォルトでは、要素はそれぞれの型に応じて昇順で並べ替えられます。 You can also pass one of the following constants in the *ascOrDesc* parameter: + + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + + コレクションが異なる型の要素を格納している場合、それらはまず型ごとにグループ分けされ、そのあとで並べ替えられます。 型は以下の順番で返されます: 1. null 2. ブール diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/API/CollectionClass.md b/i18n/pt/docusaurus-plugin-content-docs/current/API/CollectionClass.md index 6dfa4eb0bea5ae..ceeec01850bac0 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/API/CollectionClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/API/CollectionClass.md @@ -3172,16 +3172,17 @@ Quer saber se pelo menos um valor de coleção é >0. -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection -| Parâmetro | Tipo | | Descrição | -| ---------- | ---------------------------- | :-------------------------: | --------------------------------------------------------------------- | -| formula | 4D. Function | -> | Objecto fórmula | -| methodName | Text | -> | Nome da função a qual se chama para processar os elementos da coleção | -| extraParam | any | -> | Parâmetros para o método | -| Resultados | Collection | <- | Colecção original ordenada | +| Parâmetro | Tipo | | Descrição | +| ---------- | ---------------------------- | :-------------------------: | ------------------------------------------------------------------------ | +| ascOrDesc | Integer | -> | `ck ascending` ou `ck descending` (valores escalares) | +| formula | 4D. Function | -> | Objecto fórmula | +| methodName | Text | -> | Nome da função a qual se chama para processar os elementos da coleção | +| extraParam | any | -> | Parâmetros para o método | +| Resultados | Collection | <- | Colecção original ordenada | @@ -3191,7 +3192,19 @@ A função `.sort()` classifica os elemen > Essa função modifica a coleção original. -Se `.sort()` for chamado sem parâmetros, somente os valores escalares (número, texto, data, booleanos) serão classificados. Os elementos são classificados por defeito em ordem ascendente, de acordo com o seu tipo. Se a coleção conter elementos de tipos diferentes, são primeiro agrupados por tipo e ordenados depois. Se attributePath levar a uma propriedade de objeto que conter valores de diferentes tipos, primeiro se agrupam por tipo e se ordenam depois. +Se `.sort()` for chamado sem parâmetros, somente os valores escalares (número, texto, data, booleanos) serão classificados. Os elementos são classificados por defeito em ordem ascendente, de acordo com o seu tipo. +You can also pass one of the following constants in the *ascOrDesc* parameter: + +``` +|Constant| Type|Value|Comment| +|---|---|---|---| +|ck ascending|Integer|0|Elements are ordered in ascending order (default)| +|ck descending|Integer|1|Elements are ordered in descending order| + +This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). +``` + +Se a coleção conter elementos de tipos diferentes, são primeiro agrupados por tipo e ordenados depois. Se attributePath levar a uma propriedade de objeto que conter valores de diferentes tipos, primeiro se agrupam por tipo e se ordenam depois. 1. null 2. booleans diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/API/SessionClass.md b/i18n/pt/docusaurus-plugin-content-docs/current/API/SessionClass.md index eb3431c0ae30be..6ea1fd129e4c34 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/API/SessionClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/API/SessionClass.md @@ -54,9 +54,10 @@ A disponibilidade de propriedades e funções no objeto `Session` depende do tip
    História -| Release | Mudanças | -| ------- | ---------- | -| 18 R6 | Adicionado | +| Release | Mudanças | +| ------- | -------------------------- | +| 21 | Support of remote sessions | +| 18 R6 | Adicionado |
    @@ -74,7 +75,7 @@ A disponibilidade de propriedades e funções no objeto `Session` depende do tip :::note -Esta função não faz nada e sempre retorna **Verdadeiro** com cliente remoto, procedimento armazenado e sessões autônomas. +This function does nothing and always returns **True** with stored procedure sessions and standalone sessions. ::: @@ -88,6 +89,8 @@ This function does not remove **promoted privileges** from the web process, whet ::: +Regarding remote client sessions, the function only impacts [code accessing the web server](../WebServer/preemptiveWeb.md#writing-thread-safe-web-server-code). + #### Exemplo ```4d @@ -107,9 +110,10 @@ $isGuest:=Session.isGuest() //$isGuest é True
    História -| Release | Mudanças | -| ------- | ---------- | -| 20 R9 | Adicionado | +| Release | Mudanças | +| ------- | -------------------------- | +| 21 | Support of remote sessions | +| 20 R9 | Adicionado |
    @@ -120,7 +124,7 @@ $isGuest:=Session.isGuest() //$isGuest é True | Parâmetro | Tipo | | Descrição | | ---------- | ------- | :-------------------------: | -------------------------------------- | | lifespan | Integer | -> | Duração do token de sessão em segundos | -| Resultados | Text | <- | UUID da sessão | +| Resultados | Text | <- | UUID of the token | @@ -128,7 +132,7 @@ $isGuest:=Session.isGuest() //$isGuest é True :::note -Essa função só está disponível com sessões de usuário Web. Ele retorna uma string vazia em outros contextos. +This function is available with web user sessions and remote sessions. It returns an empty string in stored procedure and standalone sessions. ::: @@ -136,9 +140,14 @@ A função `.createOTP()` cria um Para mais informações sobre os tokens OTP, consulte [esta seção](../WebServer/sessions.md#session-token-otp). -Por padrão, se o parâmetro *lifespan* for omitido, o token será criado com o mesmo tempo de vida que o [`.idleTimeOut`](#idletimeout) da sessão. You can set a custom timeout by passing a value in seconds in *lifespan*. Se um token expirado for usado para restaurar uma sessão de usuário Web, ele será ignorado. +You can set a custom timeout by passing a value in seconds in *lifespan*. If an expired token is used to restore a session, it is ignored. By default, if the *lifespan* parameter is omitted: + +- with web user sessions, the token is created with the same lifespan as the [`.idleTimeOut`](#idletimeout) of the session. +- with remote sessions, the token is created with a 10 seconds lifespan. -O token retornado pode então ser usado em trocas com aplicativos ou sites de terceiros para identificar a sessão com segurança. Por exemplo, o token de sessão OTP pode ser usado com um aplicativo de pagamento. +For **web user sessions**, the returned token can be used in exchanges with third-party applications or websites to securely identify the session. Por exemplo, o token de sessão OTP pode ser usado com um aplicativo de pagamento. + +For **remote sessions**, the returned token can be used on 4D Server to identitfy requests coming from a [remote 4D running Qodly forms in a Web area](../Desktop/clientServer.md#remote-user-sessions). #### Exemplo @@ -253,9 +262,10 @@ $expiration:=Session.expirationDate //por exemplo "2021-11-05T17:10:42Z"
    História -| Release | Mudanças | -| ------- | ---------- | -| 20 R6 | Adicionado | +| Release | Mudanças | +| ------- | --------------------------------- | +| 21 | Support of remote client sessions | +| 20 R6 | Adicionado |
    @@ -279,7 +289,9 @@ This function returns privileges assigned to a Session using the [`setPrivileges ::: -Com cliente remoto, procedimento armazenado e sessões autônomas, essa função retorna uma coleção que contém apenas "WebAdmin". +With remote client sessions, the privileges only concerns the code executed in the context of a [web request sent through a Web area](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). + +With stored procedure sessions and standalone sessions, this function returns a collection only containing "WebAdmin". #### Exemplo @@ -348,10 +360,10 @@ $privileges := Session.getPrivileges()
    História -| Release | Mudanças | -| ------- | ------------------------------------ | -| 21 | Returns True for promoted privileges | -| 18 R6 | Adicionado | +| Release | Mudanças | +| ------- | ----------------------------------------------------------------------- | +| 21 | Returns True for promoted privileges, Support of remote client sessions | +| 18 R6 | Adicionado |
    @@ -376,7 +388,9 @@ This function returns True for the *privilege* if called from a function that wa ::: -Com cliente remoto, procedimento armazenado e sessões autônomas, essa função sempre retorna True, independentemente do *privilégio*. +Regarding remote client sessions, the function only impacts [code accessing the web server](../WebServer/preemptiveWeb.md#writing-thread-safe-web-server-code). + +With stored procedure sessions and standalone sessions, this function always returns True, whatever the *privilege*. #### Exemplo @@ -717,6 +731,7 @@ Function callback($request : 4D.IncomingMessage) : 4D.OutgoingMessage | Release | Mudanças | | ------- | ------------------------------------------- | +| 21 | Support of remote client sessions | | 19 R8 | Suporte da propriedade "roles" das Settings | | 18 R6 | Adicionado | @@ -739,23 +754,21 @@ Function callback($request : 4D.IncomingMessage) : 4D.OutgoingMessage :::note -Essa função não faz nada e sempre retorna **False** com cliente remoto, procedimento armazenado e sessões autônomas. +This function does nothing and always returns **False** with stored procedure sessions and standalone sessions. ::: A função `.setPrivileges()` associa os privilégios e/ou papéis definidos no parâmetro para a sessão e retorna **True** se a execução foi bem sucedida . - No parâmetro *privilege*, passe uma cadeia de caracteres contendo um nome de privilégio (ou vários nomes de privilégio separados por vírgula). - - No parâmetro *privileges*, passe uma coleção de cadeias de caracteres contendo nomes de privilégios. - - No parâmetro *settings*, passe um objeto que contenha as seguintes propriedades: -| Propriedade | Tipo | Descrição | -| ----------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------- | -| privileges | Text ou Collection |
  • String contendo um nome de privilégio, ou
  • Coleção de cadeias de caracteres contendo nomes de privilégios
  • | -| roles | Text ou Collection |
  • String que contém uma função, ou
  • Coleção de cadeias de caracteres contendo funções
  • | -| userName | Text | Nome de usuário associado à sessão (opcional) | +| Propriedade | Tipo | Descrição | +| ----------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| privileges | Text ou Collection |
  • String contendo um nome de privilégio, ou
  • Coleção de cadeias de caracteres contendo nomes de privilégios
  • | +| roles | Text ou Collection |
  • String que contém uma função, ou
  • Coleção de cadeias de caracteres contendo funções
  • | +| userName | Text | User name to associate to the session (optional, web sessions only). Not available in remote client sessions (ignored). | :::note @@ -769,6 +782,8 @@ Como padrão quando não houver um privilégio associado à sessão, a sessão A propriedade [`userName`](#username) está disponível no nível do objeto de sessão (somente leitura). +Regarding remote client sessions, the function only concerns the code executed in the context of a [web request sent through a Web area](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). + #### Exemplo Em um método de autenticação personalizado, deve estabecer o privilégio "WebAdmin" ao usuário: diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/Desktop/clientServer.md b/i18n/pt/docusaurus-plugin-content-docs/current/Desktop/clientServer.md index e3bee4751d7585..b4523f85dd4e68 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/Desktop/clientServer.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/Desktop/clientServer.md @@ -89,11 +89,19 @@ No entanto, você precisa prestar atenção às seguintes diferenças de comport No servidor, o comando [`Session`](../commands/session.md) retorna um objeto `session` descrevendo a sessão atual do usuário. Este objeto é tratado através das funções e propriedades da [classe `sessão`](../API/SessionClass.md). +:::tip Related blog posts + +[Objeto de sessão remota 4D com conexão de Cliente/Servidor e procedimento armazenado](https://blog.4d.com/new-4D-remote-session-object-with-client-server-connection-and-stored-procedure re). + +::: + ### Utilização -O objeto `sessão` permite que você obtenha informações sobre a sessão remota do usuário. Você pode compartilhar dados entre todos os processos da sessão do usuário usando o objeto compartilhado [`session.storage`](../API/SessionClass.md#storage). +The `session` object allows you to handle information and privileges for the remote user session. + +Você pode compartilhar dados entre todos os processos da sessão do usuário usando o objeto compartilhado [`session.storage`](../API/SessionClass.md#storage). Por exemplo, você pode iniciar um procedimento de autenticação e verificação do usuário quando um cliente se conecta ao servidor, envolvendo a inserção de um código enviado por e-mail ou SMS no aplicativo. Em seguida, você adiciona as informações do usuário ao armazenamento de sessão, permitindo que o servidor identifique o usuário. Dessa forma, o servidor 4D pode acessar as informações do usuário para todos os processos do cliente, permitindo a escrita de código personalizado de acordo com o papel do usuário. -Por exemplo, você pode iniciar um procedimento de autenticação e verificação do usuário quando um cliente se conecta ao servidor, envolvendo a inserção de um código enviado por e-mail ou SMS no aplicativo. Em seguida, você adiciona as informações do usuário ao armazenamento de sessão, permitindo que o servidor identifique o usuário. Dessa forma, o servidor 4D pode acessar as informações do usuário para todos os processos do cliente, permitindo a escrita de código personalizado de acordo com o papel do usuário. +You can also assign privileges to a remote user session to control access when the session comes from Qodly pages running in web areas. ### Disponibilidade @@ -110,7 +118,60 @@ Todos os procedimentos armazenados no servidor compartilham a mesma sessão do u ::: -### Ver também (post do blog) +### Sharing the session with Qodly pages in Web areas -[Objeto de sessão remota 4D com conexão de Cliente/Servidor e procedimento armazenado](https://blog.4d.com/new-4D-remote-session-object-with-client-server-connection-and-stored-procedure re). +Remote client sessions can be used to handle Client/Server applications where [Qodly pages](https://developer.4d.com/qodly/4DQodlyPro/pageLoaders/pageLoaderOverview) are used for the interface, running on remote machines. With this configuration, your applications have modern CSS-based web interfaces but still benefit from the power and simplicity of integrated client/server development. In such applications, Qodly pages are executed within standard 4D [Web areas](../FormObjects/webArea_overview.md). + +To manage this configuration, you need to use remote client sessions. Actually, requests coming from both the remote 4D application and its Qodly pages loaded in Web areas need to work inside a single user session. You just have to share the same session between the remote client and its web pages so that you can have the same [session storage](../API/SessionClass.md#storage) and client license, whatever the request origin. + +Note that [privileges](../ORDA/privileges.md) should be set in the session before executing a web request from a Web area, so that the user automatically gets their privileges for web access (see example). Keep in mind that privileges only apply to requests coming from the web, not to the 4D code executed in a standard remote session. + +Shared sessions are handled through [OTP tokens](../WebServer/sessions.md#session-token-otp). After you created an OTP token on the server for the user session, you add the token (through the `$4DSID` parameter value) to web requests sent from web areas containing Qodly pages so that the user session on the server is identified and shared. On the web server side, if a web request contains an *OTP id* in the $4DSID parameter, the session corresponding to this OTP token is used. + +:::tip Related blog post + +[Share your 4D remote client session with web accesses](https://blog.4d.com/share-your-4d-remote-client-session-with-web-accesses) + +::: + +#### Exemplo + +```4d +var $otp : Text + +// Some privileges are put in the remote user session on the server for a further web access +ds.resetPrivileges("basic") + +// An OTP is created on the server for this remote client session +$otp:=ds.getOTP() + + +// The user has already the required privileges for a web access +// and the same session is shared between this remote user and the web Qodly app +WA OPEN URL(*; "Welcome"; "http://127.0.0.1/$lib/renderer/?w=People&$4DSID="+$otp) + +``` + +*resetPrivileges()* function in the Datastore class: + +```4d +// This function is run on the server +// and puts some privileges in the session for a further web access + +exposed Function resetPrivileges($priv : Text) + + Session.clearPrivileges() + Session.setPrivileges($priv) +``` + +*getOTP()* function in the Datastore class: + +```4d +// This function is run on the server +// and generates an OTP able to retrieve this remote user session +exposed Function getOTP(): Text + + return Session.createOTP() + +``` diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/Notes/updates.md b/i18n/pt/docusaurus-plugin-content-docs/current/Notes/updates.md index 3e892c024818ee..4017bcc3189469 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/Notes/updates.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/Notes/updates.md @@ -12,6 +12,7 @@ Leia [**O que há de novo no 4D 21**](https://blog.4d.com/en-whats-new-in-4d-21/ - 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. - 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. +- In client/server applications, use Qodly pages in Web areas and [share the remote client session](../Desktop/clientServer.md#sharing-the-session-with-qodly-pages-in-web-areas). - 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). diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/ORDA/privileges.md b/i18n/pt/docusaurus-plugin-content-docs/current/ORDA/privileges.md index 02b5ac460afa71..73c0eff02fec15 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/ORDA/privileges.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/ORDA/privileges.md @@ -17,9 +17,11 @@ Se um usuário tentar executar uma ação e não tiver os direitos de acesso ade ![schema](../assets/en/ORDA/privileges-schema.png) -### Veja também +:::tip Related Blog posts -Para obter uma visão detalhada de toda a arquitetura de permissões, por favor leia o post do blog [**Filtre o acesso aos seus dados com um sistema completo de permissões**](https://blog.4d.com/filter-access-to-your-data-with-a-complete-system-of-permissions/). +[**Filter access to your data with a complete system of permissions**](https://blog.4d.com/filter-access-to-your-data-with-a-complete-system-of-permissions/) + +::: ## Resources @@ -79,7 +81,7 @@ Um privilégio ou um papel pode ser associado a várias combinações de "ação - Você cria **privilégios** e/ou funções no arquivo `roles.json` (veja abaixo). Você **configurou** o escopo dele, atribuindo-lhes a ação de permissão aplicada aos recursos. -- Você **permite** privilégios e/ou funções para cada sessão do usuário usando a função [`.setPrivileges()`](../API/SessionClass.md#setprivileges) da classe `Session`. +- Você **permite** privilégios e/ou funções para cada sessão usuário usando a função [`.setPrivileges()`](../API/SessionClass.md#setprivileges) da classe `Session`. ### Exemplo @@ -113,7 +115,7 @@ O arquivo `roles.json` descreve todas as configurações de segurança do projet ### Arquivo padrão -Quando você cria um projeto, um arquivo `roles.json` padrão é criado no seguinte local: `/Project/Sources/` (consulte a seção [Arquitetura](../Project/architecture.md#sources)). +When you create a project, a default `roles.json` file is created at the following location: `/Project/Sources/` (see [Architecture](../Project/architecture.md#sources) section). O arquivo padrão tem o seguinte conteúdo: @@ -122,7 +124,7 @@ O arquivo padrão tem o seguinte conteúdo: { "privileges": [ { - "privilege": "none", + "privilege": "all", "includes": [] } ], @@ -134,12 +136,12 @@ O arquivo padrão tem o seguinte conteúdo: { "applyTo": "ds", "type": "datastore", - "read": ["none"], - "create": ["none"], - "update": ["none"], - "drop": ["none"], - "execute": ["none"], - "promote": ["none"] + "read": ["all"], + "create": ["all"], + "update": ["all"], + "drop": ["all"], + "execute": ["all"], + "promote": ["all"] } ] }, @@ -150,7 +152,8 @@ O arquivo padrão tem o seguinte conteúdo: ``` -Para um nível máximo de segurança, o privilégio "none" é atribuído a todas as permissões no datastore, assim o acesso aos dados no objeto `ds` inteiro é desabilitado por padrão. É recomendado não modificar ou usar esse privilégio de bloqueio, mas adicionar permissões específicas a cada recurso que você deseja disponibilizar para solicitações da web ou REST (veja o exemplo abaixo). +For a highest level of security, the "all" privilege is assigned to all permissions in the datastore, thus data access on the whole `ds` object is disabled by default. The principle is as follows: assigning a permission is like putting a lock on a door. Only sessions with privilege having the corresponding key (i.e., a permission) will be able to open the lock. +É recomendado não modificar ou usar esse privilégio de bloqueio, mas adicionar permissões específicas a cada recurso que você deseja disponibilizar para solicitações da web ou REST (veja o exemplo abaixo). :::caution @@ -264,14 +267,14 @@ Finalizado, se ## Exemplo de configuração de privilégios -A boa prática é manter todo o acesso aos dados bloqueado por padrão graças ao privilégio "none" e configurar o arquivo `roles.json` para abrir apenas partes controladas para sessões autorizadas. Por exemplo, para permitir alguns acessos às sessões de convidados: +The good practice is to keep all data access locked by default thanks to the "all" privilege and to configure the `roles.json` file to only open controlled parts to authorized sessions. For example, to allow some accesses to "guest" sessions: ```json title="/Project/Sources/roles.json" { "privileges": [ { - "privilege": "none", + "privilege": "all", "includes": [] } ], @@ -282,22 +285,22 @@ A boa prática é manter todo o acesso aos dados bloqueado por padrão graças a "applyTo": "ds", "type": "datastore", "read": [ - "none" + "all" ], "create": [ - "none" + "all" ], "update": [ - "none" + "all" ], "drop": [ - "none" + "all" ], "execute": [ - "none" + "all" ], "promote": [ - "none" + "all" ] }, { diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/WebServer/sessions.md b/i18n/pt/docusaurus-plugin-content-docs/current/WebServer/sessions.md index ef954013962206..2471ddb6831c51 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/WebServer/sessions.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/WebServer/sessions.md @@ -213,6 +213,12 @@ The 4D web server allows you to generate, share, and use OTP (One-Time Passcode) In 4D, OTP session tokens are useful when calling external URLs and being called back in another browser or device (mobile/computer). Typically, a third-party application sends a confirmation email containing a callback link on which the user has to click. The callback link includes the OTP token, so that the session which triggered the callback is loaded along with its data and privileges. This principle allows you to share the same session on multiple devices. Graças a esta arquitetura, o [cookie de sessão](#session-implementation) não está exposto na rede, o que elimina o risco de ataque do homem-meio. +:::tips Related blog posts + +[Connect Your Web Apps to Third-Party Systems](https://blog.4d.com/connect-your-web-apps-to-third-party-systems/) + +::: + ### Visão Geral The basic sequence of an OTP session token use in a 4D web application is the following: @@ -477,8 +483,4 @@ A session token has a lifespan, and the session itself has a lifespan. O tempo d A session is only restored by a token if both the session token lifespan and the session lifespan have not expired. In other cases (the session token has expired and/or the session itself has expired), a guest session is created when a web request with a session token is received. -:::note - -For more information, please refer to the [Connect Your Web Apps to Third-Party Systems](https://blog.4d.com/connect-your-web-apps-to-third-party-systems/) blog post. -::: \ No newline at end of file diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md b/i18n/pt/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md index f891619a258e54..7b7c04a2454eb8 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/aikit/Classes/OpenAIChatHelper.md @@ -65,30 +65,42 @@ $chatHelper.reset() // Clear all previous messages and tools ### registerTool() -**registerTool**(*tool* : Object; *handler* : 4D.Function) +**registerTool**(*tool* : Object; *handler* : Object) -| Parâmetro | Tipo | Descrição | -| --------- | ---------------------------- | ---------------------------------------------------------------------------------------- | -| *tool* | Object | The tool definition object (or [OpenAITool](OpenAITool.md) instance) | -| *handler* | 4D. Function | The function to handle tool calls (optional if defined inside *tool*) | +| Parâmetro | Tipo | Descrição | +| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| *tool* | Object | The tool definition object (or [OpenAITool](OpenAITool.md) instance) | +| *handler* | Object | The function to handle tool calls ([4D.Function](../../API/FunctionClass.md) or Object), optional if defined inside *tool* as *handler* property | Registers a tool with its handler function for automatic tool call handling. -If the handler is not provided, the tool's `handler` property will be used. + +The *handler* parameter can be: + +- A **4D.Function**: Direct handler function +- An **Object**: An object containing a `formula` property matching the tool function name The handler function receives an object containing the parameters passed from the OpenAI tool call. This object contains key-value pairs where the keys match the parameter names defined in the tool's schema, and the values are the actual arguments provided by the AI model. #### Register Tool Example ```4D -// Define a simple tool +// Example 1: Simple registration with direct handler var $tool:={type: "function"; function: {name: "get_weather"; description: "Get current weather"; parameters: {type: "object"; properties: {location: {type: "string"; description: "City name"}}}}} - -// Define a handler function that receives an argument { location: "a city" } var $handler:=Formula(return "Sunny, 25°C in "+$1.location) $chatHelper.registerTool($tool; $handler) -// or + +// Example 2: Tool with handler property (no second parameter needed) +var $tool:={name: "calculate"; description: "Perform calculations"; handler: Formula(return String(Num($1.expression)))} +$chatHelper.registerTool($tool) + +// Example 3: Using object notation $chatHelper.registerTool({tool: $tool; handler: $handler}) + +// Example 4: Handler as object with formula matching tool name +var $tool:={name: "getTime"; description: "Get current time"} +var $handlerObj:=cs.MyTimeTool.new() // class with a getTime function +$chatHelper.registerTool($tool; $handlerObj) ``` ### registerTools() @@ -99,34 +111,64 @@ $chatHelper.registerTool({tool: $tool; handler: $handler}) | ------------------- | ------------ | -------------------------------------------------------- | | *toolsWithHandlers* | Diferente de | Object or Collection containing tools and their handlers | -Registers multiple tools at once. The parameter can be either an object with function names as keys, or a collection of tool objects. +Registers multiple tools at once. The parameter can be: + +- **Collection**: Array of tool objects (with handlers embedded or separate) +- **Object**: Object with function names as keys mapping to tool definitions +- **Object with `tools` attribute**: Object containing a `tools` collection and formula properties matching tool names #### Register Multiple Tools Example -```4D -// Simple approach: handlers defined directly in tools -var $weatherTool:={type: "function"; function: {name: "get_weather"; description: "Get current weather"; parameters: {type: "object"; properties: {location: {type: "string"; description: "City name"}}}}; \ - handler: Formula(return "Sunny, 25°C in "+$1.location)} -var $calculatorTool:={type: "function"; function: {name: "calculate"; description: "Perform calculations"; parameters: {type: "object"; properties: {expression: {type: "string"; description: "Math expression"}}}}; \ - handler: Formula(return String(Num($1.expression)))} +##### Example 1: Collection format with handlers in tools -var $tools:={} -$tools.get_weather:=$weatherTool -$tools.calculate:=$calculatorTool - -$chatHelper.registerTools($tools) +```4D +var $weatherTool:={name: "getWeather"; description: "Get current weather"; handler: Formula(return "Sunny, 25°C in "+$1.location)} +var $calculatorTool:={name: "calculate"; description: "Perform calculations"; handler: Formula(return String(Num($1.expression)))} -// Using collection format $chatHelper.registerTools([$weatherTool; $calculatorTool]) +``` -// Alternative: separate tool definitions from handlers (useful for better code organization) +##### Example 2: Object format with separate tool and handler + +```4D var $toolsWithSeparateHandlers:={} -$toolsWithSeparateHandlers.get_weather:={tool: $weatherToolDefinition; handler: $weatherHandler} +$toolsWithSeparateHandlers.getWeather:={tool: $weatherToolDefinition; handler: $weatherHandler} $toolsWithSeparateHandlers.calculate:={tool: $calculatorToolDefinition; handler: $calculatorHandler} $chatHelper.registerTools($toolsWithSeparateHandlers) ``` +##### Example 3: Object with tools collection attribute and formula properties + +MyTools class: + +```4D + +Class constructor + this.tools:=[{name: "getWeather"; description: "Get current weather"}; \ + {name: "getTime"; description: "Get current time"}] // Collection of tool definitions + +Function getWeather($parameters: Object) + return "Sunny, 25°C" + +Function getTime($parameters: Object) + return String(Current time) +``` + +```4D +$chatHelper.registerTools(cs.MyTools.new()) +``` + +##### Example 4: Simple object format with tools as properties + +```4D +var $tools:={} +$tools.getWeather:=$weatherTool // Tool with handler property +$tools.calculate:=$calculatorTool // Tool with handler property + +$chatHelper.registerTools($tools) +``` + ### unregisterTool() **unregisterTool**(*functionName* : Text) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3033006.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3033006.en.png new file mode 100644 index 00000000000000..ad7e034e246705 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3033006.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3033008.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3033008.en.png new file mode 100644 index 00000000000000..51f1aa5c128b59 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3033008.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3307937.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3307937.en.png new file mode 100644 index 00000000000000..fb12b681bed355 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3307937.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3307941.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3307941.en.png new file mode 100644 index 00000000000000..0016bc2e11049d Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3307941.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3513503.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3513503.en.png new file mode 100644 index 00000000000000..eddf97544e0575 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3513503.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3541581.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3541581.en.png new file mode 100644 index 00000000000000..8d2321c8b19748 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3541581.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3626363.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3626363.en.png new file mode 100644 index 00000000000000..823fcf7c97fbcb Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3626363.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3893246.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3893246.en.png new file mode 100644 index 00000000000000..84c289b866e8e6 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3893246.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3893248.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3893248.en.png new file mode 100644 index 00000000000000..c21d5b60eeb195 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict3893248.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5562054.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5562054.en.png new file mode 100644 index 00000000000000..dee167c5ccf7c3 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5562054.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5562058.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5562058.en.png new file mode 100644 index 00000000000000..f84f46638756cb Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5562058.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5859437.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5859437.en.png new file mode 100644 index 00000000000000..8a546866502013 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5859437.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907013.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907013.en.png new file mode 100644 index 00000000000000..e233c502a77cb2 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907013.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907021.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907021.en.png new file mode 100644 index 00000000000000..bcbe548297f87d Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907021.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907023.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907023.en.png new file mode 100644 index 00000000000000..6eba7f2baedff6 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907023.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907026.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907026.en.png new file mode 100644 index 00000000000000..d526c51578eb27 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907026.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907030.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907030.en.png new file mode 100644 index 00000000000000..964245707b6717 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5907030.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5941073.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5941073.en.png new file mode 100644 index 00000000000000..66f10af3210774 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict5941073.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6014414.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6014414.en.png new file mode 100644 index 00000000000000..1454f02b49f34c Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6014414.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6014426.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6014426.en.png new file mode 100644 index 00000000000000..5430cc882d6f13 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6014426.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6014429.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6014429.en.png new file mode 100644 index 00000000000000..12cb8442c5f68c Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6014429.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6022144.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6022144.en.png new file mode 100644 index 00000000000000..ab1d4670b16d55 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6022144.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6131919.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6131919.en.png new file mode 100644 index 00000000000000..d8b2b0f013f901 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6131919.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421031.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421031.en.png new file mode 100644 index 00000000000000..f338bd44caeb38 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421031.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421340.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421340.en.png new file mode 100644 index 00000000000000..a00a64fa003fe5 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421340.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421342.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421342.en.png new file mode 100644 index 00000000000000..e7bbdb0445e7dc Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421342.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421344.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421344.en.png new file mode 100644 index 00000000000000..b1da7d4f717589 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421344.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421356.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421356.en.png new file mode 100644 index 00000000000000..e19848f65d2951 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6421356.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6434579.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6434579.en.png new file mode 100644 index 00000000000000..232ad5653b5bdf Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6434579.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6434721.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6434721.en.png new file mode 100644 index 00000000000000..199e62f81ef736 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6434721.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6434723.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6434723.en.png new file mode 100644 index 00000000000000..480da0bfc5f80f Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6434723.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6441966.en.png b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6441966.en.png new file mode 100644 index 00000000000000..e6b76b3b690664 Binary files /dev/null and b/i18n/pt/docusaurus-plugin-content-docs/current/assets/en/WritePro/pict6441966.en.png differ diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/commands/session.md b/i18n/pt/docusaurus-plugin-content-docs/current/commands/session.md index 2e35301565f311..6b378039a369f9 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/commands/session.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/commands/session.md @@ -57,6 +57,7 @@ O objeto `Session` das sessões remotas de clientes está disponível em: - Métodos de projeto que têm o atributo [Execute on Server](../Project/code-overview.md#execute-on-server) (são executados no processo "geminado" do processo do cliente), - Triggers, +- ORDA [funções do modelo de dados](../ORDA/ordaClasses.md) (exceto aquelas declaradas com a palavra-chave [`local`](../ORDA/ordaClasses.md#local-functions), - 'Conexão aberta com o servidor' e 'Conexão com o servidor' métodos de banco de dados. Para mais informações em sessões usuários remotos, consulte o parágrafo [**Sessões usuário cliente remoto**](../Desktop/clientServer.md#remote-user-sessions). diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md index 03049b816fb7a5..6bce0f973d38c8 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-19/API/CollectionClass.md @@ -2484,24 +2484,33 @@ Com o seguinte método *NumberGreaterThan0*: -**.sort**() : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection | Parâmetro | Tipo | | Descrição | | ---------- | ---------- |:--:| -------------------------------------------------------------- | +| ascOrDesc | Integer | -> | `ck ascending` ou `ck descending` (valores escalares) | | methodName | Text | -> | Nome do método utilizado para especificar a ordem de ordenação | | extraParam | any | -> | Parâmetros para o método | -| Resultados | Collection | <- | Colecção original ordenada| - -| +| Resultados | Collection | <- | Colecção original ordenada | + #### Descrição A função `.shift()` ordena os elementos da coleção original e também devolve a coleção ordenada. > Essa função modifica a coleção original. -Se `.sort()` for chamado sem parâmetros, apenas valores escalares (número, texto, data, booleanos) são ordenados. Os elementos são classificados por defeito em ordem ascendente, de acordo com o seu tipo. Se a coleção conter elementos de tipos diferentes, são primeiro agrupados por tipo e ordenados depois. Se *attributePath* levar a uma propriedade de objeto que conter valores de diferentes tipos, primeiro se agrupam por tipo e se ordenam depois. +Se `.sort()` for chamado sem parâmetros, apenas valores escalares (número, texto, data, booleanos) são ordenados. Os elementos são classificados por defeito em ordem ascendente, de acordo com o seu tipo. You can also pass one of the following constants in the *ascOrDesc* parameter: + + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + + Se a coleção conter elementos de tipos diferentes, são primeiro agrupados por tipo e ordenados depois. Se *attributePath* levar a uma propriedade de objeto que conter valores de diferentes tipos, primeiro se agrupam por tipo e se ordenam depois. 1. null 2. booleans diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md index 6dfa4eb0bea5ae..3f0cc44d806675 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/CollectionClass.md @@ -3172,16 +3172,17 @@ Quer saber se pelo menos um valor de coleção é >0. -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection -| Parâmetro | Tipo | | Descrição | -| ---------- | ---------------------------- | :-------------------------: | --------------------------------------------------------------------- | -| formula | 4D. Function | -> | Objecto fórmula | -| methodName | Text | -> | Nome da função a qual se chama para processar os elementos da coleção | -| extraParam | any | -> | Parâmetros para o método | -| Resultados | Collection | <- | Colecção original ordenada | +| Parâmetro | Tipo | | Descrição | +| ---------- | ---------------------------- | :-------------------------: | ------------------------------------------------------------------------ | +| ascOrDesc | Integer | -> | `ck ascending` ou `ck descending` (valores escalares) | +| formula | 4D. Function | -> | Objecto fórmula | +| methodName | Text | -> | Nome da função a qual se chama para processar os elementos da coleção | +| extraParam | any | -> | Parâmetros para o método | +| Resultados | Collection | <- | Colecção original ordenada | @@ -3191,7 +3192,19 @@ A função `.sort()` classifica os elemen > Essa função modifica a coleção original. -Se `.sort()` for chamado sem parâmetros, somente os valores escalares (número, texto, data, booleanos) serão classificados. Os elementos são classificados por defeito em ordem ascendente, de acordo com o seu tipo. Se a coleção conter elementos de tipos diferentes, são primeiro agrupados por tipo e ordenados depois. Se attributePath levar a uma propriedade de objeto que conter valores de diferentes tipos, primeiro se agrupam por tipo e se ordenam depois. +Se `.sort()` for chamado sem parâmetros, somente os valores escalares (número, texto, data, booleanos) serão classificados. Os elementos são classificados por defeito em ordem ascendente, de acordo com o seu tipo. +You can also pass one of the following constants in the *ascOrDesc* parameter: + + ``` + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + ``` + +Se a coleção conter elementos de tipos diferentes, são primeiro agrupados por tipo e ordenados depois. Se attributePath levar a uma propriedade de objeto que conter valores de diferentes tipos, primeiro se agrupam por tipo e se ordenam depois. 1. null 2. booleans diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md index 02c3bb6af40dfa..b9e7ba45b3c0ac 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/API/SessionClass.md @@ -120,7 +120,7 @@ $isGuest:=Session.isGuest() //$isGuest é True | Parâmetro | Tipo | | Descrição | | ---------- | ------- | :-------------------------: | -------------------------------------- | | lifespan | Integer | -> | Duração do token de sessão em segundos | -| Resultados | Text | <- | UUID da sessão | +| Resultados | Text | <- | UUID of the OTP token | diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/ORDA/privileges.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/ORDA/privileges.md index 02b5ac460afa71..b8c7045056e46c 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/ORDA/privileges.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R10/ORDA/privileges.md @@ -79,7 +79,7 @@ Um privilégio ou um papel pode ser associado a várias combinações de "ação - Você cria **privilégios** e/ou funções no arquivo `roles.json` (veja abaixo). Você **configurou** o escopo dele, atribuindo-lhes a ação de permissão aplicada aos recursos. -- Você **permite** privilégios e/ou funções para cada sessão do usuário usando a função [`.setPrivileges()`](../API/SessionClass.md#setprivileges) da classe `Session`. +- Você **permite** privilégios e/ou funções para cada sessão usuário usando a função [`.setPrivileges()`](../API/SessionClass.md#setprivileges) da classe `Session`. ### Exemplo @@ -113,7 +113,7 @@ O arquivo `roles.json` descreve todas as configurações de segurança do projet ### Arquivo padrão -Quando você cria um projeto, um arquivo `roles.json` padrão é criado no seguinte local: `/Project/Sources/` (consulte a seção [Arquitetura](../Project/architecture.md#sources)). +When you create a project, a default `roles.json` file is created at the following location: `/Project/Sources/` (see [Architecture](../Project/architecture.md#sources) section). O arquivo padrão tem o seguinte conteúdo: diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md index 6dfa4eb0bea5ae..3f0cc44d806675 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/API/CollectionClass.md @@ -3172,16 +3172,17 @@ Quer saber se pelo menos um valor de coleção é >0. -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection -| Parâmetro | Tipo | | Descrição | -| ---------- | ---------------------------- | :-------------------------: | --------------------------------------------------------------------- | -| formula | 4D. Function | -> | Objecto fórmula | -| methodName | Text | -> | Nome da função a qual se chama para processar os elementos da coleção | -| extraParam | any | -> | Parâmetros para o método | -| Resultados | Collection | <- | Colecção original ordenada | +| Parâmetro | Tipo | | Descrição | +| ---------- | ---------------------------- | :-------------------------: | ------------------------------------------------------------------------ | +| ascOrDesc | Integer | -> | `ck ascending` ou `ck descending` (valores escalares) | +| formula | 4D. Function | -> | Objecto fórmula | +| methodName | Text | -> | Nome da função a qual se chama para processar os elementos da coleção | +| extraParam | any | -> | Parâmetros para o método | +| Resultados | Collection | <- | Colecção original ordenada | @@ -3191,7 +3192,19 @@ A função `.sort()` classifica os elemen > Essa função modifica a coleção original. -Se `.sort()` for chamado sem parâmetros, somente os valores escalares (número, texto, data, booleanos) serão classificados. Os elementos são classificados por defeito em ordem ascendente, de acordo com o seu tipo. Se a coleção conter elementos de tipos diferentes, são primeiro agrupados por tipo e ordenados depois. Se attributePath levar a uma propriedade de objeto que conter valores de diferentes tipos, primeiro se agrupam por tipo e se ordenam depois. +Se `.sort()` for chamado sem parâmetros, somente os valores escalares (número, texto, data, booleanos) serão classificados. Os elementos são classificados por defeito em ordem ascendente, de acordo com o seu tipo. +You can also pass one of the following constants in the *ascOrDesc* parameter: + + ``` + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + ``` + +Se a coleção conter elementos de tipos diferentes, são primeiro agrupados por tipo e ordenados depois. Se attributePath levar a uma propriedade de objeto que conter valores de diferentes tipos, primeiro se agrupam por tipo e se ordenam depois. 1. null 2. booleans diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md index 7f50a117cbcb58..5369ef6030e60c 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/API/SessionClass.md @@ -117,7 +117,7 @@ $isGuest:=Session.isGuest() //$isGuest é True | Parâmetro | Tipo | | Descrição | | ---------- | ------- | :-------------------------: | -------------------------------------- | | lifespan | Integer | -> | Duração do token de sessão em segundos | -| Resultados | Text | <- | UUID da sessão | +| Resultados | Text | <- | UUID of the OTP token | diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/ORDA/privileges.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/ORDA/privileges.md index 43b7de5a36cf21..843d734816c5de 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/ORDA/privileges.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R9/ORDA/privileges.md @@ -76,7 +76,7 @@ Um privilégio ou um papel pode ser associado a várias combinações de "ação - Você cria **privilégios** e/ou funções no arquivo `roles.json` (veja abaixo). Você **configurou** o escopo dele, atribuindo-lhes a ação de permissão aplicada aos recursos. -- Você **permite** privilégios e/ou funções para cada sessão do usuário usando a função [`.setPrivileges()`](../API/SessionClass.md#setprivileges) da classe `Session`. +- Você **permite** privilégios e/ou funções para cada sessão usuário usando a função [`.setPrivileges()`](../API/SessionClass.md#setprivileges) da classe `Session`. ### Exemplo @@ -110,7 +110,7 @@ O arquivo `roles.json` descreve todas as configurações de segurança do projet ### Arquivo padrão -Quando você cria um projeto, um arquivo `roles.json` padrão é criado no seguinte local: `/Project/Sources/` (consulte a seção [Arquitetura](../Project/architecture.md#sources)). +When you create a project, a default `roles.json` file is created at the following location: `/Project/Sources/` (see [Architecture](../Project/architecture.md#sources) section). O arquivo padrão tem o seguinte conteúdo: diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md index 1a9f2a3bedf7bf..f2d5492e1a84f4 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/API/CollectionClass.md @@ -3206,19 +3206,18 @@ Quer saber se pelo menos um valor de colecção é >0. -**.sort**() : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection +**.sort**() : Collection
    **.sort**( *ascOrDesc* : Integer ) : Collection
    **.sort**( *formula* : 4D.Function { ; *...extraParam* : any } ) : Collection
    **.sort**( *methodName* : Text { ; *...extraParam* : any } ) : Collection | Parâmetro | Tipo | | Descrição | | ---------- | ------------ |:--:| --------------------------------------------------------------------- | +| ascOrDesc | Integer | -> | `ck ascending` ou `ck descending` (valores escalares) | | formula | 4D. Function | -> | Objecto fórmula | | methodName | Text | -> | Nome da função a qual se chama para processar os elementos da coleção | | extraParam | any | -> | Parâmetros para o método | -| Resultados | Collection | <- | Colecção original ordenada| - - -| +| Resultados | Collection | <- | Colecção original ordenada | + #### Descrição @@ -3226,7 +3225,16 @@ Quer saber se pelo menos um valor de colecção é >0. A função `.shift()` remove o primeiro elemento da colecção e devolve-o como resultado da função . > Essa função modifica a coleção original. -Se `.sort()` for chamado sem parâmetros, apenas valores escalares (número, texto, data, booleanos) são ordenados. Os elementos são classificados por defeito em ordem ascendente, de acordo com o seu tipo. Se a coleção contiver valores escalares diferentes, eles serão primeiro agrupados por tipo e, em seguida, classificados. Se *attributePath* levar a uma propriedade de objeto que conter valores de diferentes tipos, primeiro se agrupam por tipo e se ordenam depois. +Se `.sort()` for chamado sem parâmetros, apenas valores escalares (número, texto, data, booleanos) são ordenados. Os elementos são classificados por defeito em ordem ascendente, de acordo com o seu tipo. You can also pass one of the following constants in the *ascOrDesc* parameter: + + |Constant| Type|Value|Comment| + |---|---|---|---| + |ck ascending|Integer|0|Elements are ordered in ascending order (default)| + |ck descending|Integer|1|Elements are ordered in descending order| + + This syntax orders scalar values in the collection only (other element types such as objects or collections are returned unordered). + + Se a coleção conter elementos de tipos diferentes, são primeiro agrupados por tipo e ordenados depois. Se *attributePath* levar a uma propriedade de objeto que conter valores de diferentes tipos, primeiro se agrupam por tipo e se ordenam depois. 1. null 2. booleans