You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Saliya Ekanayake (JIRA)" <ji...@apache.org> on 2007/08/06 20:03:59 UTC

[jira] Created: (WSCOMMONS-230) Method to retrieve the owner element of an OMAttribute instance

Method to retrieve the owner element of an OMAttribute instance
---------------------------------------------------------------

                 Key: WSCOMMONS-230
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-230
             Project: WS-Commons
          Issue Type: Improvement
          Components: AXIOM
            Reporter: Saliya Ekanayake
            Priority: Minor


Providing methods to set and get the owner element of an instance of OMAttribute is pretty much useful. An OMAttribute instance is then restricted to be added only to a single OMElement instance (DOM Attr has similar restriction).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Commented: (WSCOMMONS-230) Method to retrieve the owner element of an OMAttribute instance

Posted by "Ruchith Udayanga Fernando (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519907 ] 

Ruchith Udayanga Fernando commented on WSCOMMONS-230:
-----------------------------------------------------

Hi Saliya,

The attached patch  breaks axis2 please fix it and attach a new patch.

Thanks,
Ruchith

> Method to retrieve the owner element of an OMAttribute instance
> ---------------------------------------------------------------
>
>                 Key: WSCOMMONS-230
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-230
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Saliya Ekanayake
>            Priority: Minor
>         Attachments: fixed_omattribute_patch.txt, fixed_omattribute_patch_v2.txt, omattribute_patch.txt
>
>
> Providing methods to set and get the owner element of an instance of OMAttribute is pretty much useful. An OMAttribute instance is then restricted to be added only to a single OMElement instance (DOM Attr has similar restriction).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Commented: (WSCOMMONS-230) Method to retrieve the owner element of an OMAttribute instance

Posted by "Glen Daniels (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517995 ] 

Glen Daniels commented on WSCOMMONS-230:
----------------------------------------

Hi Saliya!

I don't think we should do this.  If you have an explicit setParent() method, you open yourself up to broken object models.  Simple example, if you just call attr.setParent(elem) before calling elem.addChild(attr), you now have a "floating" attribute that *thinks* it belongs to the OMElelement "elem", but it doesn't!  The only way to set the parent of an OMAttribute, IMO, should be to actually add it as a child to an OMElement.  This makes sure all the structural constraints are always correct.

I agree an OMAttribute should *have* a single parent, and perhaps an exception should be thrown if you try to "relocate" one that has already been added to an element, but I am opposed to an API which allows setting the parent outside of the normal structure-building APIs.

Thanks,
--Glen


> Method to retrieve the owner element of an OMAttribute instance
> ---------------------------------------------------------------
>
>                 Key: WSCOMMONS-230
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-230
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Saliya Ekanayake
>            Priority: Minor
>         Attachments: omattribute_patch.txt
>
>
> Providing methods to set and get the owner element of an instance of OMAttribute is pretty much useful. An OMAttribute instance is then restricted to be added only to a single OMElement instance (DOM Attr has similar restriction).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Updated: (WSCOMMONS-230) Method to retrieve the owner element of an OMAttribute instance

Posted by "Saliya Ekanayake (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Saliya Ekanayake updated WSCOMMONS-230:
---------------------------------------

    Attachment: fixed_omattribute_patch.txt

This is the patch fixing the issue raised by Glen

Thanks,
--Saliya

> Method to retrieve the owner element of an OMAttribute instance
> ---------------------------------------------------------------
>
>                 Key: WSCOMMONS-230
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-230
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Saliya Ekanayake
>            Priority: Minor
>         Attachments: fixed_omattribute_patch.txt, omattribute_patch.txt
>
>
> Providing methods to set and get the owner element of an instance of OMAttribute is pretty much useful. An OMAttribute instance is then restricted to be added only to a single OMElement instance (DOM Attr has similar restriction).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Updated: (WSCOMMONS-230) Method to retrieve the owner element of an OMAttribute instance

Posted by "Saliya Ekanayake (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Saliya Ekanayake updated WSCOMMONS-230:
---------------------------------------

    Attachment: attribute-clone-patch.txt

Hi,

I have fixed the problem. Now whenever a user tries to add an OMAttribute which is already added to another OMElement the attribute is cloned and added. Thus we can enforce one parent constraint while allowing the user to work as before. A user who needs to worry about the owner, however, will have to consider the cloning effect.

The addAttribute(OMAttribute attr) method of OMElementImpl guarantees to return the attribute that is added to it (this may be different from the attribute which is given to the method if the given attribute already has an owner). A user needs to consider this matter only if he/she is tracking the owner of the attribute in his/her application.

