Wednesday, November 18, 2009

Supra Muska Skytop Edmonton

FinalCountdown iPhone-App

final countdown is the new iPhone app for watching the countdown to a chosen date / time in all time zones.

Eg with final countdown you can follow the New Year's Eve all over the world in different time zone. Or you can lookup where in the world can be your birthday celebrated first.

So Very useful if you want to launch something worldwide at a special date so you can watch when the next timezone is ready for your launch.

Tuesday, November 3, 2009

2nd Birthday Party Rhymes

JSXP (Just Simple eXtensible Pages)


JSXP: Web-Applikationen entwickeln – wie es sein sollte
JSXP steht für Just Simple eXtensible Pages[1] und ist ein frisch veröffentlichtes Open Source Framework für Web-Applikationen in Java. Unter [2] findet  man einen Screencast, der zeigt, wie man eine Newsletter-Web-Applikationen mit JSXP implementiert.
Warum ein neues Web-Framework? Als David Tanzer und ich im Februar dieses Jahres bei den JSFDays[3] were in Vienna we have with developers of the JSF technology, discussed the fact that JSF is too complicated. Still, because the situation is improving, even with JSF2 not.
came Unfortunately this view, which I (have) in our industry from the designers who work with JSF and other technologies, from the creators of the existing technologies not heard. On the way back David and I discussed diligently. We agreed that Apache Wicket has some good points, but replaced it in our opinion, still not the problems with the web front-end development.
We wanted to go to a compile-time safety and a stricter separation of design and code, as we have seen so far in Java sector. The discussion ended with the fact that it would be great a proof of concept to have. The following night I was writing the first version of JSXP frameworks, from today in this form is probably no line of code left. But the road was paved. After the feedback on the first live demo of JSXP at the Fall Campus [4] and other very positive reviews of all those we presented JSXP, the framework is no longer just a proof-of-concept. It is to realize a serious possibility in Java Web Sites.
If the input erwähnte Frage: Warum ein neues Web-Framework? Diese Frage musste ich mir in einer frühen Phase von JSXP von einem Entwickler der JSF-Technologie stellen lassen, als ich ihm unser Konzept vorstellte
. Er fügte hinzu, dass es unsinnig und verlorene Zeit sei etwas zu entwickeln, was es schon gibt. Meine Antwort darauf ist folgende: es ist bezeichnend, wenn Menschen etwas neu entwickeln müssen, obwohl es bereits einen Ansatz gibt.
Was kann und bietet JSXP?
JSXP hat als realisierte Ziele von Anfang an Einfachheit und Sicherheit in der Anwendung. Zwar It is extremely flexible and offers all the features you know from technologies like JSF, but in shaping the framework JSXP the API has always been optimized for usability.
central components of a Web application are JSXP Design Views, view-controller, application class, and Context . Design Views is the name of the design (eg XHTML) files, view-controller are Java classes that implement the code behind the design. Each JSXP Web project has an application class, the basic settings and algorithms for the application specifies. The context is a project anywhere in JSXP available object in which we include Details of the current request, various settings, users find information.
JSXP Web applications are Design-Driven . Designers deliver the design. By default, in the form of XHTML files, but thanks to the realized Factory pattern, it is possible to use any other type of input (eg from the DB) and shape of the design (eg XAML, Silverlight, or any format) if the interfaces be implemented accordingly. In the following we restrict ourselves to the examples on the design directly from the standard supported by XHTML.
The finished design is at JSXP Web applications disfigured than code the XHTML files remain in the browser include the preview available. JSXP in compliance with the strict separation of design and code. This makes it possible to integrate design into the software development process successfully. A designer can customize the design iteratively , there are no inconsistencies. The designer can get direct access to the versioning and check in there and change design.
A callable by Shell Generator
generated for the design Views (in a standard XHTML file) a View-Controller . The generated class itself is never edited. One can derive from it and adjust the subclass. This prevents problems in the iterative process of re-generation. The generated classes contain special get and set methods for accessing the design and allow the templating and replace / add text and elements. Thanks to the generated methods / properties, already at compile time to determine whether a design has changed so that the self-implemented code needs to be improved. On this Compile-time Safety feature you do not do without when you get to a typo in the design directly refer to the error, and this not only for the duration „um die Ohren gehauen“ bekommt. Auch wenn im Code benötigte Elemente umbenannt oder gelöscht werden, bekommt man sofortiges Feedback.
Das Paar von Design-View und View-Controller bildet in JSXP eine View-Komponente . Im Normalfall gehört genau eine View-Controller-Klasse zu einem Design-View. Diese Komponenten können wiederverwendet werden und man kann aus den Komponenten andere Views zusammen bauen. Innerhalb eines View-Controllers kann man andere Komponenten importieren und nutzen. JSXP ist damit Komponenten-basiert . Das Definieren und der Zugriff auf Komponenten geschieht dabei im Java-Code, nicht im Design.
replaced at runtime to the framework JSXP a URL to find needed View-Controller (or resource files directly deliver). The application class is used to check whether any further lines are necessary or security restrictions exist (login required, etc.). When accessing a JSXP view the associated view controller is initialized. This is then subject to a certain life cycle phases in the view controller itself by overriding methods, or from any location via registration of phase-listeners can respond. Preparing, initialization, set input parameters, validation of input parameters: An example sequence of phases is Ausführung, Templating, Resourcen-Handling, Variablenersetzung, Rendering,
Wie funktioniert der Zugriff auf Design-Elemente bei Beachtung von Separierung von Code und Design ? Gerade bei diesem Feature von JSXP wird man seine Vorteile in Bezug auf Apache Wicket spüren, denn JSXP verfolgt das Prinzip der Separierung weit strikter. In den XHTML-Dateien muss man Elementen lediglich eine JSXP-ID geben und entsprechende Methoden/Eigenschaften werden generiert. JSXP-IDs sind im XHTML Tag-Attribute aus einem bestimmten Namensraum. JSXP kennt dabei keine HTML-Tags, es kennt lediglich View-Elemente . Es weiss nicht, ob es sich z.B. dahinter um eine List is structured or DIV blocks. It must also know the nesting of elements, since the IDs are unique. This means that you can change the following design-neck, will not react the wrong JSXP:
example by JSXP ID referenceable design elements in the design view
\u0026lt;html xmlns=" http://www.w3.org/1999/xhtml "xmlns:jsxp=" http://www.jsxp.org/spec/1.0 ">
\u0026lt;head>
<title>Hello World</title>
</head>
<body>
<div jsxp:id="Name">Name
<p jsxp:id="Address">Adresse</p>
</div>
</body>
</html>
are here generated on the View-Controller "getElementName" and "getElementAddress" as methods that return each generated elements of "Name" and "Address" type safe (note that special elements for these IDs are generated as interfaces, but that there are DIV elements JSXP need not to know). And can the element "Name" is a method "getElementAddress" generated
Per code is as follows access to the elements.
Name name element = getElementName ();
Address address element = getElementAddress ();
element common address element = getElementName () getElementAddress ();.
Name and Address are implementations of the general interface "element." In the example, "address element" and "same address element" identical. Depending on whether you use Line 2 or Line 3 from the example, the following design change is compatible or generates a compile-time error:
Example: Change der Verschachtelung im Design
<div jsxp:id="Address">Adresse
<p jsxp:id="Name">Name</p>
</div>
Nur in Fällen, wo eine Verschachtelung im Design wichtig für den Code ist, benutzt man in JSXP also den verschachtelten Zugriff.
Mit den JSXP-IDs kann man Elemente aus dem Design-View referenzieren. Man kann auch Variablen im Design nutzen, um komfortabel Share content. This one uses the $ (variable name) notation in anywhere design. Variables are always generated at the next level by JSXP id specified element.
Example: Variable
\u0026lt;div jsxp:id="Name"> $ (FirstName) $ (last name)
\u0026lt;p jsxp: id = "address"> $ (street) \u0026lt;/ p>
\u0026lt;/ div>
In the variable sample, there are generated methods for reading and setting the "first name" and "last name" variable to the element "Name" and for the variable "street" on the item "Address".
example. Methods that match the variables
getElementAddress () setVariableStreet (String value);
getElementName () setVariableFirstName (String value); .
getElementName () setVariableLastName (String value);.
In this way, you can use with JSXP variables, yet is compile-time safe. When specifying the variable name in the $ notation JSXP supports wisely no Expression Language. A Query Language would be contrary to the JSXP guidelines for type safety and consistency of design and code. If you want to make sure, however, that a variable belongs to a particular item or to view-controller directly, you can write it down by a point.
Example: Other variables notation
\u0026lt;div jsxp:id"customer">
\u0026lt;div jsxp: id = "order">
\u0026lt;div jsxp:id="billingAddress"> $ (customer.name) $ (street) \u0026lt;/ div>
\u0026lt; jsxp div id = "deliveryAddress"> $ (customer.name) $ (street) \u0026lt;/ div>
\u0026lt;/ div>
\u0026lt;/ div>
In this example there is one variable "street" on the elements of "billing address" and "deliveryAddress" and a variable "name" the element "customer". If one uses only "$ (. Name)" is the variable generated directly in the view controller and is valid for the entire view.
JSXP allows the designer fully functional designs deliver. The XHTML files can be navigated and have already filled up with data lists for demonstration purposes. The developer needs these lists are not empty in the design files. He does so where one would expect from a Java Developer: in the Java code. As a result, the application immediately after the insertion of the Design Views funktioniert und Prototyping möglich macht. Dies sieht man auch in dem Video-Screencast [2]. Man integriert die Design-Dateien in sein Projekt und kann die Webanwendung direkt nutzen und iterativ den Code und somit die dynamische Funktionalität implementieren. Dies bedeutet, dass die Design-Dateien stets auch losgelöst vom Webserver im Browser angeschaut und Designer und Entwickler in einem iterativen Prozess an den gleichen Dateien arbeiten können.
Beispiel: vereinfachte Tabelle vom Designer (Ausschnitt aus XHTML-Datei)
<table>
\u0026lt;tr>
\u0026lt;td> 12345 \u0026lt;/ td> \u0026lt;td> 07.02.2009 \u0026lt;/ td>
\u0026lt;/ tr>
\u0026lt;tr> ;
\u0026lt;td> 45678 \u0026lt;/ td> \u0026lt;td> 11.10.2009 \u0026lt;/ td>
\u0026lt;/ tr>
\u0026lt;/ table>
Suppose the above table has been supplied by the designer. This table can adjust in the next step for the developer JSXP without changing the design or remove the sample data.
Example: Table after adjustment by developers
\u0026lt;html xmlns = "http://www.w3.org/1999/xhtml " xmlns: jsxp = " http://www.jsxp.org/spec/1.0 >
\u0026lt;head>
<title>Hello World</title>
</head>
<body>
<table jsxp:id="orderList">
<tr>
<td>12345</td><td>07.02.2009</td>
</tr>
<tr>
<td>45678</td><td>11.10.2009</td>
</tr>
<tr jsxp:id="orderItem">
<td>$(orderNo)</td><td>$(orderDate)</td>
</tr>
\u0026lt;/ table>
\u0026lt;/ body>
\u0026lt;/ html>
Per code, the developer now clears the list from the design and use the added line element for templating . In JSXP can use elements from the design as a template and add as repeatedly as a structure.
example: code of the view controller to the table as
public class extends TableXhtmlController TableXhtmlControllerGenerated \u0026lt;Object> {
@Override
public void execute() throws Exception {
getElementOrderList().removeElements();
ElementTemplate<OrderItem> itemTemplate = 
getElementOrderItem().createTemplate();
List<Order> orderList = ...; /* Business-Logik */
for (Order order : orderList) {
OrderItem orderItem = itemTemplate.createElement(order);
getElementOrderList().addElement(orderItem);
}
}
}
Die „execute“-Methode aus dem Beispiel wird vom JSXP-Framework im Zuge des Lebenszyklus eines Request aufgerufen, wenn die „Table“-Komponente Teil des Views ist, der zu einem Request gerendert wird. Here, then, until the list is emptied from the design, making void the sample contents. After that is generated from the "orderItem" element is a template that is used to prepare orders for the view objects. The "createElement" method generates the specific element within the loop for the reply to be lifted browser request. If you had specified the "createElement" method, an object, automatically with the existing properties on the object attempts to set the variables of the element. Alternatively, you could have set the variables manually:
orderItem.setVariableOrderNo (value);
orderItem.setVariableOrderDate (value);
important at this point is that the code does not notice that it is in the design is a table. Changes to the design and the table as a DIV structure or simple text lines replaced, does not change the code. Code and design are independent. Does a JSXP ID away from treatment by the designer, there is a compilation error. So you will already warned in the IDE.
If you want the table to build a pager that allows the list to the profile, is it possible to import a pager component and to use. In the previous example, we can do this by overriding the init method of the View-Controller:
@ Override
public void init (Importer importer) throws Exception {
PagerXhtmlController PagerXhtmlController pager = new ();
pager.setPageSize (20);
importer.importView (pager);
getElementOrderList (), addElement (pager.getElementSimplePager. ());}
can in this way, any desired finished or proprietary View components and integrated directly import or use by templating mechanisms. And unlike here, the interfaces of JSF components in the language of the developers are on file: Java. The designer is not burdened with additional constructs unknown to him.
In JSXP are URLs directly bookmark capable ( Bookmarkable ) and human-readable ( Human-readable URLs ). This is also supported by both Redirects . Support for this is right for other web frameworks poor or very difficult to implement. Even in relation to internationalization or handling any complicated Resource URIs are necessary (as in JSF2). I
internationalization is supported by default. It can be specified by the application class, which supported locales the application, and by default JSXP determined which of the best locales to the user fits. Then the one corresponding locale directories for design and code are used, and the locale set on the context, so that you can use it for resource handling.
With Resource Action can bind to elements from the view of resources and fill the elements of this exchange varies as well. This is the case for text within a view is useful, is to come from Java resource bundles, or for images or scripts that originate from different sources, for which the designer to design a static path file. For resource handling is defined by overriding the method "getResources" belonging provided with a JSXP ID elements of the design to a resource. You can define resource handler at the application (in the standard have already provided some of) the element varies according to resource type for the response to client . Render be replaced in the following example we see an element in the design, the contents of the resource by automatically handling JSXP framework through the contents of a Java properties file.
Example: Sample Design Resource Handling
\u0026lt;html xmlns = "http://www.w3.org/1999/xhtml " xmlns: jsxp = " http://www.jsxp.org/spec/1.0 >
\u0026lt;body>
\u0026lt;p jsxp:id="resourcebundle">
Hello <br/> $(name)
</p>
</body>
</html>
Beispiel: Resourcenhandling View-Controller
public class ResourceBundleXhtmlController extends ResourceBundleXhtmlControllerGenerated<Object> {
@Override
public void execute () {
getElementResourcebundle (). SetVariableName ("Snoopy");
}
@ Override
\u0026lt;Resource> getResources public List () {
List \u0026lt;Resource> super.getResources resources = ();
resources.add (new Resource (
" ResourceBundlePropertiesFileURL "
"text / ResourceBundle" getElementResourcebundle ()));
return resources;
}}
example : Resource handling properties file
ResourceBundle [] = Hello . Download With resource handling elements are replaced by arbitrary resources. As represented, decides on a specific resource type (eg "text / ResourceBundle") registered resource handler. Resources are especially important for component-based development. Is a view controller to for example, that it requires a certain JavaScript file as a resource, this resource for the client rendered and sent to him, even if only parts of the view can be used to import the component.
JSXP allows a convenient way to secure
states on the server. This supports JSXP various scopes,
as application scope, session scope, View-Scope, Flash-scope, view flow-scope and request scope . All of these scopes and their contents are automatically managed and are available through the Context object as easy-to-use maps, or can be used by specifying annotations on properties of the View Controller. JSXP automatically checked at the used view-controller, whether to create the session is necessary and takes care of everything necessary.
With JSXP View flows can be defined amounts of View components, have an excellent start and end points. JSXP allowed then automatically invoking these views per request from the Client only if it has been called the first of the start view. The View Flow stops automatically when an end-view is achieved. Moves the user from a View to flow beyond the start is aborted the Flow View. While flows of view of a view-scope flow is valid. view flows one can understand how form wizard, can be processed with operations across multiple requests.
JSXP supports AJAX
. This is a very lightweight AJAX JavaScript API is integrated. But any other AJAX library can be used with JSXP.
JSXP speed with no problem. A caching mechanism
ensures that prototypes of the design views might be on call. They are loaded automatically when the respective design changes.
Also the automatic setting of input parameters (for example, in HTTP-GET/POST come from the browser) JSXP takes for the developer. This requires a developer to only a bean with properties expected for input parameters are available. Input parameters can also be passed on imported components.
to validate input parameters JSXP sees a phase in the life cycle. For the validation we will override the view controller, the "validate" method. Within the method can use any framework to validate data on the input parameter bean and pass on errors to other similar views and see the errors / reported. Requires no special framework can be checked with the validator JSXP the data elements JSXP mark on the results page and messages.
JSXP is generally designed on the principle: Fully
but easily adaptable . Each time, the behavior of the framework for the specific project needs be adjusted. JSXP offers this particular application of the Context class and the ability to overwrite methods, thus making the behavior of JSXP flexible. For example, one can be marked the way in which elements with errors to the user to input validation errors noted, or how to use the locale change is detected. But also far-reaching changes such as parsing or theme files are easy. Many of the standard algorithms used can thus adjust or replace.
JSXP offers a range of other features, such as
Project Stages , view templates (a Template-Mechanismus auf View-Ebene wie man ihn u.a. von Apache Struts kennt), View-Aliases
,
Command-Pattern und einiges mehr. Des weiteren ist noch in für dieses Jahr geplant, JSXP vollständig portletfähig zu machen.
Momentan wird JSXP von der MATHEMA Software GmbH [5] und der Ciqua [6] unterstützt. Damit gibt es eine breite Basis an erfahrenen Entwicklern, Trainern und Beratern für JSXP. Gern dürfen sich natürlich weitere Freiwillige zu uns gesellen. Das JSXP-Framework steht unter der Apache License Version 2. Es gibt auch erste Referenzprojekte: sowohl der jsxp.org Webauftritt ist über das CMS-System CMSonal mit JSXP implementiert, and the JSXP Wiki, and the Internet platform solacize.com [7].
An implementation of your web applications with JSXP nothing stands in your way. Why?
This design can again take place with the application being made for it, and not too heavy in any handle plugins. can be adapted
This design even after several months of project duration slightly iterative, a developer without wasting precious time.
This allows developers to fulfill its core mission: business and process logic into Java code to implement.
  • Thus wasting developers do not despair for a long time for trivialities that stop the progress of projects.
  • And certainly also to create more robust applications that do not run unpredictably at run time extremely hard to find fault, because the development has only one mistake.
[1] JSXP site http://www.jsxp.org
[2] JSXP screencast
http://mathema .com / company / ACTIVITIES / web-framework-jsxp /
[3] JSFDays site http://jsfdays.irian.at
http://www.mathema.de
[6] Ciqua Pirringer & Tanzer OEG,
http://www.ciqua.com
[7] solacize.com, http://www.solacize.com