Saturday, January 09, 2010

Immediate = True

In JSF development, and attribute called Immediate pops up sporadically.
It has always been a source of confusion of myself and others around me. Rather than trying to explain its meaning in the post, I will redirect the reader to the best article i have ever read about this issue,
http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works

In essense, the immediate behaviour has to be studied for Input Items seperately from Command items. In Input Items, immediate = true, effectively executes the validation, conversion and events queueing at the end of the apply-request phase. If an error occurs, the rest of the lifecycle is skipped and the Render phase is executed (meaning that non-immediate input items wont be checked). For Command Button, immediate=true means that the action listener or other action events are executed at the end of the apply-request (before, any validation on non - immediate items and before update model). If the event processing returns a non-null navigation string, the lifecycle proceeds to the render-response phase, effectively short-circuiting all other component's lifecycle processing. if the even processing returns null navigation string, then normal processing of lifecycle continues.

ammar sajdi

Monday, December 28, 2009

living in an Ice box


Ammar Sajdi

This is the title that best suits the weather conditions in Beijing (aka Peking) - Mainland China last Friday.
I was in Beijing from Monday till Friday. Upon arrival, it was cold, around zero, which is ok, however, by Friday morning the temperature dropped to a frigid (-13 C) with wind chill approaching near (-20 C) with Sunny skies. Beijing lies in the northern part of China and towards the eastern tip of Asia close to Japan (relatively close); This kind of cold weather reminded me of my college days at the Urbana-Champaign campus.
Beijing turned out to be a very modern city with a really organized infrastructure, clean streets, and excellent shopping malls. It does not fall short of any of the world’s renowned capitals, while still accommodating some 15 million inhabitants. I was impressed right from the beginning upon entrance to Beijing Airport terminal. A Very well organized, clean, and huge airport. How huge? Well, you take the subway to reach the luggage pick-up area. The hotel was a good 4-star hotel with excellent service and nice restaurants. Even though I was in Beijing on a business trip, on Friday, I had some time to spare and defied the frigid cold temperature and went shopping. I ended up with nice Chinese gadgets to take home on a nine-hour flight to Doha, 8 hours transit time, and another 2 hours to Amman. It was a quick journey, and I felt that I visited Tokyo therefore, I still have plans for a future China visit. To sum up, a well worthwhile trip that I need to try again when the temperature is not as cold and when I have more time to ramble around.


Ammar
www.realsoft-me.com
www.e-ammar.net

Friday, December 11, 2009

Unpleasent Treat, Movenpick bahrain

I am leaving Kuwait now back to Jordan, after spending 6 days in Kuwait.
I have not been in kuwait since 2003, but then, i had a splendid stay at Marriott (I was treated lavishly, really pampered in all sense). This time I thought i was making the best decision by staying at Movenpick Kuwait (Free Zone). To be honest, i was a bit disappointed. The only 5 Star aspect of the Hotel is Service, however, the hotel is of poor quality, you can notice that as soon as you get to the reception area. It looks old and unmaintained and the finish is not good.The room is Ok, spacious and clean, but the furniture does lack the 5 Star luxury feel.
I did not enjoy the TV since it has been a while since i watched a NON-LCD any kind of display. It is an old 29 Inch regular TV, with a bad sound quality, and not to mention, a rather poor choice of channels.
One point worth mentioning is the fact that there seems to be a sewage treatment plant nearby, and as such, some times (especially at night any in the early monring hours, it smells like Sh.t). Unfortunetly, these are the periods when i was most likely to be in the Hotel.
The food is good, but the buffet is not a 5 stars buffet from an assortment point of view. That applies to both breakfast and dinner.

In essense, for the amount of money paid, i will not return

as for the general stay, i was there for a short consulting engagmemt at Kuwait University, to check how the team is doing with the Jdeveloper 11g New ADF technology. In all fairness, they are doing very good job and definitely, they are an early adopters to the technology

ammar

Friday, November 27, 2009

العيد بعيدين

and maybe more,

the first reason is because it is EID Al Adha, and instead for writing again and agian about it, i will just refer to
http://oraclejo.blogspot.com/2008/09/eid-dj-vu.html.

and for the second Eid, it about some technical issue that i figured about ADF technology. If you are not familiar with what Oracle ADF is, stop reading because this is not for YOU, or continue at our own risk

Well, i spend the day yesterday fiddling around with ADF binding concepts until i believe i have got it all figured out. I was working with this technology for quite sometime (only from out of the box) but since i am asked to do some consulting job next week in Kuwait, i have been doing nitty gritty details and trying to come done to core of the material.

I have designed two pages one based on on Table DEPT and with the following page definition information

Page definition name ="untitled1PageDef"
iterator name ="deptView1Iterator"

and the other is page is based on TRADE table with the following page definition information

