Skip to content

Commit bfeac2e

Browse files
authored
Merge pull request #2272 from openturing/0.3.10
0.3.10
2 parents b781851 + da298ab commit bfeac2e

File tree

183 files changed

+10365
-19281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+10365
-19281
lines changed

.github/dependabot.yml

+1-16
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,4 @@ updates:
3131
angular:
3232
applies-to: version-updates
3333
patterns:
34-
- "*"
35-
36-
- package-ecosystem: "npm" # See documentation for possible values
37-
directory: "/turing-react" # Location of package manifests
38-
schedule:
39-
interval: "weekly"
40-
target-branch: "0.3.10"
41-
open-pull-requests-limit: 15
42-
ignore:
43-
- dependency-name: "typescript"
44-
- dependency-name: "styled-components"
45-
groups:
46-
react:
47-
applies-to: version-updates
48-
patterns:
49-
- "*"
34+
- "*"

pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<properties>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
16-
<spring-boot.version>3.4.1</spring-boot.version>
16+
<spring-boot.version>3.4.2</spring-boot.version>
1717
<sonar.organization>viglet-turing</sonar.organization>
1818
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
1919
</properties>
@@ -279,7 +279,7 @@
279279
<dependency>
280280
<groupId>org.xerial</groupId>
281281
<artifactId>sqlite-jdbc</artifactId>
282-
<version>3.48.0.0</version>
282+
<version>3.49.0.0</version>
283283
</dependency>
284284
<dependency>
285285
<groupId>org.apache.logging.log4j</groupId>
@@ -294,7 +294,7 @@
294294
<dependency>
295295
<groupId>org.apache.httpcomponents.client5</groupId>
296296
<artifactId>httpclient5</artifactId>
297-
<version>5.4.1</version>
297+
<version>5.4.2</version>
298298
</dependency>
299299
<dependency>
300300
<groupId>com.jayway.jsonpath</groupId>

turing-aem/aem-commons/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<dependency>
4848
<groupId>org.jetbrains</groupId>
4949
<artifactId>annotations</artifactId>
50-
<version>26.0.1</version>
50+
<version>26.0.2</version>
5151
<scope>compile</scope>
5252
</dependency>
5353
</dependencies>

turing-aem/aem-plugin/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<name>Turing AEM - Plugin</name>
1414
<description>Turing AEM - Plugin</description>
1515
<properties>
16-
<spring-boot.version>3.4.1</spring-boot.version>
16+
<spring-boot.version>3.4.2</spring-boot.version>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1919
<maven.compiler.source>21</maven.compiler.source>

turing-app/pom.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<url>https://github.com/openturing/turing</url>
1515
<packaging>jar</packaging>
1616
<properties>
17-
<spring-boot.version>3.4.1</spring-boot.version>
17+
<spring-boot.version>3.4.2</spring-boot.version>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1919
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2020
<maven.compiler.source>21</maven.compiler.source>
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>co.elastic.clients</groupId>
4040
<artifactId>elasticsearch-java</artifactId>
41-
<version>8.17.0</version>
41+
<version>8.17.1</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>org.springframework.boot</groupId>
@@ -196,33 +196,33 @@
196196
<dependency>
197197
<groupId>org.apache.tika</groupId>
198198
<artifactId>tika-core</artifactId>
199-
<version>3.0.0</version>
199+
<version>3.1.0</version>
200200
</dependency>
201201
<dependency>
202202
<groupId>org.apache.tika</groupId>
203203
<artifactId>tika-parsers</artifactId>
204-
<version>3.0.0</version>
204+
<version>3.1.0</version>
205205
<type>pom</type>
206206
</dependency>
207207
<dependency>
208208
<groupId>org.apache.tika</groupId>
209209
<artifactId>tika-parser-pdf-module</artifactId>
210-
<version>3.0.0</version>
210+
<version>3.1.0</version>
211211
</dependency>
212212
<dependency>
213213
<groupId>org.apache.tika</groupId>
214214
<artifactId>tika-parser-text-module</artifactId>
215-
<version>3.0.0</version>
215+
<version>3.1.0</version>
216216
</dependency>
217217
<dependency>
218218
<groupId>org.apache.tika</groupId>
219219
<artifactId>tika-parser-ocr-module</artifactId>
220-
<version>3.0.0</version>
220+
<version>3.1.0</version>
221221
</dependency>
222222
<dependency>
223223
<groupId>org.apache.tika</groupId>
224224
<artifactId>tika-parser-microsoft-module</artifactId>
225-
<version>3.0.0</version>
225+
<version>3.1.0</version>
226226
</dependency>
227227
<dependency>
228228
<groupId>com.levigo.jbig2</groupId>
@@ -242,7 +242,7 @@
242242
<dependency>
243243
<groupId>org.springdoc</groupId>
244244
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
245-
<version>2.8.3</version>
245+
<version>2.8.4</version>
246246
</dependency>
247247
<dependency>
248248
<groupId>com.squins.google.fork.schema-org-client</groupId>
@@ -295,7 +295,7 @@
295295
<dependency>
296296
<groupId>org.apache.solr</groupId>
297297
<artifactId>solr-solrj</artifactId>
298-
<version>9.7.0</version>
298+
<version>9.8.0</version>
299299
</dependency>
300300
<dependency>
301301
<groupId>org.springframework.security</groupId>

