Blog do projektu Open Source JavaHotel

wtorek, 30 lipca 2013

Byliśmy na przedstawieniu

20 lipca byliśmy na przedstawieniu filmu operowego "Kopciuszek" wyświetlonego w ramach 13 edycji Festiwalu "Ogrody Muzyczne" na Zamku Królewskim w Warszawie, podobało nam się bardzo.
Opera Rossiniego jest pozbawiona elementów bajkowych w porównaniu do wersji baśni Charles Perraulta, nie ma tutaj czarów dobrej wróżki. Autorzy przedstawienia postanowili jednak przypomnieć baśniowy charakter w postaci pięknych animacji pojawiających się w przerwach miedzy aktami opery.
Samo przedstawienie jest częścią szerszego projektu mającego na celu nagrywanie oper w historycznych wnętrzach z pełnym użyciem nowoczesnej techniki, tutaj za scenę posłużyły zabytkowe budowle z Turynu.
Samo przedstawienie nie ma jednego bohatera czy wiodącego solisty, tutaj wszystkie elementy są tak samo ważne i stanowią istotny element całości.
Autorzy nie zamierzali intrygować widzów jakimś rewolucyjnym i nowatorskim odczytaniem dzieła operowego, a raczej odwrotnie. Za pomocą nowoczesnej techniki wydobyć i pokazać to co najpiękniejsze, czyli wspaniałe wnętrza, piękną muzykę i postacie wykonawców, którzy nie tylko śpiewają swoje role ale także z wielkim talentem je odgrywają.
To zamierzenie udało się z całą pewnością. Mimo  iż cały film trwa blisko trzy godziny, to śledzi się od początku do końca z niesłabnącą przyjemnością i zainteresowaniem.

poniedziałek, 29 lipca 2013

Selenium, python and Firefox 22

Problem
Selenium refuses to work with Firefox22 although it works properly with Firefox21. A lot of posts poured over internet. Example :
https://groups.google.com/forum/#!topic/selenium-users/1psXxdH-zS0
Although there is a fix available for Selenium 2.22 it seems not working for python users.
My solution
By I find a way to force Selenium to use Firefox21 without removing Firefox22.
  • Download and install somewhere Firefox21 (for instance /home/opt/firefox21/firefox)
  • Force selenium starter to use it by adding browserConfigurationOptions parameter to start method. 
selenium = selenium(host, port, browser, http)
selenium.start(("executablePath=/home/opt/firefox21/firefox"))

niedziela, 30 czerwca 2013

MVP Jython framework and dateline widget

Introduction
I added "dateline" (not confuse with "timeline") widget to MVP framework. The demo version is available here (click "Panel date" button at the bottom). Source code for whole solution is available here. Sample screen snapshot.
This widget can be used as a dashboard for hotel application where lines are rooms and columns are rooms availability on timeline (free, reserved, in use).
Technical description is available here.
Features

  1. Buttons for navigating though time line (go to date, next day, previous day etc).
  2. Declaration of some visual behavior: number of lines visible, number of date columns.
  3. Lines customization. Dynamically created list of lines and definition of columns visible.
  4. Cell (line/date) customization. Dynamic definition of cell visualization via custom html. For instance: different visualization for free rooms and reserved rooms.
  5. Customized logic for clicking on cell. Possible to define some business logic to clicking. For instance: after clicking on the cell open a windows to start reservation of the room.
  6. Sorting (lines values only).

Future enhancement

  • Partial refresh. Current version calls for refresh any time something has changed. Optimization is possible, for instance: in case of moving one day forward/backward refresh only one column. 
  • The same for lines, request data only for visible line.
  • More convenient way for moving in time.
  • Customized searching.


poniedziałek, 24 czerwca 2013

Glassfish 4.0 and Guice