Page definition name ="untitled1PageDef"
iterator name ="tradeView1Iterator"

A trivial scenario would be to read some page1 attribute (Text item) from page1 while running page one. All ADF programmers must have encountered this situation and have done it many times through several different solution. The solution i pick is a solution that i can always use and a solution that depends on the basics (No Eid here)

FacesContext ctx = FacesContext.getCurrentInstance();
Application app = ctx.getApplication();
ValueBinding bind = app.createValueBinding("#{data}");

BindingContext bindingCtx = (BindingContext)bind.getValue(ctx);
DCBindingContainer dcb = (DCBindingContainer)bindingCtx.findBindingContainer("untitled1PageDef");
DCIteratorBinding Iter = dcb.findIteratorBinding("DeptView1Iterator");
String attr =Iter.getCurrentRow().getAttribute(2).toString();

(note: i know that there are short cuts that would probably eliminate a few lines of code, but at the expense of hiding the basics).


Now, let us move to the following situation. I am running page1 and selected a specific row, and i am moving to page 2 and i am required to find an attribute of on page 1 (which i have already left) . Well many techniques exist and most of them depend on other standard web techniques like using Session Variables, or ADF actions set Action listener etc..
The basic concept in ADF relies on a model object that holds that sources based on View Object. Since view objects are already instantiated by the Application Module and their data is persistent as long as the application module is alive, and since such objects are bound to ADF iterator binding in the binding containers, then, its only makes sense that we should be able to read the iterator binding of any visited page definition.

Well, during my past readings , i came to know more things about iterator binding, that i undermined at that time. The Literature about ADF iterator binding says, that after the completion of the JSF and ADF lifecycle, the framework unbinds the iterator binding from its data source and rebinds it again when the page is loaded again. This is done automatically to save resources. This of course does not cause the loss of any data, because the view object is still there in the model layer. It is only the iterator binding pointer is not there and in most cases, it needs not be there since at that time the user is on a different page

So, for now, page2 is displayed on the screen and there is a button on page2 screen and i want to read information from page1, the same information that i read when i was already on page 1.

An innocent attempt would be to use the same code as before, and if you do, you will face a NullPointer exception when you run

DCIteratorBinding Iter = dcb.findIteratorBinding("DeptView1Iterator");

Because as i explained earlier the binding iterator of page 1 (DeptView1Iterator) is not bound after the page lifecycle is complete even though the iterator itself exists?? It will be bound during the iterator refresh step during page reload.

Well, then i can find some why to manually refresh the iterator binding, i should be able to accomplish what i want, and Eureka, after some brain drain investigating, i found it


call getRowSetIterator();


and then I included the above call in my code with my fingers crossed, and the Second Eid emerged for me , it worked like a
charm

FacesContext ctx = FacesContext.getCurrentInstance();
Application app = ctx.getApplication();
ValueBinding bind = app.createValueBinding("#{data}");

BindingContext bindingCtx = (BindingContext)bind.getValue(ctx);
DCBindingContainer dcb = (DCBindingContainer)bindingCtx.findBindingContainer("untitled1PageDef");
DCIteratorBinding Iter = dcb.findIteratorBinding("DeptView1Iterator");
String attr =Iter.getRowSetIterator().getCurrentRow().getAttribute(2).toString();
//simialr to DCBindingIterator Iter = (DCBindingIterator)Iter.get("binding iterator)
DCIteratorBinding Iter1 = dcb.findIteratorBinding("tradeView1Iterator");
String attr2 =Iter1.getRowSetIterator().getCurrentRow().getAttribute(2).toString();
System.out.println(attr);
System.out.println(attr2);

The getRowSetIterator() binds it again to the data control and hence it now points to current row of the view object (which would be the row you selected in the previous page when you navigated out of it)

Since I became more confident about my knowledge, i thought, ok what if the user ran page2 immediately without running page 1, and tried to access some data from page (1).
There is no data in page 1!!! and that is exactly the case, running the above code would legitimately yield NullPointer Exception. To demonstrate my understanding, i thought i would manipulate the code is a way, that in case the user skipped page1 , it only makes sense to say that in this case, the current row of the first page would be the first row in the view object, I figure what if i execute a query of the first page iterator after accessing it using

Iter.executeQuery();

Again, it worked like a charm

FacesContext ctx = FacesContext.getCurrentInstance();
Application app = ctx.getApplication();
ValueBinding bind = app.createValueBinding("#{data}");

