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
Hi,

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.

I.E.
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 =
elementClassDescriptor.getIdFieldDescriptor().getFieldName();
                elementJcrName = ReflectionUtils.getNestedProperty(item,
idFieldName).toString();
            }
            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
OCM?

Many thanks
regards
Sascha

-- 

Sascha Rodekamp

    Lynx-Consulting GmbH
    Johanniskirchplatz 6
    D-33615 Bielefeld
    http://www.lynx.de

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