Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Feb 2, 2024
1 parent 288de5c commit 9e96972
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 72 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/alfio/i18n/README.md
Expand Up @@ -30,6 +30,6 @@ You can suggest modifications to the translations of certain terms for these lan

#### 3. Add yourself to the contributors' list

After your modification is complete, please provide a Pull Request for adding your name/details under the "contributors" section of the [Project Repo page](https://github.com/alfio-event/alf.io/blob/master/README.md).
After your modification is complete, please provide a Pull Request for adding your name/details under the "contributors" section of the [Project Repo page](https://github.com/alfio-event/alf.io/blob/main/README.md).

More info on Pull Requests [here](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-pull-requests)
4 changes: 2 additions & 2 deletions website/content/en/docs/Reference/Extensions/_index.md
Expand Up @@ -70,8 +70,8 @@ the extensions. As mentioned above, `for`, `for/in` or `for/of` loops can be use
Java methods can be called from the scripts, therefore we limit some harmful usage by applying sandboxing. Access to
`java.lang.System.exit()` and `getClass()` are disabled. In general, access to Java classes is not possible. However,
the standard objects (`Object`, `String`, `Number`, `Date`, etc.) can be used. In addition, we enable the use of
the following classes: `GSON`, [`SimpleHttpClient`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/extension/SimpleHttpClient.java),
`HashMap`, [`ExtensionUtils`]( https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/extension/ExtensionUtils.java)
the following classes: `GSON`, [`SimpleHttpClient`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/extension/SimpleHttpClient.java),
`HashMap`, [`ExtensionUtils`]( https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/extension/ExtensionUtils.java)
and [`Logger`](https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/Logger.html).


Expand Down
Expand Up @@ -50,12 +50,12 @@ Alf.io provides some objects and properties to the script in the script scope:
</tr>
<tr>
<td>`extensionLogger`</td>
<td>[`ExtensionLogger`] ( https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/extension/ExtensionLogger.java)</td>
<td>[`ExtensionLogger`] ( https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/extension/ExtensionLogger.java)</td>
<td>A logger that writes in the extension_log table.</td>
</tr>
<tr>
<td>`simpleHttpClient`</td>
<td>[`SimpleHttpClient`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/extension/SimpleHttpClient.java)</td>
<td>[`SimpleHttpClient`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/extension/SimpleHttpClient.java)</td>
<td>A simplified version created by Alf.io for calling external services</td>
</tr>
<tr>
Expand All @@ -75,7 +75,7 @@ Alf.io provides some objects and properties to the script in the script scope:
</tr>
<tr>
<td>`event`</td>
<td>[`Event`]( https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/Event.java)</td>
<td>[`Event`]( https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/Event.java)</td>
<td>Alf.io's implementation of a general event</td>
</tr>
<tr>
Expand All @@ -90,7 +90,7 @@ Alf.io provides some objects and properties to the script in the script scope:
</tr>
<tr>
<td>`Utils`</td>
<td>[`ExtensionUtils`]( https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/extension/ExtensionUtils.java)</td>
<td>[`ExtensionUtils`]( https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/extension/ExtensionUtils.java)</td>
<td>A collection of utilities</td>
</tr>
<tr>
Expand Down
18 changes: 9 additions & 9 deletions website/content/en/docs/Reference/Extensions/reference/email.md
Expand Up @@ -13,7 +13,7 @@ description: >
Fired before sending a reservation confirmation email.

This is a **synchronous** call.
A result of type [`CustomEmailText`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/extension/CustomEmailText.java) is expected. Return `null` if the generation was not successful.
A result of type [`CustomEmailText`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/extension/CustomEmailText.java) is expected. Return `null` if the generation was not successful.
<div class="table-responsive table-hover">
<table class="table table-sm">
<thead>
Expand All @@ -26,17 +26,17 @@ A result of type [`CustomEmailText`](https://github.com/alfio-event/alf.io/blob/
<tbody>
<tr>
<td>`reservation`</td>
<td>[`TicketReservation`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/TicketReservation.java)</td>
<td>[`TicketReservation`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/TicketReservation.java)</td>
<td>Details about the reservation</td>
</tr>
<tr>
<td>`purchaseContext`</td>
<td>[`PurchaseContext`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/PurchaseContext.java)</td>
<td>[`PurchaseContext`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/PurchaseContext.java)</td>
<td>The PurchaseContext (Event or Subscription) for which the reservation has been made</td>
</tr>
<tr>
<td>`billingData`</td>
<td>[`TicketReservationAdditionalInfo`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/TicketReservationAdditionalInfo.java)</td>
<td>[`TicketReservationAdditionalInfo`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/TicketReservationAdditionalInfo.java)</td>
<td>Billing info for the reservation</td>
</tr>
</tbody>
Expand All @@ -50,7 +50,7 @@ A result of type [`CustomEmailText`](https://github.com/alfio-event/alf.io/blob/
Fired before sending a ticket email.

This is a **synchronous** call.
A result of type [`CustomEmailText`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/extension/CustomEmailText.java) is expected. Return `null` if the generation was not successful.
A result of type [`CustomEmailText`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/extension/CustomEmailText.java) is expected. Return `null` if the generation was not successful.
<div class="table-responsive table-hover">
<table class="table table-sm">
<thead>
Expand All @@ -63,22 +63,22 @@ A result of type [`CustomEmailText`](https://github.com/alfio-event/alf.io/blob/
<tbody>
<tr>
<td>`reservation`</td>
<td>[`TicketReservation`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/TicketReservation.java)</td>
<td>[`TicketReservation`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/TicketReservation.java)</td>
<td>Details about the reservation</td>
</tr>
<tr>
<td>`event`</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/Event.java)</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/Event.java)</td>
<td>The Event for which the ticket has been confirmeds</td>
</tr>
<tr>
<td>`billingData`</td>
<td>[`TicketReservationAdditionalInfo`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/TicketReservationAdditionalInfo.java)</td>
<td>[`TicketReservationAdditionalInfo`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/TicketReservationAdditionalInfo.java)</td>
<td>Billing info for the reservation</td>
</tr>
<tr>
<td>`additionalFields`</td>
<td>`List<`[`TicketFieldValue`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/TicketFieldValue.java)`>`</td>
<td>`List<`[`TicketFieldValue`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/TicketFieldValue.java)`>`</td>
<td>Additional info provided for the ticket holder</td>
</tr>
</tbody>
Expand Down
65 changes: 58 additions & 7 deletions website/content/en/docs/Reference/Extensions/reference/event.md
Expand Up @@ -22,13 +22,36 @@ Fired both **asynchronously** and **synchronously** when an Event is created
<tbody>
<tr>
<td>`event`</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/Event.java)</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/Event.java)</td>
<td>The created Event</td>
</tr>
</tbody>
</table>
</div>

### Event created
`EVENT_VALIDATE_CREATION`

Fired **synchronously** before creating an Event. Useful to perform custom validations
<div class="table-responsive table-hover">
<table class="table table-sm">
<thead>
<tr>
<th>Variable</th>
<th>Type</th>
<th>About</th>
</tr>
</thead>
<tbody>
<tr>
<td>`request`</td>
<td>[`EventModification`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/modification/EventModification.java)</td>
<td>Creation request</td>
</tr>
</tbody>
</table>
</div>

### Event status change
`EVENT_STATUS_CHANGE`

Expand All @@ -45,24 +68,52 @@ Fired both **asynchronously** and **synchronously** when an Event status changes
<tbody>
<tr>
<td>`event`</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/Event.java)</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/Event.java)</td>
<td>The Event</td>
</tr>
<tr>
<td>`status`</td>
<td>[`Event.Status`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/Event.java#L45)</td>
<td>[`Event.Status`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/Event.java#L45)</td>
<td>updated Status</td>
</tr>
</tbody>
</table>
</div>

### Validate seats/prices update
`EVENT_VALIDATE_SEATS_PRICES_UPDATE`

Fired **synchronously** when a modification to prices and/or seats number is requested for an Event
<div class="table-responsive table-hover">
<table class="table table-sm">
<thead>
<tr>
<th>Variable</th>
<th>Type</th>
<th>About</th>
</tr>
</thead>
<tbody>
<tr>
<td>`event`</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/Event.java)</td>
<td>The Event</td>
</tr>
<tr>
<td>`request`</td>
<td>[`EventModification`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/modification/EventModification.java)</td>
<td>Modification request</td>
</tr>
</tbody>
</table>
</div>

### Event status change
`EVENT_METADATA_UPDATE`

Fired **synchronously** when the organizer updates the metadata of an Event.

A result of type [`AlfioMetadata`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/metadata/AlfioMetadata.java) is expected. Return `null` if you want to fall back to default settings.
A result of type [`AlfioMetadata`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/metadata/AlfioMetadata.java) is expected. Return `null` if you want to fall back to default settings.
<div class="table-responsive table-hover">
<table class="table table-sm">
<thead>
Expand All @@ -75,17 +126,17 @@ A result of type [`AlfioMetadata`](https://github.com/alfio-event/alf.io/blob/ma
<tbody>
<tr>
<td>`event`</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/Event.java)</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/Event.java)</td>
<td>The Event</td>
</tr>
<tr>
<td>`metadata`</td>
<td>[`AlfioMetadata`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/metadata/AlfioMetadata.java)</td>
<td>[`AlfioMetadata`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/metadata/AlfioMetadata.java)</td>
<td>existing metadata. **Might be `null`**</td>
</tr>
<tr>
<td>`organization`</td>
<td>[`Organization`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/user/Organization.java)</td>
<td>[`Organization`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/user/Organization.java)</td>
<td>organizer details</td>
</tr>
<tr>
Expand Down
Expand Up @@ -23,7 +23,7 @@ Fired when someone subscribes to a waiting list
<tbody>
<tr>
<td>`waitingQueueSubscription`</td>
<td>[`WaitingQueueSubscription`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/WaitingQueueSubscription.java)</td>
<td>[`WaitingQueueSubscription`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/WaitingQueueSubscription.java)</td>
<td>Details about the subscription</td>
</tr>
</tbody>
Expand All @@ -35,10 +35,10 @@ Fired when someone subscribes to a waiting list

