From 7a25c4dc0c0293c2c356a0cbef855270ffcbaa91 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:09:07 +0200 Subject: [PATCH 001/180] New translations DataClassClass.md (French) --- .../current/API/DataClassClass.md | 269 +++++++++++------- 1 file changed, 163 insertions(+), 106 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/fr/docusaurus-plugin-content-docs/current/API/DataClassClass.md index 777d87eebea71c..429347781f0d75 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/API/DataClassClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/API/DataClassClass.md @@ -851,7 +851,7 @@ La fonction `.query()` recherche les Si aucune entité correspondante n'est trouvée, une `EntitySelection` vide est retournée. -**Paramètre queryString** +#### queryString parameter Le paramètre *queryString* doit respecter la syntaxe suivante : @@ -861,9 +861,9 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -où : +where: -* **attributePath** : Chemin de l'attribut sur lequel vous souhaitez exécuter la recherche. Ce paramètre peut contenir un nom simple (par exemple "pays") ou un chemin d'attribut valide (par exemple "pays.nom"). Dans le cas d'un chemin d'attribut de type `Collection`, la notation \[ ] est utilisée pour designer toutes les occurrences (par exemple "enfants\[ ].age"). +* **attributePath** : Chemin de l'attribut sur lequel vous souhaitez exécuter la recherche. Ce paramètre peut contenir un nom simple (par exemple "pays") ou un chemin d'attribut valide (par exemple "pays.nom"). In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > Vous ne pouvez pas utiliser directement des attributs dont les noms contiennent des caractères spéciaux tels que ".", "\[ ]", ou "=", ">", "#"..., car ils ne seront pas correctement évalués dans la chaîne de recherche. Si vous souhaitez rechercher ces attributs, vous devez utiliser des placeholders, qui permettent d'utiliser un ensemble de caractères plus étendu dans les chemins d'attribut (voir * **Utiliser des placeholders** *ci-dessous). * **formula** : Une formule valide passée en `Text` ou en `Object`. La formule sera évaluée pour chaque entité traitée et doit retourner une valeur booléenne. Dans la formule, l'entité est disponible via l'objet `This`. @@ -879,19 +879,19 @@ où : * **comparator** : symbole d'opérateur utilisé pour comparer *attributePath* et *value*. Les symboles suivants sont pris en charge : - | Comparaison | Symbole(s) | Commentaire | - | --------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | - | Egal à | =, == | Retourne les données correspondantes, prend en charge le joker de recherche (@), ne tient pas compte de la casse et est non diacritique. | - | | ===, IS | Retourne les données correspondantes, considère le @ comme un caractère standard, ne tient pas compte de la casse et est non diacritique | - | Différent de | #, != | Prend en charge le joker de recherche (@) | - | | !==, IS NOT | Considère le @ comme un caractère standard | - | Inférieur à | | | - | Supérieur à | > | | - | Inférieur ou égal à | <= | | - | Supérieur ou égal à | >= | | - | Inclus parmi | IN | Retourne les données égales à au moins une des valeurs d'une collection ou d'un ensemble de valeurs, prend en charge le joker de recherche (@) | - | Condition Not appliquée à une assertion | NOT | Les parenthèses sont obligatoires lorsque NOT est utilisé devant une assertion contenant plusieurs opérateurs | - | Contient mot-clé | % | Les mots-clés peuvent être utilisés avec les attributs de type texte ou image | + | Comparaison | Symbole(s) | Commentaire | + | --------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Egal à | =, == | Retourne les données correspondantes, prend en charge le joker de recherche (@), ne tient pas compte de la casse et est non diacritique. | + | | ===, IS | Retourne les données correspondantes, considère le @ comme un caractère standard, ne tient pas compte de la casse et est non diacritique | + | Différent de | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considère le @ comme un caractère standard | + | Condition Not appliquée à une assertion | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Inférieur à | | | + | Supérieur à | > | | + | Inférieur ou égal à | <= | | + | Supérieur ou égal à | >= | | + | Inclus parmi | IN | Retourne les données égales à au moins une des valeurs d'une collection ou d'un ensemble de valeurs, prend en charge le joker de recherche (@) | + | Contient mot-clé | % | Les mots-clés peuvent être utilisés avec les attributs de type texte ou image | * **value** : valeur à comparer à la valeur courante de l'attribut de chaque entité de la sélection ou élément de la collection. Peut être un **placeholder** (voir **Utiliser des placeholders** ci-dessous) ou toute expression correspondant à la propriété du type de donnée. Lorsque vous utilisez une valeur constante, les règles suivantes doivent être respectées : * Les valeurs constantes de type **texte** peuvent être passées avec ou sans guillemets (voir **Utilisation des guillemets** ci-dessous). Pour rechercher une chaîne dans une chaîne (recherche de type "contient"), utilisez le symbole joker (@) dans valeur pour isoler la chaîne à chercher, comme dans cet exemple : "@Smith@". Les mots-clés suivants sont interdits pour des constantes de type texte : true, false. @@ -909,40 +909,40 @@ où : * **order by attributePath** : vous pouvez inclure une déclaration order by *attributePath* dans la requête afin que les données résultantes soient triées selon cette déclaration. Vous pouvez utiliser plusieurs tris par déclaration, en les séparant par des virgules (e.g., order by *attributePath1* desc, *attributePath2* asc). Par défaut, le tri est par ordre croissant. Passez 'desc' pour définir un tri par ordre décroissant et 'asc' pour définir un tri par ordre croissant. >Si vous utilisez cette déclaration, l'entity selection retournée est triée (pour plus d'informations, veuillez consulter [Entity selections triées vs Entity selection non triées](ORDA/dsMapping.md#entity-selections-triees-vs-entity-selections-non-triees)). -**Utilisation des guillemets** +#### Using quotes -Lorsque vous utilisez des guillemets dans les recherches, vous devez utiliser des apostrophes ' ' à l'intérieur des requêtes et des guillemets " " pour encadrer la recherche complète, sinon une erreur est générée. Par exemple : +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Par exemple : ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Les guillemets simples (') ne sont pas pris en charge dans les valeurs recherchées car ils casseraient la chaîne de recherche. Par exemple, "comp.name = 'John's pizza' " génèrera une erreur. Si vous devez rechercher des valeurs contenant des guillemets simples, il est nécessaire d'utiliser des placeholders (voir ci-dessous). -**Utilisation des parenthèses** +#### Using parenthesis -Vous pouvez utiliser des parenthèses dans la recherche afin de prioriser les calculs. Par exemple, vous pouvez organiser une recherche de la manière suivante : +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Utilisation des placeholders** +#### Using placeholders -4D vous permet d'utiliser des placeholders pour les arguments *attributePath*, *formula* et *value* dans le paramètre *queryString*. Un placeholder est un paramètre que vous insérez dans des chaines de recherche et qui est remplacé par une autre valeur au moment où la chaîne de recherche est évaluée. La valeur des placeholders est évaluée une seule fois, au début de la requête ; elle n'est pas évaluée pour chaque élément. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Il existe deux types de placeholders : les **placeholders indexés** et les **placeholders nommés** : +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | | Placeholders indexés | Placeholders nommés | | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Définition | You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: | Les paramètres sont insérés sous la forme `:paramName` (par exemple :myparam) et leurs valeurs sont fournies dans les objets attributes et/ou parameters dans le paramètre *querySettings* | | Exemple | `$r:=class.query(":1=:2";"city";"Chicago")` | `$o.attributes:=New object("att";"city")`
`$o.parameters:=New object("name";"Chicago")`
`$r:=class.query(":att=:name";$o)` | -Vous pouvez combiner tous les types d'arguments dans *queryString*. in *queryString* and their corresponding values are provided by the sequence of *value* parameter(s). You can use up to 128 *value* parameters +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * des valeurs directes (pas de placeholders) * des placeholders indexés et/ou nommés. -L'utilisation de placeholders dans les recherches **est recommandée** pour les raisons suivantes : +Using placeholders in queries **is recommended** for the following reasons: 1. Cela empêche l'injection de code malveillant : si vous utilisez dans la chaîne de recherche des variables dont le contenu provient directement de la saisie de l'utilisateur, celui-ci pourrait modifier les conditions de recherche en saisissant des arguments de recherche supplémentaires. Par exemple, imaginez une chaîne de recherche du type : @@ -951,50 +951,105 @@ L'utilisation de placeholders dans les recherches **est recommandée** pour les $result:=$col.query($vquery) ``` - Cette recherche semble sécurisée puisque les données non publiques sont filtrées. Cependant, si l'utilisateur saisit dans la zone *myname* une chaîne du type *"smith OR status='private'*, la chaîne de recherche sera modifiée à l'étape de l'interprétation et pourra retourner des données privées. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Lorsque vous utilisez des placeholders, le contournement des options de sécurité n'est pas possible : + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - Dans ce cas, si l'utilisateur saisit *smith OR status='private'* dans la zone *myname*, cela ne sera pas interprété dans la chaîne de recherche, mais uniquement passé en tant que valeur. La recherche d'une personne nommée "smith OR status='private"' échouera simplement. + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Cela résout les questions liées au formatage des valeurs ou des caractères, notamment lorsque vous gérez des paramètres *attributePath* et *value* qui peuvent contenir des caractères non-alphanumériques tels que ".", "["... 3. Cela permet l'utilisation de variables ou d'expressions dans les arguments de recherche. Exemples : ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Recherche de valeurs null** +#### Looking for null values -Lorsque vous recherchez les valeurs null, vous ne pouvez pas utiliser la syntaxe placeholder car le moteur de recherche considère la valeur null comme une valeur de comparaison invalide. Par exemple, si vous exécutez la recherche suivante : +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // ne fonctionnera PAS ``` -Vous n'obtiendrez pas le résultat souhaité car la valeur null sera évaluée par 4D comme une erreur résultant de l'évaluation du paramètre (pouvant être, par exemple, un attribut provenant d'une autre recherche). Pour ce type de recherches, vous devez utiliser la syntaxe de recherche directe : +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds.Person.query("spouse = null") //syntaxe valide ``` -**Relier les arguments de recherche aux collections dans les attributs** +#### Not equal to in collections + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + + +#### Linking collection attribute query arguments :::info -Cette fonctionnalité est disponible uniquement pour les recherches dans les dataclasses et les [entity selections](EntitySelectionClass.md#query). Elle ne peut pas être utilisée pour les recherches dans les [collections](CollectionClass.md#query). +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -Lorsque vous effectuez des recherches parmi des attributs objets de dataclass contenant des collections à l'aide de plusieurs arguments de requête reliés par l'opérateur AND, vous souhaiterez éventuellement vous assurer que seules les entités contenant des éléments correspondant à tous les arguments soient retournées, et non les entités où des arguments peuvent être trouvés dans différents éléments. Pour ce faire, vous devez relier les arguments de requête aux éléments de collection, de sorte que seuls les éléments uniques contenant des arguments reliés soient retournés. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Par exemple, avec les deux entités suivantes : +For example, with the following two entities: ``` Entity 1: @@ -1017,35 +1072,35 @@ ds.People.places: } ] } ``` -Vous souhaitez trouver des personnes dont le type d'emplacement est "home" dans la ville de "paris". Si vous écrivez : +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... la requête retournera "martin" **et** "smith" car "smith" a un élément "locations" dont "kind" (le type) est "home" et un élément "locations" dont "city" (la ville) est "paris", même si ce sont des éléments différents. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Si vous souhaitez obtenir uniquement les entités dont les arguments correspondants sont dans le même élément de collection, vous devez **relier les arguments**. Pour lier des arguments de requête : +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Ajoutez une lettre entre le caractère \[] dans le premier chemin à lier et répétez la même lettre dans tous les arguments liés. Par exemple : `locations[a].city and locations[a].kind`. Vous pouvez utiliser n'importe quelle lettre de l'alphabet latin (non sensible à la casse). * Pour ajouter différents critères liés dans la même requête, utilisez une autre lettre. Vous pouvez créer jusqu'à 26 combinaisons de critères dans une seule requête. -A l'aide des entités ci-dessus, si vous écrivez : +With the above entities, if you write: ```4d ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... la requête ne retournera uniquement "martin" car il possède un élément "locations" dont "kind" est "home" et dont "city" est "paris". La requête ne retournera pas "smith" car les valeurs "home" et "paris" ne sont pas contenus dans le même élément de collection. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Recherches dans les relations N vers N** +#### Queries in many-to-many relations -ORDA propose une syntaxe spéciale pour faciliter les recherches dans les relations N vers N. Dans ce contexte, vous pouvez avoir besoin de rechercher des valeurs différentes à l'aide de l'opérateur `AND` MAIS dans le même attribut. Par exemple, considérez la structure suivante : +ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: ![alt-text](../assets/en/API/manytomany.png) -Imaginez que vous souhaitiez rechercher tous les films dans lesquels un acteur A *Et* un acteur B ont joué un rôle. Si vous écrivez une recherche simple utilisant l'opérateur `AND`, cela ne va pas fonctionner : +Imagine that you want to search all movies in which *both* actor A and actor B have a role. If you write a simple query using an `AND` operator, it will not work: ```4d // code invalide @@ -1053,17 +1108,17 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";"H // $es est vide ``` -Fondamentalement, le problème vient de la logique interne de la recherche : vous ne pouvez pas rechercher une entité dont un attribut aurait simultanément la valeur "A" et "B". +Basically, the issue is related to the internal logic of the query: you cannot search for an attribute whose value would be both "A" and "B". -Pour rendre possible ce type de recheche, ORDA prend en charge une syntaxe spéciale : vous devez juste ajouter un *class index* entre les caractères **{}** dans tous les attributs relationnels utilisés dans la chaîne de recherche : +To make it possible to perform such queries, ORDA allows a special syntax: you just need to add a *class index* between **{}** in all additional relation attributes used in the string: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** indique à ORDA de créer une autre référence pour l'attribut relationnel. Le moteur de requêtes effectuera alors toutes les opérations internes nécessaires. Notez que **x** peut être n'importe quel nombre **à l'exception de 0**: {1}, ou {2}, ou {1540}... ORDA a simplement besoin d'une référence unique dans la recherche pour chaque class index. +**{x}** tells ORDA to create another reference for the relation attribute. It will then perform all the necessary bitmap operations internally. Note that **x** can be any number **except 0**: {1}, or {2}, or {1540}... ORDA only needs a unique reference in the query for each class index. -Dans notre exemple, cela pourrait donner : +In our example, it would be: ```4d // code valide @@ -1071,38 +1126,40 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es contient des films (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**Paramètre formula** -Au lieu d'insérer une formule dans le paramètre *queryString* (voir ci-dessus), vous pouvez directement passer un objet formule en tant que critère de recherche booléen. L'utilisation d'un objet formule pour les requêtes est **recommandée** car vous bénéficiez d'une tokenisation et le code est plus facile à rechercher/lire. -La formule doit avoir été créée à l'aide des commandes [`Formula`](FunctionClass.md#formula) ou [`Formula from string`](FunctionClass.md#formula-from-string). Dans ce cas : +#### formula parameter + +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. + +La formule doit avoir été créée à l'aide des commandes [`Formula`](FunctionClass.md#formula) ou [`Formula from string`](FunctionClass.md#formula-from-string). In this case: * *formula* est évaluée pour chaque entité et doit renvoyer vrai ou faux. Lors de l'exécution de la requête, si le résultat de la formule n'est pas un booléen, il est considéré comme faux. * dans *formula*, l'entité est disponible via l'objet `This`. * si l'objet `Formula` est **null**, l'erreur 1626 ("Attente d'un texte ou d'une formule") est générée, que vous pouvez intercepter à l'aide d'une méthode installée avec `ON ERR CALL`. > Pour des raisons de sécurité, les appels de formule dans les fonctions `query()` peuvent être interdits. Voir la description du paramètre *querySettings*. -**Passer des paramètres aux formules** +#### Passing parameters to formulas -Tout paramètre *formula* appelé par la fonction `query()` peut recevoir des paramètres : +Any *formula* called by the `query()` class function can receive parameters: * Les paramètres doivent être passés via la propriété **args** du paramètre *querySettings*. * La formule reçoit cet objet **args** en tant que paramètre **$1**. -Ce code montre comment les paramètres sont passés aux fonctions : +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //objet args pour passer des paramètres $es:=ds.Students.query("eval(checkName($1.exclude))";$settings) //args est reçu dans $1 ``` -Des exemples supplémentaires sont fournis dans l'exemple 3. +Additional examples are provided in example 3. -**4D Server** : En client/serveur, les formules sont exécutées sur le serveur. Dans ce contexte, seul l'objet `querySettings.args` est envoyé aux formules. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**Paramètre querySettings** +#### querySettings parameter -Dans le paramètre *querySettings* vous pouvez passer un objet contenant des options supplémentaires. Les propriétés suivantes sont prises en charge : +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propriété | Type | Description | | ------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1114,18 +1171,18 @@ Dans le paramètre *querySettings* vous pouvez passer un objet contenant des opt | queryPlan | Boolean | Dans l'entity selection résultante, retourne ou ne retourne la description détaillée de la recherche juste avant d'être exécutée, i.e. La propriété retournée est un objet qui inclut chaque recherche et sous-recherche programmée (dans le cas d'une recherche complexe). Cette option est utile durant la phase de développement d'une application. Elle est utilisée conjointement à queryPath. Par défaut, si elle est omise : faux. **Note** : Cette propriété est prise en charge uniquement par les fonctions `entitySelection.query()` et `dataClass.query()`. | | queryPath | Boolean | Dans l'entity selection résultante, retourne ou ne retourne pas la description détaillée de la recherche telle qu'elle est effectuée. La propriété retournée est un objet qui contient le chemin utilisé pour la recherche (généralement identique à celui de queryPlan, mais il peut être différent si le moteur parvient à optimiser la recherche), la durée du traitement et le nombre d'enregistrements trouvés. Cette option est utile durant la phase de développement d'une application. Par défaut, si elle est omise : faux. **Note** : Cette propriété est prise en charge uniquement par les fonctions `entitySelection.query()` et `dataClass.query()`. | -**A propos de queryPlan et queryPath** +#### About queryPlan and queryPath -Les informations enregistrées dans `queryPlan` et `queryPath` incluent le type de recherche (indexée ou séquentielle), chaque sous-recherche nécessaire, ainsi que les opérateurs de conjonction. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Généralement, la description du plan de requête et son chemin d'accès sont identiques mais ils peuvent différer car 4D peut intégrer des optimisations dynamiques lorsqu'une requête est exécutée, afin d'améliorer les performances. Par exemple, le moteur 4D peut convertir dynamiquement une requête indexée en requête séquentielle s'il estime que ce processus est plus rapide. Ce cas particulier peut se produire lorsque le nombre d'entités recherchées est faible. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Par exemple, si vous exécutez la recherche suivante : +For example, if you execute the following query: ```4d $sel:=ds.Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ 50000;"Lima West Kilo";10000000;New object("queryPath";True;"queryPlan";True)) ``` -queryPlan : +queryPlan: ```4d {Or:[{And:[{item:[index : Employee.salary ] < 50000}, @@ -1135,7 +1192,7 @@ queryPlan : subquery:[{item:[index : Company.revenues ] > 10000000}]}]} ``` -queryPath : +queryPath: ```4d {steps:[{description:OR,time:63,recordsfounds:1388132, @@ -1147,46 +1204,46 @@ queryPath : #### Exemple 1 -Cette section fournit divers exemples de recherches. +This section provides various examples of queries. -Recherche dans une chaîne : +Query on a string: ```4d $entitySelection:=ds.Customer.query("firstName = 'S@'") ``` -Recherche avec une instruction NOT : +Query with a NOT statement: ```4d $entitySelection:=ds.Employee.query("not(firstName=Kim)") ``` -Recherche avec des dates : +Queries with dates: ```4d $entitySelection:=ds.Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds.Employee.query("birthDate <= :1";Current date-10950) ``` -Recherche avec des placeholders indexés pour les valeurs : +Query with indexed placeholders for values: ```4d $entitySelection:=ds.Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Recherche avec des placeholders indexés pour les valeurs sur une dataclass liée : +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds.Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Recherche avec des placeholders indexés avec tri décroissant : +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds.Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Recherche avec des placeholders nommés pour les valeurs : +Query with named placeholders for values: ```4d var $querySettings : Object @@ -1196,7 +1253,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Recherche utilisant les placeholders nommés et indexés pour les valeurs : +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -1205,7 +1262,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Recherche avec objets queryPlan et queryPath : +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds.Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -1216,19 +1273,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Recherche avec un chemin d'attribut de type Collection : +Query with an attribute path of Collection type: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Recherche avec un chemin d'attribut de type Collection et des attributs reliés : +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Recherche avec un chemin d'attribut de type Collection et plusieurs attributs reliés : +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1236,25 +1293,25 @@ $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Recherche avec un chemin d'attribut de type Objet : +Query with an attribute path of Object type: ```4d $entitySelection:=ds.Employee.query("extra.eyeColor = :1";"blue") ``` -Recherche avec instruction IN : +Query with an IN statement: ```4d $entitySelection:=ds.Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Recherche avec instruction NOT (IN) : +Query with a NOT (IN) statement: ```4d $entitySelection:=ds.Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Recherche avec des placeholders indexés pour les attributs : +Query with indexed placeholders for attributes: ```4d var $es : cs.EmployeeSelection @@ -1262,7 +1319,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") //salesperson est une entité reliée ``` -Recherche avec des placeholders indexés pour les attributs et avec des placeholders nommés pour les valeurs : +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs.EmployeeSelection @@ -1273,7 +1330,7 @@ $es:=ds.Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId";" //salesperson est une entité reliée ``` -Recherche avec des placeholders indexés pour les attributs et les valeurs : +Query with indexed placeholders for attributes and values: ```4d var $es : cs.EmployeeSelection @@ -1283,11 +1340,11 @@ $es:=ds.Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smith #### Exemple 2 -Cette section illustre les recherches avec des placeholders nommés pour les attributs. +This section illustrates queries with named placeholders for attributes. -Considérons une dataclass Employee avec 2 entités : +Given an Employee dataclass with 2 entities: -Entité 1 : +Entity 1: ```4d name: "Marie" @@ -1299,7 +1356,7 @@ softwares:{ } ``` -Entité 2 : +Entity 2: ```4d name: "Sophie" @@ -1311,7 +1368,7 @@ softwares:{ } ``` -Recherche avec des placeholders nommés pour les attributs : +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1322,7 +1379,7 @@ Recherche avec des placeholders nommés pour les attributs : //$es.length=1 (Employee Marie) ``` -Recherche avec des placeholders nommés pour les attributs et les valeurs : +Query with named placeholders for attributes and values: ```4d @@ -1343,16 +1400,16 @@ Recherche avec des placeholders nommés pour les attributs et les valeurs : #### Exemple 3 -Ces exemples illustrent les diverses manières d'utiliser des formules avec ou sans paramètres dans vos recherches. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -La formule est fournie sous forme de texte avec `eval()` dans le paramètre *queryString* : +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs.StudentsSelection $es:=ds.Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -La formule est fournie sout forme d'objet `Formula` via un placeholder : +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs.StudentsSelection @@ -1361,7 +1418,7 @@ La formule est fournie sout forme d'objet `Formula` via un placeholder : $es:=ds.Students.query(":1 and nationality='French'";$formula) ``` -Seul un objet `Formula` est fourni comme critère de recherche : +Only a `Formula` object is given as criteria: ```4d var $es : cs.StudentsSelection @@ -1370,7 +1427,7 @@ Seul un objet `Formula` est fourni comme critère de recherche : $es:=ds.Students.query($formula) ``` -Plusieurs formules peuvent être appliquées : +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1379,7 +1436,7 @@ Plusieurs formules peuvent être appliquées : $0:=ds.Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Une formule texte dans *queryString* reçoit un paramètre : +A text formula in *queryString* receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1395,7 +1452,7 @@ Une formule texte dans *queryString* reçoit un paramètre : $result:=(Position($exclude;This.lastname)=0) ``` -En utilisant la même méthode ***checkName***, un objet `Formula` en placeholder reçoit un paramètre : +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1408,7 +1465,7 @@ En utilisant la même méthode ***checkName***, un objet `Formula` en placeholde $es:=ds.Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisissent leurs requêtes : +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs.StudentsSelection @@ -1423,7 +1480,7 @@ Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisis #### Voir également -[`.query()`](EntitySelectionClass.md#query) pour les entity selections +[`.query()`](EntitySelectionClass.md#query) for entity selections @@ -1443,7 +1500,7 @@ Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisis | Paramètres | Type | | Description | | ---------- | ------ | -- | ------------------------------------------------------------------------------------------------------------- | -| settings | Object | -> | Objet définissant le timeout et la taille maximum du cache ORDA pour la dataclass.| +| settings | Object | -> | Object that sets the timeout and maximum size of the ORDA cache for the dataclass.| | @@ -1451,30 +1508,30 @@ Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisis #### Description -La fonction `setRemoteCacheSettings()` définit le timeout et la taille maximum du cache ORDA pour la dataclass.. +The `.setRemoteCacheSettings()` function sets the timeout and maximum size of the ORDA cache for a dataclass.. -Dans le paramètre *settings*, passez un objet contenant les propriétés suivantes : +In the *settings* parameter, pass an object with the following properties: | Propriété | Type | Description | | ---------- | ------- | ------------------------- | | timeout | Integer | Timeout en secondes. | | maxEntries | Integer | Nombre maximum d'entités. | -`timeout` définit le timeout du cache ORDA pour la dataclass (30 secondes par défaut). Lorsque le timeout est atteint, les entités de la dataclass dans le cache sont considérées comme expirées. Cela signifie que : +`timeout` sets the timeout of the ORDA cache for the dataclass (default is 30 seconds). Once the timeout has passed, the entities of the dataclass in the cache are considered as expired. This means that: * les données sont toujours présentes * la prochaine fois que les données seront requises, elles seront demandées au serveur * 4D supprime automatiquement les données expirées lorsque le nombre maximum d'entités est atteint -Modifier la propriété `timeout` définit un nouveau timeout pour les entités déjà présentes dans le cache. Cela peut être utile lorsque vous travaillez avec des données qui ne changent pas souvent, et pour lesquelles de nouvelles requêtes au serveur ne sont donc pas nécessaires. +Setting a `timeout` property sets a new timeout for the entities already present in the cache. It is useful when working with data that does not change very frequently, and thus when new requests to the server are not necessary. -`maxEntries` définit le nombre maximum d'entités dans le cache ORDA. Par défaut ce nombre est 30 000. +`maxEntries` sets the max number of entities in the ORDA cache. Default is 30 000. -Le nombre d'entrées minimum est 300, donc la valeur de `maxEntries` doit être égale ou supérieure à 300. Sinon la valeur est ignorée et le nombre d'entrées maximum est fixé à 300. +The minimum number of entries is 300, so the value of `maxEntries` must be equal to or higher than 300. Otherwise it is ignored and the maximum number of entries is set to 300. -Si aucune propriété valide n'est passée à `timeout` et `maxEntries`, le cache n'est pas modifié, il conserve ses valeurs précédentes ou par défaut. +If no valid properties are passed as `timeout` and `maxEntries`, the cache remains unchanged, with its default or previously set values. -Lorsqu'une entité est sauvegardée, elle est mise à jour dans le cache expirera lorsque le timeout sera atteint. +When an entity is saved, it is updated in the cache and expires once the timeout is reached. #### Exemple From e30598fffb1cc7260f624028ad93edf3ac3a4ed7 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:09:15 +0200 Subject: [PATCH 002/180] New translations EntityClass.md (French) --- .../docusaurus-plugin-content-docs/current/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/API/EntityClass.md b/i18n/fr/docusaurus-plugin-content-docs/current/API/EntityClass.md index 9adedb07b42f9e..26068ccbbbd05d 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/API/EntityClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/API/EntityClass.md @@ -1699,7 +1699,7 @@ Si aucun attribut de l'entité n'a été touché, la fonction retourne une colle //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -Dans ce cas : +In this case: * firstName et lastName ont un type `storage` * employer a un type `relatedEntity` From 0fa85c2a7a0428510550a4a068adbd687352450f Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:11:59 +0200 Subject: [PATCH 003/180] New translations properties_Text.md (French) --- .../current/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md b/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md index 7787dae5fabb80..7f2737a1d800d1 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md @@ -282,7 +282,7 @@ This property can also be handled by the [OBJECT Get vertical alignment](https:/ `List box de type collection ou entity selection (sélection d'entité)` -Indique une expression ou une variable qui sera évaluée pour chaque ligne affichée. Elle permet de définir un ensemble d'attributs texte des lignes. Vous devez passer une **variable objet** ou une **expression qui retourne un objet**. Les propriétés suivantes sont prises en charge : +Indique une expression ou une variable qui sera évaluée pour chaque ligne affichée. Elle permet de définir un ensemble d'attributs texte des lignes. Vous devez passer une **variable objet** ou une **expression qui retourne un objet**. The following properties are supported: | Nom de propriété | Type | Description | | ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 836ed6da6d27d22a14e7b4fddf41bcb9e7880278 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:13:09 +0200 Subject: [PATCH 004/180] New translations genInfo.md (French) --- i18n/fr/docusaurus-plugin-content-docs/current/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/REST/genInfo.md b/i18n/fr/docusaurus-plugin-content-docs/current/REST/genInfo.md index ad66a4d9676037..836c3e8a81e488 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/REST/genInfo.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/REST/genInfo.md @@ -33,4 +33,4 @@ Ces propriétés sont des objets contenant des informations sur la façon dont l - **queryPlan** : objet contenant la description détaillée de la requête juste avant son exécution (c'est-à-dire la requête planifiée). - **queryPath** : objet contenant la description détaillée de la requête telle qu'elle a été réellement effectuée. -Les informations enregistrées incluent le type de requête (indexé et séquentiel) et chaque sous-requête nécessaire ainsi que les opérateurs de conjonction. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Query paths also contain the number of entities found and the time required to execute each search criterion. Généralement, la description du plan de requête et son chemin d'accès sont identiques mais ils peuvent différer car 4D peut intégrer des optimisations dynamiques lorsqu'une requête est exécutée, afin d'améliorer les performances. Par exemple, le moteur 4D peut convertir dynamiquement une requête indexée en requête séquentielle s'il estime que ce processus est plus rapide. Ce cas particulier peut se produire lorsque le nombre d'entités recherchées est faible. \ No newline at end of file +Les informations enregistrées incluent le type de requête (indexé et séquentiel) et chaque sous-requête nécessaire ainsi que les opérateurs de conjonction. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From 58d5a058836f7d811debd6fac9fb1b56140163d0 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:13:31 +0200 Subject: [PATCH 005/180] New translations method-list.md (French) --- .../current/ViewPro/method-list.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/ViewPro/method-list.md b/i18n/fr/docusaurus-plugin-content-docs/current/ViewPro/method-list.md index 12eae7ec2266e4..bf07156b1ef43d 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/ViewPro/method-list.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/ViewPro/method-list.md @@ -37,7 +37,7 @@ Passez la formule 4D View Pro que vous souhaitez nommer dans *vpFormula*. Pour p Passez le nouveau nom de la formule dans *name*. Si le nom est déjà utilisé dans le même scope, la nouvelle formule nommée remplace la formule existante. A noter que vous pouvez utiliser le même nom pour plusieurs scopes (ci-dessous). -Vous pouvez passer un objet avec des propriétés additionnelles pour la plage nommée dans *options*. Les propriétés suivantes sont prises en charge : +Vous pouvez passer un objet avec des propriétés additionnelles pour la plage nommée dans *options*. The following properties are supported: | Propriété | Type | Description | | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -77,7 +77,7 @@ La commande `VP ADD RANGE NAME` Dans *rangeObj*, passez la plage que vous souhaitez nommer, et passez le nouveau nom de la plage dans *name*. Si le nom est déjà utilisé dans le même scope, la nouvelle plage nommée remplace la plage existante. A noter que vous pouvez utiliser le même nom pour plusieurs scopes (ci-dessous). -Vous pouvez passer un objet avec des propriétés supplémentaires pour la plage nommée dans *options*. Les propriétés suivantes sont prises en charge : +Vous pouvez passer un objet avec des propriétés supplémentaires pour la plage nommée dans *options*. The following properties are supported: | Propriété | Type | Description | | --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1160,7 +1160,7 @@ Dans le paramètre *rangeObj*, passez un objet contenant une plage dans laquelle Le paramètre *searchValue* vous permet de passer le texte à rechercher dans *rangeObj*. -Vous pouvez passer le paramètre optionnel *searchCondition* pour préciser le fonctionnement de la recherche. Les propriétés suivantes sont prises en charge : +Vous pouvez passer le paramètre optionnel *searchCondition* pour préciser le fonctionnement de la recherche. The following properties are supported: | Propriété | Type | Description | | ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -3484,7 +3484,7 @@ VP NEW DOCUMENT("myVPArea") The `VP Object to font` command returns a font shorthand string from *fontObj*. -Dans *fontObj*, passez un objet contenant les propriétés de police. Les propriétés suivantes sont prises en charge : +Dans *fontObj*, passez un objet contenant les propriétés de police. The following properties are supported: | Propriété | Type | Description | Possible values | Obligatoire | | --------- | ---- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | From f17243eaf64b7217f1b47d65f21291ffa186bffd Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:26:46 +0200 Subject: [PATCH 006/180] New translations properties_Text.md (French) --- .../version-18/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md b/i18n/fr/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md index ad829e608d7895..173c43b88f0bf6 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md @@ -276,7 +276,7 @@ Cette propriété peut également être gérée par les commandes [OBJECT Get ve `List box de type collection ou entity selection (sélection d'entité)` -Indique une expression ou une variable qui sera évaluée pour chaque ligne affichée. Elle permet de définir un ensemble d'attributs texte des lignes. Vous devez passer une **variable objet** ou une **expression qui retourne un objet**. Les propriétés suivantes sont prises en charge : +Indique une expression ou une variable qui sera évaluée pour chaque ligne affichée. Elle permet de définir un ensemble d'attributs texte des lignes. Vous devez passer une **variable objet** ou une **expression qui retourne un objet**. The following properties are supported: | Nom de propriété | Type | Description | | --------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 7bd01bf917e85dc25b4253dc9c30e3b487796dfb Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:27:41 +0200 Subject: [PATCH 007/180] New translations genInfo.md (French) --- .../docusaurus-plugin-content-docs/version-18/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-18/REST/genInfo.md b/i18n/fr/docusaurus-plugin-content-docs/version-18/REST/genInfo.md index ad66a4d9676037..836c3e8a81e488 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-18/REST/genInfo.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-18/REST/genInfo.md @@ -33,4 +33,4 @@ Ces propriétés sont des objets contenant des informations sur la façon dont l - **queryPlan** : objet contenant la description détaillée de la requête juste avant son exécution (c'est-à-dire la requête planifiée). - **queryPath** : objet contenant la description détaillée de la requête telle qu'elle a été réellement effectuée. -Les informations enregistrées incluent le type de requête (indexé et séquentiel) et chaque sous-requête nécessaire ainsi que les opérateurs de conjonction. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Query paths also contain the number of entities found and the time required to execute each search criterion. Généralement, la description du plan de requête et son chemin d'accès sont identiques mais ils peuvent différer car 4D peut intégrer des optimisations dynamiques lorsqu'une requête est exécutée, afin d'améliorer les performances. Par exemple, le moteur 4D peut convertir dynamiquement une requête indexée en requête séquentielle s'il estime que ce processus est plus rapide. Ce cas particulier peut se produire lorsque le nombre d'entités recherchées est faible. \ No newline at end of file +Les informations enregistrées incluent le type de requête (indexé et séquentiel) et chaque sous-requête nécessaire ainsi que les opérateurs de conjonction. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From 8083c9fe0b6f3b29126b040d4cad4c73edbfb6be Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:32:12 +0200 Subject: [PATCH 008/180] New translations DataClassClass.md (French) --- .../version-19/API/DataClassClass.md | 205 +++++++++++------- 1 file changed, 131 insertions(+), 74 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md index 9bca16dd3ea6a1..c8b44a7e612fe0 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md @@ -481,8 +481,10 @@ La méthode projet ***SearchDuplicate*** recherche des valeurs dupliquées dans | ---------- | ------ | -- | -------------------------------------------------------- | | Résultat | Object | <- | Informations sur la dataclass| + | + #### Description The `.getInfo( )` function retourne un objet qui fournit des informations sur la dataclass. Cette fonction est utile pour l'écriture de code générique. @@ -650,7 +652,7 @@ The `.query( )` function recherche l Si aucune entité correspondante n'est trouvée, une `EntitySelection` vide est retournée. -**Paramètre queryString** +**queryString parameter** Le paramètre *queryString* doit respecter la syntaxe suivante : @@ -660,7 +662,7 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -où : +where: * **attributePath** : Chemin de l'attribut sur lequel vous souhaitez exécuter la recherche. Ce paramètre peut contenir un nom simple (par exemple "pays") ou un chemin d'attribut valide (par exemple "pays.nom"). Dans le cas d'un chemin d'attribut de type `Collection`, la notation \[ ] est utilisée pour designer toutes les occurrences (par exemple "enfants\[ ].age"). Vous pouvez également utiliser **placeholder** (voir ci-dessous). > Vous ne pouvez pas utiliser directement des attributs dont les noms contiennent des caractères spéciaux tels que ".", "\[ ]", ou "=", ">", "#"..., car ils ne seront pas correctement évalués dans la chaîne de recherche. Si vous souhaitez rechercher ces attributs, vous devez utiliser des placeholders, qui permettent d'utiliser un ensemble de caractères plus étendu dans les chemins d'attribut (voir * **Utiliser des placeholders** *ci-dessous). @@ -708,35 +710,35 @@ où : * **order by attributePath** : vous pouvez inclure une déclaration order by *attributePath* dans la requête afin que les données résultantes soient triées selon cette déclaration. Vous pouvez utiliser plusieurs tris par déclaration, en les séparant par des virgules (e.g., order by *attributePath1* desc, *attributePath2* asc). Par défaut, le tri est par ordre croissant. Passez 'desc' pour définir un tri par ordre décroissant et 'asc' pour définir un tri par ordre croissant. > > *If you use this statement, the returned entity selection is ordered (for more information, please refer to [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Utilisation des guillemets** +**Using quotes** -Lorsque vous utilisez des guillemets dans les recherches, vous devez utiliser des apostrophes ' ' à l'intérieur des requêtes et des guillemets " " pour encadrer la recherche complète, sinon une erreur est générée. Par exemple : +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Par exemple : ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Les guillemets simples (') ne sont pas pris en charge dans les valeurs recherchées car ils casseraient la chaîne de recherche. Par exemple, "comp.name = 'John's pizza' " génèrera une erreur. Si vous devez rechercher des valeurs contenant des guillemets simples, il est nécessaire d'utiliser des placeholders (voir ci-dessous). -**Utilisation des parenthèses** +**Using parenthesis** -Vous pouvez utiliser des parenthèses dans la recherche afin de prioriser les calculs. Par exemple, vous pouvez organiser une recherche de la manière suivante : +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Utilisation des placeholders** +**Using placeholders** -4D vous permet d'utiliser des placeholders pour les arguments *attributePath*, *formula* et *value* dans le paramètre *queryString*. Un placeholder est un paramètre que vous insérez dans des chaines de recherche et qui est remplacé par une autre valeur au moment où la chaîne de recherche est évaluée. La valeur des placeholders est évaluée une seule fois, au début de la requête ; elle n'est pas évaluée pour chaque élément. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Il existe deux types de placeholders : les **placeholders indexés** et les **placeholders nommés** : +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | - | Placeholders indexés | Placeholders nommés | | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Définition | Les paramètres sont insérés sous la forme :paramIndex (par exemple :1, :2...) dans queryString et leurs valeurs sont fournies par la séquence de paramètre(s) value. Vous pouvez utiliser jusqu'à 128 paramètres value | Les paramètres sont insérés sous la forme :paramName (par exemple :myparam) et leurs valeurs sont fournies dans les objets attributes et/ou parameters dans le paramètre querySettings | | Exemple | $r:=class.query(":1=:2";"city";"Chicago") | $o.attributes:=New object("att";"city")
$o.parameters:=New object("name";"Chicago")
$r:=class.query(":att=:name";$o) | -Vous pouvez combiner tous les types d'arguments dans *queryString*. in *queryString* and their corresponding values are provided by the sequence of *value* parameter(s). You can use up to 128 *value* parameters +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * des valeurs directes (pas de placeholders) * des placeholders indexés et/ou nommés. @@ -750,15 +752,15 @@ Vous pouvez combiner tous les types d'arguments dans *queryString*. in *queryStr $result:=$col.query($vquery) ``` - Cette recherche semble sécurisée puisque les données non publiques sont filtrées. Cependant, si l'utilisateur saisit dans la zone *myname* une chaîne du type *"smith OR status='private'*, la chaîne de recherche sera modifiée à l'étape de l'interprétation et pourra retourner des données privées. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Lorsque vous utilisez des placeholders, le contournement des options de sécurité n'est pas possible : + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - Dans ce cas, si l'utilisateur saisit *smith OR status='private'* dans la zone *myname*, cela ne sera pas interprété dans la chaîne de recherche, mais uniquement passé en tant que valeur. La recherche d'une personne nommée "smith OR status='private"' échouera simplement. + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Cela résout les questions liées au formatage des valeurs ou des caractères, notamment lorsque vous gérez des paramètres *attributePath* et *value* qui peuvent contenir des caractères non-alphanumériques tels que ".", "["... @@ -769,31 +771,86 @@ Vous pouvez combiner tous les types d'arguments dans *queryString*. in *queryStr $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Recherche de valeurs null** +**Looking for null values** -Lorsque vous recherchez les valeurs null, vous ne pouvez pas utiliser la syntaxe placeholder car le moteur de recherche considère la valeur null comme une valeur de comparaison invalide. Par exemple, si vous exécutez la recherche suivante : +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // ne fonctionnera PAS ``` -Vous n'obtiendrez pas le résultat souhaité car la valeur null sera évaluée par 4D comme une erreur résultant de l'évaluation du paramètre (pouvant être, par exemple, un attribut provenant d'une autre recherche). Pour ce type de recherches, vous devez utiliser la syntaxe de recherche directe : +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds.Person.query("spouse = null") //syntaxe valide ``` -**Relier les arguments de recherche aux collections dans les attributs** + +**Not equal to in collections** + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + +**Linking collection attribute query arguments** :::info -Cette fonctionnalité est disponible uniquement pour les recherches dans les dataclasses et les [entity selections](EntitySelectionClass.md#query). Elle ne peut pas être utilisée pour les recherches dans les [collections](CollectionClass.md#query). +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -Lorsque vous effectuez des recherches parmi des attributs objets de dataclass contenant des collections à l'aide de plusieurs arguments de requête reliés par l'opérateur AND, vous souhaiterez éventuellement vous assurer que seules les entités contenant des éléments correspondant à tous les arguments soient retournées, et non les entités où des arguments peuvent être trouvés dans différents éléments. Pour ce faire, vous devez relier les arguments de requête aux éléments de collection, de sorte que seuls les éléments uniques contenant des arguments reliés soient retournés. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Par exemple, avec les deux entités suivantes : +For example, with the following two entities: ``` Entity 1: @@ -816,59 +873,59 @@ ds.People.places: } ] } ``` -Vous souhaitez trouver des personnes dont le type d'emplacement est "home" dans la ville de "paris". Si vous écrivez : +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... la requête retournera "martin" **et** "smith" car "smith" a un élément "locations" dont "kind" (le type) est "home" et un élément "locations" dont "city" (la ville) est "paris", même si ce sont des éléments différents. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Si vous souhaitez obtenir uniquement les entités dont les arguments correspondants sont dans le même élément de collection, vous devez **relier les arguments**. Pour lier des arguments de requête : +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Ajoutez une lettre entre le caractère \[] dans le premier chemin à lier et répétez la même lettre dans tous les arguments liés. Par exemple : `locations[a].city and locations[a].kind`. Vous pouvez utiliser n'importe quelle lettre de l'alphabet latin (non sensible à la casse). * Pour ajouter différents critères liés dans la même requête, utilisez une autre lettre. Vous pouvez créer jusqu'à 26 combinaisons de critères dans une seule requête. -A l'aide des entités ci-dessus, si vous écrivez : +With the above entities, if you write: ```4d ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... la requête ne retournera uniquement "martin" car il possède un élément "locations" dont "kind" est "home" et dont "city" est "paris". La requête ne retournera pas "smith" car les valeurs "home" et "paris" ne sont pas contenus dans le même élément de collection. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Paramètre formula** +**formula parameter** -Au lieu d'insérer une formule dans le paramètre *queryString* (voir ci-dessus), vous pouvez directement passer un objet formule en tant que critère de recherche booléen. L'utilisation d'un objet formule pour les requêtes est **recommandée** car vous bénéficiez d'une tokenisation et le code est plus facile à rechercher/lire. +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. -La formule doit avoir été créée à l'aide de la commande `Formula` ou `Formula from string`. Dans ce cas : +La formule doit avoir été créée à l'aide de la commande `Formula` ou `Formula from string`. In this case: * *formula* est évaluée pour chaque entité et doit renvoyer vrai ou faux. Lors de l'exécution de la requête, si le résultat de la formule n'est pas un booléen, il est considéré comme faux. * dans *formula*, l'entité est disponible via l'objet `This`. * si l'objet `Formula` est **null**, l'erreur 1626 ("Attente d'un texte ou d'une formule") est générée, que vous pouvez intercepter à l'aide d'une méthode installée avec `ON ERR CALL`. > > For security reasons, formula calls within `query(`) member methods can be disallowed. Voir la description du paramètre *querySettings*. -**Passer des paramètres aux formules** +**Passing parameters to formulas** -Tout paramètre *formula* appelé par la fonction `query()` peut recevoir des paramètres : +Any *formula* called by the `query()` class function can receive parameters: * Les paramètres doivent être passés via la propriété **args** du paramètre *querySettings*. * La formule reçoit cet objet **args** en tant que paramètre **$1**. -Ce code montre comment les paramètres sont passés aux fonctions : +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //objet args pour passer des paramètres $es:=ds.Students.query("eval(checkName($1.exclude))";$settings) //args est reçu dans $1 ``` -Des exemples supplémentaires sont fournis dans l'exemple 3. +Additional examples are provided in example 3. -**4D Server** : En client/serveur, les formules sont exécutées sur le serveur. Dans ce contexte, seul l'objet `querySettings.args` est envoyé aux formules. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**Paramètre querySettings** +**querySettings parameter** -Dans le paramètre *querySettings* vous pouvez passer un objet contenant des options supplémentaires. Les propriétés suivantes sont prises en charge : +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propriété | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -880,18 +937,18 @@ Dans le paramètre *querySettings* vous pouvez passer un objet contenant des opt | queryPlan | Boolean | Dans l'entity selection résultante, retourne ou ne retourne la description détaillée de la recherche juste avant d'être exécutée, i.e. La propriété retournée est un objet qui inclut chaque recherche et sous-recherche programmée (dans le cas d'une recherche complexe). Cette option est utile durant la phase de développement d'une application. Elle est utilisée conjointement à queryPath. Par défaut, si elle est omise : faux. **Note** : Cette propriété est prise en charge uniquement par les fonctions `entitySelection.query()` et `dataClass.query()`. | | queryPath | Boolean | Dans l'entity selection résultante, retourne ou ne retourne pas la description détaillée de la recherche telle qu'elle est effectuée. La propriété retournée est un objet qui contient le chemin utilisé pour la recherche (généralement identique à celui de queryPlan, mais il peut être différent si le moteur parvient à optimiser la recherche), la durée du traitement et le nombre d'enregistrements trouvés. Cette option est utile durant la phase de développement d'une application. Par défaut, si elle est omise : faux. **Note** : Cette propriété est prise en charge uniquement par les fonctions `entitySelection.query()` et `dataClass.query()`. | -**A propos de queryPlan et queryPath** +**About queryPlan and queryPath** -Les informations enregistrées dans `queryPlan` et `queryPath` incluent le type de recherche (indexée ou séquentielle), chaque sous-recherche nécessaire, ainsi que les opérateurs de conjonction. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Généralement, la description du plan de requête et son chemin d'accès sont identiques mais ils peuvent différer car 4D peut intégrer des optimisations dynamiques lorsqu'une requête est exécutée, afin d'améliorer les performances. Par exemple, le moteur 4D peut convertir dynamiquement une requête indexée en requête séquentielle s'il estime que ce processus est plus rapide. Ce cas particulier peut se produire lorsque le nombre d'entités recherchées est faible. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Par exemple, si vous exécutez la recherche suivante : +For example, if you execute the following query: ```4d $sel:=ds.Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ 50000;"Lima West Kilo";10000000;New object("queryPath";True;"queryPlan";True)) ``` -queryPlan : +queryPlan: ```4d {Or:[{And:[{item:[index : Employee.salary ] < 50000}, @@ -901,7 +958,7 @@ queryPlan : subquery:[{item:[index : Company.revenues ] > 10000000}]}]} ``` -queryPath : +queryPath: ```4d {steps:[{description:OR,time:63,recordsfounds:1388132, @@ -913,46 +970,46 @@ queryPath : #### Exemple 1 -Cette section fournit divers exemples de recherches. +This section provides various examples of queries. -Recherche dans une chaîne : +Query on a string: ```4d $entitySelection:=ds.Customer.query("firstName = 'S@'") ``` -Recherche avec une instruction NOT : +Query with a NOT statement: ```4d $entitySelection:=ds.Employee.query("not(firstName=Kim)") ``` -Recherche avec des dates : +Queries with dates: ```4d $entitySelection:=ds.Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds.Employee.query("birthDate <= :1";Current date-10950) ``` -Recherche avec des placeholders indexés pour les valeurs : +Query with indexed placeholders for values: ```4d $entitySelection:=ds.Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Recherche avec des placeholders indexés pour les valeurs sur une dataclass liée : +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds.Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Recherche avec des placeholders indexés avec tri décroissant : +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds.Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Recherche avec des placeholders nommés pour les valeurs : +Query with named placeholders for values: ```4d var $querySettings : Object @@ -962,7 +1019,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Recherche utilisant les placeholders nommés et indexés pour les valeurs : +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -971,7 +1028,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Recherche avec objets queryPlan et queryPath : +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds.Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -982,19 +1039,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Recherche avec un chemin d'attribut de type Collection : +Query with an attribute path of Collection type: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Recherche avec un chemin d'attribut de type Collection et des attributs reliés : +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Recherche avec un chemin d'attribut de type Collection et plusieurs attributs reliés : +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1002,25 +1059,25 @@ $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Recherche avec un chemin d'attribut de type Objet : +Query with an attribute path of Object type: ```4d $entitySelection:=ds.Employee.query("extra.eyeColor = :1";"blue") ``` -Recherche avec instruction IN : +Query with an IN statement: ```4d $entitySelection:=ds.Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Recherche avec instruction NOT (IN) : +Query with a NOT (IN) statement: ```4d $entitySelection:=ds.Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Recherche avec des placeholders indexés pour les attributs : +Query with indexed placeholders for attributes: ```4d var $es : cs.EmployeeSelection @@ -1028,7 +1085,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") //salesperson est une entité reliée ``` -Recherche avec des placeholders indexés pour les attributs et avec des placeholders nommés pour les valeurs : +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs.EmployeeSelection @@ -1039,7 +1096,7 @@ $es:=ds.Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId";" //salesperson est une entité reliée ``` -Recherche avec des placeholders indexés pour les attributs et les valeurs : +Query with indexed placeholders for attributes and values: ```4d var $es : cs.EmployeeSelection @@ -1049,11 +1106,11 @@ $es:=ds.Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smith #### Exemple 2 -Cette section illustre les recherches avec des placeholders nommés pour les attributs. +This section illustrates queries with named placeholders for attributes. -Considérons une dataclass Employee avec 2 entités : +Given an Employee dataclass with 2 entities: -Entité 1 : +Entity 1: ```4d name: "Marie" @@ -1065,7 +1122,7 @@ softwares:{ } ``` -Entité 2 : +Entity 2: ```4d name: "Sophie" @@ -1077,7 +1134,7 @@ softwares:{ } ``` -Recherche avec des placeholders nommés pour les attributs : +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1088,7 +1145,7 @@ Recherche avec des placeholders nommés pour les attributs : //$es.length=1 (Employee Marie) ``` -Recherche avec des placeholders nommés pour les attributs et les valeurs : +Query with named placeholders for attributes and values: ```4d var $querySettings : Object @@ -1108,16 +1165,16 @@ Recherche avec des placeholders nommés pour les attributs et les valeurs : #### Exemple 3 -Ces exemples illustrent les diverses manières d'utiliser des formules avec ou sans paramètres dans vos recherches. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -La formule est fournie sous forme de texte avec `eval()` dans le paramètre *queryString* : +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs.StudentsSelection $es:=ds.Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -La formule est fournie sout forme d'objet `Formula` via un placeholder : +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs.StudentsSelection @@ -1126,7 +1183,7 @@ La formule est fournie sout forme d'objet `Formula` via un placeholder : $es:=ds.Students.query(":1 and nationality='French'";$formula) ``` -Seul un objet `Formula` est fourni comme critère de recherche : +Only a `Formula` object is given as criteria: ```4d var $es : cs.StudentsSelection @@ -1135,7 +1192,7 @@ Seul un objet `Formula` est fourni comme critère de recherche : $es:=ds.Students.query($formula) ``` -Plusieurs formules peuvent être appliquées : +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1144,7 +1201,7 @@ Plusieurs formules peuvent être appliquées : $0:=ds.Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Une formule texte dans *queryString* reçoit un paramètre : +A text formula in *queryString* receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1160,7 +1217,7 @@ Une formule texte dans *queryString* reçoit un paramètre : $result:=(Position($exclude;This.lastname)=0) ``` -En utilisant la même méthode ***checkName***, un objet `Formula` en placeholder reçoit un paramètre : +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1173,7 +1230,7 @@ En utilisant la même méthode ***checkName***, un objet `Formula` en placeholde $es:=ds.Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisissent leurs requêtes : +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs.StudentsSelection @@ -1188,5 +1245,5 @@ Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisis #### Voir également -[`.query()`](EntitySelectionClass.md#query) pour les entity selections +[`.query()`](EntitySelectionClass.md#query) for entity selections From 8e1daa91edf9ec16ede3d528ea63831acdc3c680 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:32:18 +0200 Subject: [PATCH 009/180] New translations EntityClass.md (French) --- .../version-19/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-19/API/EntityClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-19/API/EntityClass.md index 1d63056db72323..0dc264bb6a24a2 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-19/API/EntityClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-19/API/EntityClass.md @@ -1625,7 +1625,7 @@ Si aucun attribut de l'entité n'a été touché, la fonction retourne une colle //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -Dans ce cas : +In this case: * firstName et lastName ont un type `storage` * employer a un type `relatedEntity` From 22041ba36b6c54ae1f08b1cdb712734d1c584ea4 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:34:56 +0200 Subject: [PATCH 010/180] New translations properties_Text.md (French) --- .../version-19/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md b/i18n/fr/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md index 7787dae5fabb80..7f2737a1d800d1 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md @@ -282,7 +282,7 @@ This property can also be handled by the [OBJECT Get vertical alignment](https:/ `List box de type collection ou entity selection (sélection d'entité)` -Indique une expression ou une variable qui sera évaluée pour chaque ligne affichée. Elle permet de définir un ensemble d'attributs texte des lignes. Vous devez passer une **variable objet** ou une **expression qui retourne un objet**. Les propriétés suivantes sont prises en charge : +Indique une expression ou une variable qui sera évaluée pour chaque ligne affichée. Elle permet de définir un ensemble d'attributs texte des lignes. Vous devez passer une **variable objet** ou une **expression qui retourne un objet**. The following properties are supported: | Nom de propriété | Type | Description | | ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 642476e356015caac5d46796f82ce283ba6ad1db Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:36:04 +0200 Subject: [PATCH 011/180] New translations genInfo.md (French) --- .../docusaurus-plugin-content-docs/version-19/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-19/REST/genInfo.md b/i18n/fr/docusaurus-plugin-content-docs/version-19/REST/genInfo.md index ad66a4d9676037..836c3e8a81e488 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-19/REST/genInfo.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-19/REST/genInfo.md @@ -33,4 +33,4 @@ Ces propriétés sont des objets contenant des informations sur la façon dont l - **queryPlan** : objet contenant la description détaillée de la requête juste avant son exécution (c'est-à-dire la requête planifiée). - **queryPath** : objet contenant la description détaillée de la requête telle qu'elle a été réellement effectuée. -Les informations enregistrées incluent le type de requête (indexé et séquentiel) et chaque sous-requête nécessaire ainsi que les opérateurs de conjonction. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Query paths also contain the number of entities found and the time required to execute each search criterion. Généralement, la description du plan de requête et son chemin d'accès sont identiques mais ils peuvent différer car 4D peut intégrer des optimisations dynamiques lorsqu'une requête est exécutée, afin d'améliorer les performances. Par exemple, le moteur 4D peut convertir dynamiquement une requête indexée en requête séquentielle s'il estime que ce processus est plus rapide. Ce cas particulier peut se produire lorsque le nombre d'entités recherchées est faible. \ No newline at end of file +Les informations enregistrées incluent le type de requête (indexé et séquentiel) et chaque sous-requête nécessaire ainsi que les opérateurs de conjonction. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From 03e65e271861171be393aa95a3b744c7d069397b Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:44:56 +0200 Subject: [PATCH 012/180] New translations DataClassClass.md (French) --- .../version-20/API/DataClassClass.md | 269 +++++++++++------- 1 file changed, 163 insertions(+), 106 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md index 777d87eebea71c..429347781f0d75 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md @@ -851,7 +851,7 @@ La fonction `.query()` recherche les Si aucune entité correspondante n'est trouvée, une `EntitySelection` vide est retournée. -**Paramètre queryString** +#### queryString parameter Le paramètre *queryString* doit respecter la syntaxe suivante : @@ -861,9 +861,9 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -où : +where: -* **attributePath** : Chemin de l'attribut sur lequel vous souhaitez exécuter la recherche. Ce paramètre peut contenir un nom simple (par exemple "pays") ou un chemin d'attribut valide (par exemple "pays.nom"). Dans le cas d'un chemin d'attribut de type `Collection`, la notation \[ ] est utilisée pour designer toutes les occurrences (par exemple "enfants\[ ].age"). +* **attributePath** : Chemin de l'attribut sur lequel vous souhaitez exécuter la recherche. Ce paramètre peut contenir un nom simple (par exemple "pays") ou un chemin d'attribut valide (par exemple "pays.nom"). In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > Vous ne pouvez pas utiliser directement des attributs dont les noms contiennent des caractères spéciaux tels que ".", "\[ ]", ou "=", ">", "#"..., car ils ne seront pas correctement évalués dans la chaîne de recherche. Si vous souhaitez rechercher ces attributs, vous devez utiliser des placeholders, qui permettent d'utiliser un ensemble de caractères plus étendu dans les chemins d'attribut (voir * **Utiliser des placeholders** *ci-dessous). * **formula** : Une formule valide passée en `Text` ou en `Object`. La formule sera évaluée pour chaque entité traitée et doit retourner une valeur booléenne. Dans la formule, l'entité est disponible via l'objet `This`. @@ -879,19 +879,19 @@ où : * **comparator** : symbole d'opérateur utilisé pour comparer *attributePath* et *value*. Les symboles suivants sont pris en charge : - | Comparaison | Symbole(s) | Commentaire | - | --------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | - | Egal à | =, == | Retourne les données correspondantes, prend en charge le joker de recherche (@), ne tient pas compte de la casse et est non diacritique. | - | | ===, IS | Retourne les données correspondantes, considère le @ comme un caractère standard, ne tient pas compte de la casse et est non diacritique | - | Différent de | #, != | Prend en charge le joker de recherche (@) | - | | !==, IS NOT | Considère le @ comme un caractère standard | - | Inférieur à | | | - | Supérieur à | > | | - | Inférieur ou égal à | <= | | - | Supérieur ou égal à | >= | | - | Inclus parmi | IN | Retourne les données égales à au moins une des valeurs d'une collection ou d'un ensemble de valeurs, prend en charge le joker de recherche (@) | - | Condition Not appliquée à une assertion | NOT | Les parenthèses sont obligatoires lorsque NOT est utilisé devant une assertion contenant plusieurs opérateurs | - | Contient mot-clé | % | Les mots-clés peuvent être utilisés avec les attributs de type texte ou image | + | Comparaison | Symbole(s) | Commentaire | + | --------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Egal à | =, == | Retourne les données correspondantes, prend en charge le joker de recherche (@), ne tient pas compte de la casse et est non diacritique. | + | | ===, IS | Retourne les données correspondantes, considère le @ comme un caractère standard, ne tient pas compte de la casse et est non diacritique | + | Différent de | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considère le @ comme un caractère standard | + | Condition Not appliquée à une assertion | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Inférieur à | | | + | Supérieur à | > | | + | Inférieur ou égal à | <= | | + | Supérieur ou égal à | >= | | + | Inclus parmi | IN | Retourne les données égales à au moins une des valeurs d'une collection ou d'un ensemble de valeurs, prend en charge le joker de recherche (@) | + | Contient mot-clé | % | Les mots-clés peuvent être utilisés avec les attributs de type texte ou image | * **value** : valeur à comparer à la valeur courante de l'attribut de chaque entité de la sélection ou élément de la collection. Peut être un **placeholder** (voir **Utiliser des placeholders** ci-dessous) ou toute expression correspondant à la propriété du type de donnée. Lorsque vous utilisez une valeur constante, les règles suivantes doivent être respectées : * Les valeurs constantes de type **texte** peuvent être passées avec ou sans guillemets (voir **Utilisation des guillemets** ci-dessous). Pour rechercher une chaîne dans une chaîne (recherche de type "contient"), utilisez le symbole joker (@) dans valeur pour isoler la chaîne à chercher, comme dans cet exemple : "@Smith@". Les mots-clés suivants sont interdits pour des constantes de type texte : true, false. @@ -909,40 +909,40 @@ où : * **order by attributePath** : vous pouvez inclure une déclaration order by *attributePath* dans la requête afin que les données résultantes soient triées selon cette déclaration. Vous pouvez utiliser plusieurs tris par déclaration, en les séparant par des virgules (e.g., order by *attributePath1* desc, *attributePath2* asc). Par défaut, le tri est par ordre croissant. Passez 'desc' pour définir un tri par ordre décroissant et 'asc' pour définir un tri par ordre croissant. >Si vous utilisez cette déclaration, l'entity selection retournée est triée (pour plus d'informations, veuillez consulter [Entity selections triées vs Entity selection non triées](ORDA/dsMapping.md#entity-selections-triees-vs-entity-selections-non-triees)). -**Utilisation des guillemets** +#### Using quotes -Lorsque vous utilisez des guillemets dans les recherches, vous devez utiliser des apostrophes ' ' à l'intérieur des requêtes et des guillemets " " pour encadrer la recherche complète, sinon une erreur est générée. Par exemple : +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Par exemple : ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Les guillemets simples (') ne sont pas pris en charge dans les valeurs recherchées car ils casseraient la chaîne de recherche. Par exemple, "comp.name = 'John's pizza' " génèrera une erreur. Si vous devez rechercher des valeurs contenant des guillemets simples, il est nécessaire d'utiliser des placeholders (voir ci-dessous). -**Utilisation des parenthèses** +#### Using parenthesis -Vous pouvez utiliser des parenthèses dans la recherche afin de prioriser les calculs. Par exemple, vous pouvez organiser une recherche de la manière suivante : +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Utilisation des placeholders** +#### Using placeholders -4D vous permet d'utiliser des placeholders pour les arguments *attributePath*, *formula* et *value* dans le paramètre *queryString*. Un placeholder est un paramètre que vous insérez dans des chaines de recherche et qui est remplacé par une autre valeur au moment où la chaîne de recherche est évaluée. La valeur des placeholders est évaluée une seule fois, au début de la requête ; elle n'est pas évaluée pour chaque élément. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Il existe deux types de placeholders : les **placeholders indexés** et les **placeholders nommés** : +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | | Placeholders indexés | Placeholders nommés | | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Définition | You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: | Les paramètres sont insérés sous la forme `:paramName` (par exemple :myparam) et leurs valeurs sont fournies dans les objets attributes et/ou parameters dans le paramètre *querySettings* | | Exemple | `$r:=class.query(":1=:2";"city";"Chicago")` | `$o.attributes:=New object("att";"city")`
`$o.parameters:=New object("name";"Chicago")`
`$r:=class.query(":att=:name";$o)` | -Vous pouvez combiner tous les types d'arguments dans *queryString*. in *queryString* and their corresponding values are provided by the sequence of *value* parameter(s). You can use up to 128 *value* parameters +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * des valeurs directes (pas de placeholders) * des placeholders indexés et/ou nommés. -L'utilisation de placeholders dans les recherches **est recommandée** pour les raisons suivantes : +Using placeholders in queries **is recommended** for the following reasons: 1. Cela empêche l'injection de code malveillant : si vous utilisez dans la chaîne de recherche des variables dont le contenu provient directement de la saisie de l'utilisateur, celui-ci pourrait modifier les conditions de recherche en saisissant des arguments de recherche supplémentaires. Par exemple, imaginez une chaîne de recherche du type : @@ -951,50 +951,105 @@ L'utilisation de placeholders dans les recherches **est recommandée** pour les $result:=$col.query($vquery) ``` - Cette recherche semble sécurisée puisque les données non publiques sont filtrées. Cependant, si l'utilisateur saisit dans la zone *myname* une chaîne du type *"smith OR status='private'*, la chaîne de recherche sera modifiée à l'étape de l'interprétation et pourra retourner des données privées. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Lorsque vous utilisez des placeholders, le contournement des options de sécurité n'est pas possible : + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - Dans ce cas, si l'utilisateur saisit *smith OR status='private'* dans la zone *myname*, cela ne sera pas interprété dans la chaîne de recherche, mais uniquement passé en tant que valeur. La recherche d'une personne nommée "smith OR status='private"' échouera simplement. + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Cela résout les questions liées au formatage des valeurs ou des caractères, notamment lorsque vous gérez des paramètres *attributePath* et *value* qui peuvent contenir des caractères non-alphanumériques tels que ".", "["... 3. Cela permet l'utilisation de variables ou d'expressions dans les arguments de recherche. Exemples : ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Recherche de valeurs null** +#### Looking for null values -Lorsque vous recherchez les valeurs null, vous ne pouvez pas utiliser la syntaxe placeholder car le moteur de recherche considère la valeur null comme une valeur de comparaison invalide. Par exemple, si vous exécutez la recherche suivante : +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // ne fonctionnera PAS ``` -Vous n'obtiendrez pas le résultat souhaité car la valeur null sera évaluée par 4D comme une erreur résultant de l'évaluation du paramètre (pouvant être, par exemple, un attribut provenant d'une autre recherche). Pour ce type de recherches, vous devez utiliser la syntaxe de recherche directe : +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds.Person.query("spouse = null") //syntaxe valide ``` -**Relier les arguments de recherche aux collections dans les attributs** +#### Not equal to in collections + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + + +#### Linking collection attribute query arguments :::info -Cette fonctionnalité est disponible uniquement pour les recherches dans les dataclasses et les [entity selections](EntitySelectionClass.md#query). Elle ne peut pas être utilisée pour les recherches dans les [collections](CollectionClass.md#query). +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -Lorsque vous effectuez des recherches parmi des attributs objets de dataclass contenant des collections à l'aide de plusieurs arguments de requête reliés par l'opérateur AND, vous souhaiterez éventuellement vous assurer que seules les entités contenant des éléments correspondant à tous les arguments soient retournées, et non les entités où des arguments peuvent être trouvés dans différents éléments. Pour ce faire, vous devez relier les arguments de requête aux éléments de collection, de sorte que seuls les éléments uniques contenant des arguments reliés soient retournés. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Par exemple, avec les deux entités suivantes : +For example, with the following two entities: ``` Entity 1: @@ -1017,35 +1072,35 @@ ds.People.places: } ] } ``` -Vous souhaitez trouver des personnes dont le type d'emplacement est "home" dans la ville de "paris". Si vous écrivez : +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... la requête retournera "martin" **et** "smith" car "smith" a un élément "locations" dont "kind" (le type) est "home" et un élément "locations" dont "city" (la ville) est "paris", même si ce sont des éléments différents. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Si vous souhaitez obtenir uniquement les entités dont les arguments correspondants sont dans le même élément de collection, vous devez **relier les arguments**. Pour lier des arguments de requête : +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Ajoutez une lettre entre le caractère \[] dans le premier chemin à lier et répétez la même lettre dans tous les arguments liés. Par exemple : `locations[a].city and locations[a].kind`. Vous pouvez utiliser n'importe quelle lettre de l'alphabet latin (non sensible à la casse). * Pour ajouter différents critères liés dans la même requête, utilisez une autre lettre. Vous pouvez créer jusqu'à 26 combinaisons de critères dans une seule requête. -A l'aide des entités ci-dessus, si vous écrivez : +With the above entities, if you write: ```4d ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... la requête ne retournera uniquement "martin" car il possède un élément "locations" dont "kind" est "home" et dont "city" est "paris". La requête ne retournera pas "smith" car les valeurs "home" et "paris" ne sont pas contenus dans le même élément de collection. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Recherches dans les relations N vers N** +#### Queries in many-to-many relations -ORDA propose une syntaxe spéciale pour faciliter les recherches dans les relations N vers N. Dans ce contexte, vous pouvez avoir besoin de rechercher des valeurs différentes à l'aide de l'opérateur `AND` MAIS dans le même attribut. Par exemple, considérez la structure suivante : +ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: ![alt-text](../assets/en/API/manytomany.png) -Imaginez que vous souhaitiez rechercher tous les films dans lesquels un acteur A *Et* un acteur B ont joué un rôle. Si vous écrivez une recherche simple utilisant l'opérateur `AND`, cela ne va pas fonctionner : +Imagine that you want to search all movies in which *both* actor A and actor B have a role. If you write a simple query using an `AND` operator, it will not work: ```4d // code invalide @@ -1053,17 +1108,17 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";"H // $es est vide ``` -Fondamentalement, le problème vient de la logique interne de la recherche : vous ne pouvez pas rechercher une entité dont un attribut aurait simultanément la valeur "A" et "B". +Basically, the issue is related to the internal logic of the query: you cannot search for an attribute whose value would be both "A" and "B". -Pour rendre possible ce type de recheche, ORDA prend en charge une syntaxe spéciale : vous devez juste ajouter un *class index* entre les caractères **{}** dans tous les attributs relationnels utilisés dans la chaîne de recherche : +To make it possible to perform such queries, ORDA allows a special syntax: you just need to add a *class index* between **{}** in all additional relation attributes used in the string: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** indique à ORDA de créer une autre référence pour l'attribut relationnel. Le moteur de requêtes effectuera alors toutes les opérations internes nécessaires. Notez que **x** peut être n'importe quel nombre **à l'exception de 0**: {1}, ou {2}, ou {1540}... ORDA a simplement besoin d'une référence unique dans la recherche pour chaque class index. +**{x}** tells ORDA to create another reference for the relation attribute. It will then perform all the necessary bitmap operations internally. Note that **x** can be any number **except 0**: {1}, or {2}, or {1540}... ORDA only needs a unique reference in the query for each class index. -Dans notre exemple, cela pourrait donner : +In our example, it would be: ```4d // code valide @@ -1071,38 +1126,40 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es contient des films (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**Paramètre formula** -Au lieu d'insérer une formule dans le paramètre *queryString* (voir ci-dessus), vous pouvez directement passer un objet formule en tant que critère de recherche booléen. L'utilisation d'un objet formule pour les requêtes est **recommandée** car vous bénéficiez d'une tokenisation et le code est plus facile à rechercher/lire. -La formule doit avoir été créée à l'aide des commandes [`Formula`](FunctionClass.md#formula) ou [`Formula from string`](FunctionClass.md#formula-from-string). Dans ce cas : +#### formula parameter + +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. + +La formule doit avoir été créée à l'aide des commandes [`Formula`](FunctionClass.md#formula) ou [`Formula from string`](FunctionClass.md#formula-from-string). In this case: * *formula* est évaluée pour chaque entité et doit renvoyer vrai ou faux. Lors de l'exécution de la requête, si le résultat de la formule n'est pas un booléen, il est considéré comme faux. * dans *formula*, l'entité est disponible via l'objet `This`. * si l'objet `Formula` est **null**, l'erreur 1626 ("Attente d'un texte ou d'une formule") est générée, que vous pouvez intercepter à l'aide d'une méthode installée avec `ON ERR CALL`. > Pour des raisons de sécurité, les appels de formule dans les fonctions `query()` peuvent être interdits. Voir la description du paramètre *querySettings*. -**Passer des paramètres aux formules** +#### Passing parameters to formulas -Tout paramètre *formula* appelé par la fonction `query()` peut recevoir des paramètres : +Any *formula* called by the `query()` class function can receive parameters: * Les paramètres doivent être passés via la propriété **args** du paramètre *querySettings*. * La formule reçoit cet objet **args** en tant que paramètre **$1**. -Ce code montre comment les paramètres sont passés aux fonctions : +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //objet args pour passer des paramètres $es:=ds.Students.query("eval(checkName($1.exclude))";$settings) //args est reçu dans $1 ``` -Des exemples supplémentaires sont fournis dans l'exemple 3. +Additional examples are provided in example 3. -**4D Server** : En client/serveur, les formules sont exécutées sur le serveur. Dans ce contexte, seul l'objet `querySettings.args` est envoyé aux formules. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**Paramètre querySettings** +#### querySettings parameter -Dans le paramètre *querySettings* vous pouvez passer un objet contenant des options supplémentaires. Les propriétés suivantes sont prises en charge : +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propriété | Type | Description | | ------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1114,18 +1171,18 @@ Dans le paramètre *querySettings* vous pouvez passer un objet contenant des opt | queryPlan | Boolean | Dans l'entity selection résultante, retourne ou ne retourne la description détaillée de la recherche juste avant d'être exécutée, i.e. La propriété retournée est un objet qui inclut chaque recherche et sous-recherche programmée (dans le cas d'une recherche complexe). Cette option est utile durant la phase de développement d'une application. Elle est utilisée conjointement à queryPath. Par défaut, si elle est omise : faux. **Note** : Cette propriété est prise en charge uniquement par les fonctions `entitySelection.query()` et `dataClass.query()`. | | queryPath | Boolean | Dans l'entity selection résultante, retourne ou ne retourne pas la description détaillée de la recherche telle qu'elle est effectuée. La propriété retournée est un objet qui contient le chemin utilisé pour la recherche (généralement identique à celui de queryPlan, mais il peut être différent si le moteur parvient à optimiser la recherche), la durée du traitement et le nombre d'enregistrements trouvés. Cette option est utile durant la phase de développement d'une application. Par défaut, si elle est omise : faux. **Note** : Cette propriété est prise en charge uniquement par les fonctions `entitySelection.query()` et `dataClass.query()`. | -**A propos de queryPlan et queryPath** +#### About queryPlan and queryPath -Les informations enregistrées dans `queryPlan` et `queryPath` incluent le type de recherche (indexée ou séquentielle), chaque sous-recherche nécessaire, ainsi que les opérateurs de conjonction. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Généralement, la description du plan de requête et son chemin d'accès sont identiques mais ils peuvent différer car 4D peut intégrer des optimisations dynamiques lorsqu'une requête est exécutée, afin d'améliorer les performances. Par exemple, le moteur 4D peut convertir dynamiquement une requête indexée en requête séquentielle s'il estime que ce processus est plus rapide. Ce cas particulier peut se produire lorsque le nombre d'entités recherchées est faible. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Par exemple, si vous exécutez la recherche suivante : +For example, if you execute the following query: ```4d $sel:=ds.Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ 50000;"Lima West Kilo";10000000;New object("queryPath";True;"queryPlan";True)) ``` -queryPlan : +queryPlan: ```4d {Or:[{And:[{item:[index : Employee.salary ] < 50000}, @@ -1135,7 +1192,7 @@ queryPlan : subquery:[{item:[index : Company.revenues ] > 10000000}]}]} ``` -queryPath : +queryPath: ```4d {steps:[{description:OR,time:63,recordsfounds:1388132, @@ -1147,46 +1204,46 @@ queryPath : #### Exemple 1 -Cette section fournit divers exemples de recherches. +This section provides various examples of queries. -Recherche dans une chaîne : +Query on a string: ```4d $entitySelection:=ds.Customer.query("firstName = 'S@'") ``` -Recherche avec une instruction NOT : +Query with a NOT statement: ```4d $entitySelection:=ds.Employee.query("not(firstName=Kim)") ``` -Recherche avec des dates : +Queries with dates: ```4d $entitySelection:=ds.Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds.Employee.query("birthDate <= :1";Current date-10950) ``` -Recherche avec des placeholders indexés pour les valeurs : +Query with indexed placeholders for values: ```4d $entitySelection:=ds.Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Recherche avec des placeholders indexés pour les valeurs sur une dataclass liée : +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds.Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Recherche avec des placeholders indexés avec tri décroissant : +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds.Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Recherche avec des placeholders nommés pour les valeurs : +Query with named placeholders for values: ```4d var $querySettings : Object @@ -1196,7 +1253,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Recherche utilisant les placeholders nommés et indexés pour les valeurs : +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -1205,7 +1262,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Recherche avec objets queryPlan et queryPath : +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds.Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -1216,19 +1273,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Recherche avec un chemin d'attribut de type Collection : +Query with an attribute path of Collection type: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Recherche avec un chemin d'attribut de type Collection et des attributs reliés : +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Recherche avec un chemin d'attribut de type Collection et plusieurs attributs reliés : +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1236,25 +1293,25 @@ $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Recherche avec un chemin d'attribut de type Objet : +Query with an attribute path of Object type: ```4d $entitySelection:=ds.Employee.query("extra.eyeColor = :1";"blue") ``` -Recherche avec instruction IN : +Query with an IN statement: ```4d $entitySelection:=ds.Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Recherche avec instruction NOT (IN) : +Query with a NOT (IN) statement: ```4d $entitySelection:=ds.Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Recherche avec des placeholders indexés pour les attributs : +Query with indexed placeholders for attributes: ```4d var $es : cs.EmployeeSelection @@ -1262,7 +1319,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") //salesperson est une entité reliée ``` -Recherche avec des placeholders indexés pour les attributs et avec des placeholders nommés pour les valeurs : +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs.EmployeeSelection @@ -1273,7 +1330,7 @@ $es:=ds.Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId";" //salesperson est une entité reliée ``` -Recherche avec des placeholders indexés pour les attributs et les valeurs : +Query with indexed placeholders for attributes and values: ```4d var $es : cs.EmployeeSelection @@ -1283,11 +1340,11 @@ $es:=ds.Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smith #### Exemple 2 -Cette section illustre les recherches avec des placeholders nommés pour les attributs. +This section illustrates queries with named placeholders for attributes. -Considérons une dataclass Employee avec 2 entités : +Given an Employee dataclass with 2 entities: -Entité 1 : +Entity 1: ```4d name: "Marie" @@ -1299,7 +1356,7 @@ softwares:{ } ``` -Entité 2 : +Entity 2: ```4d name: "Sophie" @@ -1311,7 +1368,7 @@ softwares:{ } ``` -Recherche avec des placeholders nommés pour les attributs : +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1322,7 +1379,7 @@ Recherche avec des placeholders nommés pour les attributs : //$es.length=1 (Employee Marie) ``` -Recherche avec des placeholders nommés pour les attributs et les valeurs : +Query with named placeholders for attributes and values: ```4d @@ -1343,16 +1400,16 @@ Recherche avec des placeholders nommés pour les attributs et les valeurs : #### Exemple 3 -Ces exemples illustrent les diverses manières d'utiliser des formules avec ou sans paramètres dans vos recherches. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -La formule est fournie sous forme de texte avec `eval()` dans le paramètre *queryString* : +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs.StudentsSelection $es:=ds.Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -La formule est fournie sout forme d'objet `Formula` via un placeholder : +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs.StudentsSelection @@ -1361,7 +1418,7 @@ La formule est fournie sout forme d'objet `Formula` via un placeholder : $es:=ds.Students.query(":1 and nationality='French'";$formula) ``` -Seul un objet `Formula` est fourni comme critère de recherche : +Only a `Formula` object is given as criteria: ```4d var $es : cs.StudentsSelection @@ -1370,7 +1427,7 @@ Seul un objet `Formula` est fourni comme critère de recherche : $es:=ds.Students.query($formula) ``` -Plusieurs formules peuvent être appliquées : +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1379,7 +1436,7 @@ Plusieurs formules peuvent être appliquées : $0:=ds.Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Une formule texte dans *queryString* reçoit un paramètre : +A text formula in *queryString* receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1395,7 +1452,7 @@ Une formule texte dans *queryString* reçoit un paramètre : $result:=(Position($exclude;This.lastname)=0) ``` -En utilisant la même méthode ***checkName***, un objet `Formula` en placeholder reçoit un paramètre : +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1408,7 +1465,7 @@ En utilisant la même méthode ***checkName***, un objet `Formula` en placeholde $es:=ds.Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisissent leurs requêtes : +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs.StudentsSelection @@ -1423,7 +1480,7 @@ Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisis #### Voir également -[`.query()`](EntitySelectionClass.md#query) pour les entity selections +[`.query()`](EntitySelectionClass.md#query) for entity selections @@ -1443,7 +1500,7 @@ Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisis | Paramètres | Type | | Description | | ---------- | ------ | -- | ------------------------------------------------------------------------------------------------------------- | -| settings | Object | -> | Objet définissant le timeout et la taille maximum du cache ORDA pour la dataclass.| +| settings | Object | -> | Object that sets the timeout and maximum size of the ORDA cache for the dataclass.| | @@ -1451,30 +1508,30 @@ Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisis #### Description -La fonction `setRemoteCacheSettings()` définit le timeout et la taille maximum du cache ORDA pour la dataclass.. +The `.setRemoteCacheSettings()` function sets the timeout and maximum size of the ORDA cache for a dataclass.. -Dans le paramètre *settings*, passez un objet contenant les propriétés suivantes : +In the *settings* parameter, pass an object with the following properties: | Propriété | Type | Description | | ---------- | ------- | ------------------------- | | timeout | Integer | Timeout en secondes. | | maxEntries | Integer | Nombre maximum d'entités. | -`timeout` définit le timeout du cache ORDA pour la dataclass (30 secondes par défaut). Lorsque le timeout est atteint, les entités de la dataclass dans le cache sont considérées comme expirées. Cela signifie que : +`timeout` sets the timeout of the ORDA cache for the dataclass (default is 30 seconds). Once the timeout has passed, the entities of the dataclass in the cache are considered as expired. This means that: * les données sont toujours présentes * la prochaine fois que les données seront requises, elles seront demandées au serveur * 4D supprime automatiquement les données expirées lorsque le nombre maximum d'entités est atteint -Modifier la propriété `timeout` définit un nouveau timeout pour les entités déjà présentes dans le cache. Cela peut être utile lorsque vous travaillez avec des données qui ne changent pas souvent, et pour lesquelles de nouvelles requêtes au serveur ne sont donc pas nécessaires. +Setting a `timeout` property sets a new timeout for the entities already present in the cache. It is useful when working with data that does not change very frequently, and thus when new requests to the server are not necessary. -`maxEntries` définit le nombre maximum d'entités dans le cache ORDA. Par défaut ce nombre est 30 000. +`maxEntries` sets the max number of entities in the ORDA cache. Default is 30 000. -Le nombre d'entrées minimum est 300, donc la valeur de `maxEntries` doit être égale ou supérieure à 300. Sinon la valeur est ignorée et le nombre d'entrées maximum est fixé à 300. +The minimum number of entries is 300, so the value of `maxEntries` must be equal to or higher than 300. Otherwise it is ignored and the maximum number of entries is set to 300. -Si aucune propriété valide n'est passée à `timeout` et `maxEntries`, le cache n'est pas modifié, il conserve ses valeurs précédentes ou par défaut. +If no valid properties are passed as `timeout` and `maxEntries`, the cache remains unchanged, with its default or previously set values. -Lorsqu'une entité est sauvegardée, elle est mise à jour dans le cache expirera lorsque le timeout sera atteint. +When an entity is saved, it is updated in the cache and expires once the timeout is reached. #### Exemple From db8fa8e5e51309bb64e1bd4cb3a58ebe75e59ad6 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:45:03 +0200 Subject: [PATCH 013/180] New translations EntityClass.md (French) --- .../version-20/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20/API/EntityClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20/API/EntityClass.md index 9adedb07b42f9e..26068ccbbbd05d 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20/API/EntityClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20/API/EntityClass.md @@ -1699,7 +1699,7 @@ Si aucun attribut de l'entité n'a été touché, la fonction retourne une colle //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -Dans ce cas : +In this case: * firstName et lastName ont un type `storage` * employer a un type `relatedEntity` From 7ea761383a8eb20bcb8f5b3ac08528bbddea53b8 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:47:39 +0200 Subject: [PATCH 014/180] New translations properties_Text.md (French) --- .../version-20/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md b/i18n/fr/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md index 7787dae5fabb80..7f2737a1d800d1 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md @@ -282,7 +282,7 @@ This property can also be handled by the [OBJECT Get vertical alignment](https:/ `List box de type collection ou entity selection (sélection d'entité)` -Indique une expression ou une variable qui sera évaluée pour chaque ligne affichée. Elle permet de définir un ensemble d'attributs texte des lignes. Vous devez passer une **variable objet** ou une **expression qui retourne un objet**. Les propriétés suivantes sont prises en charge : +Indique une expression ou une variable qui sera évaluée pour chaque ligne affichée. Elle permet de définir un ensemble d'attributs texte des lignes. Vous devez passer une **variable objet** ou une **expression qui retourne un objet**. The following properties are supported: | Nom de propriété | Type | Description | | ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From f2ea2db95ec5ecc49334e4f3c4cf7e9d562a382b Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:48:41 +0200 Subject: [PATCH 015/180] New translations genInfo.md (French) --- .../docusaurus-plugin-content-docs/version-20/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20/REST/genInfo.md b/i18n/fr/docusaurus-plugin-content-docs/version-20/REST/genInfo.md index ad66a4d9676037..836c3e8a81e488 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20/REST/genInfo.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20/REST/genInfo.md @@ -33,4 +33,4 @@ Ces propriétés sont des objets contenant des informations sur la façon dont l - **queryPlan** : objet contenant la description détaillée de la requête juste avant son exécution (c'est-à-dire la requête planifiée). - **queryPath** : objet contenant la description détaillée de la requête telle qu'elle a été réellement effectuée. -Les informations enregistrées incluent le type de requête (indexé et séquentiel) et chaque sous-requête nécessaire ainsi que les opérateurs de conjonction. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Query paths also contain the number of entities found and the time required to execute each search criterion. Généralement, la description du plan de requête et son chemin d'accès sont identiques mais ils peuvent différer car 4D peut intégrer des optimisations dynamiques lorsqu'une requête est exécutée, afin d'améliorer les performances. Par exemple, le moteur 4D peut convertir dynamiquement une requête indexée en requête séquentielle s'il estime que ce processus est plus rapide. Ce cas particulier peut se produire lorsque le nombre d'entités recherchées est faible. \ No newline at end of file +Les informations enregistrées incluent le type de requête (indexé et séquentiel) et chaque sous-requête nécessaire ainsi que les opérateurs de conjonction. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From cd8922a20e03ed0352b0fd3b49471ac1be59fc73 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 08:49:03 +0200 Subject: [PATCH 016/180] New translations method-list.md (French) --- .../version-20/ViewPro/method-list.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md b/i18n/fr/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md index 8cdc86b19bb111..eda6e55aac4ce6 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md @@ -37,7 +37,7 @@ Passez la formule 4D View Pro que vous souhaitez nommer dans *vpFormula*. Pour p Passez le nouveau nom de la formule dans *name*. Si le nom est déjà utilisé dans le même scope, la nouvelle formule nommée remplace la formule existante. A noter que vous pouvez utiliser le même nom pour plusieurs scopes (ci-dessous). -Vous pouvez passer un objet avec des propriétés additionnelles pour la plage nommée dans *options*. Les propriétés suivantes sont prises en charge : +Vous pouvez passer un objet avec des propriétés additionnelles pour la plage nommée dans *options*. The following properties are supported: | Propriété | Type | Description | | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -77,7 +77,7 @@ La commande `VP ADD RANGE NAME` Dans *rangeObj*, passez la plage que vous souhaitez nommer, et passez le nouveau nom de la plage dans *name*. Si le nom est déjà utilisé dans le même scope, la nouvelle plage nommée remplace la plage existante. A noter que vous pouvez utiliser le même nom pour plusieurs scopes (ci-dessous). -Vous pouvez passer un objet avec des propriétés supplémentaires pour la plage nommée dans *options*. Les propriétés suivantes sont prises en charge : +Vous pouvez passer un objet avec des propriétés supplémentaires pour la plage nommée dans *options*. The following properties are supported: | Propriété | Type | Description | | --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1160,7 +1160,7 @@ Dans le paramètre *rangeObj*, passez un objet contenant une plage dans laquelle Le paramètre *searchValue* vous permet de passer le texte à rechercher dans *rangeObj*. -Vous pouvez passer le paramètre optionnel *searchCondition* pour préciser le fonctionnement de la recherche. Les propriétés suivantes sont prises en charge : +Vous pouvez passer le paramètre optionnel *searchCondition* pour préciser le fonctionnement de la recherche. The following properties are supported: | Propriété | Type | Description | | ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -3485,7 +3485,7 @@ VP NEW DOCUMENT("myVPArea") The `VP Object to font` command returns a font shorthand string from *fontObj*. -Dans *fontObj*, passez un objet contenant les propriétés de police. Les propriétés suivantes sont prises en charge : +Dans *fontObj*, passez un objet contenant les propriétés de police. The following properties are supported: | Propriété | Type | Description | Possible values | Obligatoire | | --------- | ---- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | From 9aac5c48d517df4003b93e8578cd2efc6cffd3cc Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:00:06 +0200 Subject: [PATCH 017/180] New translations DataClassClass.md (French) --- .../version-20-R2/API/DataClassClass.md | 269 +++++++++++------- 1 file changed, 163 insertions(+), 106 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md index 777d87eebea71c..429347781f0d75 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md @@ -851,7 +851,7 @@ La fonction `.query()` recherche les Si aucune entité correspondante n'est trouvée, une `EntitySelection` vide est retournée. -**Paramètre queryString** +#### queryString parameter Le paramètre *queryString* doit respecter la syntaxe suivante : @@ -861,9 +861,9 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -où : +where: -* **attributePath** : Chemin de l'attribut sur lequel vous souhaitez exécuter la recherche. Ce paramètre peut contenir un nom simple (par exemple "pays") ou un chemin d'attribut valide (par exemple "pays.nom"). Dans le cas d'un chemin d'attribut de type `Collection`, la notation \[ ] est utilisée pour designer toutes les occurrences (par exemple "enfants\[ ].age"). +* **attributePath** : Chemin de l'attribut sur lequel vous souhaitez exécuter la recherche. Ce paramètre peut contenir un nom simple (par exemple "pays") ou un chemin d'attribut valide (par exemple "pays.nom"). In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > Vous ne pouvez pas utiliser directement des attributs dont les noms contiennent des caractères spéciaux tels que ".", "\[ ]", ou "=", ">", "#"..., car ils ne seront pas correctement évalués dans la chaîne de recherche. Si vous souhaitez rechercher ces attributs, vous devez utiliser des placeholders, qui permettent d'utiliser un ensemble de caractères plus étendu dans les chemins d'attribut (voir * **Utiliser des placeholders** *ci-dessous). * **formula** : Une formule valide passée en `Text` ou en `Object`. La formule sera évaluée pour chaque entité traitée et doit retourner une valeur booléenne. Dans la formule, l'entité est disponible via l'objet `This`. @@ -879,19 +879,19 @@ où : * **comparator** : symbole d'opérateur utilisé pour comparer *attributePath* et *value*. Les symboles suivants sont pris en charge : - | Comparaison | Symbole(s) | Commentaire | - | --------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | - | Egal à | =, == | Retourne les données correspondantes, prend en charge le joker de recherche (@), ne tient pas compte de la casse et est non diacritique. | - | | ===, IS | Retourne les données correspondantes, considère le @ comme un caractère standard, ne tient pas compte de la casse et est non diacritique | - | Différent de | #, != | Prend en charge le joker de recherche (@) | - | | !==, IS NOT | Considère le @ comme un caractère standard | - | Inférieur à | | | - | Supérieur à | > | | - | Inférieur ou égal à | <= | | - | Supérieur ou égal à | >= | | - | Inclus parmi | IN | Retourne les données égales à au moins une des valeurs d'une collection ou d'un ensemble de valeurs, prend en charge le joker de recherche (@) | - | Condition Not appliquée à une assertion | NOT | Les parenthèses sont obligatoires lorsque NOT est utilisé devant une assertion contenant plusieurs opérateurs | - | Contient mot-clé | % | Les mots-clés peuvent être utilisés avec les attributs de type texte ou image | + | Comparaison | Symbole(s) | Commentaire | + | --------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Egal à | =, == | Retourne les données correspondantes, prend en charge le joker de recherche (@), ne tient pas compte de la casse et est non diacritique. | + | | ===, IS | Retourne les données correspondantes, considère le @ comme un caractère standard, ne tient pas compte de la casse et est non diacritique | + | Différent de | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considère le @ comme un caractère standard | + | Condition Not appliquée à une assertion | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Inférieur à | | | + | Supérieur à | > | | + | Inférieur ou égal à | <= | | + | Supérieur ou égal à | >= | | + | Inclus parmi | IN | Retourne les données égales à au moins une des valeurs d'une collection ou d'un ensemble de valeurs, prend en charge le joker de recherche (@) | + | Contient mot-clé | % | Les mots-clés peuvent être utilisés avec les attributs de type texte ou image | * **value** : valeur à comparer à la valeur courante de l'attribut de chaque entité de la sélection ou élément de la collection. Peut être un **placeholder** (voir **Utiliser des placeholders** ci-dessous) ou toute expression correspondant à la propriété du type de donnée. Lorsque vous utilisez une valeur constante, les règles suivantes doivent être respectées : * Les valeurs constantes de type **texte** peuvent être passées avec ou sans guillemets (voir **Utilisation des guillemets** ci-dessous). Pour rechercher une chaîne dans une chaîne (recherche de type "contient"), utilisez le symbole joker (@) dans valeur pour isoler la chaîne à chercher, comme dans cet exemple : "@Smith@". Les mots-clés suivants sont interdits pour des constantes de type texte : true, false. @@ -909,40 +909,40 @@ où : * **order by attributePath** : vous pouvez inclure une déclaration order by *attributePath* dans la requête afin que les données résultantes soient triées selon cette déclaration. Vous pouvez utiliser plusieurs tris par déclaration, en les séparant par des virgules (e.g., order by *attributePath1* desc, *attributePath2* asc). Par défaut, le tri est par ordre croissant. Passez 'desc' pour définir un tri par ordre décroissant et 'asc' pour définir un tri par ordre croissant. >Si vous utilisez cette déclaration, l'entity selection retournée est triée (pour plus d'informations, veuillez consulter [Entity selections triées vs Entity selection non triées](ORDA/dsMapping.md#entity-selections-triees-vs-entity-selections-non-triees)). -**Utilisation des guillemets** +#### Using quotes -Lorsque vous utilisez des guillemets dans les recherches, vous devez utiliser des apostrophes ' ' à l'intérieur des requêtes et des guillemets " " pour encadrer la recherche complète, sinon une erreur est générée. Par exemple : +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Par exemple : ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Les guillemets simples (') ne sont pas pris en charge dans les valeurs recherchées car ils casseraient la chaîne de recherche. Par exemple, "comp.name = 'John's pizza' " génèrera une erreur. Si vous devez rechercher des valeurs contenant des guillemets simples, il est nécessaire d'utiliser des placeholders (voir ci-dessous). -**Utilisation des parenthèses** +#### Using parenthesis -Vous pouvez utiliser des parenthèses dans la recherche afin de prioriser les calculs. Par exemple, vous pouvez organiser une recherche de la manière suivante : +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Utilisation des placeholders** +#### Using placeholders -4D vous permet d'utiliser des placeholders pour les arguments *attributePath*, *formula* et *value* dans le paramètre *queryString*. Un placeholder est un paramètre que vous insérez dans des chaines de recherche et qui est remplacé par une autre valeur au moment où la chaîne de recherche est évaluée. La valeur des placeholders est évaluée une seule fois, au début de la requête ; elle n'est pas évaluée pour chaque élément. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Il existe deux types de placeholders : les **placeholders indexés** et les **placeholders nommés** : +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | | Placeholders indexés | Placeholders nommés | | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Définition | You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: | Les paramètres sont insérés sous la forme `:paramName` (par exemple :myparam) et leurs valeurs sont fournies dans les objets attributes et/ou parameters dans le paramètre *querySettings* | | Exemple | `$r:=class.query(":1=:2";"city";"Chicago")` | `$o.attributes:=New object("att";"city")`
`$o.parameters:=New object("name";"Chicago")`
`$r:=class.query(":att=:name";$o)` | -Vous pouvez combiner tous les types d'arguments dans *queryString*. in *queryString* and their corresponding values are provided by the sequence of *value* parameter(s). You can use up to 128 *value* parameters +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * des valeurs directes (pas de placeholders) * des placeholders indexés et/ou nommés. -L'utilisation de placeholders dans les recherches **est recommandée** pour les raisons suivantes : +Using placeholders in queries **is recommended** for the following reasons: 1. Cela empêche l'injection de code malveillant : si vous utilisez dans la chaîne de recherche des variables dont le contenu provient directement de la saisie de l'utilisateur, celui-ci pourrait modifier les conditions de recherche en saisissant des arguments de recherche supplémentaires. Par exemple, imaginez une chaîne de recherche du type : @@ -951,50 +951,105 @@ L'utilisation de placeholders dans les recherches **est recommandée** pour les $result:=$col.query($vquery) ``` - Cette recherche semble sécurisée puisque les données non publiques sont filtrées. Cependant, si l'utilisateur saisit dans la zone *myname* une chaîne du type *"smith OR status='private'*, la chaîne de recherche sera modifiée à l'étape de l'interprétation et pourra retourner des données privées. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Lorsque vous utilisez des placeholders, le contournement des options de sécurité n'est pas possible : + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - Dans ce cas, si l'utilisateur saisit *smith OR status='private'* dans la zone *myname*, cela ne sera pas interprété dans la chaîne de recherche, mais uniquement passé en tant que valeur. La recherche d'une personne nommée "smith OR status='private"' échouera simplement. + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Cela résout les questions liées au formatage des valeurs ou des caractères, notamment lorsque vous gérez des paramètres *attributePath* et *value* qui peuvent contenir des caractères non-alphanumériques tels que ".", "["... 3. Cela permet l'utilisation de variables ou d'expressions dans les arguments de recherche. Exemples : ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Recherche de valeurs null** +#### Looking for null values -Lorsque vous recherchez les valeurs null, vous ne pouvez pas utiliser la syntaxe placeholder car le moteur de recherche considère la valeur null comme une valeur de comparaison invalide. Par exemple, si vous exécutez la recherche suivante : +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // ne fonctionnera PAS ``` -Vous n'obtiendrez pas le résultat souhaité car la valeur null sera évaluée par 4D comme une erreur résultant de l'évaluation du paramètre (pouvant être, par exemple, un attribut provenant d'une autre recherche). Pour ce type de recherches, vous devez utiliser la syntaxe de recherche directe : +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds.Person.query("spouse = null") //syntaxe valide ``` -**Relier les arguments de recherche aux collections dans les attributs** +#### Not equal to in collections + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + + +#### Linking collection attribute query arguments :::info -Cette fonctionnalité est disponible uniquement pour les recherches dans les dataclasses et les [entity selections](EntitySelectionClass.md#query). Elle ne peut pas être utilisée pour les recherches dans les [collections](CollectionClass.md#query). +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -Lorsque vous effectuez des recherches parmi des attributs objets de dataclass contenant des collections à l'aide de plusieurs arguments de requête reliés par l'opérateur AND, vous souhaiterez éventuellement vous assurer que seules les entités contenant des éléments correspondant à tous les arguments soient retournées, et non les entités où des arguments peuvent être trouvés dans différents éléments. Pour ce faire, vous devez relier les arguments de requête aux éléments de collection, de sorte que seuls les éléments uniques contenant des arguments reliés soient retournés. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Par exemple, avec les deux entités suivantes : +For example, with the following two entities: ``` Entity 1: @@ -1017,35 +1072,35 @@ ds.People.places: } ] } ``` -Vous souhaitez trouver des personnes dont le type d'emplacement est "home" dans la ville de "paris". Si vous écrivez : +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... la requête retournera "martin" **et** "smith" car "smith" a un élément "locations" dont "kind" (le type) est "home" et un élément "locations" dont "city" (la ville) est "paris", même si ce sont des éléments différents. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Si vous souhaitez obtenir uniquement les entités dont les arguments correspondants sont dans le même élément de collection, vous devez **relier les arguments**. Pour lier des arguments de requête : +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Ajoutez une lettre entre le caractère \[] dans le premier chemin à lier et répétez la même lettre dans tous les arguments liés. Par exemple : `locations[a].city and locations[a].kind`. Vous pouvez utiliser n'importe quelle lettre de l'alphabet latin (non sensible à la casse). * Pour ajouter différents critères liés dans la même requête, utilisez une autre lettre. Vous pouvez créer jusqu'à 26 combinaisons de critères dans une seule requête. -A l'aide des entités ci-dessus, si vous écrivez : +With the above entities, if you write: ```4d ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... la requête ne retournera uniquement "martin" car il possède un élément "locations" dont "kind" est "home" et dont "city" est "paris". La requête ne retournera pas "smith" car les valeurs "home" et "paris" ne sont pas contenus dans le même élément de collection. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Recherches dans les relations N vers N** +#### Queries in many-to-many relations -ORDA propose une syntaxe spéciale pour faciliter les recherches dans les relations N vers N. Dans ce contexte, vous pouvez avoir besoin de rechercher des valeurs différentes à l'aide de l'opérateur `AND` MAIS dans le même attribut. Par exemple, considérez la structure suivante : +ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: ![alt-text](../assets/en/API/manytomany.png) -Imaginez que vous souhaitiez rechercher tous les films dans lesquels un acteur A *Et* un acteur B ont joué un rôle. Si vous écrivez une recherche simple utilisant l'opérateur `AND`, cela ne va pas fonctionner : +Imagine that you want to search all movies in which *both* actor A and actor B have a role. If you write a simple query using an `AND` operator, it will not work: ```4d // code invalide @@ -1053,17 +1108,17 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";"H // $es est vide ``` -Fondamentalement, le problème vient de la logique interne de la recherche : vous ne pouvez pas rechercher une entité dont un attribut aurait simultanément la valeur "A" et "B". +Basically, the issue is related to the internal logic of the query: you cannot search for an attribute whose value would be both "A" and "B". -Pour rendre possible ce type de recheche, ORDA prend en charge une syntaxe spéciale : vous devez juste ajouter un *class index* entre les caractères **{}** dans tous les attributs relationnels utilisés dans la chaîne de recherche : +To make it possible to perform such queries, ORDA allows a special syntax: you just need to add a *class index* between **{}** in all additional relation attributes used in the string: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** indique à ORDA de créer une autre référence pour l'attribut relationnel. Le moteur de requêtes effectuera alors toutes les opérations internes nécessaires. Notez que **x** peut être n'importe quel nombre **à l'exception de 0**: {1}, ou {2}, ou {1540}... ORDA a simplement besoin d'une référence unique dans la recherche pour chaque class index. +**{x}** tells ORDA to create another reference for the relation attribute. It will then perform all the necessary bitmap operations internally. Note that **x** can be any number **except 0**: {1}, or {2}, or {1540}... ORDA only needs a unique reference in the query for each class index. -Dans notre exemple, cela pourrait donner : +In our example, it would be: ```4d // code valide @@ -1071,38 +1126,40 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es contient des films (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**Paramètre formula** -Au lieu d'insérer une formule dans le paramètre *queryString* (voir ci-dessus), vous pouvez directement passer un objet formule en tant que critère de recherche booléen. L'utilisation d'un objet formule pour les requêtes est **recommandée** car vous bénéficiez d'une tokenisation et le code est plus facile à rechercher/lire. -La formule doit avoir été créée à l'aide des commandes [`Formula`](FunctionClass.md#formula) ou [`Formula from string`](FunctionClass.md#formula-from-string). Dans ce cas : +#### formula parameter + +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. + +La formule doit avoir été créée à l'aide des commandes [`Formula`](FunctionClass.md#formula) ou [`Formula from string`](FunctionClass.md#formula-from-string). In this case: * *formula* est évaluée pour chaque entité et doit renvoyer vrai ou faux. Lors de l'exécution de la requête, si le résultat de la formule n'est pas un booléen, il est considéré comme faux. * dans *formula*, l'entité est disponible via l'objet `This`. * si l'objet `Formula` est **null**, l'erreur 1626 ("Attente d'un texte ou d'une formule") est générée, que vous pouvez intercepter à l'aide d'une méthode installée avec `ON ERR CALL`. > Pour des raisons de sécurité, les appels de formule dans les fonctions `query()` peuvent être interdits. Voir la description du paramètre *querySettings*. -**Passer des paramètres aux formules** +#### Passing parameters to formulas -Tout paramètre *formula* appelé par la fonction `query()` peut recevoir des paramètres : +Any *formula* called by the `query()` class function can receive parameters: * Les paramètres doivent être passés via la propriété **args** du paramètre *querySettings*. * La formule reçoit cet objet **args** en tant que paramètre **$1**. -Ce code montre comment les paramètres sont passés aux fonctions : +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //objet args pour passer des paramètres $es:=ds.Students.query("eval(checkName($1.exclude))";$settings) //args est reçu dans $1 ``` -Des exemples supplémentaires sont fournis dans l'exemple 3. +Additional examples are provided in example 3. -**4D Server** : En client/serveur, les formules sont exécutées sur le serveur. Dans ce contexte, seul l'objet `querySettings.args` est envoyé aux formules. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**Paramètre querySettings** +#### querySettings parameter -Dans le paramètre *querySettings* vous pouvez passer un objet contenant des options supplémentaires. Les propriétés suivantes sont prises en charge : +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propriété | Type | Description | | ------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1114,18 +1171,18 @@ Dans le paramètre *querySettings* vous pouvez passer un objet contenant des opt | queryPlan | Boolean | Dans l'entity selection résultante, retourne ou ne retourne la description détaillée de la recherche juste avant d'être exécutée, i.e. La propriété retournée est un objet qui inclut chaque recherche et sous-recherche programmée (dans le cas d'une recherche complexe). Cette option est utile durant la phase de développement d'une application. Elle est utilisée conjointement à queryPath. Par défaut, si elle est omise : faux. **Note** : Cette propriété est prise en charge uniquement par les fonctions `entitySelection.query()` et `dataClass.query()`. | | queryPath | Boolean | Dans l'entity selection résultante, retourne ou ne retourne pas la description détaillée de la recherche telle qu'elle est effectuée. La propriété retournée est un objet qui contient le chemin utilisé pour la recherche (généralement identique à celui de queryPlan, mais il peut être différent si le moteur parvient à optimiser la recherche), la durée du traitement et le nombre d'enregistrements trouvés. Cette option est utile durant la phase de développement d'une application. Par défaut, si elle est omise : faux. **Note** : Cette propriété est prise en charge uniquement par les fonctions `entitySelection.query()` et `dataClass.query()`. | -**A propos de queryPlan et queryPath** +#### About queryPlan and queryPath -Les informations enregistrées dans `queryPlan` et `queryPath` incluent le type de recherche (indexée ou séquentielle), chaque sous-recherche nécessaire, ainsi que les opérateurs de conjonction. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Généralement, la description du plan de requête et son chemin d'accès sont identiques mais ils peuvent différer car 4D peut intégrer des optimisations dynamiques lorsqu'une requête est exécutée, afin d'améliorer les performances. Par exemple, le moteur 4D peut convertir dynamiquement une requête indexée en requête séquentielle s'il estime que ce processus est plus rapide. Ce cas particulier peut se produire lorsque le nombre d'entités recherchées est faible. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Par exemple, si vous exécutez la recherche suivante : +For example, if you execute the following query: ```4d $sel:=ds.Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ 50000;"Lima West Kilo";10000000;New object("queryPath";True;"queryPlan";True)) ``` -queryPlan : +queryPlan: ```4d {Or:[{And:[{item:[index : Employee.salary ] < 50000}, @@ -1135,7 +1192,7 @@ queryPlan : subquery:[{item:[index : Company.revenues ] > 10000000}]}]} ``` -queryPath : +queryPath: ```4d {steps:[{description:OR,time:63,recordsfounds:1388132, @@ -1147,46 +1204,46 @@ queryPath : #### Exemple 1 -Cette section fournit divers exemples de recherches. +This section provides various examples of queries. -Recherche dans une chaîne : +Query on a string: ```4d $entitySelection:=ds.Customer.query("firstName = 'S@'") ``` -Recherche avec une instruction NOT : +Query with a NOT statement: ```4d $entitySelection:=ds.Employee.query("not(firstName=Kim)") ``` -Recherche avec des dates : +Queries with dates: ```4d $entitySelection:=ds.Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds.Employee.query("birthDate <= :1";Current date-10950) ``` -Recherche avec des placeholders indexés pour les valeurs : +Query with indexed placeholders for values: ```4d $entitySelection:=ds.Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Recherche avec des placeholders indexés pour les valeurs sur une dataclass liée : +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds.Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Recherche avec des placeholders indexés avec tri décroissant : +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds.Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Recherche avec des placeholders nommés pour les valeurs : +Query with named placeholders for values: ```4d var $querySettings : Object @@ -1196,7 +1253,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Recherche utilisant les placeholders nommés et indexés pour les valeurs : +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -1205,7 +1262,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Recherche avec objets queryPlan et queryPath : +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds.Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -1216,19 +1273,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Recherche avec un chemin d'attribut de type Collection : +Query with an attribute path of Collection type: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Recherche avec un chemin d'attribut de type Collection et des attributs reliés : +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Recherche avec un chemin d'attribut de type Collection et plusieurs attributs reliés : +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1236,25 +1293,25 @@ $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Recherche avec un chemin d'attribut de type Objet : +Query with an attribute path of Object type: ```4d $entitySelection:=ds.Employee.query("extra.eyeColor = :1";"blue") ``` -Recherche avec instruction IN : +Query with an IN statement: ```4d $entitySelection:=ds.Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Recherche avec instruction NOT (IN) : +Query with a NOT (IN) statement: ```4d $entitySelection:=ds.Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Recherche avec des placeholders indexés pour les attributs : +Query with indexed placeholders for attributes: ```4d var $es : cs.EmployeeSelection @@ -1262,7 +1319,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") //salesperson est une entité reliée ``` -Recherche avec des placeholders indexés pour les attributs et avec des placeholders nommés pour les valeurs : +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs.EmployeeSelection @@ -1273,7 +1330,7 @@ $es:=ds.Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId";" //salesperson est une entité reliée ``` -Recherche avec des placeholders indexés pour les attributs et les valeurs : +Query with indexed placeholders for attributes and values: ```4d var $es : cs.EmployeeSelection @@ -1283,11 +1340,11 @@ $es:=ds.Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smith #### Exemple 2 -Cette section illustre les recherches avec des placeholders nommés pour les attributs. +This section illustrates queries with named placeholders for attributes. -Considérons une dataclass Employee avec 2 entités : +Given an Employee dataclass with 2 entities: -Entité 1 : +Entity 1: ```4d name: "Marie" @@ -1299,7 +1356,7 @@ softwares:{ } ``` -Entité 2 : +Entity 2: ```4d name: "Sophie" @@ -1311,7 +1368,7 @@ softwares:{ } ``` -Recherche avec des placeholders nommés pour les attributs : +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1322,7 +1379,7 @@ Recherche avec des placeholders nommés pour les attributs : //$es.length=1 (Employee Marie) ``` -Recherche avec des placeholders nommés pour les attributs et les valeurs : +Query with named placeholders for attributes and values: ```4d @@ -1343,16 +1400,16 @@ Recherche avec des placeholders nommés pour les attributs et les valeurs : #### Exemple 3 -Ces exemples illustrent les diverses manières d'utiliser des formules avec ou sans paramètres dans vos recherches. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -La formule est fournie sous forme de texte avec `eval()` dans le paramètre *queryString* : +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs.StudentsSelection $es:=ds.Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -La formule est fournie sout forme d'objet `Formula` via un placeholder : +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs.StudentsSelection @@ -1361,7 +1418,7 @@ La formule est fournie sout forme d'objet `Formula` via un placeholder : $es:=ds.Students.query(":1 and nationality='French'";$formula) ``` -Seul un objet `Formula` est fourni comme critère de recherche : +Only a `Formula` object is given as criteria: ```4d var $es : cs.StudentsSelection @@ -1370,7 +1427,7 @@ Seul un objet `Formula` est fourni comme critère de recherche : $es:=ds.Students.query($formula) ``` -Plusieurs formules peuvent être appliquées : +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1379,7 +1436,7 @@ Plusieurs formules peuvent être appliquées : $0:=ds.Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Une formule texte dans *queryString* reçoit un paramètre : +A text formula in *queryString* receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1395,7 +1452,7 @@ Une formule texte dans *queryString* reçoit un paramètre : $result:=(Position($exclude;This.lastname)=0) ``` -En utilisant la même méthode ***checkName***, un objet `Formula` en placeholder reçoit un paramètre : +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1408,7 +1465,7 @@ En utilisant la même méthode ***checkName***, un objet `Formula` en placeholde $es:=ds.Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisissent leurs requêtes : +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs.StudentsSelection @@ -1423,7 +1480,7 @@ Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisis #### Voir également -[`.query()`](EntitySelectionClass.md#query) pour les entity selections +[`.query()`](EntitySelectionClass.md#query) for entity selections @@ -1443,7 +1500,7 @@ Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisis | Paramètres | Type | | Description | | ---------- | ------ | -- | ------------------------------------------------------------------------------------------------------------- | -| settings | Object | -> | Objet définissant le timeout et la taille maximum du cache ORDA pour la dataclass.| +| settings | Object | -> | Object that sets the timeout and maximum size of the ORDA cache for the dataclass.| | @@ -1451,30 +1508,30 @@ Nous voulons interdire les formules, par exemple lorsque les utilisateurs saisis #### Description -La fonction `setRemoteCacheSettings()` définit le timeout et la taille maximum du cache ORDA pour la dataclass.. +The `.setRemoteCacheSettings()` function sets the timeout and maximum size of the ORDA cache for a dataclass.. -Dans le paramètre *settings*, passez un objet contenant les propriétés suivantes : +In the *settings* parameter, pass an object with the following properties: | Propriété | Type | Description | | ---------- | ------- | ------------------------- | | timeout | Integer | Timeout en secondes. | | maxEntries | Integer | Nombre maximum d'entités. | -`timeout` définit le timeout du cache ORDA pour la dataclass (30 secondes par défaut). Lorsque le timeout est atteint, les entités de la dataclass dans le cache sont considérées comme expirées. Cela signifie que : +`timeout` sets the timeout of the ORDA cache for the dataclass (default is 30 seconds). Once the timeout has passed, the entities of the dataclass in the cache are considered as expired. This means that: * les données sont toujours présentes * la prochaine fois que les données seront requises, elles seront demandées au serveur * 4D supprime automatiquement les données expirées lorsque le nombre maximum d'entités est atteint -Modifier la propriété `timeout` définit un nouveau timeout pour les entités déjà présentes dans le cache. Cela peut être utile lorsque vous travaillez avec des données qui ne changent pas souvent, et pour lesquelles de nouvelles requêtes au serveur ne sont donc pas nécessaires. +Setting a `timeout` property sets a new timeout for the entities already present in the cache. It is useful when working with data that does not change very frequently, and thus when new requests to the server are not necessary. -`maxEntries` définit le nombre maximum d'entités dans le cache ORDA. Par défaut ce nombre est 30 000. +`maxEntries` sets the max number of entities in the ORDA cache. Default is 30 000. -Le nombre d'entrées minimum est 300, donc la valeur de `maxEntries` doit être égale ou supérieure à 300. Sinon la valeur est ignorée et le nombre d'entrées maximum est fixé à 300. +The minimum number of entries is 300, so the value of `maxEntries` must be equal to or higher than 300. Otherwise it is ignored and the maximum number of entries is set to 300. -Si aucune propriété valide n'est passée à `timeout` et `maxEntries`, le cache n'est pas modifié, il conserve ses valeurs précédentes ou par défaut. +If no valid properties are passed as `timeout` and `maxEntries`, the cache remains unchanged, with its default or previously set values. -Lorsqu'une entité est sauvegardée, elle est mise à jour dans le cache expirera lorsque le timeout sera atteint. +When an entity is saved, it is updated in the cache and expires once the timeout is reached. #### Exemple From 26e7b2b95956af2ad806d6ccd31500cc53045555 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:00:13 +0200 Subject: [PATCH 018/180] New translations EntityClass.md (French) --- .../version-20-R2/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md index 9adedb07b42f9e..26068ccbbbd05d 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md @@ -1699,7 +1699,7 @@ Si aucun attribut de l'entité n'a été touché, la fonction retourne une colle //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -Dans ce cas : +In this case: * firstName et lastName ont un type `storage` * employer a un type `relatedEntity` From 7783198bc91ac700f455edf5608532b641d9b10a Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:02:52 +0200 Subject: [PATCH 019/180] New translations properties_Text.md (French) --- .../version-20-R2/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md index 7787dae5fabb80..7f2737a1d800d1 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md @@ -282,7 +282,7 @@ This property can also be handled by the [OBJECT Get vertical alignment](https:/ `List box de type collection ou entity selection (sélection d'entité)` -Indique une expression ou une variable qui sera évaluée pour chaque ligne affichée. Elle permet de définir un ensemble d'attributs texte des lignes. Vous devez passer une **variable objet** ou une **expression qui retourne un objet**. Les propriétés suivantes sont prises en charge : +Indique une expression ou une variable qui sera évaluée pour chaque ligne affichée. Elle permet de définir un ensemble d'attributs texte des lignes. Vous devez passer une **variable objet** ou une **expression qui retourne un objet**. The following properties are supported: | Nom de propriété | Type | Description | | ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 218c133fa8dcf6a8b04bf6e2c37e21b2a412edcb Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:03:58 +0200 Subject: [PATCH 020/180] New translations genInfo.md (French) --- .../version-20-R2/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md index ad66a4d9676037..836c3e8a81e488 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md @@ -33,4 +33,4 @@ Ces propriétés sont des objets contenant des informations sur la façon dont l - **queryPlan** : objet contenant la description détaillée de la requête juste avant son exécution (c'est-à-dire la requête planifiée). - **queryPath** : objet contenant la description détaillée de la requête telle qu'elle a été réellement effectuée. -Les informations enregistrées incluent le type de requête (indexé et séquentiel) et chaque sous-requête nécessaire ainsi que les opérateurs de conjonction. Les chemins d'accès des requêtes contiennent également le nombre d'entités identifiées et la durée d'exécution de chaque critère de recherche. Query paths also contain the number of entities found and the time required to execute each search criterion. Généralement, la description du plan de requête et son chemin d'accès sont identiques mais ils peuvent différer car 4D peut intégrer des optimisations dynamiques lorsqu'une requête est exécutée, afin d'améliorer les performances. Par exemple, le moteur 4D peut convertir dynamiquement une requête indexée en requête séquentielle s'il estime que ce processus est plus rapide. Ce cas particulier peut se produire lorsque le nombre d'entités recherchées est faible. \ No newline at end of file +Les informations enregistrées incluent le type de requête (indexé et séquentiel) et chaque sous-requête nécessaire ainsi que les opérateurs de conjonction. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From 87cb49a8e7116f1c45e3f54d563a28ab3ca944e6 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:04:20 +0200 Subject: [PATCH 021/180] New translations method-list.md (French) --- .../version-20-R2/ViewPro/method-list.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md b/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md index 8cdc86b19bb111..eda6e55aac4ce6 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md +++ b/i18n/fr/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md @@ -37,7 +37,7 @@ Passez la formule 4D View Pro que vous souhaitez nommer dans *vpFormula*. Pour p Passez le nouveau nom de la formule dans *name*. Si le nom est déjà utilisé dans le même scope, la nouvelle formule nommée remplace la formule existante. A noter que vous pouvez utiliser le même nom pour plusieurs scopes (ci-dessous). -Vous pouvez passer un objet avec des propriétés additionnelles pour la plage nommée dans *options*. Les propriétés suivantes sont prises en charge : +Vous pouvez passer un objet avec des propriétés additionnelles pour la plage nommée dans *options*. The following properties are supported: | Propriété | Type | Description | | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -77,7 +77,7 @@ La commande `VP ADD RANGE NAME` Dans *rangeObj*, passez la plage que vous souhaitez nommer, et passez le nouveau nom de la plage dans *name*. Si le nom est déjà utilisé dans le même scope, la nouvelle plage nommée remplace la plage existante. A noter que vous pouvez utiliser le même nom pour plusieurs scopes (ci-dessous). -Vous pouvez passer un objet avec des propriétés supplémentaires pour la plage nommée dans *options*. Les propriétés suivantes sont prises en charge : +Vous pouvez passer un objet avec des propriétés supplémentaires pour la plage nommée dans *options*. The following properties are supported: | Propriété | Type | Description | | --------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1160,7 +1160,7 @@ Dans le paramètre *rangeObj*, passez un objet contenant une plage dans laquelle Le paramètre *searchValue* vous permet de passer le texte à rechercher dans *rangeObj*. -Vous pouvez passer le paramètre optionnel *searchCondition* pour préciser le fonctionnement de la recherche. Les propriétés suivantes sont prises en charge : +Vous pouvez passer le paramètre optionnel *searchCondition* pour préciser le fonctionnement de la recherche. The following properties are supported: | Propriété | Type | Description | | ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -3485,7 +3485,7 @@ VP NEW DOCUMENT("myVPArea") The `VP Object to font` command returns a font shorthand string from *fontObj*. -Dans *fontObj*, passez un objet contenant les propriétés de police. Les propriétés suivantes sont prises en charge : +Dans *fontObj*, passez un objet contenant les propriétés de police. The following properties are supported: | Propriété | Type | Description | Possible values | Obligatoire | | --------- | ---- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | From 9b905888733d21d3dc16269c0874eddca54efcc7 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:15:50 +0200 Subject: [PATCH 022/180] New translations CollectionClass.md (Spanish) --- .../current/API/CollectionClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 32fdec4190479b..65e0b89a070ff5 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/API/CollectionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/API/CollectionClass.md @@ -186,7 +186,7 @@ El comando `New shared collection` busca entidad Si no se encuentran entidades coincidentes, se devuelve una `EntitySelection` vacía. -**parámetro queryString** +#### queryString parameter El parámetro *queryString* utiliza la siguiente sintaxis: @@ -861,9 +861,9 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -donde: +where: -* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. Each value is a path that can designate either a scalar or a related attribute of the dataclass or a property in an object field of the dataclass +* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > *No puede utilizar directamente atributos cuyo nombre contenga caracteres especiales como ".", "\[ ]", o "=", ">", "#"..., porque se evaluarán incorrectamente en la cadena de consulta. Si necesita consultar dichos atributos, debe considerar el uso de marcadores, que permiten un rango ampliado de caracteres en las rutas de los atributos (ver* **Uso de marcadores de posición** *a continuación).* * **formula**: una fórmula válida pasada como `Text` o en `Object`. La fórmula se evaluará para cada entidad procesada y debe devolver un valor booleano. Dentro de la fórmula, la entidad está disponible a través del objeto `This`. @@ -879,19 +879,19 @@ donde: * **comparator**: símbolo que compara *attributePath* y *value*. Se soportan los siguientes símbolos: - | Comparación | Símbolo(s) | Comentario | - | ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------ | - | Igual a | =, == | Obtiene los datos coincidentes, admite el comodín (@), no distingue entre mayúsculas de minúsculas ni diacríticas. | - | | ===, IS | Obtiene los datos coincidentes, considera @ como carácter estándar, no distingue entre mayúsculas de minúsculas ni diacríticas | - | Diferente de | #, != | Soporta el comodín (@) | - | | !==, IS NOT | Considera la @ como un caracter estándar | - | Menor que | < | | - | Mayor que | > | | - | Menor o igual que | <= | | - | Mayor o igual que | >= | | - | Incluído en | IN | Devuelve los datos iguales a al menos uno de los valores de una colección o de un conjunto de valores, admite el comodín (@) | - | Condición No aplicada a una sentencia | NOT | Los paréntesis son obligatorios cuando se utiliza NOT antes de una instrucción que contiene varios operadores | - | Contiene palabra clave | % | Las palabras claves pueden utilizarse en atributos de tipo texto o imagen | + | Comparación | Símbolo(s) | Comentario | + | ------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Igual a | =, == | Obtiene los datos coincidentes, admite el comodín (@), no distingue entre mayúsculas de minúsculas ni diacríticas. | + | | ===, IS | Obtiene los datos coincidentes, considera @ como carácter estándar, no distingue entre mayúsculas de minúsculas ni diacríticas | + | Diferente de | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considera la @ como un caracter estándar | + | Condición No aplicada a una sentencia | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Menor que | < | | + | Mayor que | > | | + | Menor o igual que | <= | | + | Mayor o igual que | >= | | + | Incluído en | IN | Devuelve los datos iguales a al menos uno de los valores de una colección o de un conjunto de valores, admite el comodín (@) | + | Contiene palabra clave | % | Las palabras claves pueden utilizarse en atributos de tipo texto o imagen | * **value**: el valor a comparar con el valor actual de la propiedad de cada entidad en la selección de entidades o elemento en la colección. Puede ser un **marcador** (ver **Uso de marcadores** más adelante) o cualquier expresión que coincida con la propiedad de tipo de datos. Al utilizar un valor constante, deben respetarse las siguientes reglas: * La constante de tipo **texto** puede pasarse con o sin comillas simples (ver **Uso de comillas** más abajo). Para consultar una cadena dentro de otra cadena (una consulta de tipo "contiene"), utilice el símbolo de comodín (@) en el valor para aislar la cadena a buscar como se muestra en este ejemplo: "@Smith@". Las siguientes palabras claves están prohibidas para las constantes de texto: true, false. @@ -909,40 +909,40 @@ donde: * **order by attributePath**: puede incluir una declaración order by *attributePath* en la búsqueda para que los datos resultantes se ordenen de acuerdo con esa declaración. Puede utilizar varias instrucciones de ordenación, separadas por comas (por ejemplo, ordenación por *attributePath1* desc, *attributePath2* asc). Por defecto, el orden es ascendente. Pase 'desc' para definir un orden descendente y 'asc' para definir un orden ascendente. >Si utiliza esta instrucción, la selección de entidades devuelta es ordenada (para más información, consulte [>Selecciones de entidades ordenadas y no ordenadas](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Utilizar comillas** +#### Using quotes -Cuando utilice comillas dentro de las consultas, debe utilizar comillas simples ' ' dentro de la consulta y comillas dobles " " para encerrar toda la consulta, de lo contrario se devuelve un error. Por ejemplo: +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Por ejemplo: ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Las comillas simples (') no se admiten en los valores buscados, ya que romperían la cadena de búsqueda. Por ejemplo, "comp.name = 'John's pizza' " generará un error. Si necesita buscar en valores con comillas simples, puede considerar el uso de marcadores de posición (ver más abajo). -**Uso del paréntesis** +#### Using parenthesis -Puede utilizar paréntesis en la búsqueda para dar prioridad al cálculo. Por ejemplo, puede organizar una búsqueda de la siguiente manera: +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Uso de marcadores de posición** +#### Using placeholders -4D le permite utilizar marcadores para los argumentos *attributePath*, *formula* y *value* dentro del parámetro *queryString*. Un marcador es un parámetro que se inserta en las cadenas de búsqueda y que se sustituye por otro valor cuando se evalúa la cadena de búsqueda consulta. El valor de los marcadores se evalúa una vez al principio de la búsqueda; no se evalúa para cada elemento. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Se pueden utilizar dos tipos de marcadores: **indexed placeholders** y los **named placeholders**: +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | | Marcadores de posición indexados | Nombre del marcador de posición | | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Definición | Los parámetros se insertan como `:paramIndex` (por ejemplo :1, :2...) en *queryString* y sus valores correspondientes son suministrados por la secuencia de parámetros *value*. Puede utilizar hasta 128 parámetros *valor* | Los parámetros se insertan como`: paramName` (por ejemplo :myparam) y sus valores se proporcionan en los atributos y/o objetos de parámetros en el parámetro *querySettings* | | Ejemplo | `$r:=class.query(":1=:2";"city";"Chicago")` | `$o.attributes:=New object("att";"city")`
`$o.parameters:=New object("name";"Chicago")`
`$r:=class.query(":att=:name";$o)` | -Puede mezclar todos los tipos de argumentos en *queryString*. Una *queryString* puede contener, para los parámetros *attributePath*, *formula* y *value*: +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * valores directos (sin marcadores), * marcadores indexados y/o con nombre. -El uso de marcadores de posición en las búsquedas **se recomienda** por las siguientes razones: +Using placeholders in queries **is recommended** for the following reasons: 1. Evita la inserción de código malicioso: si utiliza directamente variables completadas por el usuario dentro de la cadena de búsqueda, un usuario podría modificar las condiciones de búsqueda introduciendo argumentos de búsqueda adicionales. Por ejemplo, imagine una cadena de búsqueda como: @@ -951,50 +951,105 @@ El uso de marcadores de posición en las búsquedas **se recomienda** por las si $result:=$col.query($vquery) ``` - Esta búsqueda parece segura ya que se filtran los datos no públicos. Sin embargo, si el usuario introduce en el área *myname* algo como *"smith OR status='private'*, la cadena de búsqueda se modificaría en la etapa de la interpretación y podría devolver datos privados. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Cuando se utilizan marcadores de posición, no es posible anular las condiciones de seguridad: + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - En este caso, si el usuario introduce *smith OR status='private'* en el área *myname*, no se interpretará en la cadena de búsqueda, sino que sólo se pasará como valor. La búsqueda de una persona llamada "smith OR status='private'" simplemente fallará. + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Evita tener que preocuparse por cuestiones de formato o caracteres, especialmente cuando se manejan los parámetros *attributePath* o *value* que pueden contener caracteres no alfanuméricos como ".", "['... 3. Permite el uso de variables o expresiones en los argumentos de búsqueda. Ejemplos: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Búsqueda de valores null** +#### Looking for null values -Cuando se buscan valores null, no se puede utilizar la sintaxis de marcador de posición porque el motor de búsqueda considera null como un valor de comparación invalido. Por ejemplo, si ejecuta la siguiente búsqueda: +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // NO funcionará ``` -No obtendrá el resultado esperado porque el valor null será evaluado por 4D como un error resultante de la evaluación del parámetro (por ejemplo, un atributo procedente de otra búsqueda). Para este tipo de búsquedas, debe utilizar la sintaxis de búsqueda directa: +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds.Person.query("spouse = null") // Sintaxis correcta ``` -**Vinculación de los argumentos de búsqueda y los atributos de colección** +#### Not equal to in collections -| +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. -Esta funcionalidad sólo está disponible en las búsquedas en clases de datos y en las [selecciones de entidades](EntitySelectionClass.md#query). No se puede utilizar en las búsquedas en [colecciones](CollectionClass.md#query). + +#### Linking collection attribute query arguments + +:::info + +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. When searching in collections within object attributes using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Por ejemplo, con las dos entidades siguientes: +For example, with the following two entities: ``` Entity 1: @@ -1017,35 +1072,35 @@ ds. People.places: } ] } ``` -Quiere encontrar personas con un tipo de ubicación "home" en la ciudad "paris". Si escribe: +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... la búsqueda devolverá "martin" **y** "smith" porque "smith" tiene un elemento "locations" cuyo "tipo" es "home" y un elemento "locations" cuya "ciudad" es "paris", aunque sean elementos diferentes. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Si quiere obtener sólo las entidades en las que los argumentos correspondientes están en el mismo elemento de colección, necesita **enlazar los argumentos**. Para enlazar los argumentos de búsqueda: +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Añada una letra entre los \[] en la primera ruta a enlazar y repita la misma letra en todos los argumentos enlazados. Por ejemplo: `locations[a].city and locations[a].kind`. Puede utilizar cualquier letra del alfabeto latino (no diferencia entre mayúsculas y minúsculas). * Para añadir diferentes criterios vinculados en la misma consulta, utilice otra letra. Puede crear hasta 26 combinaciones de criterios en una sola consulta. -Con las entidades anteriores, si escribe: +With the above entities, if you write: ```4d ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... la búsqueda sólo devolverá "martin" porque tiene un elemento "locations" cuyo "kind" es "home" y cuyo "city" es "paris". La búsqueda no devolverá "smith" porque los valores "home" y "paris" no están en el mismo elemento de colección. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Búsquedas en las relaciones Muchos a Muchos** +#### Queries in many-to-many relations -ORDA ofrece una sintaxis especial para facilitar las consultas en las relaciones de muchos a muchos. En este contexto, puede ser necesario buscar diferentes valores con un operador `AND` PERO en el mismo atributo. Por ejemplo, de una mirada a la siguiente estructura: +ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: ![alt-text](../assets/en/API/manytomany.png) -Imagine que quiere buscar todas las películas en las que un actor A *y* un actor B tienen un papel. Si escribe una búsqueda simple utilizando un operador `AND`, no funcionará: +Imagine that you want to search all movies in which *both* actor A and actor B have a role. If you write a simple query using an `AND` operator, it will not work: ```4d // código inválido @@ -1053,17 +1108,17 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";"H // $es está vacía ``` -Básicamente, el problema está relacionado con la lógica interna de la búsqueda: no se puede buscar un atributo cuyo valor sea tanto "A" como "B". +Basically, the issue is related to the internal logic of the query: you cannot search for an attribute whose value would be both "A" and "B". -Para poder realizar este tipo de búsqueda, ORDA permite una sintaxis especial: basta con añadir un *class index* entre **{}** en todos los atributos relacionales adicionales utilizados en la cadena: +To make it possible to perform such queries, ORDA allows a special syntax: you just need to add a *class index* between **{}** in all additional relation attributes used in the string: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** indica a ORDA que cree otra referencia para el atributo relacional. A continuación, realizará todas las operaciones de mapa de bits internas necesarias. Tenga en cuenta que **x** puede ser todo número **excepto 0**: {1}, o {2}, o {1540}... ORDA sólo necesita una referencia única en la búsqueda para cada class index. +**{x}** tells ORDA to create another reference for the relation attribute. It will then perform all the necessary bitmap operations internally. Note that **x** can be any number **except 0**: {1}, or {2}, or {1540}... ORDA only needs a unique reference in the query for each class index. -En nuestro ejemplo, sería: +In our example, it would be: ```4d // código válido @@ -1071,38 +1126,40 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es contient des films (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**parámetro formula** -Como alternativa a la inserción de fórmulas dentro del parámetro *queryString* (ver arriba), puede pasar directamente un objeto fórmula como criterio de búsqueda booleano. La utilización de un objeto fórmula para las búsquedas es **recomendada** ya que se beneficia de la tokenización, y el código es más fácil de buscar/leer. -La fórmula debe haber sido creada utilizando los comandos [`Formula`](FunctionClass.md#formula) o [`Formula from string`](FunctionClass.md#formula-from-string). En este caso: +#### formula parameter + +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. + +La fórmula debe haber sido creada utilizando los comandos [`Formula`](FunctionClass.md#formula) o [`Formula from string`](FunctionClass.md#formula-from-string). In this case: * *fórmula* se evalúa para cada entidad y debe devolver true o false. Durante la ejecución de la búsqueda, si el resultado de la fórmula no es un booleano, se considera como false. * dentro de la *fórmula*, la entidad está disponible a través del objeto `This`. * si el objeto `Formula` es **null**, se genera el error 1626 ("Esperando un texto o una fórmula"), que llama a interceptar utilizando un método instalado con `ON ERR CALL`. > Por razones de seguridad, las llamadas a fórmulas dentro de las funciones `query()` pueden ser desestimadas. Ver la descripción del parámetro *querySettings*. -**Pasar parámetros a las fórmulas** +#### Passing parameters to formulas -Todo parámetro *formula* llamado por la función `query()` puede recibir parámetros: +Any *formula* called by the `query()` class function can receive parameters: * Los parámetros deben pasarse a través de la propiedad **args** (objeto) del parámetro *querySettings*. * La fórmula recibe este objeto **args** como parámetro **$1**. -Este pequeño código muestra los principios de cómo se pasan los parámetros a los métodos: +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //objeto args a pasar los parámetros $es:=ds.Students.query("eval(checkName($1.exclude))";$settings) //args se recibe en $1 ``` -En el ejemplo 3 se ofrecen más ejemplos. +Additional examples are provided in example 3. -**4D Server**: en cliente/servidor, las fórmulas se ejecutan en el servidor. En este contexto, sólo se envía a las fórmulas el objeto `querySettings.args`. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**Parámetro querySettings** +#### querySettings parameter -En el parámetro *querySettings* se puede pasar un objeto que contenga opciones adicionales. Se soportan las siguientes propiedades: +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propiedad | Tipo | Descripción | | ------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1114,11 +1171,11 @@ En el parámetro *querySettings* se puede pasar un objeto que contenga opciones | queryPlan | Boolean | En la entity selection resultante, devuelve o no la descripción detallada de la búsqueda justo antes de que se ejecute, es decir, la búsqueda planificada. La propiedad devuelta es un objeto que incluye cada búsqueda y sub búsqueda prevista (en el caso de una búsqueda compleja). Esta opción es útil durante la fase de desarrollo de una aplicación. Suele utilizarse junto con queryPath. Por defecto si se omite: false. **Nota**: esta propiedad sólo la soportan las funciones `entitySelection.query()` y `dataClass.query()`. | | queryPath | Boolean | En la entity selection resultante, devuelve o no la descripción detallada de la búsqueda tal cual es realizada. La propiedad devuelta es un objeto que contiene la ruta utilizada para la búsqueda (normalmente idéntica a la de queryPlan, pero puede diferir si el motor consigue optimizar la búsqueda), así como el tiempo de procesamiento y el número de registros encontrados. Esta opción es útil durante la fase de desarrollo de una aplicación. Por defecto si se omite: false. **Nota**: esta propiedad sólo la soportan las funciones `entitySelection.query()` y `dataClass.query()`. | -**Sobre queryPlan y queryPath** +#### About queryPlan and queryPath -La información registrada en `queryPlan`/`queryPath` incluye el tipo de búsqueda (indexada y secuencial) y cada subconsulta necesaria junto con los operadores de conjunción. Las rutas de acceso de las peticiones también contienen el número de entidades encontradas y el tiempo necesario para ejecutar cada criterio de búsqueda. Las rutas de acceso de las peticiones también contienen el número de entidades encontradas y el tiempo necesario para ejecutar cada criterio de búsqueda. Generalmente, la descripción del plan de consulta y su ruta de acceso son idénticas, pero pueden diferir porque 4D puede implementar optimizaciones dinámicas cuando se ejecuta una consulta para mejorar el rendimiento. Por ejemplo, el motor 4D puede convertir dinámicamente una consulta indexada en una secuencial si estima que es más rápida. Este caso concreto puede darse cuando el número de entidades que se buscan es bajo. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Por ejemplo, si ejecuta la siguiente búsqueda: +For example, if you execute the following query: ```4d $sel:=ds.Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ @@ -1147,46 +1204,46 @@ queryPath: #### Ejemplo 1 -Esta sección ofrece varios ejemplos de búsquedas. +This section provides various examples of queries. -Consultas en una cadena: +Query on a string: ```4d $entitySelection:=ds.Customer.query("firstName = 'S@'") ``` -Búsqueda con una instrucción NOT: +Query with a NOT statement: ```4d $entitySelection:=ds.Employee.query("not(firstName=Kim)") ``` -Búsquedas con fechas: +Queries with dates: ```4d $entitySelection:=ds.Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds.Employee.query("birthDate <= :1";Current date-10950) ``` -Búsqueda con marcadores de posición indexados para los valores: +Query with indexed placeholders for values: ```4d $entitySelection:=ds.Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Búsqueda con marcadores de posición indexados para valores en una dataclass relacionada: +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds.Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Búsqueda con marcador de posición indexado que incluye una instrucción de orden descendente: +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds.Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Búsqueda con marcadores de posición con nombre para los valores: +Query with named placeholders for values: ```4d var $querySettings : Object @@ -1196,7 +1253,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Búsqueda que utiliza marcadores de posición con nombre e indexados para los valores: +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -1205,7 +1262,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Búsqueda con objetos queryPlan y queryPath: +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds.Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -1216,19 +1273,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Búsqueda con una ruta de atributo de tipo Collection: +Query with an attribute path of Collection type: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Búsqueda con una ruta de atributos de tipo Collection y atributos vinculados: +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Búsqueda con una ruta de atributos de tipo Collection y múltiples atributos vinculados: +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1236,25 +1293,25 @@ $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Búsqueda con una ruta de atributo de tipo Objeto: +Query with an attribute path of Object type: ```4d $entitySelection:=ds.Employee.query("extra.eyeColor = :1";"blue") ``` -Búsqueda con una instrucción IN: +Query with an IN statement: ```4d $entitySelection:=ds.Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Búsqueda con instrucción NOT (IN): +Query with a NOT (IN) statement: ```4d $entitySelection:=ds.Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Búsqueda con marcadores de posición indexados para los atributos: +Query with indexed placeholders for attributes: ```4d var $es : cs.EmployeeSelection @@ -1262,7 +1319,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") //salesperson es una entidad relacionada ``` -Búsqueda con marcadores de posición indexados para los atributos y marcadores de posición con nombre para los valores: +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs.EmployeeSelection @@ -1273,7 +1330,7 @@ $es:=ds.Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId";" //salesperson es una entidad relacionada ``` -Búsqueda con marcadores de posición indexados para los atributos y los valores: +Query with indexed placeholders for attributes and values: ```4d var $es : cs.EmployeeSelection @@ -1283,11 +1340,11 @@ $es:=ds.Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smith #### Ejemplo 2 -Esta sección ilustra las búsquedas con marcadores de posición con nombre para los atributos. +This section illustrates queries with named placeholders for attributes. -Dada una dataclass Employee con 2 entidades: +Given an Employee dataclass with 2 entities: -Entidad 1: +Entity 1: ```4d name: "Marie" @@ -1299,7 +1356,7 @@ softwares:{ } ``` -Entidad 2: +Entity 2: ```4d name: "Sophie" @@ -1311,7 +1368,7 @@ softwares:{ } ``` -Búsqueda con marcadores de posición con nombre para los atributos: +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1322,7 +1379,7 @@ Búsqueda con marcadores de posición con nombre para los atributos: //$es.length=1 (Employee Marie) ``` -Búsqueda con marcadores de posición con nombre para los atributos y los valores: +Query with named placeholders for attributes and values: ```4d @@ -1343,16 +1400,16 @@ Búsqueda con marcadores de posición con nombre para los atributos y los valore #### Ejemplo 3 -Estos ejemplos ilustran las distintas formas de utilizar fórmulas con o sin parámetros en sus búsquedas. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -La fórmula se da como texto con `eval()` en el parámetro *queryString*: +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs.StudentsSelection $es:=ds.Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -La fórmula se da como un objeto `Formula` a través de un marcador de posición: +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs.StudentsSelection @@ -1361,7 +1418,7 @@ La fórmula se da como un objeto `Formula` a través de un marcador de posición $es:=ds.Students.query(":1 and nationality='French'";$formula) ``` -Sólo se da como criterio un objeto `Formula`: +Only a `Formula` object is given as criteria: ```4d var $es : cs.StudentsSelection @@ -1370,7 +1427,7 @@ Sólo se da como criterio un objeto `Formula`: $es:=ds.Students.query($formula) ``` -Se pueden aplicar varias fórmulas: +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1379,7 +1436,7 @@ Se pueden aplicar varias fórmulas: $0:=ds.Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Una fórmula texto en *queryString* recibe un parámetro: +A text formula in *queryString* receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1395,7 +1452,7 @@ Una fórmula texto en *queryString* recibe un parámetro: $result:=(Position($exclude;This.lastname)=0) ``` -Utilizando el mismo método ***checkName***, un objeto `Formula` como marcador de posición recibe un parámetro: +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1408,7 +1465,7 @@ Utilizando el mismo método ***checkName***, un objeto `Formula` como marcador d $es:=ds.Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su consulta: +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs.StudentsSelection @@ -1423,7 +1480,7 @@ Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su #### Ver también -[`.query()`](EntitySelectionClass.md#query) para selecciones de entidades +[`.query()`](EntitySelectionClass.md#query) for entity selections @@ -1437,13 +1494,13 @@ Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su -**.setRemoteCacheSettings**(*settings*: Object) +**.setRemoteCacheSettings**(*settings* : Object) -| Parámetros | Tipo | | Descripción | -| ---------- | ------ | -- | ----------------------------------------------------------------------------------------------------------------------- | -| settings | Object | -> | Objeto que define el tiempo de espera y el tamaño máximo de la caché ORDA para el dataclass.| +| Parámetros | Tipo | | Descripción | +| ---------- | ------ | -- | ------------------------------------------------------------------------------------------------------------- | +| settings | Object | -> | Object that sets the timeout and maximum size of the ORDA cache for the dataclass.| | @@ -1451,30 +1508,30 @@ Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su #### Descripción -La función `.setRemoteCacheSettings()` define el tiempo de espera y el tamaño máximo de la caché ORDA para una clase de datos.. +The `.setRemoteCacheSettings()` function sets the timeout and maximum size of the ORDA cache for a dataclass.. -En el parámetro *settings*, pase un objeto con las siguientes propiedades: +In the *settings* parameter, pass an object with the following properties: | Propiedad | Tipo | Descripción | | ---------- | ------- | ----------------------------- | | timeout | Integer | Tiempo de espera en segundos. | | maxEntries | Integer | Número máximo de entidades. | -`timeout` define el tiempo de espera de la caché ORDA para la dataclass (por defecto es 30 segundos). Una vez transcurrido el tiempo de espera, las entidades de la dataclass en la caché son consideradas como vencidas. Esto significa que: +`timeout` sets the timeout of the ORDA cache for the dataclass (default is 30 seconds). Once the timeout has passed, the entities of the dataclass in the cache are considered as expired. This means that: * los datos siguen estando ahí * la próxima vez que se necesiten los datos, se le pedirán al servidor * 4D elimina automáticamente los datos caducados cuando se alcanza el número máximo de entidades -Definir la propiedad `timeout` define un nuevo timeout para las entidades ya presentes en la caché. Es útil cuando se trabaja con los datos que no cambian con mucha frecuencia y, por tanto, cuando no son necesarias nuevas peticiones al servidor. +Setting a `timeout` property sets a new timeout for the entities already present in the cache. It is useful when working with data that does not change very frequently, and thus when new requests to the server are not necessary. -`maxEntries` define el número máximo de entidades en la caché ORDA. Por defecto es 30 000. +`maxEntries` sets the max number of entities in the ORDA cache. Default is 30 000. -El número de entradas mínimo es 300, por lo que el valor de `maxEntries` debe ser igual o superior a 300. En caso contrario, se ignora y el número máximo de entradas se fija en 300. +The minimum number of entries is 300, so the value of `maxEntries` must be equal to or higher than 300. Otherwise it is ignored and the maximum number of entries is set to 300. -Si no se pasan propiedades válidas como `timeout` y `maxEntries`, la caché permanece sin cambios, con sus valores por defecto o previamente definidos. +If no valid properties are passed as `timeout` and `maxEntries`, the cache remains unchanged, with its default or previously set values. -Cuando se guarda una entidad, se actualiza en la caché y vence una vez alcanzado el timeout. +When an entity is saved, it is updated in the cache and expires once the timeout is reached. #### Ejemplo From 7d06630240bd1d9543f6ff9e36cb1b4bae9a2a47 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:15:56 +0200 Subject: [PATCH 024/180] New translations DataStoreClass.md (Spanish) --- .../current/API/DataStoreClass.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/API/DataStoreClass.md b/i18n/es/docusaurus-plugin-content-docs/current/API/DataStoreClass.md index 547d5c1b313c4c..5870ebd9d69d5a 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/API/DataStoreClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/API/DataStoreClass.md @@ -411,7 +411,7 @@ Quiere saber el número de tablas encriptadas en el archivo de datos actual: La función `.flushAndLock()` vacía la caché del datastore local e impide que los otros procesos realicen operaciones de escritura en la base de datos. El datastore se pone en un estado consistente y congelado. Es necesario llamar a esta función antes de ejecutar una instantánea de la aplicación, por ejemplo. -| +:::info Esta función sólo puede llamarse: @@ -1086,7 +1086,7 @@ End case La función `.startRequestLog()` inicia el registro de peticiones ORDA del lado del cliente o del lado del servidor. Está diseñado para fines de depuración en configuraciones cliente/servidor. -| +:::info Para una descripción del formato del registro de peticiones ORDA, consulte la sección [**Peticiones ORDA**](../Debugging/debugLogFiles.md#orda-requests). From b5367ca1373053902f4af87438990a77d90e16b0 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:16:02 +0200 Subject: [PATCH 025/180] New translations EntityClass.md (Spanish) --- .../docusaurus-plugin-content-docs/current/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/API/EntityClass.md b/i18n/es/docusaurus-plugin-content-docs/current/API/EntityClass.md index 49e7107cb280cc..b9d214a662f7cd 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/API/EntityClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/API/EntityClass.md @@ -1700,7 +1700,7 @@ Si no se ha tocado ningún atributo de entidad, el método devuelve una colecci //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -En este caso: +In this case: * firstName y lastName tienen un tipo `storage` * employer tiene un tipo `relatedEntity` From 07aae7238949996fd542ec55f96777145ce0e453 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:16:11 +0200 Subject: [PATCH 026/180] New translations IMAPTransporterClass.md (Spanish) --- .../current/API/IMAPTransporterClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md b/i18n/es/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md index 680d38d6888fb7..ffc4d0df1595a6 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/API/IMAPTransporterClass.md @@ -1714,7 +1714,7 @@ El objeto `boxInfo` devuelto contiene las siguientes propiedades: | flags | text | Lista de banderas utilizadas actualmente para el buzón, separadas por espacios | | permanentFlags | text | Lista de banderas que el cliente puede cambiar permanentemente (excepto el indicador \Recent, que gestiona el servidor IMAP), separados por espacios | -| +:::info Si la cadena `permanentFlags` incluye la bandera especial \*, significa que el servidor soporta [banderas personalizadas](#addflags). From eb6d081bf0213c3b0f31ab84bab7b2d852b96425 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:16:16 +0200 Subject: [PATCH 027/180] New translations SessionClass.md (Spanish) --- .../docusaurus-plugin-content-docs/current/API/SessionClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e5f8f46b9b14de..a98bc3781ce497 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/API/SessionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/API/SessionClass.md @@ -324,7 +324,7 @@ La función `.setPrivileges()` c En *rangeObj*, pase el rango que quiere nombrar, y pase el nuevo nombre del rango en *name*. Si el nombre ya se utiliza en el mismo alcance, el nuevo rango nombrado sustituye al existente. Tenga en cuenta que puede utilizar el mismo nombre para diferentes alcances (ver más adelante). -Puede pasar un objeto con las propiedades adicionales para el rango nombrado en *options*. Se soportan las siguientes propiedades: +Puede pasar un objeto con las propiedades adicionales para el rango nombrado en *options*. The following properties are supported: | Propiedad | Tipo | Descripción | | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1159,7 +1159,7 @@ En el parámetro *rangeObj*, pase un objeto que contenga un rango a buscar. El parámetro *searchValue* permite pasar el texto a buscar dentro del *rangeObj*. -Puede pasar el parámetro opcional *searchCondition* para especificar el funcionamiento de la búsqueda. Se soportan las siguientes propiedades: +Puede pasar el parámetro opcional *searchCondition* para especificar el funcionamiento de la búsqueda. The following properties are supported: | Propiedad | Tipo | Descripción | | ----------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -3484,7 +3484,7 @@ VP NEW DOCUMENT("myVPArea") El comando `VP Object to font` devuelve una cadena de caracteres de *fontObj*. -En *fontObj*, pase un objeto que contenga las propiedades de fuente. Se soportan las siguientes propiedades: +En *fontObj*, pase un objeto que contenga las propiedades de fuente. The following properties are supported: | Propiedad | Tipo | Descripción | Valores posibles | Obligatorio | | --------- | ---- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | From a42d114a4f11ca97b1669ded1761184249a42b40 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:32:44 +0200 Subject: [PATCH 046/180] New translations overview.md (Spanish) --- .../current/code-editor/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/code-editor/overview.md b/i18n/es/docusaurus-plugin-content-docs/current/code-editor/overview.md index 1c2bc2a62d9d38..39109bb721163c 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/code-editor/overview.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/code-editor/overview.md @@ -82,7 +82,7 @@ Con 4D Server, el nombre del método se cambia en el servidor cuando se termina ::: -| +:::info Los métodos base no pueden ser renombrados. Lo mismo ocurre con los triggers, los métodos formulario y los métodos objeto, que están vinculados a los objetos y toman sus nombre del objeto en cuestión. From 4193193df8b7cb0b307911941b026df351bd69c1 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:32:46 +0200 Subject: [PATCH 047/180] New translations write-class-method.md (Spanish) --- .../current/code-editor/write-class-method.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/code-editor/write-class-method.md b/i18n/es/docusaurus-plugin-content-docs/current/code-editor/write-class-method.md index c1c82b6165f0a5..b2df0b7b5ac561 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/code-editor/write-class-method.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/code-editor/write-class-method.md @@ -614,7 +614,7 @@ Los marcadores se gestionan utilizando el submenú **Marcadores** del menú **M - **Eliminar todo**: elimina todos los marcadores de la ventana en primer plano. - **Ir al siguiente** / **Ir al anterior**: permite navegar entre los marcadores de la ventana. Al seleccionar uno de estos comandos, el cursor se sitúa en el primer caracter de la línea asociada al marcador en cuestión. También puede utilizar los atajos de teclado **F3** (ir a la siguiente) o **Mayús+F3** (ir a la anterior). -| +:::info Puede utilizar marcadores como señalizadores de líneas que contengan un elemento [encontrado mediante una búsqueda](#find). En este caso, 4D añade automáticamente los marcadores. Para más información, consulte [Marcar todos](#bookmark-all). From 7d9526302466e9876870663c251b4a6b10d0588f Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:34:05 +0200 Subject: [PATCH 048/180] New translations properties_Text.md (Spanish) --- .../version-18/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md b/i18n/es/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md index 7774300b39832a..649ff101331fcb 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md @@ -276,7 +276,7 @@ Esta propiedad también puede ser manejada por los comandos [OBJECT Get vertical `List box de tipo colección o entity selection (selección de entidades)` -Indica una expresión o una variable que se evaluará para cada línea mostrada. Permite definir todo un conjunto de atributos texto de las líneas. Debe pasar una **variable objeto** o una **expresión que devuelva un objeto**. Se soportan las siguientes propiedades: +Indica una expresión o una variable que se evaluará para cada línea mostrada. Permite definir todo un conjunto de atributos texto de las líneas. Debe pasar una **variable objeto** o una **expresión que devuelva un objeto**. The following properties are supported: | Nombre de propiedad | Tipo | Descripción | | --------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 2cca055f308d1cd5ca3700d8f960244f4d86916c Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:34:59 +0200 Subject: [PATCH 049/180] New translations genInfo.md (Spanish) --- .../docusaurus-plugin-content-docs/version-18/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-18/REST/genInfo.md b/i18n/es/docusaurus-plugin-content-docs/version-18/REST/genInfo.md index de46a70e9cf13a..6bbf6917846c6f 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-18/REST/genInfo.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-18/REST/genInfo.md @@ -33,4 +33,4 @@ Estas propiedades son objetos que contienen información sobre cómo el servidor - **queryPlan**: objeto que contiene la descripción detallada de la petición justo antes de ser ejecutada (es decir, la consulta planificada). - **queryPath**: objeto que contiene la descripción detallada de la consulta tal y como se ha realizado realmente. -La información registrada incluye el tipo de consulta (indexada y secuencial) y cada subconsulta necesaria junto con los operadores de conjunción. Las rutas de acceso de las peticiones también contienen el número de entidades encontradas y el tiempo necesario para ejecutar cada criterio de búsqueda. Query paths also contain the number of entities found and the time required to execute each search criterion. Generalmente, la descripción del plan de consulta y su ruta de acceso son idénticas, pero pueden diferir porque 4D puede implementar optimizaciones dinámicas cuando se ejecuta una consulta para mejorar el rendimiento. Por ejemplo, el motor 4D puede convertir dinámicamente una consulta indexada en una secuencial si estima que es más rápida. Este caso concreto puede darse cuando el número de entidades que se buscan es bajo. \ No newline at end of file +La información registrada incluye el tipo de consulta (indexada y secuencial) y cada subconsulta necesaria junto con los operadores de conjunción. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From cb336fd54228a5ab30c0c99869b58318f05175fb Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:39:33 +0200 Subject: [PATCH 050/180] New translations DataClassClass.md (Spanish) --- .../version-19/API/DataClassClass.md | 203 +++++++++++------- 1 file changed, 130 insertions(+), 73 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md b/i18n/es/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md index 5997abe0f91915..d8c6ed1561a75e 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md @@ -481,8 +481,10 @@ El método de proyecto ***SearchDuplicate*** busca valores duplicados en cualqui | ---------- | ------ | -- | -------------------------------------------------------------- | | Result | Object | <- | Información sobre la clase de datos| + | + #### Descripción La función `.getInfo( )` devuelve un objeto que ofrece información sobre la clase de datos. Esta función es útil para configurar el código genérico. @@ -650,7 +652,7 @@ La función `.query( )` busca entida Si no se encuentran entidades coincidentes, se devuelve una `EntitySelection` vacía. -**parámetro queryString** +**queryString parameter** El parámetro *queryString* utiliza la siguiente sintaxis: @@ -660,7 +662,7 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -donde: +where: * **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. Each value is a path that can designate either a scalar or a related attribute of the dataclass or a property in an object field of the dataclass También puede utilizar un **marcador** (ver más abajo). > *No puede utilizar directamente atributos cuyo nombre contenga caracteres especiales como ".", "\[ ]", o "=", ">", "#"..., porque se evaluarán incorrectamente en la cadena de consulta. Si necesita consultar dichos atributos, debe considerar el uso de marcadores, que permiten un rango ampliado de caracteres en las rutas de los atributos (ver* **Uso de marcadores de posición** *a continuación).* @@ -708,35 +710,35 @@ donde: * **order by attributePath**: puede incluir una declaración order by *attributePath* en la búsqueda para que los datos resultantes se ordenen de acuerdo con esa declaración. Puede utilizar varias instrucciones de ordenación, separadas por comas (por ejemplo, ordenación por *attributePath1* desc, *attributePath2* asc). Por defecto, el orden es ascendente. Pase 'desc' para definir un orden descendente y 'asc' para definir un orden ascendente. > > *If you use this statement, the returned entity selection is ordered (for more information, please refer to [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Utilizar comillas** +**Using quotes** -Cuando utilice comillas dentro de las consultas, debe utilizar comillas simples ' ' dentro de la consulta y comillas dobles " " para encerrar toda la consulta, de lo contrario se devuelve un error. Por ejemplo: +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Por ejemplo: ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Las comillas simples (') no se admiten en los valores buscados, ya que romperían la cadena de búsqueda. Por ejemplo, "comp.name = 'John's pizza' " generará un error. Si necesita buscar en valores con comillas simples, puede considerar el uso de marcadores de posición (ver más abajo). -**Uso del paréntesis** +**Using parenthesis** -Puede utilizar paréntesis en la búsqueda para dar prioridad al cálculo. Por ejemplo, puede organizar una búsqueda de la siguiente manera: +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Uso de marcadores de posición** +**Using placeholders** -4D le permite utilizar marcadores para los argumentos *attributePath*, *formula* y *value* dentro del parámetro *queryString*. Un marcador es un parámetro que se inserta en las cadenas de búsqueda y que se sustituye por otro valor cuando se evalúa la cadena de búsqueda consulta. El valor de los marcadores se evalúa una vez al principio de la búsqueda; no se evalúa para cada elemento. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Se pueden utilizar dos tipos de marcadores: **indexed placeholders** y los **named placeholders**: +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | - | Marcadores de posición indexados | Nombre del marcador de posición | | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Definición | Los parámetros se insertan como :paramIndex (por ejemplo :1, :2...) en queryString y sus valores correspondientes son suministrados por la secuencia de parámetros value. Puede utilizar hasta 128 parámetros de valor | Los parámetros se insertan como: paramName (por ejemplo :myparam) y sus valores se proporcionan en los atributos y/o objetos de parámetros en el parámetro querySettings | | Ejemplo | $r:=class.query(":1=:2";"city";"Chicago") | $o.attributes:=New object("att";"city")
$o.parameters:=New object("name";"Chicago")
$r:=class.query(":att=:name";$o) | -Puede mezclar todos los tipos de argumentos en *queryString*. Una *queryString* puede contener, para los parámetros *attributePath*, *formula* y *value*: +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * valores directos (sin marcadores), * marcadores indexados y/o con nombre. @@ -750,15 +752,15 @@ Puede mezclar todos los tipos de argumentos en *queryString*. Una *queryString* $result:=$col.query($vquery) ``` - Esta búsqueda parece segura ya que se filtran los datos no públicos. Sin embargo, si el usuario introduce en el área *myname* algo como *"smith OR status='private'*, la cadena de búsqueda se modificaría en la etapa de la interpretación y podría devolver datos privados. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Cuando se utilizan marcadores de posición, no es posible anular las condiciones de seguridad: + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - En este caso, si el usuario introduce *smith OR status='private'* en el área *myname*, no se interpretará en la cadena de búsqueda, sino que sólo se pasará como valor. La búsqueda de una persona llamada "smith OR status='private'" simplemente fallará. + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Evita tener que preocuparse por cuestiones de formato o caracteres, especialmente cuando se manejan los parámetros *attributePath* o *value* que pueden contener caracteres no alfanuméricos como ".", "['... @@ -769,31 +771,86 @@ Puede mezclar todos los tipos de argumentos en *queryString*. Una *queryString* $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Búsqueda de valores null** +**Looking for null values** -Cuando se buscan valores null, no se puede utilizar la sintaxis de marcador de posición porque el motor de búsqueda considera null como un valor de comparación invalido. Por ejemplo, si ejecuta la siguiente búsqueda: +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // NO funcionará ``` -No obtendrá el resultado esperado porque el valor null será evaluado por 4D como un error resultante de la evaluación del parámetro (por ejemplo, un atributo procedente de otra búsqueda). Para este tipo de búsquedas, debe utilizar la sintaxis de búsqueda directa: +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds.Person.query("spouse = null") // Sintaxis correcta ``` -**Vinculación de los argumentos de búsqueda y los atributos de colección** -| +**Not equal to in collections** + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` -Esta funcionalidad sólo está disponible en las búsquedas en clases de datos y en las [selecciones de entidades](EntitySelectionClass.md#query). No se puede utilizar en las búsquedas en [colecciones](CollectionClass.md#query). +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + +**Linking collection attribute query arguments** + +:::info + +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. When searching in collections within object attributes using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Por ejemplo, con las dos entidades siguientes: +For example, with the following two entities: ``` Entity 1: @@ -816,59 +873,59 @@ ds. People.places: } ] } ``` -Quiere encontrar personas con un tipo de ubicación "home" en la ciudad "paris". Si escribe: +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... la búsqueda devolverá "martin" **y** "smith" porque "smith" tiene un elemento "locations" cuyo "tipo" es "home" y un elemento "locations" cuya "ciudad" es "paris", aunque sean elementos diferentes. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Si quiere obtener sólo las entidades en las que los argumentos correspondientes están en el mismo elemento de colección, necesita **enlazar los argumentos**. Para enlazar los argumentos de búsqueda: +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Añada una letra entre los \[] en la primera ruta a enlazar y repita la misma letra en todos los argumentos enlazados. Por ejemplo: `locations[a].city and locations[a].kind`. Puede utilizar cualquier letra del alfabeto latino (no diferencia entre mayúsculas y minúsculas). * Para añadir diferentes criterios vinculados en la misma consulta, utilice otra letra. Puede crear hasta 26 combinaciones de criterios en una sola consulta. -Con las entidades anteriores, si escribe: +With the above entities, if you write: ```4d ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... la búsqueda sólo devolverá "martin" porque tiene un elemento "locations" cuyo "kind" es "home" y cuyo "city" es "paris". La búsqueda no devolverá "smith" porque los valores "home" y "paris" no están en el mismo elemento de colección. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**parámetro formula** +**formula parameter** -Como alternativa a la inserción de fórmulas dentro del parámetro *queryString* (ver arriba), puede pasar directamente un objeto fórmula como criterio de búsqueda booleano. La utilización de un objeto fórmula para las búsquedas es **recomendada** ya que se beneficia de la tokenización, y el código es más fácil de buscar/leer. +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. -La fórmula debe haber sido creada con el comando `Formula` o `Formula from string`. En este caso: +La fórmula debe haber sido creada con el comando `Formula` o `Formula from string`. In this case: * *fórmula* se evalúa para cada entidad y debe devolver true o false. Durante la ejecución de la búsqueda, si el resultado de la fórmula no es un booleano, se considera como false. * dentro de la *fórmula*, la entidad está disponible a través del objeto `This`. * si el objeto `Formula` es **null**, se genera el error 1626 ("Esperando un texto o una fórmula"), que llama a interceptar utilizando un método instalado con `ON ERR CALL`. > > For security reasons, formula calls within `query(`) member methods can be disallowed. Ver la descripción del parámetro *querySettings*. -**Pasar parámetros a las fórmulas** +**Passing parameters to formulas** -Todo parámetro *formula* llamado por la función `query()` puede recibir parámetros: +Any *formula* called by the `query()` class function can receive parameters: * Los parámetros deben pasarse a través de la propiedad **args** (objeto) del parámetro *querySettings*. * La fórmula recibe este objeto **args** como parámetro **$1**. -Este pequeño código muestra los principios de cómo se pasan los parámetros a los métodos: +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //objeto args a pasar los parámetros $es:=ds.Students.query("eval(checkName($1.exclude))";$settings) //args se recibe en $1 ``` -En el ejemplo 3 se ofrecen más ejemplos. +Additional examples are provided in example 3. -**4D Server**: en cliente/servidor, las fórmulas se ejecutan en el servidor. En este contexto, sólo se envía a las fórmulas el objeto `querySettings.args`. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**Parámetro querySettings** +**querySettings parameter** -En el parámetro *querySettings* se puede pasar un objeto que contenga opciones adicionales. Se soportan las siguientes propiedades: +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propiedad | Tipo | Descripción | | ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -880,11 +937,11 @@ En el parámetro *querySettings* se puede pasar un objeto que contenga opciones | queryPlan | Boolean | En la entity selection resultante, devuelve o no la descripción detallada de la búsqueda justo antes de que se ejecute, es decir, la búsqueda planificada. La propiedad devuelta es un objeto que incluye cada búsqueda y sub búsqueda prevista (en el caso de una búsqueda compleja). Esta opción es útil durante la fase de desarrollo de una aplicación. Suele utilizarse junto con queryPath. Por defecto si se omite: false. **Nota**: esta propiedad sólo la soportan las funciones`entitySelection.query( )` y `dataClass.query( )`. | | queryPath | Boolean | En la entity selection resultante, devuelve o no la descripción detallada de la búsqueda tal cual es realizada. La propiedad devuelta es un objeto que contiene la ruta utilizada para la búsqueda (normalmente idéntica a la de queryPlan, pero puede diferir si el motor consigue optimizar la búsqueda), así como el tiempo de procesamiento y el número de registros encontrados. Esta opción es útil durante la fase de desarrollo de una aplicación. Por defecto si se omite: false. **Nota**: esta propiedad sólo la soportan las funciones`entitySelection.query( )` y `dataClass.query( )`. | -**Sobre queryPlan y queryPath** +**About queryPlan and queryPath** -La información registrada en `queryPlan`/`queryPath` incluye el tipo de búsqueda (indexada y secuencial) y cada subconsulta necesaria junto con los operadores de conjunción. Las rutas de acceso de las peticiones también contienen el número de entidades encontradas y el tiempo necesario para ejecutar cada criterio de búsqueda. Las rutas de acceso de las peticiones también contienen el número de entidades encontradas y el tiempo necesario para ejecutar cada criterio de búsqueda. Generalmente, la descripción del plan de consulta y su ruta de acceso son idénticas, pero pueden diferir porque 4D puede implementar optimizaciones dinámicas cuando se ejecuta una consulta para mejorar el rendimiento. Por ejemplo, el motor 4D puede convertir dinámicamente una consulta indexada en una secuencial si estima que es más rápida. Este caso concreto puede darse cuando el número de entidades que se buscan es bajo. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Por ejemplo, si ejecuta la siguiente búsqueda: +For example, if you execute the following query: ```4d $sel:=ds.Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ @@ -913,46 +970,46 @@ queryPath: #### Ejemplo 1 -Esta sección ofrece varios ejemplos de búsquedas. +This section provides various examples of queries. -Consultas en una cadena: +Query on a string: ```4d $entitySelection:=ds.Customer.query("firstName = 'S@'") ``` -Búsqueda con una instrucción NOT: +Query with a NOT statement: ```4d $entitySelection:=ds.Employee.query("not(firstName=Kim)") ``` -Búsquedas con fechas: +Queries with dates: ```4d $entitySelection:=ds.Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds.Employee.query("birthDate <= :1";Current date-10950) ``` -Búsqueda con marcadores de posición indexados para los valores: +Query with indexed placeholders for values: ```4d $entitySelection:=ds.Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Búsqueda con marcadores de posición indexados para valores en una dataclass relacionada: +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds.Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Búsqueda con marcador de posición indexado que incluye una instrucción de orden descendente: +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds.Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Búsqueda con marcadores de posición con nombre para los valores: +Query with named placeholders for values: ```4d var $querySettings : Object @@ -962,7 +1019,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Búsqueda que utiliza marcadores de posición con nombre e indexados para los valores: +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -971,7 +1028,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Búsqueda con objetos queryPlan y queryPath: +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds.Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -982,19 +1039,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Búsqueda con una ruta de atributo de tipo Collection: +Query with an attribute path of Collection type: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Búsqueda con una ruta de atributos de tipo Collection y atributos vinculados: +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Búsqueda con una ruta de atributos de tipo Collection y múltiples atributos vinculados: +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1002,25 +1059,25 @@ $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Búsqueda con una ruta de atributo de tipo Objeto: +Query with an attribute path of Object type: ```4d $entitySelection:=ds.Employee.query("extra.eyeColor = :1";"blue") ``` -Búsqueda con una instrucción IN: +Query with an IN statement: ```4d $entitySelection:=ds.Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Búsqueda con instrucción NOT (IN): +Query with a NOT (IN) statement: ```4d $entitySelection:=ds.Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Búsqueda con marcadores de posición indexados para los atributos: +Query with indexed placeholders for attributes: ```4d var $es : cs.EmployeeSelection @@ -1028,7 +1085,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") //salesperson es una entidad relacionada ``` -Búsqueda con marcadores de posición indexados para los atributos y marcadores de posición con nombre para los valores: +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs.EmployeeSelection @@ -1039,7 +1096,7 @@ $es:=ds.Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId";" //salesperson es una entidad relacionada ``` -Búsqueda con marcadores de posición indexados para los atributos y los valores: +Query with indexed placeholders for attributes and values: ```4d var $es : cs.EmployeeSelection @@ -1049,11 +1106,11 @@ $es:=ds.Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smith #### Ejemplo 2 -Esta sección ilustra las búsquedas con marcadores de posición con nombre para los atributos. +This section illustrates queries with named placeholders for attributes. -Dada una dataclass Employee con 2 entidades: +Given an Employee dataclass with 2 entities: -Entidad 1: +Entity 1: ```4d name: "Marie" @@ -1065,7 +1122,7 @@ softwares:{ } ``` -Entidad 2: +Entity 2: ```4d name: "Sophie" @@ -1077,7 +1134,7 @@ softwares:{ } ``` -Búsqueda con marcadores de posición con nombre para los atributos: +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1088,7 +1145,7 @@ Búsqueda con marcadores de posición con nombre para los atributos: //$es.length=1 (Employee Marie) ``` -Búsqueda con marcadores de posición con nombre para los atributos y los valores: +Query with named placeholders for attributes and values: ```4d var $querySettings : Object @@ -1108,16 +1165,16 @@ Búsqueda con marcadores de posición con nombre para los atributos y los valore #### Ejemplo 3 -Estos ejemplos ilustran las distintas formas de utilizar fórmulas con o sin parámetros en sus búsquedas. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -La fórmula se da como texto con `eval()` en el parámetro *queryString*: +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs.StudentsSelection $es:=ds.Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -La fórmula se da como un objeto `Formula` a través de un marcador de posición: +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs.StudentsSelection @@ -1126,7 +1183,7 @@ La fórmula se da como un objeto `Formula` a través de un marcador de posición $es:=ds.Students.query(":1 and nationality='French'";$formula) ``` -Sólo se da como criterio un objeto `Formula`: +Only a `Formula` object is given as criteria: ```4d var $es : cs.StudentsSelection @@ -1135,7 +1192,7 @@ Sólo se da como criterio un objeto `Formula`: $es:=ds.Students.query($formula) ``` -Se pueden aplicar varias fórmulas: +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1144,7 +1201,7 @@ Se pueden aplicar varias fórmulas: $0:=ds.Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Una fórmula texto en *queryString* recibe un parámetro: +A text formula in *queryString* receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1160,7 +1217,7 @@ Una fórmula texto en *queryString* recibe un parámetro: $result:=(Position($exclude;This.lastname)=0) ``` -Utilizando el mismo método ***checkName***, un objeto `Formula` como marcador de posición recibe un parámetro: +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1173,7 +1230,7 @@ Utilizando el mismo método ***checkName***, un objeto `Formula` como marcador d $es:=ds.Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su consulta: +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs.StudentsSelection @@ -1188,5 +1245,5 @@ Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su #### Ver también -[`.query()`](EntitySelectionClass.md#query) para selecciones de entidades +[`.query()`](EntitySelectionClass.md#query) for entity selections From 897cf6706c17f5cff0be944f71370ff95195eac1 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:39:40 +0200 Subject: [PATCH 051/180] New translations EntityClass.md (Spanish) --- .../version-19/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-19/API/EntityClass.md b/i18n/es/docusaurus-plugin-content-docs/version-19/API/EntityClass.md index 156670b97ac736..edbdd4b4423f43 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-19/API/EntityClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-19/API/EntityClass.md @@ -1625,7 +1625,7 @@ Si no se ha tocado ningún atributo de entidad, el método devuelve una colecci //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -En este caso: +In this case: * firstName y lastName tienen un tipo `storage` * employer tiene un tipo `relatedEntity` From 8b8e5f34519d1f3953c7cabf2d90050e1d02ed5d Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:41:50 +0200 Subject: [PATCH 052/180] New translations dropdownList_Overview.md (Spanish) --- .../version-19/FormObjects/dropdownList_Overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-19/FormObjects/dropdownList_Overview.md b/i18n/es/docusaurus-plugin-content-docs/version-19/FormObjects/dropdownList_Overview.md index b7ce53a757be4d..04dd83944a54ae 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-19/FormObjects/dropdownList_Overview.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-19/FormObjects/dropdownList_Overview.md @@ -147,7 +147,7 @@ Una lista desplegable jerárquica tiene una sublista asociada a cada elemento de Puede asignar la lista de selección jerárquica al objeto de lista desplegable utilizando el campo [Lista de selección](properties_DataSource.md#choice-list) de la Lista de propiedades. -Las listas jerárquicas desplegables se gestionan utilizando los comandos **Listas jerárquicas** del Lenguaje 4D. Todos los comandos que soportan la sintaxis `(*; "name")` pueden utilizarse con listas desplegables jerárquicas, por ejemplo [`Elemento de lista padre`](https://doc.4d.com/4dv19/help/command/en/page633.html). +Las listas jerárquicas desplegables se gestionan utilizando los comandos **Listas jerárquicas** del Lenguaje 4D. Todos los comandos que soportan la sintaxis `(*; "name")` pueden utilizarse con listas desplegables jerárquicas, por ejemplo [`List item parent`](https://doc.4d.com/4dv19/help/command/en/page633.html). ### Utilizar una acción estándar From c7c2c1cc14b4e6db6817964875466c3032eeba7c Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:42:25 +0200 Subject: [PATCH 053/180] New translations properties_Text.md (Spanish) --- .../version-19/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md b/i18n/es/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md index c0a70695a2c5f4..663fe077ec1369 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md @@ -282,7 +282,7 @@ Esta propiedad también puede ser manejada por los comandos [OBJECT Get vertical `List box de tipo colección o entity selection (selección de entidades)` -Indica una expresión o una variable que se evaluará para cada línea mostrada. Permite definir todo un conjunto de atributos texto de las líneas. Debe pasar una **variable objeto** o una **expresión que devuelva un objeto**. Se soportan las siguientes propiedades: +Indica una expresión o una variable que se evaluará para cada línea mostrada. Permite definir todo un conjunto de atributos texto de las líneas. Debe pasar una **variable objeto** o una **expresión que devuelva un objeto**. The following properties are supported: | Nombre de propiedad | Tipo | Descripción | | ------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 3b9c95a77f3d68e12c44d730424ebfbdbb8ca416 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:42:39 +0200 Subject: [PATCH 054/180] New translations Installation.md (Spanish) --- .../version-19/GettingStarted/Installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-19/GettingStarted/Installation.md b/i18n/es/docusaurus-plugin-content-docs/version-19/GettingStarted/Installation.md index 1af38edad49306..4874a392b436fa 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-19/GettingStarted/Installation.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-19/GettingStarted/Installation.md @@ -43,7 +43,7 @@ Despliegue el área **Abrir o crear un proyecto aplicación** y seleccione la ac ¡Disfrute de su experiencia 4D! -| +:::info ¿Necesita activar licencias específicas? Visite la página [Gestión de licencias 4D](../Admin/licenses.md). From cc0d57ee13e75b928307c81fb4f9364da8431457 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:42:43 +0200 Subject: [PATCH 055/180] New translations encrypt.md (Spanish) --- .../es/docusaurus-plugin-content-docs/version-19/MSC/encrypt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-19/MSC/encrypt.md b/i18n/es/docusaurus-plugin-content-docs/version-19/MSC/encrypt.md index deab01454674fc..92650a67c6e6b8 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-19/MSC/encrypt.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-19/MSC/encrypt.md @@ -6,7 +6,7 @@ sidebar_label: Página de cifrado Puede utilizar esta página para cifrar o *descifrar* (es decir, eliminar el cifrado) el archivo de datos, según el estado del atributo **Encriptable** definido para cada tabla de la base. -| +:::info For detailed information about data encryption in 4D, please refer to the [Encrypting data](https://doc.4d.com/4Dv20/4D/20/Encrypting-data.300-6263735.en.html) section in the *Design Reference* manual. También puede leer la entrada del blog [Una mirada más profunda al cifrado de datos en 4D](https://blog.4d.com/a-deeper-look-into-4d-data-encryption/). From 0719e26e2bbec3aa3bbc45147ef04967d5281d12 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:43:36 +0200 Subject: [PATCH 056/180] New translations genInfo.md (Spanish) --- .../docusaurus-plugin-content-docs/version-19/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-19/REST/genInfo.md b/i18n/es/docusaurus-plugin-content-docs/version-19/REST/genInfo.md index de46a70e9cf13a..6bbf6917846c6f 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-19/REST/genInfo.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-19/REST/genInfo.md @@ -33,4 +33,4 @@ Estas propiedades son objetos que contienen información sobre cómo el servidor - **queryPlan**: objeto que contiene la descripción detallada de la petición justo antes de ser ejecutada (es decir, la consulta planificada). - **queryPath**: objeto que contiene la descripción detallada de la consulta tal y como se ha realizado realmente. -La información registrada incluye el tipo de consulta (indexada y secuencial) y cada subconsulta necesaria junto con los operadores de conjunción. Las rutas de acceso de las peticiones también contienen el número de entidades encontradas y el tiempo necesario para ejecutar cada criterio de búsqueda. Query paths also contain the number of entities found and the time required to execute each search criterion. Generalmente, la descripción del plan de consulta y su ruta de acceso son idénticas, pero pueden diferir porque 4D puede implementar optimizaciones dinámicas cuando se ejecuta una consulta para mejorar el rendimiento. Por ejemplo, el motor 4D puede convertir dinámicamente una consulta indexada en una secuencial si estima que es más rápida. Este caso concreto puede darse cuando el número de entidades que se buscan es bajo. \ No newline at end of file +La información registrada incluye el tipo de consulta (indexada y secuencial) y cada subconsulta necesaria junto con los operadores de conjunción. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From e08a02bec1f91aafa496bd9189c26dd87cd49c68 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:52:33 +0200 Subject: [PATCH 057/180] New translations WebSocketConnectionClass.md (Spanish) --- .../current/API/WebSocketConnectionClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/current/API/WebSocketConnectionClass.md b/i18n/es/docusaurus-plugin-content-docs/current/API/WebSocketConnectionClass.md index 97ff7b474e6a35..e8636f0942fd6e 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/API/WebSocketConnectionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/API/WebSocketConnectionClass.md @@ -13,7 +13,7 @@ title: WebSocketConnection La API de la clase `WebSocketConnection` permite gestionar conexiones WebSocket, una vez definidas mediante la clase [`WebSocketServer`](WebSocketServerClass.md). -| +:::info Para obtener una visión general y algunos ejemplos de la implementación del servidor WebSocket en 4D, consulte la clase [`WebSocketServer`](WebSocketServerClass.md). From 58322a14fdd8b640ff5f2550dfdb33fddd622d47 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:52:44 +0200 Subject: [PATCH 058/180] New translations CollectionClass.md (Spanish) --- .../version-20/API/CollectionClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 32fdec4190479b..65e0b89a070ff5 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 @@ -186,7 +186,7 @@ El comando `New shared collection` busca entidad Si no se encuentran entidades coincidentes, se devuelve una `EntitySelection` vacía. -**parámetro queryString** +#### queryString parameter El parámetro *queryString* utiliza la siguiente sintaxis: @@ -861,9 +861,9 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -donde: +where: -* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. Each value is a path that can designate either a scalar or a related attribute of the dataclass or a property in an object field of the dataclass +* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > *No puede utilizar directamente atributos cuyo nombre contenga caracteres especiales como ".", "\[ ]", o "=", ">", "#"..., porque se evaluarán incorrectamente en la cadena de consulta. Si necesita consultar dichos atributos, debe considerar el uso de marcadores, que permiten un rango ampliado de caracteres en las rutas de los atributos (ver* **Uso de marcadores de posición** *a continuación).* * **formula**: una fórmula válida pasada como `Text` o en `Object`. La fórmula se evaluará para cada entidad procesada y debe devolver un valor booleano. Dentro de la fórmula, la entidad está disponible a través del objeto `This`. @@ -879,19 +879,19 @@ donde: * **comparator**: símbolo que compara *attributePath* y *value*. Se soportan los siguientes símbolos: - | Comparación | Símbolo(s) | Comentario | - | ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------ | - | Igual a | =, == | Obtiene los datos coincidentes, admite el comodín (@), no distingue entre mayúsculas de minúsculas ni diacríticas. | - | | ===, IS | Obtiene los datos coincidentes, considera @ como carácter estándar, no distingue entre mayúsculas de minúsculas ni diacríticas | - | Diferente de | #, != | Soporta el comodín (@) | - | | !==, IS NOT | Considera la @ como un caracter estándar | - | Menor que | < | | - | Mayor que | > | | - | Menor o igual que | <= | | - | Mayor o igual que | >= | | - | Incluído en | IN | Devuelve los datos iguales a al menos uno de los valores de una colección o de un conjunto de valores, admite el comodín (@) | - | Condición No aplicada a una sentencia | NOT | Los paréntesis son obligatorios cuando se utiliza NOT antes de una instrucción que contiene varios operadores | - | Contiene palabra clave | % | Las palabras claves pueden utilizarse en atributos de tipo texto o imagen | + | Comparación | Símbolo(s) | Comentario | + | ------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Igual a | =, == | Obtiene los datos coincidentes, admite el comodín (@), no distingue entre mayúsculas de minúsculas ni diacríticas. | + | | ===, IS | Obtiene los datos coincidentes, considera @ como carácter estándar, no distingue entre mayúsculas de minúsculas ni diacríticas | + | Diferente de | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considera la @ como un caracter estándar | + | Condición No aplicada a una sentencia | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Menor que | < | | + | Mayor que | > | | + | Menor o igual que | <= | | + | Mayor o igual que | >= | | + | Incluído en | IN | Devuelve los datos iguales a al menos uno de los valores de una colección o de un conjunto de valores, admite el comodín (@) | + | Contiene palabra clave | % | Las palabras claves pueden utilizarse en atributos de tipo texto o imagen | * **value**: el valor a comparar con el valor actual de la propiedad de cada entidad en la selección de entidades o elemento en la colección. Puede ser un **marcador** (ver **Uso de marcadores** más adelante) o cualquier expresión que coincida con la propiedad de tipo de datos. Al utilizar un valor constante, deben respetarse las siguientes reglas: * La constante de tipo **texto** puede pasarse con o sin comillas simples (ver **Uso de comillas** más abajo). Para consultar una cadena dentro de otra cadena (una consulta de tipo "contiene"), utilice el símbolo de comodín (@) en el valor para aislar la cadena a buscar como se muestra en este ejemplo: "@Smith@". Las siguientes palabras claves están prohibidas para las constantes de texto: true, false. @@ -909,40 +909,40 @@ donde: * **order by attributePath**: puede incluir una declaración order by *attributePath* en la búsqueda para que los datos resultantes se ordenen de acuerdo con esa declaración. Puede utilizar varias instrucciones de ordenación, separadas por comas (por ejemplo, ordenación por *attributePath1* desc, *attributePath2* asc). Por defecto, el orden es ascendente. Pase 'desc' para definir un orden descendente y 'asc' para definir un orden ascendente. >Si utiliza esta instrucción, la selección de entidades devuelta es ordenada (para más información, consulte [>Selecciones de entidades ordenadas y no ordenadas](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Utilizar comillas** +#### Using quotes -Cuando utilice comillas dentro de las consultas, debe utilizar comillas simples ' ' dentro de la consulta y comillas dobles " " para encerrar toda la consulta, de lo contrario se devuelve un error. Por ejemplo: +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Por ejemplo: ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Las comillas simples (') no se admiten en los valores buscados, ya que romperían la cadena de búsqueda. Por ejemplo, "comp.name = 'John's pizza' " generará un error. Si necesita buscar en valores con comillas simples, puede considerar el uso de marcadores de posición (ver más abajo). -**Uso del paréntesis** +#### Using parenthesis -Puede utilizar paréntesis en la búsqueda para dar prioridad al cálculo. Por ejemplo, puede organizar una búsqueda de la siguiente manera: +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Uso de marcadores de posición** +#### Using placeholders -4D le permite utilizar marcadores para los argumentos *attributePath*, *formula* y *value* dentro del parámetro *queryString*. Un marcador es un parámetro que se inserta en las cadenas de búsqueda y que se sustituye por otro valor cuando se evalúa la cadena de búsqueda consulta. El valor de los marcadores se evalúa una vez al principio de la búsqueda; no se evalúa para cada elemento. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Se pueden utilizar dos tipos de marcadores: **indexed placeholders** y los **named placeholders**: +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | | Marcadores de posición indexados | Nombre del marcador de posición | | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Definición | Los parámetros se insertan como `:paramIndex` (por ejemplo :1, :2...) en *queryString* y sus valores correspondientes son suministrados por la secuencia de parámetros *value*. Puede utilizar hasta 128 parámetros *valor* | Los parámetros se insertan como`: paramName` (por ejemplo :myparam) y sus valores se proporcionan en los atributos y/o objetos de parámetros en el parámetro *querySettings* | | Ejemplo | `$r:=class.query(":1=:2";"city";"Chicago")` | `$o.attributes:=New object("att";"city")`
`$o.parameters:=New object("name";"Chicago")`
`$r:=class.query(":att=:name";$o)` | -Puede mezclar todos los tipos de argumentos en *queryString*. Una *queryString* puede contener, para los parámetros *attributePath*, *formula* y *value*: +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * valores directos (sin marcadores), * marcadores indexados y/o con nombre. -El uso de marcadores de posición en las búsquedas **se recomienda** por las siguientes razones: +Using placeholders in queries **is recommended** for the following reasons: 1. Evita la inserción de código malicioso: si utiliza directamente variables completadas por el usuario dentro de la cadena de búsqueda, un usuario podría modificar las condiciones de búsqueda introduciendo argumentos de búsqueda adicionales. Por ejemplo, imagine una cadena de búsqueda como: @@ -951,50 +951,105 @@ El uso de marcadores de posición en las búsquedas **se recomienda** por las si $result:=$col.query($vquery) ``` - Esta búsqueda parece segura ya que se filtran los datos no públicos. Sin embargo, si el usuario introduce en el área *myname* algo como *"smith OR status='private'*, la cadena de búsqueda se modificaría en la etapa de la interpretación y podría devolver datos privados. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Cuando se utilizan marcadores de posición, no es posible anular las condiciones de seguridad: + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - En este caso, si el usuario introduce *smith OR status='private'* en el área *myname*, no se interpretará en la cadena de búsqueda, sino que sólo se pasará como valor. La búsqueda de una persona llamada "smith OR status='private'" simplemente fallará. + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Evita tener que preocuparse por cuestiones de formato o caracteres, especialmente cuando se manejan los parámetros *attributePath* o *value* que pueden contener caracteres no alfanuméricos como ".", "['... 3. Permite el uso de variables o expresiones en los argumentos de búsqueda. Ejemplos: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Búsqueda de valores null** +#### Looking for null values -Cuando se buscan valores null, no se puede utilizar la sintaxis de marcador de posición porque el motor de búsqueda considera null como un valor de comparación invalido. Por ejemplo, si ejecuta la siguiente búsqueda: +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // NO funcionará ``` -No obtendrá el resultado esperado porque el valor null será evaluado por 4D como un error resultante de la evaluación del parámetro (por ejemplo, un atributo procedente de otra búsqueda). Para este tipo de búsquedas, debe utilizar la sintaxis de búsqueda directa: +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds.Person.query("spouse = null") // Sintaxis correcta ``` -**Vinculación de los argumentos de búsqueda y los atributos de colección** +#### Not equal to in collections -| +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. -Esta funcionalidad sólo está disponible en las búsquedas en clases de datos y en las [selecciones de entidades](EntitySelectionClass.md#query). No se puede utilizar en las búsquedas en [colecciones](CollectionClass.md#query). + +#### Linking collection attribute query arguments + +:::info + +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. When searching in collections within object attributes using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Por ejemplo, con las dos entidades siguientes: +For example, with the following two entities: ``` Entity 1: @@ -1017,35 +1072,35 @@ ds. People.places: } ] } ``` -Quiere encontrar personas con un tipo de ubicación "home" en la ciudad "paris". Si escribe: +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... la búsqueda devolverá "martin" **y** "smith" porque "smith" tiene un elemento "locations" cuyo "tipo" es "home" y un elemento "locations" cuya "ciudad" es "paris", aunque sean elementos diferentes. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Si quiere obtener sólo las entidades en las que los argumentos correspondientes están en el mismo elemento de colección, necesita **enlazar los argumentos**. Para enlazar los argumentos de búsqueda: +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Añada una letra entre los \[] en la primera ruta a enlazar y repita la misma letra en todos los argumentos enlazados. Por ejemplo: `locations[a].city and locations[a].kind`. Puede utilizar cualquier letra del alfabeto latino (no diferencia entre mayúsculas y minúsculas). * Para añadir diferentes criterios vinculados en la misma consulta, utilice otra letra. Puede crear hasta 26 combinaciones de criterios en una sola consulta. -Con las entidades anteriores, si escribe: +With the above entities, if you write: ```4d ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... la búsqueda sólo devolverá "martin" porque tiene un elemento "locations" cuyo "kind" es "home" y cuyo "city" es "paris". La búsqueda no devolverá "smith" porque los valores "home" y "paris" no están en el mismo elemento de colección. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Búsquedas en las relaciones Muchos a Muchos** +#### Queries in many-to-many relations -ORDA ofrece una sintaxis especial para facilitar las consultas en las relaciones de muchos a muchos. En este contexto, puede ser necesario buscar diferentes valores con un operador `AND` PERO en el mismo atributo. Por ejemplo, de una mirada a la siguiente estructura: +ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: ![alt-text](../assets/en/API/manytomany.png) -Imagine que quiere buscar todas las películas en las que un actor A *y* un actor B tienen un papel. Si escribe una búsqueda simple utilizando un operador `AND`, no funcionará: +Imagine that you want to search all movies in which *both* actor A and actor B have a role. If you write a simple query using an `AND` operator, it will not work: ```4d // código inválido @@ -1053,17 +1108,17 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";"H // $es está vacía ``` -Básicamente, el problema está relacionado con la lógica interna de la búsqueda: no se puede buscar un atributo cuyo valor sea tanto "A" como "B". +Basically, the issue is related to the internal logic of the query: you cannot search for an attribute whose value would be both "A" and "B". -Para poder realizar este tipo de búsqueda, ORDA permite una sintaxis especial: basta con añadir un *class index* entre **{}** en todos los atributos relacionales adicionales utilizados en la cadena: +To make it possible to perform such queries, ORDA allows a special syntax: you just need to add a *class index* between **{}** in all additional relation attributes used in the string: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** indica a ORDA que cree otra referencia para el atributo relacional. A continuación, realizará todas las operaciones de mapa de bits internas necesarias. Tenga en cuenta que **x** puede ser todo número **excepto 0**: {1}, o {2}, o {1540}... ORDA sólo necesita una referencia única en la búsqueda para cada class index. +**{x}** tells ORDA to create another reference for the relation attribute. It will then perform all the necessary bitmap operations internally. Note that **x** can be any number **except 0**: {1}, or {2}, or {1540}... ORDA only needs a unique reference in the query for each class index. -En nuestro ejemplo, sería: +In our example, it would be: ```4d // código válido @@ -1071,38 +1126,40 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es contient des films (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**parámetro formula** -Como alternativa a la inserción de fórmulas dentro del parámetro *queryString* (ver arriba), puede pasar directamente un objeto fórmula como criterio de búsqueda booleano. La utilización de un objeto fórmula para las búsquedas es **recomendada** ya que se beneficia de la tokenización, y el código es más fácil de buscar/leer. -La fórmula debe haber sido creada utilizando los comandos [`Formula`](FunctionClass.md#formula) o [`Formula from string`](FunctionClass.md#formula-from-string). En este caso: +#### formula parameter + +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. + +La fórmula debe haber sido creada utilizando los comandos [`Formula`](FunctionClass.md#formula) o [`Formula from string`](FunctionClass.md#formula-from-string). In this case: * *fórmula* se evalúa para cada entidad y debe devolver true o false. Durante la ejecución de la búsqueda, si el resultado de la fórmula no es un booleano, se considera como false. * dentro de la *fórmula*, la entidad está disponible a través del objeto `This`. * si el objeto `Formula` es **null**, se genera el error 1626 ("Esperando un texto o una fórmula"), que llama a interceptar utilizando un método instalado con `ON ERR CALL`. > Por razones de seguridad, las llamadas a fórmulas dentro de las funciones `query()` pueden ser desestimadas. Ver la descripción del parámetro *querySettings*. -**Pasar parámetros a las fórmulas** +#### Passing parameters to formulas -Todo parámetro *formula* llamado por la función `query()` puede recibir parámetros: +Any *formula* called by the `query()` class function can receive parameters: * Los parámetros deben pasarse a través de la propiedad **args** (objeto) del parámetro *querySettings*. * La fórmula recibe este objeto **args** como parámetro **$1**. -Este pequeño código muestra los principios de cómo se pasan los parámetros a los métodos: +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //objeto args a pasar los parámetros $es:=ds.Students.query("eval(checkName($1.exclude))";$settings) //args se recibe en $1 ``` -En el ejemplo 3 se ofrecen más ejemplos. +Additional examples are provided in example 3. -**4D Server**: en cliente/servidor, las fórmulas se ejecutan en el servidor. En este contexto, sólo se envía a las fórmulas el objeto `querySettings.args`. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**Parámetro querySettings** +#### querySettings parameter -En el parámetro *querySettings* se puede pasar un objeto que contenga opciones adicionales. Se soportan las siguientes propiedades: +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propiedad | Tipo | Descripción | | ------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1114,11 +1171,11 @@ En el parámetro *querySettings* se puede pasar un objeto que contenga opciones | queryPlan | Boolean | En la entity selection resultante, devuelve o no la descripción detallada de la búsqueda justo antes de que se ejecute, es decir, la búsqueda planificada. La propiedad devuelta es un objeto que incluye cada búsqueda y sub búsqueda prevista (en el caso de una búsqueda compleja). Esta opción es útil durante la fase de desarrollo de una aplicación. Suele utilizarse junto con queryPath. Por defecto si se omite: false. **Nota**: esta propiedad sólo la soportan las funciones `entitySelection.query()` y `dataClass.query()`. | | queryPath | Boolean | En la entity selection resultante, devuelve o no la descripción detallada de la búsqueda tal cual es realizada. La propiedad devuelta es un objeto que contiene la ruta utilizada para la búsqueda (normalmente idéntica a la de queryPlan, pero puede diferir si el motor consigue optimizar la búsqueda), así como el tiempo de procesamiento y el número de registros encontrados. Esta opción es útil durante la fase de desarrollo de una aplicación. Por defecto si se omite: false. **Nota**: esta propiedad sólo la soportan las funciones `entitySelection.query()` y `dataClass.query()`. | -**Sobre queryPlan y queryPath** +#### About queryPlan and queryPath -La información registrada en `queryPlan`/`queryPath` incluye el tipo de búsqueda (indexada y secuencial) y cada subconsulta necesaria junto con los operadores de conjunción. Las rutas de acceso de las peticiones también contienen el número de entidades encontradas y el tiempo necesario para ejecutar cada criterio de búsqueda. Las rutas de acceso de las peticiones también contienen el número de entidades encontradas y el tiempo necesario para ejecutar cada criterio de búsqueda. Generalmente, la descripción del plan de consulta y su ruta de acceso son idénticas, pero pueden diferir porque 4D puede implementar optimizaciones dinámicas cuando se ejecuta una consulta para mejorar el rendimiento. Por ejemplo, el motor 4D puede convertir dinámicamente una consulta indexada en una secuencial si estima que es más rápida. Este caso concreto puede darse cuando el número de entidades que se buscan es bajo. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Por ejemplo, si ejecuta la siguiente búsqueda: +For example, if you execute the following query: ```4d $sel:=ds.Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ @@ -1147,46 +1204,46 @@ queryPath: #### Ejemplo 1 -Esta sección ofrece varios ejemplos de búsquedas. +This section provides various examples of queries. -Consultas en una cadena: +Query on a string: ```4d $entitySelection:=ds.Customer.query("firstName = 'S@'") ``` -Búsqueda con una instrucción NOT: +Query with a NOT statement: ```4d $entitySelection:=ds.Employee.query("not(firstName=Kim)") ``` -Búsquedas con fechas: +Queries with dates: ```4d $entitySelection:=ds.Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds.Employee.query("birthDate <= :1";Current date-10950) ``` -Búsqueda con marcadores de posición indexados para los valores: +Query with indexed placeholders for values: ```4d $entitySelection:=ds.Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Búsqueda con marcadores de posición indexados para valores en una dataclass relacionada: +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds.Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Búsqueda con marcador de posición indexado que incluye una instrucción de orden descendente: +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds.Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Búsqueda con marcadores de posición con nombre para los valores: +Query with named placeholders for values: ```4d var $querySettings : Object @@ -1196,7 +1253,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Búsqueda que utiliza marcadores de posición con nombre e indexados para los valores: +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -1205,7 +1262,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Búsqueda con objetos queryPlan y queryPath: +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds.Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -1216,19 +1273,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Búsqueda con una ruta de atributo de tipo Collection: +Query with an attribute path of Collection type: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Búsqueda con una ruta de atributos de tipo Collection y atributos vinculados: +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Búsqueda con una ruta de atributos de tipo Collection y múltiples atributos vinculados: +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1236,25 +1293,25 @@ $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Búsqueda con una ruta de atributo de tipo Objeto: +Query with an attribute path of Object type: ```4d $entitySelection:=ds.Employee.query("extra.eyeColor = :1";"blue") ``` -Búsqueda con una instrucción IN: +Query with an IN statement: ```4d $entitySelection:=ds.Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Búsqueda con instrucción NOT (IN): +Query with a NOT (IN) statement: ```4d $entitySelection:=ds.Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Búsqueda con marcadores de posición indexados para los atributos: +Query with indexed placeholders for attributes: ```4d var $es : cs.EmployeeSelection @@ -1262,7 +1319,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") //salesperson es una entidad relacionada ``` -Búsqueda con marcadores de posición indexados para los atributos y marcadores de posición con nombre para los valores: +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs.EmployeeSelection @@ -1273,7 +1330,7 @@ $es:=ds.Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId";" //salesperson es una entidad relacionada ``` -Búsqueda con marcadores de posición indexados para los atributos y los valores: +Query with indexed placeholders for attributes and values: ```4d var $es : cs.EmployeeSelection @@ -1283,11 +1340,11 @@ $es:=ds.Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smith #### Ejemplo 2 -Esta sección ilustra las búsquedas con marcadores de posición con nombre para los atributos. +This section illustrates queries with named placeholders for attributes. -Dada una dataclass Employee con 2 entidades: +Given an Employee dataclass with 2 entities: -Entidad 1: +Entity 1: ```4d name: "Marie" @@ -1299,7 +1356,7 @@ softwares:{ } ``` -Entidad 2: +Entity 2: ```4d name: "Sophie" @@ -1311,7 +1368,7 @@ softwares:{ } ``` -Búsqueda con marcadores de posición con nombre para los atributos: +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1322,7 +1379,7 @@ Búsqueda con marcadores de posición con nombre para los atributos: //$es.length=1 (Employee Marie) ``` -Búsqueda con marcadores de posición con nombre para los atributos y los valores: +Query with named placeholders for attributes and values: ```4d @@ -1343,16 +1400,16 @@ Búsqueda con marcadores de posición con nombre para los atributos y los valore #### Ejemplo 3 -Estos ejemplos ilustran las distintas formas de utilizar fórmulas con o sin parámetros en sus búsquedas. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -La fórmula se da como texto con `eval()` en el parámetro *queryString*: +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs.StudentsSelection $es:=ds.Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -La fórmula se da como un objeto `Formula` a través de un marcador de posición: +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs.StudentsSelection @@ -1361,7 +1418,7 @@ La fórmula se da como un objeto `Formula` a través de un marcador de posición $es:=ds.Students.query(":1 and nationality='French'";$formula) ``` -Sólo se da como criterio un objeto `Formula`: +Only a `Formula` object is given as criteria: ```4d var $es : cs.StudentsSelection @@ -1370,7 +1427,7 @@ Sólo se da como criterio un objeto `Formula`: $es:=ds.Students.query($formula) ``` -Se pueden aplicar varias fórmulas: +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1379,7 +1436,7 @@ Se pueden aplicar varias fórmulas: $0:=ds.Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Una fórmula texto en *queryString* recibe un parámetro: +A text formula in *queryString* receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1395,7 +1452,7 @@ Una fórmula texto en *queryString* recibe un parámetro: $result:=(Position($exclude;This.lastname)=0) ``` -Utilizando el mismo método ***checkName***, un objeto `Formula` como marcador de posición recibe un parámetro: +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1408,7 +1465,7 @@ Utilizando el mismo método ***checkName***, un objeto `Formula` como marcador d $es:=ds.Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su consulta: +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs.StudentsSelection @@ -1423,7 +1480,7 @@ Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su #### Ver también -[`.query()`](EntitySelectionClass.md#query) para selecciones de entidades +[`.query()`](EntitySelectionClass.md#query) for entity selections @@ -1437,13 +1494,13 @@ Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su -**.setRemoteCacheSettings**(*settings*: Object) +**.setRemoteCacheSettings**(*settings* : Object) -| Parámetros | Tipo | | Descripción | -| ---------- | ------ | -- | ----------------------------------------------------------------------------------------------------------------------- | -| settings | Object | -> | Objeto que define el tiempo de espera y el tamaño máximo de la caché ORDA para el dataclass.| +| Parámetros | Tipo | | Descripción | +| ---------- | ------ | -- | ------------------------------------------------------------------------------------------------------------- | +| settings | Object | -> | Object that sets the timeout and maximum size of the ORDA cache for the dataclass.| | @@ -1451,30 +1508,30 @@ Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su #### Descripción -La función `.setRemoteCacheSettings()` define el tiempo de espera y el tamaño máximo de la caché ORDA para una clase de datos.. +The `.setRemoteCacheSettings()` function sets the timeout and maximum size of the ORDA cache for a dataclass.. -En el parámetro *settings*, pase un objeto con las siguientes propiedades: +In the *settings* parameter, pass an object with the following properties: | Propiedad | Tipo | Descripción | | ---------- | ------- | ----------------------------- | | timeout | Integer | Tiempo de espera en segundos. | | maxEntries | Integer | Número máximo de entidades. | -`timeout` define el tiempo de espera de la caché ORDA para la dataclass (por defecto es 30 segundos). Una vez transcurrido el tiempo de espera, las entidades de la dataclass en la caché son consideradas como vencidas. Esto significa que: +`timeout` sets the timeout of the ORDA cache for the dataclass (default is 30 seconds). Once the timeout has passed, the entities of the dataclass in the cache are considered as expired. This means that: * los datos siguen estando ahí * la próxima vez que se necesiten los datos, se le pedirán al servidor * 4D elimina automáticamente los datos caducados cuando se alcanza el número máximo de entidades -Definir la propiedad `timeout` define un nuevo timeout para las entidades ya presentes en la caché. Es útil cuando se trabaja con los datos que no cambian con mucha frecuencia y, por tanto, cuando no son necesarias nuevas peticiones al servidor. +Setting a `timeout` property sets a new timeout for the entities already present in the cache. It is useful when working with data that does not change very frequently, and thus when new requests to the server are not necessary. -`maxEntries` define el número máximo de entidades en la caché ORDA. Por defecto es 30 000. +`maxEntries` sets the max number of entities in the ORDA cache. Default is 30 000. -El número de entradas mínimo es 300, por lo que el valor de `maxEntries` debe ser igual o superior a 300. En caso contrario, se ignora y el número máximo de entradas se fija en 300. +The minimum number of entries is 300, so the value of `maxEntries` must be equal to or higher than 300. Otherwise it is ignored and the maximum number of entries is set to 300. -Si no se pasan propiedades válidas como `timeout` y `maxEntries`, la caché permanece sin cambios, con sus valores por defecto o previamente definidos. +If no valid properties are passed as `timeout` and `maxEntries`, the cache remains unchanged, with its default or previously set values. -Cuando se guarda una entidad, se actualiza en la caché y vence una vez alcanzado el timeout. +When an entity is saved, it is updated in the cache and expires once the timeout is reached. #### Ejemplo From abb0fbb0e97b3377a74a8f024e3ef1372b50192e Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:52:50 +0200 Subject: [PATCH 060/180] New translations DataStoreClass.md (Spanish) --- .../version-20/API/DataStoreClass.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/API/DataStoreClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20/API/DataStoreClass.md index 547d5c1b313c4c..5870ebd9d69d5a 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/API/DataStoreClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/API/DataStoreClass.md @@ -411,7 +411,7 @@ Quiere saber el número de tablas encriptadas en el archivo de datos actual: La función `.flushAndLock()` vacía la caché del datastore local e impide que los otros procesos realicen operaciones de escritura en la base de datos. El datastore se pone en un estado consistente y congelado. Es necesario llamar a esta función antes de ejecutar una instantánea de la aplicación, por ejemplo. -| +:::info Esta función sólo puede llamarse: @@ -1086,7 +1086,7 @@ End case La función `.startRequestLog()` inicia el registro de peticiones ORDA del lado del cliente o del lado del servidor. Está diseñado para fines de depuración en configuraciones cliente/servidor. -| +:::info Para una descripción del formato del registro de peticiones ORDA, consulte la sección [**Peticiones ORDA**](../Debugging/debugLogFiles.md#orda-requests). From 3ca09bb7563ec8e4377cbd3e6e5bbd7fdcfa86e7 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:52:55 +0200 Subject: [PATCH 061/180] New translations EntityClass.md (Spanish) --- .../version-20/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/API/EntityClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20/API/EntityClass.md index 49e7107cb280cc..b9d214a662f7cd 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/API/EntityClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/API/EntityClass.md @@ -1700,7 +1700,7 @@ Si no se ha tocado ningún atributo de entidad, el método devuelve una colecci //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -En este caso: +In this case: * firstName y lastName tienen un tipo `storage` * employer tiene un tipo `relatedEntity` From f06b3340e191d23ae7107503f34deb34c2fe772c Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:53:04 +0200 Subject: [PATCH 062/180] New translations IMAPTransporterClass.md (Spanish) --- .../version-20/API/IMAPTransporterClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/API/IMAPTransporterClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20/API/IMAPTransporterClass.md index e46e051c39b573..b2ac41044bbe79 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/API/IMAPTransporterClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/API/IMAPTransporterClass.md @@ -1714,7 +1714,7 @@ El objeto `boxInfo` devuelto contiene las siguientes propiedades: | flags | text | Lista de banderas utilizadas actualmente para el buzón, separadas por espacios | | permanentFlags | text | Lista de banderas que el cliente puede cambiar permanentemente (excepto el indicador \Recent, que gestiona el servidor IMAP), separados por espacios | -| +:::info Si la cadena `permanentFlags` incluye la bandera especial \*, significa que el servidor soporta [banderas personalizadas](#addflags). From 9152a0adbc6d4f0f641410119a904ed379a9b23a Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 09:53:08 +0200 Subject: [PATCH 063/180] New translations SessionClass.md (Spanish) --- .../version-20/API/SessionClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/API/SessionClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20/API/SessionClass.md index e5f8f46b9b14de..a98bc3781ce497 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/API/SessionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/API/SessionClass.md @@ -324,7 +324,7 @@ La función `.setPrivileges()` c En *rangeObj*, pase el rango que quiere nombrar, y pase el nuevo nombre del rango en *name*. Si el nombre ya se utiliza en el mismo alcance, el nuevo rango nombrado sustituye al existente. Tenga en cuenta que puede utilizar el mismo nombre para diferentes alcances (ver más adelante). -Puede pasar un objeto con las propiedades adicionales para el rango nombrado en *options*. Se soportan las siguientes propiedades: +Puede pasar un objeto con las propiedades adicionales para el rango nombrado en *options*. The following properties are supported: | Propiedad | Tipo | Descripción | | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1159,7 +1159,7 @@ En el parámetro *rangeObj*, pase un objeto que contenga un rango a buscar. El parámetro *searchValue* permite pasar el texto a buscar dentro del *rangeObj*. -Puede pasar el parámetro opcional *searchCondition* para especificar el funcionamiento de la búsqueda. Se soportan las siguientes propiedades: +Puede pasar el parámetro opcional *searchCondition* para especificar el funcionamiento de la búsqueda. The following properties are supported: | Propiedad | Tipo | Descripción | | ----------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -3485,7 +3485,7 @@ VP NEW DOCUMENT("myVPArea") El comando `VP Object to font` devuelve una cadena de caracteres de *fontObj*. -En *fontObj*, pase un objeto que contenga las propiedades de fuente. Se soportan las siguientes propiedades: +En *fontObj*, pase un objeto que contenga las propiedades de fuente. The following properties are supported: | Propiedad | Tipo | Descripción | Valores posibles | Obligatorio | | --------- | ---- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | From 4013954db358f02481f8a9f65a60437d2d4b7966 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:08:32 +0200 Subject: [PATCH 084/180] New translations overview.md (Spanish) --- .../version-20/code-editor/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/code-editor/overview.md b/i18n/es/docusaurus-plugin-content-docs/version-20/code-editor/overview.md index 1c2bc2a62d9d38..39109bb721163c 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/code-editor/overview.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/code-editor/overview.md @@ -82,7 +82,7 @@ Con 4D Server, el nombre del método se cambia en el servidor cuando se termina ::: -| +:::info Los métodos base no pueden ser renombrados. Lo mismo ocurre con los triggers, los métodos formulario y los métodos objeto, que están vinculados a los objetos y toman sus nombre del objeto en cuestión. From 4fc37af7bc780896aba0b8c56528a2d72bce80b1 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:08:34 +0200 Subject: [PATCH 085/180] New translations write-class-method.md (Spanish) --- .../version-20/code-editor/write-class-method.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20/code-editor/write-class-method.md b/i18n/es/docusaurus-plugin-content-docs/version-20/code-editor/write-class-method.md index 6a3efdd3d935c1..5bc11ad7ec9aa2 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20/code-editor/write-class-method.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20/code-editor/write-class-method.md @@ -614,7 +614,7 @@ Los marcadores se gestionan utilizando el submenú **Marcadores** del menú **M - **Eliminar todo**: elimina todos los marcadores de la ventana en primer plano. - **Ir al siguiente** / **Ir al anterior**: permite navegar entre los marcadores de la ventana. Al seleccionar uno de estos comandos, el cursor se sitúa en el primer caracter de la línea asociada al marcador en cuestión. También puede utilizar los atajos de teclado **F3** (ir a la siguiente) o **Mayús+F3** (ir a la anterior). -| +:::info Puede utilizar marcadores como señalizadores de líneas que contengan un elemento [encontrado mediante una búsqueda](#find). En este caso, 4D añade automáticamente los marcadores. Para más información, consulte [Marcar todos](#bookmark-all). From c16fb91ecf62465d17f44c6e17924fed795711f7 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:08:50 +0200 Subject: [PATCH 086/180] New translations CollectionClass.md (Spanish) --- .../version-20-R2/API/CollectionClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/CollectionClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/CollectionClass.md index 32fdec4190479b..65e0b89a070ff5 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/CollectionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/CollectionClass.md @@ -186,7 +186,7 @@ El comando `New shared collection` busca entidad Si no se encuentran entidades coincidentes, se devuelve una `EntitySelection` vacía. -**parámetro queryString** +#### queryString parameter El parámetro *queryString* utiliza la siguiente sintaxis: @@ -861,9 +861,9 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -donde: +where: -* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. Each value is a path that can designate either a scalar or a related attribute of the dataclass or a property in an object field of the dataclass +* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > *No puede utilizar directamente atributos cuyo nombre contenga caracteres especiales como ".", "\[ ]", o "=", ">", "#"..., porque se evaluarán incorrectamente en la cadena de consulta. Si necesita consultar dichos atributos, debe considerar el uso de marcadores, que permiten un rango ampliado de caracteres en las rutas de los atributos (ver* **Uso de marcadores de posición** *a continuación).* * **formula**: una fórmula válida pasada como `Text` o en `Object`. La fórmula se evaluará para cada entidad procesada y debe devolver un valor booleano. Dentro de la fórmula, la entidad está disponible a través del objeto `This`. @@ -879,19 +879,19 @@ donde: * **comparator**: símbolo que compara *attributePath* y *value*. Se soportan los siguientes símbolos: - | Comparación | Símbolo(s) | Comentario | - | ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------ | - | Igual a | =, == | Obtiene los datos coincidentes, admite el comodín (@), no distingue entre mayúsculas de minúsculas ni diacríticas. | - | | ===, IS | Obtiene los datos coincidentes, considera @ como carácter estándar, no distingue entre mayúsculas de minúsculas ni diacríticas | - | Diferente de | #, != | Soporta el comodín (@) | - | | !==, IS NOT | Considera la @ como un caracter estándar | - | Menor que | < | | - | Mayor que | > | | - | Menor o igual que | <= | | - | Mayor o igual que | >= | | - | Incluído en | IN | Devuelve los datos iguales a al menos uno de los valores de una colección o de un conjunto de valores, admite el comodín (@) | - | Condición No aplicada a una sentencia | NOT | Los paréntesis son obligatorios cuando se utiliza NOT antes de una instrucción que contiene varios operadores | - | Contiene palabra clave | % | Las palabras claves pueden utilizarse en atributos de tipo texto o imagen | + | Comparación | Símbolo(s) | Comentario | + | ------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Igual a | =, == | Obtiene los datos coincidentes, admite el comodín (@), no distingue entre mayúsculas de minúsculas ni diacríticas. | + | | ===, IS | Obtiene los datos coincidentes, considera @ como carácter estándar, no distingue entre mayúsculas de minúsculas ni diacríticas | + | Diferente de | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considera la @ como un caracter estándar | + | Condición No aplicada a una sentencia | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Menor que | < | | + | Mayor que | > | | + | Menor o igual que | <= | | + | Mayor o igual que | >= | | + | Incluído en | IN | Devuelve los datos iguales a al menos uno de los valores de una colección o de un conjunto de valores, admite el comodín (@) | + | Contiene palabra clave | % | Las palabras claves pueden utilizarse en atributos de tipo texto o imagen | * **value**: el valor a comparar con el valor actual de la propiedad de cada entidad en la selección de entidades o elemento en la colección. Puede ser un **marcador** (ver **Uso de marcadores** más adelante) o cualquier expresión que coincida con la propiedad de tipo de datos. Al utilizar un valor constante, deben respetarse las siguientes reglas: * La constante de tipo **texto** puede pasarse con o sin comillas simples (ver **Uso de comillas** más abajo). Para consultar una cadena dentro de otra cadena (una consulta de tipo "contiene"), utilice el símbolo de comodín (@) en el valor para aislar la cadena a buscar como se muestra en este ejemplo: "@Smith@". Las siguientes palabras claves están prohibidas para las constantes de texto: true, false. @@ -909,40 +909,40 @@ donde: * **order by attributePath**: puede incluir una declaración order by *attributePath* en la búsqueda para que los datos resultantes se ordenen de acuerdo con esa declaración. Puede utilizar varias instrucciones de ordenación, separadas por comas (por ejemplo, ordenación por *attributePath1* desc, *attributePath2* asc). Por defecto, el orden es ascendente. Pase 'desc' para definir un orden descendente y 'asc' para definir un orden ascendente. >Si utiliza esta instrucción, la selección de entidades devuelta es ordenada (para más información, consulte [>Selecciones de entidades ordenadas y no ordenadas](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Utilizar comillas** +#### Using quotes -Cuando utilice comillas dentro de las consultas, debe utilizar comillas simples ' ' dentro de la consulta y comillas dobles " " para encerrar toda la consulta, de lo contrario se devuelve un error. Por ejemplo: +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Por ejemplo: ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Las comillas simples (') no se admiten en los valores buscados, ya que romperían la cadena de búsqueda. Por ejemplo, "comp.name = 'John's pizza' " generará un error. Si necesita buscar en valores con comillas simples, puede considerar el uso de marcadores de posición (ver más abajo). -**Uso del paréntesis** +#### Using parenthesis -Puede utilizar paréntesis en la búsqueda para dar prioridad al cálculo. Por ejemplo, puede organizar una búsqueda de la siguiente manera: +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Uso de marcadores de posición** +#### Using placeholders -4D le permite utilizar marcadores para los argumentos *attributePath*, *formula* y *value* dentro del parámetro *queryString*. Un marcador es un parámetro que se inserta en las cadenas de búsqueda y que se sustituye por otro valor cuando se evalúa la cadena de búsqueda consulta. El valor de los marcadores se evalúa una vez al principio de la búsqueda; no se evalúa para cada elemento. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Se pueden utilizar dos tipos de marcadores: **indexed placeholders** y los **named placeholders**: +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | | Marcadores de posición indexados | Nombre del marcador de posición | | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Definición | Los parámetros se insertan como `:paramIndex` (por ejemplo :1, :2...) en *queryString* y sus valores correspondientes son suministrados por la secuencia de parámetros *value*. Puede utilizar hasta 128 parámetros *valor* | Los parámetros se insertan como`: paramName` (por ejemplo :myparam) y sus valores se proporcionan en los atributos y/o objetos de parámetros en el parámetro *querySettings* | | Ejemplo | `$r:=class.query(":1=:2";"city";"Chicago")` | `$o.attributes:=New object("att";"city")`
`$o.parameters:=New object("name";"Chicago")`
`$r:=class.query(":att=:name";$o)` | -Puede mezclar todos los tipos de argumentos en *queryString*. Una *queryString* puede contener, para los parámetros *attributePath*, *formula* y *value*: +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * valores directos (sin marcadores), * marcadores indexados y/o con nombre. -El uso de marcadores de posición en las búsquedas **se recomienda** por las siguientes razones: +Using placeholders in queries **is recommended** for the following reasons: 1. Evita la inserción de código malicioso: si utiliza directamente variables completadas por el usuario dentro de la cadena de búsqueda, un usuario podría modificar las condiciones de búsqueda introduciendo argumentos de búsqueda adicionales. Por ejemplo, imagine una cadena de búsqueda como: @@ -951,50 +951,105 @@ El uso de marcadores de posición en las búsquedas **se recomienda** por las si $result:=$col.query($vquery) ``` - Esta búsqueda parece segura ya que se filtran los datos no públicos. Sin embargo, si el usuario introduce en el área *myname* algo como *"smith OR status='private'*, la cadena de búsqueda se modificaría en la etapa de la interpretación y podría devolver datos privados. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Cuando se utilizan marcadores de posición, no es posible anular las condiciones de seguridad: + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - En este caso, si el usuario introduce *smith OR status='private'* en el área *myname*, no se interpretará en la cadena de búsqueda, sino que sólo se pasará como valor. La búsqueda de una persona llamada "smith OR status='private'" simplemente fallará. + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Evita tener que preocuparse por cuestiones de formato o caracteres, especialmente cuando se manejan los parámetros *attributePath* o *value* que pueden contener caracteres no alfanuméricos como ".", "['... 3. Permite el uso de variables o expresiones en los argumentos de búsqueda. Ejemplos: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Búsqueda de valores null** +#### Looking for null values -Cuando se buscan valores null, no se puede utilizar la sintaxis de marcador de posición porque el motor de búsqueda considera null como un valor de comparación invalido. Por ejemplo, si ejecuta la siguiente búsqueda: +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // NO funcionará ``` -No obtendrá el resultado esperado porque el valor null será evaluado por 4D como un error resultante de la evaluación del parámetro (por ejemplo, un atributo procedente de otra búsqueda). Para este tipo de búsquedas, debe utilizar la sintaxis de búsqueda directa: +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds.Person.query("spouse = null") // Sintaxis correcta ``` -**Vinculación de los argumentos de búsqueda y los atributos de colección** +#### Not equal to in collections -| +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. -Esta funcionalidad sólo está disponible en las búsquedas en clases de datos y en las [selecciones de entidades](EntitySelectionClass.md#query). No se puede utilizar en las búsquedas en [colecciones](CollectionClass.md#query). + +#### Linking collection attribute query arguments + +:::info + +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. When searching in collections within object attributes using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Por ejemplo, con las dos entidades siguientes: +For example, with the following two entities: ``` Entity 1: @@ -1017,35 +1072,35 @@ ds. People.places: } ] } ``` -Quiere encontrar personas con un tipo de ubicación "home" en la ciudad "paris". Si escribe: +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... la búsqueda devolverá "martin" **y** "smith" porque "smith" tiene un elemento "locations" cuyo "tipo" es "home" y un elemento "locations" cuya "ciudad" es "paris", aunque sean elementos diferentes. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Si quiere obtener sólo las entidades en las que los argumentos correspondientes están en el mismo elemento de colección, necesita **enlazar los argumentos**. Para enlazar los argumentos de búsqueda: +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Añada una letra entre los \[] en la primera ruta a enlazar y repita la misma letra en todos los argumentos enlazados. Por ejemplo: `locations[a].city and locations[a].kind`. Puede utilizar cualquier letra del alfabeto latino (no diferencia entre mayúsculas y minúsculas). * Para añadir diferentes criterios vinculados en la misma consulta, utilice otra letra. Puede crear hasta 26 combinaciones de criterios en una sola consulta. -Con las entidades anteriores, si escribe: +With the above entities, if you write: ```4d ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... la búsqueda sólo devolverá "martin" porque tiene un elemento "locations" cuyo "kind" es "home" y cuyo "city" es "paris". La búsqueda no devolverá "smith" porque los valores "home" y "paris" no están en el mismo elemento de colección. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Búsquedas en las relaciones Muchos a Muchos** +#### Queries in many-to-many relations -ORDA ofrece una sintaxis especial para facilitar las consultas en las relaciones de muchos a muchos. En este contexto, puede ser necesario buscar diferentes valores con un operador `AND` PERO en el mismo atributo. Por ejemplo, de una mirada a la siguiente estructura: +ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: ![alt-text](../assets/en/API/manytomany.png) -Imagine que quiere buscar todas las películas en las que un actor A *y* un actor B tienen un papel. Si escribe una búsqueda simple utilizando un operador `AND`, no funcionará: +Imagine that you want to search all movies in which *both* actor A and actor B have a role. If you write a simple query using an `AND` operator, it will not work: ```4d // código inválido @@ -1053,17 +1108,17 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";"H // $es está vacía ``` -Básicamente, el problema está relacionado con la lógica interna de la búsqueda: no se puede buscar un atributo cuyo valor sea tanto "A" como "B". +Basically, the issue is related to the internal logic of the query: you cannot search for an attribute whose value would be both "A" and "B". -Para poder realizar este tipo de búsqueda, ORDA permite una sintaxis especial: basta con añadir un *class index* entre **{}** en todos los atributos relacionales adicionales utilizados en la cadena: +To make it possible to perform such queries, ORDA allows a special syntax: you just need to add a *class index* between **{}** in all additional relation attributes used in the string: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** indica a ORDA que cree otra referencia para el atributo relacional. A continuación, realizará todas las operaciones de mapa de bits internas necesarias. Tenga en cuenta que **x** puede ser todo número **excepto 0**: {1}, o {2}, o {1540}... ORDA sólo necesita una referencia única en la búsqueda para cada class index. +**{x}** tells ORDA to create another reference for the relation attribute. It will then perform all the necessary bitmap operations internally. Note that **x** can be any number **except 0**: {1}, or {2}, or {1540}... ORDA only needs a unique reference in the query for each class index. -En nuestro ejemplo, sería: +In our example, it would be: ```4d // código válido @@ -1071,38 +1126,40 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es contient des films (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**parámetro formula** -Como alternativa a la inserción de fórmulas dentro del parámetro *queryString* (ver arriba), puede pasar directamente un objeto fórmula como criterio de búsqueda booleano. La utilización de un objeto fórmula para las búsquedas es **recomendada** ya que se beneficia de la tokenización, y el código es más fácil de buscar/leer. -La fórmula debe haber sido creada utilizando los comandos [`Formula`](FunctionClass.md#formula) o [`Formula from string`](FunctionClass.md#formula-from-string). En este caso: +#### formula parameter + +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. + +La fórmula debe haber sido creada utilizando los comandos [`Formula`](FunctionClass.md#formula) o [`Formula from string`](FunctionClass.md#formula-from-string). In this case: * *fórmula* se evalúa para cada entidad y debe devolver true o false. Durante la ejecución de la búsqueda, si el resultado de la fórmula no es un booleano, se considera como false. * dentro de la *fórmula*, la entidad está disponible a través del objeto `This`. * si el objeto `Formula` es **null**, se genera el error 1626 ("Esperando un texto o una fórmula"), que llama a interceptar utilizando un método instalado con `ON ERR CALL`. > Por razones de seguridad, las llamadas a fórmulas dentro de las funciones `query()` pueden ser desestimadas. Ver la descripción del parámetro *querySettings*. -**Pasar parámetros a las fórmulas** +#### Passing parameters to formulas -Todo parámetro *formula* llamado por la función `query()` puede recibir parámetros: +Any *formula* called by the `query()` class function can receive parameters: * Los parámetros deben pasarse a través de la propiedad **args** (objeto) del parámetro *querySettings*. * La fórmula recibe este objeto **args** como parámetro **$1**. -Este pequeño código muestra los principios de cómo se pasan los parámetros a los métodos: +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //objeto args a pasar los parámetros $es:=ds.Students.query("eval(checkName($1.exclude))";$settings) //args se recibe en $1 ``` -En el ejemplo 3 se ofrecen más ejemplos. +Additional examples are provided in example 3. -**4D Server**: en cliente/servidor, las fórmulas se ejecutan en el servidor. En este contexto, sólo se envía a las fórmulas el objeto `querySettings.args`. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**Parámetro querySettings** +#### querySettings parameter -En el parámetro *querySettings* se puede pasar un objeto que contenga opciones adicionales. Se soportan las siguientes propiedades: +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propiedad | Tipo | Descripción | | ------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1114,11 +1171,11 @@ En el parámetro *querySettings* se puede pasar un objeto que contenga opciones | queryPlan | Boolean | En la entity selection resultante, devuelve o no la descripción detallada de la búsqueda justo antes de que se ejecute, es decir, la búsqueda planificada. La propiedad devuelta es un objeto que incluye cada búsqueda y sub búsqueda prevista (en el caso de una búsqueda compleja). Esta opción es útil durante la fase de desarrollo de una aplicación. Suele utilizarse junto con queryPath. Por defecto si se omite: false. **Nota**: esta propiedad sólo la soportan las funciones `entitySelection.query()` y `dataClass.query()`. | | queryPath | Boolean | En la entity selection resultante, devuelve o no la descripción detallada de la búsqueda tal cual es realizada. La propiedad devuelta es un objeto que contiene la ruta utilizada para la búsqueda (normalmente idéntica a la de queryPlan, pero puede diferir si el motor consigue optimizar la búsqueda), así como el tiempo de procesamiento y el número de registros encontrados. Esta opción es útil durante la fase de desarrollo de una aplicación. Por defecto si se omite: false. **Nota**: esta propiedad sólo la soportan las funciones `entitySelection.query()` y `dataClass.query()`. | -**Sobre queryPlan y queryPath** +#### About queryPlan and queryPath -La información registrada en `queryPlan`/`queryPath` incluye el tipo de búsqueda (indexada y secuencial) y cada subconsulta necesaria junto con los operadores de conjunción. Las rutas de acceso de las peticiones también contienen el número de entidades encontradas y el tiempo necesario para ejecutar cada criterio de búsqueda. Las rutas de acceso de las peticiones también contienen el número de entidades encontradas y el tiempo necesario para ejecutar cada criterio de búsqueda. Generalmente, la descripción del plan de consulta y su ruta de acceso son idénticas, pero pueden diferir porque 4D puede implementar optimizaciones dinámicas cuando se ejecuta una consulta para mejorar el rendimiento. Por ejemplo, el motor 4D puede convertir dinámicamente una consulta indexada en una secuencial si estima que es más rápida. Este caso concreto puede darse cuando el número de entidades que se buscan es bajo. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Por ejemplo, si ejecuta la siguiente búsqueda: +For example, if you execute the following query: ```4d $sel:=ds.Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ @@ -1147,46 +1204,46 @@ queryPath: #### Ejemplo 1 -Esta sección ofrece varios ejemplos de búsquedas. +This section provides various examples of queries. -Consultas en una cadena: +Query on a string: ```4d $entitySelection:=ds.Customer.query("firstName = 'S@'") ``` -Búsqueda con una instrucción NOT: +Query with a NOT statement: ```4d $entitySelection:=ds.Employee.query("not(firstName=Kim)") ``` -Búsquedas con fechas: +Queries with dates: ```4d $entitySelection:=ds.Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds.Employee.query("birthDate <= :1";Current date-10950) ``` -Búsqueda con marcadores de posición indexados para los valores: +Query with indexed placeholders for values: ```4d $entitySelection:=ds.Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Búsqueda con marcadores de posición indexados para valores en una dataclass relacionada: +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds.Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Búsqueda con marcador de posición indexado que incluye una instrucción de orden descendente: +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds.Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Búsqueda con marcadores de posición con nombre para los valores: +Query with named placeholders for values: ```4d var $querySettings : Object @@ -1196,7 +1253,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Búsqueda que utiliza marcadores de posición con nombre e indexados para los valores: +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -1205,7 +1262,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds.Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Búsqueda con objetos queryPlan y queryPath: +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds.Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -1216,19 +1273,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Búsqueda con una ruta de atributo de tipo Collection: +Query with an attribute path of Collection type: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Búsqueda con una ruta de atributos de tipo Collection y atributos vinculados: +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Búsqueda con una ruta de atributos de tipo Collection y múltiples atributos vinculados: +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1236,25 +1293,25 @@ $entitySelection:=ds.Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Búsqueda con una ruta de atributo de tipo Objeto: +Query with an attribute path of Object type: ```4d $entitySelection:=ds.Employee.query("extra.eyeColor = :1";"blue") ``` -Búsqueda con una instrucción IN: +Query with an IN statement: ```4d $entitySelection:=ds.Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Búsqueda con instrucción NOT (IN): +Query with a NOT (IN) statement: ```4d $entitySelection:=ds.Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Búsqueda con marcadores de posición indexados para los atributos: +Query with indexed placeholders for attributes: ```4d var $es : cs.EmployeeSelection @@ -1262,7 +1319,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") //salesperson es una entidad relacionada ``` -Búsqueda con marcadores de posición indexados para los atributos y marcadores de posición con nombre para los valores: +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs.EmployeeSelection @@ -1273,7 +1330,7 @@ $es:=ds.Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId";" //salesperson es una entidad relacionada ``` -Búsqueda con marcadores de posición indexados para los atributos y los valores: +Query with indexed placeholders for attributes and values: ```4d var $es : cs.EmployeeSelection @@ -1283,11 +1340,11 @@ $es:=ds.Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smith #### Ejemplo 2 -Esta sección ilustra las búsquedas con marcadores de posición con nombre para los atributos. +This section illustrates queries with named placeholders for attributes. -Dada una dataclass Employee con 2 entidades: +Given an Employee dataclass with 2 entities: -Entidad 1: +Entity 1: ```4d name: "Marie" @@ -1299,7 +1356,7 @@ softwares:{ } ``` -Entidad 2: +Entity 2: ```4d name: "Sophie" @@ -1311,7 +1368,7 @@ softwares:{ } ``` -Búsqueda con marcadores de posición con nombre para los atributos: +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1322,7 +1379,7 @@ Búsqueda con marcadores de posición con nombre para los atributos: //$es.length=1 (Employee Marie) ``` -Búsqueda con marcadores de posición con nombre para los atributos y los valores: +Query with named placeholders for attributes and values: ```4d @@ -1343,16 +1400,16 @@ Búsqueda con marcadores de posición con nombre para los atributos y los valore #### Ejemplo 3 -Estos ejemplos ilustran las distintas formas de utilizar fórmulas con o sin parámetros en sus búsquedas. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -La fórmula se da como texto con `eval()` en el parámetro *queryString*: +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs.StudentsSelection $es:=ds.Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -La fórmula se da como un objeto `Formula` a través de un marcador de posición: +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs.StudentsSelection @@ -1361,7 +1418,7 @@ La fórmula se da como un objeto `Formula` a través de un marcador de posición $es:=ds.Students.query(":1 and nationality='French'";$formula) ``` -Sólo se da como criterio un objeto `Formula`: +Only a `Formula` object is given as criteria: ```4d var $es : cs.StudentsSelection @@ -1370,7 +1427,7 @@ Sólo se da como criterio un objeto `Formula`: $es:=ds.Students.query($formula) ``` -Se pueden aplicar varias fórmulas: +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1379,7 +1436,7 @@ Se pueden aplicar varias fórmulas: $0:=ds.Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Una fórmula texto en *queryString* recibe un parámetro: +A text formula in *queryString* receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1395,7 +1452,7 @@ Una fórmula texto en *queryString* recibe un parámetro: $result:=(Position($exclude;This.lastname)=0) ``` -Utilizando el mismo método ***checkName***, un objeto `Formula` como marcador de posición recibe un parámetro: +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs.StudentsSelection @@ -1408,7 +1465,7 @@ Utilizando el mismo método ***checkName***, un objeto `Formula` como marcador d $es:=ds.Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su consulta: +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs.StudentsSelection @@ -1423,7 +1480,7 @@ Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su #### Ver también -[`.query()`](EntitySelectionClass.md#query) para selecciones de entidades +[`.query()`](EntitySelectionClass.md#query) for entity selections @@ -1437,13 +1494,13 @@ Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su -**.setRemoteCacheSettings**(*settings*: Object) +**.setRemoteCacheSettings**(*settings* : Object) -| Parámetros | Tipo | | Descripción | -| ---------- | ------ | -- | ----------------------------------------------------------------------------------------------------------------------- | -| settings | Object | -> | Objeto que define el tiempo de espera y el tamaño máximo de la caché ORDA para el dataclass.| +| Parámetros | Tipo | | Descripción | +| ---------- | ------ | -- | ------------------------------------------------------------------------------------------------------------- | +| settings | Object | -> | Object that sets the timeout and maximum size of the ORDA cache for the dataclass.| | @@ -1451,30 +1508,30 @@ Queremos desautorizar las fórmulas, por ejemplo, cuando el usuario introduce su #### Descripción -La función `.setRemoteCacheSettings()` define el tiempo de espera y el tamaño máximo de la caché ORDA para una clase de datos.. +The `.setRemoteCacheSettings()` function sets the timeout and maximum size of the ORDA cache for a dataclass.. -En el parámetro *settings*, pase un objeto con las siguientes propiedades: +In the *settings* parameter, pass an object with the following properties: | Propiedad | Tipo | Descripción | | ---------- | ------- | ----------------------------- | | timeout | Integer | Tiempo de espera en segundos. | | maxEntries | Integer | Número máximo de entidades. | -`timeout` define el tiempo de espera de la caché ORDA para la dataclass (por defecto es 30 segundos). Una vez transcurrido el tiempo de espera, las entidades de la dataclass en la caché son consideradas como vencidas. Esto significa que: +`timeout` sets the timeout of the ORDA cache for the dataclass (default is 30 seconds). Once the timeout has passed, the entities of the dataclass in the cache are considered as expired. This means that: * los datos siguen estando ahí * la próxima vez que se necesiten los datos, se le pedirán al servidor * 4D elimina automáticamente los datos caducados cuando se alcanza el número máximo de entidades -Definir la propiedad `timeout` define un nuevo timeout para las entidades ya presentes en la caché. Es útil cuando se trabaja con los datos que no cambian con mucha frecuencia y, por tanto, cuando no son necesarias nuevas peticiones al servidor. +Setting a `timeout` property sets a new timeout for the entities already present in the cache. It is useful when working with data that does not change very frequently, and thus when new requests to the server are not necessary. -`maxEntries` define el número máximo de entidades en la caché ORDA. Por defecto es 30 000. +`maxEntries` sets the max number of entities in the ORDA cache. Default is 30 000. -El número de entradas mínimo es 300, por lo que el valor de `maxEntries` debe ser igual o superior a 300. En caso contrario, se ignora y el número máximo de entradas se fija en 300. +The minimum number of entries is 300, so the value of `maxEntries` must be equal to or higher than 300. Otherwise it is ignored and the maximum number of entries is set to 300. -Si no se pasan propiedades válidas como `timeout` y `maxEntries`, la caché permanece sin cambios, con sus valores por defecto o previamente definidos. +If no valid properties are passed as `timeout` and `maxEntries`, the cache remains unchanged, with its default or previously set values. -Cuando se guarda una entidad, se actualiza en la caché y vence una vez alcanzado el timeout. +When an entity is saved, it is updated in the cache and expires once the timeout is reached. #### Ejemplo From a34830919848c1d5ccb1c458d473ed8e7fb13224 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:08:56 +0200 Subject: [PATCH 088/180] New translations DataStoreClass.md (Spanish) --- .../version-20-R2/API/DataStoreClass.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/DataStoreClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/DataStoreClass.md index 547d5c1b313c4c..5870ebd9d69d5a 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/DataStoreClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/DataStoreClass.md @@ -411,7 +411,7 @@ Quiere saber el número de tablas encriptadas en el archivo de datos actual: La función `.flushAndLock()` vacía la caché del datastore local e impide que los otros procesos realicen operaciones de escritura en la base de datos. El datastore se pone en un estado consistente y congelado. Es necesario llamar a esta función antes de ejecutar una instantánea de la aplicación, por ejemplo. -| +:::info Esta función sólo puede llamarse: @@ -1086,7 +1086,7 @@ End case La función `.startRequestLog()` inicia el registro de peticiones ORDA del lado del cliente o del lado del servidor. Está diseñado para fines de depuración en configuraciones cliente/servidor. -| +:::info Para una descripción del formato del registro de peticiones ORDA, consulte la sección [**Peticiones ORDA**](../Debugging/debugLogFiles.md#orda-requests). From a2e9f0540bfb72aad4d2c2f2e85c33eb7399df53 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:09:01 +0200 Subject: [PATCH 089/180] New translations EntityClass.md (Spanish) --- .../version-20-R2/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md index 49e7107cb280cc..b9d214a662f7cd 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md @@ -1700,7 +1700,7 @@ Si no se ha tocado ningún atributo de entidad, el método devuelve una colecci //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -En este caso: +In this case: * firstName y lastName tienen un tipo `storage` * employer tiene un tipo `relatedEntity` From 1b756bb110b3c5e7f1313789394ca6d00227b06a Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:09:11 +0200 Subject: [PATCH 090/180] New translations IMAPTransporterClass.md (Spanish) --- .../version-20-R2/API/IMAPTransporterClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/IMAPTransporterClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/IMAPTransporterClass.md index e46e051c39b573..b2ac41044bbe79 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/IMAPTransporterClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/IMAPTransporterClass.md @@ -1714,7 +1714,7 @@ El objeto `boxInfo` devuelto contiene las siguientes propiedades: | flags | text | Lista de banderas utilizadas actualmente para el buzón, separadas por espacios | | permanentFlags | text | Lista de banderas que el cliente puede cambiar permanentemente (excepto el indicador \Recent, que gestiona el servidor IMAP), separados por espacios | -| +:::info Si la cadena `permanentFlags` incluye la bandera especial \*, significa que el servidor soporta [banderas personalizadas](#addflags). From e05029ad05b8e95e13550a4ac93d3b86a82f3b27 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:09:16 +0200 Subject: [PATCH 091/180] New translations SessionClass.md (Spanish) --- .../version-20-R2/API/SessionClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/SessionClass.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/SessionClass.md index e5f8f46b9b14de..a98bc3781ce497 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/SessionClass.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/API/SessionClass.md @@ -324,7 +324,7 @@ La función `.setPrivileges()` c En *rangeObj*, pase el rango que quiere nombrar, y pase el nuevo nombre del rango en *name*. Si el nombre ya se utiliza en el mismo alcance, el nuevo rango nombrado sustituye al existente. Tenga en cuenta que puede utilizar el mismo nombre para diferentes alcances (ver más adelante). -Puede pasar un objeto con las propiedades adicionales para el rango nombrado en *options*. Se soportan las siguientes propiedades: +Puede pasar un objeto con las propiedades adicionales para el rango nombrado en *options*. The following properties are supported: | Propiedad | Tipo | Descripción | | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1159,7 +1159,7 @@ En el parámetro *rangeObj*, pase un objeto que contenga un rango a buscar. El parámetro *searchValue* permite pasar el texto a buscar dentro del *rangeObj*. -Puede pasar el parámetro opcional *searchCondition* para especificar el funcionamiento de la búsqueda. Se soportan las siguientes propiedades: +Puede pasar el parámetro opcional *searchCondition* para especificar el funcionamiento de la búsqueda. The following properties are supported: | Propiedad | Tipo | Descripción | | ----------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -3485,7 +3485,7 @@ VP NEW DOCUMENT("myVPArea") El comando `VP Object to font` devuelve una cadena de caracteres de *fontObj*. -En *fontObj*, pase un objeto que contenga las propiedades de fuente. Se soportan las siguientes propiedades: +En *fontObj*, pase un objeto que contenga las propiedades de fuente. The following properties are supported: | Propiedad | Tipo | Descripción | Valores posibles | Obligatorio | | --------- | ---- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | From 3e0402b73468b69bda5d35b6325b65e6c2731d5e Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:24:44 +0200 Subject: [PATCH 111/180] New translations overview.md (Spanish) --- .../version-20-R2/code-editor/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/code-editor/overview.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/code-editor/overview.md index 1c2bc2a62d9d38..39109bb721163c 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/code-editor/overview.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/code-editor/overview.md @@ -82,7 +82,7 @@ Con 4D Server, el nombre del método se cambia en el servidor cuando se termina ::: -| +:::info Los métodos base no pueden ser renombrados. Lo mismo ocurre con los triggers, los métodos formulario y los métodos objeto, que están vinculados a los objetos y toman sus nombre del objeto en cuestión. From d724aeb49a0a733cdd4edf0ea1211ce3369fb85e Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:24:45 +0200 Subject: [PATCH 112/180] New translations write-class-method.md (Spanish) --- .../version-20-R2/code-editor/write-class-method.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/code-editor/write-class-method.md b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/code-editor/write-class-method.md index 6a3efdd3d935c1..5bc11ad7ec9aa2 100644 --- a/i18n/es/docusaurus-plugin-content-docs/version-20-R2/code-editor/write-class-method.md +++ b/i18n/es/docusaurus-plugin-content-docs/version-20-R2/code-editor/write-class-method.md @@ -614,7 +614,7 @@ Los marcadores se gestionan utilizando el submenú **Marcadores** del menú **M - **Eliminar todo**: elimina todos los marcadores de la ventana en primer plano. - **Ir al siguiente** / **Ir al anterior**: permite navegar entre los marcadores de la ventana. Al seleccionar uno de estos comandos, el cursor se sitúa en el primer caracter de la línea asociada al marcador en cuestión. También puede utilizar los atajos de teclado **F3** (ir a la siguiente) o **Mayús+F3** (ir a la anterior). -| +:::info Puede utilizar marcadores como señalizadores de líneas que contengan un elemento [encontrado mediante una búsqueda](#find). En este caso, 4D añade automáticamente los marcadores. Para más información, consulte [Marcar todos](#bookmark-all). From 26a8dd7a298ddd3fb5d4dd41690525345522371e Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:25:10 +0200 Subject: [PATCH 113/180] New translations DataClassClass.md (German) --- .../current/API/DataClassClass.md | 111 +++++++++++++----- 1 file changed, 84 insertions(+), 27 deletions(-) diff --git a/i18n/de/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/de/docusaurus-plugin-content-docs/current/API/DataClassClass.md index a56126d4a482cf..8010a61fe81ddb 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/API/DataClassClass.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/API/DataClassClass.md @@ -851,7 +851,7 @@ The `.query()` function searches for If no matching entities are found, an empty `EntitySelection` is returned. -**queryString parameter** +#### queryString parameter The *queryString* parameter uses the following syntax: @@ -863,7 +863,7 @@ attributePath|formula comparator value where: -* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. Each value is a path that can designate either a scalar or a related attribute of the dataclass or a property in an object field of the dataclass +* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > *You cannot use directly attributes whose name contains special characters such as ".", "\[ ]", or "=", ">", "#"..., because they will be incorrectly evaluated in the query string. If you need to query on such attributes, you must consider using placeholders, which allow an extended range of characters in attribute paths (see* **Using placeholders** *below).* * **formula**: a valid formula passed as `Text` or `Object`. The formula will be evaluated for each processed entity and must return a boolean value. Within the formula, the entity is available through the `This` object. @@ -879,19 +879,19 @@ where: * **comparator**: symbol that compares *attributePath* and *value*. The following symbols are supported: - | Comparison | Symbol(s) | Kommentar | - | ------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------------- | - | Equal to | =, == | Gets matching data, supports the wildcard (@), neither case-sensitive nor diacritic. | - | | ===, IS | Gets matching data, considers the @ as a standard character, neither case-sensitive nor diacritic | - | Not equal to | #, != | Supports the wildcard (@) | - | | !==, IS NOT | Considers the @ as a standard character | - | Kleiner als | < | | - | Größer als | > | | - | Kleiner als oder gleich | <= | | - | Größer als oder gleich | >= | | - | Included in | IN | Gets data equal to at least one of the values in a collection or in a set of values, supports the wildcard (@) | - | Not condition applied on a statement | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators | - | Mit Schlüsselwort | % | Keywords can be used in attributes of string or picture type | + | Comparison | Symbol(s) | Kommentar | + | ------------------------------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Equal to | =, == | Gets matching data, supports the wildcard (@), neither case-sensitive nor diacritic. | + | | ===, IS | Gets matching data, considers the @ as a standard character, neither case-sensitive nor diacritic | + | Not equal to | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considers the @ as a standard character | + | Not condition applied on a statement | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Kleiner als | < | | + | Größer als | > | | + | Kleiner als oder gleich | <= | | + | Größer als oder gleich | >= | | + | Included in | IN | Gets data equal to at least one of the values in a collection or in a set of values, supports the wildcard (@) | + | Mit Schlüsselwort | % | Keywords can be used in attributes of string or picture type | * **value**: the value to compare to the current value of the property of each entity in the entity selection or element in the collection. It can be a **placeholder** (see **Using placeholders** below) or any expression matching the data type property. When using a constant value, the following rules must be respected: * **text** type constant can be passed with or without simple quotes (see **Using quotes** below). To query a string within a string (a "contains" query), use the wildcard symbol (@) in value to isolate the string to be searched for as shown in this example: "@Smith@". The following keywords are forbidden for text constants: true, false. @@ -909,7 +909,7 @@ where: * **order by attributePath**: you can include an order by *attributePath* statement in the query so that the resulting data will be sorted according to that statement. You can use multiple order by statements, separated by commas (e.g., order by *attributePath1* desc, *attributePath2* asc). By default, the order is ascending. Pass 'desc' to define a descending order and 'asc' to define an ascending order. >If you use this statement, the returned entity selection is ordered (for more information, please refer to [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Using quotes** +#### Using quotes When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Beispiel: @@ -918,7 +918,7 @@ When you use quotes within queries, you must use single quotes ' ' inside the qu ``` > Single quotes (') are not supported in searched values since they would break the query string. For example "comp.name = 'John's pizza' " will generate an error. If you need to search on values with single quotes, you may consider using placeholders (see below). -**Using parenthesis** +#### Using parenthesis You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: @@ -926,7 +926,7 @@ You can use parentheses in the query to give priority to the calculation. For ex "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Using placeholders** +#### Using placeholders 4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. @@ -966,11 +966,11 @@ Using placeholders in queries **is recommended** for the following reasons: 3. It allows the use of variables or expressions in query arguments. Beispiele: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Looking for null values** +#### Looking for null values When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: @@ -984,7 +984,62 @@ You will not get the expected result because the null value will be evaluated by $vSingles:=ds.Person.query("spouse = null") //correct syntax ``` -**Linking collection attribute query arguments** +#### Not equal to in collections + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + + +#### Linking collection attribute query arguments :::info @@ -1039,7 +1094,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; ... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Queries in many-to-many relations** +#### Queries in many-to-many relations ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: @@ -1071,7 +1126,9 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es contains movies (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**formula parameter** + + +#### formula parameter As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. @@ -1082,7 +1139,7 @@ The formula must have been created using the [`Formula`](FunctionClass.md#formul * if the `Formula` object is **null**, the error 1626 ("Expecting a text or formula") is generated, that you call intercept using a method installed with `ON ERR CALL`. > For security reasons, formula calls within `query()` functions can be disallowed. See *querySettings* parameter description. -**Passing parameters to formulas** +#### Passing parameters to formulas Any *formula* called by the `query()` class function can receive parameters: @@ -1100,7 +1157,7 @@ Additional examples are provided in example 3. **4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**querySettings parameter** +#### querySettings parameter In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: @@ -1114,9 +1171,9 @@ In the *querySettings* parameter, you can pass an object containing additional o | queryPlan | Boolean | In the resulting entity selection, returns or does not return the detailed description of the query just before it is executed, i.e. the planned query. The returned property is an object that includes each planned query and subquery (in the case of a complex query). This option is useful during the development phase of an application. It is usually used in conjunction with queryPath. Default if omitted: false. **Note**: This property is supported only by the `entitySelection.query()` and `dataClass.query()` functions. | | queryPath | Boolean | In the resulting entity selection, returns or does not return the detailed description of the query as it is actually performed. The returned property is an object that contains the actual path used for the query (usually identical to that of the queryPlan, but may differ if the engine manages to optimize the query), as well as the processing time and the number of records found. This option is useful during the development phase of an application. Default if omitted: false. **Note**: This property is supported only by the `entitySelection.query()` and `dataClass.query()` functions. | -**About queryPlan and queryPath** +#### About queryPlan and queryPath -The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. For example, if you execute the following query: From 870c55d7d6855fb768fb9e26378a2fd7e3328e20 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 10:49:14 +0200 Subject: [PATCH 114/180] New translations DataClassClass.md (German) --- .../version-19/API/DataClassClass.md | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/i18n/de/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md b/i18n/de/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md index b80bc22af43bca..3670384e2deab0 100644 --- a/i18n/de/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md +++ b/i18n/de/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md @@ -481,8 +481,10 @@ The ***SearchDuplicate*** project method searches for duplicated values in any d | --------- | ------ | -- | ------------------------------------------------------- | | Ergebnis | Objekt | <- | Information on the dataclass| + | + #### Beschreibung The `.getInfo( )` function returns an object providing information about the dataclass. This function is useful for setting up generic code. @@ -783,6 +785,61 @@ You will not get the expected result because the null value will be evaluated by $vSingles:=ds.Person.query("spouse = null") //correct syntax ``` + +**Not equal to in collections** + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + **Linking collection attribute query arguments** :::info @@ -882,7 +939,7 @@ In the *querySettings* parameter, you can pass an object containing additional o **About queryPlan and queryPath** -The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. For example, if you execute the following query: From 32cc8d6a8d36f6fe992aa5cb2d4b14198a10b667 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 11:03:03 +0200 Subject: [PATCH 115/180] New translations DataClassClass.md (German) --- .../version-20/API/DataClassClass.md | 111 +++++++++++++----- 1 file changed, 84 insertions(+), 27 deletions(-) diff --git a/i18n/de/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md b/i18n/de/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md index a56126d4a482cf..8010a61fe81ddb 100644 --- a/i18n/de/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md +++ b/i18n/de/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md @@ -851,7 +851,7 @@ The `.query()` function searches for If no matching entities are found, an empty `EntitySelection` is returned. -**queryString parameter** +#### queryString parameter The *queryString* parameter uses the following syntax: @@ -863,7 +863,7 @@ attributePath|formula comparator value where: -* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. Each value is a path that can designate either a scalar or a related attribute of the dataclass or a property in an object field of the dataclass +* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > *You cannot use directly attributes whose name contains special characters such as ".", "\[ ]", or "=", ">", "#"..., because they will be incorrectly evaluated in the query string. If you need to query on such attributes, you must consider using placeholders, which allow an extended range of characters in attribute paths (see* **Using placeholders** *below).* * **formula**: a valid formula passed as `Text` or `Object`. The formula will be evaluated for each processed entity and must return a boolean value. Within the formula, the entity is available through the `This` object. @@ -879,19 +879,19 @@ where: * **comparator**: symbol that compares *attributePath* and *value*. The following symbols are supported: - | Comparison | Symbol(s) | Kommentar | - | ------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------------- | - | Equal to | =, == | Gets matching data, supports the wildcard (@), neither case-sensitive nor diacritic. | - | | ===, IS | Gets matching data, considers the @ as a standard character, neither case-sensitive nor diacritic | - | Not equal to | #, != | Supports the wildcard (@) | - | | !==, IS NOT | Considers the @ as a standard character | - | Kleiner als | < | | - | Größer als | > | | - | Kleiner als oder gleich | <= | | - | Größer als oder gleich | >= | | - | Included in | IN | Gets data equal to at least one of the values in a collection or in a set of values, supports the wildcard (@) | - | Not condition applied on a statement | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators | - | Mit Schlüsselwort | % | Keywords can be used in attributes of string or picture type | + | Comparison | Symbol(s) | Kommentar | + | ------------------------------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Equal to | =, == | Gets matching data, supports the wildcard (@), neither case-sensitive nor diacritic. | + | | ===, IS | Gets matching data, considers the @ as a standard character, neither case-sensitive nor diacritic | + | Not equal to | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considers the @ as a standard character | + | Not condition applied on a statement | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Kleiner als | < | | + | Größer als | > | | + | Kleiner als oder gleich | <= | | + | Größer als oder gleich | >= | | + | Included in | IN | Gets data equal to at least one of the values in a collection or in a set of values, supports the wildcard (@) | + | Mit Schlüsselwort | % | Keywords can be used in attributes of string or picture type | * **value**: the value to compare to the current value of the property of each entity in the entity selection or element in the collection. It can be a **placeholder** (see **Using placeholders** below) or any expression matching the data type property. When using a constant value, the following rules must be respected: * **text** type constant can be passed with or without simple quotes (see **Using quotes** below). To query a string within a string (a "contains" query), use the wildcard symbol (@) in value to isolate the string to be searched for as shown in this example: "@Smith@". The following keywords are forbidden for text constants: true, false. @@ -909,7 +909,7 @@ where: * **order by attributePath**: you can include an order by *attributePath* statement in the query so that the resulting data will be sorted according to that statement. You can use multiple order by statements, separated by commas (e.g., order by *attributePath1* desc, *attributePath2* asc). By default, the order is ascending. Pass 'desc' to define a descending order and 'asc' to define an ascending order. >If you use this statement, the returned entity selection is ordered (for more information, please refer to [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Using quotes** +#### Using quotes When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Beispiel: @@ -918,7 +918,7 @@ When you use quotes within queries, you must use single quotes ' ' inside the qu ``` > Single quotes (') are not supported in searched values since they would break the query string. For example "comp.name = 'John's pizza' " will generate an error. If you need to search on values with single quotes, you may consider using placeholders (see below). -**Using parenthesis** +#### Using parenthesis You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: @@ -926,7 +926,7 @@ You can use parentheses in the query to give priority to the calculation. For ex "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Using placeholders** +#### Using placeholders 4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. @@ -966,11 +966,11 @@ Using placeholders in queries **is recommended** for the following reasons: 3. It allows the use of variables or expressions in query arguments. Beispiele: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Looking for null values** +#### Looking for null values When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: @@ -984,7 +984,62 @@ You will not get the expected result because the null value will be evaluated by $vSingles:=ds.Person.query("spouse = null") //correct syntax ``` -**Linking collection attribute query arguments** +#### Not equal to in collections + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + + +#### Linking collection attribute query arguments :::info @@ -1039,7 +1094,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; ... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Queries in many-to-many relations** +#### Queries in many-to-many relations ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: @@ -1071,7 +1126,9 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es contains movies (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**formula parameter** + + +#### formula parameter As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. @@ -1082,7 +1139,7 @@ The formula must have been created using the [`Formula`](FunctionClass.md#formul * if the `Formula` object is **null**, the error 1626 ("Expecting a text or formula") is generated, that you call intercept using a method installed with `ON ERR CALL`. > For security reasons, formula calls within `query()` functions can be disallowed. See *querySettings* parameter description. -**Passing parameters to formulas** +#### Passing parameters to formulas Any *formula* called by the `query()` class function can receive parameters: @@ -1100,7 +1157,7 @@ Additional examples are provided in example 3. **4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**querySettings parameter** +#### querySettings parameter In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: @@ -1114,9 +1171,9 @@ In the *querySettings* parameter, you can pass an object containing additional o | queryPlan | Boolean | In the resulting entity selection, returns or does not return the detailed description of the query just before it is executed, i.e. the planned query. The returned property is an object that includes each planned query and subquery (in the case of a complex query). This option is useful during the development phase of an application. It is usually used in conjunction with queryPath. Default if omitted: false. **Note**: This property is supported only by the `entitySelection.query()` and `dataClass.query()` functions. | | queryPath | Boolean | In the resulting entity selection, returns or does not return the detailed description of the query as it is actually performed. The returned property is an object that contains the actual path used for the query (usually identical to that of the queryPlan, but may differ if the engine manages to optimize the query), as well as the processing time and the number of records found. This option is useful during the development phase of an application. Default if omitted: false. **Note**: This property is supported only by the `entitySelection.query()` and `dataClass.query()` functions. | -**About queryPlan and queryPath** +#### About queryPlan and queryPath -The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. For example, if you execute the following query: From d3dbbaf946ff9e98cce504c358f62e087304e434 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 11:19:29 +0200 Subject: [PATCH 116/180] New translations DataClassClass.md (German) --- .../version-20-R2/API/DataClassClass.md | 111 +++++++++++++----- 1 file changed, 84 insertions(+), 27 deletions(-) diff --git a/i18n/de/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md b/i18n/de/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md index a56126d4a482cf..8010a61fe81ddb 100644 --- a/i18n/de/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md +++ b/i18n/de/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md @@ -851,7 +851,7 @@ The `.query()` function searches for If no matching entities are found, an empty `EntitySelection` is returned. -**queryString parameter** +#### queryString parameter The *queryString* parameter uses the following syntax: @@ -863,7 +863,7 @@ attributePath|formula comparator value where: -* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. Each value is a path that can designate either a scalar or a related attribute of the dataclass or a property in an object field of the dataclass +* **Named placeholders for attribute paths** used in the *queryString* or *formula*. Attributes are expressed as property / value pairs, where property is the placeholder name inserted for an attribute path in the *queryString* or *formula* (":placeholder"), and value can be a string or a collection of strings. In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > *You cannot use directly attributes whose name contains special characters such as ".", "\[ ]", or "=", ">", "#"..., because they will be incorrectly evaluated in the query string. If you need to query on such attributes, you must consider using placeholders, which allow an extended range of characters in attribute paths (see* **Using placeholders** *below).* * **formula**: a valid formula passed as `Text` or `Object`. The formula will be evaluated for each processed entity and must return a boolean value. Within the formula, the entity is available through the `This` object. @@ -879,19 +879,19 @@ where: * **comparator**: symbol that compares *attributePath* and *value*. The following symbols are supported: - | Comparison | Symbol(s) | Kommentar | - | ------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------------- | - | Equal to | =, == | Gets matching data, supports the wildcard (@), neither case-sensitive nor diacritic. | - | | ===, IS | Gets matching data, considers the @ as a standard character, neither case-sensitive nor diacritic | - | Not equal to | #, != | Supports the wildcard (@) | - | | !==, IS NOT | Considers the @ as a standard character | - | Kleiner als | < | | - | Größer als | > | | - | Kleiner als oder gleich | <= | | - | Größer als oder gleich | >= | | - | Included in | IN | Gets data equal to at least one of the values in a collection or in a set of values, supports the wildcard (@) | - | Not condition applied on a statement | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators | - | Mit Schlüsselwort | % | Keywords can be used in attributes of string or picture type | + | Comparison | Symbol(s) | Kommentar | + | ------------------------------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Equal to | =, == | Gets matching data, supports the wildcard (@), neither case-sensitive nor diacritic. | + | | ===, IS | Gets matching data, considers the @ as a standard character, neither case-sensitive nor diacritic | + | Not equal to | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considers the @ as a standard character | + | Not condition applied on a statement | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Kleiner als | < | | + | Größer als | > | | + | Kleiner als oder gleich | <= | | + | Größer als oder gleich | >= | | + | Included in | IN | Gets data equal to at least one of the values in a collection or in a set of values, supports the wildcard (@) | + | Mit Schlüsselwort | % | Keywords can be used in attributes of string or picture type | * **value**: the value to compare to the current value of the property of each entity in the entity selection or element in the collection. It can be a **placeholder** (see **Using placeholders** below) or any expression matching the data type property. When using a constant value, the following rules must be respected: * **text** type constant can be passed with or without simple quotes (see **Using quotes** below). To query a string within a string (a "contains" query), use the wildcard symbol (@) in value to isolate the string to be searched for as shown in this example: "@Smith@". The following keywords are forbidden for text constants: true, false. @@ -909,7 +909,7 @@ where: * **order by attributePath**: you can include an order by *attributePath* statement in the query so that the resulting data will be sorted according to that statement. You can use multiple order by statements, separated by commas (e.g., order by *attributePath1* desc, *attributePath2* asc). By default, the order is ascending. Pass 'desc' to define a descending order and 'asc' to define an ascending order. >If you use this statement, the returned entity selection is ordered (for more information, please refer to [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Using quotes** +#### Using quotes When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Beispiel: @@ -918,7 +918,7 @@ When you use quotes within queries, you must use single quotes ' ' inside the qu ``` > Single quotes (') are not supported in searched values since they would break the query string. For example "comp.name = 'John's pizza' " will generate an error. If you need to search on values with single quotes, you may consider using placeholders (see below). -**Using parenthesis** +#### Using parenthesis You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: @@ -926,7 +926,7 @@ You can use parentheses in the query to give priority to the calculation. For ex "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Using placeholders** +#### Using placeholders 4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. @@ -966,11 +966,11 @@ Using placeholders in queries **is recommended** for the following reasons: 3. It allows the use of variables or expressions in query arguments. Beispiele: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Looking for null values** +#### Looking for null values When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: @@ -984,7 +984,62 @@ You will not get the expected result because the null value will be evaluated by $vSingles:=ds.Person.query("spouse = null") //correct syntax ``` -**Linking collection attribute query arguments** +#### Not equal to in collections + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + + +#### Linking collection attribute query arguments :::info @@ -1039,7 +1094,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; ... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Queries in many-to-many relations** +#### Queries in many-to-many relations ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: @@ -1071,7 +1126,9 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es contains movies (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**formula parameter** + + +#### formula parameter As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. @@ -1082,7 +1139,7 @@ The formula must have been created using the [`Formula`](FunctionClass.md#formul * if the `Formula` object is **null**, the error 1626 ("Expecting a text or formula") is generated, that you call intercept using a method installed with `ON ERR CALL`. > For security reasons, formula calls within `query()` functions can be disallowed. See *querySettings* parameter description. -**Passing parameters to formulas** +#### Passing parameters to formulas Any *formula* called by the `query()` class function can receive parameters: @@ -1100,7 +1157,7 @@ Additional examples are provided in example 3. **4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**querySettings parameter** +#### querySettings parameter In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: @@ -1114,9 +1171,9 @@ In the *querySettings* parameter, you can pass an object containing additional o | queryPlan | Boolean | In the resulting entity selection, returns or does not return the detailed description of the query just before it is executed, i.e. the planned query. The returned property is an object that includes each planned query and subquery (in the case of a complex query). This option is useful during the development phase of an application. It is usually used in conjunction with queryPath. Default if omitted: false. **Note**: This property is supported only by the `entitySelection.query()` and `dataClass.query()` functions. | | queryPath | Boolean | In the resulting entity selection, returns or does not return the detailed description of the query as it is actually performed. The returned property is an object that contains the actual path used for the query (usually identical to that of the queryPlan, but may differ if the engine manages to optimize the query), as well as the processing time and the number of records found. This option is useful during the development phase of an application. Default if omitted: false. **Note**: This property is supported only by the `entitySelection.query()` and `dataClass.query()` functions. | -**About queryPlan and queryPath** +#### About queryPlan and queryPath -The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. Query paths also contain the number of entities found and the time required to execute each search criterion. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. For example, if you execute the following query: From 39e1ad5e20dc7589cf4764f242b712acd2ce7c30 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 11:35:53 +0200 Subject: [PATCH 117/180] New translations DataClassClass.md (Japanese) --- .../current/API/DataClassClass.md | 141 ++++++++++++------ 1 file changed, 99 insertions(+), 42 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md index f23050be40e2f2..9a1602f4a63e01 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/API/DataClassClass.md @@ -851,7 +851,7 @@ $cacheAddress:=$ds.Adress.getRemoteCache() エンティティが見つからない場合、空のエンティティセレクションが返されます。 -**queryString 引数** +#### queryString 引数 *queryString* 引数には、以下のシンタックスを使用します: @@ -863,7 +863,7 @@ attributePath|formula 比較演算子 値 詳細は以下の通りです: -* **attributePath**: クエリの実行対象となる属性パス。 この引数は、単純な名前 ("country" など) のほか、あらゆる有効な属性パス ("country.name" など) の形をとることができます。 属性パスが `Collection` 型である場合、すべてのオカレンスを管理するには\[ ] 記法を使用してください (例: "children\[ ].age" など)。 +* **attributePath**: クエリの実行対象となる属性パス。 この引数は、単純な名前 ("country" など) のほか、あらゆる有効な属性パス ("country.name" など) の形をとることができます。 属性パスが `Collection` 型である場合、すべてのオカレンスを管理するには `[]` 記法を使用してください (例: `children[].age` など)。 > *".", "\[ ]", や "=", ">", "#"..., などの特殊文字はクエリ文字列の中で正しく評価されないため、これらが含まれた属性名を直接使用することはできません。 このような属性をクエリするには、プレースホルダーの使用を検討します。これにより、属性パス内で使用できる文字の範囲が広がります (後述の* **プレースホルダーの使用** *参照)。* * **formula**: テキストまたはオブジェクト形式で渡された有効なフォーミュラ。 フォーミュラは処理されるエンティティごとに評価され、ブール値を返さなくてはなりません。 処理中のエンティティはフォーミュラ内において `This` で参照されます。 @@ -879,19 +879,19 @@ attributePath|formula 比較演算子 値 * **比較演算子**: *attributePath* 引数と *value* 引数の比較に使用する記号 以下の記号がサポートされます: - | 比較 | 記号 | 説明 | - | ------------- | ----------- | ---------------------------------------------------------------- | - | 等しい | =, == | 一致するデータを取得します。ワイルドカード (@) をサポートし、文字の大小/アクセントの有無は区別しません。 | - | | ===, IS | 一致するデータを取得します。ワイルドカード (@) は標準の文字として認識され、文字の大小/アクセント記号の有無は区別しません。 | - | 等しくない | #, != | ワイルドカード (@) をサポートします | - | | !==, IS NOT | ワイルドカード (@) は標準の文字として認識されます | - | 小さい | < | | - | 大きい | > | | - | 以下 | <= | | - | 以上 | >= | | - | 含まれる | IN | コレクション、あるいは複数の値のうち、どれか一つの値と等しいデータを取得します。ワイルドカード (@) をサポートします。 | - | 宣言に Not 条件を適用 | NOT | 複数の演算子が含まれる宣言の前に NOT を使用する場合にはカッコをつける必要があります。 | - | キーワードを含む | % | キーワードは、文字列あるいはピクチャー型の属性内で使用されるものが対象です。 | + | 比較 | 記号 | 説明 | + | ------------- | ----------- | --------------------------------------------------------------------------------------- | + | 等しい | =, == | 一致するデータを取得します。ワイルドカード (@) をサポートし、文字の大小/アクセントの有無は区別しません。 | + | | ===, IS | 一致するデータを取得します。ワイルドカード (@) は標準の文字として認識され、文字の大小/アクセント記号の有無は区別しません。 | + | 等しくない | #, != | ワイルドカード (@) をサポートします。 "宣言に Not 条件を適用" と同じです ([後述参照](#コレクションにおける-等しくない)) | + | | !==, IS NOT | ワイルドカード (@) は標準の文字として認識されます | + | 宣言に Not 条件を適用 | NOT | 複数の演算子が含まれる宣言の前に NOT を使用する場合にはカッコをつける必要があります。 "等しくない" と同じです ([後述参照](#コレクションにおける-等しくない)) | + | 小さい | < | | + | 大きい | > | | + | 以下 | <= | | + | 以上 | >= | | + | 含まれる | IN | コレクション、あるいは複数の値のうち、どれか一つの値と等しいデータを取得します。ワイルドカード (@) をサポートします。 | + | キーワードを含む | % | キーワードは、文字列あるいはピクチャー型の属性内で使用されるものが対象です。 | * **値**: コレクションの各要素、あるいはエンティティセレクションの各エンティティのプロパティのカレント値に対して比較する値。 **プレースホルダー** (後述の **プレースホルダーの使用** 参照) か、あるいはデータ型プロパティと同じ型の式を使用することができます。 定数値を使用する場合、以下の原則に従う必要があります: * **テキスト** テキスト型の定数値の場合は単一引用符つき、あるいはなしでも渡すことができます(後述の **引用符を使用する** 参照)。 文字列中の文字列を検索する ("含まれる" クエリ) には、ワイルドカード記号 (@) を使用して検索文字列を指定します (例: "@Smith@")。 また以下のキーワードはテキスト定数においては使用できません: true, false。 @@ -909,7 +909,7 @@ attributePath|formula 比較演算子 値 * **order by attributePath**: クエリに "order by attributePath" ステートメントを追加することで、結果をソートすることができます。 カンマで区切ることで、複数の order by ステートメントを使用することもできます (例: order by *attributePath1* desc, *attributePath2* asc)。 デフォルトの並び順は昇順です。 並び順を指定するには、降順の場合は 'desc'、昇順の場合は 'asc' を追加します。 >このステートメントを使用した場合、順序ありエンティティセレクションが返されます (詳細については [エンティティセレクションの順列あり/順列なし](ORDA/dsMapping.md#エンティティセレクションの順列あり順列なし) を参照ください)。 -**引用符を使用する** +#### 引用符を使用する クエリ内で引用符を使用する場合、クエリ内においては単一引用符 ' ' を使用し、クエリ全体をくくるには二重引用符 " " を使用します。クオートを混同するとエラーが返されます。 例: @@ -918,7 +918,7 @@ attributePath|formula 比較演算子 値 ``` > 単一引用符 (') は、クエリ文字列を分解してしまうため、検索値としてはサポートされていません。 たとえば、"comp.name = 'John's pizza' " はエラーを生成します。 単一引用符を含む値を検索するには、プレースホルダーを使用します (後述参照)。 -**カッコの使用** +#### カッコを使用する クエリ内でカッコを使用すると、計算に優先順位をつけることができます。 たとえば、以下のようにクエリを整理することができます: @@ -926,9 +926,9 @@ attributePath|formula 比較演算子 値 "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**プレースホルダーの使用** +#### プレースホルダーを使用する -4D では、*queryString* 引数内の *attributePath*、*formula* および *値* にプレースホルダーを使用することができます。 プレースホルダーとは、クエリ文字列に挿入するパラメーターで、クエリ文字列が評価される時に他の値で置き換えられるものです。 プレースホルダーの値はクエリ開始時に一度だけ評価されます。各要素に対して毎回評価されるわけではありません。 +4D では、*queryString* 引数内の *attributePath*、*formula* および *値* にプレースホルダーを使用することができます。 プレースホルダーとは、クエリ文字列に挿入するパラメーターで、クエリ文字列が評価される際に他の値で置き換えられるものです。 プレースホルダーの値はクエリ開始時に一度だけ評価されます。 各要素に対して毎回評価されるわけではありません。 プレースホルダーには二つの種類があります。**インデックスプレースホルダー** および **命名プレースホルダー** です: @@ -942,7 +942,7 @@ attributePath|formula 比較演算子 値 * 定数値 (プレースホルダーを使用しない) * インデックスプレースホルダーや命名プレースホルダー -以下の理由から、クエリでのプレースホルダーの使用が**推奨されます**: +以下の理由から、クエリでのプレースホルダーの使用が **推奨されます**: 1. 悪意あるコードの挿入を防ぎます: ユーザーによって値が代入された変数をクエリ文字列として直接使用した場合、余計なクエリ引数を入力することでユーザーがクエリ条件を変更する可能性があります。 たとえば、以下のようなクエリ文字列を考えます: @@ -966,13 +966,13 @@ attributePath|formula 比較演算子 値 3. クエリに変数や式を使用することができます。 例: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**null値の検索** +#### null値を検索する -null値を検索する場合、プレースホルダーシンタックスは使用できません。なぜならクエリエンジンは null を予期せぬ比較値としてみなすからです。 たとえば、以下のクエリを実行した場合: +null値を検索する場合、プレースホルダーシンタックスは使用できません。 なぜならクエリエンジンは null を予期せぬ比較値としてみなすからです。 たとえば、以下のクエリを実行した場合: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません @@ -984,7 +984,62 @@ $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません $vSingles:=ds.Person.query("spouse = null") // 正しいシンタックス ``` -**コレクション要素とクエリ条件のリンク** +#### コレクションにおける "等しくない" + +コレクションを含むデータクラス属性内を検索する場合、"*値* と等しくない" 比較演算子 (`#` または `!=`) は、すべてのプロパティが *値* と異なる要素を検索します (ほかの比較演算子とは異なり、少なくとも 1つのプロパティが *値* と異なる要素は検索しません)。 つまり、"Not(プロパティ値が *value* と等しいコレクション要素を検索する)" を検索することと同じです。 たとえば、以下のような エンティティがあるとき: + +``` +エンティティ1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +エンティティ2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +エンティティ3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +次のような結果になります: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// B と C を返します +// "少なくとも 1つの valプロパティ値が 0 と等しいエンティティ" を探します + +ds.Class.query("info.coll[].val != :1";0) +// A のみを返します +// "すべての valプロパティ値が 0 と異なるエンティティ" を探します +// これは、次のクエリと同義です: +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +"少なくとも 1つのプロパティが *値* と異なる" エンティティを検索するクエリを実装したい場合は、 `[]` に文字を入れた特別な表記を使用する必要があります: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// A と B を返します +// "少なくとも 1つの valプロパティ値が 0 と異なるエンティティ" を探します +``` + +`[a]` 表記には、どのローマ字でも使用可能です。 + + +#### コレクション要素とクエリ条件をリンクする :::info @@ -992,7 +1047,7 @@ $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません ::: -エンティティのオブジェクト型属性が、プロパティを複数持つオブジェクト要素からなりたっているコレクションを値として持つ場合に、当該コレクションに特定要素が存在するかを条件に親オブジェクトを検出したいケースを考えます。AND 演算子で結合された複数のクエリ条件を使用して検索するだけでは、異なるコレクション要素がそれぞれ検索条件に合致するプロパティ値を持つ場合にも当該親オブジェクトが検出されてしまいます。 これを避けるには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 +コレクションを含むデータクラス属性を対象に、AND 演算子で結合された複数のクエリ条件を使用して検索するにあたって、検索条件に合致するプロパティが複数のコレクション要素にバラけているのではなく、一つのコレクション要素がすべてまとまっているエンティティを探したいとします。 これには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 たとえば、以下のような 2件のエンティティがあるとき: @@ -1023,7 +1078,7 @@ ds.People.places: ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... クエリは "martin" と "smith" の**両方**を返します。なぜなら "smith" も "kind=home" である "location" 要素を持っており、"city=paris" である "location" 要素をも持っているからです (ですがこれら 2つは異なる要素です)。 +... クエリは "martin" と "smith" の**両方**を返します。 なぜなら "smith" も "kind=home" である "location" 要素を持っており、"city=paris" である "location" 要素をも持っているからです (ですがこれら 2つは異なるコレクション要素です)。 検索条件に合致する属性が同一のコレクション要素に含まれるエンティティのみを取得するには、**クエリ条件をリンク** します。 クエリ条件をリンクするには: @@ -1036,12 +1091,12 @@ ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"h ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... クエリは、"kind=home" かつ "city=paris" である "locations" 要素を持つエンティティ "martin" のみを返します。 "home" と"paris" が同じコレクション要素内にない "smith" は、クエリの結果に含まれません。 +... クエリは、"kind=home" かつ "city=paris" である "locations" 要素を持つエンティティ "martin" のみを返します。 "home" と "paris" が同じコレクション要素内にない "smith" は、クエリの結果に含まれません。 -**N対Nリレーションのクエリ** +#### N対Nリレーションのクエリ -ORDA は、N対Nリレーションにおけるクエリを容易にするための特別な構文を提供します。 このような場合には、`AND` 演算子を使って同じ属性の異なる値を検索する必要があるかもしれません。 たとえば、以下のようなストラクチャーの場合を考えます: +ORDA は、N対Nリレーションにおけるクエリを容易にするための特別な構文を提供します。 このような場合には `AND` 演算子を使って、同じ属性内に格納されている異なる値を検索する必要があるかもしれません。 たとえば、以下のようなストラクチャーの場合を考えます: ![alt-text](../assets/en/API/manytomany.png) @@ -1053,15 +1108,15 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";"H // $es is empty ``` -基本的に、この問題はクエリの内部ロジックに関連しています。値が "A" と "B" の両方である属性を検索することはできません。 +基本的に、この問題はクエリの内部ロジックに関連しています。 値が "A" と "B" の両方である属性を検索することはできません。 -このようなクエリを実行するために、ORDA では特別な構文を用意しています。具体的には、文字列内で使用される追加のリレート属性ずべてにおいて、**{}** の間に *クラスインデックス* を追加します。 +このようなクエリを実行するために、ORDA では特別な構文を用意しています。 具体的には、文字列内で使用される追加のリレート属性すべてにおいて、**{}** の間に *クラスインデックス* を追加します: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** は、リレーション属性のために新たな参照を作成するよう、ORDA に指示します。 すると、ORDA は必要なビットマップ操作を内部で実行します。 **x** は **0 以外** の任意の数であることに注意してください ({1}、{2}、{1540}...)。 ORDA は、各クラスインデックス用の一意な参照をクエリ内においてのみ必要とします。 +**{x}** は、リレーション属性のために新たな参照を作成するよう、ORDA に指示します。 すると、ORDA は必要なビットマップ操作を内部で実行します。 **x** には **0 以外** の任意の数値を使用できます: {1}、{2}、{1540}...。 ORDA は、各クラスインデックス用の一意な参照をクエリ内においてのみ必要とします。 この例では、次のようになります: @@ -1071,9 +1126,11 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es には映画が格納されます (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**formula 引数** -*queryString* 引数にフォーミュラを挿入 (上記参照) する代わりに、formula オブジェクトをブール検索条件として直接渡すことができます。 トークナイズの利点を生かせる、コードが検索しやすく読みやすい、などといった面から、クエリにおけるフォーミュラオブジェクトの使用は **推奨** されています。 + +#### formula 引数 + +*queryString* 引数にフォーミュラを挿入 (上記参照) する代わりに、formula オブジェクトをブール検索条件として直接渡すことができます。 トークナイズの利点を生かせる、コードが検索しやすく読みやすい、などといった面から、クエリにおけるフォーミュラオブジェクトの使用は **推奨されています**。 このフォーミュラは、[`Formula`](FunctionClass.md#formula) または [`Formula from string`](FunctionClass.md#formula-from-string) コマンドによって作成されたものでなくてはなりません。 この場合において: @@ -1082,14 +1139,14 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" * `Formula` オブジェクトが **null** の場合、エラー1626 ("テキストまたはフォーミュラが必要です") が生成されます。 > セキュリティのため、 `query()` 関数内のフォーミュラ使用を禁止することができます。 *querySettings* パラメーターの説明を参照ください。 -**フォーミュラに引数を渡す** +#### フォーミュラに引数を渡す -`query()` クラス関数によって呼び出されるフォーミュラは、引数を受け取ることができます: +`query()` クラス関数によって呼び出される *フォーミュラ* は、引数を受け取ることができます: * 引数は、*querySettings* 引数の **args** プロパティ (オブジェクト) を通して渡さなければなりません。 * フォーミュラは **args** オブジェクトを **$1** に受け取ります。 -以下の短いコードは、引数をフォーミュラに渡す仕組みを示しています: +以下の短いコードは、引数をメソッドに渡す仕組みを示しています: ```4d $settings:=New object("args";New object("exclude";"-")) // 引数を渡すための args オブジェクト @@ -1100,9 +1157,9 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" **4D Server**: クライアント/サーバーにおいては、フォーミュラはサーバー上で実行されます。 このコンテキストにおいては、`querySettings.args` オブジェクトのみがフォーミュラに送信されます。 -**querySettings 引数** +#### querySettings 引数 -*querySettings* 引数は、追加のオプションを格納したオブジェクトです。 以下のオブジェクトプロパティがサポートされています: +*querySettings* 引数は、追加のオプションを格納したオブジェクトです。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1114,9 +1171,9 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" | queryPlan | Boolean | 戻り値のエンティティコレクションに、実行する直前のクエリの詳細 (クエリプラン) を含めるかどうかを指定します。 返されるプロパティは、クエリプラン あるいはサブクエリ (複合クエリの場合) を格納したオブジェクトです。 このオプションはアプリケーションの開発フェーズにおいて有用です。 このオプションは通常 queryPath と組み合わせて使用されます。 省略時のデフォルト: false。 **注:** このプロパティは `entitySelection.query()` および `dataClass.query()` 関数においてのみサポートされます。 | | queryPath | Boolean | 戻り値のエンティティコレクションに、実際に実行されたクエリの詳細を含めるかどうかを指定します。 返されたプロパティは、クエリで実際に使用されたパス (通常は queryPlan と同一ですが、エンジンがクエリを最適化した場合には異なる場合があります)、処理時間と検出レコード数を格納したオブジェクトです。 このオプションはアプリケーションの開発フェーズにおいて有用です。 省略時のデフォルト: false。 **注:** このプロパティは `entitySelection.query()` および `dataClass.query()` 関数においてのみサポートされます。 | -**queryPlan と queryPath について** +#### queryPlan と queryPath について -`queryPlan`/`queryPath` に格納される情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーションの開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンスの向上のために、動的な最適化をクエリ実行時に実装することがあるからです。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 +`queryPlan`/`queryPath` に格納される情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーションの開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンス向上のために動的な最適化をクエリ実行時に実装することがあり、異なることもあります。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 たとえば、以下のクエリを実行した場合: @@ -1262,7 +1319,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") // salesperson はリレートエンティティです ``` -属性パスのインデックスプレースホルダーを、値の命名プレースホルダーを使用したクエリ: +属性パスのインデックスプレースホルダーと、値の命名プレースホルダーを使用したクエリ: ```4d var $es : cs.EmployeeSelection From 8a7b1c426d5d5dd3c9b18785b2b756235f0c887d Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 11:38:53 +0200 Subject: [PATCH 118/180] New translations properties_Text.md (Japanese) --- .../current/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md b/i18n/ja/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md index ce8d366bc37225..b30924521b0807 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md @@ -282,7 +282,7 @@ Choose([Companies]ID;Bold;Plain;Italic;Underline) `コレクションまたはエンティティセレクション型リストボックス` -表示される行ごとに評価される式あるいは変数を指定します。 行テキスト属性全体を定義することができます。 **オブジェクト変数**、あるいは **オブジェクトを返す式** を指定する必要があります。 以下のオブジェクトプロパティがサポートされています: +表示される行ごとに評価される式あるいは変数を指定します。 行テキスト属性全体を定義することができます。 **オブジェクト変数**、あるいは **オブジェクトを返す式** を指定する必要があります。 以下のプロパティがサポートされています: | プロパティ名 | タイプ | 説明 | | -------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 4a3e13b23333b845dd632e1464931222c94fde9c Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 11:40:08 +0200 Subject: [PATCH 119/180] New translations genInfo.md (Japanese) --- i18n/ja/docusaurus-plugin-content-docs/current/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/REST/genInfo.md b/i18n/ja/docusaurus-plugin-content-docs/current/REST/genInfo.md index 29b8edf2d0b667..879b436d681ba1 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/REST/genInfo.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/REST/genInfo.md @@ -33,4 +33,4 @@ RESTサーバーの次の情報を取得することができます: - **queryPlan**: 実行前のクエリについての詳細な情報 (クエリプラン) を格納するオブジェクト。 - **queryPath**: 実際に実行されたクエリ処理の詳細な情報 (クエリパス) を格納するオブジェクト。 -情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーション開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンスの向上のために、動的な最適化をクエリ実行時に実装することがあるからです。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 \ No newline at end of file +情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーション開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンス向上のために動的な最適化をクエリ実行時に実装することがあり、異なることもあります。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 \ No newline at end of file From 1341d84c9990a2e551196aa555a8989d93837772 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 11:40:32 +0200 Subject: [PATCH 120/180] New translations method-list.md (Japanese) --- .../current/ViewPro/method-list.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/ViewPro/method-list.md b/i18n/ja/docusaurus-plugin-content-docs/current/ViewPro/method-list.md index e287041e546a43..80104b65a74ad3 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/ViewPro/method-list.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/ViewPro/method-list.md @@ -37,7 +37,7 @@ title: メソッド一覧 名前をつけたいレンジを *rangeObj* に、新しいレンジの名前は *name* に渡します。 同じスコープ内で名前が既に使用されている場合、新しい命名レンジは既存のものを上書きします。 ただし異なるスコープであれば同じ名前を使用することが可能です (以下参照)。 -*options* 引数には、命名フォーミュラの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のオブジェクトプロパティがサポートされています: +*options* 引数には、命名フォーミュラの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -77,7 +77,7 @@ VP ADD FORMULA NAME("ViewProArea";"SUM($A$1:$A$10)";"Total2") *name* 引数には、新しいフォーミュラの名前を渡します。 同じスコープ内で名前が既に使用されている場合、新しい命名フォーミュラは既存のものを上書きします。 ただし異なるスコープであれば同じ名前を使用することが可能です (以下参照)。 -*options* 引数には、命名レンジの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のオブジェクトプロパティがサポートされています: +*options* 引数には、命名レンジの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1160,7 +1160,7 @@ $vpObj:=VP Export to object("vpArea";New object("includeFormatInfo";False)) *searchValue* 引数として、*rangeObj* に指定したレンジ内で検索するテキスト値を渡します。 -任意の *searchCondition* 引数を渡すことで、検索がどのように実行されるかを指定することができます。 以下のオブジェクトプロパティがサポートされています: +任意の *searchCondition* 引数を渡すことで、検索がどのように実行されるかを指定することができます。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ----------- | ------- | ----------------------------------------------------------------------------------------------------------- | @@ -3485,7 +3485,7 @@ VP NEW DOCUMENT("myVPArea") `VP Object to font` コマンドは、 *fontObj* 引数で指定したフォントオブジェクトからフォントのショートハンド文字列を返します。 -*fontObj* には、フォントプロパティを格納するオブジェクトを渡します。 以下のオブジェクトプロパティがサポートされています: +*fontObj* には、フォントプロパティを格納するオブジェクトを渡します。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | とりうる値 | 必須 | | ------- | ---- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -- | From 2acc576a9136b76c5b24a39311d58a5a986ce876 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 11:54:50 +0200 Subject: [PATCH 121/180] New translations properties_Text.md (Japanese) --- .../version-18/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md b/i18n/ja/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md index f8409b874deda7..0b760579036ae4 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md @@ -276,7 +276,7 @@ Choose([Companies]ID;Bold;Plain;Italic;Underline) `コレクションまたはエンティティセレクション型リストボックス` -表示される行ごとに評価される式あるいは変数を指定します。 行テキスト属性全体を定義することができます。 **オブジェクト変数**、あるいは **オブジェクトを返す式** を指定する必要があります。 以下のオブジェクトプロパティがサポートされています: +表示される行ごとに評価される式あるいは変数を指定します。 行テキスト属性全体を定義することができます。 **オブジェクト変数**、あるいは **オブジェクトを返す式** を指定する必要があります。 以下のプロパティがサポートされています: | プロパティ名 | タイプ | 説明 | | ------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 52ff26cd4552318a78c7f24f434342a4ccff61d5 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 11:55:48 +0200 Subject: [PATCH 122/180] New translations genInfo.md (Japanese) --- .../docusaurus-plugin-content-docs/version-18/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-18/REST/genInfo.md b/i18n/ja/docusaurus-plugin-content-docs/version-18/REST/genInfo.md index 29b8edf2d0b667..879b436d681ba1 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-18/REST/genInfo.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-18/REST/genInfo.md @@ -33,4 +33,4 @@ RESTサーバーの次の情報を取得することができます: - **queryPlan**: 実行前のクエリについての詳細な情報 (クエリプラン) を格納するオブジェクト。 - **queryPath**: 実際に実行されたクエリ処理の詳細な情報 (クエリパス) を格納するオブジェクト。 -情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーション開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンスの向上のために、動的な最適化をクエリ実行時に実装することがあるからです。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 \ No newline at end of file +情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーション開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンス向上のために動的な最適化をクエリ実行時に実装することがあり、異なることもあります。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 \ No newline at end of file From dc8ee7e896b93b847f612a6516d73ee40415d185 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:00:34 +0200 Subject: [PATCH 123/180] New translations DataClassClass.md (Japanese) --- .../version-19/API/DataClassClass.md | 87 +++++++++++++++---- 1 file changed, 72 insertions(+), 15 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md index 43f39731fdd8c1..c6438edd42dc7e 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md @@ -481,8 +481,10 @@ var $firstnameAtt;$employerAtt;$employeesAtt : Object | --- | ------ | -- | ------------------------------------ | | 戻り値 | Object | <- | データクラスの情報| + | + #### 説明 `.getInfo()` 関数は、 データクラスの情報を提供するオブジェクトを返します。 このメソッドは汎用的なコードを書くのに有用です。 @@ -717,7 +719,7 @@ attributePath|formula 比較演算子 値 ``` > 単一引用符 (') は、クエリ文字列を分解してしまうため、検索値としてはサポートされていません。 たとえば、"comp.name = 'John's pizza' " はエラーを生成します。 単一引用符を含む値を検索するには、プレースホルダーを使用します (後述参照)。 -**カッコの使用** +**カッコを使用する** クエリ内でカッコを使用すると、計算に優先順位をつけることができます。 たとえば、以下のようにクエリを整理することができます: @@ -725,9 +727,9 @@ attributePath|formula 比較演算子 値 "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**プレースホルダーの使用** +**プレースホルダーを使用する** -4D では、*queryString* 引数内の *attributePath*、*formula* および *値* にプレースホルダーを使用することができます。 プレースホルダーとは、クエリ文字列に挿入するパラメーターで、クエリ文字列が評価される時に他の値で置き換えられるものです。 プレースホルダーの値はクエリ開始時に一度だけ評価されます。各要素に対して毎回評価されるわけではありません。 +4D では、*queryString* 引数内の *attributePath*、*formula* および *値* にプレースホルダーを使用することができます。 プレースホルダーとは、クエリ文字列に挿入するパラメーターで、クエリ文字列が評価される際に他の値で置き換えられるものです。 プレースホルダーの値はクエリ開始時に一度だけ評価されます。 各要素に対して毎回評価されるわけではありません。 プレースホルダーには二つの種類があります。**インデックスプレースホルダー** および **命名プレースホルダー** です: @@ -769,9 +771,9 @@ attributePath|formula 比較演算子 値 $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**null値の検索** +**null値を検索する** -null値を検索する場合、プレースホルダーシンタックスは使用できません。なぜならクエリエンジンは null を予期せぬ比較値としてみなすからです。 たとえば、以下のクエリを実行した場合: +null値を検索する場合、プレースホルダーシンタックスは使用できません。 なぜならクエリエンジンは null を予期せぬ比較値としてみなすからです。 たとえば、以下のクエリを実行した場合: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません @@ -783,7 +785,62 @@ $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません $vSingles:=ds.Person.query("spouse = null") // 正しいシンタックス ``` -**コレクション要素とクエリ条件のリンク** + +**コレクションにおける "等しくない"** + +コレクションを含むデータクラス属性内を検索する場合、"*値* と等しくない" 比較演算子 (`#` または `!=`) は、すべてのプロパティが *値* と異なる要素を検索します (ほかの比較演算子とは異なり、少なくとも 1つのプロパティが *値* と異なる要素は検索しません)。 つまり、"Not(プロパティ値が *value* と等しいコレクション要素を検索する)" を検索することと同じです。 たとえば、以下のような エンティティがあるとき: + +``` +エンティティ1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +エンティティ2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +エンティティ3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +次のような結果になります: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// B と C を返します +// "少なくとも 1つの valプロパティ値が 0 と等しいエンティティ" を探します + +ds.Class.query("info.coll[].val != :1";0) +// A のみを返します +// "すべての valプロパティ値が 0 と異なるエンティティ" を探します +// これは、次のクエリと同義です: +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +"少なくとも 1つのプロパティが *値* と異なる" エンティティを検索するクエリを実装したい場合は、 `[]` に文字を入れた特別な表記を使用する必要があります: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// A と B を返します +// "少なくとも 1つの valプロパティ値が 0 と異なるエンティティ" を探します +``` + +`[a]` 表記には、どのローマ字でも使用可能です。 + +**コレクション要素とクエリ条件をリンクする** :::info @@ -791,7 +848,7 @@ $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません ::: -エンティティのオブジェクト型属性が、プロパティを複数持つオブジェクト要素からなりたっているコレクションを値として持つ場合に、当該コレクションに特定要素が存在するかを条件に親オブジェクトを検出したいケースを考えます。AND 演算子で結合された複数のクエリ条件を使用して検索するだけでは、異なるコレクション要素がそれぞれ検索条件に合致するプロパティ値を持つ場合にも当該親オブジェクトが検出されてしまいます。 これを避けるには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 +コレクションを含むデータクラス属性を対象に、AND 演算子で結合された複数のクエリ条件を使用して検索するにあたって、検索条件に合致するプロパティが複数のコレクション要素にバラけているのではなく、一つのコレクション要素がすべてまとまっているエンティティを探したいとします。 これには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 たとえば、以下のような 2件のエンティティがあるとき: @@ -822,7 +879,7 @@ ds.People.places: ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... クエリは "martin" と "smith" の**両方**を返します。なぜなら "smith" も "kind=home" である "location" 要素を持っており、"city=paris" である "location" 要素をも持っているからです (ですがこれら 2つは異なる要素です)。 +... クエリは "martin" と "smith" の**両方**を返します。 なぜなら "smith" も "kind=home" である "location" 要素を持っており、"city=paris" である "location" 要素をも持っているからです (ですがこれら 2つは異なるコレクション要素です)。 検索条件に合致する属性が同一のコレクション要素に含まれるエンティティのみを取得するには、**クエリ条件をリンク** します。 クエリ条件をリンクするには: @@ -835,11 +892,11 @@ ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"h ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... クエリは、"kind=home" かつ "city=paris" である "locations" 要素を持つエンティティ "martin" のみを返します。 "home" と"paris" が同じコレクション要素内にない "smith" は、クエリの結果に含まれません。 +... クエリは、"kind=home" かつ "city=paris" である "locations" 要素を持つエンティティ "martin" のみを返します。 "home" と "paris" が同じコレクション要素内にない "smith" は、クエリの結果に含まれません。 **formula 引数** -*queryString* 引数にフォーミュラを挿入 (上記参照) する代わりに、formula オブジェクトをブール検索条件として直接渡すことができます。 トークナイズの利点を生かせる、コードが検索しやすく読みやすい、などといった面から、クエリにおけるフォーミュラオブジェクトの使用は **推奨** されています。 +*queryString* 引数にフォーミュラを挿入 (上記参照) する代わりに、formula オブジェクトをブール検索条件として直接渡すことができます。 トークナイズの利点を生かせる、コードが検索しやすく読みやすい、などといった面から、クエリにおけるフォーミュラオブジェクトの使用は **推奨されています**。 このフォーミュラは、`Formula` または `Formula from string` コマンドによって作成されたものでなくてはなりません。 この場合において: @@ -850,12 +907,12 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; **フォーミュラに引数を渡す** -`query()` クラス関数によって呼び出されるフォーミュラは、引数を受け取ることができます: +`query()` クラス関数によって呼び出される *フォーミュラ* は、引数を受け取ることができます: * 引数は、*querySettings* 引数の **args** プロパティ (オブジェクト) を通して渡さなければなりません。 * フォーミュラは **args** オブジェクトを **$1** に受け取ります。 -以下の短いコードは、引数をフォーミュラに渡す仕組みを示しています: +以下の短いコードは、引数をメソッドに渡す仕組みを示しています: ```4d $settings:=New object("args";New object("exclude";"-")) // 引数を渡すための args オブジェクト @@ -868,7 +925,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; **querySettings 引数** -*querySettings* 引数は、追加のオプションを格納したオブジェクトです。 以下のオブジェクトプロパティがサポートされています: +*querySettings* 引数は、追加のオプションを格納したオブジェクトです。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -882,7 +939,7 @@ ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2"; **queryPlan と queryPath について** -`queryPlan`/`queryPath` に格納される情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーションの開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンスの向上のために、動的な最適化をクエリ実行時に実装することがあるからです。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 +`queryPlan`/`queryPath` に格納される情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーションの開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンス向上のために動的な最適化をクエリ実行時に実装することがあり、異なることもあります。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 たとえば、以下のクエリを実行した場合: @@ -1028,7 +1085,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") // salesperson はリレートエンティティです ``` -属性パスのインデックスプレースホルダーを、値の命名プレースホルダーを使用したクエリ: +属性パスのインデックスプレースホルダーと、値の命名プレースホルダーを使用したクエリ: ```4d var $es : cs.EmployeeSelection From 939be06bbf07c6ded6dd72161493f4b99fa4492f Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:03:30 +0200 Subject: [PATCH 124/180] New translations properties_Text.md (Japanese) --- .../version-19/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md b/i18n/ja/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md index ce8d366bc37225..b30924521b0807 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md @@ -282,7 +282,7 @@ Choose([Companies]ID;Bold;Plain;Italic;Underline) `コレクションまたはエンティティセレクション型リストボックス` -表示される行ごとに評価される式あるいは変数を指定します。 行テキスト属性全体を定義することができます。 **オブジェクト変数**、あるいは **オブジェクトを返す式** を指定する必要があります。 以下のオブジェクトプロパティがサポートされています: +表示される行ごとに評価される式あるいは変数を指定します。 行テキスト属性全体を定義することができます。 **オブジェクト変数**、あるいは **オブジェクトを返す式** を指定する必要があります。 以下のプロパティがサポートされています: | プロパティ名 | タイプ | 説明 | | -------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From d586454165c612db4f2340dd00a0c5da06af4637 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:04:43 +0200 Subject: [PATCH 125/180] New translations genInfo.md (Japanese) --- .../docusaurus-plugin-content-docs/version-19/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-19/REST/genInfo.md b/i18n/ja/docusaurus-plugin-content-docs/version-19/REST/genInfo.md index 29b8edf2d0b667..879b436d681ba1 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-19/REST/genInfo.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-19/REST/genInfo.md @@ -33,4 +33,4 @@ RESTサーバーの次の情報を取得することができます: - **queryPlan**: 実行前のクエリについての詳細な情報 (クエリプラン) を格納するオブジェクト。 - **queryPath**: 実際に実行されたクエリ処理の詳細な情報 (クエリパス) を格納するオブジェクト。 -情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーション開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンスの向上のために、動的な最適化をクエリ実行時に実装することがあるからです。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 \ No newline at end of file +情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーション開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンス向上のために動的な最適化をクエリ実行時に実装することがあり、異なることもあります。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 \ No newline at end of file From f087de8c968999cca4362c2162844547d1fc5bff Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:13:46 +0200 Subject: [PATCH 126/180] New translations code.json (Japanese) --- i18n/ja/code.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/code.json b/i18n/ja/code.json index 4335d68c674b87..4721e78d1bb6b5 100644 --- a/i18n/ja/code.json +++ b/i18n/ja/code.json @@ -90,7 +90,7 @@ "message": "4D Widgets" }, "4D Write Pro Interface": { - "message": "4D WritePro インターフェース" + "message": "4D WritePro Interface" }, "Developing Components": { "message": "コンポーネントの開発" From 79dce917e9a6ea5d4697212609af38eeeb99ba7d Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:13:47 +0200 Subject: [PATCH 127/180] New translations current.json (Japanese) --- i18n/ja/docusaurus-plugin-content-docs/current.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current.json b/i18n/ja/docusaurus-plugin-content-docs/current.json index 71532283725cd5..2efa55ba162013 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current.json +++ b/i18n/ja/docusaurus-plugin-content-docs/current.json @@ -196,7 +196,7 @@ "description": "The label for link 4D Widgets in sidebar docs, linking to https://doc.4d.com/4Dv20R2/4D/20-R2/4D-Widgets.100-6439460.en.html" }, "sidebar.docs.link.4D Write Pro Interface": { - "message": "4D WritePro インターフェース", + "message": "4D WritePro Interface", "description": "The label for link 4D Write Pro Interface in sidebar docs, linking to https://github.com/4d/4D-WritePro-Interface" }, "sidebar.docs.link.Go Mobile": { From 6a9ea26e78dfb020b2d21be8341b510afd914ecb Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:14:11 +0200 Subject: [PATCH 128/180] New translations version-20.json (Japanese) --- i18n/ja/docusaurus-plugin-content-docs/version-20.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20.json b/i18n/ja/docusaurus-plugin-content-docs/version-20.json index ddffb171db1718..efbef51e02b504 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20.json +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20.json @@ -248,7 +248,7 @@ "description": "The label for link 4D Write Pro in sidebar docs, linking to https://doc.4d.com/4Dv20/4D/20/4D-Write-Pro-Reference.100-6229455.en.html" }, "sidebar.docs.link.4D Write Pro Interface": { - "message": "4D WritePro インターフェース", + "message": "4D WritePro Interface", "description": "The label for link 4D Write Pro Interface in sidebar docs, linking to https://github.com/4d/4D-WritePro-Interface" }, "sidebar.docs.link.4D Mobile App Server": { From 988dac45fa9768bb4c33b698f9bedec6a80185c6 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:14:22 +0200 Subject: [PATCH 129/180] New translations DataClassClass.md (Japanese) --- .../version-20/API/DataClassClass.md | 141 ++++++++++++------ 1 file changed, 99 insertions(+), 42 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md index f23050be40e2f2..9a1602f4a63e01 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md @@ -851,7 +851,7 @@ $cacheAddress:=$ds.Adress.getRemoteCache() エンティティが見つからない場合、空のエンティティセレクションが返されます。 -**queryString 引数** +#### queryString 引数 *queryString* 引数には、以下のシンタックスを使用します: @@ -863,7 +863,7 @@ attributePath|formula 比較演算子 値 詳細は以下の通りです: -* **attributePath**: クエリの実行対象となる属性パス。 この引数は、単純な名前 ("country" など) のほか、あらゆる有効な属性パス ("country.name" など) の形をとることができます。 属性パスが `Collection` 型である場合、すべてのオカレンスを管理するには\[ ] 記法を使用してください (例: "children\[ ].age" など)。 +* **attributePath**: クエリの実行対象となる属性パス。 この引数は、単純な名前 ("country" など) のほか、あらゆる有効な属性パス ("country.name" など) の形をとることができます。 属性パスが `Collection` 型である場合、すべてのオカレンスを管理するには `[]` 記法を使用してください (例: `children[].age` など)。 > *".", "\[ ]", や "=", ">", "#"..., などの特殊文字はクエリ文字列の中で正しく評価されないため、これらが含まれた属性名を直接使用することはできません。 このような属性をクエリするには、プレースホルダーの使用を検討します。これにより、属性パス内で使用できる文字の範囲が広がります (後述の* **プレースホルダーの使用** *参照)。* * **formula**: テキストまたはオブジェクト形式で渡された有効なフォーミュラ。 フォーミュラは処理されるエンティティごとに評価され、ブール値を返さなくてはなりません。 処理中のエンティティはフォーミュラ内において `This` で参照されます。 @@ -879,19 +879,19 @@ attributePath|formula 比較演算子 値 * **比較演算子**: *attributePath* 引数と *value* 引数の比較に使用する記号 以下の記号がサポートされます: - | 比較 | 記号 | 説明 | - | ------------- | ----------- | ---------------------------------------------------------------- | - | 等しい | =, == | 一致するデータを取得します。ワイルドカード (@) をサポートし、文字の大小/アクセントの有無は区別しません。 | - | | ===, IS | 一致するデータを取得します。ワイルドカード (@) は標準の文字として認識され、文字の大小/アクセント記号の有無は区別しません。 | - | 等しくない | #, != | ワイルドカード (@) をサポートします | - | | !==, IS NOT | ワイルドカード (@) は標準の文字として認識されます | - | 小さい | < | | - | 大きい | > | | - | 以下 | <= | | - | 以上 | >= | | - | 含まれる | IN | コレクション、あるいは複数の値のうち、どれか一つの値と等しいデータを取得します。ワイルドカード (@) をサポートします。 | - | 宣言に Not 条件を適用 | NOT | 複数の演算子が含まれる宣言の前に NOT を使用する場合にはカッコをつける必要があります。 | - | キーワードを含む | % | キーワードは、文字列あるいはピクチャー型の属性内で使用されるものが対象です。 | + | 比較 | 記号 | 説明 | + | ------------- | ----------- | --------------------------------------------------------------------------------------- | + | 等しい | =, == | 一致するデータを取得します。ワイルドカード (@) をサポートし、文字の大小/アクセントの有無は区別しません。 | + | | ===, IS | 一致するデータを取得します。ワイルドカード (@) は標準の文字として認識され、文字の大小/アクセント記号の有無は区別しません。 | + | 等しくない | #, != | ワイルドカード (@) をサポートします。 "宣言に Not 条件を適用" と同じです ([後述参照](#コレクションにおける-等しくない)) | + | | !==, IS NOT | ワイルドカード (@) は標準の文字として認識されます | + | 宣言に Not 条件を適用 | NOT | 複数の演算子が含まれる宣言の前に NOT を使用する場合にはカッコをつける必要があります。 "等しくない" と同じです ([後述参照](#コレクションにおける-等しくない)) | + | 小さい | < | | + | 大きい | > | | + | 以下 | <= | | + | 以上 | >= | | + | 含まれる | IN | コレクション、あるいは複数の値のうち、どれか一つの値と等しいデータを取得します。ワイルドカード (@) をサポートします。 | + | キーワードを含む | % | キーワードは、文字列あるいはピクチャー型の属性内で使用されるものが対象です。 | * **値**: コレクションの各要素、あるいはエンティティセレクションの各エンティティのプロパティのカレント値に対して比較する値。 **プレースホルダー** (後述の **プレースホルダーの使用** 参照) か、あるいはデータ型プロパティと同じ型の式を使用することができます。 定数値を使用する場合、以下の原則に従う必要があります: * **テキスト** テキスト型の定数値の場合は単一引用符つき、あるいはなしでも渡すことができます(後述の **引用符を使用する** 参照)。 文字列中の文字列を検索する ("含まれる" クエリ) には、ワイルドカード記号 (@) を使用して検索文字列を指定します (例: "@Smith@")。 また以下のキーワードはテキスト定数においては使用できません: true, false。 @@ -909,7 +909,7 @@ attributePath|formula 比較演算子 値 * **order by attributePath**: クエリに "order by attributePath" ステートメントを追加することで、結果をソートすることができます。 カンマで区切ることで、複数の order by ステートメントを使用することもできます (例: order by *attributePath1* desc, *attributePath2* asc)。 デフォルトの並び順は昇順です。 並び順を指定するには、降順の場合は 'desc'、昇順の場合は 'asc' を追加します。 >このステートメントを使用した場合、順序ありエンティティセレクションが返されます (詳細については [エンティティセレクションの順列あり/順列なし](ORDA/dsMapping.md#エンティティセレクションの順列あり順列なし) を参照ください)。 -**引用符を使用する** +#### 引用符を使用する クエリ内で引用符を使用する場合、クエリ内においては単一引用符 ' ' を使用し、クエリ全体をくくるには二重引用符 " " を使用します。クオートを混同するとエラーが返されます。 例: @@ -918,7 +918,7 @@ attributePath|formula 比較演算子 値 ``` > 単一引用符 (') は、クエリ文字列を分解してしまうため、検索値としてはサポートされていません。 たとえば、"comp.name = 'John's pizza' " はエラーを生成します。 単一引用符を含む値を検索するには、プレースホルダーを使用します (後述参照)。 -**カッコの使用** +#### カッコを使用する クエリ内でカッコを使用すると、計算に優先順位をつけることができます。 たとえば、以下のようにクエリを整理することができます: @@ -926,9 +926,9 @@ attributePath|formula 比較演算子 値 "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**プレースホルダーの使用** +#### プレースホルダーを使用する -4D では、*queryString* 引数内の *attributePath*、*formula* および *値* にプレースホルダーを使用することができます。 プレースホルダーとは、クエリ文字列に挿入するパラメーターで、クエリ文字列が評価される時に他の値で置き換えられるものです。 プレースホルダーの値はクエリ開始時に一度だけ評価されます。各要素に対して毎回評価されるわけではありません。 +4D では、*queryString* 引数内の *attributePath*、*formula* および *値* にプレースホルダーを使用することができます。 プレースホルダーとは、クエリ文字列に挿入するパラメーターで、クエリ文字列が評価される際に他の値で置き換えられるものです。 プレースホルダーの値はクエリ開始時に一度だけ評価されます。 各要素に対して毎回評価されるわけではありません。 プレースホルダーには二つの種類があります。**インデックスプレースホルダー** および **命名プレースホルダー** です: @@ -942,7 +942,7 @@ attributePath|formula 比較演算子 値 * 定数値 (プレースホルダーを使用しない) * インデックスプレースホルダーや命名プレースホルダー -以下の理由から、クエリでのプレースホルダーの使用が**推奨されます**: +以下の理由から、クエリでのプレースホルダーの使用が **推奨されます**: 1. 悪意あるコードの挿入を防ぎます: ユーザーによって値が代入された変数をクエリ文字列として直接使用した場合、余計なクエリ引数を入力することでユーザーがクエリ条件を変更する可能性があります。 たとえば、以下のようなクエリ文字列を考えます: @@ -966,13 +966,13 @@ attributePath|formula 比較演算子 値 3. クエリに変数や式を使用することができます。 例: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**null値の検索** +#### null値を検索する -null値を検索する場合、プレースホルダーシンタックスは使用できません。なぜならクエリエンジンは null を予期せぬ比較値としてみなすからです。 たとえば、以下のクエリを実行した場合: +null値を検索する場合、プレースホルダーシンタックスは使用できません。 なぜならクエリエンジンは null を予期せぬ比較値としてみなすからです。 たとえば、以下のクエリを実行した場合: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません @@ -984,7 +984,62 @@ $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません $vSingles:=ds.Person.query("spouse = null") // 正しいシンタックス ``` -**コレクション要素とクエリ条件のリンク** +#### コレクションにおける "等しくない" + +コレクションを含むデータクラス属性内を検索する場合、"*値* と等しくない" 比較演算子 (`#` または `!=`) は、すべてのプロパティが *値* と異なる要素を検索します (ほかの比較演算子とは異なり、少なくとも 1つのプロパティが *値* と異なる要素は検索しません)。 つまり、"Not(プロパティ値が *value* と等しいコレクション要素を検索する)" を検索することと同じです。 たとえば、以下のような エンティティがあるとき: + +``` +エンティティ1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +エンティティ2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +エンティティ3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +次のような結果になります: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// B と C を返します +// "少なくとも 1つの valプロパティ値が 0 と等しいエンティティ" を探します + +ds.Class.query("info.coll[].val != :1";0) +// A のみを返します +// "すべての valプロパティ値が 0 と異なるエンティティ" を探します +// これは、次のクエリと同義です: +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +"少なくとも 1つのプロパティが *値* と異なる" エンティティを検索するクエリを実装したい場合は、 `[]` に文字を入れた特別な表記を使用する必要があります: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// A と B を返します +// "少なくとも 1つの valプロパティ値が 0 と異なるエンティティ" を探します +``` + +`[a]` 表記には、どのローマ字でも使用可能です。 + + +#### コレクション要素とクエリ条件をリンクする :::info @@ -992,7 +1047,7 @@ $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません ::: -エンティティのオブジェクト型属性が、プロパティを複数持つオブジェクト要素からなりたっているコレクションを値として持つ場合に、当該コレクションに特定要素が存在するかを条件に親オブジェクトを検出したいケースを考えます。AND 演算子で結合された複数のクエリ条件を使用して検索するだけでは、異なるコレクション要素がそれぞれ検索条件に合致するプロパティ値を持つ場合にも当該親オブジェクトが検出されてしまいます。 これを避けるには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 +コレクションを含むデータクラス属性を対象に、AND 演算子で結合された複数のクエリ条件を使用して検索するにあたって、検索条件に合致するプロパティが複数のコレクション要素にバラけているのではなく、一つのコレクション要素がすべてまとまっているエンティティを探したいとします。 これには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 たとえば、以下のような 2件のエンティティがあるとき: @@ -1023,7 +1078,7 @@ ds.People.places: ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... クエリは "martin" と "smith" の**両方**を返します。なぜなら "smith" も "kind=home" である "location" 要素を持っており、"city=paris" である "location" 要素をも持っているからです (ですがこれら 2つは異なる要素です)。 +... クエリは "martin" と "smith" の**両方**を返します。 なぜなら "smith" も "kind=home" である "location" 要素を持っており、"city=paris" である "location" 要素をも持っているからです (ですがこれら 2つは異なるコレクション要素です)。 検索条件に合致する属性が同一のコレクション要素に含まれるエンティティのみを取得するには、**クエリ条件をリンク** します。 クエリ条件をリンクするには: @@ -1036,12 +1091,12 @@ ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"h ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... クエリは、"kind=home" かつ "city=paris" である "locations" 要素を持つエンティティ "martin" のみを返します。 "home" と"paris" が同じコレクション要素内にない "smith" は、クエリの結果に含まれません。 +... クエリは、"kind=home" かつ "city=paris" である "locations" 要素を持つエンティティ "martin" のみを返します。 "home" と "paris" が同じコレクション要素内にない "smith" は、クエリの結果に含まれません。 -**N対Nリレーションのクエリ** +#### N対Nリレーションのクエリ -ORDA は、N対Nリレーションにおけるクエリを容易にするための特別な構文を提供します。 このような場合には、`AND` 演算子を使って同じ属性の異なる値を検索する必要があるかもしれません。 たとえば、以下のようなストラクチャーの場合を考えます: +ORDA は、N対Nリレーションにおけるクエリを容易にするための特別な構文を提供します。 このような場合には `AND` 演算子を使って、同じ属性内に格納されている異なる値を検索する必要があるかもしれません。 たとえば、以下のようなストラクチャーの場合を考えます: ![alt-text](../assets/en/API/manytomany.png) @@ -1053,15 +1108,15 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";"H // $es is empty ``` -基本的に、この問題はクエリの内部ロジックに関連しています。値が "A" と "B" の両方である属性を検索することはできません。 +基本的に、この問題はクエリの内部ロジックに関連しています。 値が "A" と "B" の両方である属性を検索することはできません。 -このようなクエリを実行するために、ORDA では特別な構文を用意しています。具体的には、文字列内で使用される追加のリレート属性ずべてにおいて、**{}** の間に *クラスインデックス* を追加します。 +このようなクエリを実行するために、ORDA では特別な構文を用意しています。 具体的には、文字列内で使用される追加のリレート属性すべてにおいて、**{}** の間に *クラスインデックス* を追加します: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** は、リレーション属性のために新たな参照を作成するよう、ORDA に指示します。 すると、ORDA は必要なビットマップ操作を内部で実行します。 **x** は **0 以外** の任意の数であることに注意してください ({1}、{2}、{1540}...)。 ORDA は、各クラスインデックス用の一意な参照をクエリ内においてのみ必要とします。 +**{x}** は、リレーション属性のために新たな参照を作成するよう、ORDA に指示します。 すると、ORDA は必要なビットマップ操作を内部で実行します。 **x** には **0 以外** の任意の数値を使用できます: {1}、{2}、{1540}...。 ORDA は、各クラスインデックス用の一意な参照をクエリ内においてのみ必要とします。 この例では、次のようになります: @@ -1071,9 +1126,11 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es には映画が格納されます (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**formula 引数** -*queryString* 引数にフォーミュラを挿入 (上記参照) する代わりに、formula オブジェクトをブール検索条件として直接渡すことができます。 トークナイズの利点を生かせる、コードが検索しやすく読みやすい、などといった面から、クエリにおけるフォーミュラオブジェクトの使用は **推奨** されています。 + +#### formula 引数 + +*queryString* 引数にフォーミュラを挿入 (上記参照) する代わりに、formula オブジェクトをブール検索条件として直接渡すことができます。 トークナイズの利点を生かせる、コードが検索しやすく読みやすい、などといった面から、クエリにおけるフォーミュラオブジェクトの使用は **推奨されています**。 このフォーミュラは、[`Formula`](FunctionClass.md#formula) または [`Formula from string`](FunctionClass.md#formula-from-string) コマンドによって作成されたものでなくてはなりません。 この場合において: @@ -1082,14 +1139,14 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" * `Formula` オブジェクトが **null** の場合、エラー1626 ("テキストまたはフォーミュラが必要です") が生成されます。 > セキュリティのため、 `query()` 関数内のフォーミュラ使用を禁止することができます。 *querySettings* パラメーターの説明を参照ください。 -**フォーミュラに引数を渡す** +#### フォーミュラに引数を渡す -`query()` クラス関数によって呼び出されるフォーミュラは、引数を受け取ることができます: +`query()` クラス関数によって呼び出される *フォーミュラ* は、引数を受け取ることができます: * 引数は、*querySettings* 引数の **args** プロパティ (オブジェクト) を通して渡さなければなりません。 * フォーミュラは **args** オブジェクトを **$1** に受け取ります。 -以下の短いコードは、引数をフォーミュラに渡す仕組みを示しています: +以下の短いコードは、引数をメソッドに渡す仕組みを示しています: ```4d $settings:=New object("args";New object("exclude";"-")) // 引数を渡すための args オブジェクト @@ -1100,9 +1157,9 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" **4D Server**: クライアント/サーバーにおいては、フォーミュラはサーバー上で実行されます。 このコンテキストにおいては、`querySettings.args` オブジェクトのみがフォーミュラに送信されます。 -**querySettings 引数** +#### querySettings 引数 -*querySettings* 引数は、追加のオプションを格納したオブジェクトです。 以下のオブジェクトプロパティがサポートされています: +*querySettings* 引数は、追加のオプションを格納したオブジェクトです。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1114,9 +1171,9 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" | queryPlan | Boolean | 戻り値のエンティティコレクションに、実行する直前のクエリの詳細 (クエリプラン) を含めるかどうかを指定します。 返されるプロパティは、クエリプラン あるいはサブクエリ (複合クエリの場合) を格納したオブジェクトです。 このオプションはアプリケーションの開発フェーズにおいて有用です。 このオプションは通常 queryPath と組み合わせて使用されます。 省略時のデフォルト: false。 **注:** このプロパティは `entitySelection.query()` および `dataClass.query()` 関数においてのみサポートされます。 | | queryPath | Boolean | 戻り値のエンティティコレクションに、実際に実行されたクエリの詳細を含めるかどうかを指定します。 返されたプロパティは、クエリで実際に使用されたパス (通常は queryPlan と同一ですが、エンジンがクエリを最適化した場合には異なる場合があります)、処理時間と検出レコード数を格納したオブジェクトです。 このオプションはアプリケーションの開発フェーズにおいて有用です。 省略時のデフォルト: false。 **注:** このプロパティは `entitySelection.query()` および `dataClass.query()` 関数においてのみサポートされます。 | -**queryPlan と queryPath について** +#### queryPlan と queryPath について -`queryPlan`/`queryPath` に格納される情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーションの開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンスの向上のために、動的な最適化をクエリ実行時に実装することがあるからです。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 +`queryPlan`/`queryPath` に格納される情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーションの開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンス向上のために動的な最適化をクエリ実行時に実装することがあり、異なることもあります。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 たとえば、以下のクエリを実行した場合: @@ -1262,7 +1319,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") // salesperson はリレートエンティティです ``` -属性パスのインデックスプレースホルダーを、値の命名プレースホルダーを使用したクエリ: +属性パスのインデックスプレースホルダーと、値の命名プレースホルダーを使用したクエリ: ```4d var $es : cs.EmployeeSelection From 5b7870473869d4881cd2a090e8d380b3e99b90c0 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:17:12 +0200 Subject: [PATCH 130/180] New translations properties_Text.md (Japanese) --- .../version-20/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md index ce8d366bc37225..b30924521b0807 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md @@ -282,7 +282,7 @@ Choose([Companies]ID;Bold;Plain;Italic;Underline) `コレクションまたはエンティティセレクション型リストボックス` -表示される行ごとに評価される式あるいは変数を指定します。 行テキスト属性全体を定義することができます。 **オブジェクト変数**、あるいは **オブジェクトを返す式** を指定する必要があります。 以下のオブジェクトプロパティがサポートされています: +表示される行ごとに評価される式あるいは変数を指定します。 行テキスト属性全体を定義することができます。 **オブジェクト変数**、あるいは **オブジェクトを返す式** を指定する必要があります。 以下のプロパティがサポートされています: | プロパティ名 | タイプ | 説明 | | -------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From c0ae8b3b60da1c676cd98a84c43f911609ea9f82 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:18:22 +0200 Subject: [PATCH 131/180] New translations genInfo.md (Japanese) --- .../docusaurus-plugin-content-docs/version-20/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/REST/genInfo.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/REST/genInfo.md index 29b8edf2d0b667..879b436d681ba1 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20/REST/genInfo.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/REST/genInfo.md @@ -33,4 +33,4 @@ RESTサーバーの次の情報を取得することができます: - **queryPlan**: 実行前のクエリについての詳細な情報 (クエリプラン) を格納するオブジェクト。 - **queryPath**: 実際に実行されたクエリ処理の詳細な情報 (クエリパス) を格納するオブジェクト。 -情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーション開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンスの向上のために、動的な最適化をクエリ実行時に実装することがあるからです。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 \ No newline at end of file +情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーション開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンス向上のために動的な最適化をクエリ実行時に実装することがあり、異なることもあります。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 \ No newline at end of file From fb8c354eb18d2e9ef7ba75c4e1eb1926a74a5027 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:18:46 +0200 Subject: [PATCH 132/180] New translations method-list.md (Japanese) --- .../version-20/ViewPro/method-list.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md b/i18n/ja/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md index 57087bf9d2652e..905565be9d78ee 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md @@ -37,7 +37,7 @@ title: メソッド一覧 名前をつけたいレンジを *rangeObj* に、新しいレンジの名前は *name* に渡します。 同じスコープ内で名前が既に使用されている場合、新しい命名レンジは既存のものを上書きします。 ただし異なるスコープであれば同じ名前を使用することが可能です (以下参照)。 -*options* 引数には、命名フォーミュラの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のオブジェクトプロパティがサポートされています: +*options* 引数には、命名フォーミュラの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -77,7 +77,7 @@ VP ADD FORMULA NAME("ViewProArea";"SUM($A$1:$A$10)";"Total2") *name* 引数には、新しいフォーミュラの名前を渡します。 同じスコープ内で名前が既に使用されている場合、新しい命名フォーミュラは既存のものを上書きします。 ただし異なるスコープであれば同じ名前を使用することが可能です (以下参照)。 -*options* 引数には、命名レンジの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のオブジェクトプロパティがサポートされています: +*options* 引数には、命名レンジの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1160,7 +1160,7 @@ $vpObj:=VP Export to object("vpArea";New object("includeFormatInfo";False)) *searchValue* 引数として、*rangeObj* に指定したレンジ内で検索するテキスト値を渡します。 -任意の *searchCondition* 引数を渡すことで、検索がどのように実行されるかを指定することができます。 以下のオブジェクトプロパティがサポートされています: +任意の *searchCondition* 引数を渡すことで、検索がどのように実行されるかを指定することができます。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ----------- | ------- | ----------------------------------------------------------------------------------------------------------- | @@ -3486,7 +3486,7 @@ VP NEW DOCUMENT("myVPArea") `VP Object to font` コマンドは、 *fontObj* 引数で指定したフォントオブジェクトからフォントのショートハンド文字列を返します。 -*fontObj* には、フォントプロパティを格納するオブジェクトを渡します。 以下のオブジェクトプロパティがサポートされています: +*fontObj* には、フォントプロパティを格納するオブジェクトを渡します。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | とりうる値 | 必須 | | ------- | ---- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -- | From b99c70803213f6c4f276e4855ff16c677eeace0f Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:30:59 +0200 Subject: [PATCH 133/180] New translations version-20-R2.json (Japanese) --- i18n/ja/docusaurus-plugin-content-docs/version-20-R2.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2.json b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2.json index f736f4fe2ab140..e383caf59a9526 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2.json +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2.json @@ -248,7 +248,7 @@ "description": "The label for link 4D Write Pro in sidebar docs, linking to https://doc.4d.com/4Dv20R2/4D/20-R2/4D-Write-Pro-Reference.100-6390313.en.html" }, "sidebar.docs.link.4D Write Pro Interface": { - "message": "4D WritePro インターフェース", + "message": "4D WritePro Interface", "description": "The label for link 4D Write Pro Interface in sidebar docs, linking to https://github.com/4d/4D-WritePro-Interface" }, "sidebar.docs.link.4D Mobile App Server": { From 61cab978c093c586a9f0864a51404bfd74b21d86 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:31:07 +0200 Subject: [PATCH 134/180] New translations DataClassClass.md (Japanese) --- .../version-20-R2/API/DataClassClass.md | 141 ++++++++++++------ 1 file changed, 99 insertions(+), 42 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md index f23050be40e2f2..9a1602f4a63e01 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md @@ -851,7 +851,7 @@ $cacheAddress:=$ds.Adress.getRemoteCache() エンティティが見つからない場合、空のエンティティセレクションが返されます。 -**queryString 引数** +#### queryString 引数 *queryString* 引数には、以下のシンタックスを使用します: @@ -863,7 +863,7 @@ attributePath|formula 比較演算子 値 詳細は以下の通りです: -* **attributePath**: クエリの実行対象となる属性パス。 この引数は、単純な名前 ("country" など) のほか、あらゆる有効な属性パス ("country.name" など) の形をとることができます。 属性パスが `Collection` 型である場合、すべてのオカレンスを管理するには\[ ] 記法を使用してください (例: "children\[ ].age" など)。 +* **attributePath**: クエリの実行対象となる属性パス。 この引数は、単純な名前 ("country" など) のほか、あらゆる有効な属性パス ("country.name" など) の形をとることができます。 属性パスが `Collection` 型である場合、すべてのオカレンスを管理するには `[]` 記法を使用してください (例: `children[].age` など)。 > *".", "\[ ]", や "=", ">", "#"..., などの特殊文字はクエリ文字列の中で正しく評価されないため、これらが含まれた属性名を直接使用することはできません。 このような属性をクエリするには、プレースホルダーの使用を検討します。これにより、属性パス内で使用できる文字の範囲が広がります (後述の* **プレースホルダーの使用** *参照)。* * **formula**: テキストまたはオブジェクト形式で渡された有効なフォーミュラ。 フォーミュラは処理されるエンティティごとに評価され、ブール値を返さなくてはなりません。 処理中のエンティティはフォーミュラ内において `This` で参照されます。 @@ -879,19 +879,19 @@ attributePath|formula 比較演算子 値 * **比較演算子**: *attributePath* 引数と *value* 引数の比較に使用する記号 以下の記号がサポートされます: - | 比較 | 記号 | 説明 | - | ------------- | ----------- | ---------------------------------------------------------------- | - | 等しい | =, == | 一致するデータを取得します。ワイルドカード (@) をサポートし、文字の大小/アクセントの有無は区別しません。 | - | | ===, IS | 一致するデータを取得します。ワイルドカード (@) は標準の文字として認識され、文字の大小/アクセント記号の有無は区別しません。 | - | 等しくない | #, != | ワイルドカード (@) をサポートします | - | | !==, IS NOT | ワイルドカード (@) は標準の文字として認識されます | - | 小さい | < | | - | 大きい | > | | - | 以下 | <= | | - | 以上 | >= | | - | 含まれる | IN | コレクション、あるいは複数の値のうち、どれか一つの値と等しいデータを取得します。ワイルドカード (@) をサポートします。 | - | 宣言に Not 条件を適用 | NOT | 複数の演算子が含まれる宣言の前に NOT を使用する場合にはカッコをつける必要があります。 | - | キーワードを含む | % | キーワードは、文字列あるいはピクチャー型の属性内で使用されるものが対象です。 | + | 比較 | 記号 | 説明 | + | ------------- | ----------- | --------------------------------------------------------------------------------------- | + | 等しい | =, == | 一致するデータを取得します。ワイルドカード (@) をサポートし、文字の大小/アクセントの有無は区別しません。 | + | | ===, IS | 一致するデータを取得します。ワイルドカード (@) は標準の文字として認識され、文字の大小/アクセント記号の有無は区別しません。 | + | 等しくない | #, != | ワイルドカード (@) をサポートします。 "宣言に Not 条件を適用" と同じです ([後述参照](#コレクションにおける-等しくない)) | + | | !==, IS NOT | ワイルドカード (@) は標準の文字として認識されます | + | 宣言に Not 条件を適用 | NOT | 複数の演算子が含まれる宣言の前に NOT を使用する場合にはカッコをつける必要があります。 "等しくない" と同じです ([後述参照](#コレクションにおける-等しくない)) | + | 小さい | < | | + | 大きい | > | | + | 以下 | <= | | + | 以上 | >= | | + | 含まれる | IN | コレクション、あるいは複数の値のうち、どれか一つの値と等しいデータを取得します。ワイルドカード (@) をサポートします。 | + | キーワードを含む | % | キーワードは、文字列あるいはピクチャー型の属性内で使用されるものが対象です。 | * **値**: コレクションの各要素、あるいはエンティティセレクションの各エンティティのプロパティのカレント値に対して比較する値。 **プレースホルダー** (後述の **プレースホルダーの使用** 参照) か、あるいはデータ型プロパティと同じ型の式を使用することができます。 定数値を使用する場合、以下の原則に従う必要があります: * **テキスト** テキスト型の定数値の場合は単一引用符つき、あるいはなしでも渡すことができます(後述の **引用符を使用する** 参照)。 文字列中の文字列を検索する ("含まれる" クエリ) には、ワイルドカード記号 (@) を使用して検索文字列を指定します (例: "@Smith@")。 また以下のキーワードはテキスト定数においては使用できません: true, false。 @@ -909,7 +909,7 @@ attributePath|formula 比較演算子 値 * **order by attributePath**: クエリに "order by attributePath" ステートメントを追加することで、結果をソートすることができます。 カンマで区切ることで、複数の order by ステートメントを使用することもできます (例: order by *attributePath1* desc, *attributePath2* asc)。 デフォルトの並び順は昇順です。 並び順を指定するには、降順の場合は 'desc'、昇順の場合は 'asc' を追加します。 >このステートメントを使用した場合、順序ありエンティティセレクションが返されます (詳細については [エンティティセレクションの順列あり/順列なし](ORDA/dsMapping.md#エンティティセレクションの順列あり順列なし) を参照ください)。 -**引用符を使用する** +#### 引用符を使用する クエリ内で引用符を使用する場合、クエリ内においては単一引用符 ' ' を使用し、クエリ全体をくくるには二重引用符 " " を使用します。クオートを混同するとエラーが返されます。 例: @@ -918,7 +918,7 @@ attributePath|formula 比較演算子 値 ``` > 単一引用符 (') は、クエリ文字列を分解してしまうため、検索値としてはサポートされていません。 たとえば、"comp.name = 'John's pizza' " はエラーを生成します。 単一引用符を含む値を検索するには、プレースホルダーを使用します (後述参照)。 -**カッコの使用** +#### カッコを使用する クエリ内でカッコを使用すると、計算に優先順位をつけることができます。 たとえば、以下のようにクエリを整理することができます: @@ -926,9 +926,9 @@ attributePath|formula 比較演算子 値 "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**プレースホルダーの使用** +#### プレースホルダーを使用する -4D では、*queryString* 引数内の *attributePath*、*formula* および *値* にプレースホルダーを使用することができます。 プレースホルダーとは、クエリ文字列に挿入するパラメーターで、クエリ文字列が評価される時に他の値で置き換えられるものです。 プレースホルダーの値はクエリ開始時に一度だけ評価されます。各要素に対して毎回評価されるわけではありません。 +4D では、*queryString* 引数内の *attributePath*、*formula* および *値* にプレースホルダーを使用することができます。 プレースホルダーとは、クエリ文字列に挿入するパラメーターで、クエリ文字列が評価される際に他の値で置き換えられるものです。 プレースホルダーの値はクエリ開始時に一度だけ評価されます。 各要素に対して毎回評価されるわけではありません。 プレースホルダーには二つの種類があります。**インデックスプレースホルダー** および **命名プレースホルダー** です: @@ -942,7 +942,7 @@ attributePath|formula 比較演算子 値 * 定数値 (プレースホルダーを使用しない) * インデックスプレースホルダーや命名プレースホルダー -以下の理由から、クエリでのプレースホルダーの使用が**推奨されます**: +以下の理由から、クエリでのプレースホルダーの使用が **推奨されます**: 1. 悪意あるコードの挿入を防ぎます: ユーザーによって値が代入された変数をクエリ文字列として直接使用した場合、余計なクエリ引数を入力することでユーザーがクエリ条件を変更する可能性があります。 たとえば、以下のようなクエリ文字列を考えます: @@ -966,13 +966,13 @@ attributePath|formula 比較演算子 値 3. クエリに変数や式を使用することができます。 例: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**null値の検索** +#### null値を検索する -null値を検索する場合、プレースホルダーシンタックスは使用できません。なぜならクエリエンジンは null を予期せぬ比較値としてみなすからです。 たとえば、以下のクエリを実行した場合: +null値を検索する場合、プレースホルダーシンタックスは使用できません。 なぜならクエリエンジンは null を予期せぬ比較値としてみなすからです。 たとえば、以下のクエリを実行した場合: ```4d $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません @@ -984,7 +984,62 @@ $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません $vSingles:=ds.Person.query("spouse = null") // 正しいシンタックス ``` -**コレクション要素とクエリ条件のリンク** +#### コレクションにおける "等しくない" + +コレクションを含むデータクラス属性内を検索する場合、"*値* と等しくない" 比較演算子 (`#` または `!=`) は、すべてのプロパティが *値* と異なる要素を検索します (ほかの比較演算子とは異なり、少なくとも 1つのプロパティが *値* と異なる要素は検索しません)。 つまり、"Not(プロパティ値が *value* と等しいコレクション要素を検索する)" を検索することと同じです。 たとえば、以下のような エンティティがあるとき: + +``` +エンティティ1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +エンティティ2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +エンティティ3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +次のような結果になります: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// B と C を返します +// "少なくとも 1つの valプロパティ値が 0 と等しいエンティティ" を探します + +ds.Class.query("info.coll[].val != :1";0) +// A のみを返します +// "すべての valプロパティ値が 0 と異なるエンティティ" を探します +// これは、次のクエリと同義です: +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +"少なくとも 1つのプロパティが *値* と異なる" エンティティを検索するクエリを実装したい場合は、 `[]` に文字を入れた特別な表記を使用する必要があります: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// A と B を返します +// "少なくとも 1つの valプロパティ値が 0 と異なるエンティティ" を探します +``` + +`[a]` 表記には、どのローマ字でも使用可能です。 + + +#### コレクション要素とクエリ条件をリンクする :::info @@ -992,7 +1047,7 @@ $vSingles:=ds.Person.query("spouse = :1";Null) // 機能しません ::: -エンティティのオブジェクト型属性が、プロパティを複数持つオブジェクト要素からなりたっているコレクションを値として持つ場合に、当該コレクションに特定要素が存在するかを条件に親オブジェクトを検出したいケースを考えます。AND 演算子で結合された複数のクエリ条件を使用して検索するだけでは、異なるコレクション要素がそれぞれ検索条件に合致するプロパティ値を持つ場合にも当該親オブジェクトが検出されてしまいます。 これを避けるには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 +コレクションを含むデータクラス属性を対象に、AND 演算子で結合された複数のクエリ条件を使用して検索するにあたって、検索条件に合致するプロパティが複数のコレクション要素にバラけているのではなく、一つのコレクション要素がすべてまとまっているエンティティを探したいとします。 これには、すべての条件に合致するコレクション要素のみが検出されるよう、クエリ条件をコレクション要素にリンクする必要があります。 たとえば、以下のような 2件のエンティティがあるとき: @@ -1023,7 +1078,7 @@ ds.People.places: ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... クエリは "martin" と "smith" の**両方**を返します。なぜなら "smith" も "kind=home" である "location" 要素を持っており、"city=paris" である "location" 要素をも持っているからです (ですがこれら 2つは異なる要素です)。 +... クエリは "martin" と "smith" の**両方**を返します。 なぜなら "smith" も "kind=home" である "location" 要素を持っており、"city=paris" である "location" 要素をも持っているからです (ですがこれら 2つは異なるコレクション要素です)。 検索条件に合致する属性が同一のコレクション要素に含まれるエンティティのみを取得するには、**クエリ条件をリンク** します。 クエリ条件をリンクするには: @@ -1036,12 +1091,12 @@ ds.People.query("places.locations[].kind= :1 and places.locations[].city= :2";"h ds.People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... クエリは、"kind=home" かつ "city=paris" である "locations" 要素を持つエンティティ "martin" のみを返します。 "home" と"paris" が同じコレクション要素内にない "smith" は、クエリの結果に含まれません。 +... クエリは、"kind=home" かつ "city=paris" である "locations" 要素を持つエンティティ "martin" のみを返します。 "home" と "paris" が同じコレクション要素内にない "smith" は、クエリの結果に含まれません。 -**N対Nリレーションのクエリ** +#### N対Nリレーションのクエリ -ORDA は、N対Nリレーションにおけるクエリを容易にするための特別な構文を提供します。 このような場合には、`AND` 演算子を使って同じ属性の異なる値を検索する必要があるかもしれません。 たとえば、以下のようなストラクチャーの場合を考えます: +ORDA は、N対Nリレーションにおけるクエリを容易にするための特別な構文を提供します。 このような場合には `AND` 演算子を使って、同じ属性内に格納されている異なる値を検索する必要があるかもしれません。 たとえば、以下のようなストラクチャーの場合を考えます: ![alt-text](../assets/en/API/manytomany.png) @@ -1053,15 +1108,15 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";"H // $es is empty ``` -基本的に、この問題はクエリの内部ロジックに関連しています。値が "A" と "B" の両方である属性を検索することはできません。 +基本的に、この問題はクエリの内部ロジックに関連しています。 値が "A" と "B" の両方である属性を検索することはできません。 -このようなクエリを実行するために、ORDA では特別な構文を用意しています。具体的には、文字列内で使用される追加のリレート属性ずべてにおいて、**{}** の間に *クラスインデックス* を追加します。 +このようなクエリを実行するために、ORDA では特別な構文を用意しています。 具体的には、文字列内で使用される追加のリレート属性すべてにおいて、**{}** の間に *クラスインデックス* を追加します: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** は、リレーション属性のために新たな参照を作成するよう、ORDA に指示します。 すると、ORDA は必要なビットマップ操作を内部で実行します。 **x** は **0 以外** の任意の数であることに注意してください ({1}、{2}、{1540}...)。 ORDA は、各クラスインデックス用の一意な参照をクエリ内においてのみ必要とします。 +**{x}** は、リレーション属性のために新たな参照を作成するよう、ORDA に指示します。 すると、ORDA は必要なビットマップ操作を内部で実行します。 **x** には **0 以外** の任意の数値を使用できます: {1}、{2}、{1540}...。 ORDA は、各クラスインデックス用の一意な参照をクエリ内においてのみ必要とします。 この例では、次のようになります: @@ -1071,9 +1126,11 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" // $es には映画が格納されます (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**formula 引数** -*queryString* 引数にフォーミュラを挿入 (上記参照) する代わりに、formula オブジェクトをブール検索条件として直接渡すことができます。 トークナイズの利点を生かせる、コードが検索しやすく読みやすい、などといった面から、クエリにおけるフォーミュラオブジェクトの使用は **推奨** されています。 + +#### formula 引数 + +*queryString* 引数にフォーミュラを挿入 (上記参照) する代わりに、formula オブジェクトをブール検索条件として直接渡すことができます。 トークナイズの利点を生かせる、コードが検索しやすく読みやすい、などといった面から、クエリにおけるフォーミュラオブジェクトの使用は **推奨されています**。 このフォーミュラは、[`Formula`](FunctionClass.md#formula) または [`Formula from string`](FunctionClass.md#formula-from-string) コマンドによって作成されたものでなくてはなりません。 この場合において: @@ -1082,14 +1139,14 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" * `Formula` オブジェクトが **null** の場合、エラー1626 ("テキストまたはフォーミュラが必要です") が生成されます。 > セキュリティのため、 `query()` 関数内のフォーミュラ使用を禁止することができます。 *querySettings* パラメーターの説明を参照ください。 -**フォーミュラに引数を渡す** +#### フォーミュラに引数を渡す -`query()` クラス関数によって呼び出されるフォーミュラは、引数を受け取ることができます: +`query()` クラス関数によって呼び出される *フォーミュラ* は、引数を受け取ることができます: * 引数は、*querySettings* 引数の **args** プロパティ (オブジェクト) を通して渡さなければなりません。 * フォーミュラは **args** オブジェクトを **$1** に受け取ります。 -以下の短いコードは、引数をフォーミュラに渡す仕組みを示しています: +以下の短いコードは、引数をメソッドに渡す仕組みを示しています: ```4d $settings:=New object("args";New object("exclude";"-")) // 引数を渡すための args オブジェクト @@ -1100,9 +1157,9 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" **4D Server**: クライアント/サーバーにおいては、フォーミュラはサーバー上で実行されます。 このコンテキストにおいては、`querySettings.args` オブジェクトのみがフォーミュラに送信されます。 -**querySettings 引数** +#### querySettings 引数 -*querySettings* 引数は、追加のオプションを格納したオブジェクトです。 以下のオブジェクトプロパティがサポートされています: +*querySettings* 引数は、追加のオプションを格納したオブジェクトです。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1114,9 +1171,9 @@ $es:=ds.Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2" | queryPlan | Boolean | 戻り値のエンティティコレクションに、実行する直前のクエリの詳細 (クエリプラン) を含めるかどうかを指定します。 返されるプロパティは、クエリプラン あるいはサブクエリ (複合クエリの場合) を格納したオブジェクトです。 このオプションはアプリケーションの開発フェーズにおいて有用です。 このオプションは通常 queryPath と組み合わせて使用されます。 省略時のデフォルト: false。 **注:** このプロパティは `entitySelection.query()` および `dataClass.query()` 関数においてのみサポートされます。 | | queryPath | Boolean | 戻り値のエンティティコレクションに、実際に実行されたクエリの詳細を含めるかどうかを指定します。 返されたプロパティは、クエリで実際に使用されたパス (通常は queryPlan と同一ですが、エンジンがクエリを最適化した場合には異なる場合があります)、処理時間と検出レコード数を格納したオブジェクトです。 このオプションはアプリケーションの開発フェーズにおいて有用です。 省略時のデフォルト: false。 **注:** このプロパティは `entitySelection.query()` および `dataClass.query()` 関数においてのみサポートされます。 | -**queryPlan と queryPath について** +#### queryPlan と queryPath について -`queryPlan`/`queryPath` に格納される情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーションの開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンスの向上のために、動的な最適化をクエリ実行時に実装することがあるからです。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 +`queryPlan`/`queryPath` に格納される情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーションの開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンス向上のために動的な最適化をクエリ実行時に実装することがあり、異なることもあります。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 たとえば、以下のクエリを実行した場合: @@ -1262,7 +1319,7 @@ $es:=ds.Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name") // salesperson はリレートエンティティです ``` -属性パスのインデックスプレースホルダーを、値の命名プレースホルダーを使用したクエリ: +属性パスのインデックスプレースホルダーと、値の命名プレースホルダーを使用したクエリ: ```4d var $es : cs.EmployeeSelection From 2a5a93c4d1bebf88c72eb846f0fbc694655a39fa Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:34:03 +0200 Subject: [PATCH 135/180] New translations properties_Text.md (Japanese) --- .../version-20-R2/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md index ce8d366bc37225..b30924521b0807 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md @@ -282,7 +282,7 @@ Choose([Companies]ID;Bold;Plain;Italic;Underline) `コレクションまたはエンティティセレクション型リストボックス` -表示される行ごとに評価される式あるいは変数を指定します。 行テキスト属性全体を定義することができます。 **オブジェクト変数**、あるいは **オブジェクトを返す式** を指定する必要があります。 以下のオブジェクトプロパティがサポートされています: +表示される行ごとに評価される式あるいは変数を指定します。 行テキスト属性全体を定義することができます。 **オブジェクト変数**、あるいは **オブジェクトを返す式** を指定する必要があります。 以下のプロパティがサポートされています: | プロパティ名 | タイプ | 説明 | | -------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 33cbe829270cf5fc260da7e1a2bdb2149d51ac9c Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:35:08 +0200 Subject: [PATCH 136/180] New translations genInfo.md (Japanese) --- .../version-20-R2/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md index 29b8edf2d0b667..879b436d681ba1 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md @@ -33,4 +33,4 @@ RESTサーバーの次の情報を取得することができます: - **queryPlan**: 実行前のクエリについての詳細な情報 (クエリプラン) を格納するオブジェクト。 - **queryPath**: 実際に実行されたクエリ処理の詳細な情報 (クエリパス) を格納するオブジェクト。 -情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーション開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンスの向上のために、動的な最適化をクエリ実行時に実装することがあるからです。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 \ No newline at end of file +情報には、クエリの種類 (インデックスあるいはシーケンシャル)、必要なサブクエリおよびその連結演算子が含まれます。 クエリパスには、見つかったエンティティの数と各検索条件を実行するににかかった時間も含まれます。 この情報は、アプリケーション開発中に解析することで有効に活用できます。 一般的には、クエリプランとクエリパスの詳細は同一になるはずですが、4D はパフォーマンス向上のために動的な最適化をクエリ実行時に実装することがあり、異なることもあります。 たとえば、その方が早いと判断した場合には、4Dエンジンはインデックス付きクエリをシーケンシャルなものへと動的に変換することがあります。 これは検索されているエンティティの数が少ないときに起こりえます。 \ No newline at end of file From 1ac8e60ca3302c783a9868614b1a0a5eb7490a68 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:35:31 +0200 Subject: [PATCH 137/180] New translations method-list.md (Japanese) --- .../version-20-R2/ViewPro/method-list.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md index 57087bf9d2652e..905565be9d78ee 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md @@ -37,7 +37,7 @@ title: メソッド一覧 名前をつけたいレンジを *rangeObj* に、新しいレンジの名前は *name* に渡します。 同じスコープ内で名前が既に使用されている場合、新しい命名レンジは既存のものを上書きします。 ただし異なるスコープであれば同じ名前を使用することが可能です (以下参照)。 -*options* 引数には、命名フォーミュラの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のオブジェクトプロパティがサポートされています: +*options* 引数には、命名フォーミュラの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -77,7 +77,7 @@ VP ADD FORMULA NAME("ViewProArea";"SUM($A$1:$A$10)";"Total2") *name* 引数には、新しいフォーミュラの名前を渡します。 同じスコープ内で名前が既に使用されている場合、新しい命名フォーミュラは既存のものを上書きします。 ただし異なるスコープであれば同じ名前を使用することが可能です (以下参照)。 -*options* 引数には、命名レンジの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のオブジェクトプロパティがサポートされています: +*options* 引数には、命名レンジの追加プロパティを格納したオブジェクト型を渡すことができます。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1160,7 +1160,7 @@ $vpObj:=VP Export to object("vpArea";New object("includeFormatInfo";False)) *searchValue* 引数として、*rangeObj* に指定したレンジ内で検索するテキスト値を渡します。 -任意の *searchCondition* 引数を渡すことで、検索がどのように実行されるかを指定することができます。 以下のオブジェクトプロパティがサポートされています: +任意の *searchCondition* 引数を渡すことで、検索がどのように実行されるかを指定することができます。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | | ----------- | ------- | ----------------------------------------------------------------------------------------------------------- | @@ -3486,7 +3486,7 @@ VP NEW DOCUMENT("myVPArea") `VP Object to font` コマンドは、 *fontObj* 引数で指定したフォントオブジェクトからフォントのショートハンド文字列を返します。 -*fontObj* には、フォントプロパティを格納するオブジェクトを渡します。 以下のオブジェクトプロパティがサポートされています: +*fontObj* には、フォントプロパティを格納するオブジェクトを渡します。 以下のプロパティがサポートされています: | プロパティ | タイプ | 説明 | とりうる値 | 必須 | | ------- | ---- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -- | From 61f907391a730fbdcb45860382856c7d862c46b4 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:47:24 +0200 Subject: [PATCH 138/180] New translations writeprointerface.md (Japanese) --- .../current/WritePro/writeprointerface.md | 128 +++++++++--------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/WritePro/writeprointerface.md b/i18n/ja/docusaurus-plugin-content-docs/current/WritePro/writeprointerface.md index 98579b8032eaa4..2b15feaa14b6fc 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/WritePro/writeprointerface.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/WritePro/writeprointerface.md @@ -1,6 +1,6 @@ --- id: writeprointerface -title: 4D WritePro インターフェース +title: 4D WritePro Interface --- 4D WritePro インターフェースは、エンドユーザーが 4D Write Proドキュメントを簡単にカスタマイズできるパレットを提供します。 @@ -162,25 +162,25 @@ JSONファイルの簡単な一例を以下に示します: JSON形式のトランスレーションファイルには、以下の属性が含まれます: -| 属性 | タイプ | 必須 | 説明 | -|:--------- |:---------- |:-- |:------------------------------------------------------------------------------------- | -| tables | Collection | | Collection of translated table objects | -| fields | Collection | | Collection of translated field objects | -| formulas | Collection | | Collection of translated formula objects | -| fileNames | Collection | | Collection of translated fileName objects (applicable to the theme and template name) | +| 属性 | タイプ | 必須 | 説明 | +|:--------- |:---------- |:-- |:-------------------------------------------- | +| tables | Collection | | 翻訳されたテーブルオブジェクトのコレクション | +| fields | Collection | | 翻訳されたフィールドオブジェクトのコレクション | +| formulas | Collection | | 翻訳されたフォーミュラオブジェクトのコレクション | +| fileNames | Collection | | 翻訳された fileNameオブジェクトのコレクション (テーマとテンプレート名に適用) | -Whitin each one of these attribute, the translation object includes the following attributes: +これら属性に含まれるコレクションの各オブジェクト要素は以下の属性を含みます: -| 属性 | タイプ | 必須 | 説明 | -|:----------- |:---- |:-- |:--------------------------------------- | -| original | Text | ○ | Original text intended for translation | -| translation | Text | ○ | Translated version of the original text | +| 属性 | タイプ | 必須 | 説明 | +|:----------- |:---- |:-- |:---------- | +| original | Text | ○ | 翻訳の対象となる原文 | +| translation | Text | ○ | 原文を翻訳したもの | -Defining these attributes within the translation object ensures proper organization and alignment between the source and translated content. +これらの属性を定義することで、原文と翻訳されたコンテンツ間の適切な対応が確保されます。 -If the template name or the formula (break, carry-over row, or extra) exists in the translated file, its translation is applied in the Table Wizard. In addition, only the table defined within the translation file is displayed and translated. +テンプレート名やフォーミュラ名 (ブレーク行、キャリーオーバー行、追加の行) がトランスレーションファイルに存在する場合、表ウィザードではその翻訳が表示されます。 また、トランスレーションファイル内で定義されたテーブルだけが表ウィザードに (翻訳されて) 表示されます。 -The translation file serves an additional role when a user selects a table in the interface. It can filter the tables and fields proposed to the user. For example, to hide table IDs, this behavior is similar to the `SET TABLE TITLES` and `SET FIELD TITLES` commands. +ユーザーがインターフェースでテーブルを選択したときには、トランスレーションファイルは追加の役割を果たします。 具体的には、ユーザーに提案されるテーブルやフィールドをフィルターします。 たとえば、テーブルID を非表示にするなど、この動作は `SET TABLE TITLES` や `SET FIELD TITLES` コマンドに似ています。 ##### 例題 @@ -188,74 +188,74 @@ The translation file serves an additional role when a user selects a table in th { "tables": [{ "original": "People", - "translation": "Personne" + "translation": "従業員" } ], "fields": [{ "original": "lastname", - "translation": "Nom" + "translation": "名字" }, { "original": "firstname", - "translation": "Prénom" + "translation": "名前" }, { "original": "salary", - "translation": "Salaire" + "translation": "給与" }, { "original": "company", - "translation": "Société" + "translation": "会社" } ], "formulas": [{ "original": "Sum of salary", - "translation": "Somme des salaires" + "translation": "給与の合計" } ] } ``` -#### Theme files - -A list of themes is provided by default in the 4D Write Pro Interface component, such as "Arial", "CourierNew" and "YuGothic", available in multiple variations like "Blue" and "Green". However, you can create your own theme by placing it in the "[`Resources`](../Project/architecture.md#resources)/4DWP_Wizard/Themes" folder within your project. - -The theme file in JSON format contains the following attributes: - -| 属性 | タイプ | 必須 | 説明 | -|:------- |:------ |:-- |:------------------------------------------------------------------------------------------------------------------------------------- | -| default | Object | | Object containing the default style applicable to all rows. | -| table | Object | | Object containing the style definition applicable to the table. | -| rows | Object | | Object containing the style definition applicable to all rows. | -| cells | Object | | Object containing the style definition applicable to all cells. | -| header1 | Object | | Object containing the style definition applicable to the first header row. | -| header2 | Object | | Object containing the style definition applicable to the second header row. | -| header3 | Object | | Object containing the style definition applicable to the third header row. | -| header4 | Object | | Object containing the style definition applicable to the fourth header row. | -| header5 | Object | | Object containing the style definition applicable to the fifth header row. | -| headers | Object | | Object containing the style definition applicable to the header rows, if a specific header (like header1, header2...) is not defined. | -| data | Object | | Object containing the style definition applicable to the repeated data row. | -| break1 | Object | | Object containing the style definition applicable to the first break row. | -| break2 | Object | | Object containing the style definition applicable to the second break row. | -| break3 | Object | | Object containing the style definition applicable to the third break row. | -| break4 | Object | | Object containing the style definition applicable to the fourth break row. | -| break5 | Object | | Object containing the style definition applicable to the fifth break row. | -| breaks | Object | | Object containing the style definition applicable to the break rows, if a specific break (like break1, break2...) is not defined. | -| bcor | Object | | Object containing the style definition applicable to the bottom carry-over row. | - - -For every attribute used in your JSON file (header, data, carry-over, summary, and extra rows), you can define the following WP attributes, mentionned with their [corresponding WP constant](https://doc.4d.com/4Dv20/4D/20/4D-Write-Pro-Attributes.300-6229528.en.html): - -| WP attributes | Corresponding WP constant | -|:--------------- |:------------------------- | -| textAlign | wk text align | -| backgroundColor | wk background color | -| borderColor | wk border color | -| borderStyle | wk border style | -| borderWidth | wk border width | -| font | wk font | -| color | wk font color | -| fontFamily | wk font family | -| fontSize | wk font size | -| padding | wk padding | +#### テーマファイル + +4D WritePro Interface コンポーネントには、"Arial"、"CourierNew"、"YuGothic" などのテーマがデフォルトで用意されており、"Blue" や "Green" など複数のバリエーションが用意されています。 しかし、プロジェクト内の "[`Resources`](../Project/architecture.md#resources)/4DWP_Wizard/Themes" フォルダーにテーマファイルを配置することで、独自のテーマを作成することができます。 + +JSON形式のテーマファイルには、以下の属性が含まれます: + +| 属性 | タイプ | 必須 | 説明 | +|:------- |:------ |:-- |:-------------------------------------------------------------- | +| default | Object | | すべての行に適用されるデフォルトスタイルを格納したオブジェクト。 | +| table | Object | | 表組みに適用されるスタイル定義を格納したオブジェクト。 | +| rows | Object | | すべての行に適用されるスタイル定義を格納したオブジェクト。 | +| cells | Object | | すべてのセルに適用されるスタイル定義を格納したオブジェクト。 | +| header1 | Object | | 先頭のヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| header2 | Object | | 2つ目のヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| header3 | Object | | 3つ目のヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| header4 | Object | | 4つ目のヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| header5 | Object | | 5つ目のヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| headers | Object | | header1、header2など専用のスタイル定義がない場合に、ヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| data | Object | | 繰り返し行に適用されるスタイル定義を格納したオブジェクト。 | +| break1 | Object | | 1つ目のブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| break2 | Object | | 2つ目のブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| break3 | Object | | 3つ目のブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| break4 | Object | | 4つ目のブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| break5 | Object | | 5つ目のブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| breaks | Object | | break1、break2など専用のスタイル定義がない場合に、ブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| bcor | Object | | 下部キャリーオーバー行に適用されるスタイル定義を格納したオブジェクト。 | + + +JSONファイルで設定する各属性に対して、以下の WP属性を定義することができます ([対応する WP定数](https://doc.4d.com/4Dv20/4D/20/4D-Write-Pro-Attributes.300-6229528.ja.html) を指定します): + +| WP 属性 | 対応する WP定数 | +|:--------------- |:------------------- | +| textAlign | wk text align | +| backgroundColor | wk background color | +| borderColor | wk border color | +| borderStyle | wk border style | +| borderWidth | wk border width | +| font | wk font | +| color | wk font color | +| fontFamily | wk font family | +| fontSize | wk font size | +| padding | wk padding | ##### 例題 @@ -297,4 +297,4 @@ For every attribute used in your JSON file (header, data, carry-over, summary, a #### 参照 -[4D Write Pro - Table Wizard (tutorial video)](https://www.youtube.com/watch?v=2ChlTju-mtM) \ No newline at end of file +[4D Write Pro - 表ウィザード (チュートリアル動画)](https://www.youtube.com/watch?v=2ChlTju-mtM) \ No newline at end of file From 80e112803f404dfad971e78935abbd5f4a6c063b Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:47:27 +0200 Subject: [PATCH 139/180] New translations writeprointerface.md (Japanese) --- .../WritePro/writeprointerface.md | 128 +++++++++--------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/WritePro/writeprointerface.md b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/WritePro/writeprointerface.md index 4989866e40aa8f..5962b2c03fe9d8 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/WritePro/writeprointerface.md +++ b/i18n/ja/docusaurus-plugin-content-docs/version-20-R2/WritePro/writeprointerface.md @@ -1,6 +1,6 @@ --- id: writeprointerface -title: 4D WritePro インターフェース +title: 4D WritePro Interface --- 4D WritePro インターフェースは、エンドユーザーが 4D Write Proドキュメントを簡単にカスタマイズできるパレットを提供します。 @@ -162,25 +162,25 @@ JSONファイルの簡単な一例を以下に示します: JSON形式のトランスレーションファイルには、以下の属性が含まれます: -| 属性 | タイプ | 必須 | 説明 | -|:--------- |:---------- |:-- |:------------------------------------------------------------------------------------- | -| tables | Collection | | Collection of translated table objects | -| fields | Collection | | Collection of translated field objects | -| formulas | Collection | | Collection of translated formula objects | -| fileNames | Collection | | Collection of translated fileName objects (applicable to the theme and template name) | +| 属性 | タイプ | 必須 | 説明 | +|:--------- |:---------- |:-- |:-------------------------------------------- | +| tables | Collection | | 翻訳されたテーブルオブジェクトのコレクション | +| fields | Collection | | 翻訳されたフィールドオブジェクトのコレクション | +| formulas | Collection | | 翻訳されたフォーミュラオブジェクトのコレクション | +| fileNames | Collection | | 翻訳された fileNameオブジェクトのコレクション (テーマとテンプレート名に適用) | -Whitin each one of these attribute, the translation object includes the following attributes: +これら属性に含まれるコレクションの各オブジェクト要素は以下の属性を含みます: -| 属性 | タイプ | 必須 | 説明 | -|:----------- |:---- |:-- |:--------------------------------------- | -| original | Text | ○ | Original text intended for translation | -| translation | Text | ○ | Translated version of the original text | +| 属性 | タイプ | 必須 | 説明 | +|:----------- |:---- |:-- |:---------- | +| original | Text | ○ | 翻訳の対象となる原文 | +| translation | Text | ○ | 原文を翻訳したもの | -Defining these attributes within the translation object ensures proper organization and alignment between the source and translated content. +これらの属性を定義することで、原文と翻訳されたコンテンツ間の適切な対応が確保されます。 -If the template name or the formula (break, carry-over row, or extra) exists in the translated file, its translation is applied in the Table Wizard. In addition, only the table defined within the translation file is displayed and translated. +テンプレート名やフォーミュラ名 (ブレーク行、キャリーオーバー行、追加の行) がトランスレーションファイルに存在する場合、表ウィザードではその翻訳が表示されます。 また、トランスレーションファイル内で定義されたテーブルだけが表ウィザードに (翻訳されて) 表示されます。 -The translation file serves an additional role when a user selects a table in the interface. It can filter the tables and fields proposed to the user. For example, to hide table IDs, this behavior is similar to the `SET TABLE TITLES` and `SET FIELD TITLES` commands. +ユーザーがインターフェースでテーブルを選択したときには、トランスレーションファイルは追加の役割を果たします。 具体的には、ユーザーに提案されるテーブルやフィールドをフィルターします。 たとえば、テーブルID を非表示にするなど、この動作は `SET TABLE TITLES` や `SET FIELD TITLES` コマンドに似ています。 ##### 例題 @@ -188,74 +188,74 @@ The translation file serves an additional role when a user selects a table in th { "tables": [{ "original": "People", - "translation": "Personne" + "translation": "従業員" } ], "fields": [{ "original": "lastname", - "translation": "Nom" + "translation": "名字" }, { "original": "firstname", - "translation": "Prénom" + "translation": "名前" }, { "original": "salary", - "translation": "Salaire" + "translation": "給与" }, { "original": "company", - "translation": "Société" + "translation": "会社" } ], "formulas": [{ "original": "Sum of salary", - "translation": "Somme des salaires" + "translation": "給与の合計" } ] } ``` -#### Theme files - -A list of themes is provided by default in the 4D Write Pro Interface component, such as "Arial", "CourierNew" and "YuGothic", available in multiple variations like "Blue" and "Green". However, you can create your own theme by placing it in the "[`Resources`](../Project/architecture.md#resources)/4DWP_Wizard/Themes" folder within your project. - -The theme file in JSON format contains the following attributes: - -| 属性 | タイプ | 必須 | 説明 | -|:------- |:------ |:-- |:------------------------------------------------------------------------------------------------------------------------------------- | -| default | Object | | Object containing the default style applicable to all rows. | -| table | Object | | Object containing the style definition applicable to the table. | -| rows | Object | | Object containing the style definition applicable to all rows. | -| cells | Object | | Object containing the style definition applicable to all cells. | -| header1 | Object | | Object containing the style definition applicable to the first header row. | -| header2 | Object | | Object containing the style definition applicable to the second header row. | -| header3 | Object | | Object containing the style definition applicable to the third header row. | -| header4 | Object | | Object containing the style definition applicable to the fourth header row. | -| header5 | Object | | Object containing the style definition applicable to the fifth header row. | -| headers | Object | | Object containing the style definition applicable to the header rows, if a specific header (like header1, header2...) is not defined. | -| data | Object | | Object containing the style definition applicable to the repeated data row. | -| break1 | Object | | Object containing the style definition applicable to the first break row. | -| break2 | Object | | Object containing the style definition applicable to the second break row. | -| break3 | Object | | Object containing the style definition applicable to the third break row. | -| break4 | Object | | Object containing the style definition applicable to the fourth break row. | -| break5 | Object | | Object containing the style definition applicable to the fifth break row. | -| breaks | Object | | Object containing the style definition applicable to the break rows, if a specific break (like break1, break2...) is not defined. | -| bcor | Object | | Object containing the style definition applicable to the bottom carry-over row. | - - -For every attribute used in your JSON file (header, data, carry-over, summary, and extra rows), you can define the following WP attributes, mentionned with their [corresponding WP constant](https://doc.4d.com/4Dv20/4D/20/4D-Write-Pro-Attributes.300-6229528.en.html): - -| WP attributes | Corresponding WP constant | -|:--------------- |:------------------------- | -| textAlign | wk text align | -| backgroundColor | wk background color | -| borderColor | wk border color | -| borderStyle | wk border style | -| borderWidth | wk border width | -| font | wk font | -| color | wk font color | -| fontFamily | wk font family | -| fontSize | wk font size | -| padding | wk padding | +#### テーマファイル + +4D WritePro Interface コンポーネントには、"Arial"、"CourierNew"、"YuGothic" などのテーマがデフォルトで用意されており、"Blue" や "Green" など複数のバリエーションが用意されています。 しかし、プロジェクト内の "[`Resources`](../Project/architecture.md#resources)/4DWP_Wizard/Themes" フォルダーにテーマファイルを配置することで、独自のテーマを作成することができます。 + +JSON形式のテーマファイルには、以下の属性が含まれます: + +| 属性 | タイプ | 必須 | 説明 | +|:------- |:------ |:-- |:-------------------------------------------------------------- | +| default | Object | | すべての行に適用されるデフォルトスタイルを格納したオブジェクト。 | +| table | Object | | 表組みに適用されるスタイル定義を格納したオブジェクト。 | +| rows | Object | | すべての行に適用されるスタイル定義を格納したオブジェクト。 | +| cells | Object | | すべてのセルに適用されるスタイル定義を格納したオブジェクト。 | +| header1 | Object | | 先頭のヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| header2 | Object | | 2つ目のヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| header3 | Object | | 3つ目のヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| header4 | Object | | 4つ目のヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| header5 | Object | | 5つ目のヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| headers | Object | | header1、header2など専用のスタイル定義がない場合に、ヘッダー行に適用されるスタイル定義を格納したオブジェクト。 | +| data | Object | | 繰り返し行に適用されるスタイル定義を格納したオブジェクト。 | +| break1 | Object | | 1つ目のブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| break2 | Object | | 2つ目のブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| break3 | Object | | 3つ目のブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| break4 | Object | | 4つ目のブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| break5 | Object | | 5つ目のブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| breaks | Object | | break1、break2など専用のスタイル定義がない場合に、ブレーク行に適用されるスタイル定義を格納したオブジェクト。 | +| bcor | Object | | 下部キャリーオーバー行に適用されるスタイル定義を格納したオブジェクト。 | + + +JSONファイルで設定する各属性に対して、以下の WP属性を定義することができます ([対応する WP定数](https://doc.4d.com/4Dv20/4D/20/4D-Write-Pro-Attributes.300-6229528.ja.html) を指定します): + +| WP 属性 | 対応する WP定数 | +|:--------------- |:------------------- | +| textAlign | wk text align | +| backgroundColor | wk background color | +| borderColor | wk border color | +| borderStyle | wk border style | +| borderWidth | wk border width | +| font | wk font | +| color | wk font color | +| fontFamily | wk font family | +| fontSize | wk font size | +| padding | wk padding | ##### 例題 @@ -297,4 +297,4 @@ For every attribute used in your JSON file (header, data, carry-over, summary, a #### 参照 -[4D Write Pro - Table Wizard (tutorial video)](https://www.youtube.com/watch?v=2ChlTju-mtM) \ No newline at end of file +[4D Write Pro - 表ウィザード (チュートリアル動画)](https://www.youtube.com/watch?v=2ChlTju-mtM) \ No newline at end of file From e86e458baf4269d1f97384448de32d8406296d51 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:47:39 +0200 Subject: [PATCH 140/180] New translations DataClassClass.md (Portuguese, Brazilian) --- .../current/API/DataClassClass.md | 269 +++++++++++------- 1 file changed, 163 insertions(+), 106 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md index 7eab60b7869baf..8009e567e07292 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/API/DataClassClass.md @@ -845,7 +845,7 @@ A função `.query()` pesquisa por Se não houver entidades correspondentes encontradas, uma `EntitySelection` vazia é retornada. -**parâmetro queryString** +#### queryString parameter O parâmetro *queryString* usa a sintaxe abaixo: @@ -855,9 +855,9 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -onde: +where: -* **attributePath**: caminho de atributo no qual se pretende executar a consulta. Os atributos se expressam como pares propriedade/ valor, onde propriedade é o nome do marcador de posição inserido para uma rota de atributo em *queryString* ou *formula* (":placeholder") e valor pode ser uma string ou uma coleção de strings. Cada valor e uma rota que pode designar um escalar ou um atributo relacionado da dataclass ou uma propriedade num campo de objeto da dataclass +* **attributePath**: caminho de atributo no qual se pretende executar a consulta. Os atributos se expressam como pares propriedade/ valor, onde propriedade é o nome do marcador de posição inserido para uma rota de atributo em *queryString* ou *formula* (":placeholder") e valor pode ser uma string ou uma coleção de strings. In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > *Não pode usar diretamente atributos cujo nome contenha caracteres especiais como ".", "\[ ]", or "=", ">", "#"..., porque serão avaliados incorretamente na string da query. Se precisar de uma query com esses atributos, deve considerar o uso de placeholders que permitem uma gama estendida de caracteres em rotas de atributo (ver* **Using placeholders** *below).* * **formula**: uma fórmula válida passada como `Text` ou `Object`. A fórmula será avaliada para cada entidade processada e deve retornar um valor booleano. Dentro da fórmula, a entidade está disponível através do objeto `This`. @@ -873,19 +873,19 @@ onde: * **comparator**: symbol que compara *attributePath* e *valor*. Os simbolos abaixo são compatíveis: - | Comparação | Símbolos | Comentário | - | ---------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------ | - | Igual a | =, == | Retorna os dados coincidentes, admite o coringa (@), não diferencia entre maiúsculas e minúsculas nem diacríticas. | - | | ===, IS | Retorna os dados coincidentes, considera @ como caractere padrão, não diferencia entre maiúsculas e minúsculas nem diacríticas | - | Diferente de | #, != | Suporta o coringa (@) | - | | !==, IS NOT | Considera @ como um caractere normal | - | Menor que | < | | - | Maior que | > | | - | Menor que ou igual a | <= | | - | Maior ou igual a | >= | | - | Incluído em | IN | Retorna dados iguais a ao menos um dos valores de uma coleção ou de um conjunto de valores, admite o coringa (@) | - | Não se aplica à condição de uma sentença | NOT | Parentesis são obrigatórios quando usar NOT antes de uma instrução que contenha vários operadores | - | Contém palavra chave | % | As palavras chaves podem ser usadas em atributos de string ou imagem | + | Comparação | Símbolos | Comentário | + | ---------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Igual a | =, == | Retorna os dados coincidentes, admite o coringa (@), não diferencia entre maiúsculas e minúsculas nem diacríticas. | + | | ===, IS | Retorna os dados coincidentes, considera @ como caractere padrão, não diferencia entre maiúsculas e minúsculas nem diacríticas | + | Diferente de | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considera @ como um caractere normal | + | Não se aplica à condição de uma sentença | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Menor que | < | | + | Maior que | > | | + | Menor que ou igual a | <= | | + | Maior ou igual a | >= | | + | Incluído em | IN | Retorna dados iguais a ao menos um dos valores de uma coleção ou de um conjunto de valores, admite o coringa (@) | + | Contém palavra chave | % | As palavras chaves podem ser usadas em atributos de string ou imagem | * **value**: o valor a comparar ao valor atual da propriedade de cada entidade na seleção de entidade ou elemento na coleção. Pode ser um **marcador** (ver **Uso de marcadores** mais adiante) ou qualquer expressão que coincida com a propriedad de tipo de dados. Quando usar um valor constante, as regras abaixo devem ser respeitadas: * A constante de tipo **texto** pode ser passada com ou sem aspas simples (ver **Uso de aspas** mais abaixo). Para pesquisar uma stirng dentro de uma string (uma pesquisa "contém") use o símbolo coringa (@) em valor para isolar a string a ser pesquisada como mostrado neste exemplo: "@Smith@". As palavras chaves abaixo são proibidas para constantes de texto: true, false. @@ -903,40 +903,40 @@ onde: * **order by attributePath**: pode incluir uma declaração order by *attributePath* na pesquisa para que os dados resultantes sejam ordenados de acordo com esta declaração. Pode utilizar várias instruções de ordenação, separadas por vírgulas (por exemplo, ordenação por *attributePath1* desc, *attributePath2* asc). Como padrão, a ordem é ascendente. Passe 'desc'' para definir uma ordem descendente e 'asc' para definir uma ordem ascendente. > > *If you use this statement, the returned entity selection is ordered (for more information, please refer to [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Usar aspas** +#### Using quotes -Quando usar aspas com pesquisas, deve usar aspas simples ' ' dentro das pesquisas e aspas duplas " " para cercar a consulta inteira, senão um erro é retornado. Por exemplo: +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Por exemplo: ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Aspas siples (') não são permitidas nos valores pesquisados, já que quebrariam a string de pesquisa. Por exemplo, "comp.name = 'John's pizza' " gerará um erro. Se precisar pesquisar valores com aspas simples, pode considerar o uso de placeholders (ver abaixo). -**Usando parêntesis** +#### Using parenthesis -É possível utilizar parênteses na consulta para dar prioridade ao cálculo. Por exemplo, pode organizar uma pesquisa da seguinte maneira: +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Uso de placeholders** +#### Using placeholders -4D lhe permite utilizar placeholders, marcadores de posição, para os argumentos *attributePath*, *formula* e *value* dentro do parâmetro *queryString*. Um placeholder é um parâmetro que é inserido em strings de pesquisa e que pode ser substituído por outro valor quando a string for realizada. O valor dos placeholders é avaliado uma vez ao inicio da pesquisa - não é avaliado para cada elemento. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Dois tipos de marcadores podem ser usados: **placeholders indexados ** e **placeholders nomeados**: +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | | Marcadores de posição indexados | Placeholders nomeados | | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Definição | Os parâmetros são inseridos como :paramIndex (por exemplo :1, :2...) em queryString e seus valores correspondentes são fornecidos pela sequência de parâmetros value. Pode usara até 128 parâmetros de valor | Os parâmetros são inseridos como: paramName (por exemplo :myparam) e seus valores se proporcionam nos atributos ou objetos de parâmetros no parámetro querySettings | | Exemplo | `$r:=class.query(":1=:2";"city";"Chicago")` | $o.attributes:=New object("att";"city")
$o.parameters:=New object("name";"Chicago")
$r:=class.query(":att=:name";$o) | -Pode misturar os tipos de argumentos em *queryString*. Um *queryString* pode conter, para os parâmetros *attributePath*, *formula* e *value* : +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * valores diretos (sem marcadores), * marcadores indexados ou com nome. -**É recomendado usar marcadores de posição ou placeholders nas consultas** pelas razões abaixo: +Using placeholders in queries **is recommended** for the following reasons: 1. Evita a inserção de código malicioso: se user diretamente variáveis preenchidas com uma string de pesquisa, um usuário poderia modificar as condições de pesquisa entrando argumentos adicionais. Por exemplo, imagine uma string de pesquisa como: @@ -945,50 +945,105 @@ Pode misturar os tipos de argumentos em *queryString*. Um *queryString* pode con $result:=$col.query($vquery) ``` - Esta pesquisa parece segura já que se filtram os dados não públicos. Entretanto, se o usuário introduzr na área *myname* algo como *"smith OR status='private'*, a string de pesquisa se modificaría na etapa da interpretação e poderia devolver dados privados. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Quando usar marcadores de posição, não é possível anular as condições de segurança: + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - Neste caso, se o usuário introduz *smith OR status='private'* na área *myname*, não se interpretará na string de pesquisa, só será passada como um valor. Procurando por "smith OR status = 'private' vai falhar + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Evita ter que se preocupar por questões de formato ou caracteres, especialmente quando se manejam os parâmetros *attributePath* o *value* que podem conter não alfanuméricos como ".", "['... 3. Permite o uso de variáveis ou expressões nos argumentos de pesquisa. Exemplos: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Pesquisa de valores null** +#### Looking for null values -Quando pesquisar por valores null não pode usar a sintaxe de placeholder porque o motor de pesquisa vai consider null como um valor de comparação inesperado. Por exemplo se executar esta pesquisa: +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds. Person.query("spouse = :1";Null) // will NOT work ``` -Não obterá o resultado esperado porque o valor nulo será avaliado por 4D como um erro resultante da avaliação do parâmetro (por exemplo, um atributo vindo de outra pesquisa). Para este tipo de pesquisa, deve usar a sintaxe de pesquisa direta: +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds. Person.query("spouse = null") //correct syntax ``` -**Linkar os argumentos de pesquisa com os atributos de coleção** +#### Not equal to in collections + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + + +#### Linking collection attribute query arguments :::info -Esta funcionalidade só está disponível em consultas de dataclasses e [selecção de entidades](EntitySelectionClass.md#query). Não pode ser utilizado em pesquisas em [colecções](CollectionClass.md#query). +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -Para fazer isso, é necessário vincular os argumentos de pesquisa para elementos de coleção, para que apenas elementos únicos contendo argumentos linkados são encontrados. Ao pesquisar dentro de atributos de objectos dataclass contendo colecções utilizando múltiplos argumentos de consulta unidos pelo operador AND, poderá querer certificar-se de que apenas entidades contendo elementos que correspondem a todos os argumentos são devolvidas, e não entidades onde os argumentos podem ser encontrados em diferentes elementos. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Por exemplo, com as duas entidades abaixo: +For example, with the following two entities: ``` Entity 1: @@ -1009,35 +1064,35 @@ ds. People.places: } ] } ``` -Se quiser encontrar pessoas com um tipo de local "home" na cidade "paris". Se escrever +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds. People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... a pesquisa devolverá "martin" **e** "smith" porque "smith" tem um elemento "locations" cujo "tipo" é "home" e um elemento "locations" cuja "cidade" é "paris", mesmo que sejam elementos diferentes. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Se quiser obter apenas entidades onde os argumentos correspondentes estão no mesmo elemento coleção, precisa **linkar os argumentos**. Para linkar argumentos de pesquisa: +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Adicionar uma letra entre os \[] na primeira rota a linkar e repita a mesma letra em todos os argumentos linkados. Por exemplo: `locations[a].city and locations[a].kind`. Pode usar qualquer letra do alfabeto latino (não diferencia maiúsculas e minúsculas). * Para adicionar critérios linkados na mesma pesquisa, use outra letra. Pode criar até 26 combinações de critérios em uma única pesquisa. -Com as entidades acima, se escreve: +With the above entities, if you write: ```4d ds. People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... pesquisa só devolverá "martin" porque tem um elemento "locations" cujo "kind" é "home" e cujo "city" for "paris". A pesquisa não devolverá 'smith' porque os valores 'home' e 'paris' não estão no mesmo elemento de coleção. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Consultas em relações Muitos para Muitos** +#### Queries in many-to-many relations -A ORDA oferece uma sintaxe especial para facilitar as consultas em muitas relações. Neste contexto, poderá ter de procurar valores diferentes com um operador `E` MAS no mesmo atributo. Por exemplo, veja a seguinte estrutura: +ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: ![alt-text](../assets/en/API/manytomany.png) -Imagine que quer procurar em todos os filmes em que *tanto* o actor A como o actor B têm um papel. Se escrever uma simples consulta utilizando um operador `E` , não funcionará: +Imagine that you want to search all movies in which *both* actor A and actor B have a role. If you write a simple query using an `AND` operator, it will not work: ```4d // invalid code @@ -1045,17 +1100,17 @@ $es:=ds. Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";" // $es is empty ``` -Basicamente, a questão está relacionada com a lógica interna da consulta: não se pode procurar um atributo cujo valor seria tanto "A" como "B". +Basically, the issue is related to the internal logic of the query: you cannot search for an attribute whose value would be both "A" and "B". -Para tornar possível a realização de tais consultas, a ORDA permite uma sintaxe especial: basta adicionar um índice de classe ** entre **{}** em todos os atributos de relação adicionais utilizados na cadeia de caracteres: +To make it possible to perform such queries, ORDA allows a special syntax: you just need to add a *class index* between **{}** in all additional relation attributes used in the string: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** diz à ORDA para criar outra referência para o atributo da relação. Realizará então todas as operações de bitmap necessárias internamente. Também pode usar um **placeholder** (ver abaixo). A ORDA só precisa de uma referência única na consulta para cada índice de classe. +**{x}** tells ORDA to create another reference for the relation attribute. It will then perform all the necessary bitmap operations internally. Note that **x** can be any number **except 0**: {1}, or {2}, or {1540}... ORDA only needs a unique reference in the query for each class index. -No nosso exemplo, seria: +In our example, it would be: ```4d // valid code @@ -1063,38 +1118,40 @@ $es:=ds. Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2 // $es contains movies (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**parâmetro de fórmula** -Como alternativa à inserção de fórmulas dentro do parâmetro *queryString* (ver acima), pode passar diretamente um objeto fórmula como critério de pesquisa booleano. A utilizaçã de um objeto fórmula para as pesquisas é **recomendada** já que se beneficia da tokenização, e o código é mais fácil de pesquisar/ler. -A fórmula deve ter sido criada usando [`Formula`](FunctionClass.md#formula) ou o comando[`Formula from string`](FunctionClass.md#formula-from-string) command. Nesse modo: +#### formula parameter + +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. + +A fórmula deve ter sido criada usando [`Formula`](FunctionClass.md#formula) ou o comando[`Formula from string`](FunctionClass.md#formula-from-string) command. In this case: * *fórmula* se avalia para cada entidade e deve devolver true ou false. Durante a execução da pesquisa, se o resultado da fórmula não for booleano, é considerado como False. * dentro da *fórmula*, a entidade está disponível através do objeto `This`. * Se o objeto `Formula` for **null**, o errro 1626 ("Expecting a text or formula") é gerado, então pode interceptar a chamada com o método instalado `ON ERR CALL`. > Por razões de segurança, as chamadas a fórmulas dentro dos métodos `query()` podem ser desativadas. Veja a descrição do parâmetro *querySettings*. -**Passar parâmetros a fórmulas** +#### Passing parameters to formulas -Todo parâmetro *formula* chamado pela função `query()` pode receber parâmetros: +Any *formula* called by the `query()` class function can receive parameters: * Parâmeters devem ser passados através da propriedade **args** (objeto) do parâmetro *querySettings*. * A fórmula recebe este objeto **args** como um parâmetro **$1**. -Este pequeno código mostra os principios de como são passados os parâmetros aos métodos: +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //args object to pass parameters $es:=ds. Students.query("eval(checkName($1.exclude))";$settings) //args is received in $1 ``` -No exemplo 3 são oferecidos mais exemplos. +Additional examples are provided in example 3. -**4D Server**: em cliente/servidor, as fórmulas são executadas no servidor. Neste contexto, só se envia às fórmulas o objeto `querySettings.args`. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**parâmetro querySettings** +#### querySettings parameter -No parâmetro *querySettings* é possível passar um objeto que conteha opções adicionais. As propriedades abaixo são compatíveis: +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propriedade | Tipo | Descrição | | ------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1106,11 +1163,11 @@ No parâmetro *querySettings* é possível passar um objeto que conteha opçõe | queryPlan | Parâmetros | Na entity selection resultante, devolve ou não a descrição detalhada da pesquisa logo antes de ser executada, ou seja, a pesquisa planificada. A propriedade devolvida é um objeto que inclui cada pesquisa e subpesquisa prevista (no caso de uma pesquisa complexa). Esta opção é útil durante a fase de desenvolvimento de uma aplicação. Geralmente é usada em conjunto com queryPath. Como padrão é omitido: false. **Nota**: esta propriedade só são compatíveis com as funções`entitySelection.query( )` e `dataClass.query( )`. | | queryPath | Parâmetros | Na entity selection resultante, devolve ou não a descrição detalhada da pesquisa tal qual for realizada. A propriedade retornada é um objeto que contém a rota atual usada para a pesquisa (geralmente idêntica àquela do queryPlan, mas deve diferenciar se o motor consegue otimizar a pesquisa), assim como o tempo de processamento e o número de registros encontrado. Esta opção é útil durante a fase de desenvolvimento de uma aplicação. Como padrão é omitido: false. **Nota**: esta propriedade só são compatíveis com as funções`entitySelection.query( )` e `dataClass.query( )`. | -**Sobre queryPlan e queryPath** +#### About queryPlan and queryPath -A informação registrada em `queryPlan`/`queryPath` inclui o tipo de pesquisa (indexada e sequencial) e cada subconsulta necessária junto com os operadores de conjunção. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Geralmente a descrição do plano de pesquisa e sua rota são idênticas mas podem ser diferentes porque 4D pode implementar otimizações dinâmicas quando uma pesquisa for executada para melhorar a performance. Por exemplo, o motor 4D pode converter dinamicamente uma consulta indexada em uma consulta sequencial se estimar que seja mais rápido. Esse caso particular pode acontecer quando o número de entidades sendo pesquisada é baixo. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Por exemplo se executar esta pesquisa: +For example, if you execute the following query: ```4d $sel:=ds. Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ @@ -1139,46 +1196,46 @@ queryPath: #### Exemplo 1 -Esta seção oferece vários exemplos de pesquisas. +This section provides various examples of queries. -Consultas em uma string: +Query on a string: ```4d $entitySelection:=ds. Customer.query("firstName = 'S@'") ``` -Consulta com uma instrução NOT: +Query with a NOT statement: ```4d $entitySelection:=ds. Employee.query("not(firstName=Kim)") ``` -Pesquisas com datas: +Queries with dates: ```4d $entitySelection:=ds. Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds. Employee.query("birthDate <= :1";Current date-10950) ``` -Pesquisa com marcadores de posição indexados para os valores: +Query with indexed placeholders for values: ```4d $entitySelection:=ds. Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Pesquisa com marcadores de posição indexados para valores em u ma dataclass relacionada: +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds. Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Pesquisa com marcador de posição indexado que inclui uma instrução de ordem descendente: +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds. Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Pesquisa com marcadores de posição com nome para os valores: +Query with named placeholders for values: ```4d var $querySettings : Object @@ -1188,7 +1245,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds. Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Pesquisa que usa marcadores de posição nomeados e indexados para valores: +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -1197,7 +1254,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds. Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Pesquisa com objetos queryPlan e queryPath: +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds. Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -1208,19 +1265,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Pesquisa com uma rota de atributo de tipo Collection: +Query with an attribute path of Collection type: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Pesquisa com uma rota de atributos de tipo Collection e atributos vinculados: +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Pesquisa com uma rota de atributos de tipo Collection e múltiplos atributos vinculados: +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1228,25 +1285,25 @@ $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Pesquisa com uma rota de atributo de tipo Objeto +Query with an attribute path of Object type: ```4d $entitySelection:=ds. Employee.query("extra.eyeColor = :1";"blue") ``` -Pesquisa com uma instrução IN: +Query with an IN statement: ```4d $entitySelection:=ds. Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Pesquisa com instrução NOT (IN): +Query with a NOT (IN) statement: ```4d $entitySelection:=ds. Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Pesquisa com marcadores de posição indexados para os atributos: +Query with indexed placeholders for attributes: ```4d var $es : cs. EmployeeSelection @@ -1254,7 +1311,7 @@ $es:=ds. Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name" //salesperson is a related entity ``` -Pesquisa com marcadores de posição indexados para os atributos e marcadores de posição com nome para os valores: +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs. EmployeeSelection @@ -1265,7 +1322,7 @@ $es:=ds. Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId"; //salesperson is a related entity ``` -Pesquisa com marcadores de posição indexados para os atributos e os valores: +Query with indexed placeholders for attributes and values: ```4d var $es : cs. EmployeeSelection @@ -1275,11 +1332,11 @@ $es:=ds. Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smit #### Exemplo 2 -Esta seção ilustra pesquisas com marcadores de posição com nomes para os atributos. +This section illustrates queries with named placeholders for attributes. -Dada uma dataclass Employee com 2 entidades: +Given an Employee dataclass with 2 entities: -Entidade 1: +Entity 1: ```4d name: "Marie" @@ -1291,7 +1348,7 @@ softwares:{ } ``` -Entidade 2: +Entity 2: ```4d name: "Sophie" @@ -1303,7 +1360,7 @@ softwares:{ } ``` -Pesquisa com marcadores de posição com nome para os atributos: +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1314,7 +1371,7 @@ Pesquisa com marcadores de posição com nome para os atributos: //$es.length=1 (Employee Marie) ``` -Pesquisa com marcadores de posição com nome para os atributos e os valores: +Query with named placeholders for attributes and values: ```4d @@ -1335,16 +1392,16 @@ Pesquisa com marcadores de posição com nome para os atributos e os valores: #### Exemplo 3 -Estes exemplos ilustram as distintas formas de utilizar fórmulas com ou sem parâmetros em suas pesquisas. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -A fórmula se da como texto com `eval()` no parâmetro *queryString*: +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs. StudentsSelection $es:=ds. Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -A fórmula se dá como um objeto `Formula` através de um marcador de posição: +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs. StudentsSelection @@ -1353,7 +1410,7 @@ A fórmula se dá como um objeto `Formula` através de um marcador de posição: $es:=ds. Students.query(":1 and nationality='French'";$formula) ``` -Só se da como criterio um objeto `Formula`: +Only a `Formula` object is given as criteria: ```4d var $es : cs. StudentsSelection @@ -1362,7 +1419,7 @@ Só se da como criterio um objeto `Formula`: $es:=ds. Students.query($formula) ``` -Podem ser aplicadas várias fórmulas: +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1371,7 +1428,7 @@ Podem ser aplicadas várias fórmulas: $0:=ds. Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Uma fórmula texto em *queryString* recebe um parámetro: +A text formula in *queryString* receives a parameter: ```4d var $es : cs. StudentsSelection @@ -1387,7 +1444,7 @@ Uma fórmula texto em *queryString* recebe um parámetro: $result:=(Position($exclude;This.lastname)=0) ``` -Utilizando o mesmo método ***checkName***, um objeto `Formula` como marcador de posição recebe um parámetro: +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs. StudentsSelection @@ -1400,7 +1457,7 @@ Utilizando o mesmo método ***checkName***, um objeto `Formula` como marcador de $es:=ds. Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua consulta: +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs. StudentsSelection @@ -1415,7 +1472,7 @@ Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua #### Veja também -[`.query()`](EntitySelectionClass.md#query) para seleções de entidades +[`.query()`](EntitySelectionClass.md#query) for entity selections @@ -1433,9 +1490,9 @@ Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua -| Parâmetro | Tipo | | Descrição | -| --------- | ------ | -- | --------------------------------------------------------------------------------------------------------------- | -| settings | Object | -> | Objecto que define o tempo limite e o tamanho máximo da cache ORDA para a dataclass.| +| Parâmetro | Tipo | | Descrição | +| --------- | ------ | -- | ------------------------------------------------------------------------------------------------------------- | +| settings | Object | -> | Object that sets the timeout and maximum size of the ORDA cache for the dataclass.| | @@ -1443,30 +1500,30 @@ Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua #### Descrição -A função `.setRemoteCacheSettings()` define o tempo limite e o tamanho máximo da cache ORDA para um dataclass.. +The `.setRemoteCacheSettings()` function sets the timeout and maximum size of the ORDA cache for a dataclass.. -No parâmetro *settings*, passe um objeto contendo as propriedades abaixo: +In the *settings* parameter, pass an object with the following properties: | Propriedade | Tipo | Descrição | | ----------- | ------- | ---------------------------- | | timeout | Integer | Tempo de espera em segundos. | | maxEntries | Integer | Número máximo de entidades. | -`timeout` define o timeout da cache ORDA para o dataclass (por defeito é de 30 segundos). Uma vez decorrido o tempo limite, as entidades da classe de dados na cache são consideradas como expiradas. Isto significa que: +`timeout` sets the timeout of the ORDA cache for the dataclass (default is 30 seconds). Once the timeout has passed, the entities of the dataclass in the cache are considered as expired. This means that: * os dados ainda estão lá * na próxima vez que os dados forem necessários, serão solicitados ao servidor * 4D remove automaticamente os dados expirados quando o número máximo de entidades é atingido -A definição de um tempo limite `` define um novo tempo limite para as entidades já presentes na cache. É útil quando se trabalha com dados que não mudam com muita frequência, e portanto quando não são necessários novos pedidos ao servidor. +Setting a `timeout` property sets a new timeout for the entities already present in the cache. It is useful when working with data that does not change very frequently, and thus when new requests to the server are not necessary. -`maxEntries` define o número máximo de entidades na cache ORDA. O padrão é de 30 000. +`maxEntries` sets the max number of entities in the ORDA cache. Default is 30 000. -O número mínimo de entradas é 300, pelo que o valor de `maxEntries` deve ser igual ou superior a 300. Caso contrário, é ignorado e o número máximo de entradas é fixado em 300. +The minimum number of entries is 300, so the value of `maxEntries` must be equal to or higher than 300. Otherwise it is ignored and the maximum number of entries is set to 300. -Se nenhuma propriedade válida for passada como `timeout` e `maxEntries`, a cache permanece inalterada, com os seus valores por defeito ou previamente definidos. +If no valid properties are passed as `timeout` and `maxEntries`, the cache remains unchanged, with its default or previously set values. -Quando uma entidade é guardada, é actualizada na cache e expira quando o tempo limite é atingido. +When an entity is saved, it is updated in the cache and expires once the timeout is reached. #### Exemplo From 0a29b9e4e0017e8e18e6d4fc785c793daf7b5a53 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:47:41 +0200 Subject: [PATCH 141/180] New translations DataStoreClass.md (Portuguese, Brazilian) --- .../current/API/DataStoreClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/API/DataStoreClass.md b/i18n/pt/docusaurus-plugin-content-docs/current/API/DataStoreClass.md index 6eb1519db5e39a..eeda9729940512 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/API/DataStoreClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/API/DataStoreClass.md @@ -1108,7 +1108,7 @@ To create a client-side ORDA request log, call this function on a remote machine #### Do lado do servidor -To create a server-side ORDA request log, call this function on the server machine. The log data is written in a file in `.jsonl` format. Cada objeto representa um pedido. If the file does not already exist, it is created. No caso contrário, ou seja, se o arquivo já existir, os novos dados de registro serão adicionados a ele. +To create a server-side ORDA request log, call this function on the server machine. The log data is written in a file in `.jsonl` format. Cada objeto representa um pedido. Se o ficheiro ainda não existir, é criado. No caso contrário, ou seja, se o arquivo já existir, os novos dados de registro serão adicionados a ele. - If you passed the *file* parameter, the log data is written in this file, at the requested location. - If you omit the *file* parameter or if it is null, the log data is written in a file named *ordaRequests.jsonl* and stored in the "/LOGS" folder. - The *options* parameter can be used to specify if the server response has to be logged, and if it should include the body. By default when the parameter is omitted, the full response is logged. The following constants can be used in this parameter: From c2222556109e048035d90eb6e4ebc1b9735267c4 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:47:47 +0200 Subject: [PATCH 142/180] New translations EntityClass.md (Portuguese, Brazilian) --- .../docusaurus-plugin-content-docs/current/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/API/EntityClass.md b/i18n/pt/docusaurus-plugin-content-docs/current/API/EntityClass.md index 59b944068875df..298640d5488bcc 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/API/EntityClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/API/EntityClass.md @@ -1698,7 +1698,7 @@ Se nenhum atributo de entidade for tocado, o método retorna uma coleção vazia //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -Nesse modo: +In this case: * firstName and lastName tem um tipo `storage` * employer tem um tipo `relatedEntity` From eb2ffdbccaca516a7b0e9759e21ff155ae2e25cc Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:50:37 +0200 Subject: [PATCH 143/180] New translations properties_Text.md (Portuguese, Brazilian) --- .../current/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md b/i18n/pt/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md index 7281320fe7f790..85a7e55253e81b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/FormObjects/properties_Text.md @@ -281,7 +281,7 @@ This property can also be handled by the [OBJECT Get vertical alignment](https:/ `List box do tipo Collection ou entity selection` -Especifica uma expressão ou uma variável que será avaliada para cada linha exibida. Permite definir um conjunto completo de atributos de texto das linhas. É necessário transmitir uma **variável objeto** ou uma **expressão que devolva um objeto**. As propriedades abaixo são compatíveis: +Especifica uma expressão ou uma variável que será avaliada para cada linha exibida. Permite definir um conjunto completo de atributos de texto das linhas. É necessário transmitir uma **variável objeto** ou uma **expressão que devolva um objeto**. The following properties are supported: | Nome da propriedade | Tipo | Descrição | | ------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From bb79821afaa585b68e5a0f763232e4e31b78ace9 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:51:28 +0200 Subject: [PATCH 144/180] New translations $compute.md (Portuguese, Brazilian) --- .../docusaurus-plugin-content-docs/current/REST/$compute.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/REST/$compute.md b/i18n/pt/docusaurus-plugin-content-docs/current/REST/$compute.md index 7d681cf5d86853..d8a49053699667 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/REST/$compute.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/REST/$compute.md @@ -33,7 +33,7 @@ Pode utilizar qualquer uma das seguintes palavras-chave: ## Exemplo -If you want to get all the computations for an attribute of type Number, you can write: +Se quiser obter todos os cálculos para um atributo do tipo Número, pode escrever: `GET /rest/Employee/salary/?$compute=$all` @@ -67,7 +67,7 @@ Se quiser obter todos os cálculos para um atributo do tipo String, pode escreve } ```` -If you want to just get one calculation on an attribute, you can write the following: +Se pretender obter apenas um cálculo num atributo, pode escrever o seguinte: `GET /rest/Employee/salary/?$compute=sum` @@ -76,7 +76,7 @@ If you want to just get one calculation on an attribute, you can write the follo `235000` -If you want to perform a calculation on an Object attribute, you can write the following: +Se pretender efetuar um cálculo num atributo de um objeto, pode escrever o seguinte: `GET /rest/Employee/objectAttribute.property1/?$compute=sum` From fb4b27c4967a4e08127458dec90407a7481a19ea Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:51:34 +0200 Subject: [PATCH 145/180] New translations $imageformat.md (Portuguese, Brazilian) --- .../current/REST/$imageformat.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/REST/$imageformat.md b/i18n/pt/docusaurus-plugin-content-docs/current/REST/$imageformat.md index 9b72a8b5cecdbe..820d6c101ff35b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/REST/$imageformat.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/REST/$imageformat.md @@ -17,13 +17,13 @@ Definir o formato a utilizar para mostrar imagens. Pode utilizar um dos seguinte | ".jpeg" or "image/jpeg" | Formato JPEG | | ".tiff" ou "image/tiff" | Formato TIFF | -Once you have defined the format, you must pass the image attribute to [`$expand`]($expand.md) to load the photo completely. +Uma vez definido o formato, é necessário passar o atributo de imagem a [`$expand`]($expand.md) para carregar completamente a fotografia. -If there is no image to be loaded or the format doesn't allow the image to be loaded, the response will be an empty object `{}`. +Se não houver nenhuma imagem a carregar ou se o formato não permitir que a imagem seja carregada, a resposta será um objeto vazio `{}`. ## Exemplo -The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: +O exemplo seguinte define o formato de imagem como JPEG, independentemente do tipo real da fotografia, e passa o número de versão real enviado pelo servidor: `GET /rest/Employee(1)/photo?$imageformat=.jpeg&$version=3&$expand=photo` From a53fd414d419c5a0f7850cca3aabe9347f9895ee Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:51:36 +0200 Subject: [PATCH 146/180] New translations $lock.md (Portuguese, Brazilian) --- .../current/REST/$lock.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/REST/$lock.md b/i18n/pt/docusaurus-plugin-content-docs/current/REST/$lock.md index 620583aef1c2f0..9e91cbb9f15ccb 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/REST/$lock.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/REST/$lock.md @@ -28,33 +28,33 @@ A propriedade [`lockKindText`](../API/EntityClass.md#lock) é "Locked by session ### Descrição -The locks triggered by the REST API are put at the [session](authUsers.md#opening-sessions) level. +Os bloqueios accionados pela API REST são colocados ao nível da [sessão](authUsers.md#opening-sessions). -A locked entity is seen as *locked* (i.e. lock / unlock / update / delete actions are not possible) by: +Uma entidade bloqueada é vista como *bloqueada* (ou seja, as acções de bloquear/desbloquear/atualizar/eliminar não são possíveis) por: - outras sessões REST -- 4D processes (client/server, remote datastore, standalone) running on the REST server. +- Processos 4D (cliente/servidor, datastore remoto, autónomo) em execução no servidor REST. Uma entidade bloqueada pela API REST só pode ser desbloqueada: -- by its locker, i.e. a `/?$lock=false` in the REST session that sets `/?$lock=true` -- or if the session's [inactivity timeout]($directory.md) is reached (the session is closed). +- pelo seu locker, ou seja, um `/?$lock=false` na sessão REST que define `/?$lock=true` +- ou se o tempo limite de inatividade da sessão []($directory.md) for atingido (a sessão é encerrada). ### Resposta -A `?$lock` request returns a JSON object with `"result"=true` if the lock operation was successful and `"result"=false` if it failed. +Um pedido `?$lock` devolve um objeto JSON com `"result"=true` se a operação de bloqueio for bem sucedida e `"result"=false` se falhar. O objeto "__STATUS" devolvido tem as seguintes propriedades: | Propriedade | | Tipo | Descrição | | ------------ | -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | | | | ***Disponível apenas em caso de sucesso:*** | -| success | | boolean | true if the lock action is successful (or if the entity is already locked in the current session), false otherwise (not returned in this case). | +| success | | boolean | true se a ação de bloqueio for bem sucedida (ou se a entidade já estiver bloqueada na sessão atual), false caso contrário (não devolvido neste caso). | | | | | ***Disponível apenas em caso de erro:*** | | status | | number | Código de erro, ver abaixo | | statusText | | text | Descrição do erro, ver abaixo | | lockKind | | number | Código de bloqueio | -| lockKindText | | text | "Locked by session" if locked by a REST session, "Locked by record" if locked by a 4D process | +| lockKindText | | text | "Bloqueado por sessão" se bloqueado por uma sessão REST, "Bloqueado por registo" se bloqueado por um processo 4D | | lockInfo | | object | Informações sobre a origem do bloqueio. Retorna propriedades dependendo da origem da trava (processo 4D ou sessão REST) | | | | | ***Disponível só para um processo trava 4D:*** | | | task_id | number | Process ID | From 176d379aabb500c8c0d3d9da1daf678e4820e28e Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:51:50 +0200 Subject: [PATCH 147/180] New translations genInfo.md (Portuguese, Brazilian) --- i18n/pt/docusaurus-plugin-content-docs/current/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/REST/genInfo.md b/i18n/pt/docusaurus-plugin-content-docs/current/REST/genInfo.md index b41a6100f6387e..8c149773857e3c 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/REST/genInfo.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/REST/genInfo.md @@ -33,4 +33,4 @@ Essas propriedades são objetos que contém informação sobre como o servidor r - **queryPlan**: objeto contendo a descrição detalhada da pesquisa logo antes de ser executada (ou seja, a pesquisa planejada). - **queryPath**: objeto contendo a descrição detalhada da pesquisa como foi realizada. -A informação registrada inclui o tipo de pesquisa (indexada e sequencial) e cada subpesquisa necessária junto com operações de conjunção. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Geralmente a descrição do plano de pesquisa e sua rota são idênticas mas podem ser diferentes porque 4D pode implementar otimizações dinâmicas quando uma pesquisa for executada para melhorar a performance. Por exemplo, o motor 4D pode converter dinamicamente uma consulta indexada em uma consulta sequencial se estimar que seja mais rápido. Esse caso particular pode acontecer quando o número de entidades sendo pesquisada é baixo. \ No newline at end of file +A informação registrada inclui o tipo de pesquisa (indexada e sequencial) e cada subpesquisa necessária junto com operações de conjunção. Query paths also contain the number of entities found and the time required to execute each search criterion. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From bad9191a4256f31002b3d986a82d006c38f425e7 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 12:52:15 +0200 Subject: [PATCH 148/180] New translations method-list.md (Portuguese, Brazilian) --- .../current/ViewPro/method-list.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/current/ViewPro/method-list.md b/i18n/pt/docusaurus-plugin-content-docs/current/ViewPro/method-list.md index 4f60b1e7da4304..82e5bf0c12354b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/current/ViewPro/method-list.md +++ b/i18n/pt/docusaurus-plugin-content-docs/current/ViewPro/method-list.md @@ -37,7 +37,7 @@ Passar a fórmula 4D View Pro que deseja nomear em *vpFormula*. Para obter infor Passar o novo nome da fórmula em *name*. Se o nome já estiver a ser utilizado no mesmo âmbito, a nova fórmula nomeada substitui a existente. Note que pode utilizar o mesmo nome para diferentes âmbitos (ver abaixo). -Pode passar um objeto com propriedades adicionais para a fórmula nomeada em *options*. As propriedades abaixo são compatíveis: +Pode passar um objeto com propriedades adicionais para a fórmula nomeada em *options*. The following properties are supported: | Propriedade | Tipo | Descrição | | ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -77,7 +77,7 @@ O comando `VP ADD RANGE NAME` cr Em *rangeObj*, passe o intervalo que pretende nomear e passe o novo nome para o intervalo em *name*. Se o nome já estiver a ser utilizado no mesmo âmbito, o novo intervalo nomeado substitui o existente. Note que pode utilizar o mesmo nome para diferentes âmbitos (ver abaixo). -Pode passar um objeto com propriedades adicionais para o intervalo nomeado em *options*. As propriedades abaixo são compatíveis: +Pode passar um objeto com propriedades adicionais para o intervalo nomeado em *options*. The following properties are supported: | Propriedade | Tipo | Descrição | | ----------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1151,7 +1151,7 @@ In the *rangeObj* parameter, pass an object containing a range to search. The *searchValue* parameter lets you pass the text to search for within the *rangeObj*. -You can pass the optional *searchCondition* parameter to specify how the search is performed. As propriedades abaixo são compatíveis: +You can pass the optional *searchCondition* parameter to specify how the search is performed. The following properties are supported: | Propriedade | Tipo | Descrição | | ----------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -3460,7 +3460,7 @@ VP NEW DOCUMENT("myVPArea") O comando `VP Object to font` returns a font shorthand string from *fontObj*. -In *fontObj*, pass an object containing the font properties. As propriedades abaixo são compatíveis: +In *fontObj*, pass an object containing the font properties. The following properties are supported: | Propriedade | Tipo | Descrição | Valores possíveis | Obrigatório | | ----------- | ---- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | From 94a4d273e1ac0a8dae203e801ff0da6302d74db2 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:06:03 +0200 Subject: [PATCH 149/180] New translations properties_Text.md (Portuguese, Brazilian) --- .../version-18/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md b/i18n/pt/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md index a043603a411ca5..ed30e17b7408b4 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-18/FormObjects/properties_Text.md @@ -275,7 +275,7 @@ This property can also be handled by the [OBJECT Get vertical alignment](https:/ `List box do tipo Collection ou entity selection` -Especifica uma expressão ou uma variável que será avaliada para cada linha exibida. Permite definir um conjunto completo de atributos de texto das linhas. É necessário transmitir uma **variável objeto** ou uma **expressão que devolva um objeto**. As propriedades abaixo são compatíveis: +Especifica uma expressão ou uma variável que será avaliada para cada linha exibida. Permite definir um conjunto completo de atributos de texto das linhas. É necessário transmitir uma **variável objeto** ou uma **expressão que devolva um objeto**. The following properties are supported: | Nome da propriedade | Tipo | Descrição | | ------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 27bfe1147735cadf8e1e9fb8e0020bfc2dd590f7 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:06:40 +0200 Subject: [PATCH 150/180] New translations $compute.md (Portuguese, Brazilian) --- .../version-18/REST/$compute.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$compute.md b/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$compute.md index cd2082f3f68dad..60e12c4b6fa718 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$compute.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$compute.md @@ -33,7 +33,7 @@ Pode utilizar qualquer uma das seguintes palavras-chave: ## Exemplo -If you want to get all the computations for an attribute of type Number, you can write: +Se quiser obter todos os cálculos para um atributo do tipo Número, pode escrever: `GET /rest/Employee/salary/?$compute=$all` @@ -67,7 +67,7 @@ Se quiser obter todos os cálculos para um atributo do tipo String, pode escreve } ```` -If you want to just get one calculation on an attribute, you can write the following: +Se pretender obter apenas um cálculo num atributo, pode escrever o seguinte: `GET /rest/Employee/salary/?$compute=sum` @@ -76,7 +76,7 @@ If you want to just get one calculation on an attribute, you can write the follo `235000` -If you want to perform a calculation on an Object attribute, you can write the following: +Se pretender efetuar um cálculo num atributo de um objeto, pode escrever o seguinte: `GET /rest/Employee/objectAttribute.property1/?$compute=sum` From d8a0d8c92b27a511cb299a873e14d7d1d2470756 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:06:46 +0200 Subject: [PATCH 151/180] New translations $imageformat.md (Portuguese, Brazilian) --- .../version-18/REST/$imageformat.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$imageformat.md b/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$imageformat.md index 9b72a8b5cecdbe..820d6c101ff35b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$imageformat.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$imageformat.md @@ -17,13 +17,13 @@ Definir o formato a utilizar para mostrar imagens. Pode utilizar um dos seguinte | ".jpeg" or "image/jpeg" | Formato JPEG | | ".tiff" ou "image/tiff" | Formato TIFF | -Once you have defined the format, you must pass the image attribute to [`$expand`]($expand.md) to load the photo completely. +Uma vez definido o formato, é necessário passar o atributo de imagem a [`$expand`]($expand.md) para carregar completamente a fotografia. -If there is no image to be loaded or the format doesn't allow the image to be loaded, the response will be an empty object `{}`. +Se não houver nenhuma imagem a carregar ou se o formato não permitir que a imagem seja carregada, a resposta será um objeto vazio `{}`. ## Exemplo -The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: +O exemplo seguinte define o formato de imagem como JPEG, independentemente do tipo real da fotografia, e passa o número de versão real enviado pelo servidor: `GET /rest/Employee(1)/photo?$imageformat=.jpeg&$version=3&$expand=photo` From d0a08f4d8885111695bea92fe275040fe35d6c4f Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:06:56 +0200 Subject: [PATCH 152/180] New translations $version.md (Portuguese, Brazilian) --- .../docusaurus-plugin-content-docs/version-18/REST/$version.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$version.md b/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$version.md index 3ff4ffd431325b..107390c0cfd013 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$version.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/$version.md @@ -13,6 +13,6 @@ O valor do parâmetro de versão da imagem é modificado pelo servidor. ## Exemplo -The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: +O exemplo seguinte define o formato de imagem como JPEG, independentemente do tipo real da fotografia, e passa o número de versão real enviado pelo servidor: `GET /rest/Employee(1)/photo?$imageformat=jpeg&$version=3&$expand=photo` \ No newline at end of file From 77b0f9095e91aaa589426ea8fab97bf3e11014d8 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:07:01 +0200 Subject: [PATCH 153/180] New translations genInfo.md (Portuguese, Brazilian) --- .../docusaurus-plugin-content-docs/version-18/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/genInfo.md b/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/genInfo.md index b41a6100f6387e..8c149773857e3c 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/genInfo.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-18/REST/genInfo.md @@ -33,4 +33,4 @@ Essas propriedades são objetos que contém informação sobre como o servidor r - **queryPlan**: objeto contendo a descrição detalhada da pesquisa logo antes de ser executada (ou seja, a pesquisa planejada). - **queryPath**: objeto contendo a descrição detalhada da pesquisa como foi realizada. -A informação registrada inclui o tipo de pesquisa (indexada e sequencial) e cada subpesquisa necessária junto com operações de conjunção. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Geralmente a descrição do plano de pesquisa e sua rota são idênticas mas podem ser diferentes porque 4D pode implementar otimizações dinâmicas quando uma pesquisa for executada para melhorar a performance. Por exemplo, o motor 4D pode converter dinamicamente uma consulta indexada em uma consulta sequencial se estimar que seja mais rápido. Esse caso particular pode acontecer quando o número de entidades sendo pesquisada é baixo. \ No newline at end of file +A informação registrada inclui o tipo de pesquisa (indexada e sequencial) e cada subpesquisa necessária junto com operações de conjunção. Query paths also contain the number of entities found and the time required to execute each search criterion. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From f624b0cb0bdd7b4b9ae47616afcf9ae6a14af432 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:11:24 +0200 Subject: [PATCH 154/180] New translations DataClassClass.md (Portuguese, Brazilian) --- .../version-19/API/DataClassClass.md | 201 +++++++++++------- 1 file changed, 129 insertions(+), 72 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md index b9ecd73f61ad7c..3bc72f9f2e4a9b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-19/API/DataClassClass.md @@ -479,8 +479,10 @@ O método de projeto ***SearchDuplicate*** procura por valores duplicados em qua | ---------- | ------ | -- | ------------------------------------------------- | | Resultados | Object | <- | Datastore da dataclass| + | + #### Descrição A função `.getInfo( )` devolve um objecto que fornece informação sobre o dataclass. Esta função é útil para configurar o código genérico. @@ -648,7 +650,7 @@ A função `.query( )` pesquisa por Se não houver entidades correspondentes encontradas, uma `EntitySelection` vazia é retornada. -**parâmetro queryString** +**queryString parameter** O parâmetro *queryString* usa a sintaxe abaixo: @@ -658,7 +660,7 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -onde: +where: * **attributePath**: caminho de atributo no qual se pretende executar a consulta. Os atributos se expressam como pares propriedade/ valor, onde propriedade é o nome do marcador de posição inserido para uma rota de atributo em *queryString* ou *formula* (":placeholder") e valor pode ser uma string ou uma coleção de strings. Cada valor e uma rota que pode designar um escalar ou um atributo relacionado da dataclass ou uma propriedade num campo de objeto da dataclass You can also use a **placeholder** (see below). > *Não pode usar diretamente atributos cujo nome contenha caracteres especiais como ".", "\[ ]", or "=", ">", "#"..., porque serão avaliados incorretamente na string da query. Se precisar de uma query com esses atributos, deve considerar o uso de placeholders que permitem uma gama estendida de caracteres em rotas de atributo (ver* **Using placeholders** *below).* @@ -706,35 +708,35 @@ onde: * **order by attributePath**: pode incluir uma declaração order by *attributePath* na pesquisa para que os dados resultantes sejam ordenados de acordo com esta declaração. Pode utilizar várias instruções de ordenação, separadas por vírgulas (por exemplo, ordenação por *attributePath1* desc, *attributePath2* asc). Como padrão, a ordem é ascendente. Passe 'desc'' para definir uma ordem descendente e 'asc' para definir uma ordem ascendente. > *If you use this statement, the returned entity selection is ordered (for more information, please refer to [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Usar aspas** +**Using quotes** -Quando usar aspas com pesquisas, deve usar aspas simples ' ' dentro das pesquisas e aspas duplas " " para cercar a consulta inteira, senão um erro é retornado. Por exemplo: +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Por exemplo: ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Aspas siples (') não são permitidas nos valores pesquisados, já que quebrariam a string de pesquisa. Por exemplo, "comp.name = 'John's pizza' " gerará um erro. Se precisar pesquisar valores com aspas simples, pode considerar o uso de placeholders (ver abaixo). -**Usando parêntesis** +**Using parenthesis** -É possível utilizar parênteses na consulta para dar prioridade ao cálculo. Por exemplo, pode organizar uma pesquisa da seguinte maneira: +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Uso de placeholders** +**Using placeholders** -4D lhe permite utilizar placeholders, marcadores de posição, para os argumentos *attributePath*, *formula* e *value* dentro do parâmetro *queryString*. Um placeholder é um parâmetro que é inserido em strings de pesquisa e que pode ser substituído por outro valor quando a string for realizada. O valor dos placeholders é avaliado uma vez ao inicio da pesquisa - não é avaliado para cada elemento. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Dois tipos de marcadores podem ser usados: **placeholders indexados ** e **placeholders nomeados**: +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | - | Marcadores de posição indexados | Placeholders nomeados | | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Definição | Parameters are inserted as :paramIndex (for example :1, :2...) in queryString and their corresponding values are provided by the sequence of value parameter(s). É possível utilizar até 128 parâmetros de valor | Parameters are inserted as :paramName (for example :myparam) and their values are provided in the attributes and/or parameters objects in the querySettings parameter | | Exemplo | $r:=class.query(":1=:2";"city";"Chicago") | $o.attributes:=New object("att";"city")
$o.parameters:=New object("name";"Chicago")
$r:=class.query(":att=:name";$o) | -Pode misturar os tipos de argumentos em *queryString*. Um *queryString* pode conter, para os parâmetros *attributePath*, *formula* e *value* : +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * valores diretos (sem marcadores), * marcadores indexados ou com nome. @@ -748,15 +750,15 @@ Pode misturar os tipos de argumentos em *queryString*. Um *queryString* pode con $result:=$col.query($vquery) ``` - Esta pesquisa parece segura já que se filtram os dados não públicos. Entretanto, se o usuário introduzr na área *myname* algo como *"smith OR status='private'*, a string de pesquisa se modificaría na etapa da interpretação e poderia devolver dados privados. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Quando usar marcadores de posição, não é possível anular as condições de segurança: + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - Neste caso, se o usuário introduz *smith OR status='private'* na área *myname*, não se interpretará na string de pesquisa, só será passada como um valor. Procurando por "smith OR status = 'private' vai falhar + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Evita ter que se preocupar por questões de formato ou caracteres, especialmente quando se manejam os parâmetros *attributePath* o *value* que podem conter não alfanuméricos como ".", "['... @@ -767,31 +769,86 @@ Pode misturar os tipos de argumentos em *queryString*. Um *queryString* pode con $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Pesquisa de valores null** +**Looking for null values** -Quando pesquisar por valores null não pode usar a sintaxe de placeholder porque o motor de pesquisa vai consider null como um valor de comparação inesperado. Por exemplo se executar esta pesquisa: +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds. Person.query("spouse = :1";Null) // will NOT work ``` -Não obterá o resultado esperado porque o valor nulo será avaliado por 4D como um erro resultante da avaliação do parâmetro (por exemplo, um atributo vindo de outra pesquisa). Para este tipo de pesquisa, deve usar a sintaxe de pesquisa direta: +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds. Person.query("spouse = null") //correct syntax ``` -**Linkar os argumentos de pesquisa com os atributos de coleção** + +**Not equal to in collections** + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + +**Linking collection attribute query arguments** :::info -Esta funcionalidade só está disponível em consultas de dataclasses e [selecção de entidades](EntitySelectionClass.md#query). Não pode ser utilizado em pesquisas em [colecções](CollectionClass.md#query). +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -Para fazer isso, é necessário vincular os argumentos de pesquisa para elementos de coleção, para que apenas elementos únicos contendo argumentos linkados são encontrados. Ao pesquisar dentro de atributos de objectos dataclass contendo colecções utilizando múltiplos argumentos de consulta unidos pelo operador AND, poderá querer certificar-se de que apenas entidades contendo elementos que correspondem a todos os argumentos são devolvidas, e não entidades onde os argumentos podem ser encontrados em diferentes elementos. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Por exemplo, com as duas entidades abaixo: +For example, with the following two entities: ``` Entity 1: @@ -812,59 +869,59 @@ ds. People.places: } ] } ``` -Se quiser encontrar pessoas com um tipo de local "home" na cidade "paris". Se escrever +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds. People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... a pesquisa devolverá "martin" **e** "smith" porque "smith" tem um elemento "locations" cujo "tipo" é "home" e um elemento "locations" cuja "cidade" é "paris", mesmo que sejam elementos diferentes. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Se quiser obter apenas entidades onde os argumentos correspondentes estão no mesmo elemento coleção, precisa **linkar os argumentos**. Para linkar argumentos de pesquisa: +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Adicionar uma letra entre os \[] na primeira rota a linkar e repita a mesma letra em todos os argumentos linkados. Por exemplo: `locations[a].city and locations[a].kind`. Pode usar qualquer letra do alfabeto latino (não diferencia maiúsculas e minúsculas). * Para adicionar critérios linkados na mesma pesquisa, use outra letra. Pode criar até 26 combinações de critérios em uma única pesquisa. -Com as entidades acima, se escreve: +With the above entities, if you write: ```4d ds. People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... pesquisa só devolverá "martin" porque tem um elemento "locations" cujo "kind" é "home" e cujo "city" for "paris". A pesquisa não devolverá 'smith' porque os valores 'home' e 'paris' não estão no mesmo elemento de coleção. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**parâmetro de fórmula** +**formula parameter** -Como alternativa à inserção de fórmulas dentro do parâmetro *queryString* (ver acima), pode passar diretamente um objeto fórmula como critério de pesquisa booleano. A utilizaçã de um objeto fórmula para as pesquisas é **recomendada** já que se beneficia da tokenização, e o código é mais fácil de pesquisar/ler. +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. -The formula must have been created using the `Formula` or `Formula from string` command. Nesse modo: +The formula must have been created using the `Formula` or `Formula from string` command. In this case: * *fórmula* se avalia para cada entidade e deve devolver true ou false. Durante a execução da pesquisa, se o resultado da fórmula não for booleano, é considerado como False. * dentro da *fórmula*, a entidade está disponível através do objeto `This`. * if the `Formula` object is **null**, the errror 1626 ("Expecting a text or formula") is generated, that you call intercept using a method installed with `ON ERR CALL`. > For security reasons, formula calls within `query(`) member methods can be disallowed. Veja a descrição do parâmetro *querySettings*. -**Passar parâmetros a fórmulas** +**Passing parameters to formulas** -Todo parâmetro *formula* chamado pela função `query()` pode receber parâmetros: +Any *formula* called by the `query()` class function can receive parameters: * Parâmeters devem ser passados através da propriedade **args** (objeto) do parâmetro *querySettings*. * A fórmula recebe este objeto **args** como um parâmetro **$1**. -Este pequeno código mostra os principios de como são passados os parâmetros aos métodos: +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //args object to pass parameters $es:=ds. Students.query("eval(checkName($1.exclude))";$settings) //args is received in $1 ``` -No exemplo 3 são oferecidos mais exemplos. +Additional examples are provided in example 3. -**4D Server**: em cliente/servidor, as fórmulas são executadas no servidor. Neste contexto, só se envia às fórmulas o objeto `querySettings.args`. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**parâmetro querySettings** +**querySettings parameter** -No parâmetro *querySettings* é possível passar um objeto que conteha opções adicionais. As propriedades abaixo são compatíveis: +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propriedade | Tipo | Descrição | | ------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -876,11 +933,11 @@ No parâmetro *querySettings* é possível passar um objeto que conteha opçõe | queryPlan | Parâmetros | Na entity selection resultante, devolve ou não a descrição detalhada da pesquisa logo antes de ser executada, ou seja, a pesquisa planificada. A propriedade devolvida é um objeto que inclui cada pesquisa e subpesquisa prevista (no caso de uma pesquisa complexa). Esta opção é útil durante a fase de desenvolvimento de uma aplicação. Geralmente é usada em conjunto com queryPath. Como padrão é omitido: false. **Note**: This property is supported only by the `entitySelection.query( )` and `dataClass.query( )` functions. | | queryPath | Parâmetros | Na entity selection resultante, devolve ou não a descrição detalhada da pesquisa tal qual for realizada. A propriedade retornada é um objeto que contém a rota atual usada para a pesquisa (geralmente idêntica àquela do queryPlan, mas deve diferenciar se o motor consegue otimizar a pesquisa), assim como o tempo de processamento e o número de registros encontrado. Esta opção é útil durante a fase de desenvolvimento de uma aplicação. Como padrão é omitido: false. **Note**: This property is supported only by the `entitySelection.query( )` and `dataClass.query( )` functions. | -**Sobre queryPlan e queryPath** +**About queryPlan and queryPath** -A informação registrada em `queryPlan`/`queryPath` inclui o tipo de pesquisa (indexada e sequencial) e cada subconsulta necessária junto com os operadores de conjunção. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Geralmente a descrição do plano de pesquisa e sua rota são idênticas mas podem ser diferentes porque 4D pode implementar otimizações dinâmicas quando uma pesquisa for executada para melhorar a performance. Por exemplo, o motor 4D pode converter dinamicamente uma consulta indexada em uma consulta sequencial se estimar que seja mais rápido. Esse caso particular pode acontecer quando o número de entidades sendo pesquisada é baixo. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Por exemplo se executar esta pesquisa: +For example, if you execute the following query: ```4d $sel:=ds. Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ @@ -909,46 +966,46 @@ queryPath: #### Exemplo 1 -Esta seção oferece vários exemplos de pesquisas. +This section provides various examples of queries. -Consultas em uma string: +Query on a string: ```4d $entitySelection:=ds. Customer.query("firstName = 'S@'") ``` -Consulta com uma instrução NOT: +Query with a NOT statement: ```4d $entitySelection:=ds. Employee.query("not(firstName=Kim)") ``` -Pesquisas com datas: +Queries with dates: ```4d $entitySelection:=ds. Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds. Employee.query("birthDate <= :1";Current date-10950) ``` -Pesquisa com marcadores de posição indexados para os valores: +Query with indexed placeholders for values: ```4d $entitySelection:=ds. Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Pesquisa com marcadores de posição indexados para valores em u ma dataclass relacionada: +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds. Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Pesquisa com marcador de posição indexado que inclui uma instrução de ordem descendente: +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds. Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Pesquisa com marcadores de posição com nome para os valores: +Query with named placeholders for values: ```4d var $querySettings : Object @@ -958,7 +1015,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds. Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Pesquisa que usa marcadores de posição nomeados e indexados para valores: +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -967,7 +1024,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds. Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Pesquisa com objetos queryPlan e queryPath: +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds. Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -978,19 +1035,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Pesquisa com uma rota de atributo de tipo Collection: +Query with an attribute path of Collection type: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Pesquisa com uma rota de atributos de tipo Collection e atributos vinculados: +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Pesquisa com uma rota de atributos de tipo Collection e múltiplos atributos vinculados: +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and @@ -998,25 +1055,25 @@ $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Pesquisa com uma rota de atributo de tipo Objeto +Query with an attribute path of Object type: ```4d $entitySelection:=ds. Employee.query("extra.eyeColor = :1";"blue") ``` -Pesquisa com uma instrução IN: +Query with an IN statement: ```4d $entitySelection:=ds. Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Pesquisa com instrução NOT (IN): +Query with a NOT (IN) statement: ```4d $entitySelection:=ds. Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Pesquisa com marcadores de posição indexados para os atributos: +Query with indexed placeholders for attributes: ```4d var $es : cs. EmployeeSelection @@ -1024,7 +1081,7 @@ $es:=ds. Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name" //salesperson is a related entity ``` -Pesquisa com marcadores de posição indexados para os atributos e marcadores de posição com nome para os valores: +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs. EmployeeSelection @@ -1035,7 +1092,7 @@ $es:=ds. Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId"; //salesperson is a related entity ``` -Pesquisa com marcadores de posição indexados para os atributos e os valores: +Query with indexed placeholders for attributes and values: ```4d var $es : cs. EmployeeSelection @@ -1045,11 +1102,11 @@ $es:=ds. Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smit #### Exemplo 2 -Esta seção ilustra pesquisas com marcadores de posição com nomes para os atributos. +This section illustrates queries with named placeholders for attributes. -Dada uma dataclass Employee com 2 entidades: +Given an Employee dataclass with 2 entities: -Entidade 1: +Entity 1: ```4d name: "Marie" @@ -1061,7 +1118,7 @@ softwares:{ } ``` -Entidade 2: +Entity 2: ```4d name: "Sophie" @@ -1073,7 +1130,7 @@ softwares:{ } ``` -Pesquisa com marcadores de posição com nome para os atributos: +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1084,7 +1141,7 @@ Pesquisa com marcadores de posição com nome para os atributos: //$es.length=1 (Employee Marie) ``` -Pesquisa com marcadores de posição com nome para os atributos e os valores: +Query with named placeholders for attributes and values: ```4d var $querySettings : Object @@ -1104,16 +1161,16 @@ Pesquisa com marcadores de posição com nome para os atributos e os valores: #### Exemplo 3 -Estes exemplos ilustram as distintas formas de utilizar fórmulas com ou sem parâmetros em suas pesquisas. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -A fórmula se da como texto com `eval()` no parâmetro *queryString*: +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs. StudentsSelection $es:=ds. Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -A fórmula se dá como um objeto `Formula` através de um marcador de posição: +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs. StudentsSelection @@ -1122,7 +1179,7 @@ A fórmula se dá como um objeto `Formula` através de um marcador de posição: $es:=ds. Students.query(":1 and nationality='French'";$formula) ``` -Só se da como criterio um objeto `Formula`: +Only a `Formula` object is given as criteria: ```4d var $es : cs. StudentsSelection @@ -1131,7 +1188,7 @@ Só se da como criterio um objeto `Formula`: $es:=ds. Students.query($formula) ``` -Podem ser aplicadas várias fórmulas: +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1140,7 +1197,7 @@ Podem ser aplicadas várias fórmulas: $0:=ds. Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Uma fórmula texto em *queryString* recebe um parámetro: +A text formula in *queryString* receives a parameter: ```4d var $es : cs. StudentsSelection @@ -1156,7 +1213,7 @@ Uma fórmula texto em *queryString* recebe um parámetro: $result:=(Position($exclude;This.lastname)=0) ``` -Utilizando o mesmo método ***checkName***, um objeto `Formula` como marcador de posição recebe um parámetro: +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs. StudentsSelection @@ -1169,7 +1226,7 @@ Utilizando o mesmo método ***checkName***, um objeto `Formula` como marcador de $es:=ds. Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua consulta: +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs. StudentsSelection @@ -1184,5 +1241,5 @@ Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua #### Veja também -[`.query()`](EntitySelectionClass.md#query) para seleções de entidades +[`.query()`](EntitySelectionClass.md#query) for entity selections From d54da0867ad8a580e508b81d96a66561a703131c Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:11:31 +0200 Subject: [PATCH 155/180] New translations EntityClass.md (Portuguese, Brazilian) --- .../version-19/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-19/API/EntityClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-19/API/EntityClass.md index 9d20024133471e..6b88a7ffbc7d3b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-19/API/EntityClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-19/API/EntityClass.md @@ -1626,7 +1626,7 @@ Se nenhum atributo de entidade for tocado, o método retorna uma coleção vazia //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -Nesse modo: +In this case: * firstName and lastName tem um tipo `storage` * employer tem um tipo `relatedEntity` From 23e2b44ab7c08ad2a02a18fb5fec24cb9bda17c1 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:14:13 +0200 Subject: [PATCH 156/180] New translations properties_Text.md (Portuguese, Brazilian) --- .../version-19/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md b/i18n/pt/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md index 2003c5a35307f9..1bf75919fab99b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-19/FormObjects/properties_Text.md @@ -281,7 +281,7 @@ This property can also be handled by the [OBJECT Get vertical alignment](https:/ `List box do tipo Collection ou entity selection` -Especifica uma expressão ou uma variável que será avaliada para cada linha exibida. Permite definir um conjunto completo de atributos de texto das linhas. É necessário transmitir uma **variável objeto** ou uma **expressão que devolva um objeto**. As propriedades abaixo são compatíveis: +Especifica uma expressão ou uma variável que será avaliada para cada linha exibida. Permite definir um conjunto completo de atributos de texto das linhas. É necessário transmitir uma **variável objeto** ou uma **expressão que devolva um objeto**. The following properties are supported: | Nome da propriedade | Tipo | Descrição | | ------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From 902b791c81956ef9f422df0049a0077762168de6 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:15:05 +0200 Subject: [PATCH 157/180] New translations $compute.md (Portuguese, Brazilian) --- .../version-19/REST/$compute.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$compute.md b/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$compute.md index 7d681cf5d86853..d8a49053699667 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$compute.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$compute.md @@ -33,7 +33,7 @@ Pode utilizar qualquer uma das seguintes palavras-chave: ## Exemplo -If you want to get all the computations for an attribute of type Number, you can write: +Se quiser obter todos os cálculos para um atributo do tipo Número, pode escrever: `GET /rest/Employee/salary/?$compute=$all` @@ -67,7 +67,7 @@ Se quiser obter todos os cálculos para um atributo do tipo String, pode escreve } ```` -If you want to just get one calculation on an attribute, you can write the following: +Se pretender obter apenas um cálculo num atributo, pode escrever o seguinte: `GET /rest/Employee/salary/?$compute=sum` @@ -76,7 +76,7 @@ If you want to just get one calculation on an attribute, you can write the follo `235000` -If you want to perform a calculation on an Object attribute, you can write the following: +Se pretender efetuar um cálculo num atributo de um objeto, pode escrever o seguinte: `GET /rest/Employee/objectAttribute.property1/?$compute=sum` From 85825b226e8d48f5a72bd677dc84c87253510cc9 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:15:11 +0200 Subject: [PATCH 158/180] New translations $imageformat.md (Portuguese, Brazilian) --- .../version-19/REST/$imageformat.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$imageformat.md b/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$imageformat.md index 9b72a8b5cecdbe..820d6c101ff35b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$imageformat.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$imageformat.md @@ -17,13 +17,13 @@ Definir o formato a utilizar para mostrar imagens. Pode utilizar um dos seguinte | ".jpeg" or "image/jpeg" | Formato JPEG | | ".tiff" ou "image/tiff" | Formato TIFF | -Once you have defined the format, you must pass the image attribute to [`$expand`]($expand.md) to load the photo completely. +Uma vez definido o formato, é necessário passar o atributo de imagem a [`$expand`]($expand.md) para carregar completamente a fotografia. -If there is no image to be loaded or the format doesn't allow the image to be loaded, the response will be an empty object `{}`. +Se não houver nenhuma imagem a carregar ou se o formato não permitir que a imagem seja carregada, a resposta será um objeto vazio `{}`. ## Exemplo -The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: +O exemplo seguinte define o formato de imagem como JPEG, independentemente do tipo real da fotografia, e passa o número de versão real enviado pelo servidor: `GET /rest/Employee(1)/photo?$imageformat=.jpeg&$version=3&$expand=photo` From d8ec22f4fe05a6c3634f5d70c921d2ae9f8c155e Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:15:13 +0200 Subject: [PATCH 159/180] New translations $lock.md (Portuguese, Brazilian) --- .../version-19/REST/$lock.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$lock.md b/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$lock.md index 3616bb40da3832..7d36c3f2b49c26 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$lock.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$lock.md @@ -28,33 +28,33 @@ A propriedade [`lockKindText`](../API/EntityClass.md#lock) é "Locked by session ### Descrição -The locks triggered by the REST API are put at the [session](authUsers.md#opening-sessions) level. +Os bloqueios accionados pela API REST são colocados ao nível da [sessão](authUsers.md#opening-sessions). -A locked entity is seen as *locked* (i.e. lock / unlock / update / delete actions are not possible) by: +Uma entidade bloqueada é vista como *bloqueada* (ou seja, as acções de bloquear/desbloquear/atualizar/eliminar não são possíveis) por: - outras sessões REST -- 4D processes (client/server, remote datastore, standalone) running on the REST server. +- Processos 4D (cliente/servidor, datastore remoto, autónomo) em execução no servidor REST. Uma entidade bloqueada pela API REST só pode ser desbloqueada: -- by its locker, i.e. a `/?$lock=false` in the REST session that sets `/?$lock=true` -- or if the session's [inactivity timeout]($directory.md) is reached (the session is closed). +- pelo seu locker, ou seja, um `/?$lock=false` na sessão REST que define `/?$lock=true` +- ou se o tempo limite de inatividade da sessão []($directory.md) for atingido (a sessão é encerrada). ### Resposta -A `?$lock` request returns a JSON object with `"result"=true` if the lock operation was successful and `"result"=false` if it failed. +Um pedido `?$lock` devolve um objeto JSON com `"result"=true` se a operação de bloqueio for bem sucedida e `"result"=false` se falhar. O objeto "__STATUS" devolvido tem as seguintes propriedades: -| Propriedade | | Tipo | Descrição | -| ------------ | | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| | | | ***Disponível apenas em caso de sucesso:*** | -| success | | boolean | true if the lock action is successful (or if the entity is already locked in the current session), false otherwise (not returned in this case). | -| | | | ***Disponível apenas em caso de erro:*** | -| status | | number | Código de erro, ver abaixo | -| statusText | | text | Descrição do erro, ver abaixo | -| lockKind | | number | Código de bloqueio | -| lockKindText | | text | "Locked by session" if locked by a REST session, "Locked by record" if locked by a 4D process | +| Propriedade | | Tipo | Descrição | +| ------------ | | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| | | | ***Disponível apenas em caso de sucesso:*** | +| success | | boolean | true se a ação de bloqueio for bem sucedida (ou se a entidade já estiver bloqueada na sessão atual), false caso contrário (não devolvido neste caso). | +| | | | ***Disponível apenas em caso de erro:*** | +| status | | number | Código de erro, ver abaixo | +| statusText | | text | Descrição do erro, ver abaixo | +| lockKind | | number | Código de bloqueio | +| lockKindText | | text | "Bloqueado por sessão" se bloqueado por uma sessão REST, "Bloqueado por registo" se bloqueado por um processo 4D | Os seguintes valores podem ser devolvidos nas propriedades *status* e *statusText* do objeto *__STATUS* em caso de erro: From 066de12696b4e7277e13a2211b57d11e46c1ef7e Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:15:23 +0200 Subject: [PATCH 160/180] New translations $version.md (Portuguese, Brazilian) --- .../docusaurus-plugin-content-docs/version-19/REST/$version.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$version.md b/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$version.md index 27ed963ff2e6ae..385c65fa7d7d9a 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$version.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/$version.md @@ -13,6 +13,6 @@ O valor do parâmetro de versão da imagem é modificado pelo servidor. ## Exemplo -The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: +O exemplo seguinte define o formato de imagem como JPEG, independentemente do tipo real da fotografia, e passa o número de versão real enviado pelo servidor: `GET /rest/Employee(1)/photo?$imageformat=jpeg&$version=3&$expand=photo` \ No newline at end of file From 88478c14e8a476f6b059a05e03881c9467e8d738 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:15:29 +0200 Subject: [PATCH 161/180] New translations genInfo.md (Portuguese, Brazilian) --- .../docusaurus-plugin-content-docs/version-19/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/genInfo.md b/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/genInfo.md index b41a6100f6387e..8c149773857e3c 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/genInfo.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-19/REST/genInfo.md @@ -33,4 +33,4 @@ Essas propriedades são objetos que contém informação sobre como o servidor r - **queryPlan**: objeto contendo a descrição detalhada da pesquisa logo antes de ser executada (ou seja, a pesquisa planejada). - **queryPath**: objeto contendo a descrição detalhada da pesquisa como foi realizada. -A informação registrada inclui o tipo de pesquisa (indexada e sequencial) e cada subpesquisa necessária junto com operações de conjunção. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Geralmente a descrição do plano de pesquisa e sua rota são idênticas mas podem ser diferentes porque 4D pode implementar otimizações dinâmicas quando uma pesquisa for executada para melhorar a performance. Por exemplo, o motor 4D pode converter dinamicamente uma consulta indexada em uma consulta sequencial se estimar que seja mais rápido. Esse caso particular pode acontecer quando o número de entidades sendo pesquisada é baixo. \ No newline at end of file +A informação registrada inclui o tipo de pesquisa (indexada e sequencial) e cada subpesquisa necessária junto com operações de conjunção. Query paths also contain the number of entities found and the time required to execute each search criterion. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From 310e5d13c0bc702165bbaffeb69e761c43c2a298 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:24:01 +0200 Subject: [PATCH 162/180] New translations DataClassClass.md (Portuguese, Brazilian) --- .../version-20/API/DataClassClass.md | 269 +++++++++++------- 1 file changed, 163 insertions(+), 106 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md index 7eab60b7869baf..8009e567e07292 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/API/DataClassClass.md @@ -845,7 +845,7 @@ A função `.query()` pesquisa por Se não houver entidades correspondentes encontradas, uma `EntitySelection` vazia é retornada. -**parâmetro queryString** +#### queryString parameter O parâmetro *queryString* usa a sintaxe abaixo: @@ -855,9 +855,9 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -onde: +where: -* **attributePath**: caminho de atributo no qual se pretende executar a consulta. Os atributos se expressam como pares propriedade/ valor, onde propriedade é o nome do marcador de posição inserido para uma rota de atributo em *queryString* ou *formula* (":placeholder") e valor pode ser uma string ou uma coleção de strings. Cada valor e uma rota que pode designar um escalar ou um atributo relacionado da dataclass ou uma propriedade num campo de objeto da dataclass +* **attributePath**: caminho de atributo no qual se pretende executar a consulta. Os atributos se expressam como pares propriedade/ valor, onde propriedade é o nome do marcador de posição inserido para uma rota de atributo em *queryString* ou *formula* (":placeholder") e valor pode ser uma string ou uma coleção de strings. In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > *Não pode usar diretamente atributos cujo nome contenha caracteres especiais como ".", "\[ ]", or "=", ">", "#"..., porque serão avaliados incorretamente na string da query. Se precisar de uma query com esses atributos, deve considerar o uso de placeholders que permitem uma gama estendida de caracteres em rotas de atributo (ver* **Using placeholders** *below).* * **formula**: uma fórmula válida passada como `Text` ou `Object`. A fórmula será avaliada para cada entidade processada e deve retornar um valor booleano. Dentro da fórmula, a entidade está disponível através do objeto `This`. @@ -873,19 +873,19 @@ onde: * **comparator**: symbol que compara *attributePath* e *valor*. Os simbolos abaixo são compatíveis: - | Comparação | Símbolos | Comentário | - | ---------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------ | - | Igual a | =, == | Retorna os dados coincidentes, admite o coringa (@), não diferencia entre maiúsculas e minúsculas nem diacríticas. | - | | ===, IS | Retorna os dados coincidentes, considera @ como caractere padrão, não diferencia entre maiúsculas e minúsculas nem diacríticas | - | Diferente de | #, != | Suporta o coringa (@) | - | | !==, IS NOT | Considera @ como um caractere normal | - | Menor que | < | | - | Maior que | > | | - | Menor que ou igual a | <= | | - | Maior ou igual a | >= | | - | Incluído em | IN | Retorna dados iguais a ao menos um dos valores de uma coleção ou de um conjunto de valores, admite o coringa (@) | - | Não se aplica à condição de uma sentença | NOT | Parentesis são obrigatórios quando usar NOT antes de uma instrução que contenha vários operadores | - | Contém palavra chave | % | As palavras chaves podem ser usadas em atributos de string ou imagem | + | Comparação | Símbolos | Comentário | + | ---------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Igual a | =, == | Retorna os dados coincidentes, admite o coringa (@), não diferencia entre maiúsculas e minúsculas nem diacríticas. | + | | ===, IS | Retorna os dados coincidentes, considera @ como caractere padrão, não diferencia entre maiúsculas e minúsculas nem diacríticas | + | Diferente de | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considera @ como um caractere normal | + | Não se aplica à condição de uma sentença | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Menor que | < | | + | Maior que | > | | + | Menor que ou igual a | <= | | + | Maior ou igual a | >= | | + | Incluído em | IN | Retorna dados iguais a ao menos um dos valores de uma coleção ou de um conjunto de valores, admite o coringa (@) | + | Contém palavra chave | % | As palavras chaves podem ser usadas em atributos de string ou imagem | * **value**: o valor a comparar ao valor atual da propriedade de cada entidade na seleção de entidade ou elemento na coleção. Pode ser um **marcador** (ver **Uso de marcadores** mais adiante) ou qualquer expressão que coincida com a propriedad de tipo de dados. Quando usar um valor constante, as regras abaixo devem ser respeitadas: * A constante de tipo **texto** pode ser passada com ou sem aspas simples (ver **Uso de aspas** mais abaixo). Para pesquisar uma stirng dentro de uma string (uma pesquisa "contém") use o símbolo coringa (@) em valor para isolar a string a ser pesquisada como mostrado neste exemplo: "@Smith@". As palavras chaves abaixo são proibidas para constantes de texto: true, false. @@ -903,40 +903,40 @@ onde: * **order by attributePath**: pode incluir uma declaração order by *attributePath* na pesquisa para que os dados resultantes sejam ordenados de acordo com esta declaração. Pode utilizar várias instruções de ordenação, separadas por vírgulas (por exemplo, ordenação por *attributePath1* desc, *attributePath2* asc). Como padrão, a ordem é ascendente. Passe 'desc'' para definir uma ordem descendente e 'asc' para definir uma ordem ascendente. > > *If you use this statement, the returned entity selection is ordered (for more information, please refer to [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Usar aspas** +#### Using quotes -Quando usar aspas com pesquisas, deve usar aspas simples ' ' dentro das pesquisas e aspas duplas " " para cercar a consulta inteira, senão um erro é retornado. Por exemplo: +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Por exemplo: ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Aspas siples (') não são permitidas nos valores pesquisados, já que quebrariam a string de pesquisa. Por exemplo, "comp.name = 'John's pizza' " gerará um erro. Se precisar pesquisar valores com aspas simples, pode considerar o uso de placeholders (ver abaixo). -**Usando parêntesis** +#### Using parenthesis -É possível utilizar parênteses na consulta para dar prioridade ao cálculo. Por exemplo, pode organizar uma pesquisa da seguinte maneira: +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Uso de placeholders** +#### Using placeholders -4D lhe permite utilizar placeholders, marcadores de posição, para os argumentos *attributePath*, *formula* e *value* dentro do parâmetro *queryString*. Um placeholder é um parâmetro que é inserido em strings de pesquisa e que pode ser substituído por outro valor quando a string for realizada. O valor dos placeholders é avaliado uma vez ao inicio da pesquisa - não é avaliado para cada elemento. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Dois tipos de marcadores podem ser usados: **placeholders indexados ** e **placeholders nomeados**: +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | | Marcadores de posição indexados | Placeholders nomeados | | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Definição | Os parâmetros são inseridos como :paramIndex (por exemplo :1, :2...) em queryString e seus valores correspondentes são fornecidos pela sequência de parâmetros value. Pode usara até 128 parâmetros de valor | Os parâmetros são inseridos como: paramName (por exemplo :myparam) e seus valores se proporcionam nos atributos ou objetos de parâmetros no parámetro querySettings | | Exemplo | `$r:=class.query(":1=:2";"city";"Chicago")` | $o.attributes:=New object("att";"city")
$o.parameters:=New object("name";"Chicago")
$r:=class.query(":att=:name";$o) | -Pode misturar os tipos de argumentos em *queryString*. Um *queryString* pode conter, para os parâmetros *attributePath*, *formula* e *value* : +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * valores diretos (sem marcadores), * marcadores indexados ou com nome. -**É recomendado usar marcadores de posição ou placeholders nas consultas** pelas razões abaixo: +Using placeholders in queries **is recommended** for the following reasons: 1. Evita a inserção de código malicioso: se user diretamente variáveis preenchidas com uma string de pesquisa, um usuário poderia modificar as condições de pesquisa entrando argumentos adicionais. Por exemplo, imagine uma string de pesquisa como: @@ -945,50 +945,105 @@ Pode misturar os tipos de argumentos em *queryString*. Um *queryString* pode con $result:=$col.query($vquery) ``` - Esta pesquisa parece segura já que se filtram os dados não públicos. Entretanto, se o usuário introduzr na área *myname* algo como *"smith OR status='private'*, a string de pesquisa se modificaría na etapa da interpretação e poderia devolver dados privados. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Quando usar marcadores de posição, não é possível anular as condições de segurança: + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - Neste caso, se o usuário introduz *smith OR status='private'* na área *myname*, não se interpretará na string de pesquisa, só será passada como um valor. Procurando por "smith OR status = 'private' vai falhar + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Evita ter que se preocupar por questões de formato ou caracteres, especialmente quando se manejam os parâmetros *attributePath* o *value* que podem conter não alfanuméricos como ".", "['... 3. Permite o uso de variáveis ou expressões nos argumentos de pesquisa. Exemplos: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Pesquisa de valores null** +#### Looking for null values -Quando pesquisar por valores null não pode usar a sintaxe de placeholder porque o motor de pesquisa vai consider null como um valor de comparação inesperado. Por exemplo se executar esta pesquisa: +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds. Person.query("spouse = :1";Null) // will NOT work ``` -Não obterá o resultado esperado porque o valor nulo será avaliado por 4D como um erro resultante da avaliação do parâmetro (por exemplo, um atributo vindo de outra pesquisa). Para este tipo de pesquisa, deve usar a sintaxe de pesquisa direta: +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds. Person.query("spouse = null") //correct syntax ``` -**Linkar os argumentos de pesquisa com os atributos de coleção** +#### Not equal to in collections + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + + +#### Linking collection attribute query arguments :::info -Esta funcionalidade só está disponível em consultas de dataclasses e [selecção de entidades](EntitySelectionClass.md#query). Não pode ser utilizado em pesquisas em [colecções](CollectionClass.md#query). +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -Para fazer isso, é necessário vincular os argumentos de pesquisa para elementos de coleção, para que apenas elementos únicos contendo argumentos linkados são encontrados. Ao pesquisar dentro de atributos de objectos dataclass contendo colecções utilizando múltiplos argumentos de consulta unidos pelo operador AND, poderá querer certificar-se de que apenas entidades contendo elementos que correspondem a todos os argumentos são devolvidas, e não entidades onde os argumentos podem ser encontrados em diferentes elementos. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Por exemplo, com as duas entidades abaixo: +For example, with the following two entities: ``` Entity 1: @@ -1009,35 +1064,35 @@ ds. People.places: } ] } ``` -Se quiser encontrar pessoas com um tipo de local "home" na cidade "paris". Se escrever +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds. People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... a pesquisa devolverá "martin" **e** "smith" porque "smith" tem um elemento "locations" cujo "tipo" é "home" e um elemento "locations" cuja "cidade" é "paris", mesmo que sejam elementos diferentes. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Se quiser obter apenas entidades onde os argumentos correspondentes estão no mesmo elemento coleção, precisa **linkar os argumentos**. Para linkar argumentos de pesquisa: +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Adicionar uma letra entre os \[] na primeira rota a linkar e repita a mesma letra em todos os argumentos linkados. Por exemplo: `locations[a].city and locations[a].kind`. Pode usar qualquer letra do alfabeto latino (não diferencia maiúsculas e minúsculas). * Para adicionar critérios linkados na mesma pesquisa, use outra letra. Pode criar até 26 combinações de critérios em uma única pesquisa. -Com as entidades acima, se escreve: +With the above entities, if you write: ```4d ds. People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... pesquisa só devolverá "martin" porque tem um elemento "locations" cujo "kind" é "home" e cujo "city" for "paris". A pesquisa não devolverá 'smith' porque os valores 'home' e 'paris' não estão no mesmo elemento de coleção. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Consultas em relações Muitos para Muitos** +#### Queries in many-to-many relations -A ORDA oferece uma sintaxe especial para facilitar as consultas em muitas relações. Neste contexto, poderá ter de procurar valores diferentes com um operador `E` MAS no mesmo atributo. Por exemplo, veja a seguinte estrutura: +ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: ![alt-text](../assets/en/API/manytomany.png) -Imagine que quer procurar em todos os filmes em que *tanto* o actor A como o actor B têm um papel. Se escrever uma simples consulta utilizando um operador `E` , não funcionará: +Imagine that you want to search all movies in which *both* actor A and actor B have a role. If you write a simple query using an `AND` operator, it will not work: ```4d // invalid code @@ -1045,17 +1100,17 @@ $es:=ds. Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";" // $es is empty ``` -Basicamente, a questão está relacionada com a lógica interna da consulta: não se pode procurar um atributo cujo valor seria tanto "A" como "B". +Basically, the issue is related to the internal logic of the query: you cannot search for an attribute whose value would be both "A" and "B". -Para tornar possível a realização de tais consultas, a ORDA permite uma sintaxe especial: basta adicionar um índice de classe ** entre **{}** em todos os atributos de relação adicionais utilizados na cadeia de caracteres: +To make it possible to perform such queries, ORDA allows a special syntax: you just need to add a *class index* between **{}** in all additional relation attributes used in the string: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** diz à ORDA para criar outra referência para o atributo da relação. Realizará então todas as operações de bitmap necessárias internamente. Também pode usar um **placeholder** (ver abaixo). A ORDA só precisa de uma referência única na consulta para cada índice de classe. +**{x}** tells ORDA to create another reference for the relation attribute. It will then perform all the necessary bitmap operations internally. Note that **x** can be any number **except 0**: {1}, or {2}, or {1540}... ORDA only needs a unique reference in the query for each class index. -No nosso exemplo, seria: +In our example, it would be: ```4d // valid code @@ -1063,38 +1118,40 @@ $es:=ds. Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2 // $es contains movies (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**parâmetro de fórmula** -Como alternativa à inserção de fórmulas dentro do parâmetro *queryString* (ver acima), pode passar diretamente um objeto fórmula como critério de pesquisa booleano. A utilizaçã de um objeto fórmula para as pesquisas é **recomendada** já que se beneficia da tokenização, e o código é mais fácil de pesquisar/ler. -A fórmula deve ter sido criada usando [`Formula`](FunctionClass.md#formula) ou o comando[`Formula from string`](FunctionClass.md#formula-from-string) command. Nesse modo: +#### formula parameter + +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. + +A fórmula deve ter sido criada usando [`Formula`](FunctionClass.md#formula) ou o comando[`Formula from string`](FunctionClass.md#formula-from-string) command. In this case: * *fórmula* se avalia para cada entidade e deve devolver true ou false. Durante a execução da pesquisa, se o resultado da fórmula não for booleano, é considerado como False. * dentro da *fórmula*, a entidade está disponível através do objeto `This`. * Se o objeto `Formula` for **null**, o errro 1626 ("Expecting a text or formula") é gerado, então pode interceptar a chamada com o método instalado `ON ERR CALL`. > Por razões de segurança, as chamadas a fórmulas dentro dos métodos `query()` podem ser desativadas. Veja a descrição do parâmetro *querySettings*. -**Passar parâmetros a fórmulas** +#### Passing parameters to formulas -Todo parâmetro *formula* chamado pela função `query()` pode receber parâmetros: +Any *formula* called by the `query()` class function can receive parameters: * Parâmeters devem ser passados através da propriedade **args** (objeto) do parâmetro *querySettings*. * A fórmula recebe este objeto **args** como um parâmetro **$1**. -Este pequeno código mostra os principios de como são passados os parâmetros aos métodos: +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //args object to pass parameters $es:=ds. Students.query("eval(checkName($1.exclude))";$settings) //args is received in $1 ``` -No exemplo 3 são oferecidos mais exemplos. +Additional examples are provided in example 3. -**4D Server**: em cliente/servidor, as fórmulas são executadas no servidor. Neste contexto, só se envia às fórmulas o objeto `querySettings.args`. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**parâmetro querySettings** +#### querySettings parameter -No parâmetro *querySettings* é possível passar um objeto que conteha opções adicionais. As propriedades abaixo são compatíveis: +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propriedade | Tipo | Descrição | | ------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1106,11 +1163,11 @@ No parâmetro *querySettings* é possível passar um objeto que conteha opçõe | queryPlan | Parâmetros | Na entity selection resultante, devolve ou não a descrição detalhada da pesquisa logo antes de ser executada, ou seja, a pesquisa planificada. A propriedade devolvida é um objeto que inclui cada pesquisa e subpesquisa prevista (no caso de uma pesquisa complexa). Esta opção é útil durante a fase de desenvolvimento de uma aplicação. Geralmente é usada em conjunto com queryPath. Como padrão é omitido: false. **Nota**: esta propriedade só são compatíveis com as funções`entitySelection.query( )` e `dataClass.query( )`. | | queryPath | Parâmetros | Na entity selection resultante, devolve ou não a descrição detalhada da pesquisa tal qual for realizada. A propriedade retornada é um objeto que contém a rota atual usada para a pesquisa (geralmente idêntica àquela do queryPlan, mas deve diferenciar se o motor consegue otimizar a pesquisa), assim como o tempo de processamento e o número de registros encontrado. Esta opção é útil durante a fase de desenvolvimento de uma aplicação. Como padrão é omitido: false. **Nota**: esta propriedade só são compatíveis com as funções`entitySelection.query( )` e `dataClass.query( )`. | -**Sobre queryPlan e queryPath** +#### About queryPlan and queryPath -A informação registrada em `queryPlan`/`queryPath` inclui o tipo de pesquisa (indexada e sequencial) e cada subconsulta necessária junto com os operadores de conjunção. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Geralmente a descrição do plano de pesquisa e sua rota são idênticas mas podem ser diferentes porque 4D pode implementar otimizações dinâmicas quando uma pesquisa for executada para melhorar a performance. Por exemplo, o motor 4D pode converter dinamicamente uma consulta indexada em uma consulta sequencial se estimar que seja mais rápido. Esse caso particular pode acontecer quando o número de entidades sendo pesquisada é baixo. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Por exemplo se executar esta pesquisa: +For example, if you execute the following query: ```4d $sel:=ds. Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ @@ -1139,46 +1196,46 @@ queryPath: #### Exemplo 1 -Esta seção oferece vários exemplos de pesquisas. +This section provides various examples of queries. -Consultas em uma string: +Query on a string: ```4d $entitySelection:=ds. Customer.query("firstName = 'S@'") ``` -Consulta com uma instrução NOT: +Query with a NOT statement: ```4d $entitySelection:=ds. Employee.query("not(firstName=Kim)") ``` -Pesquisas com datas: +Queries with dates: ```4d $entitySelection:=ds. Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds. Employee.query("birthDate <= :1";Current date-10950) ``` -Pesquisa com marcadores de posição indexados para os valores: +Query with indexed placeholders for values: ```4d $entitySelection:=ds. Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Pesquisa com marcadores de posição indexados para valores em u ma dataclass relacionada: +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds. Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Pesquisa com marcador de posição indexado que inclui uma instrução de ordem descendente: +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds. Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Pesquisa com marcadores de posição com nome para os valores: +Query with named placeholders for values: ```4d var $querySettings : Object @@ -1188,7 +1245,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds. Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Pesquisa que usa marcadores de posição nomeados e indexados para valores: +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -1197,7 +1254,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds. Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Pesquisa com objetos queryPlan e queryPath: +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds. Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -1208,19 +1265,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Pesquisa com uma rota de atributo de tipo Collection: +Query with an attribute path of Collection type: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Pesquisa com uma rota de atributos de tipo Collection e atributos vinculados: +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Pesquisa com uma rota de atributos de tipo Collection e múltiplos atributos vinculados: +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1228,25 +1285,25 @@ $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Pesquisa com uma rota de atributo de tipo Objeto +Query with an attribute path of Object type: ```4d $entitySelection:=ds. Employee.query("extra.eyeColor = :1";"blue") ``` -Pesquisa com uma instrução IN: +Query with an IN statement: ```4d $entitySelection:=ds. Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Pesquisa com instrução NOT (IN): +Query with a NOT (IN) statement: ```4d $entitySelection:=ds. Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Pesquisa com marcadores de posição indexados para os atributos: +Query with indexed placeholders for attributes: ```4d var $es : cs. EmployeeSelection @@ -1254,7 +1311,7 @@ $es:=ds. Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name" //salesperson is a related entity ``` -Pesquisa com marcadores de posição indexados para os atributos e marcadores de posição com nome para os valores: +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs. EmployeeSelection @@ -1265,7 +1322,7 @@ $es:=ds. Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId"; //salesperson is a related entity ``` -Pesquisa com marcadores de posição indexados para os atributos e os valores: +Query with indexed placeholders for attributes and values: ```4d var $es : cs. EmployeeSelection @@ -1275,11 +1332,11 @@ $es:=ds. Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smit #### Exemplo 2 -Esta seção ilustra pesquisas com marcadores de posição com nomes para os atributos. +This section illustrates queries with named placeholders for attributes. -Dada uma dataclass Employee com 2 entidades: +Given an Employee dataclass with 2 entities: -Entidade 1: +Entity 1: ```4d name: "Marie" @@ -1291,7 +1348,7 @@ softwares:{ } ``` -Entidade 2: +Entity 2: ```4d name: "Sophie" @@ -1303,7 +1360,7 @@ softwares:{ } ``` -Pesquisa com marcadores de posição com nome para os atributos: +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1314,7 +1371,7 @@ Pesquisa com marcadores de posição com nome para os atributos: //$es.length=1 (Employee Marie) ``` -Pesquisa com marcadores de posição com nome para os atributos e os valores: +Query with named placeholders for attributes and values: ```4d @@ -1335,16 +1392,16 @@ Pesquisa com marcadores de posição com nome para os atributos e os valores: #### Exemplo 3 -Estes exemplos ilustram as distintas formas de utilizar fórmulas com ou sem parâmetros em suas pesquisas. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -A fórmula se da como texto com `eval()` no parâmetro *queryString*: +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs. StudentsSelection $es:=ds. Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -A fórmula se dá como um objeto `Formula` através de um marcador de posição: +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs. StudentsSelection @@ -1353,7 +1410,7 @@ A fórmula se dá como um objeto `Formula` através de um marcador de posição: $es:=ds. Students.query(":1 and nationality='French'";$formula) ``` -Só se da como criterio um objeto `Formula`: +Only a `Formula` object is given as criteria: ```4d var $es : cs. StudentsSelection @@ -1362,7 +1419,7 @@ Só se da como criterio um objeto `Formula`: $es:=ds. Students.query($formula) ``` -Podem ser aplicadas várias fórmulas: +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1371,7 +1428,7 @@ Podem ser aplicadas várias fórmulas: $0:=ds. Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Uma fórmula texto em *queryString* recebe um parámetro: +A text formula in *queryString* receives a parameter: ```4d var $es : cs. StudentsSelection @@ -1387,7 +1444,7 @@ Uma fórmula texto em *queryString* recebe um parámetro: $result:=(Position($exclude;This.lastname)=0) ``` -Utilizando o mesmo método ***checkName***, um objeto `Formula` como marcador de posição recebe um parámetro: +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs. StudentsSelection @@ -1400,7 +1457,7 @@ Utilizando o mesmo método ***checkName***, um objeto `Formula` como marcador de $es:=ds. Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua consulta: +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs. StudentsSelection @@ -1415,7 +1472,7 @@ Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua #### Veja também -[`.query()`](EntitySelectionClass.md#query) para seleções de entidades +[`.query()`](EntitySelectionClass.md#query) for entity selections @@ -1433,9 +1490,9 @@ Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua -| Parâmetro | Tipo | | Descrição | -| --------- | ------ | -- | --------------------------------------------------------------------------------------------------------------- | -| settings | Object | -> | Objecto que define o tempo limite e o tamanho máximo da cache ORDA para a dataclass.| +| Parâmetro | Tipo | | Descrição | +| --------- | ------ | -- | ------------------------------------------------------------------------------------------------------------- | +| settings | Object | -> | Object that sets the timeout and maximum size of the ORDA cache for the dataclass.| | @@ -1443,30 +1500,30 @@ Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua #### Descrição -A função `.setRemoteCacheSettings()` define o tempo limite e o tamanho máximo da cache ORDA para um dataclass.. +The `.setRemoteCacheSettings()` function sets the timeout and maximum size of the ORDA cache for a dataclass.. -No parâmetro *settings*, passe um objeto contendo as propriedades abaixo: +In the *settings* parameter, pass an object with the following properties: | Propriedade | Tipo | Descrição | | ----------- | ------- | ---------------------------- | | timeout | Integer | Tempo de espera em segundos. | | maxEntries | Integer | Número máximo de entidades. | -`timeout` define o timeout da cache ORDA para o dataclass (por defeito é de 30 segundos). Uma vez decorrido o tempo limite, as entidades da classe de dados na cache são consideradas como expiradas. Isto significa que: +`timeout` sets the timeout of the ORDA cache for the dataclass (default is 30 seconds). Once the timeout has passed, the entities of the dataclass in the cache are considered as expired. This means that: * os dados ainda estão lá * na próxima vez que os dados forem necessários, serão solicitados ao servidor * 4D remove automaticamente os dados expirados quando o número máximo de entidades é atingido -A definição de um tempo limite `` define um novo tempo limite para as entidades já presentes na cache. É útil quando se trabalha com dados que não mudam com muita frequência, e portanto quando não são necessários novos pedidos ao servidor. +Setting a `timeout` property sets a new timeout for the entities already present in the cache. It is useful when working with data that does not change very frequently, and thus when new requests to the server are not necessary. -`maxEntries` define o número máximo de entidades na cache ORDA. O padrão é de 30 000. +`maxEntries` sets the max number of entities in the ORDA cache. Default is 30 000. -O número mínimo de entradas é 300, pelo que o valor de `maxEntries` deve ser igual ou superior a 300. Caso contrário, é ignorado e o número máximo de entradas é fixado em 300. +The minimum number of entries is 300, so the value of `maxEntries` must be equal to or higher than 300. Otherwise it is ignored and the maximum number of entries is set to 300. -Se nenhuma propriedade válida for passada como `timeout` e `maxEntries`, a cache permanece inalterada, com os seus valores por defeito ou previamente definidos. +If no valid properties are passed as `timeout` and `maxEntries`, the cache remains unchanged, with its default or previously set values. -Quando uma entidade é guardada, é actualizada na cache e expira quando o tempo limite é atingido. +When an entity is saved, it is updated in the cache and expires once the timeout is reached. #### Exemplo From 3279e05e34923bb251d9ca619cacc5688b8be455 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:24:08 +0200 Subject: [PATCH 163/180] New translations EntityClass.md (Portuguese, Brazilian) --- .../version-20/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/API/EntityClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/API/EntityClass.md index 59b944068875df..298640d5488bcc 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/API/EntityClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/API/EntityClass.md @@ -1698,7 +1698,7 @@ Se nenhum atributo de entidade for tocado, o método retorna uma coleção vazia //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -Nesse modo: +In this case: * firstName and lastName tem um tipo `storage` * employer tem um tipo `relatedEntity` From 1ba8c34b0d6716c55732f6819cb8bc4d60025e38 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:26:47 +0200 Subject: [PATCH 164/180] New translations properties_Text.md (Portuguese, Brazilian) --- .../version-20/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md index 2003c5a35307f9..1bf75919fab99b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/FormObjects/properties_Text.md @@ -281,7 +281,7 @@ This property can also be handled by the [OBJECT Get vertical alignment](https:/ `List box do tipo Collection ou entity selection` -Especifica uma expressão ou uma variável que será avaliada para cada linha exibida. Permite definir um conjunto completo de atributos de texto das linhas. É necessário transmitir uma **variável objeto** ou uma **expressão que devolva um objeto**. As propriedades abaixo são compatíveis: +Especifica uma expressão ou uma variável que será avaliada para cada linha exibida. Permite definir um conjunto completo de atributos de texto das linhas. É necessário transmitir uma **variável objeto** ou uma **expressão que devolva um objeto**. The following properties are supported: | Nome da propriedade | Tipo | Descrição | | ------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From fed7979fd25d9962aa88aadfd48173cb2c0ac964 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:27:32 +0200 Subject: [PATCH 165/180] New translations $compute.md (Portuguese, Brazilian) --- .../version-20/REST/$compute.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$compute.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$compute.md index 7d681cf5d86853..d8a49053699667 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$compute.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$compute.md @@ -33,7 +33,7 @@ Pode utilizar qualquer uma das seguintes palavras-chave: ## Exemplo -If you want to get all the computations for an attribute of type Number, you can write: +Se quiser obter todos os cálculos para um atributo do tipo Número, pode escrever: `GET /rest/Employee/salary/?$compute=$all` @@ -67,7 +67,7 @@ Se quiser obter todos os cálculos para um atributo do tipo String, pode escreve } ```` -If you want to just get one calculation on an attribute, you can write the following: +Se pretender obter apenas um cálculo num atributo, pode escrever o seguinte: `GET /rest/Employee/salary/?$compute=sum` @@ -76,7 +76,7 @@ If you want to just get one calculation on an attribute, you can write the follo `235000` -If you want to perform a calculation on an Object attribute, you can write the following: +Se pretender efetuar um cálculo num atributo de um objeto, pode escrever o seguinte: `GET /rest/Employee/objectAttribute.property1/?$compute=sum` From 8c09e0e02b1d412a92625f55e3b162d21c43d168 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:27:36 +0200 Subject: [PATCH 166/180] New translations $imageformat.md (Portuguese, Brazilian) --- .../version-20/REST/$imageformat.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$imageformat.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$imageformat.md index 9b72a8b5cecdbe..820d6c101ff35b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$imageformat.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$imageformat.md @@ -17,13 +17,13 @@ Definir o formato a utilizar para mostrar imagens. Pode utilizar um dos seguinte | ".jpeg" or "image/jpeg" | Formato JPEG | | ".tiff" ou "image/tiff" | Formato TIFF | -Once you have defined the format, you must pass the image attribute to [`$expand`]($expand.md) to load the photo completely. +Uma vez definido o formato, é necessário passar o atributo de imagem a [`$expand`]($expand.md) para carregar completamente a fotografia. -If there is no image to be loaded or the format doesn't allow the image to be loaded, the response will be an empty object `{}`. +Se não houver nenhuma imagem a carregar ou se o formato não permitir que a imagem seja carregada, a resposta será um objeto vazio `{}`. ## Exemplo -The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: +O exemplo seguinte define o formato de imagem como JPEG, independentemente do tipo real da fotografia, e passa o número de versão real enviado pelo servidor: `GET /rest/Employee(1)/photo?$imageformat=.jpeg&$version=3&$expand=photo` From 5c63a49e11e77a823530746fa1894118156a7dde Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:27:38 +0200 Subject: [PATCH 167/180] New translations $lock.md (Portuguese, Brazilian) --- .../version-20/REST/$lock.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$lock.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$lock.md index 620583aef1c2f0..9e91cbb9f15ccb 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$lock.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$lock.md @@ -28,33 +28,33 @@ A propriedade [`lockKindText`](../API/EntityClass.md#lock) é "Locked by session ### Descrição -The locks triggered by the REST API are put at the [session](authUsers.md#opening-sessions) level. +Os bloqueios accionados pela API REST são colocados ao nível da [sessão](authUsers.md#opening-sessions). -A locked entity is seen as *locked* (i.e. lock / unlock / update / delete actions are not possible) by: +Uma entidade bloqueada é vista como *bloqueada* (ou seja, as acções de bloquear/desbloquear/atualizar/eliminar não são possíveis) por: - outras sessões REST -- 4D processes (client/server, remote datastore, standalone) running on the REST server. +- Processos 4D (cliente/servidor, datastore remoto, autónomo) em execução no servidor REST. Uma entidade bloqueada pela API REST só pode ser desbloqueada: -- by its locker, i.e. a `/?$lock=false` in the REST session that sets `/?$lock=true` -- or if the session's [inactivity timeout]($directory.md) is reached (the session is closed). +- pelo seu locker, ou seja, um `/?$lock=false` na sessão REST que define `/?$lock=true` +- ou se o tempo limite de inatividade da sessão []($directory.md) for atingido (a sessão é encerrada). ### Resposta -A `?$lock` request returns a JSON object with `"result"=true` if the lock operation was successful and `"result"=false` if it failed. +Um pedido `?$lock` devolve um objeto JSON com `"result"=true` se a operação de bloqueio for bem sucedida e `"result"=false` se falhar. O objeto "__STATUS" devolvido tem as seguintes propriedades: | Propriedade | | Tipo | Descrição | | ------------ | -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | | | | ***Disponível apenas em caso de sucesso:*** | -| success | | boolean | true if the lock action is successful (or if the entity is already locked in the current session), false otherwise (not returned in this case). | +| success | | boolean | true se a ação de bloqueio for bem sucedida (ou se a entidade já estiver bloqueada na sessão atual), false caso contrário (não devolvido neste caso). | | | | | ***Disponível apenas em caso de erro:*** | | status | | number | Código de erro, ver abaixo | | statusText | | text | Descrição do erro, ver abaixo | | lockKind | | number | Código de bloqueio | -| lockKindText | | text | "Locked by session" if locked by a REST session, "Locked by record" if locked by a 4D process | +| lockKindText | | text | "Bloqueado por sessão" se bloqueado por uma sessão REST, "Bloqueado por registo" se bloqueado por um processo 4D | | lockInfo | | object | Informações sobre a origem do bloqueio. Retorna propriedades dependendo da origem da trava (processo 4D ou sessão REST) | | | | | ***Disponível só para um processo trava 4D:*** | | | task_id | number | Process ID | From 53c01b0ec0fa7a362ea228caf8df16a722ab956d Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:27:47 +0200 Subject: [PATCH 168/180] New translations $version.md (Portuguese, Brazilian) --- .../docusaurus-plugin-content-docs/version-20/REST/$version.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$version.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$version.md index 27ed963ff2e6ae..385c65fa7d7d9a 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$version.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/$version.md @@ -13,6 +13,6 @@ O valor do parâmetro de versão da imagem é modificado pelo servidor. ## Exemplo -The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: +O exemplo seguinte define o formato de imagem como JPEG, independentemente do tipo real da fotografia, e passa o número de versão real enviado pelo servidor: `GET /rest/Employee(1)/photo?$imageformat=jpeg&$version=3&$expand=photo` \ No newline at end of file From 159e1201b303e41d469d84c847371a9d56d2060b Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:27:53 +0200 Subject: [PATCH 169/180] New translations genInfo.md (Portuguese, Brazilian) --- .../docusaurus-plugin-content-docs/version-20/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/genInfo.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/genInfo.md index b41a6100f6387e..8c149773857e3c 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/genInfo.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/REST/genInfo.md @@ -33,4 +33,4 @@ Essas propriedades são objetos que contém informação sobre como o servidor r - **queryPlan**: objeto contendo a descrição detalhada da pesquisa logo antes de ser executada (ou seja, a pesquisa planejada). - **queryPath**: objeto contendo a descrição detalhada da pesquisa como foi realizada. -A informação registrada inclui o tipo de pesquisa (indexada e sequencial) e cada subpesquisa necessária junto com operações de conjunção. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Geralmente a descrição do plano de pesquisa e sua rota são idênticas mas podem ser diferentes porque 4D pode implementar otimizações dinâmicas quando uma pesquisa for executada para melhorar a performance. Por exemplo, o motor 4D pode converter dinamicamente uma consulta indexada em uma consulta sequencial se estimar que seja mais rápido. Esse caso particular pode acontecer quando o número de entidades sendo pesquisada é baixo. \ No newline at end of file +A informação registrada inclui o tipo de pesquisa (indexada e sequencial) e cada subpesquisa necessária junto com operações de conjunção. Query paths also contain the number of entities found and the time required to execute each search criterion. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From 1809d36d03083efe5b1c4c62cff59d6e0cb39673 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:28:15 +0200 Subject: [PATCH 170/180] New translations method-list.md (Portuguese, Brazilian) --- .../version-20/ViewPro/method-list.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md b/i18n/pt/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md index c21daf813b40cc..ef9f8648171436 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20/ViewPro/method-list.md @@ -37,7 +37,7 @@ Passar a fórmula 4D View Pro que deseja nomear em *vpFormula*. Para obter infor Passar o novo nome da fórmula em *name*. Se o nome já estiver a ser utilizado no mesmo âmbito, a nova fórmula nomeada substitui a existente. Note que pode utilizar o mesmo nome para diferentes âmbitos (ver abaixo). -Pode passar um objeto com propriedades adicionais para a fórmula nomeada em *options*. As propriedades abaixo são compatíveis: +Pode passar um objeto com propriedades adicionais para a fórmula nomeada em *options*. The following properties are supported: | Propriedade | Tipo | Descrição | | ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -77,7 +77,7 @@ O comando `VP ADD RANGE NAME` cr Em *rangeObj*, passe o intervalo que pretende nomear e passe o novo nome para o intervalo em *name*. Se o nome já estiver a ser utilizado no mesmo âmbito, o novo intervalo nomeado substitui o existente. Note que pode utilizar o mesmo nome para diferentes âmbitos (ver abaixo). -Pode passar um objeto com propriedades adicionais para o intervalo nomeado em *options*. As propriedades abaixo são compatíveis: +Pode passar um objeto com propriedades adicionais para o intervalo nomeado em *options*. The following properties are supported: | Propriedade | Tipo | Descrição | | ----------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1151,7 +1151,7 @@ In the *rangeObj* parameter, pass an object containing a range to search. The *searchValue* parameter lets you pass the text to search for within the *rangeObj*. -You can pass the optional *searchCondition* parameter to specify how the search is performed. As propriedades abaixo são compatíveis: +You can pass the optional *searchCondition* parameter to specify how the search is performed. The following properties are supported: | Propriedade | Tipo | Descrição | | ----------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -3461,7 +3461,7 @@ VP NEW DOCUMENT("myVPArea") O comando `VP Object to font` returns a font shorthand string from *fontObj*. -In *fontObj*, pass an object containing the font properties. As propriedades abaixo são compatíveis: +In *fontObj*, pass an object containing the font properties. The following properties are supported: | Propriedade | Tipo | Descrição | Valores possíveis | Obrigatório | | ----------- | ---- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | From 8e8503189148fda1e51ecf85725421d98f3251e5 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:38:49 +0200 Subject: [PATCH 171/180] New translations DataClassAttributeClass.md (Portuguese, Brazilian) --- .../version-20-R2/API/DataClassAttributeClass.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/DataClassAttributeClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/DataClassAttributeClass.md index 1a09ed8fb8fe3e..7f63b46f7cb7cc 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/DataClassAttributeClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/DataClassAttributeClass.md @@ -126,13 +126,13 @@ A propriedade `.fieldType` From f318b4fe8322bcd3dee0364aca0fe548a4e7bc5c Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:38:51 +0200 Subject: [PATCH 172/180] New translations DataClassClass.md (Portuguese, Brazilian) --- .../version-20-R2/API/DataClassClass.md | 269 +++++++++++------- 1 file changed, 163 insertions(+), 106 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md index 7eab60b7869baf..8009e567e07292 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/DataClassClass.md @@ -845,7 +845,7 @@ A função `.query()` pesquisa por Se não houver entidades correspondentes encontradas, uma `EntitySelection` vazia é retornada. -**parâmetro queryString** +#### queryString parameter O parâmetro *queryString* usa a sintaxe abaixo: @@ -855,9 +855,9 @@ attributePath|formula comparator value {order by attributePath {desc | asc}} ``` -onde: +where: -* **attributePath**: caminho de atributo no qual se pretende executar a consulta. Os atributos se expressam como pares propriedade/ valor, onde propriedade é o nome do marcador de posição inserido para uma rota de atributo em *queryString* ou *formula* (":placeholder") e valor pode ser uma string ou uma coleção de strings. Cada valor e uma rota que pode designar um escalar ou um atributo relacionado da dataclass ou uma propriedade num campo de objeto da dataclass +* **attributePath**: caminho de atributo no qual se pretende executar a consulta. Os atributos se expressam como pares propriedade/ valor, onde propriedade é o nome do marcador de posição inserido para uma rota de atributo em *queryString* ou *formula* (":placeholder") e valor pode ser uma string ou uma coleção de strings. In case of an attribute path whose type is `Collection`, `[]` notation is used to handle all the occurences (for example `children[].age`). > *Não pode usar diretamente atributos cujo nome contenha caracteres especiais como ".", "\[ ]", or "=", ">", "#"..., porque serão avaliados incorretamente na string da query. Se precisar de uma query com esses atributos, deve considerar o uso de placeholders que permitem uma gama estendida de caracteres em rotas de atributo (ver* **Using placeholders** *below).* * **formula**: uma fórmula válida passada como `Text` ou `Object`. A fórmula será avaliada para cada entidade processada e deve retornar um valor booleano. Dentro da fórmula, a entidade está disponível através do objeto `This`. @@ -873,19 +873,19 @@ onde: * **comparator**: symbol que compara *attributePath* e *valor*. Os simbolos abaixo são compatíveis: - | Comparação | Símbolos | Comentário | - | ---------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------ | - | Igual a | =, == | Retorna os dados coincidentes, admite o coringa (@), não diferencia entre maiúsculas e minúsculas nem diacríticas. | - | | ===, IS | Retorna os dados coincidentes, considera @ como caractere padrão, não diferencia entre maiúsculas e minúsculas nem diacríticas | - | Diferente de | #, != | Suporta o coringa (@) | - | | !==, IS NOT | Considera @ como um caractere normal | - | Menor que | < | | - | Maior que | > | | - | Menor que ou igual a | <= | | - | Maior ou igual a | >= | | - | Incluído em | IN | Retorna dados iguais a ao menos um dos valores de uma coleção ou de um conjunto de valores, admite o coringa (@) | - | Não se aplica à condição de uma sentença | NOT | Parentesis são obrigatórios quando usar NOT antes de uma instrução que contenha vários operadores | - | Contém palavra chave | % | As palavras chaves podem ser usadas em atributos de string ou imagem | + | Comparação | Símbolos | Comentário | + | ---------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | Igual a | =, == | Retorna os dados coincidentes, admite o coringa (@), não diferencia entre maiúsculas e minúsculas nem diacríticas. | + | | ===, IS | Retorna os dados coincidentes, considera @ como caractere padrão, não diferencia entre maiúsculas e minúsculas nem diacríticas | + | Diferente de | #, != | Supports the wildcard (@). Equivalent to "Not condition applied on a statement" ([see below](#not-equal-to-in-collections)). | + | | !==, IS NOT | Considera @ como um caractere normal | + | Não se aplica à condição de uma sentença | NOT | Parenthesis are mandatory when NOT is used before a statement containing several operators. Equivalent to "Not equal to" ([see below](#not-equal-to-in-collections)). | + | Menor que | < | | + | Maior que | > | | + | Menor que ou igual a | <= | | + | Maior ou igual a | >= | | + | Incluído em | IN | Retorna dados iguais a ao menos um dos valores de uma coleção ou de um conjunto de valores, admite o coringa (@) | + | Contém palavra chave | % | As palavras chaves podem ser usadas em atributos de string ou imagem | * **value**: o valor a comparar ao valor atual da propriedade de cada entidade na seleção de entidade ou elemento na coleção. Pode ser um **marcador** (ver **Uso de marcadores** mais adiante) ou qualquer expressão que coincida com a propriedad de tipo de dados. Quando usar um valor constante, as regras abaixo devem ser respeitadas: * A constante de tipo **texto** pode ser passada com ou sem aspas simples (ver **Uso de aspas** mais abaixo). Para pesquisar uma stirng dentro de uma string (uma pesquisa "contém") use o símbolo coringa (@) em valor para isolar a string a ser pesquisada como mostrado neste exemplo: "@Smith@". As palavras chaves abaixo são proibidas para constantes de texto: true, false. @@ -903,40 +903,40 @@ onde: * **order by attributePath**: pode incluir uma declaração order by *attributePath* na pesquisa para que os dados resultantes sejam ordenados de acordo com esta declaração. Pode utilizar várias instruções de ordenação, separadas por vírgulas (por exemplo, ordenação por *attributePath1* desc, *attributePath2* asc). Como padrão, a ordem é ascendente. Passe 'desc'' para definir uma ordem descendente e 'asc' para definir uma ordem ascendente. > > *If you use this statement, the returned entity selection is ordered (for more information, please refer to [Ordered vs Unordered entity selections](ORDA/dsMapping.md#ordered-or-unordered-entity-selection)). -**Usar aspas** +#### Using quotes -Quando usar aspas com pesquisas, deve usar aspas simples ' ' dentro das pesquisas e aspas duplas " " para cercar a consulta inteira, senão um erro é retornado. Por exemplo: +When you use quotes within queries, you must use single quotes ' ' inside the query and double quotes " " to enclose the whole query, otherwise an error is returned. Por exemplo: ```4d "employee.name = 'smith' AND employee.firstname = 'john'" ``` > Aspas siples (') não são permitidas nos valores pesquisados, já que quebrariam a string de pesquisa. Por exemplo, "comp.name = 'John's pizza' " gerará um erro. Se precisar pesquisar valores com aspas simples, pode considerar o uso de placeholders (ver abaixo). -**Usando parêntesis** +#### Using parenthesis -É possível utilizar parênteses na consulta para dar prioridade ao cálculo. Por exemplo, pode organizar uma pesquisa da seguinte maneira: +You can use parentheses in the query to give priority to the calculation. For example, you can organize a query as follows: ```4d "(employee.age >= 30 OR employee.age <= 65) AND (employee.salary <= 10000 OR employee.status = 'Manager')" ``` -**Uso de placeholders** +#### Using placeholders -4D lhe permite utilizar placeholders, marcadores de posição, para os argumentos *attributePath*, *formula* e *value* dentro do parâmetro *queryString*. Um placeholder é um parâmetro que é inserido em strings de pesquisa e que pode ser substituído por outro valor quando a string for realizada. O valor dos placeholders é avaliado uma vez ao inicio da pesquisa - não é avaliado para cada elemento. +4D allows you to use placeholders for *attributePath*, *formula* and *value* arguments within the *queryString* parameter. A placeholder is a parameter that you insert in query strings and that is replaced by another value when the query string is evaluated. The value of placeholders is evaluated once at the beginning of the query; it is not evaluated for each element. -Dois tipos de marcadores podem ser usados: **placeholders indexados ** e **placeholders nomeados**: +Two types of placeholders can be used: **indexed placeholders** and **named placeholders**: | | Marcadores de posição indexados | Placeholders nomeados | | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Definição | Os parâmetros são inseridos como :paramIndex (por exemplo :1, :2...) em queryString e seus valores correspondentes são fornecidos pela sequência de parâmetros value. Pode usara até 128 parâmetros de valor | Os parâmetros são inseridos como: paramName (por exemplo :myparam) e seus valores se proporcionam nos atributos ou objetos de parâmetros no parámetro querySettings | | Exemplo | `$r:=class.query(":1=:2";"city";"Chicago")` | $o.attributes:=New object("att";"city")
$o.parameters:=New object("name";"Chicago")
$r:=class.query(":att=:name";$o) | -Pode misturar os tipos de argumentos em *queryString*. Um *queryString* pode conter, para os parâmetros *attributePath*, *formula* e *value* : +You can mix all argument kinds in *queryString*. A *queryString* can contain, for *attributePath*, *formula* and *value* parameters: * valores diretos (sem marcadores), * marcadores indexados ou com nome. -**É recomendado usar marcadores de posição ou placeholders nas consultas** pelas razões abaixo: +Using placeholders in queries **is recommended** for the following reasons: 1. Evita a inserção de código malicioso: se user diretamente variáveis preenchidas com uma string de pesquisa, um usuário poderia modificar as condições de pesquisa entrando argumentos adicionais. Por exemplo, imagine uma string de pesquisa como: @@ -945,50 +945,105 @@ Pode misturar os tipos de argumentos em *queryString*. Um *queryString* pode con $result:=$col.query($vquery) ``` - Esta pesquisa parece segura já que se filtram os dados não públicos. Entretanto, se o usuário introduzr na área *myname* algo como *"smith OR status='private'*, a string de pesquisa se modificaría na etapa da interpretação e poderia devolver dados privados. + This query seems secured since non-public data are filtered. However, if the user enters in the *myname* area something like *"smith OR status='private'*, the query string would be modified at the interpretation step and could return private data. - Quando usar marcadores de posição, não é possível anular as condições de segurança: + When using placeholders, overriding security conditions is not possible: ```4d $result:=$col.query("status='public' & name=:1";myname) ``` - Neste caso, se o usuário introduz *smith OR status='private'* na área *myname*, não se interpretará na string de pesquisa, só será passada como um valor. Procurando por "smith OR status = 'private' vai falhar + In this case if the user enters *smith OR status='private'* in the *myname* area, it will not be interpreted in the query string, but only passed as a value. Looking for a person named "smith OR status='private'" will just fail. 2. Evita ter que se preocupar por questões de formato ou caracteres, especialmente quando se manejam os parâmetros *attributePath* o *value* que podem conter não alfanuméricos como ".", "['... 3. Permite o uso de variáveis ou expressões nos argumentos de pesquisa. Exemplos: ```4d - $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") + $result:=$col.query("address.city = :1 & name =:2";$city;$myVar+"@") $result2:=$col.query("company.name = :1";"John's Pizzas") ``` -**Pesquisa de valores null** +#### Looking for null values -Quando pesquisar por valores null não pode usar a sintaxe de placeholder porque o motor de pesquisa vai consider null como um valor de comparação inesperado. Por exemplo se executar esta pesquisa: +When you look for null values, you cannot use the placeholder syntax because the query engine considers null as an unexpected comparison value. For example, if you execute the following query: ```4d $vSingles:=ds. Person.query("spouse = :1";Null) // will NOT work ``` -Não obterá o resultado esperado porque o valor nulo será avaliado por 4D como um erro resultante da avaliação do parâmetro (por exemplo, um atributo vindo de outra pesquisa). Para este tipo de pesquisa, deve usar a sintaxe de pesquisa direta: +You will not get the expected result because the null value will be evaluated by 4D as an error resulting from the parameter evaluation (for example, an attribute coming from another query). For these kinds of queries, you must use the direct query syntax: ```4d $vSingles:=ds. Person.query("spouse = null") //correct syntax ``` -**Linkar os argumentos de pesquisa com os atributos de coleção** +#### Not equal to in collections + +When searching within dataclass object attributes containing collections, the "not equal to *value*" comparator (`#` or `!=`) will find elements where ALL properties are different from *value* (and not those where AT LEAST one property is different from *value*, which is how work other comparators). Basically, it is equivalent to search for "Not(find collection elements where property equals *value*"). For example, with the following entities: + +``` +Entity 1: +ds.Class.name: "A" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":1 + } ] } + +Entity 2: +ds.Class.name: "B" +ds.Class.info: + { "coll" : [ { + "val":1, + "val":0 + } ] } + +Entity 3: +ds.Class.name: "C" +ds.Class.info: + { "coll" : [ { + "val":0, + "val":0 + } ] } +``` + +Consider the following results: + +```4d +ds.Class.query("info.coll[].val = :1";0) +// returns B and C +// finds "entities with 0 in at least one val property" + +ds.Class.query("info.coll[].val != :1";0) +// returns A only +// finds "entities where all val properties are different from 0" +// which is the equivalent to +ds.Class.query(not("info.coll[].val = :1";0)) +``` + +If you want to implement a query that finds entities where "at least one property is different from *value*", you need to use a special notation using a letter in the `[]`: + +```4d +ds.Class.query("info.coll[a].val != :1";0) +// returns A and B +// finds "entities where at least one val property is different from 0" +``` + +You can use any letter from the alphabet as the `[a]` notation. + + +#### Linking collection attribute query arguments :::info -Esta funcionalidade só está disponível em consultas de dataclasses e [selecção de entidades](EntitySelectionClass.md#query). Não pode ser utilizado em pesquisas em [colecções](CollectionClass.md#query). +This feature is only available in queries on dataclasses and [entity selections](EntitySelectionClass.md#query). It cannot be used in queries on [collections](CollectionClass.md#query). ::: -Para fazer isso, é necessário vincular os argumentos de pesquisa para elementos de coleção, para que apenas elementos únicos contendo argumentos linkados são encontrados. Ao pesquisar dentro de atributos de objectos dataclass contendo colecções utilizando múltiplos argumentos de consulta unidos pelo operador AND, poderá querer certificar-se de que apenas entidades contendo elementos que correspondem a todos os argumentos são devolvidas, e não entidades onde os argumentos podem ser encontrados em diferentes elementos. +When searching within dataclass object attributes containing collections using multiple query arguments joined by the AND operator, you may want to make sure that only entities containing elements that match all arguments are returned, and not entities where arguments can be found in different elements. To do this, you need to link query arguments to collection elements, so that only single elements containing linked arguments are found. -Por exemplo, com as duas entidades abaixo: +For example, with the following two entities: ``` Entity 1: @@ -1009,35 +1064,35 @@ ds. People.places: } ] } ``` -Se quiser encontrar pessoas com um tipo de local "home" na cidade "paris". Se escrever +You want to find people with a "home" location kind in the city "paris". If you write: ```4d ds. People.query("places.locations[].kind= :1 and places.locations[].city= :2";"home";"paris") ``` -... a pesquisa devolverá "martin" **e** "smith" porque "smith" tem um elemento "locations" cujo "tipo" é "home" e um elemento "locations" cuja "cidade" é "paris", mesmo que sejam elementos diferentes. +... the query will return "martin" **and** "smith" because "smith" has a "locations" element whose "kind" is "home" and a "locations" element whose "city" is "paris", even though they are different elements. -Se quiser obter apenas entidades onde os argumentos correspondentes estão no mesmo elemento coleção, precisa **linkar os argumentos**. Para linkar argumentos de pesquisa: +If you want to only get entities where matching arguments are in the same collection element, you need to **link arguments**. To link query arguments: * Adicionar uma letra entre os \[] na primeira rota a linkar e repita a mesma letra em todos os argumentos linkados. Por exemplo: `locations[a].city and locations[a].kind`. Pode usar qualquer letra do alfabeto latino (não diferencia maiúsculas e minúsculas). * Para adicionar critérios linkados na mesma pesquisa, use outra letra. Pode criar até 26 combinações de critérios em uma única pesquisa. -Com as entidades acima, se escreve: +With the above entities, if you write: ```4d ds. People.query("places.locations[a].kind= :1 and places.locations[a].city= :2";"home";"paris") ``` -... pesquisa só devolverá "martin" porque tem um elemento "locations" cujo "kind" é "home" e cujo "city" for "paris". A pesquisa não devolverá 'smith' porque os valores 'home' e 'paris' não estão no mesmo elemento de coleção. +... the query will only return "martin" because it has a "locations" element whose "kind" is "home" and whose "city" is "paris". The query will not return "smith" because the values "home" and "paris" are not in the same collection element. -**Consultas em relações Muitos para Muitos** +#### Queries in many-to-many relations -A ORDA oferece uma sintaxe especial para facilitar as consultas em muitas relações. Neste contexto, poderá ter de procurar valores diferentes com um operador `E` MAS no mesmo atributo. Por exemplo, veja a seguinte estrutura: +ORDA offers a special syntax to facilitate queries in many-to-many relations. In this context, you may need to search for different values with an `AND` operator BUT in the same attribute. For example, take a look at the following structure: ![alt-text](../assets/en/API/manytomany.png) -Imagine que quer procurar em todos os filmes em que *tanto* o actor A como o actor B têm um papel. Se escrever uma simples consulta utilizando um operador `E` , não funcionará: +Imagine that you want to search all movies in which *both* actor A and actor B have a role. If you write a simple query using an `AND` operator, it will not work: ```4d // invalid code @@ -1045,17 +1100,17 @@ $es:=ds. Movie.query("roles.actor.lastName = :1 AND roles.actor.lastName = :2";" // $es is empty ``` -Basicamente, a questão está relacionada com a lógica interna da consulta: não se pode procurar um atributo cujo valor seria tanto "A" como "B". +Basically, the issue is related to the internal logic of the query: you cannot search for an attribute whose value would be both "A" and "B". -Para tornar possível a realização de tais consultas, a ORDA permite uma sintaxe especial: basta adicionar um índice de classe ** entre **{}** em todos os atributos de relação adicionais utilizados na cadeia de caracteres: +To make it possible to perform such queries, ORDA allows a special syntax: you just need to add a *class index* between **{}** in all additional relation attributes used in the string: ```4d "relationAttribute.attribute = :1 AND relationAttribute{x}.attribute = :2 [AND relationAttribute{y}.attribute...]" ``` -**{x}** diz à ORDA para criar outra referência para o atributo da relação. Realizará então todas as operações de bitmap necessárias internamente. Também pode usar um **placeholder** (ver abaixo). A ORDA só precisa de uma referência única na consulta para cada índice de classe. +**{x}** tells ORDA to create another reference for the relation attribute. It will then perform all the necessary bitmap operations internally. Note that **x** can be any number **except 0**: {1}, or {2}, or {1540}... ORDA only needs a unique reference in the query for each class index. -No nosso exemplo, seria: +In our example, it would be: ```4d // valid code @@ -1063,38 +1118,40 @@ $es:=ds. Movie.query("roles.actor.lastName = :1 AND roles.actor{2}.lastName = :2 // $es contains movies (You've Got Mail, Sleepless in Seattle, Joe Versus the Volcano) ``` -**parâmetro de fórmula** -Como alternativa à inserção de fórmulas dentro do parâmetro *queryString* (ver acima), pode passar diretamente um objeto fórmula como critério de pesquisa booleano. A utilizaçã de um objeto fórmula para as pesquisas é **recomendada** já que se beneficia da tokenização, e o código é mais fácil de pesquisar/ler. -A fórmula deve ter sido criada usando [`Formula`](FunctionClass.md#formula) ou o comando[`Formula from string`](FunctionClass.md#formula-from-string) command. Nesse modo: +#### formula parameter + +As an alternative to formula insertion within the *queryString* parameter (see above), you can pass directly a formula object as a boolean search criteria. Using a formula object for queries is **recommended** since you benefit from tokenization, and code is easier to search/read. + +A fórmula deve ter sido criada usando [`Formula`](FunctionClass.md#formula) ou o comando[`Formula from string`](FunctionClass.md#formula-from-string) command. In this case: * *fórmula* se avalia para cada entidade e deve devolver true ou false. Durante a execução da pesquisa, se o resultado da fórmula não for booleano, é considerado como False. * dentro da *fórmula*, a entidade está disponível através do objeto `This`. * Se o objeto `Formula` for **null**, o errro 1626 ("Expecting a text or formula") é gerado, então pode interceptar a chamada com o método instalado `ON ERR CALL`. > Por razões de segurança, as chamadas a fórmulas dentro dos métodos `query()` podem ser desativadas. Veja a descrição do parâmetro *querySettings*. -**Passar parâmetros a fórmulas** +#### Passing parameters to formulas -Todo parâmetro *formula* chamado pela função `query()` pode receber parâmetros: +Any *formula* called by the `query()` class function can receive parameters: * Parâmeters devem ser passados através da propriedade **args** (objeto) do parâmetro *querySettings*. * A fórmula recebe este objeto **args** como um parâmetro **$1**. -Este pequeno código mostra os principios de como são passados os parâmetros aos métodos: +This small code shows the principles of how parameter are passed to methods: ```4d $settings:=New object("args";New object("exclude";"-")) //args object to pass parameters $es:=ds. Students.query("eval(checkName($1.exclude))";$settings) //args is received in $1 ``` -No exemplo 3 são oferecidos mais exemplos. +Additional examples are provided in example 3. -**4D Server**: em cliente/servidor, as fórmulas são executadas no servidor. Neste contexto, só se envia às fórmulas o objeto `querySettings.args`. +**4D Server**: In client/server, formulas are executed on the server. In this context, only the `querySettings.args` object is sent to the formulas. -**parâmetro querySettings** +#### querySettings parameter -No parâmetro *querySettings* é possível passar um objeto que conteha opções adicionais. As propriedades abaixo são compatíveis: +In the *querySettings* parameter, you can pass an object containing additional options. The following properties are supported: | Propriedade | Tipo | Descrição | | ------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1106,11 +1163,11 @@ No parâmetro *querySettings* é possível passar um objeto que conteha opçõe | queryPlan | Parâmetros | Na entity selection resultante, devolve ou não a descrição detalhada da pesquisa logo antes de ser executada, ou seja, a pesquisa planificada. A propriedade devolvida é um objeto que inclui cada pesquisa e subpesquisa prevista (no caso de uma pesquisa complexa). Esta opção é útil durante a fase de desenvolvimento de uma aplicação. Geralmente é usada em conjunto com queryPath. Como padrão é omitido: false. **Nota**: esta propriedade só são compatíveis com as funções`entitySelection.query( )` e `dataClass.query( )`. | | queryPath | Parâmetros | Na entity selection resultante, devolve ou não a descrição detalhada da pesquisa tal qual for realizada. A propriedade retornada é um objeto que contém a rota atual usada para a pesquisa (geralmente idêntica àquela do queryPlan, mas deve diferenciar se o motor consegue otimizar a pesquisa), assim como o tempo de processamento e o número de registros encontrado. Esta opção é útil durante a fase de desenvolvimento de uma aplicação. Como padrão é omitido: false. **Nota**: esta propriedade só são compatíveis com as funções`entitySelection.query( )` e `dataClass.query( )`. | -**Sobre queryPlan e queryPath** +#### About queryPlan and queryPath -A informação registrada em `queryPlan`/`queryPath` inclui o tipo de pesquisa (indexada e sequencial) e cada subconsulta necessária junto com os operadores de conjunção. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Geralmente a descrição do plano de pesquisa e sua rota são idênticas mas podem ser diferentes porque 4D pode implementar otimizações dinâmicas quando uma pesquisa for executada para melhorar a performance. Por exemplo, o motor 4D pode converter dinamicamente uma consulta indexada em uma consulta sequencial se estimar que seja mais rápido. Esse caso particular pode acontecer quando o número de entidades sendo pesquisada é baixo. +The information recorded in `queryPlan`/`queryPath` include the query type (indexed and sequential) and each necessary subquery along with conjunction operators. Query paths also contain the number of entities found and the time required to execute each search criterion. You may find it useful to analyze this information while developing your application(s). Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. -Por exemplo se executar esta pesquisa: +For example, if you execute the following query: ```4d $sel:=ds. Employee.query("salary < :1 and employer.name = :2 or employer.revenues > :3";\ @@ -1139,46 +1196,46 @@ queryPath: #### Exemplo 1 -Esta seção oferece vários exemplos de pesquisas. +This section provides various examples of queries. -Consultas em uma string: +Query on a string: ```4d $entitySelection:=ds. Customer.query("firstName = 'S@'") ``` -Consulta com uma instrução NOT: +Query with a NOT statement: ```4d $entitySelection:=ds. Employee.query("not(firstName=Kim)") ``` -Pesquisas com datas: +Queries with dates: ```4d $entitySelection:=ds. Employee.query("birthDate > :1";"1970-01-01") $entitySelection:=ds. Employee.query("birthDate <= :1";Current date-10950) ``` -Pesquisa com marcadores de posição indexados para os valores: +Query with indexed placeholders for values: ```4d $entitySelection:=ds. Customer.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@") ``` -Pesquisa com marcadores de posição indexados para valores em u ma dataclass relacionada: +Query with indexed placeholders for values on a related dataclass: ```4d $entitySelection:=ds. Employee.query("lastName = :1 and manager.lastName = :2";"M@";"S@") ``` -Pesquisa com marcador de posição indexado que inclui uma instrução de ordem descendente: +Query with indexed placeholder including a descending order by statement: ```4d $entitySelection:=ds. Student.query("nationality = :1 order by campus.name desc, lastname";"French") ``` -Pesquisa com marcadores de posição com nome para os valores: +Query with named placeholders for values: ```4d var $querySettings : Object @@ -1188,7 +1245,7 @@ $querySettings.parameters:=New object("userId";1234;"extraInfo";New object("name $managedCustomers:=ds. Customer.query("salesperson.userId = :userId and name = :extraInfo.name";$querySettings) ``` -Pesquisa que usa marcadores de posição nomeados e indexados para valores: +Query that uses both named and indexed placeholders for values: ```4d var $querySettings : Object @@ -1197,7 +1254,7 @@ $querySettings.parameters:=New object("userId";1234) $managedCustomers:=ds. Customer.query("salesperson.userId = :userId and name=:1";"Smith";$querySettings) ``` -Pesquisa com objetos queryPlan e queryPath: +Query with queryPlan and queryPath objects: ```4d $entitySelection:=ds. Employee.query("(firstName = :1 or firstName = :2) and (lastName = :3 or lastName = :4)";"D@";"R@";"S@";"K@";New object("queryPlan";True;"queryPath";True)) @@ -1208,19 +1265,19 @@ $queryPlan:=$entitySelection.queryPlan $queryPath:=$entitySelection.queryPath ``` -Pesquisa com uma rota de atributo de tipo Collection: +Query with an attribute path of Collection type: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[].name = :1";"horsebackriding") ``` -Pesquisa com uma rota de atributos de tipo Collection e atributos vinculados: +Query with an attribute path of Collection type and linked attributes: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[a].level=:2";"horsebackriding";2) ``` -Pesquisa com uma rota de atributos de tipo Collection e múltiplos atributos vinculados: +Query with an attribute path of Collection type and multiple linked attributes: ```4d $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and @@ -1228,25 +1285,25 @@ $entitySelection:=ds. Employee.query("extraInfo.hobbies[a].name = :1 and extraInfo.hobbies[b].level = :4";"horsebackriding";2;"Tennis";5) ``` -Pesquisa com uma rota de atributo de tipo Objeto +Query with an attribute path of Object type: ```4d $entitySelection:=ds. Employee.query("extra.eyeColor = :1";"blue") ``` -Pesquisa com uma instrução IN: +Query with an IN statement: ```4d $entitySelection:=ds. Employee.query("firstName in :1";New collection("Kim";"Dixie")) ``` -Pesquisa com instrução NOT (IN): +Query with a NOT (IN) statement: ```4d $entitySelection:=ds. Employee.query("not (firstName in :1)";New collection("John";"Jane")) ``` -Pesquisa com marcadores de posição indexados para os atributos: +Query with indexed placeholders for attributes: ```4d var $es : cs. EmployeeSelection @@ -1254,7 +1311,7 @@ $es:=ds. Employee.query(":1 = 1234 and :2 = 'Smith'";"salesperson.userId";"name" //salesperson is a related entity ``` -Pesquisa com marcadores de posição indexados para os atributos e marcadores de posição com nome para os valores: +Query with indexed placeholders for attributes and named placeholders for values: ```4d var $es : cs. EmployeeSelection @@ -1265,7 +1322,7 @@ $es:=ds. Customer.query(":1 = 1234 and :2 = :customerName";"salesperson.userId"; //salesperson is a related entity ``` -Pesquisa com marcadores de posição indexados para os atributos e os valores: +Query with indexed placeholders for attributes and values: ```4d var $es : cs. EmployeeSelection @@ -1275,11 +1332,11 @@ $es:=ds. Clients.query(":1 = 1234 and :2 = :3";"salesperson.userId";"name";"Smit #### Exemplo 2 -Esta seção ilustra pesquisas com marcadores de posição com nomes para os atributos. +This section illustrates queries with named placeholders for attributes. -Dada uma dataclass Employee com 2 entidades: +Given an Employee dataclass with 2 entities: -Entidade 1: +Entity 1: ```4d name: "Marie" @@ -1291,7 +1348,7 @@ softwares:{ } ``` -Entidade 2: +Entity 2: ```4d name: "Sophie" @@ -1303,7 +1360,7 @@ softwares:{ } ``` -Pesquisa com marcadores de posição com nome para os atributos: +Query with named placeholders for attributes: ```4d var $querySettings : Object @@ -1314,7 +1371,7 @@ Pesquisa com marcadores de posição com nome para os atributos: //$es.length=1 (Employee Marie) ``` -Pesquisa com marcadores de posição com nome para os atributos e os valores: +Query with named placeholders for attributes and values: ```4d @@ -1335,16 +1392,16 @@ Pesquisa com marcadores de posição com nome para os atributos e os valores: #### Exemplo 3 -Estes exemplos ilustram as distintas formas de utilizar fórmulas com ou sem parâmetros em suas pesquisas. +These examples illustrate the various ways to use formulas with or without parameters in your queries. -A fórmula se da como texto com `eval()` no parâmetro *queryString*: +The formula is given as text with `eval()` in the *queryString* parameter: ```4d var $es : cs. StudentsSelection $es:=ds. Students.query("eval(length(This.lastname) >=30) and nationality='French'") ``` -A fórmula se dá como um objeto `Formula` através de um marcador de posição: +The formula is given as a `Formula` object through a placeholder: ```4d var $es : cs. StudentsSelection @@ -1353,7 +1410,7 @@ A fórmula se dá como um objeto `Formula` através de um marcador de posição: $es:=ds. Students.query(":1 and nationality='French'";$formula) ``` -Só se da como criterio um objeto `Formula`: +Only a `Formula` object is given as criteria: ```4d var $es : cs. StudentsSelection @@ -1362,7 +1419,7 @@ Só se da como criterio um objeto `Formula`: $es:=ds. Students.query($formula) ``` -Podem ser aplicadas várias fórmulas: +Several formulas can be applied: ```4d var $formula1; $1; $formula2 ;$0 : Object @@ -1371,7 +1428,7 @@ Podem ser aplicadas várias fórmulas: $0:=ds. Students.query(":1 and :2 and nationality='French'";$formula1;$formula2) ``` -Uma fórmula texto em *queryString* recebe um parámetro: +A text formula in *queryString* receives a parameter: ```4d var $es : cs. StudentsSelection @@ -1387,7 +1444,7 @@ Uma fórmula texto em *queryString* recebe um parámetro: $result:=(Position($exclude;This.lastname)=0) ``` -Utilizando o mesmo método ***checkName***, um objeto `Formula` como marcador de posição recebe um parámetro: +Using the same ***checkName*** method, a `Formula` object as placeholder receives a parameter: ```4d var $es : cs. StudentsSelection @@ -1400,7 +1457,7 @@ Utilizando o mesmo método ***checkName***, um objeto `Formula` como marcador de $es:=ds. Students.query(":1 and nationality=:2";$formula;"French";$settings) ``` -Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua consulta: +We want to disallow formulas, for example when the user enters their query: ```4d var $es : cs. StudentsSelection @@ -1415,7 +1472,7 @@ Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua #### Veja também -[`.query()`](EntitySelectionClass.md#query) para seleções de entidades +[`.query()`](EntitySelectionClass.md#query) for entity selections @@ -1433,9 +1490,9 @@ Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua -| Parâmetro | Tipo | | Descrição | -| --------- | ------ | -- | --------------------------------------------------------------------------------------------------------------- | -| settings | Object | -> | Objecto que define o tempo limite e o tamanho máximo da cache ORDA para a dataclass.| +| Parâmetro | Tipo | | Descrição | +| --------- | ------ | -- | ------------------------------------------------------------------------------------------------------------- | +| settings | Object | -> | Object that sets the timeout and maximum size of the ORDA cache for the dataclass.| | @@ -1443,30 +1500,30 @@ Queremos desautorizar as fórmulas, por exemplo, quando el usuario introduz sua #### Descrição -A função `.setRemoteCacheSettings()` define o tempo limite e o tamanho máximo da cache ORDA para um dataclass.. +The `.setRemoteCacheSettings()` function sets the timeout and maximum size of the ORDA cache for a dataclass.. -No parâmetro *settings*, passe um objeto contendo as propriedades abaixo: +In the *settings* parameter, pass an object with the following properties: | Propriedade | Tipo | Descrição | | ----------- | ------- | ---------------------------- | | timeout | Integer | Tempo de espera em segundos. | | maxEntries | Integer | Número máximo de entidades. | -`timeout` define o timeout da cache ORDA para o dataclass (por defeito é de 30 segundos). Uma vez decorrido o tempo limite, as entidades da classe de dados na cache são consideradas como expiradas. Isto significa que: +`timeout` sets the timeout of the ORDA cache for the dataclass (default is 30 seconds). Once the timeout has passed, the entities of the dataclass in the cache are considered as expired. This means that: * os dados ainda estão lá * na próxima vez que os dados forem necessários, serão solicitados ao servidor * 4D remove automaticamente os dados expirados quando o número máximo de entidades é atingido -A definição de um tempo limite `` define um novo tempo limite para as entidades já presentes na cache. É útil quando se trabalha com dados que não mudam com muita frequência, e portanto quando não são necessários novos pedidos ao servidor. +Setting a `timeout` property sets a new timeout for the entities already present in the cache. It is useful when working with data that does not change very frequently, and thus when new requests to the server are not necessary. -`maxEntries` define o número máximo de entidades na cache ORDA. O padrão é de 30 000. +`maxEntries` sets the max number of entities in the ORDA cache. Default is 30 000. -O número mínimo de entradas é 300, pelo que o valor de `maxEntries` deve ser igual ou superior a 300. Caso contrário, é ignorado e o número máximo de entradas é fixado em 300. +The minimum number of entries is 300, so the value of `maxEntries` must be equal to or higher than 300. Otherwise it is ignored and the maximum number of entries is set to 300. -Se nenhuma propriedade válida for passada como `timeout` e `maxEntries`, a cache permanece inalterada, com os seus valores por defeito ou previamente definidos. +If no valid properties are passed as `timeout` and `maxEntries`, the cache remains unchanged, with its default or previously set values. -Quando uma entidade é guardada, é actualizada na cache e expira quando o tempo limite é atingido. +When an entity is saved, it is updated in the cache and expires once the timeout is reached. #### Exemplo From a4942e967c37927b4d51193ab0692f94aa35cc49 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:38:58 +0200 Subject: [PATCH 173/180] New translations EntityClass.md (Portuguese, Brazilian) --- .../version-20-R2/API/EntityClass.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md index 59b944068875df..298640d5488bcc 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/API/EntityClass.md @@ -1698,7 +1698,7 @@ Se nenhum atributo de entidade for tocado, o método retorna uma coleção vazia //collection $touchedAttributes: ["firstName","lastName","employer","employerID"] ``` -Nesse modo: +In this case: * firstName and lastName tem um tipo `storage` * employer tem um tipo `relatedEntity` From e1d8e392285b950a69ce5b5799355734d4ab18cd Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:41:39 +0200 Subject: [PATCH 174/180] New translations properties_Text.md (Portuguese, Brazilian) --- .../version-20-R2/FormObjects/properties_Text.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md index 2003c5a35307f9..1bf75919fab99b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/FormObjects/properties_Text.md @@ -281,7 +281,7 @@ This property can also be handled by the [OBJECT Get vertical alignment](https:/ `List box do tipo Collection ou entity selection` -Especifica uma expressão ou uma variável que será avaliada para cada linha exibida. Permite definir um conjunto completo de atributos de texto das linhas. É necessário transmitir uma **variável objeto** ou uma **expressão que devolva um objeto**. As propriedades abaixo são compatíveis: +Especifica uma expressão ou uma variável que será avaliada para cada linha exibida. Permite definir um conjunto completo de atributos de texto das linhas. É necessário transmitir uma **variável objeto** ou uma **expressão que devolva um objeto**. The following properties are supported: | Nome da propriedade | Tipo | Descrição | | ------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | From fe9ef7015fa04007190c0928a194e9dd545485da Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:42:25 +0200 Subject: [PATCH 175/180] New translations $compute.md (Portuguese, Brazilian) --- .../version-20-R2/REST/$compute.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$compute.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$compute.md index 7d681cf5d86853..d8a49053699667 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$compute.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$compute.md @@ -33,7 +33,7 @@ Pode utilizar qualquer uma das seguintes palavras-chave: ## Exemplo -If you want to get all the computations for an attribute of type Number, you can write: +Se quiser obter todos os cálculos para um atributo do tipo Número, pode escrever: `GET /rest/Employee/salary/?$compute=$all` @@ -67,7 +67,7 @@ Se quiser obter todos os cálculos para um atributo do tipo String, pode escreve } ```` -If you want to just get one calculation on an attribute, you can write the following: +Se pretender obter apenas um cálculo num atributo, pode escrever o seguinte: `GET /rest/Employee/salary/?$compute=sum` @@ -76,7 +76,7 @@ If you want to just get one calculation on an attribute, you can write the follo `235000` -If you want to perform a calculation on an Object attribute, you can write the following: +Se pretender efetuar um cálculo num atributo de um objeto, pode escrever o seguinte: `GET /rest/Employee/objectAttribute.property1/?$compute=sum` From 25ca38d82cc2ed797f68fcdb02d5c5517d1e55b9 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:42:30 +0200 Subject: [PATCH 176/180] New translations $imageformat.md (Portuguese, Brazilian) --- .../version-20-R2/REST/$imageformat.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$imageformat.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$imageformat.md index 9b72a8b5cecdbe..820d6c101ff35b 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$imageformat.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$imageformat.md @@ -17,13 +17,13 @@ Definir o formato a utilizar para mostrar imagens. Pode utilizar um dos seguinte | ".jpeg" or "image/jpeg" | Formato JPEG | | ".tiff" ou "image/tiff" | Formato TIFF | -Once you have defined the format, you must pass the image attribute to [`$expand`]($expand.md) to load the photo completely. +Uma vez definido o formato, é necessário passar o atributo de imagem a [`$expand`]($expand.md) para carregar completamente a fotografia. -If there is no image to be loaded or the format doesn't allow the image to be loaded, the response will be an empty object `{}`. +Se não houver nenhuma imagem a carregar ou se o formato não permitir que a imagem seja carregada, a resposta será um objeto vazio `{}`. ## Exemplo -The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: +O exemplo seguinte define o formato de imagem como JPEG, independentemente do tipo real da fotografia, e passa o número de versão real enviado pelo servidor: `GET /rest/Employee(1)/photo?$imageformat=.jpeg&$version=3&$expand=photo` From 097adf9a7bd74e8a979102bbd117a0cdb9d41248 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:42:33 +0200 Subject: [PATCH 177/180] New translations $lock.md (Portuguese, Brazilian) --- .../version-20-R2/REST/$lock.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$lock.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$lock.md index 620583aef1c2f0..9e91cbb9f15ccb 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$lock.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$lock.md @@ -28,33 +28,33 @@ A propriedade [`lockKindText`](../API/EntityClass.md#lock) é "Locked by session ### Descrição -The locks triggered by the REST API are put at the [session](authUsers.md#opening-sessions) level. +Os bloqueios accionados pela API REST são colocados ao nível da [sessão](authUsers.md#opening-sessions). -A locked entity is seen as *locked* (i.e. lock / unlock / update / delete actions are not possible) by: +Uma entidade bloqueada é vista como *bloqueada* (ou seja, as acções de bloquear/desbloquear/atualizar/eliminar não são possíveis) por: - outras sessões REST -- 4D processes (client/server, remote datastore, standalone) running on the REST server. +- Processos 4D (cliente/servidor, datastore remoto, autónomo) em execução no servidor REST. Uma entidade bloqueada pela API REST só pode ser desbloqueada: -- by its locker, i.e. a `/?$lock=false` in the REST session that sets `/?$lock=true` -- or if the session's [inactivity timeout]($directory.md) is reached (the session is closed). +- pelo seu locker, ou seja, um `/?$lock=false` na sessão REST que define `/?$lock=true` +- ou se o tempo limite de inatividade da sessão []($directory.md) for atingido (a sessão é encerrada). ### Resposta -A `?$lock` request returns a JSON object with `"result"=true` if the lock operation was successful and `"result"=false` if it failed. +Um pedido `?$lock` devolve um objeto JSON com `"result"=true` se a operação de bloqueio for bem sucedida e `"result"=false` se falhar. O objeto "__STATUS" devolvido tem as seguintes propriedades: | Propriedade | | Tipo | Descrição | | ------------ | -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | | | | ***Disponível apenas em caso de sucesso:*** | -| success | | boolean | true if the lock action is successful (or if the entity is already locked in the current session), false otherwise (not returned in this case). | +| success | | boolean | true se a ação de bloqueio for bem sucedida (ou se a entidade já estiver bloqueada na sessão atual), false caso contrário (não devolvido neste caso). | | | | | ***Disponível apenas em caso de erro:*** | | status | | number | Código de erro, ver abaixo | | statusText | | text | Descrição do erro, ver abaixo | | lockKind | | number | Código de bloqueio | -| lockKindText | | text | "Locked by session" if locked by a REST session, "Locked by record" if locked by a 4D process | +| lockKindText | | text | "Bloqueado por sessão" se bloqueado por uma sessão REST, "Bloqueado por registo" se bloqueado por um processo 4D | | lockInfo | | object | Informações sobre a origem do bloqueio. Retorna propriedades dependendo da origem da trava (processo 4D ou sessão REST) | | | | | ***Disponível só para um processo trava 4D:*** | | | task_id | number | Process ID | From ac31d57fb0e178ee0ff0adf684b6d93d908f97e9 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:42:41 +0200 Subject: [PATCH 178/180] New translations $version.md (Portuguese, Brazilian) --- .../version-20-R2/REST/$version.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$version.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$version.md index 27ed963ff2e6ae..385c65fa7d7d9a 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$version.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/$version.md @@ -13,6 +13,6 @@ O valor do parâmetro de versão da imagem é modificado pelo servidor. ## Exemplo -The following example defines the image format to JPEG regardless of the actual type of the photo and passes the actual version number sent by the server: +O exemplo seguinte define o formato de imagem como JPEG, independentemente do tipo real da fotografia, e passa o número de versão real enviado pelo servidor: `GET /rest/Employee(1)/photo?$imageformat=jpeg&$version=3&$expand=photo` \ No newline at end of file From 8df35edccd4b9aea7a59f0d39ebdaf41bbc620b6 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:42:46 +0200 Subject: [PATCH 179/180] New translations genInfo.md (Portuguese, Brazilian) --- .../version-20-R2/REST/genInfo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md index b41a6100f6387e..8c149773857e3c 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/REST/genInfo.md @@ -33,4 +33,4 @@ Essas propriedades são objetos que contém informação sobre como o servidor r - **queryPlan**: objeto contendo a descrição detalhada da pesquisa logo antes de ser executada (ou seja, a pesquisa planejada). - **queryPath**: objeto contendo a descrição detalhada da pesquisa como foi realizada. -A informação registrada inclui o tipo de pesquisa (indexada e sequencial) e cada subpesquisa necessária junto com operações de conjunção. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Geralmente a descrição do plano de pesquisa e sua rota são idênticas mas podem ser diferentes porque 4D pode implementar otimizações dinâmicas quando uma pesquisa for executada para melhorar a performance. Por exemplo, o motor 4D pode converter dinamicamente uma consulta indexada em uma consulta sequencial se estimar que seja mais rápido. Esse caso particular pode acontecer quando o número de entidades sendo pesquisada é baixo. \ No newline at end of file +A informação registrada inclui o tipo de pesquisa (indexada e sequencial) e cada subpesquisa necessária junto com operações de conjunção. Query paths also contain the number of entities found and the time required to execute each search criterion. As rotas de acesso das petições também contém o número de entidades encontradas e o tempo necessário para executar cada critério de pesquisa. Generally, the description of the query plan and its path are identical but they can differ because 4D can implement dynamic optimizations when a query is executed in order to improve performance. For example, the 4D engine can dynamically convert an indexed query into a sequential one if it estimates that it is faster. This particular case can occur when the number of entities being searched for is low. \ No newline at end of file From 42cce7d5673f85df879722aacae3dbb274e3bdc0 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Tue, 29 Aug 2023 13:43:09 +0200 Subject: [PATCH 180/180] New translations method-list.md (Portuguese, Brazilian) --- .../version-20-R2/ViewPro/method-list.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md index c21daf813b40cc..ef9f8648171436 100644 --- a/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md +++ b/i18n/pt/docusaurus-plugin-content-docs/version-20-R2/ViewPro/method-list.md @@ -37,7 +37,7 @@ Passar a fórmula 4D View Pro que deseja nomear em *vpFormula*. Para obter infor Passar o novo nome da fórmula em *name*. Se o nome já estiver a ser utilizado no mesmo âmbito, a nova fórmula nomeada substitui a existente. Note que pode utilizar o mesmo nome para diferentes âmbitos (ver abaixo). -Pode passar um objeto com propriedades adicionais para a fórmula nomeada em *options*. As propriedades abaixo são compatíveis: +Pode passar um objeto com propriedades adicionais para a fórmula nomeada em *options*. The following properties are supported: | Propriedade | Tipo | Descrição | | ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -77,7 +77,7 @@ O comando `VP ADD RANGE NAME` cr Em *rangeObj*, passe o intervalo que pretende nomear e passe o novo nome para o intervalo em *name*. Se o nome já estiver a ser utilizado no mesmo âmbito, o novo intervalo nomeado substitui o existente. Note que pode utilizar o mesmo nome para diferentes âmbitos (ver abaixo). -Pode passar um objeto com propriedades adicionais para o intervalo nomeado em *options*. As propriedades abaixo são compatíveis: +Pode passar um objeto com propriedades adicionais para o intervalo nomeado em *options*. The following properties are supported: | Propriedade | Tipo | Descrição | | ----------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1151,7 +1151,7 @@ In the *rangeObj* parameter, pass an object containing a range to search. The *searchValue* parameter lets you pass the text to search for within the *rangeObj*. -You can pass the optional *searchCondition* parameter to specify how the search is performed. As propriedades abaixo são compatíveis: +You can pass the optional *searchCondition* parameter to specify how the search is performed. The following properties are supported: | Propriedade | Tipo | Descrição | | ----------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -3461,7 +3461,7 @@ VP NEW DOCUMENT("myVPArea") O comando `VP Object to font` returns a font shorthand string from *fontObj*. -In *fontObj*, pass an object containing the font properties. As propriedades abaixo são compatíveis: +In *fontObj*, pass an object containing the font properties. The following properties are supported: | Propriedade | Tipo | Descrição | Valores possíveis | Obrigatório | | ----------- | ---- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |