]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
Upgrade dom4j to 2.1.4.
authorRay Lee <ray.lee@lyrasis.org>
Fri, 14 Apr 2023 03:35:34 +0000 (23:35 -0400)
committerRay Lee <ray.lee@lyrasis.org>
Fri, 14 Apr 2023 03:36:35 +0000 (23:36 -0400)
This resolves a couple of dependabot alerts.

services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/FormatTaxonBatchJob.java
services/claim/service/pom.xml
services/client/pom.xml
services/contact/client/pom.xml
services/movement/service/pom.xml
services/person/service/pom.xml
services/pom.xml
services/pottag/service/pom.xml
services/propagation/service/pom.xml
services/workflow/service/pom.xml

index b745018f128b27a0c241718b8636f842b4cce3d7..948a29e1d7ab6e8b64f419baaf798d8e7d3b9294 100644 (file)
@@ -24,7 +24,7 @@ public class FormatTaxonBatchJob extends AbstractBatchJob {
        final Logger logger = LoggerFactory.getLogger(FormatTaxonBatchJob.class);
 
        private TaxonFormatter taxonFormatter;
-       
+
        public FormatTaxonBatchJob() {
                setSupportedInvocationModes(Arrays.asList(INVOCATION_MODE_SINGLE, INVOCATION_MODE_LIST, INVOCATION_MODE_NO_CONTEXT));
                this.taxonFormatter = new TaxonFormatter();
@@ -63,68 +63,69 @@ public class FormatTaxonBatchJob extends AbstractBatchJob {
                        setErrorInfo(new InvocationError(INT_ERROR_STATUS, e.getMessage()));
                }
        }
-       
+
        public InvocationResults formatAllTaxons() throws URISyntaxException, DocumentException {
                return formatTaxons(findAllTaxonRecords());
-       }       
+       }
 
        public InvocationResults formatTaxon(String taxonCsid) throws URISyntaxException, DocumentException {
                return formatTaxons(Arrays.asList(taxonCsid));
        }
-       
+
        public InvocationResults formatTaxons(List<String> taxonCsids) throws URISyntaxException, DocumentException {
                InvocationResults results = new InvocationResults();
                int numAffected = 0;
-               
+
                for (String taxonCsid : taxonCsids) {
                        formatDisplayNames(taxonCsid);
 
                        numAffected = numAffected + 1;
                }
-               
+
                results.setNumAffected(numAffected);
                results.setUserNote("Updated " + numAffected + " taxonomy " + (numAffected == 1 ? "record" : "records"));
-               
+
                return results;
        }
-       
+
        private List<String> formatDisplayNames(String taxonCsid) throws URISyntaxException, DocumentException {
                List<String> formattedDisplayNames = new ArrayList<String>();
 
                PoxPayloadOut taxonPayload = findTaxonByCsid(taxonCsid);
                String inAuthority = getFieldValue(taxonPayload, TaxonConstants.IN_AUTHORITY_SCHEMA_NAME, TaxonConstants.IN_AUTHORITY_FIELD_NAME);
-               
+
                String[] displayNamePathElements = TaxonConstants.DISPLAY_NAME_FIELD_NAME.split("/");
                String termGroupListFieldName = displayNamePathElements[0];
                String termGroupFieldName = displayNamePathElements[1];
                String displayNameFieldName = displayNamePathElements[2];
-               
+
                String[] formattedDisplayNamePathElements = TaxonConstants.FORMATTED_DISPLAY_NAME_FIELD_NAME.split("/");
                String formattedDisplayNameFieldName = formattedDisplayNamePathElements[2];
-               
+
                PayloadOutputPart part = taxonPayload.getPart(TaxonConstants.DISPLAY_NAME_SCHEMA_NAME);
 
                if (part != null) {
                        Element element = part.asElement();
-                       Node termGroupListNode = element.selectSingleNode(termGroupListFieldName);                      
-                       List<Element> termGroupElements = termGroupListNode.selectNodes(termGroupFieldName);
-                       
-                       for (Element termGroupElement : termGroupElements) {
+                       Node termGroupListNode = element.selectSingleNode(termGroupListFieldName);
+                       List<Node> termGroupNodes = termGroupListNode.selectNodes(termGroupFieldName);
+
+                       for (Node termGroupNode : termGroupNodes) {
+                               Element termGroupElement = (Element) termGroupNode;
                                Node displayNameNode = termGroupElement.selectSingleNode(displayNameFieldName);
                                String displayName = (displayNameNode == null) ? "" : displayNameNode.getText();
                                String formattedDisplayName = taxonFormatter.format(displayName);
 
                                Element formattedDisplayNameElement = (Element) termGroupElement.selectSingleNode(formattedDisplayNameFieldName);
-                               
+
                                if (formattedDisplayNameElement == null) {
                                        formattedDisplayNameElement = termGroupElement.addElement(formattedDisplayNameFieldName);
                                }
-                               
+
                                formattedDisplayNameElement.setText(formattedDisplayName);
                                formattedDisplayNames.add(formattedDisplayName);
                        }
-                       
-                       String updatePayload = 
+
+                       String updatePayload =
                                "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
                                "<document name=\"taxon\">" +
                                        "<ns2:taxon_common xmlns:ns2=\"http://collectionspace.org/services/taxonomy\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" +
@@ -134,11 +135,11 @@ public class FormatTaxonBatchJob extends AbstractBatchJob {
 
                        AuthorityResource<?, ?> resource = (AuthorityResource<?, ?>) getResourceMap().get(TaxonomyAuthorityClient.SERVICE_NAME);
                        resource.updateAuthorityItem(getResourceMap(), createUriInfo(), inAuthority, taxonCsid, updatePayload);
-               }               
-               
+               }
+
                return formattedDisplayNames;
        }
-       
+
        private List<String> findAllTaxonRecords() {
                // TODO
                return Collections.emptyList();
index 90c4ef5eb2434e4aa1b99858b6caacbfbfc042e4..77bd509276fb8515a148bc6c5af08d36ff9a06e5 100644 (file)
@@ -53,7 +53,7 @@
         </dependency>
 
         <dependency>
-            <groupId>dom4j</groupId>
+            <groupId>org.dom4j</groupId>
             <artifactId>dom4j</artifactId>
             <scope>provided</scope>
         </dependency>
index 34af4826e26fa73625308d4211f0970d7b1e5cf9..ed12dbd0f0fbff6093afaf4b34ee4c0b8e9a90bb 100644 (file)
@@ -85,7 +85,7 @@
                    <scope>compile</scope>
                </dependency>
         <dependency>
-            <groupId>dom4j</groupId>
+            <groupId>org.dom4j</groupId>
             <artifactId>dom4j</artifactId>
         </dependency>
     </dependencies>
index 5e758de77d6f626e97095e68a96eb71e37965cce..bb18c23027dae400e06955756aec7cd855b8ae71 100644 (file)
@@ -36,7 +36,7 @@
         <!-- External dependencies -->
 
                <dependency>
-            <groupId>dom4j</groupId>
+            <groupId>org.dom4j</groupId>
             <artifactId>dom4j</artifactId>
         </dependency>
         <dependency>
index 36db84b418fe2baff8b2d1e5fb10245d01bef9f4..fbef801fb1226de7a3f7606b029d2aea30649abf 100644 (file)
@@ -52,7 +52,7 @@
             <scope>provided</scope>
         </dependency>
                <dependency>
-            <groupId>dom4j</groupId>
+            <groupId>org.dom4j</groupId>
             <artifactId>dom4j</artifactId>
         </dependency>
 
index eab328713766e1d153d8f7d3ebf04f268bf9b765..8c6e8814c43748be4aafda1fd440907643616731 100644 (file)
@@ -64,7 +64,7 @@
             <scope>provided</scope>
         </dependency>
                <dependency>
-            <groupId>dom4j</groupId>
+            <groupId>org.dom4j</groupId>
             <artifactId>dom4j</artifactId>
         </dependency>
 
index b88f834ca92a0853ed8d8db0785e50084e2d5d0b..4db1e4c7df6711f0c2941503fc5723ef7a93ac79 100644 (file)
                                <version>${postgres.driver.version}</version>
                        </dependency>
                        <dependency>
-                               <groupId>dom4j</groupId>
+                               <groupId>org.dom4j</groupId>
                                <artifactId>dom4j</artifactId>
-                               <version>1.6.1</version>
+                               <version>2.1.4</version>
                                <scope>compile</scope>
                                <exclusions>
                                        <exclusion>
index 6f86a7d17f0665d82cba5b7b700554089abea2e8..7d16a668bb5468c199a963c69fe3e2ba41e580ed 100644 (file)
@@ -53,7 +53,7 @@
         </dependency>
 
         <dependency>
-            <groupId>dom4j</groupId>
+            <groupId>org.dom4j</groupId>
             <artifactId>dom4j</artifactId>
             <scope>provided</scope>
         </dependency>
index a07d8cd7fd91c13d2c88897e2c998ac7d83feb6f..cba945709f2507a92fa79196f2337a504638a076 100644 (file)
@@ -58,7 +58,7 @@
         </dependency>
 
         <dependency>
-            <groupId>dom4j</groupId>
+            <groupId>org.dom4j</groupId>
             <artifactId>dom4j</artifactId>
             <scope>provided</scope>
         </dependency>
index 2a43c6faada8c2876f99d87791db7ea12db839d6..41065d72dde02c6284193257374d96b400fa8437 100644 (file)
@@ -42,7 +42,7 @@
             <scope>provided</scope>
         </dependency>
                <dependency>
-            <groupId>dom4j</groupId>
+            <groupId>org.dom4j</groupId>
             <artifactId>dom4j</artifactId>
         </dependency>