> Method to retrieve the owner element of an OMAttribute instance
> ---------------------------------------------------------------
>
>                 Key: WSCOMMONS-230
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-230
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Saliya Ekanayake
>            Priority: Minor
>         Attachments: attribute-clone-patch.txt, fixed_omattribute_patch.txt, fixed_omattribute_patch_v2.txt, omattribute_patch.txt
>
>
> Providing methods to set and get the owner element of an instance of OMAttribute is pretty much useful. An OMAttribute instance is then restricted to be added only to a single OMElement instance (DOM Attr has similar restriction).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Resolved: (WSCOMMONS-230) Method to retrieve the owner element of an OMAttribute instance

Posted by "Ruchith Udayanga Fernando (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruchith Udayanga Fernando resolved WSCOMMONS-230.
-------------------------------------------------

    Resolution: Fixed

Applied patch to revision 627957
http://svn.apache.org/viewvc?rev=627957&view=rev

Thanks Saliya

> Method to retrieve the owner element of an OMAttribute instance
> ---------------------------------------------------------------
>
>                 Key: WSCOMMONS-230
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-230
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Saliya Ekanayake
>            Priority: Minor
>         Attachments: attribute-clone-patch.txt, fixed_omattribute_patch.txt, fixed_omattribute_patch_v2.txt, omattribute_patch.txt, patch.txt
>
>
> Providing methods to set and get the owner element of an instance of OMAttribute is pretty much useful. An OMAttribute instance is then restricted to be added only to a single OMElement instance (DOM Attr has similar restriction).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Updated: (WSCOMMONS-230) Method to retrieve the owner element of an OMAttribute instance

Posted by "Saliya Ekanayake (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Saliya Ekanayake updated WSCOMMONS-230:
---------------------------------------

    Attachment: omattribute_patch.txt

I've attached the patch that I've created to enable setting and getting the owner element of an OMAttribute. 

> Method to retrieve the owner element of an OMAttribute instance
> ---------------------------------------------------------------
>
>                 Key: WSCOMMONS-230
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-230
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Saliya Ekanayake
>            Priority: Minor
>         Attachments: omattribute_patch.txt
>
>
> Providing methods to set and get the owner element of an instance of OMAttribute is pretty much useful. An OMAttribute instance is then restricted to be added only to a single OMElement instance (DOM Attr has similar restriction).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Updated: (WSCOMMONS-230) Method to retrieve the owner element of an OMAttribute instance

Posted by "Saliya Ekanayake (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Saliya Ekanayake updated WSCOMMONS-230:
---------------------------------------

    Attachment: patch.txt

Latest patch on the issue

> Method to retrieve the owner element of an OMAttribute instance
> ---------------------------------------------------------------
>
>                 Key: WSCOMMONS-230
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-230
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Saliya Ekanayake
>            Priority: Minor
>         Attachments: attribute-clone-patch.txt, fixed_omattribute_patch.txt, fixed_omattribute_patch_v2.txt, omattribute_patch.txt, patch.txt
>
>
> Providing methods to set and get the owner element of an instance of OMAttribute is pretty much useful. An OMAttribute instance is then restricted to be added only to a single OMElement instance (DOM Attr has similar restriction).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Updated: (WSCOMMONS-230) Method to retrieve the owner element of an OMAttribute instance

Posted by "Saliya Ekanayake (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Saliya Ekanayake updated WSCOMMONS-230:
---------------------------------------

    Attachment: fixed_omattribute_patch_v2.txt

There seems to be some issues with the previous patch. So I'm sending a new patch named fixed_omattribute_patch_v2.txt herewith.

Thanks,
--Saliya

> Method to retrieve the owner element of an OMAttribute instance
> ---------------------------------------------------------------
>
>                 Key: WSCOMMONS-230
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-230
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Saliya Ekanayake
>            Priority: Minor
>         Attachments: fixed_omattribute_patch.txt, fixed_omattribute_patch_v2.txt, omattribute_patch.txt
>
>
> Providing methods to set and get the owner element of an instance of OMAttribute is pretty much useful. An OMAttribute instance is then restricted to be added only to a single OMElement instance (DOM Attr has similar restriction).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Commented: (WSCOMMONS-230) Method to retrieve the owner element of an OMAttribute instance

Posted by "Saliya Ekanayake (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518084 ] 

Saliya Ekanayake commented on WSCOMMONS-230:
--------------------------------------------

Hi Glen,

I got your point and thank you a lot for pointing it out. I've fixed it and attached the patch herewith. 

As you suggested I removed the setParent() method. The parent is now set only once you add an attribute through addAttribute() method of the OMElement. 

Thanks,
--Saliya

> Method to retrieve the owner element of an OMAttribute instance
> ---------------------------------------------------------------
>
>                 Key: WSCOMMONS-230
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-230
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Saliya Ekanayake
>            Priority: Minor
>         Attachments: omattribute_patch.txt
>
>
> Providing methods to set and get the owner element of an instance of OMAttribute is pretty much useful. An OMAttribute instance is then restricted to be added only to a single OMElement instance (DOM Attr has similar restriction).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org