[ 
https://issues.apache.org/jira/browse/SLING-11865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17720506#comment-17720506
 ] 

Konrad Windszus edited comment on SLING-11865 at 5/8/23 1:19 PM:
-----------------------------------------------------------------

In general we don't have access to a repository, therefore we use a JCR 
Namespace Registry populated from JCR default as well as the values provided in 
the Bundle Manifest Header {{Sling-Namespaces}}. IMHO that IT uses just an 
undefined namespace prefix (which may be supported by Sling in a best effort 
basis) but is invalid for DocView XML 
(https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/7_Export.html#7.3%20Document%20View)

bq. For every namespace used within the subgraph rooted at N, the corresponding 
JCR namespace mapping in the current session is included in the exported 
document such that any use of the namespace prefix in the exported document is 
within the scope of the appropriate namespace declaration


was (Author: kwin):
In general we don't have access to a repository, therefore we use a JCR 
Namespace Registry populated from JCR default as well as the value provided in 
the Bundle Manifest Header {{Sling-Namespaces}}. IMHO that IT uses just an 
undefined namespace prefix (which may be supported by Sling in a best effort 
basis) but is invalid for DocView XML 
(https://developer.adobe.com/experience-manager/reference-materials/spec/jcr/2.0/7_Export.html#7.3%20Document%20View)

bq. For every namespace used within the subgraph rooted at N, the corresponding 
JCR namespace mapping in the current session is included in the exported 
document such that any use of the namespace prefix in the exported document is 
within the scope of the appropriate namespace declaration

> Conversion fails when initial content document does not include namespace 
> declaration
> -------------------------------------------------------------------------------------
>
>                 Key: SLING-11865
>                 URL: https://issues.apache.org/jira/browse/SLING-11865
>             Project: Sling
>          Issue Type: Bug
>          Components: Content-Package to Feature Model Converter
>    Affects Versions: Content-Package to Feature Model Converter 1.3.2
>            Reporter: Robert Munteanu
>            Priority: Critical
>             Fix For: Content-Package to Feature Model Converter 1.3.4
>
>
> I tried upgrading the AEM Analyser project to version 1.3.2 of the CP 
> Converter, but that detected a regression ( see 
> [https://github.com/adobe/aemanalyser-maven-plugin/pull/205] ). The failure 
> message is
> > Failed to execute goal 
> > com.adobe.aem:aemanalyser-maven-plugin:1.5.9-SNAPSHOT:project-analyse 
> > (aem-analyser) on project 
> > aemanalyser-maven-plugin-it-content-package-files-test: Content Package 
> > Converter Exception Can not convert 
> > /tmp/cp2fm-converter16836453237918368470/SLING-INF/apps/my-first-node.xml 
> > to enhanced DocView format: javax.jcr.NamespaceException: No URI for prefix 
> > 'cq' declared. -> [Help 1]
> The file, as extracted from the bundle, is
> {code:xml}
> <?xml version="1.0" encoding="UTF-8" ?>
> <!--
>   Licensed to the Apache Software Foundation (ASF) under one
>   or more contributor license agreements.  See the NOTICE file
>   distributed with this work for additional information
>   regarding copyright ownership.  The ASF licenses this file
>   to you under the Apache License, Version 2.0 (the
>   "License"); you may not use this file except in compliance
>   with the License.  You may obtain a copy of the License at
>    http://www.apache.org/licenses/LICENSE-2.0
>   Unless required by applicable law or agreed to in writing,
>   software distributed under the License is distributed on an
>   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>   KIND, either express or implied.  See the License for the
>   specific language governing permissions and limitations
>   under the License.
>  -->
> <node>
>     <!--
>       You can find out more documentation on this topic
>       by following these links:
>         -  http://sling.apache.org/site/content-loading.html
>         -  http://jackrabbit.apache.org/node-type-notation.html
>      -->
>     <primaryNodeType>nt:unstructured</primaryNodeType>
>     <property>
>         <name>title</name>
>         <type>String</type>
>         <value>My first node</value>
>     </property>
>     <property>
>         <name>description</name>
>         <type>String</type>
>         <value>This node has been created by a sling bundle.</value>
>     </property>
>     
>     <node>
>         <name>cq:EditConfig</name>
>         <primaryNodeType>cq:EditConfig</primaryNodeType>
>         <property>
>             <name>description</name>
>             <type>String</type>
>             <value>Some dummy data from sling initial content.</value>
>         </property>
>         
>         <node>
>             <name>cq:listeners</name>
>             <primaryNodeType>cq:EditListenersConfig</primaryNodeType>
>             <property>
>                 <name>description</name>
>                 <type>String</type>
>                 <value>Some dummy data from sling initial content.</value>
>             </property>
>             
>         </node>
>     </node>
>     
>     <node>
>         
>         <name>graniteComponent</name>
>         <mixinNodeType>granite:Component</mixinNodeType>
>         <primaryNodeType>sling:Folder</primaryNodeType>
>         <node>
>             <name>granite:data</name>
>             <primaryNodeType>nt:unstructured</primaryNodeType>
>             <property>
>                 <name>description</name>
>                 <type>String</type>
>                 <value>Some dummy data from sling initial content.</value>
>             </property>
>         </node>
>         <node>
>             <name>my:subnode</name>
>             <primaryNodeType>nt:unstructured</primaryNodeType>
>             <property>
>                 <name>description</name>
>                 <type>String</type>
>                 <value>Some dummy data from sling initial content.</value>
>             </property>
>         </node>
>         
>     </node>
>    
> </node>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to