Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C88EEE122 for ; Mon, 18 Mar 2013 18:16:15 +0000 (UTC) Received: (qmail 53588 invoked by uid 500); 18 Mar 2013 18:16:15 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 53544 invoked by uid 500); 18 Mar 2013 18:16:15 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 53451 invoked by uid 99); 18 Mar 2013 18:16:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Mar 2013 18:16:15 +0000 Date: Mon, 18 Mar 2013 18:16:15 +0000 (UTC) From: =?utf-8?Q?Florian_M=C3=BCller_=28JIRA=29?= To: dev@chemistry.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CMIS-639) AtomPub: Query result entries are missing the element MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CMIS-639?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D136054= 25#comment-13605425 ]=20 Florian M=C3=BCller commented on CMIS-639: ------------------------------------- I have disabled the empty content tags for now. If someone can present a re= al world issue with that, we can discuss it again. =20 > AtomPub: Query result entries are missing the element > -------------------------------------------------------------------- > > Key: CMIS-639 > URL: https://issues.apache.org/jira/browse/CMIS-639 > Project: Chemistry > Issue Type: Bug > Components: opencmis-server > Affects Versions: OpenCMIS 0.8.0 > Reporter: Stefan Kopf > Assignee: Florian M=C3=BCller > Fix For: OpenCMIS 0.9.0 > > > Acording to CMIS spec, the element is required in every element. See Sections 3.5.2 and 3.4.1.3.6. > The element is present in every returned for = getChildren in the NavigationService or for getObject in the ObjectService. > For some reason, the method writeQueryResultEntry in the ...atompub.Disco= veryService does not make use of AtomPubUtils.writeObjectEntry but assemble= s the result itself. But in this process, the element is mis= sing. > This problem can be fixed as follows in org.apache.chemistry.opencmis.ser= ver.impl.atompub.DiscoveryService: > {code:java} > private static void writeQueryResultEntry(AtomEntry entry, ObjectData= result, String id, GregorianCalendar now, UrlBuilder baseUrl) > throws Exception { > CmisObjectType resultJaxb =3D convert(result); > if (resultJaxb =3D=3D null) { > return; > } > // start > entry.startEntry(false); > // write Atom base tags > entry.writeAuthor(""); > entry.writeId(entry.generateAtomId(id)); > entry.writePublished(now); > entry.writeTitle("Query Result " + id); > entry.writeUpdated(now); > =20 > // BUGFIX start > String fileName =3D getStringProperty(result, PropertyIds.CONTENT= _STREAM_FILE_NAME); > String mimeType =3D getStringProperty(result, PropertyIds.CONTENT= _STREAM_MIME_TYPE); > String streamId =3D getIdProperty(result, PropertyIds.CONTENT_STR= EAM_ID); > BigInteger length =3D getIntegerProperty(result, PropertyIds.CONT= ENT_STREAM_LENGTH); > boolean hasContent =3D fileName !=3D null || mimeType !=3D null |= | streamId !=3D null || length !=3D null; > String contentSrc =3D null; > if (hasContent) { > UrlBuilder contentSrcBuilder =3D compileUrlBuilder(baseUrl, A= tomPubUtils.RESOURCE_CONTENT, result.getId()); > if (fileName !=3D null) { > contentSrcBuilder.addPathSegment(fileName); > } > contentSrc =3D contentSrcBuilder.toString(); > } > entry.writeContent(contentSrc, mimeType); > // BUGFIX end > // write query result object > JaxBHelper.marshal(JaxBHelper.CMIS_EXTRA_OBJECT_FACTORY.createObj= ect(resultJaxb), entry.getWriter(), true); > // we are done > entry.endEntry(); > } > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira