[Yanel-dev] set last modified

simon simon at 333.ch
Wed Mar 9 10:32:55 EST 2016


Hello Michi

unfortunately i lost the last message. That's why i answer on this old one.

But i just wanted to say that this is working:

Repository repository = manager.getRealm().getRepository();
Node node = repository.getNode(yarepPath);
node.setProperty(AbstractNode.PROPERTY_LAST_MODIFIED,System.currentTimeMillis());

I made another stupid mistake.
Thank you for your help.

Cheers
Simon

Am 08.03.2016 um 17:35 schrieb Michael Wechner:
> Dear Simon
>
> What Repository/Node implementation do you use?
>
> I can see the following existing implementations
>
> grep -rl getLastModified src/impl/*
> src/impl/java/org/wyona/yarep/core/impl/fs/FileSystemStorage.java
> src/impl/java/org/wyona/yarep/core/impl/svn/SVNStorage.java
> src/impl/java/org/wyona/yarep/core/impl/vfs/VFileSystemStorage.java
> src/impl/java/org/wyona/yarep/impl/AbstractNode.java
> src/impl/java/org/wyona/yarep/impl/DefaultRepository.java
> src/impl/java/org/wyona/yarep/impl/DummyNode.java
> src/impl/java/org/wyona/yarep/impl/repo/dummy/DummyRepository.java
> src/impl/java/org/wyona/yarep/impl/repo/fs/FileSystemNode.java
> src/impl/java/org/wyona/yarep/impl/repo/fs/FileSystemRepository.java
> src/impl/java/org/wyona/yarep/impl/repo/jcr/JCRNode.java
> src/impl/java/org/wyona/yarep/impl/repo/jcr/JCRRepository.java
> src/impl/java/org/wyona/yarep/impl/repo/orm/ORMRepositoryImpl.java
> src/impl/java/org/wyona/yarep/impl/repo/orm/ORMStorage.java
> src/impl/java/org/wyona/yarep/impl/repo/vfs/VirtualFileSystemNode.java
> src/impl/java/org/wyona/yarep/impl/repo/vfs/VirtualFileSystemRepository.java
> src/impl/java/org/wyona/yarep/impl/repo/vfs/VirtualFileSystemRevision.java
> src/impl/java/org/wyona/yarep/impl/repo/xmldb/XMLDBStorage.java
>
>
> For example
>
> src/impl/java/org/wyona/yarep/impl/AbstractNode.java
>
> uses the property
>
> Property lastModified = getProperty(PROPERTY_LAST_MODIFIED);
>
> which means if you overwrite this, then you should be able to change it.
>
> Just being curious, what is your actual usecase to for "touching" nodes?
>
> HTH
>
> Michael
>
>
> Am 08.03.16 um 09:18 schrieb simon:
>> Dear all
>>
>> I'm looking for some way to implement something like 'touch'. I would
>> like to programmatically update a nodes last modified.
>> i actually thought it could work like this:
>>
>>              Repository repository = manager.getRealm().getRepository();
>>              Node node = repository.getNode(yarepPath);
>>              node.setProperty(AbstractNode.PROPERTY_CHECKIN_DATE, new
>> Date());
>>
>> But this doesn't seem to work.
>> could someone give me a hint how to do this.
>>
>> Thanks in advance.
>>
>> Cheers
>> Simon
>>
>


-- 
TEIL3
Vulkanstrasse 114
8048 Zürich

www.teil3.ch



More information about the Yanel-development mailing list