Skip to content

Commit

Permalink
Merge pull request #2272 from openturing/0.3.10
Browse files Browse the repository at this point in the history
0.3.10
  • Loading branch information
alegauss authored Feb 11, 2025
2 parents b781851 + da298ab commit bfeac2e
Show file tree
Hide file tree
Showing 183 changed files with 10,365 additions and 19,281 deletions.
17 changes: 1 addition & 16 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,4 @@ updates:
angular:
applies-to: version-updates
patterns:
- "*"

- package-ecosystem: "npm" # See documentation for possible values
directory: "/turing-react" # Location of package manifests
schedule:
interval: "weekly"
target-branch: "0.3.10"
open-pull-requests-limit: 15
ignore:
- dependency-name: "typescript"
- dependency-name: "styled-components"
groups:
react:
applies-to: version-updates
patterns:
- "*"
- "*"
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>3.4.1</spring-boot.version>
<spring-boot.version>3.4.2</spring-boot.version>
<sonar.organization>viglet-turing</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
Expand Down Expand Up @@ -279,7 +279,7 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.48.0.0</version>
<version>3.49.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand All @@ -294,7 +294,7 @@
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.4.1</version>
<version>5.4.2</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
Expand Down
2 changes: 1 addition & 1 deletion turing-aem/aem-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.1</version>
<version>26.0.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion turing-aem/aem-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<name>Turing AEM - Plugin</name>
<description>Turing AEM - Plugin</description>
<properties>
<spring-boot.version>3.4.1</spring-boot.version>
<spring-boot.version>3.4.2</spring-boot.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>21</maven.compiler.source>
Expand Down
20 changes: 10 additions & 10 deletions turing-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<url>https://github.com/openturing/turing</url>
<packaging>jar</packaging>
<properties>
<spring-boot.version>3.4.1</spring-boot.version>
<spring-boot.version>3.4.2</spring-boot.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>21</maven.compiler.source>
Expand All @@ -38,7 +38,7 @@
<dependency>
<groupId>co.elastic.clients</groupId>
<artifactId>elasticsearch-java</artifactId>
<version>8.17.0</version>
<version>8.17.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -196,33 +196,33 @@
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parser-pdf-module</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parser-text-module</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parser-ocr-module</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parser-microsoft-module</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.levigo.jbig2</groupId>
Expand All @@ -242,7 +242,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.3</version>
<version>2.8.4</version>
</dependency>
<dependency>
<groupId>com.squins.google.fork.schema-org-client</groupId>
Expand Down Expand Up @@ -295,7 +295,7 @@
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>9.7.0</version>
<version>9.8.0</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.LocaleUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -84,7 +85,7 @@ public ResponseEntity<TurSNSiteSearchBean> turSNSiteSearchSelectGet(
@RequestParam(required = false, name = TurSNParamType.FILTER_QUERY_OPERATOR, defaultValue = "NONE")
TurSNFilterQueryOperator fqOperator,
@RequestParam(required = false, name = TurSNParamType.SORT) String sort,
@RequestParam(required = false, name = TurSNParamType.ROWS, defaultValue = "10") Integer rows,
@RequestParam(required = false, name = TurSNParamType.ROWS, defaultValue = "-1") Integer rows,
@RequestParam(required = false, name = TurSNParamType.GROUP) String group,
@RequestParam(required = false, name = TurSNParamType.AUTO_CORRECTION_DISABLED, defaultValue = "0")
Integer autoCorrectionDisabled,
Expand Down Expand Up @@ -127,7 +128,7 @@ public ResponseEntity<TurSNSiteSearchBean> turSNSiteSearchSelectPost(
@RequestParam(required = false, name = TurSNParamType.FILTER_QUERY_OPERATOR, defaultValue = "NONE")
TurSNFilterQueryOperator fqOperator,
@RequestParam(required = false, name = TurSNParamType.SORT) String sort,
@RequestParam(required = false, name = TurSNParamType.ROWS, defaultValue = "10") Integer rows,
@RequestParam(required = false, name = TurSNParamType.ROWS, defaultValue = "-1") Integer rows,
@RequestParam(required = false, name = TurSNParamType.GROUP) String group,
@RequestParam(required = false, name = TurSNParamType.AUTO_CORRECTION_DISABLED, defaultValue = "0")
Integer autoCorrectionDisabled,
Expand All @@ -136,7 +137,9 @@ public ResponseEntity<TurSNSiteSearchBean> turSNSiteSearchSelectPost(
Principal principal,
HttpServletRequest request) {
if (principal != null) {
Locale locale = LocaleUtils.toLocale(localeRequest);
Locale locale = LocaleUtils.toLocale(StringUtils.isNotBlank(turSNSitePostParamsBean.getLocale()) ?
turSNSitePostParamsBean.getLocale() :
localeRequest);
if (existsByTurSNSiteAndLanguage(siteName, locale)) {
turSNSitePostParamsBean.setTargetingRules(
turSNSearchProcess.requestTargetingRules(turSNSitePostParamsBean.getTargetingRules()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public class TurSNSite extends TurAuditable<String> implements Serializable {
@Column(nullable = false)
private String description;

/**
* Number of results per page
*/
@Column
private Integer rowsPerPage = 10;

Expand Down
12 changes: 8 additions & 4 deletions turing-app/src/main/java/com/viglet/turing/solr/TurSolr.java
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,16 @@ private void setMLT(TurSNSite turSNSite, List<TurSNSiteFieldExt> turSNSiteMLTFie
if (hasMLT(turSNSite, turSNSiteMLTFieldExtList)) turSEResults.setSimilarResults(similarResults);
}

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

private void setSortEntry(TurSNSite turSNSite, SolrQuery query, TurSEParameters turSEParameters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,6 @@ public static String asJsonString(final Object obj) throws TurException {
}

public static File getTempDirectory() {
return TurCommonsUtils.addSubDirToStoreDir("tmp");
return addSubDirToStoreDir("tmp");
}
}
12 changes: 6 additions & 6 deletions turing-filesystem/fs-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,33 @@
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parser-pdf-module</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parser-text-module</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parser-ocr-module</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parser-microsoft-module</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.levigo.jbig2</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@

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

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.viglet.turing.client.auth.TurServer;
import com.viglet.turing.client.auth.credentials.TurApiKeyCredentials;
import com.viglet.turing.client.ocr.TurOcr;
import com.viglet.turing.commons.file.TurFileAttributes;
import lombok.extern.slf4j.Slf4j;

import java.net.MalformedURLException;
import java.io.File;
import java.net.URI;

/**
Expand All @@ -35,20 +37,33 @@
*/
@Slf4j
public class TurClientOcrSample {
public static void main(String[] args) {
if (args.length == 3) {

public static final String HTTP = "http";

public static void main(String[] args) throws JsonProcessingException {
if (args.length == 4) {
String turingUrl = args[0];
String apiKey = args[1];
String fileUrl = args[2];
TurServer turSNServer = new TurServer(URI.create(turingUrl),
new TurApiKeyCredentials(apiKey));
log.info("--- Ocr Url");
TurOcr turOcr = new TurOcr();
TurFileAttributes turFileAttributes = turOcr.processUrl(turSNServer, URI.create(fileUrl),
true);
log.info(turFileAttributes.toString());
String fileUrl = args[3];
log.info("--- Ocr Url");
TurFileAttributes turFileAttributes = getAttributes(turingUrl, apiKey, fileUrl);
if (turFileAttributes != null) {
log.info(new ObjectMapper().writer().withDefaultPrettyPrinter().writeValueAsString(turFileAttributes));
}
} else {
log.info("Parameters: turingUrl apiKey [file Or Url]");
}
}

private static TurFileAttributes getAttributes(String turingUrl, String apikey, String fileUrl) {
TurServer turServer = new TurServer(URI.create(turingUrl),
new TurApiKeyCredentials(apikey));
TurOcr turOcr = new TurOcr();
if (fileUrl.toLowerCase().startsWith(HTTP)) {
return turOcr.processUrl(turServer, URI.create(fileUrl), false);

} else {
log.info("Parameters: turingUrl apiKey fileUrl");
return turOcr.processFile(turServer, new File(fileUrl), false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public class TurSNJobItem implements Serializable{

private static final long serialVersionUID = 1L;
private Locale locale;

private TurSNJobAction turSNJobAction;
private TurSNJobAction turSNJobAction;
private List<String> siteNames;
private List<TurSNJobAttributeSpec> specs = new ArrayList<>();
private Map<String, Object> attributes = new HashMap<>();
Expand Down
2 changes: 2 additions & 0 deletions turing-jdk6/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.idea/
/target/
23 changes: 23 additions & 0 deletions turing-jdk6/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.viglet.turing</groupId>
<artifactId>turing-jdk6</artifactId>
<version>0.3.10.1</version>
<packaging>pom</packaging>
<name>Turing JDK 6</name>
<description>Turing JDK 6</description>
<modules>
<module>turing-java-sdk-jdk6</module>
<module>turing-wem-jdk6</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
</project>
30 changes: 30 additions & 0 deletions turing-jdk6/turing-java-sdk-jdk6/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

.gradle
.project
.classpath
.settings
build/
.vscode
/target/
Loading

0 comments on commit bfeac2e

Please sign in to comment.