projects
/
lgpl
/
argeo-commons.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
563e3bf
)
Indexed name.
author
Mathieu Baudier <mbaudier@argeo.org>
Tue, 2 Feb 2021 13:16:07 +0000
(14:16 +0100)
committer
Mathieu Baudier <mbaudier@argeo.org>
Tue, 2 Feb 2021 13:16:07 +0000
(14:16 +0100)
org.argeo.jcr/src/org/argeo/jcr/Jcr.java
patch
|
blob
|
history
diff --git
a/org.argeo.jcr/src/org/argeo/jcr/Jcr.java
b/org.argeo.jcr/src/org/argeo/jcr/Jcr.java
index 1ed7469f1d5516bb0c8cf2ad8c2ac0b086dd1a86..31077737e8e7e789335e263409b2279d190b1b27 100644
(file)
--- a/
org.argeo.jcr/src/org/argeo/jcr/Jcr.java
+++ b/
org.argeo.jcr/src/org/argeo/jcr/Jcr.java
@@
-203,6
+203,21
@@
public class Jcr {
}
}
}
}
+ /**
+ * Returns the node name with its current index (useful for re-ordering).
+ *
+ * @see Node#getName()
+ * @see Node#getIndex()
+ * @throws JcrException caused by {@link RepositoryException}
+ */
+ public static String getIndexedName(Node node) {
+ try {
+ return node.getName() + "[" + node.getIndex() + "]";
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot get name of " + node, e);
+ }
+ }
+
/**
* @see Node#getProperty(String)
* @throws JcrException caused by {@link RepositoryException}
/**
* @see Node#getProperty(String)
* @throws JcrException caused by {@link RepositoryException}