BindingContext bindingCtx = (BindingContext)bind.getValue(ctx);
DCBindingContainer dcb = (DCBindingContainer)bindingCtx.findBindingContainer("untitled1PageDef");
DCIteratorBinding Iter = dcb.findIteratorBinding("DeptView1Iterator");
String attr =Iter.getRowSetIterator().getCurrentRow().getAttribute(2).toString();
//simialr to DCBindingIterator Iter = (DCBindingIterator)Iter.get("binding iterator)
DCIteratorBinding Iter1 = dcb.findIteratorBinding("tradeView1Iterator");
Iter1.executeQuery();
String attr2 =Iter1.getRowSetIterator().getCurrentRow().getAttribute(2).toString();
System.out.println(attr);
System.out.println(attr2);

I know it means nothing to most of you, but it sure does to me and others in who opt to understand the framework that way i want ....

Which brings up a new reason why it a Eid, well, right now, at about 8:10 PM, we are leaving home and heading for a 36 hours vacation at Aqaba, a decision taken at the spur of the moment

Happy Me

Saturday, November 21, 2009

Significant leap forward



The
Large Hadron Collider is back after it was damaged last year. This collider is by far the largest ever built and will smash atoms to unleash the secrets hidden in the depth of matter.

Exciting experiments shall shed light on the Big Bang theory that explains how the world started.

Ammar Sajdi

www.realsoft-me.com
www.e-ammar.net

Monday, October 26, 2009

Disappointed -- Twice

Once in Dubai, and the other one in Windows 7

As usual, GITEX runs in October and our company exhibits as part of the Jordanian Pavilion.

I do not share sentiments with Dubai's large no of fan. I have always had mixed feelings, but now i have only negative feeling. Even though, and from the outside, it has the looks of modern cities, however, there are fews things that cannot but piss you off.

Upon arrival, i headed immediately to the passport control, and after waiting in a queue for quite sometime, i was relieved that it was my turn to check my passport, only to be asked by a friendly lady to go back to the lower floor and take an Iris Signature. Along the way i found many people returning. How Difficult is it for officials in Dubai to install a sign asking arrivals to take Iris signature before proceeding to Passport Control? The same thing happens every day and nobody is taking any action.

I rented a car (things went smooth) and upon hitting the street, i just faced a total mess. Lots of constructions and diversions , which is fine, but the signage is just horrible. You start with a sign and when you reach an intersection or a diversion, the signs do not tell you anything, and if you are lucky, you might find a small sign at exactly the intersection, by which time, it is almost impossible for you to change lanes.

it took me exactly 30 minutes to reach my hotel, because i was going around it for several rounds. I made a visual contact early on, but getting there amongst the mesh of diversion and constructions is something that requires quite a bit of training.

Arriving at the expo grounds is also an adventure. It is located next to Dubai world trade center that is reachable from a large round about!! and you can probably imagine the traffic on round about in busy areas. But when you reach the parking area, you also wait in lines only to find a poor parking area with no asphalt. If you are lucky, you find a parking place; mind you, that we are exhibitors and paying a lot to rent an area in Gitex and, therefore, the least of our expectations is find a proper parking location. There are three parking lots A, B, and C, I noticed that C is the least busy of all, so the next morning i thought i was going to play it smart. I waited in the line, and when i reached Parking A, I skipped it so that i can part in C, only to find that C is closed. Of course , no sign or nothing. It seems that in Dubai you need to improve foretelling and occultism skills. Going back to the line would take me another 20 minutes, so i decided to park at the corner of the street. When i returned to my car in the evening, i found a parking ticket saying that i am parking in an inappropriate location.


What added in my disappointment is the big fuss made by the release of Windows 7. I bought a Laptop running windows 7, and immediately hit incompatibility issues:
1- does not run my Vmware virtualization software.
2- took my a long time to make it connect to my wireless router.

problems with windows 7 made my search for critiques about it, and i would like to share with you this article

Under the Hood, Windows 7 Is Vista's Twin

Who is Microsoft trying to fool? Underneath the fresh coat of paint, Windows 7 looks and runs like Vista. Here are the benchmarks to prove it.

http://pcworld.about.com/od/windows1/Under-the-Hood-Windows-7-Is-V.htm

ammar sajdi

Tuesday, September 22, 2009

He was a model professor: generous with ideas, gracious with advice, and intellectually curious about many subjects

This is what students of Professor Richard M. Brown said when he passed away on Aug, 22 09.
Brown worked in the Control Systems Laboratory at Illinois (now the Coordinated Science Laboratory) when it was new to campus, helping to set a foundation for digital computer research. He was involved in the creation of such ground-breaking computers as the CSX-1 and the first supercomputer, the ILLIAC IV. PLATO, the first computer-assisted instruction system that helped to develop Internet concepts such as chat rooms and online testing, was helped by Brown’s research on teaching machines.

He did not live to hear what his students had to say about him! He did make a difference and the title just spells it out. If you like it, try to make a difference!

I tried myself, but it seems it shows after we die (if Ever!!!)


Ammar Sajdi
www.realsoft-me.com
www.e-ammar.net

