13:01:18 <colindixon> #startmeeting jQuery/XPath for MD-SAL intern
13:01:18 <odl_meetbot> 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 <odl_meetbot> Useful Commands: #action #agreed #help #info #idea #link #topic #startvote.
13:01:18 <odl_meetbot> The meeting name has been set to 'jquery_xpath_for_md_sal_intern'
13:01:41 <colindixon> #topic status update
13:01:43 <Neel_B> hangouts is fine by me
13:02:31 <colindixon> 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 <regXboi> let's stay with IRC for now
13:02:48 <colindixon> so, Neel_B, how’d steps 2 and 3 go?
13:02:57 <devinavery> Aggree'd. We can shift to a google hangout if needed.
13:02:58 <regXboi> about all I could see hangout be useful for is screen share
13:03:27 <Neel_B> so are we shifting ?
13:03:34 <devinavery> Staying on IRC for now
13:03:48 <Neel_B> okay implemented node interface
13:04:09 <devinavery> #info Neel uploaded his most recent changes to his git repo
13:04:16 <colindixon> #link https://github.com/neel1438/Opendaylight/tree/master/jquery/src/jquery the changes are here
13:04:26 <Neel_B> but hardcoding was difficult actually
13:04:43 <Neel_B> for attributes the return type is NamedNodeMap
13:04:50 * regXboi scans
13:05:04 <Neel_B> so i didn't know how to put attributes
13:06:12 <devinavery> Hmm. Ultimately it looks like that is another interface we will have to implement
13:06:30 <devinavery> Likely we can just use a Map<> under the hood, but need to look at it first to be sure
13:06:36 <regXboi> I think I'm missing an orbit here
13:07:08 <Neel_B> http://pastebin.com/tt8gh1Z3
13:07:09 <colindixon> #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 <Neel_B> this is what i tried for querying
13:07:33 <colindixon> regXboi: yes?
13:07:42 <colindixon> Neel_B: can you commmit that to the repo?
13:07:53 <Neel_B> that has lots of errors
13:07:57 <Neel_B> so i didn't
13:08:02 <colindixon> ah
13:08:08 <colindixon> syntax or runtime?
13:08:16 <regXboi> colindixon: that's the orbit I'm missing - I'm not 100% convinced of the conclusion
13:08:51 <Neel_B> runtime errors xpath expression exception
13:09:05 <colindixon> Neel_B:
13:09:30 <colindixon> 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 <Neel_B> i tried to populate all the nodes so i put "/" in this
13:09:47 <colindixon> Neel_B: ok, did you post the whole main.java file
13:10:16 <Neel_B> almost it has only main method and imports
13:10:39 <Neel_B> thats the testXpath.java i changed
13:12:00 <colindixon> ok, I’m just copying it in to play with it for a few minutes
13:12:15 <Neel_B> http://pastebin.com/3gmmARkh
13:12:37 <devinavery> Before we get to the NameNodeMap though it looks like the getNodeType() methods need to be implemented on the nodes.
13:12:59 <regXboi> devinavery: now *that* I agree with
13:13:56 <regXboi> on getNodeType() we've got an override that goes back to the base class... do we need more?
13:14:37 <regXboi> and with that... I'm still not convinced that I can't take the NamedNodeMap apart
13:15:53 <devinavery> 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 <devinavery> 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 <devinavery> That way, if there is a call, it will fail.
13:16:46 <devinavery> ...
13:16:51 <regXboi> hang on... we lost him
13:16:59 <devinavery> Yup. Was just going to say that.
13:17:11 <colindixon> #topic review and next steps
13:17:37 <regXboi> 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 <regXboi> 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 <regXboi> er s/w3x/w3c/
13:19:17 <colindixon> 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 <colindixon> 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 <regXboi> ok... now I got it... I'm thinking backwards from the rest of you
13:20:47 <devinavery> 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 <devinavery> So to get the ID of attribute "A", you would use /A/ID instead of /A/@ID
13:21:09 <regXboi> now... that is good news
13:21:15 <devinavery> Which means we can likely avoid NameNodeMap for now
13:21:35 <regXboi> well... so the question is... should MD-SAL be using attributes
13:21:49 <regXboi> yeah, I know I shouldn't ask it
13:22:09 <devinavery> ... well. I guess, may statement above isn't 100% accurate
13:22:21 <devinavery> RESTCONF is not using attributes and I think that is up to the restconf spec (draft)
13:22:35 <devinavery> As for XPath, I guess it really comes down to how we want to implement it
13:22:59 <regXboi> ok, I'm not going to get into RESTCONF
13:23:02 <devinavery> 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 <regXboi> I have very strong opinions on that
13:23:24 <devinavery> :)
13:24:13 <colindixon> 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 <devinavery> 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 <devinavery> Ok, sounds like a +1 from Colin... :) regXboi?
13:27:10 <colindixon> #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 <regXboi> I don't see that we have a choice
13:27:19 <regXboi> so we can mark it as agreed
13:27:57 <devinavery> 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 <devinavery> for us **
13:28:14 <regXboi> agreed
13:28:25 <devinavery> So I think these are the next steps in my mind.
13:28:37 <devinavery> And we can echo them if we all agree using the meet bot
13:28:39 <colindixon> #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 <colindixon> devinavery: that sounds good to me
13:29:12 <colindixon> I’m just capturing the discussion a bit
13:29:15 <colindixon> (for us and for Neel)
13:29:35 <devinavery> 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 <colindixon> #topic concrete next steps
13:29:53 <devinavery> 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 <devinavery> #2) Modify the test xml document (and hardcoded nodes) to remove the attributes, and just use child tags. For example <a><b><id>b_id</id><c><id>c_id</id></c></b></a>
13:30:56 <regXboi> let's action those?
13:31:01 <colindixon> +1 to both of those
13:31:08 <devinavery> #3) Implemnt the remaining missing methods when you run it (presently that is getNodeType() method)
13:31:19 <colindixon> #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 <colindixon> #action Modify the test xml document (and hardcoded nodes) to remove the attributes, and just use child tags. For example <a><b><id>b_id</id><c><id>c_id</id></c></b></a>
13:31:39 <colindixon> #action Implemnt the remaining missing methods when you run it (presently that is getNodeType() method)
13:31:54 <colindixon> hey Neel_B
13:32:14 <colindixon> 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 <devinavery> 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 <colindixon> #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 <colindixon> Neel_B: the short version is the following (from devinavery)
13:34:38 <colindixon> 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 <colindixon> 2) Modify the test xml document (and hardcoded nodes) to remove the attributes, and just use child tags. For example <a><b><id>b_id</id><c><id>c_id</id></c></b></a>
13:34:51 <colindixon> 3) Implemnt the remaining missing methods when you run it (presently that is getNodeType() method)
13:35:05 <colindixon> ** 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 <Neel_B> yeah i already know that @id means an attribute id
13:36:13 <Neel_B> but calling hasAttributes function should return false and should not print anything
13:36:18 <Neel_B> thats what i tried to do there
13:36:31 <Neel_B> hasAttribuetes()*
13:36:57 <devinavery> 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 <Neel_B> okay okay
13:37:25 <devinavery> 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 <Neel_B> okay
13:39:11 <colindixon> so, hopefully we can get away without having to implement NamedNodeMap
13:39:25 <Neel_B> do you think the getnodetype() error was due to
13:39:35 <Neel_B> initializing dummy=NULL?
13:39:51 <devinavery> Yes (it is a null pointer exception I am getting [I think] )
13:40:10 <devinavery> Yeas - confirmed. I am getting a NPE.
13:40:21 <devinavery> So we need to implement that method in all of our Nodes.
13:40:46 <Neel_B> i cannot instantiate node class so how can i instantiate MyNode without node ?
13:41:43 <devinavery> 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 <devinavery> Then in your class, you say "final Node c2 = new ThrowExceptionNode () {   ... put your method overrides here like you already are ...}
13:43:15 <colindixon> Neel_B: does that make sense?
13:43:19 <Neel_B> okay modify my node with throwing exceptions for every method
13:43:20 <Neel_B> ?
13:43:33 <devinavery> I would just copy and paste the class to a new Name.
13:43:49 <devinavery> Keep MyNode around for the old stuff just incase we want to reuse it again
13:43:58 <colindixon> +1 to that
13:44:09 <regXboi> +2 to that
13:44:58 <Neel_B> "final Node c2 = new ThrowExceptionNode () {   MyNode Funtions ?}
13:45:59 <colindixon> same as here: on line 20 http://pastebin.com/tt8gh1Z3
13:46:06 <Neel_B> if an exception araises what gets called ?
13:47:00 <colindixon> 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 <Neel_B> (throw a not supported exception or some other runtime exception from every method) ? what does adding not supproted exception do ?
13:47:11 <Neel_B> yeah
13:47:21 <Neel_B> like i did on document interface
13:48:13 <devinavery> This is what I am referring too:
13:48:17 <devinavery> public class ThrowExceptionNode implements Node {
13:48:17 <devinavery> 
13:48:17 <devinavery> @Override
13:48:17 <devinavery> public String getNodeName() {
13:48:18 <devinavery> throw new RuntimeException( "Not Implemented" );
13:48:20 <devinavery> }
13:48:22 <devinavery> ...
13:48:24 <devinavery> }
13:48:48 <colindixon> 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 <devinavery> This way if any method on ThrowExceptionNode is called, we will throw a Runtime generated exception, which will fail
13:49:04 <devinavery> (what Colin said)  :)
13:49:41 <colindixon> 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 <Neel_B> okay got it
13:51:00 <colindixon> 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 <colindixon> and then we can start doing real work on getting that to work with the MD-SAL
13:51:16 <Neel_B> yup
13:51:19 <colindixon> ok
13:51:21 <colindixon> perfect
13:51:48 <colindixon> #info there was a lot of discussion back and forth (with code examples) about exactly what to do next
13:51:54 <colindixon> anything else anyone wants to take care of
13:52:34 <colindixon> 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 <devinavery> I think once we get that we can better understand how we are going to interact with MD-SAL.
13:52:44 <colindixon> does that make sense to folks?
13:53:01 <devinavery> Yup
13:53:13 <Neel_B> i will finish this part as soon as possible
13:53:31 <devinavery> 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 <devinavery> Sorry, not Ping 2.0, just plain old ping. :)
13:54:02 <Neel_B> colindixon: sure can it be normal time 8:30 P.M here /10AM there ?
13:54:36 <regXboi> I won't be able to make that slot
13:54:43 <regXboi> but go ahead without me
13:54:53 <Neel_B> devin i did not try that yet and will so it as soon as its done
13:54:54 <regXboi> I'll catch up on the meeting minutes later
13:55:11 <colindixon> Neel_B: I can do that time tomorrow
13:55:21 <devinavery> Sounds good. Thank you all.
13:55:26 <Neel_B> actually 6:30PM is a bit inconvinient for me if its daily
13:56:00 <colindixon> 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 <colindixon> but sure
13:56:18 <colindixon> lets do 10a/8:30p
13:56:35 <Neel_B> i don't have issue with daily meetings
13:56:45 <Neel_B> but with 6:30 pm
13:57:27 <regXboi> colindixon: I'll get with you ahead of time with any issues I might be having
13:57:36 <regXboi> or q's I want raised tomorrow
13:57:36 <Neel_B> so some time after 8:30 PM is fine with me
13:57:45 <colindixon> #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 <colindixon> #endmeeting