Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 58 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

## Requirements

This project requires Java 25.
| Launchpad | Spring Boot | Java |
|-----------|-------------|------|
| 4.x | 4.x | 25+ |
| 3.x | 4.x | 17+ |
| 1.x | 3.x | 17+ |
| 0.x | 2.x | 11+ |


## Usage
Expand All @@ -15,10 +20,8 @@ This project requires Java 25.
<version>...</version>
</dependency>
```
- Choose the right version of Launchpad for your Spring Boot version:
- 3.x is using spring boot 4.x as a parent
- 1.x is using spring boot 3.x as a parent
- 0.x is using spring boot 2.x as a parent
Choose the version matching your Spring Boot and Java version, see [Requirements](#requirements).
Launchpad is a Spring Boot auto-configuration, no `@Import` or component scan is needed.
- Configure launchpad apps in your `application.yml`
```yaml
launchpad:
Expand All @@ -37,9 +40,50 @@ This project requires Java 25.
url: https://link-2
```
- Assign `HasLaunchpad` to all Controllers you want the launchpad to be available
- Render the model attribute `launchpad` in your view. It has a list `apps`, each with `url`, `name`
(in the request's language) and `icon`. The attribute is missing when the user may see no app.
```html
<nav th:if="${launchpad}">
<a th:each="app : ${launchpad.apps}" th:href="${app.url}">
<img th:src="${app.icon}" alt=""> <span th:text="${app.name}"></span>
</a>
</nav>
```

App names are looked up by the request's locale, then by its language (`en-US` finds `en`), then
`name-default-locale` is used.

### Advanced

#### Restrict Apps to an Authority

An app with an `authority` is only shown to users having this authority. Users who are not logged in
only see apps without an `authority`.

```yaml
launchpad:
apps[0]:
authority: ROLE_ADMIN
```

#### Tenant-specific URLs

With tenancy enabled, `{tenantId}` in an app URL is replaced by the id of the current tenant.

```yaml
launchpad:
tenant:
enabled: true
default-supplier:
id: my-tenant # defaults to "default"
apps[0]:
url: https://{tenantId}.example.org
```

To determine the tenant yourself, set `launchpad.tenant.default-supplier.enabled: false` and provide a
`TenantSupplier` bean. To build app URLs completely on your own, provide a `LaunchpadAppUrlCustomizer`
bean instead. Apps whose URL cannot be built are left out and logged as a warning.

#### Launchpad on Error Pages

Create a custom `ErrorControllerAdvice` and use the `LaunchpadModelAttributeAppender`
Expand Down Expand Up @@ -70,6 +114,15 @@ You can inject `HttpServletRequest` to check the requested URL with
`LaunchpadModelAttributeAppender` if the requested URL matches your condition.


## Upgrading from 3.x to 4.x

- Java 25 is required.
- Launchpad registers itself as Spring Boot auto-configuration. Remove any `@Import` or
`@ComponentScan` of `LaunchpadAutoConfiguration` or `LaunchpadTenantConfiguration`.
- `AppDto` is a record: Java code calling `getUrl()`, `getName()` or `getIcon()` has to use `url()`,
`name()` and `icon()`. Templates using `app.url` etc. keep working.


## License

Launchpad is Open Source software released under the [Apache License 2.0](LICENSE).
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</scm>

<properties>
<revision>3.6.0-SNAPSHOT</revision>
<revision>4.0.0-SNAPSHOT</revision>
<java.version>25</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand Down