Skip to content

Commit 87d5d61

Browse files
authored
Merge pull request #500 from collectionspace/develop
Merge Release 8.3.0-RC.1
2 parents 8d7171a + 000faad commit 87d5d61

98 files changed

Lines changed: 4188 additions & 1021 deletions

File tree

Some content is hidden

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

3rdparty/nuxeo/nuxeo-platform-elasticsearch/src/main/java/org/collectionspace/services/nuxeo/elasticsearch/DefaultESDocumentWriter.java

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ public ObjectNode getDenormValues(DocumentModel doc) {
7878
List<Map<String, Object>> prodDateGroupList = (List<Map<String, Object>>) doc.getProperty("collectionobjects_common", "objectProductionDateGroupList");
7979

8080
denormValues.putArray("prodYears").addAll(structDatesToYearNodes(prodDateGroupList));
81+
} else if ("Media".equals(docType) && isMediaPublished(doc)) {
82+
CoreSession session = doc.getCoreSession();
83+
String csid = doc.getName();
84+
String tenantId = (String) doc.getProperty("collectionspace_core", "tenantId");
85+
86+
// Add media-specific denormalized fields
87+
denormRelatedObjects(session, csid, tenantId, denormValues);
8188
}
8289

8390
return denormValues;
@@ -135,6 +142,31 @@ private void denormMediaRecords(CoreSession session, String csid, String tenantI
135142
denormValues.put("hasMedia", mediaCsids.size() > 0);
136143
}
137144

