You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2025/12/02 22:50:43 UTC
(tika) 07/07: TIKA-4545: include idx
This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch TIKA-4545-jsonify-all-the-things
in repository https://gitbox.apache.org/repos/asf/tika.git
commit 2385eb19e27c961990dcab73d19785de6173f8c2
Author: tallison <ta...@apache.org>
AuthorDate: Tue Dec 2 17:47:12 2025 -0500
TIKA-4545: include idx
---
.../org/apache/tika/pipes/grpc/TikaGrpcServer.java | 4 +-
.../apache/tika/pipes/grpc/TikaGrpcServerImpl.java | 5 +-
tika-langdetect/tika-langdetect-opennlp/pom.xml | 4 ++
tika-langdetect/tika-langdetect-optimaize/pom.xml | 4 ++
tika-server/tika-server-core/pom.xml | 4 ++
.../resources/configs/cxf-test-base-template.json | 57 ++++++++++++++++++++++
6 files changed, 74 insertions(+), 4 deletions(-)
diff --git a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServer.java b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServer.java
index 4fe0e15e1..1d319b64c 100644
--- a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServer.java
+++ b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServer.java
@@ -92,6 +92,7 @@ public class TikaGrpcServer {
} else {
creds = InsecureServerCredentials.create();
}
+ //TODO -- this has to be converted to json
if (tikaConfigXml == null) {
// Create a default tika config
tikaConfigXml = Files.createTempFile("tika-config", ".xml").toFile();
@@ -100,11 +101,10 @@ public class TikaGrpcServer {
}
}
File tikaConfigFile = new File(tikaConfigXml.getAbsolutePath());
- File pluginsConfig = new File(tikaPlugins.getAbsolutePath());
healthStatusManager.setStatus(TikaGrpcServer.class.getSimpleName(), ServingStatus.SERVING);
server = Grpc
.newServerBuilderForPort(port, creds)
- .addService(new TikaGrpcServerImpl(tikaConfigFile.getAbsolutePath(), pluginsConfig.getAbsolutePath()))
+ .addService(new TikaGrpcServerImpl(tikaConfigFile.getAbsolutePath()))
.addService(healthStatusManager.getHealthService())
.addService(ProtoReflectionServiceV1.newInstance())
.build()
diff --git a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
index 7a8c63fd5..db8782697 100644
--- a/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
+++ b/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
@@ -69,6 +69,7 @@ import org.apache.tika.TikaGrpc;
import org.apache.tika.config.ConfigContainer;
import org.apache.tika.config.Initializable;
import org.apache.tika.config.Param;
+import org.apache.tika.config.loader.TikaLoader;
import org.apache.tika.exception.TikaConfigException;
import org.apache.tika.exception.TikaException;
import org.apache.tika.metadata.Metadata;
@@ -101,7 +102,7 @@ class TikaGrpcServerImpl extends TikaGrpc.TikaImplBase {
String tikaConfigPath;
- TikaGrpcServerImpl(String tikaConfigPath, String pipesPlugins)
+ TikaGrpcServerImpl(String tikaConfigPath)
throws TikaConfigException, IOException, ParserConfigurationException,
TransformerException, SAXException {
File tikaConfigFile = new File(tikaConfigPath);
@@ -114,7 +115,7 @@ class TikaGrpcServerImpl extends TikaGrpc.TikaImplBase {
tikaConfigFile = tmpTikaConfigFile;
tikaConfigPath = tikaConfigFile.getAbsolutePath();
}
- pipesConfig = PipesConfig.load(tikaConfigFile.toPath());
+ pipesConfig = TikaLoader.load(tikaConfigFile.toPath()).configs().load("pipes", PipesConfig.class);
pipesClient = new PipesClient(pipesConfig);
expiringFetcherStore = new ExpiringFetcherStore(pipesConfig.getStaleFetcherTimeoutSeconds(),
diff --git a/tika-langdetect/tika-langdetect-opennlp/pom.xml b/tika-langdetect/tika-langdetect-opennlp/pom.xml
index f40614fe5..05f203807 100644
--- a/tika-langdetect/tika-langdetect-opennlp/pom.xml
+++ b/tika-langdetect/tika-langdetect-opennlp/pom.xml
@@ -70,6 +70,10 @@
<Automatic-Module-Name>org.apache.tika.langdetect.opennlp</Automatic-Module-Name>
</manifestEntries>
</archive>
+ <includes>
+ <include>**/*</include>
+ <include>META-INF/tika/**</include>
+ </includes>
</configuration>
</plugin>
</plugins>
diff --git a/tika-langdetect/tika-langdetect-optimaize/pom.xml b/tika-langdetect/tika-langdetect-optimaize/pom.xml
index cd26c6e96..f24165277 100644
--- a/tika-langdetect/tika-langdetect-optimaize/pom.xml
+++ b/tika-langdetect/tika-langdetect-optimaize/pom.xml
@@ -70,6 +70,10 @@
<Automatic-Module-Name>org.apache.tika.langdetect.optimaize</Automatic-Module-Name>
</manifestEntries>
</archive>
+ <includes>
+ <include>**/*</include>
+ <include>META-INF/tika/**</include>
+ </includes>
</configuration>
</plugin>
</plugins>
diff --git a/tika-server/tika-server-core/pom.xml b/tika-server/tika-server-core/pom.xml
index 7ba082fb2..8995fa7cb 100644
--- a/tika-server/tika-server-core/pom.xml
+++ b/tika-server/tika-server-core/pom.xml
@@ -170,6 +170,10 @@
<Automatic-Module-Name>org.apache.tika.server.core</Automatic-Module-Name>
</manifestEntries>
</archive>
+ <includes>
+ <include>**/*</include>
+ <include>META-INF/tika/**</include>
+ </includes>
</configuration>
<executions>
<execution>
diff --git a/tika-server/tika-server-standard/src/test/resources/configs/cxf-test-base-template.json b/tika-server/tika-server-standard/src/test/resources/configs/cxf-test-base-template.json
new file mode 100644
index 000000000..740d5d26b
--- /dev/null
+++ b/tika-server/tika-server-standard/src/test/resources/configs/cxf-test-base-template.json
@@ -0,0 +1,57 @@
+{
+ "fetchers": {
+ "file-system-fetcher": {
+ "fsf": {
+ "basePath": "FETCHER_BASE_PATH",
+ "extractFileSystemMetadata": false
+ }
+ }
+ },
+ "emitters": {
+ "file-system-emitter": {
+ "fse-json": {
+ "basePath": "JSON_EMITTER_BASE_PATH",
+ "fileExtension": "json",
+ "onExists": "EXCEPTION"
+ },
+ "fse-bytes": {
+ "basePath": "BYTES_EMITTER_BASE_PATH",
+ "fileExtension": "",
+ "onExists": "EXCEPTION"
+ }
+ }
+ },
+ "server": {
+ "port": 9999,
+ "taskTimeoutMillis": TIMEOUT_MILLIS,
+ "taskPulseMillis": 100,
+ "enableUnsecureFeatures": true,
+ "endpoints": [
+ "rmeta",
+ "status",
+ "async",
+ "pipes"
+ ]
+ },
+ "async": {
+ "tikaConfig": "TIKA_CONFIG",
+ "numClients": 2,
+ "timeoutMillis": TIMEOUT_MILLIS,
+ "emitIntermediateResults": false,
+ "forkedJvmArgs": [
+ "-Xmx512m"
+ ],
+ "maxForEmitBatchBytes": 1000000
+ },
+ "auto-detect-parser-config": {
+ "spoolToDisk": 1000000,
+ "outputThreshold": 1000000,
+ "digesterFactory": {
+ "@class": "org.apache.tika.parser.digestutils.CommonsDigesterFactory",
+ "markLimit": 100000,
+ "algorithmString": "md5,sha1:32"
+ },
+ "throwOnZeroBytes": false
+ },
+ "plugin-roots": "PLUGINS_PATHS"
+}
\ No newline at end of file