Hi Andrey, I think you should be able to identify an open content property (in the initializeProperty method) by calling:
if (newProperty.isOpenContent()) ... Frank. "Andrey Utkin (JIRA)" <[email protected]> wrote on 12/05/2008 11:34:44 AM: > > [ https://issues.apache.org/jira/browse/TUSCANY-2719?page=com. > atlassian.jira.plugin.system.issuetabpanels:comment- > tabpanel&focusedCommentId=12653857#action_12653857 ] > > Andrey Utkin commented on TUSCANY-2719: > --------------------------------------- > > Yes, I agree with you - it is better. > Frank, I found yet another problem with my fix: it introduce > problems with Open Content and Sequence Properties... > As I understand, Open Content properties must be represented as > elements. It seems to me that such property may be "identified" by > containing type - its name is "DocumentRoot". > Currently I have no ideas how to deal with Sequence property... I > will try to solve it. > > > > Wrong serialization DataObject in XML if DataObject is defined by > means of dynamic type > > > --------------------------------------------------------------------------------------- > > > > Key: TUSCANY-2719 > > URL: https://issues.apache.org/jira/browse/TUSCANY-2719 > > Project: Tuscany > > Issue Type: Bug > > Components: Java SDO Implementation > > Reporter: Andrey Utkin > > > > SDO 2.1.0 Specification define rules for XML generation of > DataObject`s property defined by dynamic types (without XSD) that > (part "10 Generation of XSD from SDO Type and Property" page 107): > > === > > An element is generated if property.many, > > property.containment, or property.nullable is true, or if > property.get(xmlElement) is > > present and set to true, where xmlElement is an open content property in > > commonj.sdo/xml. If the property is bidirectional and the opposite > property has > > containment=true, nothing is generated. Otherwise, an attribute isgenerated. > > === > > But Tuscany generates element by default. Attributes generated > only for properties with corresponding xmlElement - the "many" and > "nullable" properties dont checked. > > XML documents generated for such DataObjects is not corresponds to > XSD generated for their Types (XSDHelper.generate()). So, it is not > possible to deserialize XML back to DataObject. > > I have changed /org/apache/tuscany/sdo/helper/TypeHelperImpl.java > method "void initializeProperty()" as follow: > > ==== > > --- tuscany-sdo-1.1.1- > src/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl. > java 2008-07-10 16:53:42.000000000 +0400 > > +++ /patch/apache-tuscany-sdo-1.1.1/tuscany-sdo-1.1.1- > src/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl. > java 2008-12-05 06:54:56.000000000 +0300 > > @@ -271,6 +271,12 @@ > > } > > } > > } > > + > > + // Check for many and nullable > > + if (!newProperty.isMany() && !newProperty.isNullable()) { > > + isXmlElement = Boolean.FALSE; > > + } > > + > > if (!isXmlElement.booleanValue()) { > > SDOUtil.setPropertyXMLKind(newProperty, false); > > } > > ==== > > May be it is not very correct, but works for me ^) > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. >
