You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "fabrizio giustina (JIRA)" <ji...@apache.org> on 2005/04/26 11:39:25 UTC
[jira] Created: (JCR-115) Nodetype is not preserved during export/import
Nodetype is not preserved during export/import
----------------------------------------------
Key: JCR-115
URL: http://issues.apache.org/jira/browse/JCR-115
Project: Jackrabbit
Type: Bug
Components: nodetype
Reporter: fabrizio giustina
Property defined with a UNDEFINED property type are not handled correctly during export: the "real" property type assigned on creation is not preserved.
If you try to export a Boolean property (which is set as UNDEFINED in configuration) and reimport it the value returned by getType() will change.
fron jcr specs:
...
Returns the type of this Property. The type returned
is that which was set at property creation. Note that
for some property p, the type returned by
p.getType() may differ from the type returned by
p.getDefinition.getRequiredType() only in the
case where the latter returns UNDEFINED. The type of
a property instance is never UNDEFINED (it must
always have some actual type). See 6.2.5 Property
Types and 6.7.18 Discovery of Constraints on Existing
Items.
--------------------------------------------------
int UNDEFINED
This constant can be used within a property definition (see
6.7.6 Property Definitions) to specify that the property in
question may be of any type. However, it cannot be the
actual type of any property instance. For example it will
never be returned by Property.getType and (in level 2
implementations) it cannot be assigned as the type when
creating a new property.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (JCR-115) Nodetype is not preserved during export/import
Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-115?page=all ]
Stefan Guggisberg resolved JCR-115:
-----------------------------------
Resolution: Invalid
the problem is that you are using document view serialization. document view is 'lossy' by definition, e.g. type information of properties
is lost.
see 6.4.2 Document View XML Mapping in the
jsr 170 specification:
<quote>
The document view is designed to be more human-readable than the system view, though it achieves this at the expense of completeness.
</quote>
what you want to use is system view serialization,
i.e. Session.exportSystemView().
> Nodetype is not preserved during export/import
> ----------------------------------------------
>
> Key: JCR-115
> URL: http://issues.apache.org/jira/browse/JCR-115
> Project: Jackrabbit
> Type: Bug
> Components: nodetype
> Reporter: fabrizio giustina
> Assignee: Stefan Guggisberg
>
> Property defined with a UNDEFINED property type are not handled correctly during export: the "real" property type assigned on creation is not preserved.
> If you try to export a Boolean property (which is set as UNDEFINED in configuration) and reimport it the value returned by getType() will change.
> fron jcr specs:
> ...
> Returns the type of this Property. The type returned
> is that which was set at property creation. Note that
> for some property p, the type returned by
> p.getType() may differ from the type returned by
> p.getDefinition.getRequiredType() only in the
> case where the latter returns UNDEFINED. The type of
> a property instance is never UNDEFINED (it must
> always have some actual type). See 6.2.5 Property
> Types and 6.7.18 Discovery of Constraints on Existing
> Items.
> --------------------------------------------------
> int UNDEFINED
> This constant can be used within a property definition (see
> 6.7.6 Property Definitions) to specify that the property in
> question may be of any type. However, it cannot be the
> actual type of any property instance. For example it will
> never be returned by Property.getType and (in level 2
> implementations) it cannot be assigned as the type when
> creating a new property.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (JCR-115) Nodetype is not preserved during export/import
Posted by "fabrizio giustina (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-115?page=comments#action_63771 ]
fabrizio giustina commented on JCR-115:
---------------------------------------
This is the definition of the custom nodetype (note the requiredType="undefined" in the propertydefinition):
<nodeType name="custom:contentNode" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
<supertypes><supertype>nt:hierarchyNode</supertype></supertypes>
<childNodeDefinition name="*" defaultPrimaryType="" autoCreated="false"
mandatory="false" onParentVersion="VERSION" protected="false" sameNameSiblings="true">
<requiredPrimaryTypes>
<requiredPrimaryType>nt:hierarchyNode</requiredPrimaryType>
</requiredPrimaryTypes>
</childNodeDefinition>
<propertyDefinition name="*" requiredType="undefined" autoCreated="false"
mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
</nodeType>
I am using:
session.exportDocumentView("/", stream, false, false)
for export and
session.importXML("/", stream, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING);
for import.
Steps to reproduce the error:
- add a node of type custom:contentNode to the repository with a Boolean property (getType() returns PropertyType.BOOLEAN)
- export the content of the repository in document view and reimport the xml using the methods above
- getType() doesn't return PropertyType.BOOLEAN anymore
Is this enough in order to let you reproduce the error? Let me know if you need any other information...
> Nodetype is not preserved during export/import
> ----------------------------------------------
>
> Key: JCR-115
> URL: http://issues.apache.org/jira/browse/JCR-115
> Project: Jackrabbit
> Type: Bug
> Components: nodetype
> Reporter: fabrizio giustina
>
> Property defined with a UNDEFINED property type are not handled correctly during export: the "real" property type assigned on creation is not preserved.
> If you try to export a Boolean property (which is set as UNDEFINED in configuration) and reimport it the value returned by getType() will change.
> fron jcr specs:
> ...
> Returns the type of this Property. The type returned
> is that which was set at property creation. Note that
> for some property p, the type returned by
> p.getType() may differ from the type returned by
> p.getDefinition.getRequiredType() only in the
> case where the latter returns UNDEFINED. The type of
> a property instance is never UNDEFINED (it must
> always have some actual type). See 6.2.5 Property
> Types and 6.7.18 Discovery of Constraints on Existing
> Items.
> --------------------------------------------------
> int UNDEFINED
> This constant can be used within a property definition (see
> 6.7.6 Property Definitions) to specify that the property in
> question may be of any type. However, it cannot be the
> actual type of any property instance. For example it will
> never be returned by Property.getType and (in level 2
> implementations) it cannot be assigned as the type when
> creating a new property.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Reopened: (JCR-115) Nodetype is not preserved during export/import
Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-115?page=all ]
Stefan Guggisberg reopened JCR-115:
-----------------------------------
Assign To: Stefan Guggisberg
> Nodetype is not preserved during export/import
> ----------------------------------------------
>
> Key: JCR-115
> URL: http://issues.apache.org/jira/browse/JCR-115
> Project: Jackrabbit
> Type: Bug
> Components: nodetype
> Reporter: fabrizio giustina
> Assignee: Stefan Guggisberg
>
> Property defined with a UNDEFINED property type are not handled correctly during export: the "real" property type assigned on creation is not preserved.
> If you try to export a Boolean property (which is set as UNDEFINED in configuration) and reimport it the value returned by getType() will change.
> fron jcr specs:
> ...
> Returns the type of this Property. The type returned
> is that which was set at property creation. Note that
> for some property p, the type returned by
> p.getType() may differ from the type returned by
> p.getDefinition.getRequiredType() only in the
> case where the latter returns UNDEFINED. The type of
> a property instance is never UNDEFINED (it must
> always have some actual type). See 6.2.5 Property
> Types and 6.7.18 Discovery of Constraints on Existing
> Items.
> --------------------------------------------------
> int UNDEFINED
> This constant can be used within a property definition (see
> 6.7.6 Property Definitions) to specify that the property in
> question may be of any type. However, it cannot be the
> actual type of any property instance. For example it will
> never be returned by Property.getType and (in level 2
> implementations) it cannot be assigned as the type when
> creating a new property.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Closed: (JCR-115) Nodetype is not preserved during export/import
Posted by "fabrizio giustina (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-115?page=all ]
fabrizio giustina closed JCR-115:
---------------------------------
thanks, I can confirm that exportSystemView works as expected.
Maybe a note on javadocs about what is lost using exportDocumentView() could help in making clear that this is not a bug, the property type is a pretty important information...
> Nodetype is not preserved during export/import
> ----------------------------------------------
>
> Key: JCR-115
> URL: http://issues.apache.org/jira/browse/JCR-115
> Project: Jackrabbit
> Type: Bug
> Components: nodetype
> Reporter: fabrizio giustina
> Assignee: Stefan Guggisberg
>
> Property defined with a UNDEFINED property type are not handled correctly during export: the "real" property type assigned on creation is not preserved.
> If you try to export a Boolean property (which is set as UNDEFINED in configuration) and reimport it the value returned by getType() will change.
> fron jcr specs:
> ...
> Returns the type of this Property. The type returned
> is that which was set at property creation. Note that
> for some property p, the type returned by
> p.getType() may differ from the type returned by
> p.getDefinition.getRequiredType() only in the
> case where the latter returns UNDEFINED. The type of
> a property instance is never UNDEFINED (it must
> always have some actual type). See 6.2.5 Property
> Types and 6.7.18 Discovery of Constraints on Existing
> Items.
> --------------------------------------------------
> int UNDEFINED
> This constant can be used within a property definition (see
> 6.7.6 Property Definitions) to specify that the property in
> question may be of any type. However, it cannot be the
> actual type of any property instance. For example it will
> never be returned by Property.getType and (in level 2
> implementations) it cannot be assigned as the type when
> creating a new property.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (JCR-115) Nodetype is not preserved during export/import
Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/JCR-115?page=all ]
Stefan Guggisberg resolved JCR-115:
-----------------------------------
Resolution: Incomplete
please be more specific. what export method are you refering to? are you exporting to document view or to system view?
also, please provide exact instructions on how
to reproduce your issue.
> Nodetype is not preserved during export/import
> ----------------------------------------------
>
> Key: JCR-115
> URL: http://issues.apache.org/jira/browse/JCR-115
> Project: Jackrabbit
> Type: Bug
> Components: nodetype
> Reporter: fabrizio giustina
>
> Property defined with a UNDEFINED property type are not handled correctly during export: the "real" property type assigned on creation is not preserved.
> If you try to export a Boolean property (which is set as UNDEFINED in configuration) and reimport it the value returned by getType() will change.
> fron jcr specs:
> ...
> Returns the type of this Property. The type returned
> is that which was set at property creation. Note that
> for some property p, the type returned by
> p.getType() may differ from the type returned by
> p.getDefinition.getRequiredType() only in the
> case where the latter returns UNDEFINED. The type of
> a property instance is never UNDEFINED (it must
> always have some actual type). See 6.2.5 Property
> Types and 6.7.18 Discovery of Constraints on Existing
> Items.
> --------------------------------------------------
> int UNDEFINED
> This constant can be used within a property definition (see
> 6.7.6 Property Definitions) to specify that the property in
> question may be of any type. However, it cannot be the
> actual type of any property instance. For example it will
> never be returned by Property.getType and (in level 2
> implementations) it cannot be assigned as the type when
> creating a new property.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira