This blog has moved to
http://blog.matthias-reining.com

Die bestehenden Artikel bleiben vorerst alle bei blogspot. Neue Artikel veröffentliche ich allerdings nur noch auf http://blog.matthias-reining.com

Freitag, 19. November 2010

devoxx 2010

Devoxx 2010

Ich hab mit meinen Kollegen Jürgen (Twitter: @JuergenReichert) die Devoxx 2010 in  Antwerpen besucht.


Allgemeines: Coole Veranstaltung: sehr gut organisiert; überall superschnelles WLAN; Catering hat gepasst

Im folgenden die von mir besuchten Sessions mit einem kurzen Kommentar von mir:

Montag 15. November 2010

Seam 3: State oft the Union (By Dan Allen and  Peter Muir)
Abstract: Seam is a powerful open source development platform for building rich Internet applications in Java EE, now rebuilt on JSR-299: Contexts and Dependency Injection for Java EE. JSR-299 is an elegant set of new services that include dependency injection, contextual lifecycle management, configuration, interceptors and event notification. While these services are familiar, the innovative use of meta-annotations is uniquely expressive and typesafe, and a significant step forward from Seam 2. The implementation of this new programming model is provided by Weld. Seam extends the CDI programming model by providing portable enhancements, extensions and integrations that tie technologies such as Java Persistence 2 (JPA), Enterprise JavaBeans (EJB 3.1), JavaServer Faces 2 (JSF), Business Process Management (BPM), business rules (Drools), reporting (PDF and Excel), security and e-mail templates into a unified full-stack solution, supported by sophisticated tooling.
In this session, Pete Muir and Dan Allen, two of the lead Seam developers, detail the state of the union for Seam 3. We'll cover how it's being reachitected on JSR-299, cover its new modularized and autonomous infrastructure and provide an overview of features, both migrated and new. This talk has a nice blend of theory and application. Audience members will take away from this talk and understanding of CDI and Seam 3 and knowledge to get their hands dirty and started developing with this platform.
mr678: Sehr cooler Vortrag. Mich hätte an einigen Stellen noch interessiert wie sich JEE6 von Seam3 abgrenzt. Dies ging (verständlicherweise) nicht immer richtig aus dem Vortrag der JBoss Jungs hervor.
Joe Baxtter hat Seam Forge vorgestellt – Livedemo hat allerdings auch nicht ganz geklappt ;-)
--

Abstract: During this session, we’ll discover the new Flex 4 framework associated with Flash Builder 4 (Eclipse plug-in to develop Flex apps) and how your rich front-end can exchange objects with your JAVA server. If you wish to develop Desktop applications, then you’ll be interested by the new features of the Adobe AIR 2 runtime. We’ll see how to run offline applications, invoke a Java native process on the client side, play with your webcam or your microphone... on Windows, MAC and Linux. The last part of this session will cover Mobile and Tablet applications. Thanks to the future releases of the Flash platform, JAVA developers can rapidly develop applications for Android (and soon Blackberries, WebOS and iOS), leveraging specific mobile APIs such as multitouch, the accelerometer, access to the camera or the microphone, etc... These three hours will give you a 360 panorama of the Adobe RIA technologies.

mr678: Coole Präsentation. Wie bekommt man die Sachen auf dem iPhone usw. zu laufen. Präsentationstechnisch 1A


DI 16. November 2010

Abstract: Last year, Antonio & Alexis presented Java EE 6 in a room full of admirers of this new specification (Java EE 6 was out after Devoxx, mid-december 2009). This time Antonio and Alexis are back with more advanced features on Java EE 6 which is even more powerful than they initially thought! JPA 2.0 entities, EJB 3.1 EJBs, Servlet 3.0, Bean Validation, JAX-RS, @Inject and CDI... will have no more secret for you.
Mr678: Sehr coole Präsentation – cooler Überblick, a bissle JEE5 vorausgesetzt
--
Abstract: Come and see how you can use the JBoss Tools Eclipse plugin to deploy fast and efficient to any Application Server (not just JBoss), local, remote and even into The Cloud. Also see how JBoss Tools can be used to either take full usage of Eclipse WTP for deployment or if you prefer plain old Java Project's still allows you to do incremental (aka. Freaking Fast) deployment for easy testing of both local and remote applications.

