Skip to content

Commit

Permalink
Merge branch 'release-1.29.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoEberhard committed Mar 20, 2022
2 parents 98c34fc + b7a8e94 commit d985ae1
Show file tree
Hide file tree
Showing 31 changed files with 681 additions and 369 deletions.
23 changes: 10 additions & 13 deletions example/001_EmptyApplication/pom.xml
Expand Up @@ -8,12 +8,16 @@
<description>The empty application shows how to set up a Minimal-J application</description>
<build>
<sourceDirectory>src</sourceDirectory>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
Expand All @@ -23,11 +27,4 @@
</dependency>
</dependencies>

<distributionManagement>
<repository>
<id>openech-repository</id>
<url>ftp://ftp.openech.ch/public_html/repository</url>
</repository>
</distributionManagement>

</project>
27 changes: 8 additions & 19 deletions example/002_HelloWorld/pom.xml
@@ -1,18 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.minimalj.example</groupId>
<artifactId>helloWorld</artifactId>
<version>1.0.1.0</version>
<version>1.0.2.0</version>
<name>Example_002_HelloWorld</name>
<description>The hello world application shows how a simple page can be displayed</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>11</release>
</configuration>
</plugin>
<plugin>
Expand All @@ -25,27 +25,16 @@
<argument>org.minimalj.example.empty.EmptyApplication</argument>
</arguments>
</configuration>
</plugin>
</plugin>
</plugins>
<sourceDirectory>src</sourceDirectory>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
</extension>
</extensions>
</build>

<dependencies>
<dependency>
<groupId>org.minimalj</groupId>
<artifactId>minimalj</artifactId>
<version>[1.14.0.0,)</version>
<version>[1.28.0.0,)</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>openech-repository</id>
<url>ftp://ftp.openech.ch/public_html/repository</url>
</repository>
</distributionManagement>
</project>
22 changes: 5 additions & 17 deletions example/003_Notes/pom.xml
@@ -1,5 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.minimalj.example</groupId>
<artifactId>notes</artifactId>
Expand All @@ -9,21 +8,16 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>11</release>
</configuration>
</plugin>
</plugins>
<sourceDirectory>src</sourceDirectory>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
</extension>
</extensions>
</build>
</build>
<dependencies>
<dependency>
<groupId>org.minimalj</groupId>
Expand All @@ -36,10 +30,4 @@
<version>2.1.210</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>openech-repository</id>
<url>ftp://ftp.openech.ch/public_html/repository</url>
</repository>
</distributionManagement>
</project>
22 changes: 6 additions & 16 deletions example/005_Numbers/pom.xml
@@ -1,5 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.minimalj.example</groupId>
<artifactId>numbers</artifactId>
Expand All @@ -18,30 +17,21 @@
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>11</release>
</configuration>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
</extension>
</extensions> </build>
</build>

<dependencies>
<dependency>
<groupId>org.minimalj</groupId>
<artifactId>minimalj</artifactId>
<version>[1.14.0.0,)</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>openech-repository</id>
<url>ftp://ftp.openech.ch/public_html/repository</url>
</repository>
</distributionManagement>
</project>
2 changes: 1 addition & 1 deletion example/020_MinimalClinic/pom.xml
Expand Up @@ -75,12 +75,12 @@
<artifactId>memory</artifactId>
<version>0.2.0.0</version>
</dependency>
<!--
<dependency>
<groupId>org.minimalj</groupId>
<artifactId>minimalj_vaadin</artifactId>
<version>2.0.0.0-SNAPSHOT</version>
</dependency>
<!--
<dependency>
<groupId>org.minimalj</groupId>
<artifactId>swingfxbrowser</artifactId>
Expand Down
1 change: 0 additions & 1 deletion example/heroku/Procfile

This file was deleted.

16 changes: 8 additions & 8 deletions example/heroku/pom.xml
@@ -1,8 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.minimalj.example</groupId>
<artifactId>heroku</artifactId>
<artifactId>demoserver</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>All examples put together in one jar</description>
<packaging>jar</packaging>
Expand All @@ -18,10 +17,11 @@
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>11</release>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>org.minimalj.example</groupId>
<artifactId>helloWorld</artifactId>
<version>1.0.1.0</version>
<version>1.0.2.0</version>
</dependency>
<dependency>
<groupId>org.minimalj.example</groupId>
Expand Down Expand Up @@ -77,14 +77,14 @@
<artifactId>minimalj</artifactId>
<version>[1.15.0.0,)</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Expand Up @@ -24,7 +24,9 @@
import org.minimalj.util.resources.Resources;

/**
* This is just a hack to make all the examples work in one application on heroku.
* This is just a hack to make all the examples run in a single server instance.
* This is not recommended for productive applications. There should be only one
* Application in a JVM.
*
*/
public class ThreadLocalApplication extends WebApplication {
Expand All @@ -33,56 +35,56 @@ public class ThreadLocalApplication extends WebApplication {

private final InheritableThreadLocal<Application> current = new InheritableThreadLocal<>();
private boolean backendSet = false;

private Collection<Application> applications;

public ThreadLocalApplication() {
// private
}

public void setApplications(Collection<Application> applications) {
this.applications = applications;
}

public void setCurrentApplication(Application application) {
if (!backendSet) {
Backend.setInstance(new ThreadLocalBackend());
backendSet = true;
}
current.set(application);
}

public Application getCurrentApplication() {
return current.get();
}

@Override
public Class<?>[] getEntityClasses() {
return getCurrentApplication().getEntityClasses();
}

@Override
public String getName() {
return getCurrentApplication().getName();
}

@Override
public void search(String query) {
getCurrentApplication().search(query);
}

@Override
public Page createDefaultPage() {
return getCurrentApplication().createDefaultPage();
}

@Override
public List<Action> getNavigation() {
return getCurrentApplication().getNavigation();
}

public class ThreadLocalBackend extends Backend {
private final Map<Application, Repository> repositories = new HashMap<>();
private final Map<Application, Repository> repositories = new HashMap<>();

@Override
public Repository getRepository() {
Expand All @@ -93,18 +95,18 @@ public Repository getRepository() {
}
return repositories.get(application);
}

@Override
public void setRepository(Repository repository) {
repositories.put(getCurrentApplication(), repository);
}
}

@Override
protected MjHttpHandler createHttpHandler() {
return new ThreadLocalResourcesHttpHandler();
}

private class ThreadLocalResourcesHttpHandler implements MjHttpHandler {

@Override
Expand Down Expand Up @@ -152,7 +154,7 @@ private byte[] getResource(String path) {
}
}
}

@Override
public ResourceBundle getResourceBundle(Locale locale) {
List<ResourceBundle> resourceBundles = new ArrayList<>();
Expand Down

0 comments on commit d985ae1

Please sign in to comment.