Re: problem with a bind to a readonly instance ?

Posted by Erik Bruchez on
URL: https://discuss.orbeon.com/problem-with-a-bind-to-a-readonly-instance-tp33042p33045.html

Adrian,

The reason is mainly a practical one.

MIPs are currently stored as annotations ("user data") on nodes in the
case of read-write instances implemented with dom4j.

But read-only instances are backed-up by Saxon TinyTree objects, which
do not support adding annotations on nodes (they are, as the code says,
"optimized for size, and for speed of creation").

The alternative would be to:

1. Revert to dom4j when MIPs are used (but as you say that latter
solution would kill most of the benefits of read-only instances).

2. Switch to another tree representation or modify TinyTree to support
annotations.

3. Store MIPs outside the tree (e.g. a Map node id -> MIP information).
This could be promising, but it would be some work.

-Erik

Adrian Baker wrote:

> Hi Erik,
>
> If model item properties could still be applied to xxforms-readonly
> instances this would expand the number of scenarios it could be used in.
> For example, we use forms containing only xf:outputs to present data,
> but we still need the datatype & relevance properties to present the
> data correctly.
>
> However I suppose in implementing full MIP support you might lose the
> performance gain of xxforms-readonly, which is the whole point.. ?
>
> Adrian
>
> Erik Bruchez wrote:
>> Doug,
>>
>> Well, hard to say if it's really a feature, but the answer is that at
>> the moment you can't use model item properties with a read-only instance:
>>
>>   http://www.orbeon.com/ops/doc/reference-xforms-ng#xxforms-readonly
>>
>> -Erik
>>
>> Doug Young wrote:
>>> Hi,
>>>
>>>  
>>>
>>> We have a problem when we set a xxforms:readonly instance to be bind
>>> readonly  I know it seems an odd thing to do but it happens in our
>>> application when we want to make a printable version of the page we
>>> set all the instances to readonly,
>>>
>>>  
>>>
>>> Is this a bug or a feature ?
>>>
>>>  
>>>
>>> Also it would be really helpful if the “Cannot modify read-only
>>> instance” message told you which instance it was.
>>>
>>>  
>>>
>>>   The attached file shows the problem.
>>>
>>>  
>>>
>>> regards
>>>
>>> Doug
>>>
>>>  
>>>
>>> Doug Young
>>>
>>> Software Engineer
>>>
>>>  
>>>
>>> Teleflex IT
>>>
>>> 1 Michaelson Square
>>> Livingston
>>> West Lothian
>>> Scotland
>>> EH54 7DP
>>>
>>> +44 (0) 1506 407107
>>>
>>>  
>>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email] mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>  

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws