Wednesday, April 20, 2011

A new light

So after discussing a little more with Dr. Bowring, I changed the complexDataObject so that it contains a static arrayList of complexDataObjects and anytime one is created it is added to the array. The insertion is sorted to allow faster sorting using a comparator class. So after all that is done, the methods become a lot easier. For public boolean supportsView(String view) I do a search through the static arrayList for a object that has title of the string view. Returns true if the view is found else returns false. For public String[] getSupportedViews() I had to modify it to return an arrayList instead of an array and then I created a copy of the static arrayList of complexData and then return it.

Monday, April 18, 2011

Java.lang.Reflect

Thanks to Dr. Bowring I was able to find a much nicer way to implement my two methods for the complexObsHandler and complexData object. Reflection is a feature in the Java programming language. It allows an executing Java program to examine or "introspect" upon itself, and manipulate internal properties of the program. For example, it's possible for a Java class to obtain the names of all its members and display them. So after googling I was able to find some sample code and a tutorial on oracle to find all the instances of the class using reflect, now I just need to implement them into Openmrs which has given me some trouble but I'm confident I will get it done.

Thursday, April 7, 2011

Still trying to fix my bug

So after trying to fix my bug I realized I needed to get a little more info on exactly what the openMRS team wanted. I view a discussion on the mailing list , I was a little more informed but I still didn't feel I had the information I needed to accomplish the task, so I started reading what the Complex obs handler actually did at the openMRS wiki. After carefully reading I have much better understanding of  the obs handler and its actually an interface. So in order to create the method to getSupportViews()  I'm thinking  need to find a way to have java return classes that implement the obs handler. As for   supportsView(String view), I was planning on using getSupportViews() to create a list of views and then search through that list for the view pass as the parameter if the view is found return true else it returns false.So now that I have a plan its time to try implementing, wish me luck.

Tuesday, April 5, 2011

Ok lets fix another bug

So after so carefully reconsideration, Each member of my team carefully selected a bug/feature for each of us to fix. I choose Trunk-2136. The feature is to add two methods to the complex obs handler object. One method verifies that a view is supported by the handler. The other returns a list of all the supported views in an object. I have begun to experiment with these a little bit and they seem conceivable so hopefully I will be able to produce some results.