Werner

The possibilites for fine tuning the XML projection have improved in
later versions of Cache but there is no good solution to this apart
from the one I have (or at least I think so)

Consider this issue
You have a Customer/Invoice database
on one XML/SOAP service you just want to list the invoice titles and
dates (say)

then when they browse down you now want the invoice header and all the
line details

So you have the same data structure being delivered in two ways - the
XML binding does not allow you to configure what is delivered at *run*
time

so the solution I have is to create 2 sets (in this example) of proxy
classes having just the data that is required

and then a getData(object_id) method that creates this structure and
delivers the resulting structue via the XML/SOAP service

These classes are registered (in memory) they only exist for the
delivery of the one set of data

Hope this is clear

Peter 



On Thu, 8 Apr 2004 19:46:36 +0200, "Dipl.-Ing. Werner Riegler"
<[EMAIL PROTECTED]> wrote:

>Hi,
>
>there is an very interesting feature in cache I need very urgent - the xml
>projection
>
>but as I have some complex classes which have many relations to other
>classes (at least properties of complex types)
>
>I need to "cut off" the xml projection at a certain depth ...
>
>example to explain:
>
>class root ...
>{
>   property A as classA;
>
>   property B as classB;
>
>   property C as classC;
>
>...
>}
>
>class classA ...
>{
>   property S as %String;
>  ...
>
>   property D as classD;
>
>
>}
>
>I even have same nested relations ... ( like a net ) !
>
>It is very interesting - and a strong feature I think - that every XML
>enabled class is resolved by the xml write...
>But for Import / Export and Report use this is a little too much.
>
>So I would like to over write the XML representation of properties ...
>
>I found the possibilities to switch them off - XMLPROJECTION = NONE
>and to choose between Attribute and Element (which results to a compiler
>error in case of a Class),
>but I think I need the behaviour that e.g. only the Property called Name for
>a related Class should be shown ...
>
><root>
>    <A S="xxx">
>        <D ...>
>    </A>
>    <B />
></root>
>
>should be instead of the whole <A> stuff like this:
>
><root>
>    <A S="xxx" D="yyy" >
>    <B />
></root>
>
>any possibilities for this ?
>
>I think it is no goog idea to set the XML projection of property D in Class
>A to none
>and also not to set Properties within Class D to none - because they should
>only in case of
>the relation from class A become supressed for xml projection ...
>
>brg
>werner
>


Reply via email to