Thursday, June 25, 2009

Tiffany Granath Panties

use of Gmail, Calendar, Docs and Apps at universities in Germany and worldwide

The Google Web Toolkit GWT

offers native already has a relatively easy way usable

be made to simplify the implementation of the JSON data in GWT using static files available. In my Google about the plugin have created the Eclipse project

/ was
    folder that contains GWT version 1.6 are a complete Web application. For the static JSON files there just created a subdirectory, let's call him
  • model / .
  • example file:
was / / model / abschluss.json

[

{id: 123, name: degree 1, (c) H. Brune symbol: Abs1 }, { id: 456, name: degree 2,

symbol: Abs2

},

]

This file may Jetty Server that is started in Ecplise, are available on http://localhost:8080/modell/abschluss.json

(or under the configured port).

 






JSON with GWT








This works only a very brief sketch like this, the detailed description can be found in this
GWT 1.6 Page
:

Creating









JSON source (we have)







stub class , Which implements create JSNI methods to directly access the contents of the JSON structure. Instances of the stub class generated by a JSNI method that essentially

eval ()
calls (note the safety instructions!)








    implementation of an asynchronous
    request builder
    call, the JSON data collected and processed .







  1. generating a representation, z. As a Grid .









  2. Important: Do not
    The URL to the JSON file
    GWT.getModuleBaseURL ()
    be preceded by as shown in the GWT tutorial. It extends an indication of this type:





  3. private static final String JSON_URL
  4. = "/ model / abschluss.json";








experience









 The implementation of the stub class can mean annoying repetition of work, if appropriate on the server side already are (bean) classes. Here, however, can not achieve Reuse 







Once you have the stub classes, the rest of the implementation relatively easy, apart from the usual 'hardship' of the representation with the relatively primitive GWT widgets










    Source







  • package com.chb.gxt2m3.client;
  • com.google.gwt.core.client.EntryPoint import;
    com.google import. gwt.core.client.JsArray;
    import com.google.gwt.event.dom.client.ClickEvent;
  • import com.google.gwt.event.dom.client.ClickHandler;
    import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
com.google import. gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.user.client.ui. Button;
com.google.gwt.user.client.ui.Grid import, import
com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
public class GXTTest implements EntryPoint {public void

onModuleLoad () {

btLaden Button = new Button ("Load");
RootPanel.get ("buttons") add (btLaden).

btLaden.addClickHandler (new click handler () {public void onClick
 (click event) {
refreshAbschluesse ();}


});
} private static final String

JSON_URL_ABS = "/ model / abschluesse.json";

private void refreshAbschluesse () {

RootPanel.get ("display") clear ();.
RootPanel.get (" display "). add (
new Label (" financial statements are loaded of "+ JSON_URL_ABS));

request builder builder builder = new request (RequestBuilder.GET,
JSON_URL_ABS);

try {
builder.sendRequest (null, new request callback () {public void onError

(Request request, Throwable exception) {
display error ("JSON call could not be executed");}


public void onResponseReceived (Request request, Response response
) {

if (200 == response.getStatusCode ()) {

ClearError ();
abschluesseZeigen (asArrayOfAbsData (response.getText ()));} else {


display error ("Failed to call JSON (
response.getStatusText + () + ")");}


}
});} catch
(request Exception e) {
display error ("access to JSON failed");}



} private void abschluesseZeigen (JsArray
abs) {

RootPanel.get ("display") . clear ();

if (abs == null
Name "));

for (int idx = 0; idx \u0026lt;abs.length (), idx + +) {a = data
statements abs.get (idx);
agrid.setWidget (idx + 1, 0, new Label ("" +
a.getId ()));
agrid.setWidget (idx + 1, 1, new Label (a.getKuerzel ()));
agrid.setWidget (idx + 1, 2, new Label ("" + a.getName
()));}}



} private void clear error () {
RootPanel.get ("errorMsg") clear ();.
}

private void display error (String error) {
clear error ();
if (error = null)
RootPanel.get ("errorMsg") add (new Label (error));.
}
private final native JsArray
asArrayOfAbsData (String json) / *- {return
eval (json);}
}-*/;






JSON with GXT







A strength GXT (whose version 2 is available today as Milestone 3) are certainly the great widgets and Databinding ways through which changes the underlying data model to sign in all parts of the application can be. Unfortunately in the demo page only
Grid example with an XML source
. Anything but a search shows that there is a
JsonReader
. One can transfer the sample also.









One problem is the structure of the JSON file. Apparently, nested styles are not possible, at least you can understand this thread in the ExtJS Forum
be so.








There are, however, a different example:
http://extjs.net/forum/showthread.php?t=71978



Wednesday, June 24, 2009

Shannon Whirry Appreciation

use of JSON in GWT and GXT