Mr678: Ziemlich kurz… Bsp wie man mit JBoss Tools exploded deployed…. naja
--
Abstract: If you want to know what new feature of Hibernate you are missing, come and join us.
Java Persistence 2 is closing the gap and standardizes even more persistence related features.
What does this mean in the context of the Hibernate project? Generally speaking, what's new in Hibernate?
In this session, we will check out the new features of Hibernate and in particular the one coming from Java Persistence 2. They will be explored in live coding sessions.
We will explore:
·         the new type-safe Criteria API as well as its close brother the new Hibernate Static metamodel generator
·         the new locking options and their consequences for your applications
·         Infinispan's new second level cache
·         fetch profiles
·         the new partial generators
·         and many more things
We will also walk through what's beyond Hibernate Core: Hibernate has slowly grown from the ORM to a set of domain model centric tools like validation, full-text search and so on:
·         Hibernate Validator and the Bean Validation specification
·         Hibernate Envers and temporal data support
·         Hibernate Search and full-text search for Hibernate applications.
·         General knowledge of Hibernate or ORM (Object Relational Mapping) is preferred

Mr678: Überblick über JPA 2 Features und die komplette Hibernate Produktpalette
Bin um 15:00Uhr gegangen – die Arbeit hat gerufen…
--
Abstract: If you are a Java EE 6 user, your choices for Tooling have never been better. Maybe you have been using a specific tool forever (NetBeans, Eclipse, IntelliJ), and do not have the time of the energy to learn a new one? Join this talk to see the latest developments in the following IDEs around Java EE 6:
·         NetBeans and its advanced Java EE 6 GlassFish integration
·         Eclipse and the Oracle OEPE pack with GlassFish integration, as well as the latest features in the Eclipse December 2010 release (with hopefully more Java EE6 features)
·         Intellij and its EE 6 support.
The talk will use live demos of the 3 IDEs, presenting advanced features for the EE 6 developer:
JPA2, JSF 2, CDI, JAX-RS, Bean Validation, Servlet 3.0, Maven support, and end to end advanced wizards.
Mr678: Vergleich der IDE netbeans, eclipse, IntelliJ
Winner netbeans – war aber auch ein Oracle/sun Mann…
--
Abstract: Make your application compile spreadsheets directly to parametrized, high-performance Java classes for use in your business logic using the Abacus Formula Compiler (http://formulacompiler.org/, available under GPL or commercially).
Why? In many business applications, the calculation of certain key values varies from user to user, and over time. Examples of such values are: prices and shipping rates in order-entry applications, asset valuations in portfolio management solutions, or insurance premiums in sales force applications.
Business analysts, or the users themselves, know best how such key values are calculated and they know - and love - tools like Microsoft Excel or OpenOffice Calc. So let them use these familiar tools to define and update the calculations instead of adding endless and, for many users, incomprehensible configuration options to your code.

For you, no more hand-coding of changing calculation models. And, since changes in spreadsheets can be incorporated at run-time, no more waiting for the next code release for your users!
I will show this in action with examples from the Abacus Financial Applications suite (http://abacus.ch/).

Mr678: Ähnlich wie p7030 – Allerdings werden alle Formeln neu berechnet.
jExcel (in Zukunft POI) wird benutzt um Excel/OpenOffice auszulesen. Aus Excel werden Java Klassen generiert inkl. der Formeln (Performance technisch recht cool)
Im Gespräch im Anschluss habe ich Hr. Arrenbrecht nach den Kosten gefragt: 10.000EUR Commercal Lizence.
--

MI 17. November

Abstract: Welcome and Intro to the devoxx 2010 conference.
Mr678: Vorstellung von parleys.com und devoxx-ausenrum…

Abstract: During this keynote you'll get an overview of the state of Java SE 7 and beyond.
Mr678: Java Chief Architect von Oracle
RoadMap vorgestellt – Interessantes zu Java 7 / 8

Abstract: The State oft the Web keynote.
Mr678: Sehr coole Präsentation. Wo kommt das Web her und wo geht’s hin…

--

Abstract: For years, the enterprise IT community used to believe they were the big guys, and those Web folks were just script kiddies building toy apps with PHP. But by now, the really interesting systems are those built on the Web, with non-functional requirements that make even the biggest banking or insurance app pale in comparison. Integration, as practiced on the Web, is also widely different from the typical enterprise IT approach - yet it seems to yield results that outshine years of effort in most large companies.
In this session, we'll take a look at how the typical enterprise IT landscape can benefit from the Web's architecture, what Java developers need to learn to be part of this, and why the whole idea of "applications" is going to disappear.

Mr678: PHP/Ruby Entwickler vs. Java Enterprise
REST ist hipp (amazon, twitter, …) und die Erfindung von PHP/Ruby – Enterprise kann a bissle was lernen…
Viel von dem Enterprise Zeug wird auch nicht benötigt. „Der User sind nicht wir“.
Sich auf das eigentliche Konzentrieren, am Ende kommt oft nur HTML raus….
FatClient will kein User…

--

Abstract: Git is an exciting new DVCS that is gaining traction in the development world. But if you are merely using it as SVN++, then you are missing out on 75% of what it has to offer. In a quick 15 minutes, I'll open eyes to the team-behavior improvements, bug finding, and performance that only Git offers today.
Mr678: Vorteile von GIT gegenüber SVN wurden vorgestelt

--

Abstract: Get introduced to Vaadin open source web framework by its founder. The framework provides a desktop-like user experience on the web without writing any HTML, XML or JavaScript. The user interface is written completely in Java and run at the server-side. Applications are deployed as Servlets, Portlets or to Google App Engine and run in any modern web browser without plug-ins or applets.
·         Java-developers interested in writing rich desktop-like user interfaces for web should attend - no experience of web technologies is needed.
·         Get introduced to server-side RIA frameworks
·         Learn pros and cons compared to client-side RIA and Google Web Toolkit
·         Start writing beautiful web applications with Vaadin

Mr678: Ähnlich GWT und Wicket… nur cooler!
Gleich mal ausprobiert – rockt!!!
BeanValidation geht out-the-box nicht, aber scheinbar mit einem Zusatzplugin

--

Abstract: W3C’s HTML5 standard has rapidly gained momentum as 2010’s hottest technology with help from companies, such as Google, Apple, and Microsoft. Developers and businesses alike are all trying to catch and align themselves with this new standard. Out of all the ideas and features in this new set of specifications, the most intriguing, exciting, and controversial section is HTML5 WebSocket. At first glance, some misinterpret WebSocket as merely a better transport protocol and replacement of HTTP or XHR. However, upon additional understanding, one quickly learns WebSocket is NOT a replacement or improved version of HTTP or XHR, nor do we want it to be!
If we look at the current hype around PaaS, Cloud, pre-built business widgets and applications, virtualization, payments etc… they have all forgotten to look at the road. The actual tarmac that makes all of this communicate. We all assumed the Web was just there, and that HTTP provided everything we needed for Web communication. HTML5 WebSocket is the evolution of the communication fabric TO, ACROSS and WITHIN the Web/Cloud, and now we need to open our minds and start looking at the possibilities of this new way to communicate over the Web! Think BIG, really BIG!
This session is targeted developers and architects that are looking for better ways of increasing user experience and communication over the Web to create, improve, or replace existing Web applications. The session is also targeted developers and architects that just want to stretch their minds and receive the necessary information on making an educated assessment of the business and technical opportunities, and challenges, made possible by this new HTML5 standard. Wickedly cool demos, code examples, and comparisons with existing technologies and architectures will be used to illustrate these possibilities and their use cases.
Mr678: Aus meiner Sicht waren hier die Marketingfuzzies am Werk – ersten 20 Minuten technisch super langweilig. Danach wurden allgemein die Vorzüge und Möglichkeiten von WebSockets besprochen.
Den Mehrwert das das umworbene Projekt hat war mir leider nicht ganz klar.

--

Abstract: Informal gathering with several JavaSE committers.
Mr678: interssante Diskussion rund um die Entwicklung von Java und welche Features aus Sicht der Diskussionsgruppe sinnvoll wären


DO 18. November 2010-11-18

Abstract: The Future Roadmap of Java EE
Mr678:  war nur zur Hälfte Anwesend (Der Kunde ist dazwischen gekommen ;-) )
Es wurden die Features der nächsten Java EE Versionen von den entsprechenden Key Playern vorgestellt.

Abstract: Project Coin is an ongoing effort to select and implement a set of small language enhancements for JDK 7. The language changes for JDK 7 include:
·         strings in switch
·         automatic resource management
·         diamond operator
·         multi-catch with final rethrow
This talk will discuss recommend uses of the new features and demonstrate IDE support. Additionally, selection considerations, implementation concerns, testing methodologies, and language feature interactions will also be discussed.
Mr678: Interessant, die Features im Detail und was eigentlich getan werden muss um sowas überhaupt in der JVM zu interieren.

--

Abstract: A business developer can play an important role in the success of BPM projects. Despite the proclaimed value, BPM projects tend to be very costly and take too long. As a business developer you have the very important task to guide the business people in the process of transposing business requirements to a technology implementation. What actually is needed is a platform that will simplify the collaboration between business and IT people. This is what WebSphere Lombardi edition has to offer: a complete BPM solution that is covering the whole lifecycle, from modelling to implementation and monitoring, with one single product. All the different roles inside an organization will find a way to make their work smarter using this platform.
Mr678: Wenn IBM so den Vertrieb macht wundert es mich nicht das da so richtig keiner Lust drauf hat… Ansonsten schaut das Ganz aber recht cool aus. BPM Modell können realtime simuliert werden.

--
Abstract: This Quickie will be a hands-on demo of loadUI, a novel and free Open Source Load Testing tool that supports distributed load testing via an innovative JavaFX-based user interface. With loadUI you create, configure and redistribute your load tests in real time (while your tests are actually running!), giving you the unique possibility to understand how your services behave under load and when load changes. loadUI supports testing of SOAP, REST, Web, AMF, JDBC and JMS interfaces and thanks to its OSGi and Groovy based infrastructure it can easily be expanded to accommodate for any other protocol or testing requirements you might have.
Mr678: coole GUI, ansonsten wirkt das ganze recht „verspielt“.
--

Abstract: I will discuss our experiences using Hadoop, HBase, Cassandra, and Pig to scale Twitter's analytics platform. This talk will focus on the practical aspects of working at scale – the architecture, what works, what doesn't, and the software we've open-sourced to make things easier for others.
Mr678: Was muss twitter tun um den Traffic zu schaffen und ihre Daten auch noch auszuwerten. Superinteressant; abgefahrener shit; haben wir direkt eigentlich aber nichts zu tun…

Abstract: Java Posse Live
Mr678: Unterhaltsames Frage und Antwortspiel…

--

Abstract: Learn about Activiti and how you can benefit from the BPM and workflow features in your next Java project.
One aspect of Business Process Management (BPM) is to facilitate the collaboration between business people and developers.
But also developers find it often just the simplest way to implement their requirements. When dealing with task lists, timers and asynchronous messages, it can be a challenge to bind all the hooks and eyes together. In these asynchronous architectures, Activiti is at its best.
With Activiti, developers can create an overview diagram that represents the overall transactional control flow. We'll show how easy it is to link this process to your Java domain logic classes.
Another interesting aspect of using Activiti is that you get the valuable history analysis reports and audit logs for free. For example, how many successful deals did we have for each region in less then 20 days. Or who gave permission for this purchase and what was the motivation. By default, the Activiti engine collects information for each process execution.
In this session we'll demonstrate these features as well as the different components of the Activiti project.
Mr678: sehr interessant, danach gleich mal ausprobiert und eingelesen…

Freitag 19.11.2010

Abstract: Lets discuss the future of Java, the language, platform, eco-system, community with input from Oracle, Google, SpringSource, a JCP member, a JUG leader and functional language expert. The discussion panel will be moderated by our JavaPosse friends: Dick Wall and Joe Nuxoll.
Mr678: kurzweilige Diskussion moderiert von den Jungs von der Java Posse


Abstract: The combination of the Convention over Configuration and Dependency Injection principles, drastically simplifies the Java EE 6 development model. This session covers the approach for building lean, but still maintainable and scalable applications with nothing but plain Java EE 6 technologies. A (rich) JPA 2.0 domain object can be annotated with JSR-303 (Bean Validation) for validation purposes, EJB 3.1 Stateless / Stateful Session Bean provide the transactionality, remoting (JAX-RS / REST), concurrency. JSR-299 (CDI) enables the direct exposure to to the JSF 2 view and extension points, as well as aspects.
The interesting point: such minimalistic architecture still remains extensible and testable.
The pragmatic combination of EJB 3.1, JPA 2.0, Bean Validation, Context and Dependency Injection and JAX-RS (REST) will be covered from the real world angle and is especially interesting to Java (EE) developers and architects:
·         Pragmatic modularization and deployment of WARs / EARs
·         Stateful vs stateless architectures
·         Domain driven design vs. service oriented components
·         Component configuration with EJB 3.1, interceptors and CDI
·         incremental migration from J2EE
Mr678: coole hacking session

Das wars. Fazit: perfekte Woche!

Freitag, 5. November 2010

Apache Commons Configuration und NumberFormatException - Bug in EnvironmentConfiguration in Kombination mit CombinedConfiguration...

Beim Einsatz der Apache Commons Configuration Library bin ich über einen Fehler gestoßen beim Einsatz von EnvironmentConfiguration gepaart mit CombinedConfiguration.

Der Fehler tritt auf, wenn im Key eine Klammer enthalten ist.
Bei 64bit Windows7 Systemen ist dies allerdings der Normalfall mit der Environmentvariable ProgramFiles(x86).

Der Bug ist bereits gefixt, allerdings erst in der nächsten, noch nicht veröffentlichten Version 1.7, von Apache Commons Configuration.

Um nicht extra die Library patchen zu müssen habe ich folgenden kleinen Workaround hierfür gebastelt:

  private AbstractConfiguration getEnvConfig() {
    // use of EnvironmentConfiguration is not possible! (Bug in apache commons)
    // see https://issues.apache.org/jira/browse/CONFIGURATION-404

    Pattern p = Pattern.compile("[\\(\\)]");

    Map<String, String> envMap = new HashMap<String, String>();
    for (Entry<String, String> entry : System.getenv().entrySet()) {
      String key = entry.getKey();
      if (!p.matcher(key).find())
        envMap.put(key, entry.getValue());
    }
    return new MapConfiguration(envMap);
  }

Mittwoch, 27. Oktober 2010

JSF 2 - Modell Aktualisierung nach fehlgeschlagener Validierung

Beim Experimentieren mit JSF 2 bin ich auf folgendes Problem gestoßen:
  • Wird eine Form submitted und die Validierung schlägt fehl werden entsprechende Fehlermeldungen angezeigt – ok.
  • Wenn man nun mit einem weiteren Button die bisherigen Usereingaben verwerfen will und die Form mit einen Backend Model aktualisieren will, stehen die letzten korrekten submitted-values in der Form und nicht die Werte des aktualisierten Backend Models.


Leider habe ich noch keine saubere Lösung wie man das Problem angeht…

Ich habe das Problem bei stackoverflow mal mit Beispielcode gepostet:


Eine mögliche Lösung habe ich auch dazu gepostet – ist aber nicht wirklich schön.

Ich würde mich für jeden Tipp rund um das Problem natürlich tierisch freuen!!!

Montag, 2. August 2010

FormatOnSave - Autoupdate funktioniert nicht... und braucht es auch gar nicht!

Eines meines Lieblings-Eclipse-Plugins war immer FormatOnSave! Das Plugin führt zwar im wesentlichen nur ein Strg+Shift+O (organize imports) und Strg+Shift+F (format code)  aus, ist aber unheimlich hilfreich.

Das automatische Update funktioniert schon längere Zeit nicht mehr. Ich habe das Plugin daher einfach immer per „download & unzip“ installiert ohne hier mal genauer darauf zu achten.

Nach eine kurzen Netzrecherche ist auch klar wieso das Update nicht mehr funktioniert – die Funktion ist schon seit längeren out-of-the-box in eclipse Verfügbar was das Plugin überflüssig werden lässt.

Einfach unter Windows\Prefrences den Menüpunkt Java->Editor->Save Actions auswählen und „Perform the selected actions on save“ mit „Format source code“ und „organize imports“ auswählen.

Man sollte einfach öfters mal die neuen Features seiner IDE checken; macht das Leben einfacher J



Montag, 19. Juli 2010

Steb By Tab - Fehler- und Abbruch-Tracking bei formularasierten Webprozessen

In der Ausgabe 7-8/2010 des Magazins Website Boosting ist hierzu ein recht interessanter Artikel. In dem Artikel wird gezeigt wie man in JEE Systemen Fehler auf Feldebene und Abbruchfehler (User verlässt die fehlerhafte Seite) in etracker protokollieren kann.

P.S. Ruhig mal auf den Autor achten ;-)

