chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Kopf (JIRA)" <>
Subject [jira] [Created] (CMIS-639) AtomPub: Query result entries are missing the <atom:content> element
Date Mon, 18 Mar 2013 13:08:15 GMT
Stefan Kopf created CMIS-639:

             Summary: AtomPub: Query result entries are missing the <atom:content> element
                 Key: CMIS-639
             Project: Chemistry
          Issue Type: Bug
          Components: opencmis-server
    Affects Versions: OpenCMIS 0.8.0
            Reporter: Stefan Kopf

Acording to CMIS spec, the <atom:content> element is required in every <atom:entry>
element. See Sections 3.5.2 and

The <atom:content> element is present in every <atom:entry> returned for getChildren
in the NavigationService or for getObject in the ObjectService.

For some reason, the method writeQueryResultEntry in the ...atompub.DiscoveryService does
not make use of AtomPubUtils.writeObjectEntry but assembles the result itself. But in this
process, the <atom:content> element is missing.

This problem can be fixed as follows:

    private static void writeQueryResultEntry(AtomEntry entry, ObjectData result, String id,
GregorianCalendar now, UrlBuilder baseUrl)
            throws Exception {
        CmisObjectType resultJaxb = convert(result);
        if (resultJaxb == null) {

        // start

        // write Atom base tags
        entry.writeTitle("Query Result " + id);
        // BUGFIX start
        String fileName = getStringProperty(result, PropertyIds.CONTENT_STREAM_FILE_NAME);
        String mimeType = getStringProperty(result, PropertyIds.CONTENT_STREAM_MIME_TYPE);
        String streamId = getIdProperty(result, PropertyIds.CONTENT_STREAM_ID);
        BigInteger length = getIntegerProperty(result, PropertyIds.CONTENT_STREAM_LENGTH);
        boolean hasContent = fileName != null || mimeType != null || streamId != null || length
!= null;
        String contentSrc = null;
        if (hasContent) {
            UrlBuilder contentSrcBuilder = compileUrlBuilder(baseUrl, AtomPubUtils.RESOURCE_CONTENT,
            if (fileName != null) {
            contentSrc = contentSrcBuilder.toString();
        entry.writeContent(contentSrc, mimeType);
        // BUGFIX end

        // write query result object
entry.getWriter(), true);

        // we are done

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message