OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sca-assembly message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: NEW ISSUE: Difficulty using source= attribute to pull values into complextypes



Folks,

Matthew Peters originally raised this issue on the OSOA Assembly mailing list, but I think that it is worthy of consideration
within the OASIS Assembly TC, so I am raising it formally as an issue.


Yours,  Mike.

Strategist - Emerging Technologies, SCA & SDO.
Co Chair OASIS SCA Assembly TC.
IBM Hursley Park, Mail Point 146, Winchester, SO21 2JN, Great Britain.
Phone & FAX: +44-1962-818014    Mobile: +44-7802-467431  
Email:  mike_edwards@uk.ibm.com



I have a property which is a complex type, and I wanted to use source= attribute to pull the values down from a global property within my .composite. This turned out to be not quite as easy as I thought. I have been through several options.

_________________________
My first idea, which was wrong

I have a composite containing several different components. I want to specify some proerties at a global level. One of the components wants to use a omplex type for one of the properties. The complex type is already defined elsewhere. For this example I'll simplify it so it has two elements, which are long and short titles that the component will use:

<complexType name="titles-type">
  <sequence>
    <element name="long-title" type="xs:string"/>
    <element name="short-title" type="xs:string"/>
  </sequence>
</complexType>

I want to define some global properties in my composite, with values which will be pulled down into this and other components. But the structure of the globals, and the names of the elements are not the same as the component's and I don't want them to be the same - I don't want the structure of the global properties forced on me by the structure of the property for the one component. Here's the global property where just two of the elements are the titles I want:

<property name="global-properties" type="app-namespace:global-properties-type">      
    <application-full-name>Whizzo Insurance, a subsidiary of Fizzo</application-full-name>
    <application-short-name>Whizzo Insurance</application-short-name>
  . <!-- and lots of other elements in here as well -->
</property>

Here's what I really wanted to write in the component before I was thinking clearly. I imagined that I was going to use source= but hadn't realised that I was about to put the source= on the wrong elements:

<component ...
   <implementation....../>
   <property name="app-titles" type="titles-type"
      <app-titles xsi:type="titles-type">  
         <long-title source="global-properties/application-full-name"/>  
         <short-title source="global-properties/application-short-name"/>
      </my-app-complex-element>
   </property>
</component>
   
The mistake I made here of course is that source= means something to sca on a property element, but where I wanted to put it was on an element that is part of a complex type that is nothing to do with sca. And I don't control the complex type myself so I can't add to the schema to allow it to take an sca:source= attribute.

___________
Two options

******Option 1.  
I can give up using the info-type complex type altogether and flatten all the elements out into separate properties and write e.g.
<property name="long-title" source="global-properties/application-full-name"/>  
<property name="short-title" source="global-properties/application-short-name"/>
A bit of a shame, but I can do that

******Option 2.
I can copy the complex type for app-titles-type and add a source= attribute, allowing me to write more or less what I proposed the first time. But this is a bit weird - I am taking the SCA idea of source=<XPath expression> but at runtime someone is actually going to have to make it happen and I guess it will be up to the implementation to do it for me somehow. I can't expect it to just happen.

_______________
What I really want is for SCA to have a more powerful mapping system to allow me to do more than source= on scalar properties. Or some other magic.

I don't think I will be the only one to run into this. Any suggestions?
Matthew Peters











Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU









[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]