Freitag, 2. Juli 2010

POI - SVERWEIS und die Exception Unexpected eval type (org.apache.poi.hssf.record.formula.eval.MissingArgEval)


Seit ein paar Tagen gibt es etwas neues von der POI API – Seit 20. Juni 2010 die Version POI 3.7 beta 1.

Die ersten Experimente haben hiermit perfekt funktioniert! J

Nachdem ich allerdings einen SVERWEIS (englisch : VLOOKUP) verwendet habe und ein abhängiges Feld per POI API neu berechnen lassen habe, ist folgender Fehler aufgetreten:

java.lang.RuntimeException: Unexpected eval type (org.apache.poi.hssf.record.formula.eval.MissingArgEval)
       at org.apache.poi.hssf.record.formula.functions.LookupUtils.resolveRangeLookupArg(LookupUtils.java:422)
       at org.apache.poi.hssf.record.formula.functions.Vlookup.evaluate(Vlookup.java:57)
       at org.apache.poi.hssf.record.formula.functions.Var3or4ArgFunction.evaluate(Var3or4ArgFunction.java:36)
       at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:132)
       …

Der Fehler ist an folgender Stelle aufgetreten:
...
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
HSSFRow row = sheet.getRow(7);
HSSFCell cell = row.getCell(1);
CellValue cellValue = evaluator.evaluate(cell);
...

