[Yanel-dev] [Yarep] Bug/feature re indexing of properties

Guillaume Déflache guillaume.deflache at wyona.com
Wed May 12 14:29:29 CEST 2010


Michael Wechner schrieb:
> Michael Wechner wrote:
>> Hi

Hi!


>> If one uses a colon within a property name, e.g. wyona:my-property-name
>> then the indexing of this property will not work properly, at least 
>> for the virtual file system implementation,
>> because the colon is also used as separator between the name and the 
>> value, e.g.
>>
>> yarep_checkoutUserID<string>:test
>>
>> whereas if one uses a colon within the property name, then it will be 
>> saved as follows:
>>
>> wyona:my-property-name<string>:My Value
>>
>> and hence when the property value is being read then one will receive:
>>
>> my-property-name<string>:My Value
>>
>> In order to fix this we need to escape the colon within the property 
>> names.
> 
> this should be fixed now within the yarep lib, whereas I have not 
> updated the dependencies of Yanel yet.

It looks like the property values also get escaped, I get:
> org.wyona.yarep.core.RepositoryException: Unparseable date: "2010-05-11T17\:11\:39\:295+0200"
> 	at org.wyona.yarep.impl.DefaultProperty.setValueFromString(DefaultProperty.java:84)
> 	at org.wyona.yarep.impl.repo.vfs.VirtualFileSystemNode.readProperties(VirtualFileSystemNode.java:156)
> 	at org.wyona.yarep.impl.repo.vfs.VirtualFileSystemNode.init(VirtualFileSystemNode.java:113)
> 	at org.wyona.yarep.impl.repo.vfs.VirtualFileSystemNode.<init>(VirtualFileSystemNode.java:73)
> 	at org.wyona.yarep.impl.repo.vfs.VirtualFileSystemRepository.getNode(VirtualFileSystemRepository.java:386)
> 	at org.wyona.yarep.impl.repo.vfs.VirtualFileSystemNode.getNodes(VirtualFileSystemNode.java:198)
with the following metadata file:
> yarep_vfs-meta-file-version<string>:1.0
> yarep_checkinDate<date>:2010-05-11T17\:11\:39\:295+0200
> yarep_type<string>:resource
> yarep_mimeType<string>:application/xml
> yarep_checkoutUserID<string>:bob
> yarep_isCheckedOut<boolean>:false
> yarep_checkoutDate<date>:2010-05-11T17\:11\:25\:580+0200


> Also I have fixed another problem re line breaks which was noted as TODO 
> within the code.
> 
> Also to make it backwards compatible I have introduced a version number 
> which is a property itself:
> 
> yarep_vfs-meta-file-version<string>:1.0

It looks like we may need to define 1.0.1 to fix this.


> which means all meta data which does not contain this property is being 
> handled as before, but as soon as it is being
> rewritten it should be handled with escaped colons.

So AFAICU there is no workaround: as soon as one writes to the file, the 
new 1.0 gets used, right?


> All my tests are fine, but in case you should encounter any problem, 
> please let me know.

All the related tests are in 
/home/guillaume/yarep.VCWC/src/test/java/org/wyona/yarep/tests/VirtualFilesystemRevisionsTest.java 
in the 'testEscapeUnescapePropertyName' method, right?
It seems the case with ':' in property values is explicitely tested, but 
AFAICS only with values of type string, not with values of type date, 
maybe that's the problem.

Cheers,
    Guillaume


More information about the Yanel-development mailing list