jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sascha Rodekamp <sascha.rodekamp.lynx...@googlemail.com>
Subject OCM nt:file element name - "collection-element"
Date Wed, 10 Aug 2011 13:25:49 GMT

i play around with Jackrabbit 2.2.7 and the OCM package.
Putting content in and reading form the repository works like a charm.
But when i upload a file (in a HierarchyStructure) the file node is always
stored with an element name "collection-element" in the Repository.

File.jpg should be stored under /home/data/File.jpg but the OCM store it
under /home/data/collection-element in the repository.
(The path is correctly set to /home/data/File.jpg)

I found this piece of code in the NtCollectionConverterImpl:
            // If the element object has a unique id => the element jcr node
name = the id value
            if (elementClassDescriptor.hasIdField()) {
                String idFieldName =
                elementJcrName = ReflectionUtils.getNestedProperty(item,
            else {
                elementJcrName = collectionDescriptor.getJcrElementName();
                if (elementJcrName == null) { // use
PathFormat.checkFormat() here?
                    elementJcrName = COLLECTION_ELEMENT_NAME;

I tried to set an id field in my File bean

@Field(id = true) private String idField = null;

But, as expected, idField is not a valid property for nt:file nodes.

Has anyone an idea how i can change the element name for nt:file types using

Many thanks


Sascha Rodekamp

    Lynx-Consulting GmbH
    Johanniskirchplatz 6
    D-33615 Bielefeld

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message