Die Ursache hierfür ist, dass ich im Excelsheet die Formel mit dem SVERWEIS per Autocomplete erstellt habe. Der letzte Parameter des Befehls SVERWEIS „Bereich_Verweis“ wird dann mit WAHR bzw. FALSCH per Autocomplete gefüllt. Wenn man sich dann die Formel allerdings nochmal genauer anschaut, stellt man fest, dass der letzte Parameter bei WAHR einfach nicht geschrieben wird. Excel arbeitet mit einem Defaultwert.

Die POI API kommt hiermit aber nicht zurecht! Hier muss der Parameter Bereich_Verweis explizit gesetzt werden. Für WAHR muss hier eine 1 gesetzt werden.

Anschließend funktioniert die Berechnung auch wieder einwandfrei J

Dienstag, 1. Juni 2010

PL/SQL Developer - Initialization error | Windws 7 - 64bit

Auf meinem neuen Windows 7 – 64bit System habe ich ein tolles Oracle 11g – 64bit installiert – Funzt perfekt!

Anschließend noch den PL/SQL Developer von  allroundautomations installiert und schon gingen die Probleme los…

Vorab: das Problem liegt daran, dass der PL/SQL Developer ein 32bit Programm ist und Probleme bei der Verwendung des 64bit Oracle Treibers (Client) hat.

