You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by np...@apache.org on 2022/07/22 15:30:06 UTC

[sling-org-apache-sling-pipes] branch master updated (ec6444f -> a95cf11)

This is an automated email from the ASF dual-hosted git repository.

npeltier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-pipes.git


 discard ec6444f  SLING-11492 fix non markable jcr nodes
     new a95cf11  SLING-11492 fix non markable jcr nodes

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (ec6444f)
            \
             N -- N -- N   refs/heads/master (a95cf11)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/java/org/apache/sling/pipes/internal/PlumberImpl.java | 1 -
 1 file changed, 1 deletion(-)


[sling-org-apache-sling-pipes] 01/01: SLING-11492 fix non markable jcr nodes

Posted by np...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

npeltier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-pipes.git

commit a95cf1172c9f578a5a5ca9394528640641916033
Author: Nicolas Peltier <np...@apache.org>
AuthorDate: Fri Jul 22 17:29:05 2022 +0200

    SLING-11492 fix non markable jcr nodes
---
 .../org/apache/sling/pipes/internal/PlumberImpl.java    | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/sling/pipes/internal/PlumberImpl.java b/src/main/java/org/apache/sling/pipes/internal/PlumberImpl.java
index cf27be0..edb860e 100644
--- a/src/main/java/org/apache/sling/pipes/internal/PlumberImpl.java
+++ b/src/main/java/org/apache/sling/pipes/internal/PlumberImpl.java
@@ -63,6 +63,7 @@ import org.osgi.service.metatype.annotations.ObjectClassDefinition;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.query.Query;
 import javax.management.MBeanServer;
@@ -295,12 +296,16 @@ public class PlumberImpl implements Plumber, JobConsumer, PlumberMXBean, Runnabl
     @Override
     public void markWithJcrLastModified(@NotNull Pipe pipe, @NotNull Resource resource) {
         if (!pipe.isDryRun()) {
-            ModifiableValueMap mvm = resource.adaptTo(ModifiableValueMap.class);
-            if (mvm != null) {
-                mvm.put(JCR_LASTMODIFIED, Calendar.getInstance());
-                mvm.put(JCR_LAST_MODIFIED_BY, resource.getResourceResolver().getUserID());
-                if (configuration.mark_pipe_path()) {
-                    mvm.put(JCR_LAST_MODIFIED_BY_PIPE, pipe.getResource().getPath());
+            Node node = resource.adaptTo(Node.class);
+            if (node != null) {
+                try {
+                    node.setProperty(JCR_LASTMODIFIED, Calendar.getInstance());
+                    node.setProperty(JCR_LAST_MODIFIED_BY, resource.getResourceResolver().getUserID());
+                    if (configuration.mark_pipe_path()) {
+                        node.setProperty(JCR_LAST_MODIFIED_BY_PIPE, pipe.getResource().getPath());
+                    }
+                } catch (RepositoryException e) {
+                    log.debug("There is probably no way to mark that node, which we can't do much about", e);
                 }
             }
         }