Sunday, December 30, 2007

Mount And Blade Version 1.011 Cheats



W dystrybucji GWT znajdują się cztery skrypty cmd, które w największym skrócie można nazwać kreatorami. Każdy z nich jest wykorzystywany na różnym etapie tworzenia aplikacji.

projectCreator
GWT pozwala na łatwą integrację ze środowiskiem Eclipse, dlatego też jeżeli podczas tworzenia aplikacji programista zamierza korzystać z tego IDE, wówczas powinien użyć tego narzędzia. Kreator ten zakłada strukturę katalogów (wraz z plikami .project oraz .classpath) , która pozwoli easily import the application is created as a project on Eclipse.

exercising command:
  MyAppPrj projectCreator-eclipse-out MyAppDir  
will create the following structure:
  MyAppDir Created directory \\ src Created directory 
MyAppDir \\ test Created file
MyAppDir \\.
project Created file MyAppDir \\. Classpath
applicationCreator
This wizard performs three functions:

  • prepared packet structure for an application.
  • Generates default HTML files and Java fastened in a simple XML file module. These files are a simple application from which you can begin to build more advanced functionality.
  • Creates cmd scripts that allow you to recompile and run the application in hosted mode mode.
exercising command (without Eclipse):
  applicationCreator-out MyAppDir com.example.client.MyApp  
exercising command (from Eclipse):
  MyAppPrj applicationCreator-eclipse-out MyAppDir com.example.client.MyApp  
Created will be the following structure:
  MyAppDir Created directory \\ src \\ com \\ example 
MyAppDir Created directory \\ src \\ com \\ example \\ client Created directory
MyAppDir \\ src \\ com \\ example \\ public Created file
MyAppDir \\ src \\ com \\ example \\ MyApp.gwt.xml
Created MyAppDir file \\ src \\ com \\ example \\ public \\ MyApp.html
Created MyAppDir file \\ src \\ com \\ example \\ client \\ MyApp.java
Created file MyAppDir \\ MyApp-shell.cmd
Created file MyAppDir \\ MyApp-compile.cmd
In the case of-eclipse in addition to a:
  Created file MyAppDir \\ MyApp.launch  
i18nCreator
If there is a shortcut to i18n internationalization of course, about . This wizard produce simple text files that contain solid properties in the form of key / value. Generates a script cmd [Appl]-i18n, which is based on file properties generates a Java interface through which we have access to the texts of constant application GWT Java code.

exercising command (without Eclipse):
  i18nCreator-out MyAppDir com.example.client.MyAppConstants  
exercising command (from Eclipse):
  MyAppPrj i18nCreator-eclipse-out MyAppDir com.example.client.MyAppConstants  
Created will be the following structure:
  Created MyAppDir file \\ src \\ com \\ example \\ client \\ MyAppConstants.properties 
Created file MyAppDir \\ MyAppConstants-i18n.cmd
If the-eclipse in addition to a:
  Created file MyAppDir \\ MyAppConstants-i18n .  launch 
jUnitCreator
Creates the appropriate directory and files in which to place the unit testing GWT applications.

exercising command (without Eclipse):
  junitCreator-junit c: \\ junit.jar-module com.example.client.MyApp-out MyAppDir com.example.client.MyAppTest  
exercising command (from Eclipse):
  junitCreator-junit c: \\ junit.jar-eclipse-module MyAppPrj com.example.client.MyApp-out MyAppDir com.example.client.MyAppTest  
will create the following structure:
  MyAppDir Created directory \\ test \\ com \\ example \\ client \\ test Created file 
MyAppDir \\ test \\ com \\ example \\ client \\ test \\ MyAppTest.java Created file
MyAppDir \\ MyAppTest-hosted.cmd
Created file MyAppDir \\ MyAppTest-web.cmd
In the case of the-eclipse in addition to a:
  Created file MyAppDir \\ MyAppTest-hosted.launch 
