[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re[2]: [cgmo-webcgm] WebCGMNodeList
Hi Stuart, GSA> The proposal looks good to me, but I would like to see something about GSA> the WebCGMNode.attributes retaining the read/write ability. You will still be able to modify the attribute values, but you will not be able to add or remove attributes from a WebCGMNodeList interface. Okay? But will be able to do so using the WebCGMAppStructure interface. GSA> Also, should it be possible to add an attribute at runtime? Yes. GSA> For example: use the script to add a screentip? var a = cgmPic.createWebCGMStringList(); a.appendItem("A runtime screentip"); someobject.setAppStructureAttrList( "screentip", a ); or var a = cgmPic.createWebCGMStringList(); a.appendItem("A runtime screentip"); var l = someobject.attributes; var i = l.getItem( 2 /* assuming 2 represents the screentip */ ); i.value = a; I prefer the first approach, it is cleaner. -- Benoit mailto:benoit@itedo.com GSA> -- GSA> Stuart Galt GSA> SGML Resource Group GSA> stuart.a.galt@boeing.com GSA> (206) 544-9925 GSA> -----Original Message----- GSA> From: Benoit Bezaire [mailto:benoit@itedo.com] GSA> Sent: Thursday, February 10, 2005 1:33 PM GSA> To: CGM Open WebCGM TC GSA> Subject: [cgmo-webcgm] WebCGMNodeList GSA> Hi guys, GSA> I'm unclear about something... that is, how are users going to use GSA> WebCGMNodeList!? GSA> We have the following methods which return WebCGMNodeList: GSA> WebCGMNodeList WebCGMNode.childNodes; GSA> WebCGMNodeList WebCGMNode.attributes; GSA> WebCGMNodeList WebCGMNode.getElementsByTagNameNS() GSA> WebCGMNodeList WebCGMPicture.getAppsStructureByName() GSA> WebCGMNodeList WebCGMPicture.createWebCGMNodeList() GSA> And the following which requires one as input: GSA> WebCGMPicture.hightlight(in WebCGMNodeList) GSA> The WebCGMNodeList interface is as follows: GSA> interface WebCGMNodeList { GSA> readonly attribute unsigned long count; GSA> WebCGMNode item(in unsigned long index); GSA> WebCGMNode removeItem ( in unsigned long index ) GSA> raises( WebCGMException ); GSA> WebCGMNode appendItem ( in WebCGMNode newItem ) GSA> raises( WebCGMException ); GSA> void clear() GSA> raises( WebCGMException ); }; GSA> My concerns are related to a node list of APS nodes and a node list of GSA> Attr nodes. It is pretty clear that 'count' and 'item' have value; they GSA> are required to walk through a list of nodes regardless if they are APS GSA> or Attr. GSA> In a previous email, I said that there are technical reasons why 'clear' GSA> shouldn't be present. So that leaves 'removeItem' and 'appendItem' as GSA> questionable... Let's start with 'appendItem', it is needed for adding GSA> WebCGMNodes to a list of objects to be highlighted. But what happens if GSA> someone does: GSA> WebCGMNode.childNodes.appendItem() // this adds a new child GSA> I thought we wanted to forbid the 'addition' and 'deletion' of APS in GSA> the DOM. If that is true, I don't see a use case for 'removeItem', GSA> except maybe to remove an item from a node list which shouldn't be GSA> highlighted. GSA> 'removeItem' and 'appendItem' on Attr node list also have some issues. GSA> 'removeItem' could be seen as an equivalent to removeAppStructureAttr, GSA> and 'appendItem' as setAppStructureAttrList. The problem is that we GSA> don't have a createAttrNode method to feed into appendItem. Should we GSA> add such a method? GSA> I'm not sure if people are following me, I may not be very clear. But GSA> here's my proposal. GSA> Proposal: GSA> All methods returning a WebCGMNodeList, with the exception of GSA> createWebCGMNodeList, must return 'readonly' node lists. With this GSA> approach 'appendItem' and 'removeItem' can remain on the interface and GSA> will only work for node lists aimed at being used with the highlight() GSA> method. GSA> Thoughts?
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]