Zuerst kam bei der Anmeldung folgender Fehler:

Initialization error
SQL*Net not properly installed

OracleHomeKey:
OracleHomeDir:

Nach etwas googlen bin ich auf Hinweis gekommen, bei denen man spezielle Registryeinträge ändern muss oder innerhalb vom PL/SQL Developer unter Tools/Preferences direkt Einstellungen vornehmen usw... Hat alles nichts geholfen L

Auf der Console habe ich dann mal manuell mein ORACLE_HOME Verzeichnis gesetzt. Das Ergebnis war nun folgende Fehlermeldung:

E:\PLSQL Developer>set ORACLE_HOME=E:\oracle\app\mre\product\11.2.0\dbhome_1
E:\PLSQL Developer>plsqldev.exe

Initialization error
Could not load „E:\oracle\app\mre\product\11.2.0\dbhome_1\bin\oci.dll“

OracleHomeyKey:
E:\oracle\app\mre\product\11.2.0\dbhome_1
Found: oci.dll
Using: E:\oracle\app\mre\product\11.2.0\dbhome_1\bin\oci.dll
LoadLibrary(E:\oracle\app\mre\product\11.2.0\dbhome_1\bin\oci.dll) returned 0

Geht also auch nicht L

Google hat bei eingeschränktere Suche irgendwie nur noch Seiten auf Chinesisch angezeigt (das Übersetzungstool von google funzt hier sehr cool!). Also bin ich so auf einer chinesischen Seite auf die 64bit / 32bit Oracle Client Problematik gestoßen. Anschließend habe ich dann gezeilt auf der Page von allroundautomations nach 64 bit gesucht und habe folgenden Treffer gefunden:


Ein passender Oracle Client muss also her!

Als erstes also einen Windows 32bit Oracle Client herunterladen – Ich habe mich hier für den Instant Client Version 11.2.0.1.0 entschieden.


Diesen kann man einfach entpacken und braucht keine extra Installation.

Anschließend müssen diese Parameter noch  im PL/SQL Developer bekannt gemacht werden.

Oracle/Preferences/Oracle/Connection
Oracle Home:  [leer lassen, dies wird durch das setzen der Environment Variable automatisch gezogen]
OCI library: E:\instantclient_11_2\oci.dll

Anschließend den PL/SQL Developer neu starten.

Jetzt kann der PL/SQL Developer wieder sauber seine Dienste mir zur Verfügung stellen J

Freitag, 7. Mai 2010

JSF 2, AJAX und ein confirm Dialog... (Synchrone Verarbeitung)

Folgendes Problem hat sich bei mir mit dem Setup JSF2.0 und jQuery 1.4 ergeben:
(das Ganze auf Glassfish v3 (daher auch mojarra als JSF Implementierung)
  
Wie erstellt man eine „coole“ Sicherheitsfrage in Verbindung mit einer JSF 2 AJAX Action?
Genauer: wie kann vor dem Aufruf einer JSF 2 commandButton-AJAX-Action einen jQuery UI Dialog blenden, in dem der Klassiker „Wollen Sie wirklcih“ abgefragt wird? 
Auf eine Seite stelle ich eine Tabelle mit ui:repeat dar. Jede Zeile kann dabei editiert werden und auch gelöscht werden. Der Löschvorgang wird durch ein Symbol (‚X‘) am Ende der Zeile dargestellt.

Diese sieht wie folgt aus: 
<td>
      <h:commandButton action="#{schlagView.removeWorking(working.tempIdent)}"
                 image="./img/delete-icon.png"
                 styleClass="listRemove">
            <f:ajax render="@form" execute="@form" />     
      </h:commandButton>
</td>

Funktioniert als AJAX Event perfekt! J 
Um die Usability aber etwas zu steigern, wäre natürlich noch ein Sicherheitshinweis schön.
Per JavaScript lässt sich dieser einfach wie folgt ermitteln: 
<td>
      <h:commandButton onclick="return confirm('Wirklich?')"
                       action="#{schlagView.removeWorking(working.tempIdent)}"
                       image="./img/delete-icon.png"
                       styleClass="listRemove">
            <f:ajax render="@form" execute="@form" />     
      </h:commandButton>
</td>
                                                 
JSF übersetzt beim Rendern die Seite dann entsprechend, so dass auf dem JavaScript onclick-Event folgendes liegt:

onclick="jsf.util.chain(this,event,'return confirm(\' Wirklich\' );','mojarra.ab(this,event,\'action\',\'@form\',\'@form\')');return false"

Hier wird einfach das Event bei ‚NEIN‘ gestoppt und es nichts passiert.

Funktioniert perfekt! J

Um die Usability aber noch etwas mehr zu steigern, wäre natürlich eine gut aussehende Sicherheitsabfrage toll. Eine Sicherheitsabfrage auf Basis eines jQuery UI Confirm Dialogs beispielsweise…

Das Problem hier liegt aber daran, dass in dem jQuery Dialog der Event der Buttons per CallBack Funktion realisiert wird. Dies bedeutet der eigentliche JSF AJAX Aufruf ist dann schon gelaufen. Was man hier benötigt wäre eine synchrone Abarbeitung der Dialog CallBack Funktion zum Aufruf in der JSF commandAction. Mit folgenden Zeilen Code kann man dies bewerkstelligen:

JSF Code: 
<h:commandButton onclick="return removeRow(this);"
                 action="#{schlagView.removeWorking(working.tempIdent)}"
                 image="./img/delete-icon.png"
                 styleClass="listRemove">
      <f:ajax render="@form" execute="@form" />     
</h:commandButton>

JavaScript Code: 
var confirmOk = false;
function removeRow(elem) {
      if (!confirmOk) {
            $('#dialog-confirm').dialog({
                  width:500,
                  modal: true,
                  buttons: {
                        'Freilich': function() {
                             confirmOk=true;
                             $(elem).click();
                             confirmOk=false;
                             $(this).dialog('close');
                        },
                        'Auf keinen Fall': function() {
                             $(this).dialog('close');
                        }
                  }
            });
      }    
      return confirmOk;
};



Hierbei wird vor dem JSF AJAX Call die JavaScript Methode removeRow aufgerufen. Beim ersten Aufruf ist confirmOk == false und somit wird der jQuery Dialog aufgerufen. Die Methode wird aber direkt weiter abgearbeitet und liefert erstmal false zurück, was ein weiteres Aufrufen des JSF AJAX Calls verhindert.
Wird im jQuery Dialog auf ‚Freilich‘ (OK) geklickt, wird die Variable confirmOk auf true gesetzt und das Click-Event des commandButton erneut getriggert ( $(elem).click() ) . Wenn die Methode diesmal durchlaufen wird, liefert sie aber ein true zurück und der JSF AJAX Call wird ausgeführt.

Funktioniert J

Donnerstag, 15. April 2010

Blogger/ Blogspot Suchergebnisse in google - Anzeige des Titels

Nachdem ich gerade etwas experimentiert habe, wie mein Blog und dessen Einträge bei google gefunden werden, ist mir aufgefallen, dass hier immer mein Blogname „mr678“ bei dem Suchergebnissen angezeigt wird.

Ist in dieser Form nicht gerade schön und für’s SEO auch nicht ideal… (zumindest was ich gerade hierzu recherchiert habe; aktuell bin ich mit der Positionierung meines Blogeintrages aber ziemlich zufrieden ;-) – Dies hat aber natürlich andere Gründe: google blogspot mit google adsense + neu veröffentlicht…)