Created file MyAppDir \\ MyAppTest-web. launch
Wizards can, within just a few moments to build your first application in GWT, so you do not even discourage impatient. Of course, more important is that you do not need to perform repetitive tasks that can perform automated for us.

Sunday, December 23, 2007

Mobile Alabama Bathhouse

Why GWT is better than Echo2

I remember long time ago I came across a very interesting framework which was Echo2, the very concept of writing for me was brilliant, but a closer examination, however, the solution I found that in practice it has little chance of success. Now nadeszedł moment when I decided to compare it with GWT, because the very idea of \u200b\u200bwriting applications in these frameworks is similar, but basically completely different.

as both GWT and Echo2 developer uses the API similar to the Swing (or those who prefer to AWT). Below is an example zamieszony how to add and edit field button in the Echo2:
  final TextField text = new TextField (); 
text.setText ("Empty value");

final Button button = new Button ();
button.setText ("Complete");
button.addActionListener (new ActionListener () {public void actionPerformed
(ActionEvent event) {
text.setText (Supplemented by value ");}

}

Window window = new Window ();
window.setContent (new ContentPane ());
window.getContent.add (text);
window.getContent.add (button);
In this same example GWT looks like this:
  final TextBox text = new TextBox (); 
text.setText ("Empty value");

final Button button = new Button ();
button.setText ("Complete");
button.addClickListener (new ClickListener () {public void onClick
(Widget sender) {
textField.setText (Supplemented by value ");}

}

RootPanel.get (). Add (text);
RootPanel.get (). Add ( button);
Regarding the comparison of code, there is no essential difference in operation while the situation is different.

GWT from Java code generates the JavaScript that runs in your Web browser, the Echo2 code compiles to Java classes, and then executes it on the server. This makes each event (eg button pressed) generates traffic between web browser and the server. Wybraźmy yourself what would happen if every time you exit the edit box has been running the event (Echo2 fortunately limited run such events.) Hence the approach proposed by Echo2 totally does not appeal to me, because I generate too much traffic on the network. Obviously there are certain advantages of this approach such as the server knows what is the status of the application is sent only necessary JavaScript.

GWT developers have chosen according to me, more natural way, since the interface is a browser and the application is run in it, and communicates with the server only when necessary.

Sunday, November 11, 2007

Watery Cm Day Before Period Due

Hack Html good at all

I remember a time when programs is written using the curses library and the user interface was a 80x24 terminal. I'm not going to dwell too much about it, but one thing I remember I wrote something like this to work on every terminal. Then came the era of GUI applications (such as Delphi, Swing), and finally we came to Internet browsers, and here they ran into problems. It works on Firefox, and Internet Explorze not, etc. Last week I came across just such a problem and, as always, with the help Came "html hack", ie the use of the famous JavaScript function setTimeout .

I'll start from the beginning (This is the best) is from an example which clearly shows the problem to which I came. Well, the reason was to click the checkbox is selected to show (for an additional attribute position had to be relative), and after unchecking hide (additional attribute position had to be absolute ). I made all the HTML code below:
  \u0026lt;html> 
\u0026lt;head>

\u0026lt;script type="text/javascript"> \u0026lt;! -
function changeDiv (checkboxEl) {var
divElStyle = document.getElementById ("div1"). styles;
if (checkboxEl.checked) {
divElStyle.position = "relative";
divElStyle.visibility= "visible";
}
else {
divElStyle.position = "absolute";
divElStyle.visibility= "hidden";
}
}
//-->
</script>
</head>
<body>

<input type="checkbox"
onclick="changeDiv(this);">Test</input>

<br />

Poczatek 
<div id="div1"
style="position: absolute; display: inline; visibility: hidden; "> \u0026lt;input type="button"
value="Test" />
\u0026lt;/ div> End


\u0026lt;/ body>
\u0026lt; / html>
When you run this example, it turned out that yes in Firefox does everything well, but in Internet Explorer button is not visible, but it is a place reserved for him.

course, full of humility, but I took faith in success to work after a few moments, I found that the problem is related to the assignment of attribute position relative value . Unfortunately, Internet Explorer, it can not cope. Problem found, so I switched to a solution that brought the pragmatic move which was to use setTimeout function - the popular and "liked" html hacku.

Below is modified code that works in Internet Explorer:
  \u0026lt;html> 
\u0026lt;head>

\u0026lt;script type="text/javascript"> \u0026lt;! -
function changeDiv (checkboxEl) { var
divElStyle = document.getElementById ("div1"). styles;
if (checkboxEl.checked) {
divElStyle.position = "relative";
setTimeout(
'document.getElementById("div1").style.visibility = "visible"',
1);
}
else {
divElStyle.position = "absolute";
divElStyle.visibility= "hidden";
}
}
//-->
</script>
</head>
<body>

<input type="checkbox"
onclick="changeDiv(this);">Test</input>

<br />
Beginning

\u0026lt;div id="div1"
style="position: absolute; display: inline; visibility: hidden;">
\u0026lt;input type="button" value="Test" />
\u0026lt; ; / div> End


\u0026lt;/ body>
\u0026lt;/ html>
I encourage you to share in their interesting experiences.

Saturday, November 3, 2007

2 Angled Curtain Rods

Meet your idol - James Gosling

Probably needs no closer the person of James Gosling. Due to the weekend I put a link to a short film which is the main hero. I admit that this film made me very amused: There are better ways to meet your idols

Friday, October 26, 2007

Angus Bottom Round Roast Recipes

GWT - module or an entry-point

The programming is often so, do the basic stuff that is quick and easy, especially with regard to frameworks. The distribution of the library there is often plenty of examples, which are characterized by one feature - they are simple, sometimes too simple. Similarly, he is with most tutorials. However, there is a problem. At the outset, but later, yes. Because at that, after hearing the examples, or courses can do a form if you do not know how to design and then program the entire application. Of course, intuition suggests the programmer, in which direction to follow, but he always asks himself the question whether this is right direction, consistent with the art and architecture and its application is optimal.

I encountered such a problem by creating an application in GWT. My application was to consist of two components: the panel for the user and the administrator panel. However, certain elements of the panels were to be common: both display elements such as DialogBox, as well as RPC services. So here I was faced with the dilemma of how to solve the GWT - whether to create one module with several elements of an entry-point, or several modules. At first I was inclined to create more entry-points, until I realized that after the modules can inherit. Then it was over the hill, I decided stowrzyc a general module, which put the common code for both panels, and two modules of a specific code, one for the admin panel, and one for the front office. Of course, these two modules inherit the general module. Everything was within a single Eclipse project.

Now I is on the technical side.
First create a general module, which will be as follows:

Packets:
  com.blogspot.coderlife.app.common 
com.blogspot.coderlife.app.common.client
com.blogspot.coderlife.app.common.server
com . blogspot.coderlife.app.common.public
content packages:
  com.blogspot.coderlife.app.common 
Common.gwt.xml

com.blogspot.coderlife.app.common.client
CommonService.java
CommonServiceAsync.java
CommonDialogBox.java

com.blogspot.coderlife.app.common.server
CommonServiceImpl.java

com.blogspot.coderlife.app.common.public
(empty)
Content Common.gwt.xml file:
  \u0026lt;module> 
\u0026lt;inherits name="com.google.gwt.user.User">
\u0026lt;
servlet class = "com.blogspot.coderlife.app.common. server.CommonServiceImpl "
path =" / commonService ">
\u0026lt;/ module>
Please note that this module does not contain any element of an entry-point, because it will store all the elements in common, and he will not run, and therefore the package is empty com.blogspot.coderlife.app.common.public contains no html pages.

In the second step we create a module administrator which will be as follows:

Packets:
  com.blogspot.coderlife.app.adminpanel 
com.blogspot.coderlife.app.adminpanel.client
com.blogspot.coderlife.app.adminpanel.server
com.blogspot.coderlife . app.adminpanel.public
content packages:
  com.blogspot.coderlife.app.adminpanel 
AdminPanel.gwt.xml

com.blogspot.coderlife.app.adminpanel.client
AdminPanel.java

com.blogspot . coderlife.app.adminpanel.server
(empty)

com.blogspot.coderlife.app.adminpanel.public
AdminPanel.html
AdminPanel.css
AdminPanel.gwt.xml File Contents:
  \u0026lt;module> 
\u0026lt;inherits name="com.google.gwt.user.User">
\u0026lt;inherits name="com.blogspot.coderlife.app.common.server.Common">
\u0026lt;
entry-point class = "com.blogspot.coderlife.app.adminpanel.client.AdminPanel">
\u0026lt;/ module>
This module will no longer run through the file AdminPanel.html hence it contains an entry-point. The most important is the inheritance of common-module here.

I will not because he published content Userpanel is analogous to adminpanel.

summary by me if the application has two independent panels (screens) should create two modules for each of them, but the common elements in the third to put the common module (which does not contain any entry-point).

encourage you to share opinions about the correct model for building applications in GWT.

Saturday, October 20, 2007

Do People With High Cholesterol Sleep A Lot

Parsing XML provided by the GWT WYSIWYG

I start from introducing the problem, which of course does not exist until it sees it:) The problem lies in the fact that part of the XML parser closes the input stream (InputStream ) when it encounters EOF (-1). This applies even if Xerces, which is the default parser for the JDOM library. Of course not would be nothing wrong if the input stream was not SocketInputStream since its closure does not necessarily cause a desired result, namely the closure of socket, which in effect is useless which means nothing else than the fact that he can not send a reply.

For a large part of the application sockets are used for the implementation of the classic request-response model, for example, the client sends an XML document server, the server processes it, and then replies to the customer another XML document. But where, after loading the XML document by the server socket is closed, the client will not be answered.

What can you do in that case to achieve the desired effect? There are two solutions while the second one can be accomplished in several ways. The first solution is a package InputStream (with socket) in such a way that it did not close the connection, or override methods close () . The second solution is to read everything in the buffer, and then transfer the contents to the XML parser. At the same time what to do if the input data stream is large and we do not want to wait unnecessarily until all loaded and only then will pass it to the parser. After all incoming bytes can be processed by the XML parser before it will come next.

How do I do in that case effectively:
  BufferedInputStream clientSocketInputStream = 
new BufferedInputStream (clientSocket.getInputStream ());
juxtaposes two streams piped type:
  PipedOutputStream PipedOutputStream pipedOutputStream = new (); 
pipedInputStream = new PipedInputStream ();
pipedOutputStream.connect (pipedInputStream);
create thread connecting the piped output stream from the socket input stream. Its task is to read data from clientSocketInputStream to pipedOutputStream , which is connected to pipedInputStream that we can directly refer to the XML parser:
  Output2InputThread output2InputThread = 
new Output2InputThread (pipedOutputStream, clientSocketInputStream);
output2InputThread.start ();
SAXBuilder builder = new SAXBuilder ( );
Document inputDocument = builder.build (pipedInputStream);
Implementation class Output2InputThread will not he published in its entirety, but will put the passages to help you get what should be found in it:
  private static final int BUF_SIZE = 4096; 
byte [] buf = new byte [BUF_SIZE];

public void run () {int
readedCount;
while (true) {
/ / Load the socket into the buffer
readedCount = clientSocketInputStream . read (buf);

/ / TODO need to add more code,
/ / TODO check when you should stop reading

/ / Saves the buffer to pipedOutputStream
pipedOutputStream.write (buf, 0, readedCount);

}}
not posted the code to check when you should stop reading, but one thing everyone can achieve alone. Previously, of course, you need to determine how to inform the completion of the transfer of an XML document, it can be done for example by sending the document header to the number of bytes to be read or the end of a contractual document marker. I should also note that setting the buffer size to the specified value does not mean that podaczas one iteration, it will be all filled in a particular case can be loaded only one byte.

encourage you to share their methods for solving the problem presented by me.

Thursday, October 18, 2007

Gay Crusing Places In Gao

sockets back to the roots

Who did not happen in a Swing skrobnąć something and / or Delphi using a graphic designer, probably the majority of programmers. Yes, the code that may be incurred through such a tool, not a top-flight, but at least it creates a graphical user interface is simply fast, even without being an expert in a given library, we focus only on supporting the individual events (eg onClick, etc). Well, yes but so what, as today, everyone (well, maybe almost everyone) it is expected that the application will be available through a web browser, applets, and of course drop out because you have to install Java, etc.

remember a story that a friend of mine told me about the company in which developers several years ago created an application in Visual Basic, and now they do it in JSP. I asked if they are happy, and he replied that he did not end because they can not understand why, something created by one day it takes them three days now ... This short story smacks of nostalgia for their roots, a WYSIWYG designer environments in which user interface wyklikujemy and oprogramowujemy only events. Is that the MVC had waited for the developers of the story ... you see them.

They waited for GWT Designer tool that allows you to program in such a way as if they had done in the Swing, the difference is only one click is the result of our web interface.

GWT Designer is a GUI wizard, which also supports GWT. It has both the ability to create a visual interface (WYSIWYG) and a set of wizards that generate Java code for us. To create the same interface, users do not need to write even one line of code, only to program the event. Although if we feel like the course, such a code, we ourselves zedytować, then switch back to visual mode. Quite a fantastic way internationalization is supported - without compiling after selecting from the drop down language we can control how your interface will look like in different locations.

With WYSIWYG, you can:
  • add controls, drag & drop technique,
  • add support for the event by clicking the control,
  • change control properties by using the Property Editor palette,
  • change and execute the generated code refactoring, the effects are immediately evident in the visual editor,
  • tools copes well with the code that was written by hand, can analyze it and present a visual tool,
  • and most importantly, he GWT Designer is nothing but a plugin for Eclipse,
  • its biggest drawback is that it is not free.

you soon learn its capabilities through the demo videos are available at: http://www.instantiations.com/gwtdesigner/demos.html

Source: http://www.instantiations.com/gwtdesigner / index.html

Wednesday, October 17, 2007

License Renewal Grace Period

rival YUI GWT?

Google has provided developers Google Web Toolkit (GWT) framework for fast and friendly web application development. Of course the word "nice" is a relative question, but I certainly would say yes Java programmer who shuns JavaScript and HTML. Why? Because GWT does not need to use any language other than Java. But whether this is the direction of web development frameworks, which proves to be the most appropriate. At this point, hard to anticipate.

completely different concept is proposed Yahoo - so, so Yahoo also has decided to leave your player:) It's called The Yahoo User Interface (YUI). This library is a collection of tools and controls, written in JavaScript, for building interactive Web applications. It is based largely on manipulation of the House of, DHTMLu and Ajax. All the components provided by Yahoo sourcowe are open under the BSD license and can be used at will.

In order to demonstrate the fundamental possibility Yahoo will use a simple example component AutoComplete.

To use the controls in general we attach to our HTML page, CSS files and JavaScript:
  \u0026lt;link type = "text / css" rel = "stylesheet" href = 
"http://yui.yahooapis.com/2.3 .1/build/autocomplete/assets/skins/sam/autocomplete.css ">
<script type="text/javascript"
src="http://yui.yahooapis.com/2.3.1/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript"
src="http://yui.yahooapis.com/2.3.1/build/connection/connection-min.js"></script>
<script type="text/javascript"
src="http://yui.yahooapis.com/2.3.1/build/animation/animation-min.js"></script>
<script type="text/javascript"
src="http://www.json.org/json.js"></script>
\u0026lt;script type="text/javascript"
src="http://yui.yahooapis.com/2.3.1/build/autocomplete/autocomplete-min.js"> \u0026lt;/ script> Then we
AutoComplete instance fields as follows:
  \u0026lt;div id="myAutoComplete"> 
\u0026lt;input id="myInput" type="text">
\u0026lt;div id="myContainer"> \u0026lt;/ div> ;
\u0026lt;/ div> \u0026lt;script type="text/javascript">

myAutoComp var = new YAHOO.widget.AutoComplete ("myInput", "myContainer" myDataSource);
\u0026lt;/ script>
AutoComplete constructor has three parameters:

  • texbox ID type field or a textarea in which the user typed the query.

  • ID HTML element that is a container that contains the query results.

  • Finally, the third parameter is the DataSource, which will contain data that will be narrowed down by the query and presented in a container.


Before AutoComplete facility will be established, the third parameter to initialize the DataSource can be done in three different depending sposby needs.

simple plaque on the side of the browser:
  \u0026lt;script type="text/javascript"> 
myArray1 var = ['a', 'b', 'c'];
myDataSource1 var = new YAHOO.widget.DS_JSArray (myArray1);
\u0026lt;/ script>
JavaScript function, which will provide details:
  
\u0026lt;script type="text/javascript"> var myFunction = function () {var
myArray2 = ['d', 'e', 'f'];
myArray2.reverse return ();}

myDataSource2 var = new YAHOO.widget.DS_JSFunction (myFunction);
\u0026lt;/ script> Finally
the most useful way to pull data from the server:
  \u0026lt;script type="text/javascript"> var 
myserver = "someServlet"
mySchema var = ["ResultItem", "KeyDataField"];
myDataSource3 var YAHOO = new . widget.DS_XHR (MyServer, mySchema);
\u0026lt;/ script>
I hope that this example is at hand the principle of YUI. More information is available at:
http://developer.yahoo.com/yui/

also encourage you to discuss to what should be the future of web frameworks?

Saturday, October 13, 2007

Dehydrated Eyes Open Unresponsive

Drag & Drop in GWT

Since I came up GWT has passed a lot of time, so it can no longer be viewed not only in terms of whether Google's proposed approach is precisely that for which the developers are waiting webowi who knit in JavaScriptcie simply does not answer, but it can also be assessed in terms of popularity that wins, and admit that browsing the Internet resources it is clear that leaves the competition behind, such as YUI framework developed by Yahoo.

Another important element that contributes significantly to the popularity of the framework is to support the He gets open-source environment, mainly I mean the number of free expansion which is formed by a group of programmers.
hours searching the Internet I came across a very interesting library gwt-dnd that the really little effort, you will build the user interface elements of Drag & Drop.

main advantage of this library is that we can benefit from standarowych widgets and panels supplied by GWT - they do not need to implement special classes or interfaces, simply use the existing widgets and panels. I will not be focused in the following description of the functionality that the library provides, and will present a piece of code that present the ease of use with this extension.

In the first step we create the main panel, except that they can not go dragging elements:
  AbsolutePanel AbsolutePanel boundaryPanel = new (); 
boundaryPanel.setPixelSize (400, 300);
RootPanel.get (). Add (boundaryPanel);
Then inside of the panel, create another panel, this time it will be determined the area outside where you can not drop the widget (in our case it will simply label):
  AbsolutePanel AbsolutePanel targetPanel = new (); 
targetPanel.setPixelSize (300, 200);
boundaryPanel.add (targetPanel, 10, 10);
The next step is to create a so-called. DragControllera in which the panel put off that you can not drag widgets (which does not mean that you will drop it in him):
  DragController dragController = new PickupDragController (boundaryPanel, true);  
Now we add the so-called analogy. DropController, which put the panel within which it can be dropped widgets:
  DropController dropController = New AbsolutePositionDropController (targetPanel);  
register the DropController in DragControllerze:
  dragController.registerDropController (dropController);  
create the label, which we will be dragged and dropped around targetPanel:
  Label label = new Label ("Move me:) ', false); 
targetPanel.add (label, 10, 1);
Through DragControllera do with the label widget that can be dragged:
  dragController.makeDraggable (label);  
strength of this library lies in its simplicity of use in 12 lines of code can make a huge difference confusion:)

sources which I use and recommend everyone read them:
http://code.google.com/p/gwt-dnd/
http://code.google.com/p/ gwt-dnd/wiki/GettingStarted

For those interested, I put the source code.

source code file MyApplication.gwt.xml :
  \u0026lt;module> 
\u0026lt;inherits name="com.google.gwt.user.User"/>
\u0026lt;inherits name = "com.allen_sauer . gwt.dragdrop.DragAndDrop "/>
\u0026lt;entry-point class="com.mycompany.project.client.MyApplication"/>
\u0026lt;/ module>
source code file MyApplication.java :
  com.mycompany.project.client package; 

com.allen_sauer.gwt.dragdrop.client.DragController import, import
com.allen_sauer. gwt.dragdrop.client.PickupDragController;
com.allen_sauer.gwt.dragdrop.client.drop.AbsolutePositionDropController import, import
com.allen_sauer.gwt.dragdrop.client.drop.DropController;
com.google.gwt.core import. client.EntryPoint;
com.google.gwt.user.client.ui.AbsolutePanel import, import
com.google.gwt.user.client.ui.Label;
com.google.gwt.user.client.ui import. RootPanel;

public class implements MyApplication EntryPoint {

public void onModuleLoad() {
AbsolutePanel boundaryPanel = new AbsolutePanel();
boundaryPanel.setPixelSize(400, 300);
RootPanel.get().add(boundaryPanel);

AbsolutePanel targetPanel = new AbsolutePanel();
targetPanel.setPixelSize(300, 200);
boundaryPanel.add(targetPanel, 10, 10);

DragController dragController = new PickupDragController(boundaryPanel, true);
DropController dropController = new AbsolutePositionDropController(targetPanel);
dragController.registerDropController(dropController);

Label label = new Label("Rusz me:) ", false);
targetPanel.add (label, 10, 1);

dragController.makeDraggable (label);}

}

Lime Green Mens Shirt For Wedding

Portlets in Sun Java Studio Creator 2

recently became interested in a bit more serious subject portals - after hearing with a few free solutions, I decided that in the longer journey I will use Liferay due to its stability, maturity and high performance and compatibility with the JSR 168

Due to the fact that I'm a developer mainly focused my attention on writing portlet and that JSP and Servlets are very close to my soul, writing them was not a problem at all for me - turned out to be a pleasant occupation, easy and pleasant, until ...

just the time when I thought it worthwhile to take advantage of a framework (or even more - the development environment), but this would be where a lot of components at a relatively high level of abstraction, graphical development environment for designing Web pages such as the Sun Java Studio Creator 2 . (Let me remind you that this tool has a graphical editor for building JSF pages.)

Before this proceeded I have read a bit more with the JSR 168 specification . Particularly interested in me, part CSS Style Definitions , are included in the all standard CSS, which should be used in portlets. Why should it be? Well, so that each portlet look the same in terms of color and design, which dictates that the user selects the configuration available in the portal. After all, how cruel it would be torture for obiorcy if he saw several different portlets on one page in a completely different color, which does nothing match with the whole, and yet here the consistency of it.

decided to check how it is in practice and I wrote some code in the JSF (using the standard implementation in accordance with MyFaces JSF 1.2 ). Why I chose JSF because I've already had time to figure that the technology is most appropriate when it comes to writing portlets - this results from the reviews circulating on the Internet.

Below is an example in JSF written in accordance with Chapter CSS Style Definitions :
  \u0026lt;h:form id="edit" styleClass="portlet-font"> 

\u0026lt;h1 style = "portlet-section- header ">
<h:outputText value="#{text['formtitle']}" />
</h1>

<h:messages globalOnly="true" showDetail="true"
infoClass="portlet-msg-info"
warnClass="portlet-msg-alert"
errorClass="portlet-msg-error"
fatalClass="portlet-msg-fatal" />

<h:panelGrid columns="2"
footerClass="portlet-section-footer"
headerClass="portlet-section-header"
styleClass="portlet-section-body">

<h:outputLabel for="name"
styleClass="portlet-form-field-label">#{text['name']}</h:outputLabel>

<h:inputText id="name"
value="#{formbean.form.creator.name}"
required="true"
styleClass="portlet-form-input-field"/>
</h:panelGrid>

<h:commandButton id="submit"
value="#{text['submit']}"
action="#{formbean.doSave}"
styleClass="portlet-form-button"/>

<h:commandButton id="cancel"
value="#{text['cancel']}"
action = "# {formbean.doCancel}"
Immediate = "true"
styleClass = "portlet-form-button" />
\u0026lt;/ h: form>
is easy to see that a programmer in the code above has focused this to use a standard CSS style specification JSR 168 And it used to be beautiful, almost idyllic ... Until it was time for rehearsal of the Sun Java Studio Creator 2, development environment, which allows the programmer in a few minutes (maybe hours) wyklikać almost the entire application - you can see on presentation Java Studio Creator 2 in Action . (Mention only that such presentations to managers make a great impression and it is not always easy to explain to them that such a solution also has some drawbacks, and make a perfect match to the reality of companies).

JSF page created and used by a number of available components: a table, a button, etc. Given that the Sun generates for its own komponetów your CSS, I decided in one of the key to redefine them in a style consistent with the specification JSR 168:
  \u0026lt;ui : button id = "NextStep" 
action = "# {Buy.nextStep_action}
binding = "# {Buy.nextStep}"
text = "NEXT STEP"
styleClass = "portlet-form-button" />
Imagine my surprise when, after running the portlet this amendment was successful. In desperation, I looked into the source of generated HTML in a web browser. Here are results:
  \u0026lt;input type="button" value="NEXT STEP" 
class="btn2 portlet-form-button" />
As it turned out, the component generates a CSS class my portlet-form-button but previously interceded your btn2 - a custom which is contrary CSS styles defined for the portal, and that the class was btn2 -define a lot of CSS attributes to my poor class portlet-form-button could small przedefinować here. It was wrong, but whether it can be even worse, it turns out that, yes. Well, I started to look where is the CSS file, which I find unfortunate is the definition of btn2 , because maybe that gave him zwariantować separately for each subject portal. Wprowadziłbym separate file to a separate definition of CSS and placed in each subject. After some time, was unfortunate in one of bilbiliotek Sun packed into spring. How it works: when the portlet is loaded dynamically, this collection is drawn from such a spring and attached to it. The result is that each portlet has its own definition of CSS, which does not fully congruent to the standard JSR 168

There are also other problems with what I wrote above. If we run two portlets written in the development environment is the Sun from two independent suppliers, each of which applied different styles such as CSS and gray.css blue.css. It was then adopted by the two portlets on the portlet styles, which run The last - that we are dealing with a kind of lottery, because the user can decide the order of their occurrence (the deployment of portlets on the page).
This problem can be solved by using a workaround suggested on the blog Sun employee Conflicting Themes Creator Portlets al. He proposes adding a CSS style once again in a footnote, that the two portlets will have three style definitions and the definitions of the standard for the portal.

summarize all the old proverb: not all gold that shines - despite the fact that the development environment Sun Java Studio Creator 2 at first glance really offer much of a serious design errors disqualify them from use in building portlets.

What to write portlets that case, since the standard implementation of JSF 1.2 is not enough, because the expectations are greater (eg table with paging, sorting, etc.) can use Tomahawk components in conjunction with ajax4jsf ? Some people's precisely this combination puts Interview with Max Katz .

encourage you to discuss What to write portlets (JSR-168) in an efficient manner, but i zgodny ze sztuką?