propagating an attribute

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

propagating an attribute

Duane Gran-2
OPS folks,

I'm building an application in which the XML format has many  
"enAuthor" attributes to clarify the author of a given element.  I  
could use a little advice.  My intent is to have one entry field  
which binds to multiple enAuthor attributes.  So good so far...

Except, the design (for good or bad, not my choice) is that a  
subsequent person may come along and edit the document and their name  
should be listed.  In otherwords, the first author may create the  
following document:

<root>
  <note enAuthor="person A">blah blah</note>
  ... (many more note tags, etc)
</root>

And another person comes along and adds a note tag.  I want it to be  
thus:

<root>
  <note enAuthor="person A">blah blah</note>
  <note enAuthor="person B">blah blah</note>
  ... (many more note tags, etc)
</root>

I'm thinking of two strategies to deal with this, but if others on  
the list have suggestions I would be most grateful:

1) Via XForms try to set a "dirty bit" of sorts for each new  
element.  Whenever an element is repeated, mark it in some way and  
then set the enAuthor attribute when saving.
2) Similar to the previous, but when repeating any element set the  
enAuthor to blank and then set all blank enAuthor attributes upon  
submit.
3) Again, similar to the previous, but use a pipeline on the server  
to populate empty enAuthor attributes.

I'm leaning toward solution #2, but I would be most obliged if the  
wisdom of crowds could chime in.

Duane



--
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
Reply | Threaded
Open this post in threaded view
|

Re: propagating an attribute

Alessandro  Vernet
Administrator
Duane,

Are you saying that if the document edited by A is:

    <root>
        <foo enAuthor="person A">blah blah</foo>
        <bar enAuthor="person A">blah blah</bar>
    </root>

Now B comes along, edits the field foo but not bar, then the document becomes:

    <root>
        <foo enAuthor="person A">blah blah</foo>
        <foo enAuthor="person B">blah blah modified</foo>
        <bar enAuthor="person A">blah blah</bar>
    </root>

If this is the case, you would need to duplicate the node the control
is bound to if enAuthor != current user. But is this what you want to
achieve?

Alex

On 5/16/06, Duane Gran <[hidden email]> wrote:

> OPS folks,
>
> I'm building an application in which the XML format has many
> "enAuthor" attributes to clarify the author of a given element.  I
> could use a little advice.  My intent is to have one entry field
> which binds to multiple enAuthor attributes.  So good so far...
>
> Except, the design (for good or bad, not my choice) is that a
> subsequent person may come along and edit the document and their name
> should be listed.  In otherwords, the first author may create the
> following document:
>
> <root>
>   <note enAuthor="person A">blah blah</note>
>   ... (many more note tags, etc)
> </root>
>
> And another person comes along and adds a note tag.  I want it to be
> thus:
>
> <root>
>   <note enAuthor="person A">blah blah</note>
>   <note enAuthor="person B">blah blah</note>
>   ... (many more note tags, etc)
> </root>
>
> I'm thinking of two strategies to deal with this, but if others on
> the list have suggestions I would be most grateful:
>
> 1) Via XForms try to set a "dirty bit" of sorts for each new
> element.  Whenever an element is repeated, mark it in some way and
> then set the enAuthor attribute when saving.
> 2) Similar to the previous, but when repeating any element set the
> enAuthor to blank and then set all blank enAuthor attributes upon
> submit.
> 3) Again, similar to the previous, but use a pipeline on the server
> to populate empty enAuthor attributes.
>
> I'm leaning toward solution #2, but I would be most obliged if the
> wisdom of crowds could chime in.
>
> Duane
>
>
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet