Skip to content

Commit

Permalink
Merge branch 'release/7.0.0' into NAE-1989
Browse files Browse the repository at this point in the history
  • Loading branch information
machacjozef authored Nov 7, 2024
2 parents 288b6fa + f243844 commit 9f115a0
Show file tree
Hide file tree
Showing 55 changed files with 1,267 additions and 399 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ jobs:
- 9300:9300
options: -e="discovery.type=single-node" -e="xpack.security.enabled=false" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10

minio:
image: docker.io/bitnami/minio:2022
ports:
- 9000:9000
- 9001:9001
options: -e="MINIO_ROOT_USER=root" -e="MINIO_ROOT_PASSWORD=password" -e="MINIO_DEFAULT_BUCKETS=default"

steps:
- name: Test Database
env:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ jobs:
- 9300:9300
options: -e="discovery.type=single-node" -e="xpack.security.enabled=false" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10

minio:
image: docker.io/bitnami/minio:2022
ports:
- 9000:9000
- 9001:9001
options: -e="MINIO_ROOT_USER=root" -e="MINIO_ROOT_PASSWORD=password" -e="MINIO_DEFAULT_BUCKETS=default"

steps:
- name: Test Database
env:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ jobs:
- 9300:9300
options: -e="discovery.type=single-node" -e="xpack.security.enabled=false" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10

minio:
image: docker.io/bitnami/minio:2022
ports:
- 9000:9000
- 9001:9001
options: -e="MINIO_ROOT_USER=root" -e="MINIO_ROOT_PASSWORD=password" -e="MINIO_DEFAULT_BUCKETS=default"

steps:
- name: Test Database
env:
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Full Changelog: [https://github.com/netgrif/application-engine/commits/v6.3.2](https://github.com/netgrif/application-engine/commits/v6.3.2)

## [6.4.0](https://github.com/netgrif/application-engine/releases/tag/v6.4.0) (2024-04-19)
## [6.4.0](https://github.com/netgrif/application-engine/releases/tag/v6.4.0) (2024-09-26)

### Fixed
- [NAE-1908] NAE-1906 Improvements
Expand All @@ -17,6 +17,10 @@ Full Changelog: [https://github.com/netgrif/application-engine/commits/v6.3.2](h
- [NAE-1959] Indexing enumerationMap field fails when no options exist
- [NAE-1960] Enumeration Map does not propagate changes when selecting
- [NAE-1967] Elasticsearch disable dynamic field mapping
- [NAE-2006] WorkflowService.deleteInstancesOfPetriNet does not remove all cases
- [NAE-1983] Public view file handling
- [NAE-2007] Vulnerabilities fix
- [NAE-1952] Fix Loading Issue for Duplicate TaskRef Entries

### Added
- [NAE-1901] Taskref list rendering update
Expand All @@ -35,9 +39,13 @@ Full Changelog: [https://github.com/netgrif/application-engine/commits/v6.3.2](h
- [NAE-1955] Update setData to handle options / choices
- [NAE-1958] Make component properties changeable
- [NAE-1962] Event properties
- [NAE-1946] Remote file connector to S3
- [NAE-1927] Shared Roles
- [NAE-1945] External resource loader

### Changed
- [NAE-1947] HistoryService findAllSetDataEventLogs is not working
- [NAE-1979] Optimize Maven Resources Plugin Configuration for Correct File Filtering and Copying


## [6.3.3](https://github.com/netgrif/application-engine/releases/tag/v6.3.3) (2024-01-19)
Expand Down
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ services:
image: redis:7.2.5
ports:
- "6379:6379"
minio:
image: docker.io/bitnami/minio:2022
ports:
- '9000:9000'
- '9001:9001'
networks:
- minionetwork
volumes:
- 'minio_data:/data'
environment:
- MINIO_ROOT_USER=root
- MINIO_ROOT_PASSWORD=password
- MINIO_DEFAULT_BUCKETS=default
networks:
minionetwork:
driver: bridge

volumes:
minio_data:
driver: local

# kibana:
# image: docker.elastic.co/kibana/kibana:8.10.4
Expand Down
35 changes: 35 additions & 0 deletions docs/resources/resources_loading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Resource Loading

If you want to load resources, which are not included in JAR (for example large files), you can use the resource loader.
ResourceLoader returns an InputStreamResource. You can turn it into an InputStream and load resources from the directory **resource/** in the working directory of the app.
The prefix for ExternalResourceLoader is

```
resource:
```

For use you can use code like this in your runner:
```java
@Autowired
private ResourceLoader resourceLoader;

@Value("resource:nameOfFile.txt")
private Resource customResource;

@Override
void run(String... strings) throws Exception {
loadResources("resource:nameOfFile.txt");
}

void loadResources(String resourceUrl) {
var resource = resourceLoader.getResource(resourceUrl);
var txt = new String(resource.getInputStream().readAllBytes());
System.out.println("File content: " + txt);
}

void getCustomResource() throws IOException {
var txt = new String(customResource.getInputStream().readAllBytes());
System.out.println("Resource from property: " + txt);
}
```

36 changes: 36 additions & 0 deletions docs/roles/shared_roles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Shared roles
Shared roles or global roles are roles that are only created once and can be used and referenced across Petri nets.
To use a shared role in Petri nets first we must declare it. We can declare it as any other role with addition of ``global``
attribute set to ``true``:
```xml
<document xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='https://petriflow.com/petriflow.schema.xsd'>
<id>nae_1927</id>
...
<role global="true">
<id>admin_global</id>
<title>Global Administrator</title>
</role>
...
</document>
```
Then we can reference it as usual:
```xml
...
<transition>
<id>t1</id>
<x>460</x>
<y>180</y>
<label>Global roles</label>
<roleRef>
<id>admin_global</id>
<logic>
<view>true</view>
<perform>true</perform>
</logic>
</roleRef>
</transition>
...
```
When importing a Petri net, the importer checks, whether the global role has already existed.
If not, the importer creates one. If there has been already one, the importer passes it to a the newly created net.
39 changes: 28 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.21</version>
<version>1.26.0</version>
</dependency>
<dependency>
<groupId>com.beust</groupId>
Expand Down Expand Up @@ -193,14 +193,14 @@
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcmail-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk15on</artifactId>
<version>1.70</version>
<artifactId>bcmail-jdk18on</artifactId>
<version>1.78.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.78.1</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
Expand Down Expand Up @@ -319,8 +319,7 @@
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-all</artifactId>
<version>1.14</version>
<type>pom</type>
<version>1.17</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -348,7 +347,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.3</version>
<version>1.15.4</version>
</dependency>

<!-- QueryDSL -->
Expand Down Expand Up @@ -432,7 +431,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
<version>3.17.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -506,7 +505,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
<version>32.0.0-jre</version>
</dependency>


Expand Down Expand Up @@ -552,12 +551,27 @@
<artifactId>jackson-module-jsonSchema</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.5.12</version>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
Expand All @@ -582,6 +596,9 @@
<goal>repackage</goal>
</goals>
<id>repackage</id>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -797,7 +814,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
<configuration>
<delimiters>
<delimiter>@</delimiter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ package com.netgrif.application.engine.petrinet.domain.dataset
import org.springframework.data.mongodb.core.mapping.Document

@Document
class FileField extends Field<FileFieldValue> {

private Boolean remote
class FileField extends StorageField<FileFieldValue> {

FileField() {
super()
Expand Down Expand Up @@ -42,39 +40,11 @@ class FileField extends Field<FileFieldValue> {
this.setDefaultValue(FileFieldValue.fromString(defaultValue))
}

/**
* Get complete file path to the file
* Path is generated as follow:
* - if file is remote, path is field value / remote URI
* - if file is local
* - saved file name consists of Case id, field import id and original file name separated by dash
* @param caseId
* @return path to the saved file
*/
String getFilePath(String caseId) {
if (this.remote)
return this.getValue().getPath()
return this.getValue().getPath(caseId, getStringId())
}

String getFilePreviewPath(String caseId) {
return this.getValue().getPreviewPath(caseId, getStringId())
}

boolean isRemote() {
return this.remote
}

void setRemote(boolean remote) {
this.remote = remote
}

@Override
Field clone() {
FileField clone = new FileField()
super.clone(clone)
clone.remote = this.remote

clone.storage = this.storage
return clone
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,11 @@ enum FileFieldDataType {
return item
}
}
return null
}

static FileFieldDataType resolveTypeFromName(String name) {
int dot = name.lastIndexOf(".")
return resolveType((dot == -1) ? "" : name.substring(dot + 1))
}
}
Loading

0 comments on commit 9f115a0

Please sign in to comment.