Skip to content

Commit 4949cce

Browse files
update documentation for actions and custom setup; enhance clarity and provide examples
Signed-off-by: Mario Serrano <mario@dynamiasoluciones.com>
1 parent 2cd953f commit 4949cce

5 files changed

Lines changed: 116 additions & 4 deletions

File tree

astro.config.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ export default defineConfig({
2020
dark: './src/assets/dynamia-tools-dark.svg',
2121
replacesTitle: true,
2222
},
23-
favicon: './src/assets/favicon.png',
23+
favicon: '/images/favicon.png',
24+
head: [
25+
{
26+
tag: 'link',
27+
attrs: {
28+
rel: 'icon',
29+
href: '/images/favicon.png',
30+
sizes: '32x32',
31+
},
32+
},
33+
],
2434
customCss: [
2535
'./src/styles/custom.css'
2636
],

public/favicon.png

31.2 KB
Loading

public/icon.png

31.2 KB
Loading

src/content/docs/custom-setup.mdx

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,97 @@
22
title: Custom Setup
33
---
44

5-
TODO
5+
The standard setup using the Spring Boot starter works for most users, but if you need more control over the configuration, you can use a custom setup.
6+
To create a custom setup, follow these steps:
7+
8+
You can add only the dependencies you need to your `pom.xml`. For example, if you only need the domain-jpa module:
9+
10+
```xml
11+
<dependency>
12+
<groupId>tools.dynamia</groupId>
13+
<artifactId>tools.dynamia.domain-jpa</artifactId>
14+
<version>LATEST_VERSION</version>
15+
</dependency>
16+
```
17+
18+
Suppose you have a multi-module project with the following structure:
19+
20+
```
21+
my-app
22+
├── core
23+
├── ui
24+
├── boot
25+
└── pom.xml
26+
```
27+
28+
The `core` module could contain only domain-related dependencies:
29+
30+
```xml
31+
<dependency>
32+
<groupId>tools.dynamia</groupId>
33+
<artifactId>tools.dynamia.domain-jpa</artifactId>
34+
<version>LATEST_VERSION</version>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>tools.dynamia</groupId>
39+
<artifactId>tools.dynamia.integration</artifactId>
40+
<version>LATEST_VERSION</version>
41+
</dependency>
42+
```
43+
44+
The `ui` module could contain only UI-related dependencies:
45+
46+
```xml
47+
<dependency>
48+
<groupId>tools.dynamia</groupId>
49+
<artifactId>tools.dynamia.crud</artifactId>
50+
<version>LATEST_VERSION</version>
51+
</dependency>
52+
```
53+
54+
And the `boot` module could contain the Spring Boot-related dependencies:
55+
56+
```xml
57+
<dependency>
58+
<groupId>tools.dynamia</groupId>
59+
<artifactId>tools.dynamia.app</artifactId>
60+
<version>LATEST_VERSION</version>
61+
</dependency>
62+
```
63+
64+
Finally, in your main application class, you need to enable Dynamia by adding the `@EnableDynamiaTools` annotation:
65+
66+
```java
67+
import org.springframework.boot.SpringApplication;
68+
import org.springframework.boot.autoconfigure.SpringBootApplication;
69+
import tools.dynamia.app.EnableDynamiaTools;
70+
71+
@SpringBootApplication
72+
@EnableDynamiaTools // <- this is all you need
73+
public class MyApplication {
74+
75+
public static void main(String[] args) {
76+
SpringApplication.run(MyApplication.class, args);
77+
}
78+
79+
}
80+
```
81+
82+
You can provide custom configuration in your `application.yml` or `application.properties` file:
83+
84+
```yaml
85+
spring:
86+
dynamia:
87+
app:
88+
base-package: com.mycompany.myapp
89+
name: My Application
90+
version: @project.version@
91+
```
92+
93+
### Additional Tips
94+
95+
- Make sure to use the correct version for each dependency.
96+
- You can further customize your modules by adding or removing dependencies as needed.
97+
- For advanced configuration, refer to the official Dynamia documentation.
98+
- DynamiaTools is a typical Spring Boot application, so you can use all Spring Boot features and configurations.
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
---
2-
title: Actions
2+
title: How Actions Work
33

44
---
55

6-
TODO
6+
Actions are a core concept in DynamiaTools, providing a way to encapsulate behavior and logic that can be reused across different parts of an application. They are designed to be flexible and can be associated with various UI components, such as buttons, menu items, or context menus.
7+
8+
## Defining Actions
9+
To define an action, you typically create a class that extends `AbstractAction` or implements the `Action` interface. Here's a simple example of an action that prints a message to the console:
10+
11+
```java
12+
import tools.dynamia.actions.AbstractAction;
13+
import tools.dynamia.actions.ActionEvent;
14+
import tools.dynamia.actions.Action;
15+

0 commit comments

Comments
 (0)