Compare commits

...

16 Commits

Author SHA1 Message Date
alfresco-build
9d60e36682 [maven-release-plugin][skip ci] prepare release 23.1.0.231 2023-09-27 13:08:17 +00:00
Tom Page
248fecd030 ACS-4953 Add builder to TAS highlight POJO. (#2214)
* ACS-4953 Add builder to TAS highlight POJO.

Also rename ResponseHighLightModel to ResponseHighlightModel.
2023-09-27 12:13:11 +01:00
alfresco-build
d3498f4bc4 [maven-release-plugin][skip ci] prepare for next development iteration 2023-09-27 04:48:50 +00:00
alfresco-build
a862b8f829 [maven-release-plugin][skip ci] prepare release 23.1.0.230 2023-09-27 04:48:48 +00:00
Piotr Żurek
73a3f9bb19 ACS-6015 Add -parameters compiler flag (#2212) 2023-09-27 06:03:42 +02:00
alfresco-build
71063661ea [maven-release-plugin][skip ci] prepare for next development iteration 2023-09-26 11:10:23 +00:00
alfresco-build
449c58adad [maven-release-plugin][skip ci] prepare release 23.1.0.229 2023-09-26 11:10:21 +00:00
dependabot[bot]
94066cc682 Bump org.apache.httpcomponents.core5:httpcore5 from 5.2.2 to 5.2.3 (#2201)
Bumps [org.apache.httpcomponents.core5:httpcore5](https://github.com/apache/httpcomponents-core) from 5.2.2 to 5.2.3.
- [Changelog](https://github.com/apache/httpcomponents-core/blob/master/RELEASE_NOTES.txt)
- [Commits](https://github.com/apache/httpcomponents-core/compare/rel/v5.2.2...rel/v5.2.3)

---
updated-dependencies:
- dependency-name: org.apache.httpcomponents.core5:httpcore5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 12:02:14 +02:00
alfresco-build
52991462a7 [maven-release-plugin][skip ci] prepare for next development iteration 2023-09-26 08:50:17 +00:00
alfresco-build
e530ffb9b6 [maven-release-plugin][skip ci] prepare release 23.1.0.228 2023-09-26 08:50:14 +00:00
Kacper Magdziarz
5e0c592fe9 [ACS-6011] Upgrade to Jakarta compatible ATS (#2210) 2023-09-26 09:25:16 +02:00
dependabot[bot]
fb3552945e Bump org.slf4j:slf4j-api from 2.0.7 to 2.0.9 (#2175)
Bumps org.slf4j:slf4j-api from 2.0.7 to 2.0.9.

---
updated-dependencies:
- dependency-name: org.slf4j:slf4j-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-26 02:53:31 +05:30
alfresco-build
8a43c5741d [maven-release-plugin][skip ci] prepare for next development iteration 2023-09-25 16:16:05 +00:00
alfresco-build
6af36ae79e [maven-release-plugin][skip ci] prepare release 23.1.0.227 2023-09-25 16:16:02 +00:00
Piotr Żurek
d1585e4578 ACS-6057 Gytheio removal (#2206) 2023-09-25 17:31:36 +02:00
alfresco-build
dee199da5e [maven-release-plugin][skip ci] prepare for next development iteration 2023-09-25 15:06:39 +00:00
37 changed files with 480 additions and 131 deletions

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<build>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-parent</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<build>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<modules>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-amps</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<dependencies>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<dependencies>

View File

@@ -9,6 +9,6 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
</project>

View File

@@ -208,10 +208,6 @@ Hibernate http://www.hibernate.org/
jid3lib http://javamusictag.sourceforge.net/
TinyMCE http://www.tinymce.com/
=== LGPL 3.0 ===
Gytheio https://github.com/Alfresco/gytheio
=== MIT License ===
Bouncy Castle http://www.bouncycastle.org/

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<properties>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<modules>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<modules>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<organization>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<developers>

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<developers>

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<properties>

View File

@@ -44,6 +44,7 @@
package org.alfresco.rest.search;
import java.util.List;
import java.util.Objects;
import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
@@ -52,11 +53,11 @@ import org.alfresco.utility.model.TestModel;
* @author Michael Suzuki
*
*/
public class ResponseHighLightModel extends TestModel implements IRestModel<ResponseHighLightModel>
public class ResponseHighlightModel extends TestModel implements IRestModel<ResponseHighlightModel>
{
private ResponseHighLightModel model;
private ResponseHighlightModel model;
private String field;
private List<Object> snippets;
private List<String> snippets;
public String getField()
{
@@ -66,19 +67,44 @@ public class ResponseHighLightModel extends TestModel implements IRestModel<Resp
{
this.field = field;
}
public List<Object> getSnippets()
public List<String> getSnippets()
{
return snippets;
}
public void setSnippets(List<Object> snippets)
public void setSnippets(List<String> snippets)
{
this.snippets = snippets;
}
@Override
public ResponseHighLightModel onModel()
public ResponseHighlightModel onModel()
{
return model;
}
@Override
public boolean equals(Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
ResponseHighlightModel that = (ResponseHighlightModel) o;
return Objects.equals(model, that.model) && Objects.equals(field, that.field) && Objects.equals(snippets, that.snippets);
}
@Override
public int hashCode()
{
return Objects.hash(model, field, snippets);
}
@Override
public String toString()
{
return "ResponseHighlightModel{model=%s, field=%s, snippets=%s}".formatted(model, field, snippets);
}
}

View File

@@ -2,23 +2,23 @@
* #%L
* alfresco-tas-restapi
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
@@ -33,62 +33,38 @@ import org.alfresco.rest.core.IRestModel;
import org.alfresco.utility.model.TestModel;
/**
* Generated by 'msuzuki' on '2017-02-23 13:41' from 'Alfresco Search REST API' swagger file
* Generated by 'msuzuki' on '2017-02-23 13:41' from 'Alfresco Search REST API' swagger file
* Generated from 'Alfresco Search REST API' swagger file
* Base Path {@linkplain /alfresco/api/-default-/public/search/versions/1}
*/
public class RestRequestHighlightModel extends TestModel implements IRestModel<RestRequestHighlightModel>
{
@JsonProperty(value = "entry")
@JsonProperty("entry")
RestRequestHighlightModel model;
/** The string used to mark the start of a highlight in a fragment. */
private String prefix;
/** The string used to mark the end of a highlight in a fragment. */
private String postfix;
/** The maximum number of distinct highlight snippets to return for each highlight field. */
private int snippetCount;
/** The character length of each snippet. */
private int fragmentSize;
/** The number of characters to be considered for highlighting. Matches after this count will not be shown. */
private int maxAnalyzedChars;
/** If fragments overlap they can be merged into one larger fragment */
private boolean mergeContiguous;
/** Should phrases be identified. */
private boolean usePhraseHighlighter;
/** The fields to highlight and field specific configuration properties for each field */
private List<RestRequestFieldsModel> fields;
@Override
public RestRequestHighlightModel onModel()
{
return model;
}
/**
The string used to mark the start of a highlight in a fragment.
*/
private String prefix;
/**
The string used to mark the end of a highlight in a fragment.
*/
private String postfix;
/**
The maximum number of distinct highlight snippets to return for each highlight field.
*/
private int snippetCount;
/**
The character length of each snippet.
*/
private int fragmentSize;
/**
The number of characters to be considered for highlighting. Matches after this count will not be shown.
*/
private int maxAnalyzedChars;
/**
If fragments over lap they can be merged into one larger fragment
*/
private boolean mergeContiguous;
/**
Should phrases be identified.
*/
private boolean usePhraseHighlighter;
/**
The fields to highlight and field specific configuration properties for each field
*/
private List<RestRequestFieldsModel> fields;
public String getPrefix()
{
return this.prefix;
@@ -97,7 +73,7 @@ public class RestRequestHighlightModel extends TestModel implements IRestModel<R
public void setPrefix(String prefix)
{
this.prefix = prefix;
}
}
public String getPostfix()
{
@@ -107,7 +83,7 @@ public class RestRequestHighlightModel extends TestModel implements IRestModel<R
public void setPostfix(String postfix)
{
this.postfix = postfix;
}
}
public int getSnippetCount()
{
@@ -117,7 +93,7 @@ public class RestRequestHighlightModel extends TestModel implements IRestModel<R
public void setSnippetCount(int snippetCount)
{
this.snippetCount = snippetCount;
}
}
public int getFragmentSize()
{
@@ -127,7 +103,7 @@ public class RestRequestHighlightModel extends TestModel implements IRestModel<R
public void setFragmentSize(int fragmentSize)
{
this.fragmentSize = fragmentSize;
}
}
public int getMaxAnalyzedChars()
{
@@ -137,9 +113,9 @@ public class RestRequestHighlightModel extends TestModel implements IRestModel<R
public void setMaxAnalyzedChars(int maxAnalyzedChars)
{
this.maxAnalyzedChars = maxAnalyzedChars;
}
}
public boolean getMergeContiguous()
public boolean isMergeContiguous()
{
return this.mergeContiguous;
}
@@ -147,9 +123,9 @@ public class RestRequestHighlightModel extends TestModel implements IRestModel<R
public void setMergeContiguous(boolean mergeContiguous)
{
this.mergeContiguous = mergeContiguous;
}
}
public boolean getUsePhraseHighlighter()
public boolean isUsePhraseHighlighter()
{
return this.usePhraseHighlighter;
}
@@ -157,7 +133,7 @@ public class RestRequestHighlightModel extends TestModel implements IRestModel<R
public void setUsePhraseHighlighter(boolean usePhraseHighlighter)
{
this.usePhraseHighlighter = usePhraseHighlighter;
}
}
public List<RestRequestFieldsModel> getFields()
{
@@ -167,6 +143,85 @@ public class RestRequestHighlightModel extends TestModel implements IRestModel<R
public void setFields(List<RestRequestFieldsModel> fields)
{
this.fields = fields;
}
}
public static RestRequestHighlightModelBuilder builder()
{
return new RestRequestHighlightModelBuilder();
}
public static class RestRequestHighlightModelBuilder
{
private String prefix;
private String postfix;
private int snippetCount;
private int fragmentSize;
private int maxAnalyzedChars;
private boolean mergeContiguous;
private boolean usePhraseHighlighter;
private List<RestRequestFieldsModel> fields;
public RestRequestHighlightModelBuilder prefix(String prefix)
{
this.prefix = prefix;
return this;
}
public RestRequestHighlightModelBuilder postfix(String postfix)
{
this.postfix = postfix;
return this;
}
public RestRequestHighlightModelBuilder snippetCount(int snippetCount)
{
this.snippetCount = snippetCount;
return this;
}
public RestRequestHighlightModelBuilder fragmentSize(int fragmentSize)
{
this.fragmentSize = fragmentSize;
return this;
}
public RestRequestHighlightModelBuilder maxAnalyzedChars(int maxAnalyzedChars)
{
this.maxAnalyzedChars = maxAnalyzedChars;
return this;
}
public RestRequestHighlightModelBuilder mergeContinuous(boolean mergeContiguous)
{
this.mergeContiguous = mergeContiguous;
return this;
}
public RestRequestHighlightModelBuilder usePhraseHighlighter(boolean usePhraseHighlighter)
{
this.usePhraseHighlighter = usePhraseHighlighter;
return this;
}
public RestRequestHighlightModelBuilder fields(List<String> fields)
{
this.fields = fields.stream().map(field -> new RestRequestFieldsModel(field)).toList();
return this;
}
public RestRequestHighlightModel build()
{
RestRequestHighlightModel highlightModel = new RestRequestHighlightModel();
highlightModel.setPrefix(prefix);
highlightModel.setPostfix(postfix);
highlightModel.setSnippetCount(snippetCount);
highlightModel.setFragmentSize(fragmentSize);
highlightModel.setMaxAnalyzedChars(maxAnalyzedChars);
highlightModel.setMergeContiguous(mergeContiguous);
highlightModel.setUsePhraseHighlighter(usePhraseHighlighter);
highlightModel.setFields(fields);
return highlightModel;
}
}
}

View File

@@ -60,7 +60,7 @@ public class SearchScoreModel extends TestModel implements IRestModel<SearchScor
@JsonProperty(required = true)
private float score;
private List<ResponseHighLightModel> highlight;
private List<ResponseHighlightModel> highlight;
public float getScore()
{
@@ -78,12 +78,12 @@ public class SearchScoreModel extends TestModel implements IRestModel<SearchScor
return this;
}
public List<ResponseHighLightModel> getHighlight()
public List<ResponseHighlightModel> getHighlight()
{
return highlight;
}
public void setHighlight(List<ResponseHighLightModel> highlight)
public void setHighlight(List<ResponseHighlightModel> highlight)
{
this.highlight = highlight;
}

View File

@@ -9,7 +9,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-tests</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<developers>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo-packaging</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<properties>

27
pom.xml
View File

@@ -2,7 +2,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">
<modelVersion>4.0.0</modelVersion>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
<packaging>pom</packaging>
<name>Alfresco Community Repo Parent</name>
@@ -51,13 +51,14 @@
<dependency.alfresco-server-root.version>7.0.1</dependency.alfresco-server-root.version>
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
<dependency.activiti.version>5.23.0</dependency.activiti.version>
<dependency.alfresco-transform-service.version>3.1.0-M1</dependency.alfresco-transform-service.version>
<dependency.alfresco-transform-service.version>4.0.0-A1</dependency.alfresco-transform-service.version>
<dependency.alfresco-transform-core.version>5.0.0-A2</dependency.alfresco-transform-core.version>
<dependency.alfresco-greenmail.version>7.0</dependency.alfresco-greenmail.version>
<dependency.acs-event-model.version>0.0.23</dependency.acs-event-model.version>
<dependency.aspectj.version>1.9.20.1</dependency.aspectj.version>
<dependency.spring.version>6.0.9</dependency.spring.version>
<dependency.spring.version>6.0.12</dependency.spring.version>
<dependency.spring-security.version>6.1.4</dependency.spring-security.version>
<dependency.antlr.version>3.5.3</dependency.antlr.version>
<dependency.jackson.version>2.15.2</dependency.jackson.version>
<dependency.cxf.version>4.0.2</dependency.cxf.version>
@@ -74,15 +75,13 @@
<dependency.httpclient.version>4.5.14</dependency.httpclient.version>
<dependency.httpcore.version>4.4.16</dependency.httpcore.version>
<dependency.httpcomponents-httpclient5.version>5.2.1</dependency.httpcomponents-httpclient5.version>
<dependency.httpcomponents-httpcore5.version>5.2.2</dependency.httpcomponents-httpcore5.version>
<dependency.httpcomponents-httpcore5.version>5.2.3</dependency.httpcomponents-httpcore5.version>
<dependency.commons-httpclient.version>3.1-HTTPCLIENT-1265</dependency.commons-httpclient.version>
<dependency.xercesImpl.version>2.12.2</dependency.xercesImpl.version>
<dependency.slf4j.version>2.0.7</dependency.slf4j.version>
<dependency.slf4j.version>2.0.9</dependency.slf4j.version>
<dependency.log4j.version>2.20.0</dependency.log4j.version>
<dependency.gytheio.version>0.20.0-A1</dependency.gytheio.version>
<dependency.groovy.version>3.0.19</dependency.groovy.version>
<dependency.tika.version>2.4.1</dependency.tika.version>
<dependency.spring-security.version>6.1.3</dependency.spring-security.version>
<dependency.truezip.version>7.7.10</dependency.truezip.version>
<dependency.poi.version>5.2.2</dependency.poi.version>
<dependency.poi-ooxml-lite.version>5.2.3</dependency.poi-ooxml-lite.version>
@@ -154,7 +153,7 @@
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
<url>https://github.com/Alfresco/alfresco-community-repo</url>
<tag>23.1.0.226</tag>
<tag>23.1.0.231</tag>
</scm>
<distributionManagement>
@@ -968,6 +967,16 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<!-- Ensure consistent maven-release-plugin version-->
<plugin>
<artifactId>maven-release-plugin</artifactId>
@@ -1036,7 +1045,7 @@
<configuration>
<failOnMissing>true</failOnMissing>
<excludedScopes>provided,test</excludedScopes>
<excludedGroups>^(org\.alfresco|com\.alfresco|org\.activiti|org\.gytheio).*</excludedGroups>
<excludedGroups>^(org\.alfresco|com\.alfresco|org\.activiti).*</excludedGroups>
<failIfWarning>true</failIfWarning>
<includedLicenses>
https://raw.githubusercontent.com/Alfresco/third-party-license-overrides/master/includedLicenses.txt

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<dependencies>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>23.1.0.226</version>
<version>23.1.0.231</version>
</parent>
<dependencies>
@@ -560,21 +560,6 @@
<artifactId>alfresco-sync-events</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.gytheio</groupId>
<artifactId>gytheio-messaging-camel</artifactId>
<version>${dependency.gytheio.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
@@ -877,6 +862,9 @@
<showWeaveInfo>true</showWeaveInfo>
<source>1.8</source>
<target>1.8</target>
<additionalCompilerArgs>
<arg>-parameters</arg>
</additionalCompilerArgs>
</configuration>
<dependencies>
<dependency>

View File

@@ -0,0 +1,42 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.messaging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LoggingDeadLetterQueue
{
private static final Logger LOG = LoggerFactory.getLogger(LoggingDeadLetterQueue.class);
public void onReceive(Object message)
{
if (message != null)
{
LOG.debug("Received:\n\n{}}\n\n", message);
}
}
}

View File

@@ -0,0 +1,93 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.messaging.jackson;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serial;
import java.io.StringWriter;
import org.apache.commons.io.IOUtils;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
public class ObjectMapperFactory
{
private ObjectMapperFactory()
{
//no instantiation
}
public static ObjectMapper createInstance()
{
QpidJsonBodyCleanerObjectMapper mapper = new QpidJsonBodyCleanerObjectMapper();
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
return mapper;
}
private static class QpidJsonBodyCleanerObjectMapper extends ObjectMapper
{
@Serial
private static final long serialVersionUID = 2568701685293341501L;
private static final String DEFAULT_ENCODING = "utf8";
public <T> T readValue(InputStream inputStream, Class<T> valueType) throws IOException
{
try
{
// Try to unmarshal normally
if (inputStream.markSupported())
{
inputStream.mark(1024 * 512);
}
return super.readValue(inputStream, valueType);
}
catch (JsonParseException e)
{
if (!inputStream.markSupported())
{
// We can't reset this stream, bail out
throw e;
}
// Reset the stream
inputStream.reset();
}
// Clean the message body and try again
StringWriter writer = new StringWriter();
IOUtils.copy(inputStream, writer, DEFAULT_ENCODING);
String content = writer.toString();
content = content.substring(content.indexOf('{'));
return readValue(content, valueType);
}
}
}

View File

@@ -74,8 +74,6 @@ import org.alfresco.util.transaction.TransactionSupportUtil;
import org.apache.chemistry.opencmis.commons.server.CallContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.gytheio.messaging.MessageProducer;
import org.gytheio.messaging.MessagingException;
import com.google.common.base.Splitter;
import com.google.common.collect.Sets;
@@ -294,7 +292,7 @@ public abstract class AbstractEventsService extends TransactionListenerAdapter
}
/**
* Filter out event before sending them to {@link org.gytheio.messaging.MessageProducer}
* Filter out event before sending them to {@link MessageProducer}
*
* @param events the events to be filtered
*

View File

@@ -0,0 +1,57 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.events;
import java.util.Map;
import java.util.Objects;
import org.apache.camel.ProducerTemplate;
class CamelMessageProducer implements MessageProducer
{
private static final Map<String, Object> AMQP_HEADERS = Map.of("JMS_AMQP_MESSAGE_FORMAT", 0L);
private final ProducerTemplate producer;
private final String endpoint;
CamelMessageProducer(ProducerTemplate producer, String endpoint)
{
this.producer = Objects.requireNonNull(producer);
this.endpoint = Objects.requireNonNull(endpoint);
}
@Override
public void send(Object message)
{
try
{
producer.sendBodyAndHeaders(endpoint, message, AMQP_HEADERS);
}
catch (Exception e)
{
throw new MessagingException("Could not send message", e);
}
}
}

View File

@@ -30,8 +30,6 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.tenant.TenantUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.gytheio.messaging.MessageProducer;
import org.gytheio.messaging.MessagingException;
public class ExceptionEventsServiceImpl extends AbstractEventsService implements ExceptionEventsService
{

View File

@@ -0,0 +1,37 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.events;
public interface MessageProducer
{
/**
* Send the given POJO message to the default queue for the producer
*
* @param message message to send
* @throws MessagingException on failure
*/
void send(Object message) throws MessagingException;
}

View File

@@ -0,0 +1,50 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2023 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.events;
import java.io.Serial;
import java.time.LocalDate;
import java.util.concurrent.atomic.AtomicInteger;
public class MessagingException extends RuntimeException
{
@Serial
private static final long serialVersionUID = 8192266871339806688L;
private static final AtomicInteger ERROR_COUNTER = new AtomicInteger();
public MessagingException(String message, Throwable cause)
{
super(buildErrorLogNumber(message), cause);
}
private static String buildErrorLogNumber(String message)
{
final LocalDate today = LocalDate.now();
message = message == null ? "" : message;
return "%02d%02d%04d %s".formatted(today.getMonthValue(), today.getDayOfMonth(), ERROR_COUNTER.getAndIncrement(), message);
}
}

View File

@@ -9,9 +9,9 @@
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="eventsDispatcher" class="org.gytheio.messaging.camel.CamelMessageProducer">
<property name="producer" ref="camelProducerTemplate" />
<property name="endpoint" value="direct:alfresco.events" />
<bean id="eventsDispatcher" class="org.alfresco.repo.events.CamelMessageProducer">
<constructor-arg ref="camelProducerTemplate" />
<constructor-arg value="direct:alfresco.events" />
</bean>
<bean id="eventsRegistry" class="org.alfresco.sync.events.EventRegistryImpl">

View File

@@ -11,7 +11,7 @@
<context:component-scan base-package="org.alfresco.messaging.camel.configuration"/>
<bean id="messagingObjectMapper" class="org.gytheio.messaging.jackson.ObjectMapperFactory"
<bean id="messagingObjectMapper" class="org.alfresco.messaging.jackson.ObjectMapperFactory"
factory-method="createInstance" />
<bean id="defaultDataFormat" class="org.apache.camel.component.jackson.JacksonDataFormat">
@@ -96,6 +96,6 @@
</bean>
<!-- In the default routes, this is where a message goes if no queue is specified -->
<bean id="deadLetterQueue" class="org.gytheio.messaging.LoggingDeadLetterQueue" />
<bean id="deadLetterQueue" class="org.alfresco.messaging.LoggingDeadLetterQueue" />
</beans>