diff --git a/docs/web/adding-license-key.md b/docs/web/adding-license-key.md
index f6954d3d..f1946982 100644
--- a/docs/web/adding-license-key.md
+++ b/docs/web/adding-license-key.md
@@ -47,9 +47,11 @@ services.AddMvc().AddReveal(builder =>
```java
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setLicense("LICENSE_KEY").
- build());
+new RevealServerBuilder()
+ .addSettings(settings -> {
+ settings.setLicense("LICENSE_KEY");
+ })
+ .build();
```
diff --git a/docs/web/authentication.md b/docs/web/authentication.md
index 6d6f9e62..0f33493a 100644
--- a/docs/web/authentication.md
+++ b/docs/web/authentication.md
@@ -75,9 +75,9 @@ builder.Services.AddControllers().AddReveal( builder =>
```java
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setAuthProvider(new AuthenticationProvider()).
- build());
+new RevealServerBuilder()
+ .setAuthenticationProvider(new AuthenticationProvider())
+ .build();
```
@@ -538,4 +538,4 @@ const authenticationProvider = async (userContext:IRVUserContext | null, dataSou
The `RVAmazonWebServicesCredentials` is supported for the following data sources:
- Amazon Athena
-- Amazon S3
\ No newline at end of file
+- Amazon S3
diff --git a/docs/web/configure-export.md b/docs/web/configure-export.md
index 47195bc2..64f8ceba 100644
--- a/docs/web/configure-export.md
+++ b/docs/web/configure-export.md
@@ -95,9 +95,9 @@ Step 4 - While initializing Reveal, set the directory where you extracted the zi
```java
String exportToolDir = "
";
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setExportToolContainerPath(exportToolDir).
- build());
+new RevealServerBuilder()
+ .addSettings(settings -> settings.setExportToolContainerPath(exportToolDir))
+ .build();
```
Alternatively, you can specify the directory through the system property **reveal.exportToolContainerPath**, as shown below:
diff --git a/docs/web/datasources.md b/docs/web/datasources.md
index 211eb46f..45041221 100644
--- a/docs/web/datasources.md
+++ b/docs/web/datasources.md
@@ -291,9 +291,9 @@ builder.Services.AddControllers().AddReveal( builder =>
```java
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setDataSourceProvider(new DataSourceProvider()).
- build());
+new RevealServerBuilder()
+ .setDataSourceProvider(new DataSourceProvider())
+ .build();
```
diff --git a/docs/web/getting-started-spring-boot-jersey.md b/docs/web/getting-started-spring-boot-jersey.md
deleted file mode 100644
index c700072b..00000000
--- a/docs/web/getting-started-spring-boot-jersey.md
+++ /dev/null
@@ -1,268 +0,0 @@
-# Setting up the Reveal SDK Server with Spring Boot and Jersey
-
-## Step 1 - Create a Spring Boot with Jersey Project
-
-The steps below describe how to create a new Java Spring Boot with Jersey project. If you want to add the Reveal SDK to an existing application, go to Step 2.
-
-To develop a Spring Boot application in Visual Studio Code, you need to install the following:
-- [Development Kit (JDK)](https://www.microsoft.com/openjdk)
-- [Extension Pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack)
-- [Spring Boot Extension Pack](https://marketplace.visualstudio.com/items?itemName=pivotal.vscode-boot-dev-pack)
-
-More information about how to get started with Visual Studio Code and Java can be found at [Getting Started with Java](https://code.visualstudio.com/docs/java/java-tutorial) tutorial.
-
-1 - Start Visual Studio Code, open the Command Palette and type **>Spring Initializr: Create a Maven Project** and press **Enter**.
-
-
-
-2 - Select the Spring Boot version **3.3.2**.
-
-
-
-:::caution
-Version 2.x is not supported since Reveal 1.7.x
-:::
-
-3 - Select **Java** as the language.
-
-
-
-4 - Provide the Group Id. In this example, we are using **com.server**.
-
-
-
-5 - Provide the Artifact Id. In this example we are using **reveal**.
-
-
-
-6 - Select the **War** package type.
-
-
-
-7 - Select the Java version. For Spring Boot 3.x, we need to use at least **17**.
-
-
-
-8 - Choose the **Spring Web** and **Jersey** dependencies.
-
-
-
-9 - Save and open the newly created project.
-
-
-
-## Step 2 - Add Reveal SDK
-
-1 - Update the **pom.xml** file.
-
-First, add the Reveal Maven repository.
-
-```xml title="pom.xml"
-
-
- reveal.public
- https://maven.revealbi.io/repository/public
-
-
-```
-
-Next, add the Reveal SDK as a dependency.
-
-```xml title="pom.xml"
-
- com.infragistics.reveal.sdk
- reveal-sdk
- [var:sdkVersion]
-
-```
-
-2 - Create a Jersey Config class and initialize the Reveal SDK by calling the `RevealEngineInitializer.initialize` method. In order for the Reveal SDK to function properly with Jersey, we need to register all of the Reveal SDK classes with Jersey. To register the Reveal SDK classes, loop through the classes returned by the `RevealEngineInitializer.getClassesToRegister` method, and register them with the Jersey Config.
-
-```java title="RevealJerseyConfig.java"
-import org.glassfish.jersey.server.ResourceConfig;
-import org.springframework.stereotype.Component;
-
-import com.infragistics.reveal.engine.init.InitializeParameterBuilder;
-import com.infragistics.reveal.engine.init.RevealEngineInitializer;
-
-import javax.ws.rs.ApplicationPath;
-
-@Component
-@ApplicationPath("/")
-public class RevealJerseyConfig extends ResourceConfig
-{
- public RevealJerseyConfig()
- {
- RevealEngineInitializer.initialize();
-
- //register all Reveal classes in JAX-RS context
- for (Class> clazz : RevealEngineInitializer.getClassesToRegister()) {
- register(clazz);
- }
- }
-}
-```
-
-## Step 3 - Create Dashboard Provider
-
-1 - In Visual Studio Code, select the **resources** folder and then click the New Folder button in the Explorer. Name the new folder **dashboards**.
-
-
-
-2 - Next, create a dashboard provider that will load the Reveal dashboards from the newly created **dashboards** folder.
-
-```java title="RevealDashboardProvider.java"
-import com.infragistics.reveal.sdk.api.IRVUserContext;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import com.infragistics.reveal.sdk.api.IRVDashboardProvider;
-
-public class RevealDashboardProvider implements IRVDashboardProvider {
-
- @Override
- public InputStream getDashboard(IRVUserContext userContext, String dashboardId) throws IOException {
- InputStream dashboardStream = getClass().getResourceAsStream("/dashboards/" + dashboardId + ".rdash");
- return dashboardStream;
- }
-
- @Override
- public void saveDashboard(IRVUserContext arg0, String arg1, InputStream arg2) throws IOException {
-
- }
-}
-```
-
-3 - Finally, register the Dashboard Provider with the `RevealEngineInitializer` in the `RevealJerseyConfig` class.
-
-```java title="RevealJerseyConfig.java"
-@Component
-@ApplicationPath("/")
-public class RevealJerseyConfig extends ResourceConfig
-{
- public RevealJerseyConfig()
- {
- RevealEngineInitializer.initialize(new InitializeParameterBuilder()
- // highlight-next-line
- .setDashboardProvider(new RevealDashboardProvider())
- .build());
-
- //register all Reveal classes in JAX-RS context
- for (Class> clazz : RevealEngineInitializer.getClassesToRegister()) {
- register(clazz);
- }
- }
-}
-```
-
-## Step 4 - Setup CORs Policy (Debugging)
-
-While developing and debugging your application, it is common to host the server and client app on different URLs. For example; your Server my be running on `https://localhost:24519`, while your Angular app may be running on `https://localhost:4200`. If you were to try and load a dashboard from the client application, it would fail because of a Cross-Origin Resource Sharing (CORS) policy. To enable this scenario, you must create a CORS policy and enable it in the server project.
-
-1 - Create a CorsFilter
-
-```java title="CorsFilter.java"
-import java.io.IOException;
-
-import jakarta.ws.rs.container.ContainerRequestContext;
-import jakarta.ws.rs.container.ContainerRequestFilter;
-import jakarta.ws.rs.container.ContainerResponseContext;
-import jakarta.ws.rs.container.ContainerResponseFilter;
-import jakarta.ws.rs.container.PreMatching;
-import jakarta.ws.rs.core.Response;
-
-@PreMatching
-public class CorsFilter implements ContainerRequestFilter, ContainerResponseFilter {
-
- /**
- * Method for ContainerRequestFilter.
- */
- @Override
- public void filter(ContainerRequestContext request) throws IOException {
-
- // If it's a preflight request, we abort the request with
- // a 200 status, and the CORS headers are added in the
- // response filter method below.
- if (isPreflightRequest(request)) {
- request.abortWith(Response.ok().build());
- return;
- }
- }
-
- /**
- * A preflight request is an OPTIONS request
- * with an Origin header.
- */
- private static boolean isPreflightRequest(ContainerRequestContext request) {
- return request.getHeaderString("Origin") != null
- && request.getMethod().equalsIgnoreCase("OPTIONS");
- }
-
- /**
- * Method for ContainerResponseFilter.
- */
- @Override
- public void filter(ContainerRequestContext request, ContainerResponseContext response)
- throws IOException {
-
- // if there is no Origin header, then it is not a
- // cross origin request. We don't do anything.
- if (request.getHeaderString("Origin") == null) {
- return;
- }
-
-
- // If it is a preflight request, then we add all
- // the CORS headers here.
- if (isPreflightRequest(request)) {
- response.getHeaders().add("Access-Control-Allow-Credentials", "true");
- response.getHeaders().add("Access-Control-Allow-Methods",
- "GET, POST, PUT, DELETE, OPTIONS, HEAD");
- response.getHeaders().add("Access-Control-Allow-Headers",
- // Whatever other non-standard/safe headers (see list above)
- // you want the client to be able to send to the server,
- // put it in this list. And remove the ones you don't want.
- "X-Requested-With, Authorization, " +
- "Accept-Version, Content-MD5, CSRF-Token, Content-Type");
- }
-
- // Cross origin requests can be either simple requests
- // or preflight request. We need to add this header
- // to both type of requests. Only preflight requests
- // need the previously added headers.
- response.getHeaders().add("Access-Control-Allow-Origin", "*");
- }
-}
-```
-
-2 - Register the `CorsFilter` in the `RevealJerseyConfig` class.
-
-```java title="RevealJerseyConfig.java"
-@Component
-@ApplicationPath("/")
-public class RevealJerseyConfig extends ResourceConfig
-{
- public RevealJerseyConfig()
- {
- RevealEngineInitializer.initialize(new InitializeParameterBuilder()
- .setDashboardProvider(new RevealDashboardProvider())
- .build());
-
- //register all Reveal classes in JAX-RS context
- for (Class> clazz : RevealEngineInitializer.getClassesToRegister()) {
- register(clazz);
- }
-
- //register the cors filter for debugging
- // highlight-next-line
- register(CorsFilter.class);
- }
-}
-```
-
-:::info Get the Code
-
-The source code to this sample can be found on [GitHub](https://github.com/RevealBi/sdk-samples-javascript/tree/main/01-GettingStarted/server/spring-boot-jersey).
-
-:::
\ No newline at end of file
diff --git a/docs/web/getting-started-spring-boot.md b/docs/web/getting-started-spring-boot.md
new file mode 100644
index 00000000..72b86d95
--- /dev/null
+++ b/docs/web/getting-started-spring-boot.md
@@ -0,0 +1,143 @@
+# Setting up the Reveal SDK Server with Spring Boot
+
+## Step 1 - Create a Spring Boot Project
+
+The steps below describe how to create a new Java Spring Boot project. If you want to add the Reveal SDK to an existing application, go to Step 2.
+
+To develop a Spring Boot application in Visual Studio Code, you need to install the following:
+- [Development Kit (JDK)](https://www.microsoft.com/openjdk)
+- [Extension Pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack)
+- [Spring Boot Extension Pack](https://marketplace.visualstudio.com/items?itemName=pivotal.vscode-boot-dev-pack)
+
+More information about how to get started with Visual Studio Code and Java can be found at the [Getting Started with Java](https://code.visualstudio.com/docs/java/java-tutorial) tutorial.
+
+1 - Start Visual Studio Code, open the Command Palette and type **>Spring Initializr: Create a Maven Project** and press **Enter**.
+
+
+
+2 - Select the Spring Boot version **3.3.2**.
+
+
+
+:::caution
+Version 2.x is not supported since Reveal 1.7.x
+:::
+
+3 - Select **Java** as the language.
+
+
+
+4 - Provide the Group Id. In this example, we are using **com.server**.
+
+
+
+5 - Provide the Artifact Id. In this example, we are using **reveal**.
+
+
+
+6 - Select the **War** package type.
+
+
+
+7 - Select the Java version. For Spring Boot 3.x, we need to use at least **17**.
+
+
+
+8 - Choose the **Spring Web** dependency.
+
+9 - Save and open the newly created project.
+
+
+
+## Step 2 - Add Reveal SDK
+
+The Java SDK requires Java 17 or higher and a Jakarta EE 9 compliant server. The supported platforms are Linux, Windows, and macOS, with both x64 and arm64 architectures. Also, if you use Jetty as your server, its version might conflict with the Jetty version used internally by Reveal SDK, which is currently 12.0.12.
+
+1 - Update the **pom.xml** file.
+
+First, add the Reveal Maven repository.
+
+```xml title="pom.xml"
+
+
+ reveal.public
+ https://maven.revealbi.io/repository/public
+
+
+```
+
+Next, add the Reveal SDK as a dependency.
+
+```xml title="pom.xml"
+
+ io.revealbi
+ reveal-sdk-servlet
+ [var:sdkVersion]
+
+```
+
+2 - Register `RevealEngineServlet` as a Spring Boot servlet. Replace the sample provider classes with your application's implementations. If you need to pass request-based properties to the user context, replace `null` with a `Properties` object built from the request.
+
+```java title="Application.java"
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+
+ @Bean
+ ServletRegistrationBean revealServlet() {
+ RevealEngineServlet revealEngineServlet = new RevealEngineServlet(() -> new RevealServerBuilder()
+ .setAuthenticationProvider(new MyIRVAuthenticationProvider())
+ .setDashboardProvider(new RVDashboardProvider("c:\\your-path"))
+ .setDataSourceProvider(new MyIRVDataSourceProvider())
+ .addSettings(settings -> {
+ // settings.setLicense("your license or remove to use ~/.revealbi-sdk/license.key");
+ })
+ .build(), request -> new RVUserContext("whatever", null /* replace null with a Properties built from the request if needed */));
+
+ return new ServletRegistrationBean<>(revealEngineServlet, "/reveal-api/*");
+ }
+}
+```
+
+## Step 3 - Create Dashboards Folder
+
+1 - Create a folder for your dashboards.
+
+2 - Configure `RVDashboardProvider` with the folder that contains your dashboards.
+
+```java title="Application.java"
+new RevealServerBuilder()
+ .setDashboardProvider(new RVDashboardProvider("c:\\your-path"))
+ .build();
+```
+
+## Step 4 - Setup CORS Policy (Debugging)
+
+While developing and debugging your application, it is common to host the server and client app on different URLs. For example, your server may be running on `https://localhost:8080`, while your Angular app may be running on `https://localhost:4200`. If you try to load a dashboard from the client application, it will fail because of a Cross-Origin Resource Sharing (CORS) policy. To enable this scenario for the Reveal servlet endpoint, add a servlet CORS filter bean to your `Application.java`:
+
+```java title="Application.java"
+@Bean
+FilterRegistrationBean revealApiCorsFilter() {
+ CorsConfiguration config = new CorsConfiguration();
+ // DEVELOPMENT only. Do not deploy this wildcard localhost pattern to production.
+ // In production, replace this with your exact allowed client origins.
+ // The localhost port pattern below is supported in Spring Boot 3.x.
+ config.addAllowedOriginPattern("http://localhost:*");
+ config.addAllowedOriginPattern("https://localhost:*");
+ config.addAllowedHeader("*");
+ config.addAllowedMethod("*");
+
+ UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+ source.registerCorsConfiguration("/reveal-api/**", config);
+ return new FilterRegistrationBean<>(new CorsFilter(source));
+}
+```
+
+:::info Get the Code
+
+The source code to this sample can be found on [GitHub](https://github.com/RevealBi/sdk-samples-javascript/tree/main/01-GettingStarted/server/spring-boot).
+
+:::
diff --git a/docs/web/images/getting-started-spring-boot-jersey-artifact-id.jpg b/docs/web/images/getting-started-spring-boot-artifact-id.jpg
similarity index 100%
rename from docs/web/images/getting-started-spring-boot-jersey-artifact-id.jpg
rename to docs/web/images/getting-started-spring-boot-artifact-id.jpg
diff --git a/docs/web/images/getting-started-spring-boot-jersey-explorer.jpg b/docs/web/images/getting-started-spring-boot-explorer.jpg
similarity index 100%
rename from docs/web/images/getting-started-spring-boot-jersey-explorer.jpg
rename to docs/web/images/getting-started-spring-boot-explorer.jpg
diff --git a/docs/web/images/getting-started-spring-boot-jersey-group-id.jpg b/docs/web/images/getting-started-spring-boot-group-id.jpg
similarity index 100%
rename from docs/web/images/getting-started-spring-boot-jersey-group-id.jpg
rename to docs/web/images/getting-started-spring-boot-group-id.jpg
diff --git a/docs/web/images/getting-started-spring-boot-jersey-java-version.jpg b/docs/web/images/getting-started-spring-boot-java-version.jpg
similarity index 100%
rename from docs/web/images/getting-started-spring-boot-jersey-java-version.jpg
rename to docs/web/images/getting-started-spring-boot-java-version.jpg
diff --git a/docs/web/images/getting-started-spring-boot-jersey-dashboards-folder.jpg b/docs/web/images/getting-started-spring-boot-jersey-dashboards-folder.jpg
deleted file mode 100644
index 85f39ce8..00000000
Binary files a/docs/web/images/getting-started-spring-boot-jersey-dashboards-folder.jpg and /dev/null differ
diff --git a/docs/web/images/getting-started-spring-boot-jersey-dependencies.jpg b/docs/web/images/getting-started-spring-boot-jersey-dependencies.jpg
deleted file mode 100644
index 827f2a0a..00000000
Binary files a/docs/web/images/getting-started-spring-boot-jersey-dependencies.jpg and /dev/null differ
diff --git a/docs/web/images/getting-started-spring-boot-jersey-language.jpg b/docs/web/images/getting-started-spring-boot-language.jpg
similarity index 100%
rename from docs/web/images/getting-started-spring-boot-jersey-language.jpg
rename to docs/web/images/getting-started-spring-boot-language.jpg
diff --git a/docs/web/images/getting-started-spring-boot-jersey-package-type.jpg b/docs/web/images/getting-started-spring-boot-package-type.jpg
similarity index 100%
rename from docs/web/images/getting-started-spring-boot-jersey-package-type.jpg
rename to docs/web/images/getting-started-spring-boot-package-type.jpg
diff --git a/docs/web/images/getting-started-spring-boot-jersey-project.jpg b/docs/web/images/getting-started-spring-boot-project.jpg
similarity index 100%
rename from docs/web/images/getting-started-spring-boot-jersey-project.jpg
rename to docs/web/images/getting-started-spring-boot-project.jpg
diff --git a/docs/web/images/getting-started-spring-boot-jersey-version.jpg b/docs/web/images/getting-started-spring-boot-version.jpg
similarity index 100%
rename from docs/web/images/getting-started-spring-boot-jersey-version.jpg
rename to docs/web/images/getting-started-spring-boot-version.jpg
diff --git a/docs/web/install-server-sdk.md b/docs/web/install-server-sdk.md
index af26fd8a..49291aa3 100644
--- a/docs/web/install-server-sdk.md
+++ b/docs/web/install-server-sdk.md
@@ -1,4 +1,4 @@
-# Installing the Server SDK
+# Installing the Server SDK
## ASP.NET
@@ -61,6 +61,8 @@ By default, the Reveal SDK uses a convention that will load all dashboards from
The steps below describe how to install the Reveal SDK into an existing Java application.
+The Java SDK requires Java 17 or higher and a Jakarta EE 9 compliant server. Supported platforms are Windows, Linux, and macOS, in both x64 and ARM64 for all three. Also, if you use Jetty as your server, its version might conflict with the Jetty version used internally by Reveal SDK, which is currently 12.0.12.
+
1 - Update the **pom.xml** file, and add the Reveal Maven repository.
```xml title="pom.xml"
@@ -76,81 +78,65 @@ The steps below describe how to install the Reveal SDK into an existing Java app
```xml title="pom.xml"
- com.infragistics.reveal.sdk
- reveal-sdk
+ io.revealbi
+ reveal-sdk-servlet
[var:sdkVersion]
```
-### Spring Boot - Jersey
-
-Create a Jersey Config class and initialize the Reveal SDK by calling the `RevealEngineInitializer.initialize` method. In order for the Reveal SDK to function properly with Jersey, we need to register all of the Reveal SDK classes with Jersey. To register the Reveal SDK classes, loop through the classes returned by the `RevealEngineInitializer.getClassesToRegister` method, and register them with the Jersey Config.
+### Spring Boot
-```java title="RevealJerseyConfig.java"
-import org.glassfish.jersey.server.ResourceConfig;
-import org.springframework.stereotype.Component;
+Register `RevealEngineServlet` as a Spring Boot servlet. Replace the sample provider classes with your application's implementations. If you need to pass request-based properties to the user context, replace `null` with a `Properties` object built from the request.
-import com.infragistics.reveal.engine.init.RevealEngineInitializer;
+```java title="Application.java"
+@SpringBootApplication
+public class Application {
-import javax.ws.rs.ApplicationPath;
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
-@Component
-@ApplicationPath("/")
-public class RevealJerseyConfig extends ResourceConfig
-{
- public RevealJerseyConfig()
- {
- RevealEngineInitializer.initialize();
-
- //register all Reveal classes in JAX-RS context
- for (Class> clazz : RevealEngineInitializer.getClassesToRegister()) {
- register(clazz);
- }
+ @Bean
+ ServletRegistrationBean revealServlet() {
+ RevealEngineServlet revealEngineServlet = new RevealEngineServlet(() -> new RevealServerBuilder()
+ // Replace these sample providers with your application's implementations.
+ .setAuthenticationProvider(new MyIRVAuthenticationProvider())
+ .setDashboardProvider(new RVDashboardProvider("c:\\your-path"))
+ .setDataSourceProvider(new MyIRVDataSourceProvider())
+ .addSettings(settings -> {
+ // settings.setLicense("your license or remove to use ~/.revealbi-sdk/license.key");
+ })
+ .build(), request -> new RVUserContext("whatever", null /* replace null with a Properties built from the request if needed */));
+
+ return new ServletRegistrationBean<>(revealEngineServlet, "/reveal-api/*");
}
}
```
### Tomcat
-1 - Add a dependency to a Jakarta RESTful Web Services (JAX-RS) implementation. You can choose between multiple options like Jersey, RESTeasy, Apache CXF, etc. Please follow the steps described by the provider of your preference.
-
-As an example, here the dependencies you need to add for Jersey:
-
-```xml
-
- org.glassfish.jersey.containers
- jersey-container-servlet
- 2.32
-
-
- org.glassfish.jersey.inject
- jersey-cdi2-se
- 2.32
-
-```
-
-2 - Create a ServletContextListener class and initialize the Reveal SDK by calling the `RevealEngineInitializer.initialize` method.
+Use a Jakarta EE 9 compliant servlet container, such as Tomcat 10 or later. Create a `ServletContextListener` class and register `RevealEngineServlet`. Replace the sample provider classes with your application's implementations. If you need to pass request-based properties to the user context, replace `null` with a `Properties` object built from the request.
```java
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.annotation.WebListener;
-
-import com.infragistics.reveal.engine.init.RevealEngineInitializer;
-
@WebListener
-public class RevealServletContextListener implements ServletContextListener {
+public class AppInitializer implements ServletContextListener {
@Override
- public void contextDestroyed(ServletContextEvent ctx) {
-
- }
-
- @Override
- public void contextInitialized(ServletContextEvent ctx) {
-
- //initialize Reveal
- RevealEngineInitializer.initialize();
+ public void contextInitialized(ServletContextEvent sce) {
+ RevealEngineServlet revealEngineServlet = new RevealEngineServlet(() -> new RevealServerBuilder()
+ // Replace these sample providers with your application's implementations.
+ .setAuthenticationProvider(new MyIRVAuthenticationProvider())
+ .setDashboardProvider(new RVDashboardProvider("c:\\your-path"))
+ .setDataSourceProvider(new MyIRVDataSourceProvider())
+ .addSettings(settings -> {
+ // settings.setLicense("your license or remove to use ~/.revealbi-sdk/license.key");
+ })
+ .build(), request -> new RVUserContext("whatever", null /* replace null with a Properties built from the request if needed */));
+
+ ServletRegistration.Dynamic reg = sce.getServletContext().addServlet("myServlet", revealEngineServlet);
+ reg.setAsyncSupported(true);
+ reg.addMapping("/reveal-api/*");
}
}
-```
\ No newline at end of file
+```
+
diff --git a/docs/web/loading-dashboards.md b/docs/web/loading-dashboards.md
index 50929df7..6ef0ba88 100644
--- a/docs/web/loading-dashboards.md
+++ b/docs/web/loading-dashboards.md
@@ -133,9 +133,9 @@ builder.Services.AddControllers().AddReveal( builder =>
```java
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setDashboardProvider(new DashboardProvider()).
- build());
+new RevealServerBuilder()
+ .setDashboardProvider(new DashboardProvider())
+ .build();
```
diff --git a/docs/web/release-notes.md b/docs/web/release-notes.md
index 4def8579..52764ba4 100644
--- a/docs/web/release-notes.md
+++ b/docs/web/release-notes.md
@@ -17,6 +17,12 @@ import TabItem from '@theme/TabItem';
#### Node
- The `dateFilter` property on headless export options is deprecated. Use the `filters` array with `RVDateRule` instead.
+#### Java
+- The Java SDK now requires Java 17 or higher.
+- The Java SDK now uses the `io.revealbi:reveal-sdk-servlet` Maven artifact and a servlet-based setup with `RevealEngineServlet`.
+- The Java SDK supports Linux, Windows, and macOS, with both x64 and arm64 architectures.
+- If you use Jetty as your server, its version might conflict with the Jetty version used internally by Reveal SDK, which is currently 12.0.12.
+
### New Features
#### All Platforms
@@ -34,6 +40,7 @@ import TabItem from '@theme/TabItem';
- Data agent connection recovery has been improved to handle network interruptions more reliably.
#### Java
+- The Java SDK now has feature parity with the .NET SDK for connectors and extension points, with the exception of `InMemoryDataProvider`, which will be ported to Java in a future release.
- The Java SDK now supports Redis caching via `RVRedisOptions`.
- `DefaultDashboardTheme` is now supported.
- Headless export now supports CSV format.
@@ -121,4 +128,3 @@ exportOptions.filters = [new RVDateRule(RVPeriodType.Year, RVPeriodRelation.ToDa
- A regression caused `filterValueChangedEvent` to not fire correctly.
- The "titles in first row" parameter for Excel data source items was being incorrectly set.
- Missing title in the datasource selector dialog.
-
diff --git a/docs/web/replacing-datasources.md b/docs/web/replacing-datasources.md
index b8fd7c2e..6d675b08 100644
--- a/docs/web/replacing-datasources.md
+++ b/docs/web/replacing-datasources.md
@@ -81,9 +81,9 @@ builder.Services.AddControllers().AddReveal( builder =>
```java
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setDataSourceProvider(new DataSourceProvider()).
- build());
+new RevealServerBuilder()
+ .setDataSourceProvider(new DataSourceProvider())
+ .build();
```
diff --git a/docs/web/user-context.md b/docs/web/user-context.md
index 75beddaa..d45bd391 100644
--- a/docs/web/user-context.md
+++ b/docs/web/user-context.md
@@ -97,9 +97,9 @@ Follow these steps to implement the `UserContextProvider`.
```java
- RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setUserContextProvider(new UserContextProvider()).
- build());
+ new RevealServerBuilder()
+ .setUserContextProvider(new UserContextProvider())
+ .build();
```
diff --git a/i18n/en/docusaurus-plugin-content-docs/current.json b/i18n/en/docusaurus-plugin-content-docs/current.json
index ce73ac0f..30bd5b6a 100644
--- a/i18n/en/docusaurus-plugin-content-docs/current.json
+++ b/i18n/en/docusaurus-plugin-content-docs/current.json
@@ -19,9 +19,9 @@
"message": "Node.js - TypeScript",
"description": "The label for the doc item 'Node.js - TypeScript' in sidebar 'webSidebar', linking to the doc web/getting-started-server-node-typescript"
},
- "sidebar.webSidebar.doc.Spring Boot - Jersey": {
- "message": "Spring Boot - Jersey",
- "description": "The label for the doc item 'Spring Boot - Jersey' in sidebar 'webSidebar', linking to the doc web/getting-started-spring-boot-jersey"
+ "sidebar.webSidebar.doc.Spring Boot": {
+ "message": "Spring Boot",
+ "description": "The label for the doc item 'Spring Boot' in sidebar 'webSidebar', linking to the doc web/getting-started-spring-boot"
},
"sidebar.webSidebar.doc.Angular": {
"message": "Angular",
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current.json b/i18n/ja/docusaurus-plugin-content-docs/current.json
index e7a43a4b..ce110122 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current.json
+++ b/i18n/ja/docusaurus-plugin-content-docs/current.json
@@ -19,9 +19,9 @@
"message": "Node.js - TypeScript",
"description": "The label for the doc item 'Node.js - TypeScript' in sidebar 'webSidebar', linking to the doc web/getting-started-server-node-typescript"
},
- "sidebar.webSidebar.doc.Spring Boot - Jersey": {
- "message": "Spring Boot - Jersey",
- "description": "The label for the doc item 'Spring Boot - Jersey' in sidebar 'webSidebar', linking to the doc web/getting-started-spring-boot-jersey"
+ "sidebar.webSidebar.doc.Spring Boot": {
+ "message": "Spring Boot",
+ "description": "The label for the doc item 'Spring Boot' in sidebar 'webSidebar', linking to the doc web/getting-started-spring-boot"
},
"sidebar.webSidebar.doc.Angular": {
"message": "Angular",
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/adding-license-key.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/adding-license-key.md
index a045abbd..80c71778 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/adding-license-key.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/adding-license-key.md
@@ -47,9 +47,11 @@ services.AddMvc().AddReveal(builder =>
```java
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setLicense("LICENSE_KEY").
- build());
+new RevealServerBuilder()
+ .addSettings(settings -> {
+ settings.setLicense("LICENSE_KEY");
+ })
+ .build();
```
@@ -75,4 +77,4 @@ app.use("/", reveal(revealOptions));
```
-
\ No newline at end of file
+
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/authentication.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/authentication.md
index c97274fc..20bf59e6 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/authentication.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/authentication.md
@@ -75,9 +75,9 @@ builder.Services.AddControllers().AddReveal( builder =>
```java
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setAuthProvider(new AuthenticationProvider()).
- build());
+new RevealServerBuilder()
+ .setAuthenticationProvider(new AuthenticationProvider())
+ .build();
```
@@ -537,4 +537,4 @@ const authenticationProvider = async (userContext:IRVUserContext | null, dataSou
`RVAmazonWebServicesCredentials` は、次のデータ ソースでサポートされています。
- Amazon Athena
-- Amazon S3
\ No newline at end of file
+- Amazon S3
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/configure-export.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/configure-export.md
index c850cfa7..3a941bfd 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/configure-export.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/configure-export.md
@@ -95,9 +95,9 @@ sudo apt-get install -y --allow-unauthenticated libx11-dev
```java
String exportToolDir = "";
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setExportToolContainerPath(exportToolDir).
- build());
+new RevealServerBuilder()
+ .addSettings(settings -> settings.setExportToolContainerPath(exportToolDir))
+ .build();
```
また、以下のようにシステムプロパティ **reveal.exportToolContainerPath** を通じてディレクトリを指定することもできます:
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/datasources.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/datasources.md
index 815f85b1..f99de612 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/datasources.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/datasources.md
@@ -291,9 +291,9 @@ builder.Services.AddControllers().AddReveal( builder =>
```java
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setDataSourceProvider(new DataSourceProvider()).
- build());
+new RevealServerBuilder()
+ .setDataSourceProvider(new DataSourceProvider())
+ .build();
```
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/getting-started-spring-boot-jersey.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/getting-started-spring-boot-jersey.md
deleted file mode 100644
index 698e79d6..00000000
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/getting-started-spring-boot-jersey.md
+++ /dev/null
@@ -1,270 +0,0 @@
-# Spring Boot と Jersey を使用した Reveal SDK サーバーのセットアップ
-
-## 手順 1 - Jersey プロジェクトで Spring Boot を作成する
-
-以下の手順では、Jersey プロジェクトを使用して新しい Java Spring Boot を作成する方法について説明します。既存のアプリケーションに Reveal SDK を追加する場合は、手順 2 へ移動します。
-
-Visual Studio Code で Spring Boot アプリケーションを開発するには、以下をインストールする必要があります:
-- [開発キット (JDK)](https://www.microsoft.com/openjdk)
-- [Java 用拡張パック](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack)
-- [Spring Boot 拡張パック](https://marketplace.visualstudio.com/items?itemName=pivotal.vscode-boot-dev-pack)
-
-Visual Studio Code と Java の使用を開始する方法の詳細については、[Java の使用を開始する](https://code.visualstudio.com/docs/java/java-tutorial)チュートリアルを参照してください。
-
-1 - Visual Studio Code を起動し、コマンド パレットを開いて **>Spring Initializr: Create a Maven Project** と入力し、**Enter** を押します。
-
-
-
-2 - Spring Boot バージョン **3.3.2** を選択します。
-
-
-
-:::caution
-
-バージョン 2.x は Reveal 1.7.x 以降、サポートされていません。
-
-:::
-
-3 - 言語として **Java** を選択します。
-
-
-
-4 - グループ ID を提供します。この例では、**com.server** を使用しています。
-
-
-
-5 - 成果物 ID を提供します。この例では、**reveal** を使用しています。
-
-
-
-6 - **War** パッケージ タイプを選択します。
-
-
-
-7 - Java のバージョンを選択します。Spring Boot 3.x を使用する場合、**17** 以降が必要です。
-
-
-
-8 - **Spring Web** と **Jersey** の依存関係を選択します。
-
-
-
-9 - 新しく作成したプロジェクトを保存して開きます。
-
-
-
-## 手順 2 - Reveal SDK の追加
-
-1 - **pom.xml** ファイルを更新します。
-
-まず、Reveal Maven リポジトリを追加します。
-
-```xml title="pom.xml"
-
-
- reveal.public
- https://maven.revealbi.io/repository/public
-
-
-```
-
-次に、Reveal SDK を依存関係として追加します。
-
-```xml title="pom.xml"
-
- com.infragistics.reveal.sdk
- reveal-sdk
- [var:sdkVersion]
-
-```
-
-2 - Jersey Config クラスを作成し、`RevealEngineInitializer.initialize` メソッドを呼び出して Reveal SDK を初期化します。Reveal SDK が Jersey で適切に機能するには、すべての Reveal SDK クラスを Jersey に登録する必要があります。Reveal SDK クラスを登録するには、`RevealEngineInitializer.getClassesToRegister` メソッドによって返されたクラスをループして、Jersey Config に登録します。
-
-```java title="RevealJerseyConfig.java"
-import org.glassfish.jersey.server.ResourceConfig;
-import org.springframework.stereotype.Component;
-
-import com.infragistics.reveal.engine.init.InitializeParameterBuilder;
-import com.infragistics.reveal.engine.init.RevealEngineInitializer;
-
-import javax.ws.rs.ApplicationPath;
-
-@Component
-@ApplicationPath("/")
-public class RevealJerseyConfig extends ResourceConfig
-{
- public RevealJerseyConfig()
- {
- RevealEngineInitializer.initialize();
-
- //register all Reveal classes in JAX-RS context
- for (Class> clazz : RevealEngineInitializer.getClassesToRegister()) {
- register(clazz);
- }
- }
-}
-```
-
-## 手順 3 - ダッシュボード プロバイダーの作成
-
-1 - Visual Studio Code で **resources** フォルダーを選択し、エクスプローラーで [新しいフォルダー] ボタンをクリックします。新しいフォルダーに **dashboards** という名前を付けます。
-
-
-
-2 - 次に、新しく作成された **dashboards** フォルダーから Reveal ダッシュボードを読み込むダッシュボード プロバイダーを作成します。
-
-```java title="RevealDashboardProvider.java"
-import com.infragistics.reveal.sdk.api.IRVUserContext;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import com.infragistics.reveal.sdk.api.IRVDashboardProvider;
-
-public class RevealDashboardProvider implements IRVDashboardProvider {
-
- @Override
- public InputStream getDashboard(IRVUserContext userContext, String dashboardId) throws IOException {
- InputStream dashboardStream = getClass().getResourceAsStream("/dashboards/" + dashboardId + ".rdash");
- return dashboardStream;
- }
-
- @Override
- public void saveDashboard(IRVUserContext arg0, String arg1, InputStream arg2) throws IOException {
-
- }
-}
-```
-
-3 - 最後に、`RevealJerseyConfig` クラスの `RevealEngineInitializer` を使用してダッシュボード プロバイダーを登録します。
-
-```java title="RevealJerseyConfig.java"
-@Component
-@ApplicationPath("/")
-public class RevealJerseyConfig extends ResourceConfig
-{
- public RevealJerseyConfig()
- {
- RevealEngineInitializer.initialize(new InitializeParameterBuilder()
- // highlight-next-line
- .setDashboardProvider(new RevealDashboardProvider())
- .build());
-
- //register all Reveal classes in JAX-RS context
- for (Class> clazz : RevealEngineInitializer.getClassesToRegister()) {
- register(clazz);
- }
- }
-}
-```
-
-## 手順 4 - CORs ポリシー (デバッグ) の設定
-
-アプリケーションの開発とデバッグでは、サーバーとクライアント アプリを異なる URL でホストするのが一般的です。例えば、サーバーは `https://localhost:24519` で実行されている可能性がありますが、Angular アプリは `https://localhost:4200` で実行されている可能性があります。クライアント アプリケーションからダッシュボードを読み込もうとすると、Cross-Origin Resource Sharing (CORS) ポリシーが原因で失敗します。このシナリオを有効にするには、CORS ポリシーを作成し、サーバー プロジェクトで有効にする必要があります。
-
-1 - CorsFilter を作成します。
-
-```java title="CorsFilter.java"
-import java.io.IOException;
-
-import jakarta.ws.rs.container.ContainerRequestContext;
-import jakarta.ws.rs.container.ContainerRequestFilter;
-import jakarta.ws.rs.container.ContainerResponseContext;
-import jakarta.ws.rs.container.ContainerResponseFilter;
-import jakarta.ws.rs.container.PreMatching;
-import jakarta.ws.rs.core.Response;
-
-@PreMatching
-public class CorsFilter implements ContainerRequestFilter, ContainerResponseFilter {
-
- /**
- * Method for ContainerRequestFilter.
- */
- @Override
- public void filter(ContainerRequestContext request) throws IOException {
-
- // If it's a preflight request, we abort the request with
- // a 200 status, and the CORS headers are added in the
- // response filter method below.
- if (isPreflightRequest(request)) {
- request.abortWith(Response.ok().build());
- return;
- }
- }
-
- /**
- * A preflight request is an OPTIONS request
- * with an Origin header.
- */
- private static boolean isPreflightRequest(ContainerRequestContext request) {
- return request.getHeaderString("Origin") != null
- && request.getMethod().equalsIgnoreCase("OPTIONS");
- }
-
- /**
- * Method for ContainerResponseFilter.
- */
- @Override
- public void filter(ContainerRequestContext request, ContainerResponseContext response)
- throws IOException {
-
- // if there is no Origin header, then it is not a
- // cross origin request. We don't do anything.
- if (request.getHeaderString("Origin") == null) {
- return;
- }
-
-
- // If it is a preflight request, then we add all
- // the CORS headers here.
- if (isPreflightRequest(request)) {
- response.getHeaders().add("Access-Control-Allow-Credentials", "true");
- response.getHeaders().add("Access-Control-Allow-Methods",
- "GET, POST, PUT, DELETE, OPTIONS, HEAD");
- response.getHeaders().add("Access-Control-Allow-Headers",
- // Whatever other non-standard/safe headers (see list above)
- // you want the client to be able to send to the server,
- // put it in this list. And remove the ones you don't want.
- "X-Requested-With, Authorization, " +
- "Accept-Version, Content-MD5, CSRF-Token, Content-Type");
- }
-
- // Cross origin requests can be either simple requests
- // or preflight request. We need to add this header
- // to both type of requests. Only preflight requests
- // need the previously added headers.
- response.getHeaders().add("Access-Control-Allow-Origin", "*");
- }
-}
-```
-
-2 - `RevealJerseyConfig` クラスに `CorsFilter` を登録します。
-
-```java title="RevealJerseyConfig.java"
-@Component
-@ApplicationPath("/")
-public class RevealJerseyConfig extends ResourceConfig
-{
- public RevealJerseyConfig()
- {
- RevealEngineInitializer.initialize(new InitializeParameterBuilder()
- .setDashboardProvider(new RevealDashboardProvider())
- .build());
-
- //register all Reveal classes in JAX-RS context
- for (Class> clazz : RevealEngineInitializer.getClassesToRegister()) {
- register(clazz);
- }
-
- //register the cors filter for debugging
- // highlight-next-line
- register(CorsFilter.class);
- }
-}
-```
-
-:::info コードの取得
-
-このサンプルのソース コードは [GitHub](https://github.com/RevealBi/sdk-samples-javascript/tree/main/01-GettingStarted/server/spring-boot-jersey) にあります。
-
-:::
\ No newline at end of file
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/getting-started-spring-boot.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/getting-started-spring-boot.md
new file mode 100644
index 00000000..b1f89a09
--- /dev/null
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/getting-started-spring-boot.md
@@ -0,0 +1,154 @@
+# Spring Boot を使用した Reveal SDK サーバーのセットアップ
+
+## 手順 1 - Spring Boot プロジェクトを作成する
+
+以下の手順では、新しい Java Spring Boot プロジェクトを作成する方法について説明します。既存のアプリケーションに Reveal SDK を追加する場合は、手順 2 へ移動します。
+
+Visual Studio Code で Spring Boot アプリケーションを開発するには、以下をインストールする必要があります:
+- [開発キット (JDK)](https://www.microsoft.com/openjdk)
+- [Java 用拡張パック](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack)
+- [Spring Boot 拡張パック](https://marketplace.visualstudio.com/items?itemName=pivotal.vscode-boot-dev-pack)
+
+Visual Studio Code と Java の使用を開始する方法の詳細については、[Java の使用を開始する](https://code.visualstudio.com/docs/java/java-tutorial)チュートリアルを参照してください。
+
+1 - Visual Studio Code を起動し、コマンド パレットを開いて **>Spring Initializr: Create a Maven Project** と入力し、**Enter** を押します。
+
+
+
+2 - Spring Boot バージョン **3.3.2** を選択します。
+
+
+
+:::caution
+
+バージョン 2.x は Reveal 1.7.x 以降、サポートされていません。
+
+:::
+
+3 - 言語として **Java** を選択します。
+
+
+
+4 - グループ ID を提供します。この例では、**com.server** を使用しています。
+
+
+
+5 - 成果物 ID を提供します。この例では、**reveal** を使用しています。
+
+
+
+6 - **War** パッケージ タイプを選択します。
+
+
+
+7 - Java のバージョンを選択します。Spring Boot 3.x を使用する場合、**17** 以降が必要です。
+
+
+
+8 - **Spring Web** の依存関係を選択します。
+
+9 - 新しく作成したプロジェクトを保存して開きます。
+
+
+
+## 手順 2 - Reveal SDK の追加
+
+Java SDK には Java 17 以降および Jakarta EE 9 準拠サーバーが必要です。Java SDK は現在、ネイティブ .NET コンポーネントをラップしているため、AIX など、それらのコンポーネントを実行できない一部のまれなプラットフォームはサポートされていません。Jetty をサーバーとして使用する場合、そのバージョンが Reveal SDK で内部的に使用される Jetty バージョン (現在は 12.0.12) と競合する可能性があります。
+
+1 - **pom.xml** ファイルを更新します。
+
+まず、Reveal Maven リポジトリを追加します。
+
+```xml title="pom.xml"
+
+
+ reveal.public
+ https://maven.revealbi.io/repository/public
+
+
+```
+
+次に、Reveal SDK を依存関係として追加します。
+
+```xml title="pom.xml"
+
+ io.revealbi
+ reveal-sdk-servlet
+ [var:sdkVersion]
+
+```
+
+2 - `RevealEngineServlet` を Spring Boot サーブレットとして登録します。現在の Java SDK は JAX-RS 上で動作しなくなったため、Reveal SDK クラスを JAX-RS コンテキストに登録する必要はありません。`RevealEngineServlet` コンストラクターはリクエストを受け取り、`RVUserContext` を作成します。これは以前のコンテナー対応ユーザー コンテキスト プロバイダー設定の代替です。サンプルのプロバイダー クラスはアプリケーションの実装に置き換えてください。リクエスト ベースのプロパティをユーザー コンテキストに渡す必要がある場合は、
+`null` をリクエストから生成した `Properties` オブジェクトに置き換えてください。
+
+```java title="Application.java"
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+
+ @Bean
+ ServletRegistrationBean revealServlet() {
+ RevealEngineServlet revealEngineServlet = new RevealEngineServlet(() -> new RevealServerBuilder()
+ // Replace these sample providers with your application's implementations.
+ .setAuthenticationProvider(new MyIRVAuthenticationProvider())
+ .setDashboardProvider(new RVDashboardProvider("c:\\your-path"))
+ .setDataSourceProvider(new MyIRVDataSourceProvider())
+ .addSettings(settings -> {
+ // settings.setLicense("your license or remove to use ~/.revealbi-sdk/license.key");
+ })
+ .build(), request -> new RVUserContext("whatever", null /* replace null with a Properties built from the request if needed */));
+
+ return new ServletRegistrationBean<>(revealEngineServlet, "/reveal-api/*");
+ }
+}
+```
+
+## 手順 3 - dashboards フォルダーの作成
+
+1 - ダッシュボード用のフォルダーを作成します。
+
+2 - ダッシュボードを含むフォルダーを使用するように `RVDashboardProvider` を構成します。
+
+```java title="Application.java"
+new RevealServerBuilder()
+ .setDashboardProvider(new RVDashboardProvider("c:\\your-path"))
+ .build();
+```
+
+## 手順 4 - CORS ポリシーの設定 (デバッグ)
+
+アプリケーションの開発およびデバッグ中は、サーバーとクライアント アプリを異なる URL でホストすることが一般的です。たとえば、サーバーが `https://localhost:8080` で動作し、Angular アプリが `https://localhost:4200` で動作しているような場合です。クライアント アプリケーションからダッシュボードを読み込もうとすると、クロス オリジン リソース シェアリング (CORS) ポリシーにより失敗します。このシナリオを有効にするには、`Application.java` に `WebMvcConfigurer` Bean を追加します。
+
+```java title="Application.java"
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.core.Ordered;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+@Bean
+FilterRegistrationBean corsFilter() {
+ CorsConfiguration config = new CorsConfiguration();
+ config.addAllowedOriginPattern("*");
+ config.addAllowedHeader("*");
+ config.addAllowedMethod("*"); // 開発環境のみ!本番環境では適切に構成してください。
+
+ UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+ source.registerCorsConfiguration("/**", config);
+
+ FilterRegistrationBean bean = new FilterRegistrationBean<>(new CorsFilter(source));
+ bean.addUrlPatterns("/*");
+ bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
+ return bean;
+}
+```
+
+:::info コードの取得
+
+このサンプルのソース コードは [GitHub](https://github.com/RevealBi/sdk-samples-javascript/tree/main/01-GettingStarted/server/spring-boot) にあります。
+
+:::
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-artifact-id.jpg b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-artifact-id.jpg
new file mode 100644
index 00000000..cb4946ed
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-artifact-id.jpg differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-explorer.jpg b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-explorer.jpg
new file mode 100644
index 00000000..50244b39
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-explorer.jpg differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-group-id.jpg b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-group-id.jpg
new file mode 100644
index 00000000..70899111
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-group-id.jpg differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-language.jpg b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-language.jpg
new file mode 100644
index 00000000..a9d7dd78
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-language.jpg differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-package-type.jpg b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-package-type.jpg
new file mode 100644
index 00000000..6cf6185f
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-package-type.jpg differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-project.jpg b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-project.jpg
new file mode 100644
index 00000000..7fbdc2ab
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-project.jpg differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-version.jpg b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-version.jpg
new file mode 100644
index 00000000..034ee2e0
Binary files /dev/null and b/i18n/ja/docusaurus-plugin-content-docs/current/web/images/getting-started-spring-boot-version.jpg differ
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/install-server-sdk.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/install-server-sdk.md
index 83de7bea..812fd56e 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/install-server-sdk.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/install-server-sdk.md
@@ -1,4 +1,4 @@
-# Server SDK のインストール
+# Server SDK のインストール
## ASP.NET
@@ -61,6 +61,8 @@ app.listen(8080, () => {
以下の手順では、Reveal SDK を既存の Java アプリケーションにインストールする方法について説明します。
+Java SDK には Java 17 以降および Jakarta EE 9 準拠サーバーが必要です。Java SDK は現在、ネイティブ .NET コンポーネントをラップしているため、AIX など、それらのコンポーネントを実行できない一部のまれなプラットフォームはサポートされていません。Jetty をサーバーとして使用する場合、そのバージョンが Reveal SDK で内部的に使用される Jetty バージョン (現在は 12.0.12) と競合する可能性があります。
+
1 - **pom.xml** ファイルを更新します。Reveal Maven リポジトリを追加します。
```xml title="pom.xml"
@@ -76,81 +78,67 @@ app.listen(8080, () => {
```xml title="pom.xml"
- com.infragistics.reveal.sdk
- reveal-sdk
+ io.revealbi
+ reveal-sdk-servlet
[var:sdkVersion]
```
-### Spring Boot - Jersey
-
-Jersey Config クラスを作成し、`RevealEngineInitializer.initialize` メソッドを呼び出して Reveal SDK を初期化します。Reveal SDK を Jersey で正しく動作させるためには、Reveal SDK の全クラスを Jersey に登録する必要があります。Reveal SDK のクラスを登録するには、`RevealEngineInitializer.getClassesToRegister` メソッドによって返されるクラスをループして、Jersey Config にそれらを登録します。
+### Spring Boot
-```java title="RevealJerseyConfig.java"
-import org.glassfish.jersey.server.ResourceConfig;
-import org.springframework.stereotype.Component;
+`RevealEngineServlet` を Spring Boot サーブレットとして登録します。現在の Java SDK は JAX-RS 上で動作しなくなったため、Reveal SDK クラスを JAX-RS コンテキストに登録する必要はありません。サンプルのプロバイダー クラスはアプリケーションの実装に置き換えてください。リクエスト ベースのプロパティをユーザー コンテキストに渡す必要がある場合は、
+`null` をリクエストから生成した `Properties` オブジェクトに置き換えてください。
-import com.infragistics.reveal.engine.init.RevealEngineInitializer;
+```java title="Application.java"
+@SpringBootApplication
+public class Application {
-import javax.ws.rs.ApplicationPath;
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
-@Component
-@ApplicationPath("/")
-public class RevealJerseyConfig extends ResourceConfig
-{
- public RevealJerseyConfig()
- {
- RevealEngineInitializer.initialize();
-
- //register all Reveal classes in JAX-RS context
- for (Class> clazz : RevealEngineInitializer.getClassesToRegister()) {
- register(clazz);
- }
+ @Bean
+ ServletRegistrationBean revealServlet() {
+ RevealEngineServlet revealEngineServlet = new RevealEngineServlet(() -> new RevealServerBuilder()
+ // Replace these sample providers with your application's implementations.
+ .setAuthenticationProvider(new MyIRVAuthenticationProvider())
+ .setDashboardProvider(new RVDashboardProvider("c:\\your-path"))
+ .setDataSourceProvider(new MyIRVDataSourceProvider())
+ .addSettings(settings -> {
+ // settings.setLicense("your license or remove to use ~/.revealbi-sdk/license.key");
+ })
+ .build(), request -> new RVUserContext("whatever", null /* replace null with a Properties built from the request if needed */));
+
+ return new ServletRegistrationBean<>(revealEngineServlet, "/reveal-api/*");
}
}
```
### Tomcat
-1 - Jakarta RESTful Web Services (JAX-RS) 実装への依存関係を追加します。Jersey、RESTeasy、Apache CXF など複数の選択肢の中から選ぶことができます。お好みのプロバイダー提供元が説明する手順に従ってください。
-
-例として Jersey 用に追加する必要がある依存関係を以下に示します:
-
-```xml
-
- org.glassfish.jersey.containers
- jersey-container-servlet
- 2.32
-
-
- org.glassfish.jersey.inject
- jersey-cdi2-se
- 2.32
-
-```
-
-2 - ServletContextListener クラスを作成し `RevealEngineInitializer.initialize` メソッドを呼び出して Reveal SDK を初期化します。
+Tomcat 10 以降などの Jakarta EE 9 準拠サーブレット コンテナーを使用します。`ServletContextListener` クラスを作成し、`RevealEngineServlet` を登録します。サンプルのプロバイダー クラスはアプリケーションの実装に置き換えてください。リクエスト ベースのプロパティをユーザー コンテキストに渡す必要がある場合は、
+`null` をリクエストから生成した `Properties` オブジェクトに置き換えてください。
```java
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.annotation.WebListener;
-
-import com.infragistics.reveal.engine.init.RevealEngineInitializer;
-
@WebListener
-public class RevealServletContextListener implements ServletContextListener {
+public class AppInitializer implements ServletContextListener {
@Override
- public void contextDestroyed(ServletContextEvent ctx) {
-
- }
-
- @Override
- public void contextInitialized(ServletContextEvent ctx) {
-
- //initialize Reveal
- RevealEngineInitializer.initialize();
+ public void contextInitialized(ServletContextEvent sce) {
+ RevealEngineServlet revealEngineServlet = new RevealEngineServlet(() -> new RevealServerBuilder()
+ // Replace these sample providers with your application's implementations.
+ .setAuthenticationProvider(new MyIRVAuthenticationProvider())
+ .setDashboardProvider(new RVDashboardProvider("c:\\your-path"))
+ .setDataSourceProvider(new MyIRVDataSourceProvider())
+ .addSettings(settings -> {
+ // settings.setLicense("your license or remove to use ~/.revealbi-sdk/license.key");
+ })
+ .build(), request -> new RVUserContext("whatever", null /* replace null with a Properties built from the request if needed */));
+
+ ServletRegistration.Dynamic reg = sce.getServletContext().addServlet("myServlet", revealEngineServlet);
+ reg.setAsyncSupported(true);
+ reg.addMapping("/reveal-api/*");
}
}
-```
\ No newline at end of file
+```
+
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/loading-dashboards.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/loading-dashboards.md
index 787b7d90..518e5243 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/loading-dashboards.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/loading-dashboards.md
@@ -136,9 +136,9 @@ builder.Services.AddControllers().AddReveal( builder =>
```java
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setDashboardProvider(new DashboardProvider()).
- build());
+new RevealServerBuilder()
+ .setDashboardProvider(new DashboardProvider())
+ .build();
```
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/release-notes.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/release-notes.md
index f7254f93..9b8750b5 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/release-notes.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/release-notes.md
@@ -17,6 +17,12 @@ import TabItem from '@theme/TabItem';
#### Node
- ヘッドレス エクスポート オプションの `dateFilter` プロパティは非推奨です。代わりに `RVDateRule` を使用した `filters` 配列をご使用ください。
+#### Java
+- Java SDK は Java 17 以上が必須になりました。
+- Java SDK は `io.revealbi:reveal-sdk-servlet` Maven アーティファクトと `RevealEngineServlet` を使用するサーブレット ベース構成になりました。
+- Java SDK は Linux、Windows、OSX をサポートし、3 つの OS すべてで x64 と arm64 の両アーキテクチャをサポートします。
+- Jetty をサーバーとして使用する場合、Reveal SDK が内部で使用している Jetty(現在は 12.0.12)とバージョンが競合する可能性があります。
+
### 新機能
#### すべてのプラットフォーム
@@ -36,6 +42,7 @@ import TabItem from '@theme/TabItem';
- ネットワーク障害後のデータ エージェントの接続回復が改善されました。
#### Java
+- Java SDK はコネクタと拡張ポイントについて .NET SDK と機能同等になりました(`InMemoryDataProvider` を除く)。`InMemoryDataProvider` は今後のリリースで Java に移植される予定です。
- Java SDK で `RVRedisOptions` を使用した Redis キャッシュがサポートされました。
- `DefaultDashboardTheme` がサポートされました。
- ヘッドレス エクスポートで CSV 形式がサポートされました。
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/replacing-datasources.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/replacing-datasources.md
index b8fd7c2e..6d675b08 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/replacing-datasources.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/replacing-datasources.md
@@ -81,9 +81,9 @@ builder.Services.AddControllers().AddReveal( builder =>
```java
-RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setDataSourceProvider(new DataSourceProvider()).
- build());
+new RevealServerBuilder()
+ .setDataSourceProvider(new DataSourceProvider())
+ .build();
```
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/toc.yml b/i18n/ja/docusaurus-plugin-content-docs/current/web/toc.yml
index 7acfb45d..205dda64 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/toc.yml
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/toc.yml
@@ -14,8 +14,8 @@
href: getting-started-server-node.md
- name: Node.js - TypeScript
href: getting-started-server-node-typescript.md
- - name: Spring Boot - Jersey
- href: getting-started-spring-boot-jersey.md
+ - name: Spring Boot
+ href: getting-started-spring-boot.md
- name: Angular
href: getting-started-angular.md
- name: ASP.NET Core Web App
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/web/user-context.md b/i18n/ja/docusaurus-plugin-content-docs/current/web/user-context.md
index c3f12afd..4596752a 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/web/user-context.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/web/user-context.md
@@ -97,9 +97,9 @@ Reveal SDK 内のユーザー コンテキストは、`IRVUserContextProvider`
```java
- RevealEngineInitializer.initialize(new InitializeParameterBuilder().
- setUserContextProvider(new UserContextProvider()).
- build());
+ new RevealServerBuilder()
+ .setUserContextProvider(new UserContextProvider())
+ .build();
```
diff --git a/sidebars.ts b/sidebars.ts
index 9e34c99b..60e71731 100644
--- a/sidebars.ts
+++ b/sidebars.ts
@@ -21,7 +21,7 @@ const sidebars: SidebarsConfig = {
{ type: "doc", label: "NestJS", id: "web/getting-started-server-nest" },
{ type: "doc", label: "Node.js", id: "web/getting-started-server-node" },
{ type: "doc", label: "Node.js - TypeScript", id: "web/getting-started-server-node-typescript" },
- { type: "doc", label: "Spring Boot - Jersey", id: "web/getting-started-spring-boot-jersey" },
+ { type: "doc", label: "Spring Boot", id: "web/getting-started-spring-boot" },
]
},
{
diff --git a/src/components/FrameworkPicker/index.tsx b/src/components/FrameworkPicker/index.tsx
index 30b97dca..32def9a1 100644
--- a/src/components/FrameworkPicker/index.tsx
+++ b/src/components/FrameworkPicker/index.tsx
@@ -33,7 +33,7 @@ const frameworks: FrameworkItem[] = [
},
{
label: Spring Boot,
- link: '/web/getting-started-spring-boot-jersey/',
+ link: '/web/getting-started-spring-boot/',
badge: 'Server',
},
];