Blogging on topics of programming you quickly to many source
to want to show appetizers, so what is said can be illustrated directly. A Copy-and-paste of the favorite development environment works because, unfortunately, not often, in fact there is only a confused heap of words that must be processed manually tedious and again.

But there are solutions to (almost) reached the simplicity of a copy-and-paste:

Google Code Prettifier

The Google Code Prettifier be blog content with source code, provided they are enclosed in a given day, by pimped by Google delivered Javascript. A Description in German can be found in Google Watch Blog , where the set of supported languages is defined as:


currently supported languages bash, C, C + +,
Java
, JavaScript, Perl, Python, XML, HTML , HTMLXmp, white space and Misc1 - almost all important.


Even CSS has become one of the features seem to result. So you have everything in order such as a
GWT
show programming beautiful. How does it work

In preparation to Load the CSS and JS files from the Prettify website. These files must be on your own Web server to make available. It is for this the different languages of their own JS files, you can probably those from whom they accept never need to leave out. After that binds one CSS file, and the main javascript file in his blog and complements the body

day



\u0026lt;body onload="prettyPrint()">

The preparations are complete. In order to format source code of the corresponding block of code is simply surrounded by a

\u0026lt;pre class="prettyprint"> ...\u0026lt;/ pre> (c) H. Brune

. It is possible specify the language if you do not, so 'advises' the Prettifier. Example:

\u0026lt;pre class="prettyprint lang-java"> ...\u0026lt;/ pre>

Links:

Homepage Google Code Prettify
: By downloading the necessary files and documentation

Open

Tutorial: Here is additional information in German for the integration of HTML / XML
example

And it looks like:

/ **
* Small helper method to test for empty strings. * * @ Param

to_test to be tested * @ return string

* If the string

null or empty or only with * space is filled is

true, otherwise false.

