[Yanel-dev] set last modified

simon simon at 333.ch
Tue Mar 8 14:47:42 EST 2016


Dear Michi

Am 08.03.2016 um 17:35 schrieb Michael Wechner:
> Dear Simon
>
> What Repository/Node implementation do you use?
vfs
>
> 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);
I actually tried this.

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

which doesn't seem to work either.

>
> 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?
I have some aggregate pages. the node /de/index.html has some includes 
and when i edit this inculdes the node /de/index.html still has the old 
last modified. therefor the browser still displays the cached version.

The idea was to implement a usecase which is able to "touch" the node 
/de/index.html

Cheers
Simon
>
> 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