Problem
I was using a mixture of EJB3 and Guice injection following method described here. The sample source code is available here.
Glassfish 3.1
It works without problem with Glassfish 3.1 giving the desired result
Glassfish 4.0
But deployment failed when I tried the same code to push into Glassfish 4.0.
deploy?DEFAULT=/home/hotel/NetBeansProjects/Container/TestApp/dist/gfdeploy/TestApp&name=TestApp&force=true failed on GlassFish Server (1) 
 Error occurred during deployment: Exception while loading the app : CDI deployment failure:WELD-001408 Unsatisfied dependencies for type [InjectedService] with qualifiers [@Default] at injection point [[BackedAnnotatedField] @Inject private com.test.myejb.TestSessionBean.iService]. Please see server.log for more details.

It looks that CDI implementation in Glassfish 4.0 is trying to resolve @Inject annotation on its own just ignoring the fact that it should be handled by @Interceptors annotation.

@Stateless
@Interceptors(value = { GuiceInterceptor.class })
@Local
public class TestSessionBean implements TestSessionBeanLocal {

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method"
    @Inject
    private InjectedService iService;
    
    
    @Override
    public String getHello() {
        return "Hello, I'm your test session bean";
    }

    @Override
    public String getMessageFromInjected() {
        return iService.helloFromInjected();
    }


}
Solution 
Solution was quite simple, just replace:
//import com.google.inject.Inject;
import com.google.inject.Inject;
Another remedy was adding empty bean.xml file to META-INF directory.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">

niedziela, 23 czerwca 2013

Byliśmy na koncercie

5 czerwca 2013 roku byliśmy na koncercie organowym w ramach XXIII Międzynarodowego Festiwalu Muzyki Sakralnej, bardzo nam się podobało.
Uczeń Franciszka Lista, Julius Reubke, zmarł młodo i zostawił po sobie niewiele kompozycji. Ale jednak z nich, Sonata "Psalm 94", jest jednym z najchętniej wykonywanych utworów organowych epoki Romantyzmu.
Franciszek List rzadko tworzył muzykę na organy, tylko dwa większe utwory zyskały sobie większą popularność. Jeden z nich, Fantasie und Fuge über den Choral „Ad nos, ad salutarem undam”, był w repertuarze koncertu.
Pomimo, że nazwisko Franciszek List dużo więcej dzisiaj mówi niż Julius Reubke, to jednak pierwszy utwór bardziej zapadał w pamięć. List zdecydowanie bardziej się podoba jako autor muzyki fortepianowej czy symfonicznej, niż organowej.
Solistą na koncercie był Giampaolo Di Rosa, na bis wykonał bardzo szybki i efektowny utwór, ale nie udało nam się rozpoznać co to było.
Bardzo miłą zaletą koncertu w Katedrze Polowej Wojska Polskiego był telebim umieszczony w prezbiterium, który dawał możliwość obserwacji solisty w trakcie koncertu. Nie wszyscy sobie zdają sprawę, że muzyka organowa wymaga także obsługi klawiatury nożnej. Intensywne wykorzystanie pedałów widać było wyraźnie w utworze Juliusa Reubke. Wadą koncertów organowych jest dystans dzielący wykonawcę od publiczności, ale dzięki nowoczesnej technice ten dystans udało się zniwelować.

wtorek, 4 czerwca 2013

Number grid and JavaHotel application

Information
I added grid number to the JavaHotel application.





















It is used to define a price list for services offered by hotel (launch, U/P user/user -> Price list).
Next step
Hotel rooms, list of customers and dashboard to reserve/book and present hotel status

czwartek, 30 maja 2013

Jython MVP framework and new widget

Introduction
I extended "check list" (grid), also grid of numbers (not only checkbox) can be created. Demo version is available here, click "Number grid".
After clicking "Check" button the Jython backing action fills the bottom row with sum of numbers in the column.
More detailed information is available here.
Sample
Declaration of number grid is very simple, just add "type" info to  "checklist" tag. Example:

<checklist id="prices" displayname="Prices" type="decimal" afterdot="2" >
 </checklist>
Example of backing Jython code is available here.
Additional feature
Unlike "check box" number grid allows error visualization. In the sample application just enter number less then -10 and click "Check". More then one cell can be marked this way.
Test
Next test case has been added to the  test suite. Test scenario is available here.
Next step
This widget will be used in the hotel application to define a price list for services offered by the hotel.