* * / public static boolean isEmptyString (String to_test) {return to_test == null to do.

The name

The first hurdle was the name: we understand something like 'full tilt', 'Carrachero' or 'Karachiro'. With a little googling, we found initially to 'Carachillio', which does bring some search results

, including even a menu. However, no recipe or no useful description. a "real" and at least in the German web frequently-used name is

Carachillo
. Under these keyword search to find it already some useful results
.

Having now the 'ch' in English through the usual 'J', we were finally replaced at the goal and recognized. So we have a

C arajillo drunk

! Under this name we can find an entry in the Wikipedia
 
. We are interested, of course, not the simple version in which are simply coffee and alcohol to bulk. We want the full program with fire and caramel flavor.

recipes on the Internet

When Google for Carachillo found, for example, the following recipes:
http://www.cocktaildreams.de/cooldrinks/cocktailrezept.carachillo.2446.html



the Veterano in the cup (a large coffee cup) and heat it with steam. Then light to get the right taste.
Now two coffee beans and lemon rind in the cup and to pour the hot espresso.
http://toprezepte.ch/index.php/rezepte-von-az/trinkbares/54-carachillo

Theke im Canta © H. Brune

4-6 cl Brandy purely preferably delivered in a small, sturdy glass

2 sugar cubes add

Brandy heated with steam and then set fire Stir with a spoon until no sugar grain is visible. An espresso in a thin stream to Brandy give (it must be to hear a crackling sound)

is crucial pour Where appropriate flame

the burning of sugar to a caramel flavor is created that makes the espresso first to Carajillo. Even the Wikipedia article emphasizes this. Not quite agreement among the different recipes in whether coffee beans and lemon zest into it belong, and if so, whether they are already heated with brandy together or come until later.

Must it be High-proof?

burn Normally spirits until an alcohol content of about 50%. Must say for the Carajillo a suitably potent brandy are used? No, because by the heating The alcohol is readily released and a brandy Veterano as sufficient by 36%. And so we then made our first Carajillos Two teaspoons of sugar in one of our cappuccino cups. Ca. 3 cl, a little more than a shot glass

, Veterano it. The 4-6cl appeared from one of the previous recipes us something very hard. With the heat

Wasserdampfdüse the espresso machine, the sugar-brandy mixture well. Beware, it injected. But the hotter the better it makes the whole thing is burning brandy. After heating, the pivot cup of something, usually the sugar dissolves then already.

Now it so far: A match to keep the cup edge and should immediately blazing blue flames. We had a fear it may burn too much alcohol obtained, but even at the trial with the longest burn time was the result is still very high percentage. So: Brandy really hot and can burn properly so that it can also arise caramel.

During firing still stir with a long spoon bit, maybe it will help that the sugar is dissolved and heated properly. On lemon and coffee beans we have been dispensed with.

Before the flames go out the cup under the espresso machine and pour in the picture by running into the espresso. We added a double espresso, what was just right for our taste. If you do it right (with us until the 4th attempt) can be heard crackling in a really strong moment in which flows the first coffee in the hot brandy.

us for the special way of Carajillos is next to his taste and the current in the sheep's cold very helpful Durchwärmeffekt especially the aesthetics of its production: the blue flames that billow around the espresso machine to give the matter a unique charm.

Oh yes, be VERY careful when drinking, as the cup edges are

enormously hot. And unlike, for example, in a Sambuca, guests at the table do not see that the drink was once burned and therefore are unprepared.

similar drinks

The Carajillo seems to be not unlike the Café Royal

. A recipe can be found for example here:

http://www.lebensmittellexikon.de/c0001200.php


Or at Maggi:


http://www.maggi.de/Rezepte/kochstudio/ ? recipe / prescription search / default.htm id = 12 142 & action = detail

And again:

http://www.ecocktail.de/de/ecocktail-cgi/datenbank/cocktail_rezept.cgi?cocktail_id=2790 & ; cocktail_name Cafe =% 201% 20Royal

Tuesday, June 23, 2009

Hawaiian Phrases And Translation

Java, HTML and JavaScript source code constitute good on the blog?

In building

want my pages with the GWT, I use the usual HTML tags

H1-H6 . How does it work? Carajillo © H. Brune The direct use of a label

not work. A statement such as:

add (new Label ("\u0026lt;h1> title \u0026lt;/ h1 >"));

generated in hosted mode the display

\u0026lt;h1> Title \u0026lt; , / h1>

, the tags are so quoted. It is also in the Label

Java Doc

. There is also found the reference on the HTML widget

. This can solve the task. The statement:

add (new HTML ("\u0026lt;h1> title \u0026lt;/ h1 >"));

produces the desired look. must consider only that you lose the security benefits that it provides automatic HTML quoting of Labels .

Saturday, June 6, 2009

Are Deep Set Eyes Beautiful

How to do a proper Carajillo?

GoogleDesktopPhotosPluginWallpaper use in my GWT 1.6 application, both the client-server-side code as well as the same business model classes. These classes are, however, in another Eclipse project and are therefore not simply in my with the Google plugin Eclipse GWT project creator available. To ensure that everything runs smoothly following configurations are required:

Eclipse configuration Simple: 'As always' expand in the Project Properties Java Build Path

the project, in which the business model is developed (ie, extend the CLASSPATH). Then you can be in the client-and server-side programming GWT ever use the appropriate classes in Eclipse.

generation of client-side code

The most in my view, best GWT, namely the translation of JavaScript code from Java code, provides a small complication: The GWT compiler needs for all classes referenced in the client program source code. Without any JS code conversion, and therefore no client application. One finds in the error output of
Hosted Modes

entries like the following, not as long as the business model classes are available:

[ERROR] Line 21: No source code is available for type xyzmodell.KlasseXY, did you forget to inherit a required module?

Similar messages you get when you recompile the project in Eclipse:

Compiling module xyzGWTProj Refresher module from source       Validating newly compiled units          Removing units with errors             [ERROR] Errors in 'file:/…/GWTProj/src/x/y/z/client/Modell.java'                [ERROR] Line 5: The import can not be resolved xyz.modell.KlasseXY ... ..

[ERROR] Line 40: Missing code implementation in the compiler

The reference in the error message on a missing

inherit
take a module in the description of the XML files

. Actually I was hoping that it would at least in the case of classes that are not widgets not be necessary my entire business model with special

The business model is packaged in P1090268b org.xy.smod . In this package, I create the new module XML file SMod.gwt.xml

, has the following contents:

\u0026lt;? Xml version = "1.0" encoding = "UTF-8"?> ! \u0026lt;DOCTYPE module PUBLIC "- / / Google Inc. / / DTD Google Web Toolkit 1.6.4 / / EN" "

http://google-web-toolkit.googlecode.com/svn/tags/ 1.6.4/distro-source/core/src/gwt-module.dtd "

>

\u0026lt;module rename-to='smod'>

\u0026lt;source path =" " />

\u0026lt;/ module>


So I put a new 'module' in the name
smod
. The source

statement is necessary so that all classes are directly involved in the package. Otherwise, the file is empty. In particular, not the usual GWT modules such

com.google.gwt.user.User

be involved, including of course there are no entry-point

.

Now I have in the module XML file of my actual application only inherit include this module . The following line is added: ... \u0026lt;inherits name='org.xy.smod.SMod'/>

...

We're done! At least in my area of the GWT compiler will now find the source code of the business model classes that are in another Eclipse project, and can be used to compile as well as the launch in hosted mode to perform successfully.

Note: A good description of the GWT compiler in general can be found in the internet freely available section "Understand the GWT compiler

'from the book
GWT in Practice
. test the server-side programming / deployment in the web server
Once you want to test the server-side programming and installing the application WARs in the production server RPC servlets also have the business model classes are available. As this again is a pure Java byte code, only the matter is, for example in the form of a corresponding JARs necessary. The jar, you simply put 'whatever' in
/ WEB-INF/lib /
and is ready.