145+
private void denormRelatedObjects(CoreSession session, String csid, String tenantId, ObjectNode denormValues) {
146+
// Store the objectCsid of objects that are related to this media.
147+
148+
String relatedRecordQuery = String.format(
149+
"SELECT * FROM Relation WHERE relations_common:objectCsid = '%s' AND relations_common:subjectDocumentType = 'CollectionObject' AND ecm:currentLifeCycleState = 'project' AND collectionspace_core:tenantId = '%s'",
150+
csid, tenantId);
151+
DocumentModelList relationDocs = session.query(relatedRecordQuery);
152+
List<JsonNode> objectCsids = new ArrayList<JsonNode>();
153+
154+
if (relationDocs.size() > 0) {
155+
Iterator<DocumentModel> iterator = relationDocs.iterator();
156+
157+
while (iterator.hasNext()) {
158+
DocumentModel relationDoc = iterator.next();
159+
String objectCsid = (String) relationDoc.getProperty("relations_common", "subjectCsid");
160+
161+
if (objectCsid != null) {
162+
objectCsids.add(new TextNode(objectCsid));
163+
}
164+
}
165+
}
166+
167+
denormValues.putArray("objectCsid").addAll(objectCsids);
168+
}
169+
138170
private void denormAcquisitionRecords(CoreSession session, String csid, String tenantId, ObjectNode denormValues) {
139171
// Store the credit lines of acquisition records that are related to this object.
140172

@@ -266,6 +298,7 @@ private void denormConceptFields(final DocumentModel doc, final ObjectNode denor
266298
final List<String> fields = Arrays.asList("contentConcepts",
267299
"contentEvents",
268300
"contentPersons",
301+
"contentPlaces",
269302
"contentOrganizations");
270303

271304
for (String field : fields) {
@@ -274,7 +307,18 @@ private void denormConceptFields(final DocumentModel doc, final ObjectNode denor
274307
for (String content : contentList) {
275308
if (content != null) {
276309
final ObjectNode node = objectMapper.createObjectNode();
277-
node.put("subject", RefNameUtils.getDisplayName(content));
310+
String subjectValue;
311+
312+
if (RefNameUtils.isTermRefname(content)) {
313+
try {
314+
subjectValue = RefNameUtils.getDisplayName(content);
315+
} catch (Exception e) {
316+
subjectValue = content;
317+
}
318+
} else {
319+
subjectValue = content;
320+
}
321+
node.put("subject", subjectValue);
278322
denormContentSubject.add(node);
279323
}
280324
}

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# CollectionSpace Services Changelog
2+
3+
## 8.3.0
4+
5+
* Add new endpoint for returning search results
6+
* Add JDBC_URL_OPTS build parameter
7+
* Add mapping for ElasticSearch imagine ordering
8+
* Add CSV Authority export parameter
9+
* Update notice of inventory completion report
10+
* Update notice of intent to repatriate report
11+
* Update full object with place details report
12+
* Add contentPlaces to ES mapping
13+
* Add blob alt text to media responses
14+
* Remove cspace_english namespace search
15+
16+
### Bug Fixes
17+
18+
* Remove flickr urls from tests

build.properties

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ host=127.0.0.1
99
#
1010
# Release version info
1111
#
12-
release.version=8.2.0
12+
release.version=8.3.0-RC.1
1313
cspace.release=${release.version}
1414
cspace.instance.id=${env.CSPACE_INSTANCE_ID}
1515

@@ -27,15 +27,15 @@ cspace.im.root=
2727
# UI settings
2828
cspace.ui.package.name=cspace-ui
2929
cspace.ui.library.name=cspaceUI
30-
cspace.ui.version=10.1.0
31-
cspace.ui.build.branch=main
30+
cspace.ui.version=10.2.0-rc1.0
31+
cspace.ui.build.branch=develop
3232
cspace.ui.build.node.ver=20
3333
service.ui.library.name=${cspace.ui.library.name}-service
3434

3535
# Public browser settings
3636
cspace.public.browser.package.name=@collectionspace/cspace-public-browser
3737
cspace.public.browser.library.name=cspacePublicBrowser
38-
cspace.public.browser.version=3.4.0
38+
cspace.public.browser.version=3.5.0-rc1.0
3939
cspace.public.browser.build.branch=main
4040
cspace.public.browser.build.node.ver=20
4141

@@ -198,10 +198,11 @@ db.jdbc.default.datasource=jdbc/default
198198
#db.jdbc.urloptions.encoded=ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;foo=true
199199

200200
#
201-
# By default, as placeholders, we'll supply meaningless JDBC options -both encoded and non-encode forms.
201+
# Use the JDBC_URL_PARAMS env var to set the urloptions for the jdbc connection string
202+
# The db.jdbc.urloptions.encoded needs to be created in each ant target which uses it by calling the
203+
# urlencode scriptdef. We can still reference it below as it will be added at runtime.
202204
#
203-
db.jdbc.urloptions=foo=true&bar=false
204-
db.jdbc.urloptions.encoded=foo=true&amp;bar=false
205+
db.jdbc.urloptions=${env.JDBC_URL_PARAMS}
205206

206207
#
207208
# JDBC urls that CollectionSpace needs to talk to the "admin" database, Nuxeo databases, and the "cspace" database (i.e., the AuthN/AuthZ database)

build.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
<os family="windows" />
1515
</condition>
1616

17+
<scriptdef name="urlencode" language="javascript">
18+
<attribute name="property"/>
19+
<![CDATA[
20+
var value = self.project.getProperty(attributes.get("property"));
21+
var encoded = encodeURIComponent(value);
22+
self.project.setProperty(attributes.get("property") + ".encoded", encoded)
23+
]]>
24+
</scriptdef>
25+
1726
<target name="init">
1827
<!-- Create the time stamp -->
1928
<tstamp />
@@ -215,10 +224,10 @@
215224
</target>
216225

217226
<!--
218-
This target sends the 'create_nuxeo_db' and 'create_nuxeo_db' targets to all the Ant sub-modules/directories
219-
and creates some database utility functions
227+
This target calls the 'create_nuxeo_db' and 'create_cspace_db' targets and creates some database utility functions
220228
-->
221229
<target name="-create_db" depends="-validate_create_db_unix, -validate_create_db_windows">
230+
<urlencode property="db.jdbc.urloptions" />
222231
<antcall target="create_nuxeo_db" />
223232
<antcall target="create_cspace_db" />
224233
<antcall target="create_update_userid_db_function" />
@@ -303,6 +312,7 @@
303312
</target>
304313

305314
<target name="import" description="import default configuration">
315+
<urlencode property="db.jdbc.urloptions" />
306316
<ant antfile="services/build.xml" target="import" inheritAll="false" />
307317
</target>
308318

cspace-ui/anthro/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ tenant.ui.basename=/cspace/${tenant.shortname}
33

44
tenant.ui.profile.plugin.package.name=cspace-ui-plugin-profile-anthro
55
tenant.ui.profile.plugin.library.name=cspaceUIPluginProfileAnthro
6-
tenant.ui.profile.plugin.version=9.1.0
6+
tenant.ui.profile.plugin.version=9.2.0-rc1.0
77
tenant.ui.profile.plugin.build.branch=main
88

99
# If not set, defaults to /gateway/${tenant.shortname} on the current host.

pom.xml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<name>services</name>
1111

1212
<properties>
13-
<revision>8.2.0</revision>
13+
<revision>8.3.0-RC.1</revision>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<cspace.services.version>${revision}</cspace.services.version>
1616
<cspace.services.client.version>${revision}</cspace.services.client.version>
@@ -318,6 +318,63 @@
318318
</execution>
319319
</executions>
320320
</plugin>
321+
322+
<!-- Integration Test plugins: jetty, failsafe, and remote-resources -->
323+
<plugin>
324+
<groupId>org.eclipse.jetty</groupId>
325+
<artifactId>jetty-maven-plugin</artifactId>
326+
<version>9.4.57.v20241219</version>
327+
<executions>
328+
<execution>
329+
<id>start-jetty</id>
330+
<phase>pre-integration-test</phase>
331+
<goals>
332+
<goal>start</goal>
333+
</goals>
334+
<configuration>
335+
<skip>${skipTests}</skip>
336+
</configuration>
337+
</execution>
338+
<execution>
339+
<id>stop-jetty</id>
340+
<phase>post-integration-test</phase>
341+
<goals>
342+
<goal>stop</goal>
343+
</goals>
344+
</execution>
345+
</executions>
346+
</plugin>
347+
348+
<plugin>
349+
<groupId>org.apache.maven.plugins</groupId>
350+
<artifactId>maven-failsafe-plugin</artifactId>
351+
<version>3.5.3</version>
352+
<executions>
353+
<execution>
354+
<id>integration-test</id>
355+
<goals>
356+
<goal>integration-test</goal>
357+
</goals>
358+
</execution>
359+
<execution>
360+
<id>verify</id>
361+
<goals>
362+
<goal>verify</goal>
363+
</goals>
364+
</execution>
365+
</executions>
366+
<configuration>
367+
<includes>
368+
<include>**/*IT.class</include>
369+
</includes>
370+
</configuration>
371+
</plugin>
372+
373+
<plugin>
374+
<groupId>org.apache.maven.plugins</groupId>
375+
<artifactId>maven-remote-resources-plugin</artifactId>
376+
<version>3.3.0</version>
377+
</plugin>
321378
</plugins>
322379
</pluginManagement>
323380

services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/related/responses/sortRelated.res.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<itemsInPage>3</itemsInPage>
44
<totalItems>3</totalItems>
55
<fieldsReturned>
6-
csid|uri|refName|updatedAt|workflowState|identificationNumber|blobCsid|title
6+
csid|uri|refName|updatedAt|workflowState|altText|identificationNumber|blobCsid|title
77
</fieldsReturned>
88
<list-item>
99
<csid>${first}</csid>
@@ -32,4 +32,4 @@
3232
<workflowState>project</workflowState>
3333
<identificationNumber>${identificationNumberLast}</identificationNumber>
3434
</list-item>
35-
</ns2:abstract-common-list>
35+
</ns2:abstract-common-list>

services/JaxRsServiceProvider/build.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
</description>
66
<!-- set global properties for this build -->
77
<property name="services.trunk" value="../.."/>
8+
<import file="${services.trunk}/build.xml" />
89
<!-- enviornment should be declared before reading build.properties -->
910
<property environment="env" />
1011
<property file="${services.trunk}/build.properties" />
11-
<property name="application.trunk" location="${services.trunk}/../application" />
12-
<property name="cspace.tool.csmake" value="csmake" />
12+
<property name="application.trunk" location="${services.trunk}/../application" />
13+
<property name="cspace.tool.csmake" value="csmake" />
1314
<property name="mvn.opts" value="-V" />
1415
<property name="src" location="src"/>
1516

@@ -52,10 +53,12 @@
5253

5354
<target name="package" depends="package-unix,package-windows"
5455
description="Package CollectionSpace Services" />
56+
<urlencode property="db.jdbc.urloptions" />
5557
<target name="package-unix" if="osfamily-unix">
5658
<exec executable="mvn" failonerror="true">
5759
<arg value="package" />
5860
<arg value="-Dmaven.test.skip=true" />
61+
<arg value="-Ddb.jdbc.urloptions.encoded=${db.jdbc.urloptions.encoded}" />
5962
<arg value="-f" />
6063
<arg value="${basedir}/pom.xml" />
6164
<arg value="-N" />
@@ -150,15 +153,15 @@
150153
<delete dir="${jee.deploy.cspace}/${cspace.services.context}"/>
151154
<copy file="${basedir}/target/${cspace.services.war}" todir="${jee.deploy.cspace}"/>
152155
</target>
153-
156+
154157
<!--
155158
This target attempts to generate a set of Service artifacts (Nuxeo bundles and tenant bindings) by using the
156159
Application layer's configuration files.
157-
160+
158161
This target has a dependency on the Application layer's source tree. It assumes the Application layer's src tree root
159162
is a directory sibling of the Source layer's source tree root. Also, it assumes the "csmake.jar" exists in the target
160163
directory of the Application layer's "tomcat-main" module.
161-
164+
162165
This target also assumes that the system environment variable 'CSPACE_JEESERVER_HOME' is set and pointing to the root
163166
JEE server (usually Apache Tomcat) where CollectionSpace is installed. All generated Service artifacts wi
164167
-->

services/JaxRsServiceProvider/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,11 @@
466466
<artifactId>org.collectionspace.services.restrictedmedia.service</artifactId>
467467
<version>${project.version}</version>
468468
</dependency>
469+
<dependency>
470+
<groupId>org.collectionspace.services</groupId>
471+
<artifactId>org.collectionspace.services.advancedsearch.service</artifactId>
472+
<version>${project.version}</version>
473+
</dependency>
469474

470475
<!--dependency>
471476
<groupId>org.collectionspace.services</groupId>

services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import org.collectionspace.services.pottag.PottagResource;
6464
import org.collectionspace.services.report.ReportResource;
6565
import org.collectionspace.services.acquisition.AcquisitionResource;
66+
import org.collectionspace.services.advancedsearch.AdvancedSearch;
6667
import org.collectionspace.services.dimension.DimensionResource;
6768
import org.collectionspace.services.servicegroup.ServiceGroupResource;
6869
import org.collectionspace.services.structureddate.StructuredDateResource;
@@ -131,6 +132,7 @@ public CollectionSpaceJaxRsApplication() {
131132
singletons.add(new IndexResource());
132133
singletons.add(new LoginResource());
133134
singletons.add(new LogoutResource());
135+
singletons.add(new AdvancedSearch());
134136

135137
addResourceToMapAndSingletons(new VocabularyResource());
136138
addResourceToMapAndSingletons(new PersonAuthorityResource());

0 commit comments

Comments
 (0)