Google zeigt hier einfach den HTML Title an. Dieser kann daher einfach nach Belieben angepasst werden. Bei blogspot funktioniert dies wie folgt:

Layout à HTML bearbeiten

Jetzt die Zeile

<title><data:blog.title/></title>

mit folgendem Snippet ersetzen:

<b:if cond='data:blog.pageType == "item"'>
  <title><data:blog.pageName/> | <data:blog.title/></title>
<b:else/>
  <title><data:blog.pageTitle/></title>
</b:if>

Nun wird erst der Artikelname des Blogs angezeigt.

Auf folgenden Websites habe ich mir dieses Vorgehen abgeschaut:



JSF2, AJAX & JavaScript Events

Wenn man sich in den „AJAX Lifecycle“ eines JSF2 Calls hängen will, muss hierzu das Attribute onEvent gesetzt werden.

<h:commandButton styleClass="button large" action="#{schlagView.addWorking}" value="${msg.buttonAddWorkStep}">
<f:ajax render="@form" execute="@form" onevent="newRowEvent"/>
</h:commandButton>

Die JSF2 Spec (Javadoc) schreibt hierzu folgendes.

„The name of the JavaScript function that will handle UI events.“

Alles klar: In dem oben aufgeführten Beispiel wird dann die JavaScript Funktion newRowEvent aufgerufen.

Bei mir sieht die JS Funktion folgendermaßen aus:

function newRowEvent(data) {
       if (data.status != 'success') return;
      
       //new line
       //...
}

Die Methode wird insgesamt 3x aufgerufen – für jeden Ajax-Call-Zustand einmal.
Interessant ist hierbei der Parameter data. Das Property status von data gibt Aufschluss über den aktuellen Zustand des Ajax Calls:

·         begin
·         complete
·         sucess

Weitere Property Werte von data sind beispielsweise responseCode, responseText, responseXML oder source. Die möglichen Properties variieren in Abhängigkeit des Statuswertes.

--
Das beschriebene Verhalten spiegelt tritt bei mir exakt so auf beim Einsatz von Mojarra als JSF Implementierung in der out-of-the-box Variante bei Glassfish v3