Sunday, September 20, 2009

حملة انتخابية بالعيد

كالعادة وكما هو متعارف علية محليا , يدأب المرشح باقتناص الفرص لمجاملة الناس في كل مناسبة بعد سنوات عجاف من البعد والجفاء وانا طبعا واحد من هذا النسيج الاجتماعي ولا اشكل اي استثناء لذا اسمحو لي اخواني واخواتي ان اتقدم لكم بباقة من اجمل التهاني بمناسبة حلول عيد الفطر السعي واذكركم ب


برئاسة الاخ غسان خرفان


Friday, September 18, 2009

البوس ممنوع

القى فايروس N1H1 بظلالة على مراكز الافتاء الاسلامية حيث وردت اخبار ان البوس اصبح مكروها منعا لانتشار الفيروس.
لا داعي للهلع فيبدو ان المنع مؤقتا حيث يتوقع ان يرفع الحظر بعد العيد مباشرة لتستمر عمليات البوس كالمعتاد



Ammar Sajdi
www.realsoft-me.com
www.e-ammar.net

Sunday, September 13, 2009

I am surprised too



I am running for Amman Chamber of Commerce board elections

16000 people shall cast their vote on Oct 3, 2009.

To vote, you company must have a captial exceeding 5000 JD and must be registered as a memeber in the Amman Chamber of Commerce.





Tuesday, September 08, 2009

REALSOFT in the NEWs ريل سوفت

http://www.petra.gov.jo/Artical.aspx?Lng=2&Section=4&Artical=133029 http://www.addustour.com/ViewTopic.aspx?ac=\Economy\2009\08\Economy_issue693_day31_id171383.htm http://www.alanbat.net/news/Viewoldnews.asp?Nid=239474 http://www.alarabalyawm.net/pages.php?news_id=180754 http://www.addustour.com/ViewArchiveTopic.aspx?ac=\Economy\2004\09\EconomyNews_Issue14390_Day9_ID85843.htm
http://www.elaph.com/Web/Technology/2008/11/381301.htm


sample

البرمجيات المتقدمة والحلول النقالة تنفذان تعدادا تجريبيا في قطر
[30/08/2009 12:34]
عمان 30 آب(بترا)- انهت شركتا البرمجيات المتقدمة ريل سوفت والحلول النقالة تنفيذ التعداد التجريبي للسكان والمساكن والمنشآت في دولة قطر .

وتم تنفيذ التجربة بالتعاون مع جهاز الإحصاء القطري وشملت 700 أسرة موزعة على 4 بلديات تمهيدا لإجراء التعداد العام للسكان والمساكن والمنشآت في2010.

وقال بيان اصدرته شركة ريل سوفت اليوم الاحد هذا أول تعداد تجريبي ينفذ استعدادا لتعداد 2010 في دول مجلس التعاون الخليجي.

ويعتبر التعداد التجريبي مرحلة مهمة تنفذ في كافة المشاريع المشابهة لاختبار المنهجيات والعمليات والتقنيات والخروج بتوصيات لمرحلة التعداد الفعلي.

والبرمجيات المتقدمة شركة اردنية تم تأسيسها في العام 2002 والحلول النقالة شركة شقيقة سيستر كومبني للشركة الاولى.

واشتملت التجربة على اربع مراحل لمحاكاة خطوات التعداد الفعلي، حيث تم في كل مرحلة استيفاء استمارة خاصة لبيانات المباني والوحدات السكنية ثم المنشات وفي النهاية جمع البيانات التفصيلية للسكان من مواطنين ووافدين.

وجاء في بيان الشركة ان المراحل كافة تمت بسلاسة حيث كان يتم ربط بيانات كل مرحلة بالمراحل السابقة لها لضمان تكامل واتساق البيانات الإحصائية.

ومن أهم معالم هذه التجربة استخدام الأجهزة الكفية الالكترونية بي دي ايه المزودة بالخرائط الالكترونية والصور الجوية لجمع البيانات ونقلها إلكترونيا إلى قواعد البيانات المركزية بدلا من الأسلوب التقليدي الورقي.

وشركة ريل سوفت نفذت تعداد سلطنة عمان 2003 باستخدام الاجهزة الكفية في ولاية مسقط علما بأن سلطنة عُمان شرعت بالتحضير لتعداد 2010 على مستوى السلطنة باستخدام تقنيات الأجهزة الكفية.

يشار ان دائرة الإحصاءات العامة أدخلت وبالتعاون مع الشركة خدمة الاجهزة الكفية في إجراء التعداد الزراعي العام 2007.

--(بترا) ف ح/س ج/ س ق.

Fundamentals of Software Testing

Originally posted on jan , 23 2009, Published again on Sept,18,2024 extracted completely from    http://testingsoftware.blogspot.com/2005/1...