turing-app/src/main/java/com/viglet/turing/api/sn/search/TurSNSiteSearchAPI.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import jakarta.servlet.http.HttpServletRequest;
4040
import lombok.extern.slf4j.Slf4j;
4141
import org.apache.commons.lang3.LocaleUtils;
42+
import org.apache.commons.lang3.StringUtils;
4243
import org.jetbrains.annotations.NotNull;
4344
import org.springframework.beans.factory.annotation.Value;
4445
import org.springframework.http.HttpStatus;
@@ -84,7 +85,7 @@ public ResponseEntity<TurSNSiteSearchBean> turSNSiteSearchSelectGet(
8485
@RequestParam(required = false, name = TurSNParamType.FILTER_QUERY_OPERATOR, defaultValue = "NONE")
8586
TurSNFilterQueryOperator fqOperator,
8687
@RequestParam(required = false, name = TurSNParamType.SORT) String sort,
87-
@RequestParam(required = false, name = TurSNParamType.ROWS, defaultValue = "10") Integer rows,
88+
@RequestParam(required = false, name = TurSNParamType.ROWS, defaultValue = "-1") Integer rows,
8889
@RequestParam(required = false, name = TurSNParamType.GROUP) String group,
8990
@RequestParam(required = false, name = TurSNParamType.AUTO_CORRECTION_DISABLED, defaultValue = "0")
9091
Integer autoCorrectionDisabled,
@@ -127,7 +128,7 @@ public ResponseEntity<TurSNSiteSearchBean> turSNSiteSearchSelectPost(
127128
@RequestParam(required = false, name = TurSNParamType.FILTER_QUERY_OPERATOR, defaultValue = "NONE")
128129
TurSNFilterQueryOperator fqOperator,
129130
@RequestParam(required = false, name = TurSNParamType.SORT) String sort,
130-
@RequestParam(required = false, name = TurSNParamType.ROWS, defaultValue = "10") Integer rows,
131+
@RequestParam(required = false, name = TurSNParamType.ROWS, defaultValue = "-1") Integer rows,
131132
@RequestParam(required = false, name = TurSNParamType.GROUP) String group,
132133
@RequestParam(required = false, name = TurSNParamType.AUTO_CORRECTION_DISABLED, defaultValue = "0")
133134
Integer autoCorrectionDisabled,
@@ -136,7 +137,9 @@ public ResponseEntity<TurSNSiteSearchBean> turSNSiteSearchSelectPost(
136137
Principal principal,
137138
HttpServletRequest request) {
138139
if (principal != null) {
139-
Locale locale = LocaleUtils.toLocale(localeRequest);
140+
Locale locale = LocaleUtils.toLocale(StringUtils.isNotBlank(turSNSitePostParamsBean.getLocale()) ?
141+
turSNSitePostParamsBean.getLocale() :
142+
localeRequest);
140143
if (existsByTurSNSiteAndLanguage(siteName, locale)) {
141144
turSNSitePostParamsBean.setTargetingRules(
142145
turSNSearchProcess.requestTargetingRules(turSNSitePostParamsBean.getTargetingRules()));

turing-app/src/main/java/com/viglet/turing/persistence/model/sn/TurSNSite.java

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ public class TurSNSite extends TurAuditable<String> implements Serializable {
7272
@Column(nullable = false)
7373
private String description;
7474

75+
/**
76+
* Number of results per page
77+
*/
7578
@Column
7679
private Integer rowsPerPage = 10;
7780

turing-app/src/main/java/com/viglet/turing/solr/TurSolr.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -626,12 +626,16 @@ private void setMLT(TurSNSite turSNSite, List<TurSNSiteFieldExt> turSNSiteMLTFie
626626
if (hasMLT(turSNSite, turSNSiteMLTFieldExtList)) turSEResults.setSimilarResults(similarResults);
627627
}
628628

629+
/**
630+
* Sets how many result query will respond.
631+
*/
629632
private void setRows(TurSNSite turSNSite, TurSEParameters turSEParameters) {
630-
if (turSEParameters.getRows() == 0) {
631-
turSEParameters.setRows(turSNSite.getRowsPerPage());
632-
} else if (turSEParameters.getRows() < 0) {
633-
turSEParameters.setRows(0);
633+
// If user didn't input a parameter through query string. Then, use the site configuration
634+
if (turSEParameters.getRows() < 0){
635+
// But only uses if the entered value is greater than 0. If not, then uses the default value = 10
636+
turSEParameters.setRows((turSNSite.getRowsPerPage() > 0)? turSNSite.getRowsPerPage() : 10 );
634637
}
638+
// Else, it will use the query parameter
635639
}
636640

637641
private void setSortEntry(TurSNSite turSNSite, SolrQuery query, TurSEParameters turSEParameters) {

turing-commons/src/main/java/com/viglet/turing/commons/utils/TurCommonsUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,6 @@ public static String asJsonString(final Object obj) throws TurException {
289289
}
290290

291291
public static File getTempDirectory() {
292-
return TurCommonsUtils.addSubDirToStoreDir("tmp");
292+
return addSubDirToStoreDir("tmp");
293293
}
294294
}

turing-filesystem/fs-commons/pom.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,33 @@
3636
<dependency>
3737
<groupId>org.apache.tika</groupId>
3838
<artifactId>tika-core</artifactId>
39-
<version>3.0.0</version>
39+
<version>3.1.0</version>
4040
</dependency>
4141
<dependency>
4242
<groupId>org.apache.tika</groupId>
4343
<artifactId>tika-parsers</artifactId>
44-
<version>3.0.0</version>
44+
<version>3.1.0</version>
4545
<type>pom</type>
4646
</dependency>
4747
<dependency>
4848
<groupId>org.apache.tika</groupId>
4949
<artifactId>tika-parser-pdf-module</artifactId>
50-
<version>3.0.0</version>
50+
<version>3.1.0</version>
5151
</dependency>
5252
<dependency>
5353
<groupId>org.apache.tika</groupId>
5454
<artifactId>tika-parser-text-module</artifactId>
55-
<version>3.0.0</version>
55+
<version>3.1.0</version>
5656
</dependency>
5757
<dependency>
5858
<groupId>org.apache.tika</groupId>
5959
<artifactId>tika-parser-ocr-module</artifactId>
60-
<version>3.0.0</version>
60+
<version>3.1.0</version>
6161
</dependency>
6262
<dependency>
6363
<groupId>org.apache.tika</groupId>
6464
<artifactId>tika-parser-microsoft-module</artifactId>
65-
<version>3.0.0</version>
65+
<version>3.1.0</version>
6666
</dependency>
6767
<dependency>
6868
<groupId>com.levigo.jbig2</groupId>

turing-java-sdk/src/main/java/com/viglet/turing/client/ocr/sample/TurClientOcrSample.java

+27-12
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@
1818

1919
package com.viglet.turing.client.ocr.sample;
2020

21+
import com.fasterxml.jackson.core.JsonProcessingException;
22+
import com.fasterxml.jackson.databind.ObjectMapper;
2123
import com.viglet.turing.client.auth.TurServer;
2224
import com.viglet.turing.client.auth.credentials.TurApiKeyCredentials;
2325
import com.viglet.turing.client.ocr.TurOcr;
2426
import com.viglet.turing.commons.file.TurFileAttributes;
2527
import lombok.extern.slf4j.Slf4j;
2628

27-
import java.net.MalformedURLException;
29+
import java.io.File;
2830
import java.net.URI;
2931

3032
/**
@@ -35,20 +37,33 @@
3537
*/
3638
@Slf4j
3739
public class TurClientOcrSample {
38-
public static void main(String[] args) {
39-
if (args.length == 3) {
40+
41+
public static final String HTTP = "http";
42+
43+
public static void main(String[] args) throws JsonProcessingException {
44+
if (args.length == 4) {
4045
String turingUrl = args[0];
4146
String apiKey = args[1];
42-
String fileUrl = args[2];
43-
TurServer turSNServer = new TurServer(URI.create(turingUrl),
44-
new TurApiKeyCredentials(apiKey));
45-
log.info("--- Ocr Url");
46-
TurOcr turOcr = new TurOcr();
47-
TurFileAttributes turFileAttributes = turOcr.processUrl(turSNServer, URI.create(fileUrl),
48-
true);
49-
log.info(turFileAttributes.toString());
47+
String fileUrl = args[3];
48+
log.info("--- Ocr Url");
49+
TurFileAttributes turFileAttributes = getAttributes(turingUrl, apiKey, fileUrl);
50+
if (turFileAttributes != null) {
51+
log.info(new ObjectMapper().writer().withDefaultPrettyPrinter().writeValueAsString(turFileAttributes));
52+
}
53+
} else {
54+
log.info("Parameters: turingUrl apiKey [file Or Url]");
55+
}
56+
}
57+
58+
private static TurFileAttributes getAttributes(String turingUrl, String apikey, String fileUrl) {
59+
TurServer turServer = new TurServer(URI.create(turingUrl),
60+
new TurApiKeyCredentials(apikey));
61+
TurOcr turOcr = new TurOcr();
62+
if (fileUrl.toLowerCase().startsWith(HTTP)) {
63+
return turOcr.processUrl(turServer, URI.create(fileUrl), false);
64+
5065
} else {
51-
log.info("Parameters: turingUrl apiKey fileUrl");
66+
return turOcr.processFile(turServer, new File(fileUrl), false);
5267
}
5368
}
5469
}

turing-java-sdk/src/main/java/com/viglet/turing/client/sn/job/TurSNJobItem.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ public class TurSNJobItem implements Serializable{
3838

3939
private static final long serialVersionUID = 1L;
4040
private Locale locale;
41-
42-
private TurSNJobAction turSNJobAction;
41+
private TurSNJobAction turSNJobAction;
4342
private List<String> siteNames;
4443
private List<TurSNJobAttributeSpec> specs = new ArrayList<>();
4544
private Map<String, Object> attributes = new HashMap<>();

turing-jdk6/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.idea/
2+
/target/

turing-jdk6/pom.xml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4+
5+
<modelVersion>4.0.0</modelVersion>
6+
<groupId>com.viglet.turing</groupId>
7+
<artifactId>turing-jdk6</artifactId>
8+
<version>0.3.10.1</version>
9+
<packaging>pom</packaging>
10+
<name>Turing JDK 6</name>
11+
<description>Turing JDK 6</description>
12+
<modules>
13+
<module>turing-java-sdk-jdk6</module>
14+
<module>turing-wem-jdk6</module>
15+
</modules>
16+
17+
<properties>
18+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
20+
<maven.compiler.source>1.6</maven.compiler.source>
21+
<maven.compiler.target>1.6</maven.compiler.target>
22+
</properties>
23+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
7+
# BlueJ files
8+
*.ctxt
9+
10+
# Mobile Tools for Java (J2ME)
11+
.mtj.tmp/
12+
13+
# Package Files #
14+
*.war
15+
*.nar
16+
*.ear
17+
*.zip
18+
*.tar.gz
19+
*.rar
20+
21+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
22+
hs_err_pid*
23+
24+
.gradle
25+
.project
26+
.classpath
27+
.settings
28+
build/
29+
.vscode
30+
/target/

0 commit comments

Comments
 (0)