Fired when a PDF needs to be generated. This is useful if you want to delegate the actual PDF generation to a dedicated service.

Script is expected to save the result in a temporary file (e.g. by using the `postBodyAndSaveResponse` method of [SimpleHttpClient](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/extension/SimpleHttpClient.java#L84))
Script is expected to save the result in a temporary file (e.g. by using the `postBodyAndSaveResponse` method of [SimpleHttpClient](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/extension/SimpleHttpClient.java#L84))

This is a **synchronous** call.
A result of type [`PdfGenerationResult`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/extension/PdfGenerationResult.java) is expected. Return `null` if the generation was not successful.
A result of type [`PdfGenerationResult`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/extension/PdfGenerationResult.java) is expected. Return `null` if the generation was not successful.
<div class="table-responsive table-hover">
<table class="table table-sm">
<thead>
Expand All @@ -51,7 +51,7 @@ A result of type [`PdfGenerationResult`](https://github.com/alfio-event/alf.io/b
<tbody>
<tr>
<td>`event`</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/master/src/main/java/alfio/model/Event.java)</td>
<td>[`Event`](https://github.com/alfio-event/alf.io/blob/main/src/main/java/alfio/model/Event.java)</td>
<td>The event</td>
</tr>
<tr>
Expand Down

0 comments on commit 9e96972

Please sign in to comment.