Skip to content

Commit 23974c6

Browse files
authored
Merge pull request #429 from doc4d/main
20.7
2 parents 25c4b87 + e3c12d5 commit 23974c6

File tree

630 files changed

+2981
-2811
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

630 files changed

+2981
-2811
lines changed

docs/API/OutgoingMessageClass.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: OutgoingMessage
66

77
The `4D.OutgoingMessage` class allows you to build messages to be returned by your application functions in response to [REST requests](../REST/REST_requests.md). If the response is of type `4D.OutgoingMessage`, the REST server does not return an object but the object instance of the `OutgoingMessage` class.
88

9-
Typically, this class can be used in custom [HTTP request handler functions](../WebServer/http-request-handler.md#function-configuration) or in functions declared with the [`onHttpGet`](../ORDA/ordaClasses.md#onhttpget-keyword) keyword and designed to handle HTTP GET requests. Such requests are used, for example, to implement features such as download file, generate and download picture as well as receiving any content-type via a browser.
9+
Typically, this class can be used in custom [HTTP request handler functions](../WebServer/http-request-handler.md#function-configuration) or in functions declared with the [`onHTTPGet`](../ORDA/ordaClasses.md#onhttpget-keyword) keyword and designed to handle HTTP GET requests. Such requests are used, for example, to implement features such as download file, generate and download picture as well as receiving any content-type via a browser.
1010

1111
An instance of this class is built on 4D Server and can be sent to the browser by the [4D REST Server](../REST/gettingStarted.md) only. This class allows to use other technologies than HTTP (e.g. mobile).
1212

docs/Concepts/classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ You declare singleton classes by adding appropriate keyword(s) before the [`Clas
785785
:::note
786786

787787
- Session singletons are automatically shared singletons (there's no need to use the `shared` keyword in the class constructor).
788-
- Singleton shared functions support [`onHttpGet` keyword](../ORDA/ordaClasses.md#onhttpget-keyword).
788+
- Singleton shared functions support [`onHTTPGet` keyword](../ORDA/ordaClasses.md#onhttpget-keyword).
789789

790790
:::
791791

docs/Concepts/error-handling.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ It is highly recommended to install a global error-handling method on 4D Server,
2626

2727
Many 4D class functions, such as `entity.save()` or `transporter.send()`, return a *status* object. This object is used to store "predictable" errors in the runtime context, e.g. invalid password, locked entity, etc., that do not stop program execution. This category of errors can be handled by regular code.
2828

29-
Other "unpredictable" errors include disk write error, network failure, or in general any unexpected interruption. This category of errors generates exceptions and needs to be handled through an error-handling method or a `Try()` keyword.
29+
Other "unpredictable" errors include disk write error, network failure, or in general any unexpected interruption. This category of errors generates exceptions defined by [a *code*, a *message* and a *signature*](#error-codes) and needs to be handled through an error-handling method or a `Try()` keyword.
3030

3131

3232
## Installing an error-handling method
@@ -295,3 +295,62 @@ Function createInvoice($customer : cs.customerEntity; $items : Collection; $invo
295295
return $newInvoice
296296
297297
```
298+
299+
300+
## Error codes
301+
302+
Exceptions that interrupt code execution are returned by 4D but can have different origins such as the OS, a device, the 4D kernel, a [`throw`](../commands-legacy/throw.md) in your code, etc. A returned error is therefore defined by three elements:
303+
304+
- a **component signature**, which is the origin of the error
305+
- a **message**, wich explains why the error occurred
306+
- a **code**, which is an arbitrary number returned by the component
307+
308+
These information are returned for every error (when available) by the [4D error dialog box](../Debugging/basics.md) and the [`Last errors`](../commands-legacy/last-errors.md) command. Keep in mind that, if you intercept and handle errors using a [error-handling method](#installing-an-error-handling-method), you need to process all information since a simple error code could not be correctly interpreted.
309+
310+
#### 4D component signatures
311+
312+
|Component Signature|Component|
313+
|--|---|
314+
|4DCM|4D Compiler runtime|
315+
|4DRT|4D runtime|
316+
|bkrs|4D backup & restore manager|
317+
|brdg|SQL 4D bridge|
318+
|cecm|4D code Editor|
319+
|CZip|zip 4D apis|
320+
|dbmg|4D database manager|
321+
|FCGI|fast cgi 4D bridge|
322+
|FiFo|4D file objects|
323+
|HTCL|http client 4D apis|
324+
|HTTP|4D http server|
325+
|IMAP|IMAP 4D apis|
326+
|JFEM|Form Macro apis|
327+
|LD4D|LDAP 4D apis|
328+
|lscm|4D language syntax manager|
329+
|MIME|MIME 4D apis|
330+
|mobi|4D Mobile|
331+
|pdf1|4D pdf apis|
332+
|PHP_|php 4D bridge|
333+
|POP3|POP3 4D apis|
334+
|SMTP|SMTP 4D apis|
335+
|SQLS|4D SQL server|
336+
|srvr|4D network layer apis|
337+
|svg1|SVG 4D apis|
338+
|ugmg|4D users and groups manager|
339+
|UP4D|4D updater|
340+
|VSS |4D VSS support (Windows Volume Snapshot Service) |
341+
|webc|4D Web view|
342+
|xmlc|XML 4D apis|
343+
|wri1|4D Write Pro|
344+
345+
346+
#### System component signatures
347+
348+
|Component Signature|Component|
349+
|--|---|
350+
|CARB|Carbon subsystem|
351+
|COCO|Cocoa subsystem|
352+
|MACH|macOS Mach subsystem|
353+
|POSX|posix/bsd subsystem (mac, linux, win)|
354+
|PW32|Pre-Win32 subsystem|
355+
|WI32|Win32 subsystem|
356+

docs/Notes/updates.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Read [**What’s new in 4D 20 R10**](https://blog.4d.com/en-whats-new-in-4d-20-R
1212

1313
- New `connectionTimeout` option in the [`options`](../API/TCPConnectionClass.md#options-parameter) parameter of the [`4D.TCPConnection.new()`](../API/TCPConnectionClass.md#4dtcpconnectionnew) function.
1414

15+
- 4D Language:
16+
- For consistency, [`Create entity selection`](../commands/create-entity-selection.md) and [`USE ENTITY SELECTION`](../commands/use-entity-selection.md) commands have been moved from the ["4D Environment"](../commands/theme/4D_Environment.md) to the ["Selection"](../commands/theme/Selection.md) themes.
17+
18+
1519
## 4D 20 R9
1620

1721
Read [**What’s new in 4D 20 R9**](https://blog.4d.com/en-whats-new-in-4d-20-R9/), the blog post that lists all new features and enhancements in 4D 20 R9.
@@ -74,7 +78,7 @@ Read [**What’s new in 4D 20 R7**](https://blog.4d.com/en-whats-new-in-4d-20-R7
7478
- You can now [add and remove components using the Component manager interface](../Project/components.md#monitoring-project-dependencies).
7579
- New [**direct typing mode**](../Project/compiler.md#enabling-direct-typing) in which you declare all variables and parameters in your code using `var` and `#DECLARE`/`Function` keywords (only mode supported in new projects). [Syntax checking feature](../Project/compiler.md#check-syntax) has been enhanced accordingly.
7680
- Support of [Session singletons](../Concepts/classes.md#singleton-classes) and new [`.isSessionSingleton`](../API/ClassClass.md#issessionsingleton) Class property.
77-
- New [`onHttpGet` function keyword](../ORDA/ordaClasses.md#onhttpget-keyword) to define singleton or ORDA functions that can be called through [HTTP REST GET requests](../REST/ClassFunctions.md#function-calls).
81+
- New [`onHTTPGet` function keyword](../ORDA/ordaClasses.md#onhttpget-keyword) to define singleton or ORDA functions that can be called through [HTTP REST GET requests](../REST/ClassFunctions.md#function-calls).
7882
- New [`4D.OutgoingMessage`](../API/OutgoingMessageClass.md) class for the REST server to return any web contents.
7983
- Qodly Studio: You can now [attach the Qodly debugger to 4D Server](../WebServer/qodly-studio.md#using-qodly-debugger-on-4d-server).
8084
- New Build Application keys for remote 4D applications to validate the server certificate authority [signatures](https://doc.4d.com/4Dv20R7/4D/20-R7/CertificateAuthoritiesCertificates.300-7425900.en.html) and/or [domain](https://doc.4d.com/4Dv20R7/4D/20-R7/CertificateDomainName.300-7425906.en.html).

docs/ORDA/ordaClasses.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -859,20 +859,20 @@ $status:=$remoteDS.Schools.registerNewStudent($student) // OK
859859
$id:=$remoteDS.Schools.computeIDNumber() // Error "Unknown member method"
860860
```
861861

862-
## onHttpGet keyword
862+
## onHTTPGet keyword
863863

864-
Use the `onHttpGet` keyword to declare functions that can be called through HTTP requests using the `GET` verb. Such functions can return any web contents, for example using the [`4D.OutgoingMessage`](../API/OutgoingMessageClass.md) class.
864+
Use the `onHTTPGet` keyword to declare functions that can be called through HTTP requests using the `GET` verb. Such functions can return any web contents, for example using the [`4D.OutgoingMessage`](../API/OutgoingMessageClass.md) class.
865865

866-
The `onHttpGet` keyword is available with:
866+
The `onHTTPGet` keyword is available with:
867867

868868
- ORDA Data model class functions
869869
- [Singletons class functions](../Concepts/classes.md#singleton-classes)
870870

871871
The formal syntax is:
872872

873873
```4d
874-
// declare an onHttpGet function
875-
exposed onHttpGet Function <functionName>(params) : result
874+
// declare an onHTTPGet function
875+
exposed onHTTPGet Function <functionName>(params) : result
876876
```
877877

878878
:::info
@@ -889,7 +889,7 @@ As this type of call is an easy offered action, the developer must ensure no sen
889889

890890
### params
891891

892-
A function with `onHttpGet` keyword accepts [parameters](../Concepts/parameters.md).
892+
A function with `onHTTPGet` keyword accepts [parameters](../Concepts/parameters.md).
893893

894894
In the HTTP GET request, parameters must be passed directly in the URL and declared using the `$params` keyword (they must be enclosed in a collection).
895895

@@ -903,7 +903,7 @@ See the [Parameters](../REST/classFunctions#parameters) section in the REST serv
903903

904904
### result
905905

906-
A function with `onHttpGet` keyword can return any value of a supported type (same as for REST [parameters](../REST/classFunctions#parameters)).
906+
A function with `onHTTPGet` keyword can return any value of a supported type (same as for REST [parameters](../REST/classFunctions#parameters)).
907907

908908
:::info
909909

docs/REST/$singleton.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ with data in the body of the POST request: `["myparam"]`
4747

4848
:::note
4949

50-
The `SingletonClassFunction()` function must have been declared with the `onHttpGet` keyword to be callable with `GET` (see [Function configuration](ClassFunctions#function-configuration)).
50+
The `SingletonClassFunction()` function must have been declared with the `onHTTPGet` keyword to be callable with `GET` (see [Function configuration](ClassFunctions#function-configuration)).
5151

5252
:::
5353

docs/REST/ClassFunctions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ with data in the body of the POST request: `["Aguada"]`
5555

5656
:::note
5757

58-
The `getCity()` function must have been declared with the `onHttpGet` keyword (see [Function configuration](#function-configuration) below).
58+
The `getCity()` function must have been declared with the `onHTTPGet` keyword (see [Function configuration](#function-configuration) below).
5959

6060
:::
6161

@@ -80,13 +80,13 @@ exposed Function getSomeInfo() : 4D.OutgoingMessage
8080
See [Exposed vs non-exposed functions](../ORDA/ordaClasses.md#exposed-vs-non-exposed-functions) section.
8181

8282

83-
### `onHttpGet`
83+
### `onHTTPGet`
8484

85-
Functions allowed to be called from HTTP `GET` requests must also be specifically declared with the [`onHttpGet` keyword](../ORDA/ordaClasses.md#onhttpget-keyword). For example:
85+
Functions allowed to be called from HTTP `GET` requests must also be specifically declared with the [`onHTTPGet` keyword](../ORDA/ordaClasses.md#onhttpget-keyword). For example:
8686

8787
```4d
8888
//allowing GET requests
89-
exposed onHttpGet Function getSomeInfo() : 4D.OutgoingMessage
89+
exposed onHTTPGet Function getSomeInfo() : 4D.OutgoingMessage
9090
```
9191

9292

docs/WebServer/http-request-handler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Request handler functions are not necessarily shared, unless some request handle
252252

253253
:::note
254254

255-
It is **not recommended** to expose request handler functions to external REST calls using [`exposed`](../ORDA/ordaClasses.md#exposed-vs-non-exposed-functions) or [`onHttpGet`](../ORDA/ordaClasses.md#onhttpget-keyword) keywords.
255+
It is **not recommended** to expose request handler functions to external REST calls using [`exposed`](../ORDA/ordaClasses.md#exposed-vs-non-exposed-functions) or [`onHTTPGet`](../ORDA/ordaClasses.md#onhttpget-keyword) keywords.
256256

257257
:::
258258

docs/commands-legacy/last-errors.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,22 @@ Each error object contains the following attributes:
2525
| message | text | Description of the error |
2626
| componentSignature | text | Signature of the internal component which returned the error |
2727

28+
:::note
29+
30+
For a description of component signatures, please refer to the [Error codes](../Concepts/error-handling.md#error-codes) section.
31+
32+
:::
33+
34+
35+
2836
This command must be called from an on error call method installed by the [ON ERR CALL](on-err-call.md) command.
2937

3038

3139
## See also
3240

3341
[ON ERR CALL](on-err-call.md)
3442
[throw](throw.md)
43+
[Error handling](../Concepts/error-handling.md)
3544

3645
## Properties
3746

docs/commands/theme/4D_Environment.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ slug: /commands/theme/4D-Environment
1515
|[<!-- INCLUDE #_command_.Compact data file.Syntax -->](../../commands-legacy/compact-data-file.md)<br/>|
1616
|[<!-- INCLUDE #_command_.COMPONENT LIST.Syntax -->](../../commands-legacy/component-list.md)<br/>|
1717
|[<!-- INCLUDE #_command_.CREATE DATA FILE.Syntax -->](../../commands-legacy/create-data-file.md)<br/>|
18-
|[<!-- INCLUDE #_command_.Create entity selection.Syntax -->](../../commands/create-entity-selection.md)<br/>|
1918
|[<!-- INCLUDE #_command_.Data file.Syntax -->](../../commands-legacy/data-file.md)<br/>|
2019
|[<!-- INCLUDE #_command_.Database measures.Syntax -->](../../commands-legacy/database-measures.md)<br/>|
2120
|[<!-- INCLUDE #_command_.DROP REMOTE USER.Syntax -->](../../commands-legacy/drop-remote-user.md)<br/>|
@@ -47,7 +46,6 @@ slug: /commands/theme/4D-Environment
4746
|[<!-- INCLUDE #_command_.SET UPDATE FOLDER.Syntax -->](../../commands-legacy/set-update-folder.md)<br/>|
4847
|[<!-- INCLUDE #_command_.Structure file.Syntax -->](../../commands-legacy/structure-file.md)<br/>|
4948
|[<!-- INCLUDE #_command_.Table fragmentation.Syntax -->](../../commands-legacy/table-fragmentation.md)<br/>|
50-
|[<!-- INCLUDE #_command_.USE ENTITY SELECTION.Syntax -->](../../commands/use-entity-selection.md)<br/>|
5149
|[<!-- INCLUDE #_command_.VERIFY CURRENT DATA FILE.Syntax -->](../../commands-legacy/verify-current-data-file.md)<br/>|
5250
|[<!-- INCLUDE #_command_.VERIFY DATA FILE.Syntax -->](../../commands-legacy/verify-data-file.md)<br/>|
5351
|[<!-- INCLUDE #_command_.Version type.Syntax -->](../../commands-legacy/version-type.md)<br/>|

0 commit comments

Comments
 (0)