Skip to content

Commit

Permalink
Merge pull request #254 from georchestra/csw-getrecords-fix-23.0.x
Browse files Browse the repository at this point in the history
23.0.x - Fix for CSW getrecords requests issued by Mapstore
  • Loading branch information
pmauduit authored Oct 9, 2023
2 parents 437716d + aace248 commit fab90a7
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 20 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/georchestra-gn4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: Building georchestra-geonetwork4 artifacts
on:
push:
branches:
- georchestra-gn4.2.x
- georchestra-gn4.2.x-23.0.x
pull_request:
workflow_dispatch:

env:
DOCKER_TAG: 4.2.x
DOCKER_TAG: 23.0.x

jobs:
build:
Expand All @@ -23,6 +25,7 @@ jobs:
with:
repository: "georchestra/georchestra"
path: "georchestra"
ref: "23.0.x"

- name: "Setting up Java"
uses: actions/setup-java@v2
Expand Down Expand Up @@ -60,22 +63,20 @@ jobs:
-DdockerImageName=georchestra/geonetwork:${DOCKER_TAG} -DskipTests
- name: "publish the webapp as artifact"
if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x-23.0.x' && github.event_name != 'pull_request'
uses: actions/upload-artifact@v1
with:
name: geonetwork.war
path: web/target/geonetwork.war

- name: "Login onto docker-hub"
if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x-23.0.x' && github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'

- name: "Pushing branch image to docker-hub"
if: github.repository == 'georchestra/geonetwork' && github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/georchestra-gn4.2.x-23.0.x' && github.event_name != 'pull_request'
run: |
docker push georchestra/geonetwork:${DOCKER_TAG}
- name: "Pushing latest image to docker-hub"
run: |
docker tag georchestra/geonetwork:${DOCKER_TAG} georchestra/geonetwork:latest
docker push georchestra/geonetwork:latest
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ git*.properties
*/*/.*
*/*/target/
*/target/
.*/
**/.idea
**/.settings
GeoNetwork*
/geonetwork*
camel-harvesters/wfsfeature-harvester/logs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,17 @@ protected static String escapeLikeLiteral(String text) {
protected static String convertLikePattern(PropertyIsLike filter) {
String result = filter.getLiteral();
if (!filter.getWildCard().equals("*")) {
final String wildcardRe =
StringUtils.isNotEmpty(filter.getEscape())
? Pattern.quote(filter.getEscape() + filter.getWildCard())
: filter.getWildCard();
final String wildcardRe = "(?<!" + Pattern.quote(filter.getEscape()) + ")" + Pattern.quote(filter.getWildCard());
result = result.replaceAll(wildcardRe, "*");
}
if (!filter.getSingleChar().equals("?")) {
final String singleCharRe =
StringUtils.isNotEmpty(filter.getEscape())
? Pattern.quote(filter.getEscape() + filter.getSingleChar())
: filter.getSingleChar();
final String singleCharRe = "(?<!" + Pattern.quote(filter.getEscape()) + ")" + Pattern.quote(filter.getSingleChar());
result = result.replaceAll(singleCharRe, "?");
}
if (!filter.getEscape().equals("\\")) {
final String escapeRe = Pattern.quote(filter.getEscape()) + "(.)";
result = result.replaceAll(escapeRe, "\\\\$1");
}
return result;
}

Expand Down Expand Up @@ -365,7 +363,7 @@ public Object visit(PropertyIsEqualTo filter, Object extraData) {
String dataPropertyValue = stack.pop();
String dataPropertyName = stack.pop();

final String filterEqualTo = String.format(templateMatch, dataPropertyName, dataPropertyValue);
final String filterEqualTo = String.format(templateMatch, dataPropertyName, dataPropertyValue.replaceAll("\\/", "\\\\\\\\/"));
stack.push(filterEqualTo);

return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
</encoder>
</appender>

<root level="info">
<appender-ref ref="STDOUT"/>
</root>

<logger name="org.testcontainers" level="INFO"/>
<!-- The following logger can be used for containers logs since 1.18.0 -->
<logger name="tc" level="INFO"/>
<logger name="com.github.dockerjava" level="WARN"/>
<logger name="com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire" level="OFF"/>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# set by GeorchestraDatabaseContainer as a System property,
# so bad it looks like console doesn't resolve ${} placeholders
# so bad it looks like console doesn't resolve ${} placeholders
#pgsqlHost=${jdbc.host}
# set by GeorchestraDatabaseContainer as a System property
#pgsqlPort=${jdbc.port}
Expand Down Expand Up @@ -184,3 +184,9 @@ AreasGroup=INSEE_DEP
# Activates or disable GDPR-related endpoints
# default: true
#gdpr.allowAccountDeletion=true


rabbitmqHost=localhost
rabbitmqUser=
rabbitmqPassword=
rabbitmqPort=5672
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
</encoder>
</appender>

<root level="info">
<appender-ref ref="STDOUT"/>
</root>

<logger name="org.testcontainers" level="INFO"/>
<!-- The following logger can be used for containers logs since 1.18.0 -->
<logger name="tc" level="INFO"/>
<logger name="com.github.dockerjava" level="WARN"/>
<logger name="com.github.dockerjava.zerodep.shaded.org.apache.hc.client5.http.wire" level="OFF"/>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "Company",
"description": "Camptocamp SAS France",
"notes": "Internal CRM notes on Camptocamp",
"lastUpdated": "24166fee9b20a69a1ca402f1b84b80c77ad0fc263542d4de06ad86ec205e5555",
"lastUpdated": "2f42c3f432c75d6fc2b38b03048d3fed6f9a02bd303d5531efbcead0300c83b2",
"members": [
"testeditor"
]
Expand All @@ -22,7 +22,7 @@
"category": "Association",
"description": "Association PSC geOrchestra",
"notes": "Internal CRM notes on PSC",
"lastUpdated": "b9142a69098fecfb1b639d6a8e9ac091284a23f6cc103dc3f5ca71688e42d9c3",
"lastUpdated": "b7a295e9654cc4d3bdd8201feb1ac74dd23cc9ea2c9947f2b05b4118ac3bbe41",
"members": [
"testadmin",
"testuser"
Expand Down

0 comments on commit fab90a7

Please sign in to comment.