13:01:18 #startmeeting jQuery/XPath for MD-SAL intern 13:01:18 Meeting started Mon Jun 30 13:01:18 2014 UTC. The chair is colindixon. Information about MeetBot at http://ci.openstack.org/meetbot.html. 13:01:18 Useful Commands: #action #agreed #help #info #idea #link #topic #startvote. 13:01:18 The meeting name has been set to 'jquery_xpath_for_md_sal_intern' 13:01:41 #topic status update 13:01:43 hangouts is fine by me 13:02:31 I’d be fine with a google hangout, but let’s see if we need it (unelss regXboi or devinavery think it would be useful) 13:02:43 let's stay with IRC for now 13:02:48 so, Neel_B, how’d steps 2 and 3 go? 13:02:57 Aggree'd. We can shift to a google hangout if needed. 13:02:58 about all I could see hangout be useful for is screen share 13:03:27 so are we shifting ? 13:03:34 Staying on IRC for now 13:03:48 okay implemented node interface 13:04:09 #info Neel uploaded his most recent changes to his git repo 13:04:16 #link https://github.com/neel1438/Opendaylight/tree/master/jquery/src/jquery the changes are here 13:04:26 but hardcoding was difficult actually 13:04:43 for attributes the return type is NamedNodeMap 13:04:50 * regXboi scans 13:05:04 so i didn't know how to put attributes 13:06:12 Hmm. Ultimately it looks like that is another interface we will have to implement 13:06:30 Likely we can just use a Map<> under the hood, but need to look at it first to be sure 13:06:36 I think I'm missing an orbit here 13:07:08 http://pastebin.com/tt8gh1Z3 13:07:09 #info hardcoding a DOM tree turns out to be more complext than you’d hope, among other things we’re going to to need to look at implementing our own version of NamedNodeMap if we want to use XPath 13:07:15 this is what i tried for querying 13:07:33 regXboi: yes? 13:07:42 Neel_B: can you commmit that to the repo? 13:07:53 that has lots of errors 13:07:57 so i didn't 13:08:02 ah 13:08:08 syntax or runtime? 13:08:16 colindixon: that's the orbit I'm missing - I'm not 100% convinced of the conclusion 13:08:51 runtime errors xpath expression exception 13:09:05 Neel_B: 13:09:30 regXboi: so, when I was looking through things, I was pretty sure we were going to have to implement some kind of NamedNodeMap, but I’d love to be wrong 13:09:40 i tried to populate all the nodes so i put "/" in this 13:09:47 Neel_B: ok, did you post the whole main.java file 13:10:16 almost it has only main method and imports 13:10:39 thats the testXpath.java i changed 13:12:00 ok, I’m just copying it in to play with it for a few minutes 13:12:15 http://pastebin.com/3gmmARkh 13:12:37 Before we get to the NameNodeMap though it looks like the getNodeType() methods need to be implemented on the nodes. 13:12:59 devinavery: now *that* I agree with 13:13:56 on getNodeType() we've got an override that goes back to the base class... do we need more? 13:14:37 and with that... I'm still not convinced that I can't take the NamedNodeMap apart 13:15:53 So Neel, I would suggest changing "MyNode" to NOT take another Node as a delegate. That was great for mapping out what XPath called, but now we want to change the logic and throw errors if a method is called that we aren't expecting 13:16:24 So there is no need to pass in the Node there. I would actually create a new class (leaving MyNode alone) that just throws "MethodNowImplemented" exception for each method. 13:16:44 That way, if there is a call, it will fail. 13:16:46 ... 13:16:51 hang on... we lost him 13:16:59 Yup. Was just going to say that. 13:17:11 #topic review and next steps 13:17:37 btw... in the meantime, here's a hideously brutal way to handle NamedNodeMap: http://stackoverflow.com/questions/4171380/generic-foreach-iteration-of-namednodemap 13:18:02 if we are talking about wrapping the w3x named node map with a real map interface, then I think I'm all for that! 13:18:11 er s/w3x/w3c/ 13:19:17 regXboi: I think the goal is to figure out what of the w3c Node interface we need to implement to get XPath to work so that we can scope the work of adding that to the MD-SAL Node class to allow XPath queries over the MD-SAL 13:20:12 FYI, the live log is here: https://meetings.opendaylight.org/opendaylight-intern/2014/jquery_xpath_for_md_sal_intern/opendaylight-intern-jquery_xpath_for_md_sal_intern.2014-06-30-13.01.log.txt 13:20:18 ok... now I got it... I'm thinking backwards from the rest of you 13:20:47 Actually - good news. Right now it doesn't look like MD-SAL puts anything into the "attributes" fields of the XML. It uses child tags. 13:21:06 So to get the ID of attribute "A", you would use /A/ID instead of /A/@ID 13:21:09 now... that is good news 13:21:15 Which means we can likely avoid NameNodeMap for now 13:21:35 well... so the question is... should MD-SAL be using attributes 13:21:49 yeah, I know I shouldn't ask it 13:22:09 ... well. I guess, may statement above isn't 100% accurate 13:22:21 RESTCONF is not using attributes and I think that is up to the restconf spec (draft) 13:22:35 As for XPath, I guess it really comes down to how we want to implement it 13:22:59 ok, I'm not going to get into RESTCONF 13:23:02 Though I would argue that we should keep the XPath query very close, if not exactly the same as the RESTConf XML output. Otherwise people won't know how to write the XPaths 13:23:12 I have very strong opinions on that 13:23:24 :) 13:24:13 devinavery: I agree there, if you can’t actually see the “document” you’re working with, it’s going to be hard to figure things out 13:24:15 We may have the same opinions (or not) on Restconf... that aside, can we agree that the XPath querying implementation should mirror the Restconf XML output? I am just thinking of how I write paths. 13:24:43 Ok, sounds like a +1 from Colin... :) regXboi? 13:27:10 #info devinavery notes that at least in the MD-SAL as it gets serialized to XML via RESTCONF, there are no attributes, which may allow us to avoid implementing a NamedNodeMap 13:27:13 I don't see that we have a choice 13:27:19 so we can mark it as agreed 13:27:57 Ok great. So in that case we should change the XML that we are testing with to get rid of the attributes. That will simplify it fox us 13:28:01 for us ** 13:28:14 agreed 13:28:25 So I think these are the next steps in my mind. 13:28:37 And we can echo them if we all agree using the meet bot 13:28:39 #info devinavery points out that we should really keep the query semantics for XPath to be such that the query behaves as though it were run on the XML that RESTCONF returns so that people can figure out how to craft queries and what to expect back 13:29:05 devinavery: that sounds good to me 13:29:12 I’m just capturing the discussion a bit 13:29:15 (for us and for Neel) 13:29:35 1) Implement a new Node implementation, that throws "MethodNotSupportted" exceptions (or something) in every method. Then modify the dummy hardcodded nodes to extend that class. 13:29:53 #topic concrete next steps 13:29:53 That way, all calls to a method that we don't override will fail immediately, so we understand what methods are being called. 13:30:47 #2) Modify the test xml document (and hardcoded nodes) to remove the attributes, and just use child tags. For example b_idc_id 13:30:56 let's action those? 13:31:01 +1 to both of those 13:31:08 #3) Implemnt the remaining missing methods when you run it (presently that is getNodeType() method) 13:31:19 #action Implement a new Node implementation, that throws "MethodNotSupportted" exceptions (or something) in every method. Then modify the dummy hardcodded nodes to extend that class. 13:31:29 #action Modify the test xml document (and hardcoded nodes) to remove the attributes, and just use child tags. For example b_idc_id 13:31:39 #action Implemnt the remaining missing methods when you run it (presently that is getNodeType() method) 13:31:54 hey Neel_B 13:32:14 the logs while you were gone are here: https://meetings.opendaylight.org/opendaylight-intern/2014/jquery_xpath_for_md_sal_intern/opendaylight-intern-jquery_xpath_for_md_sal_intern.2014-06-30-13.01.log.txt 13:32:51 ParPart of modifying the test document is to modify the test as well. Instead of @id on line 115 of the test, we should just use 'id' (i.e. remove the @ symbol so you reference a child node instead of an attribute) 13:33:50 #info Part of modifying the test document is to modify the test as well. Instead of @id on line 115 of the test, we should just use 'id' (i.e. remove the @ symbol so you reference a child node instead of an attribute) 13:34:28 Neel_B: the short version is the following (from devinavery) 13:34:38 1) Implement a new Node implementation, that throws "MethodNotSupportted" exceptions (or something) in every method. Then modify the dummy hardcodded nodes to extend that class. 13:34:45 2) Modify the test xml document (and hardcoded nodes) to remove the attributes, and just use child tags. For example b_idc_id 13:34:51 3) Implemnt the remaining missing methods when you run it (presently that is getNodeType() method) 13:35:05 ** Part of modifying the test document is to modify the test as well. Instead of @id on line 115 of the test, we should just use 'id' (i.e. remove the @ symbol so you reference a child node instead of an attribute) 13:35:46 yeah i already know that @id means an attribute id 13:36:13 but calling hasAttributes function should return false and should not print anything 13:36:18 thats what i tried to do there 13:36:31 hasAttribuetes()* 13:36:57 So Neel.. one thing we discussed while you were away was the fact that the MD-SAL restconf xml does not use attributes 13:37:17 okay okay 13:37:25 So we are hoping we can get away with not having to do anything with attributes. The theory being that if the xpath query doesn't use attributes we won't call the attribute related methods 13:38:32 okay 13:39:11 so, hopefully we can get away without having to implement NamedNodeMap 13:39:25 do you think the getnodetype() error was due to 13:39:35 initializing dummy=NULL? 13:39:51 Yes (it is a null pointer exception I am getting [I think] ) 13:40:10 Yeas - confirmed. I am getting a NPE. 13:40:21 So we need to implement that method in all of our Nodes. 13:40:46 i cannot instantiate node class so how can i instantiate MyNode without node ? 13:41:43 Define a class like this: public class ThrowExceptioNode implements Node{ ... (throw a not supported exception or some other runtime exception from every method } 13:42:24 Then in your class, you say "final Node c2 = new ThrowExceptionNode () { ... put your method overrides here like you already are ...} 13:43:15 Neel_B: does that make sense? 13:43:19 okay modify my node with throwing exceptions for every method 13:43:20 ? 13:43:33 I would just copy and paste the class to a new Name. 13:43:49 Keep MyNode around for the old stuff just incase we want to reuse it again 13:43:58 +1 to that 13:44:09 +2 to that 13:44:58 "final Node c2 = new ThrowExceptionNode () { MyNode Funtions ?} 13:45:59 same as here: on line 20 http://pastebin.com/tt8gh1Z3 13:46:06 if an exception araises what gets called ? 13:47:00 Neel_B: so, in your MyNode (https://github.com/neel1438/Opendaylight/blob/master/jquery/src/jquery/MyNode.java) you can see that for every function you’re just calling the function on your internal node, right? 13:47:02 (throw a not supported exception or some other runtime exception from every method) ? what does adding not supproted exception do ? 13:47:11 yeah 13:47:21 like i did on document interface 13:48:13 This is what I am referring too: 13:48:17 public class ThrowExceptionNode implements Node { 13:48:17 13:48:17 @Override 13:48:17 public String getNodeName() { 13:48:18 throw new RuntimeException( "Not Implemented" ); 13:48:20 } 13:48:22 ... 13:48:24 } 13:48:48 so, in the new new Node class (ThrowsExceptionNode), instead of calling the function on an internal node, you’re going to just throw an exception (NotSupportedException) from every function so that you can tell if the XPath code calls something you haven’t implemented yet 13:48:50 This way if any method on ThrowExceptionNode is called, we will throw a Runtime generated exception, which will fail 13:49:04 (what Colin said) :) 13:49:41 and then you’re going to “extend” it the same way you did in your current main() function to provide the functions you thing you need until the code runs 13:49:56 okay got it 13:51:00 and in the end, you’ll end up with an understanding of *exactly* what functions we need to have a Node class implement to have XPath work on top of it 13:51:15 and then we can start doing real work on getting that to work with the MD-SAL 13:51:16 yup 13:51:19 ok 13:51:21 perfect 13:51:48 #info there was a lot of discussion back and forth (with code examples) about exactly what to do next 13:51:54 anything else anyone wants to take care of 13:52:34 Neel, why don’t you send us code whenever you have it (ideally sometime before this time tomorrow) and we’ll either respond via e-mail or plant to meet again in this slot tomorrow 13:52:38 I think once we get that we can better understand how we are going to interact with MD-SAL. 13:52:44 does that make sense to folks? 13:53:01 Yup 13:53:13 i will finish this part as soon as possible 13:53:31 Neel_B: did you get a chance to implement the ping 2.0 example going locally yet too? If not that is something you can do while waiting for a review from us 13:53:43 Sorry, not Ping 2.0, just plain old ping. :) 13:54:02 colindixon: sure can it be normal time 8:30 P.M here /10AM there ? 13:54:36 I won't be able to make that slot 13:54:43 but go ahead without me 13:54:53 devin i did not try that yet and will so it as soon as its done 13:54:54 I'll catch up on the meeting minutes later 13:55:11 Neel_B: I can do that time tomorrow 13:55:21 Sounds good. Thank you all. 13:55:26 actually 6:30PM is a bit inconvinient for me if its daily 13:56:00 Neel_B: my hope is that we’ll get things moving more smoothly and not need daily meetings, but when we’re doing things so iteratively it’s useful 13:56:08 but sure 13:56:18 lets do 10a/8:30p 13:56:35 i don't have issue with daily meetings 13:56:45 but with 6:30 pm 13:57:27 colindixon: I'll get with you ahead of time with any issues I might be having 13:57:36 or q's I want raised tomorrow 13:57:36 so some time after 8:30 PM is fine with me 13:57:45 #Info Neel_B to work on the action items and e-mail progress, we’ll decide whether to meet at this time tomorrow: http://www.timeanddate.com/worldclock/meetingdetails.html?year=2014&month=7&day=1&hour=15&min=0&sec=0&p1=24&p2=43&p3=505 13:57:56 #endmeeting