Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 6177 invoked from network); 7 Oct 2008 00:28:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Oct 2008 00:28:47 -0000 Received: (qmail 95088 invoked by uid 500); 7 Oct 2008 00:28:45 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 95054 invoked by uid 500); 7 Oct 2008 00:28:45 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 95043 invoked by uid 99); 7 Oct 2008 00:28:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2008 17:28:45 -0700 X-ASF-Spam-Status: No, hits=-1999.9 required=10.0 tests=ALL_TRUSTED,DNS_FROM_SECURITYSAGE X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2008 00:27:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C9D1F234C225 for ; Mon, 6 Oct 2008 17:27:44 -0700 (PDT) Message-ID: <830440001.1223339264825.JavaMail.jira@brutus> Date: Mon, 6 Oct 2008 17:27:44 -0700 (PDT) From: "Nicholas DiPiazza (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-1787) XmlHandler export functions don't work in XML repository mode - causes XML with XSLT dependencies to show up with jcr:content XML element. In-Reply-To: <1669495783.1223335366119.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-1787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637321#action_12637321 ] Nicholas DiPiazza commented on JCR-1787: ---------------------------------------- Then i had to change exportData further to get my XML back in Base 32: if (contentNode.getNodes().hasNext()) { contentNode = contentNode.getNodes().nextNode(); } OutputStream out = context.getOutputStream(); String res = ValueHelper.serialize(contentNode.getProperty("jcr:data").getValue(), false); Base64.decode(res.toCharArray(), out); > XmlHandler export functions don't work in XML repository mode - causes XML with XSLT dependencies to show up with jcr:content XML element. > ------------------------------------------------------------------------------------------------------------------------------------------ > > Key: JCR-1787 > URL: https://issues.apache.org/jira/browse/JCR-1787 > Project: Jackrabbit > Issue Type: Bug > Reporter: Nicholas DiPiazza > > I can't view XML files with XSLT dependencies because the XML returned from XML requests will come back as the "jcr:content" XML representation. > > > I suggest changes to package org.apache.jackrabbit.server.io.XmlHandler: > 1) Create new method: > /** > * @see DefaultHandler#exportData(ExportContext, boolean, Node) > */ > protected void exportData(ExportContext context, boolean isCollection, Node contentNode) throws IOException, RepositoryException { > // first child of content is XML document root > if (contentNode.getNodes().hasNext()) { > contentNode = contentNode.getNodes().nextNode(); > } > > OutputStream out = context.getOutputStream(); > out.write(ValueHelper.serialize(contentNode.getProperty("jcr:data").getValue(), false).getBytes()); > } > Change canExport method: > /** > * @see IOHandler#canExport(ExportContext, boolean) > */ > public boolean canExport(ExportContext context, boolean isCollection) { > if (super.canExport(context, isCollection)) { > String mimeType = null; > try { > Node contentNode = getContentNode(context, isCollection); > if (contentNode.hasProperty(JcrConstants.JCR_MIMETYPE)) { > mimeType = contentNode.getProperty(JcrConstants.JCR_MIMETYPE).getString(); > } else { > mimeType = context.getMimeResolver().getMimeType(context.getExportRoot().getName()); > } > } catch (RepositoryException e) { > // ignore and return false > } > return XML_MIMETYPE.equals(mimeType); > } > return false; > } > This causes my server to return the correct XML then -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.