Well, there is an obscure way: to have to generate a new lock token
for the locked node and add it to the user session.

        public static String getLockToken(String id) {
                StringBuffer buf = new StringBuffer();
                buf.append(id.toString());
                buf.append('-');
                buf.append(getCheckDigit(id.toString()));
                return buf.toString();
        }

        private static char getCheckDigit(String uuid) {
        int result = 0;

        int multiplier = 36;
        for (int i = 0; i < uuid.length(); i++) {
            char c = uuid.charAt(i);
            if (c >= '0' && c <= '9') {
                int num = c - '0';
                result += multiplier * num;
                multiplier--;
            } else if (c >= 'A' && c <= 'F') {
                int num = c - 'A' + 10;
                result += multiplier * num;
                multiplier--;
            } else if (c >= 'a' && c <= 'f') {
                int num = c - 'a' + 10;
                result += multiplier * num;
                multiplier--;
            }
        }

        int rem = result % 37;
        if (rem != 0) {
            rem = 37 - rem;
        }
        if (rem >= 0 && rem <= 9) {
            return (char) ('0' + rem);
        } else if (rem >= 10 && rem <= 35) {
            return (char) ('A' + rem - 10);
        } else {
            return '+';
        }
    }

2010/2/2  <[email protected]>:
> Nobody an idea?
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected] [mailto:[email protected]]
> Gesendet: Montag, 1. Februar 2010 10:18
> An: [email protected]
> Betreff: Recovering open-scoped lock tokens
>
> Hi all,
>
>
>
> when I lock a node in jackrabbit (open-scoped) a lock token is returned.
> When I login to jackrabbit again (new session) I must put the former
> lock token to the session, so the user can unlock the node. What can I
> do if I have lost the lock token from jackrabbit. I do not get the lock
> token again if I call node.getLockToken(). Is there a recovering
> possibility?
>
>
>
> Thanks in advance
>
>
>
> Sascha
>
>



-- 
OpenKM
http://www.openkm.com
http://www.guia-ubuntu.org

Reply via email to