ラベル Click の投稿を表示しています。 すべての投稿を表示
ラベル Click の投稿を表示しています。 すべての投稿を表示

7/20/2010

ClickIDE 2.2.0.0 is now available!

ClickIDE 2.2.0.0 is now available!

ClickIDE is an Eclipse plug-in for the developing Click web applications.

This version supports Apache Click 2.2.0 and fixed some issues.

Details about ClickIDE:
http://click.apache.org/docs/click-ide.html
Download page:
http://click.apache.org/docs/click-ide-downloads.html

Enjoy Click!

2/27/2010

ClickIDE 2.1.0.0 Released

ClickIDE 2.1.0.0 is now available!

This version is the first release of ClickIDE from Apache Software Foundation and it supports Eclipse 3.5 and Apache Click 2.1.0.

You can download it from the following link:
http://www.apache.org/dyn/closer.cgi/click/clickide/2.1.0.0/clickide-2.1.0.0.zip

Enjoy Click!

1/02/2009

Toggle comment in the Velocity editor

I've just start development of the next version of ClickIDE.

I added Toggle Comment action to the Velocity editor. You can toggle comment for selected lines by the context menu or CTRL + /.

By the way, Now I'm planning JSP and FreeMarker support in the next version of ClickIDE. I have no concrete idea yet, but I wish to provide FreeMarker editor which has features same as the Velocity editor.

11/12/2008

ClickIDE 2.1.0 Released

ClickIDE 2.1.0 is now available!

ClickIDE is an Eclipse/WTP plug-in for web application development using Click. This release has not new features however it supports Click 1.5 and Eclipse 3.4/WTP 3.0.

Please download ClickIDE 2.1.0 and enjoy Click!!

10/08/2008

Url Rewrite Filter: Make Clean URL in Click Framework

Url Rewrite Filter is a servlet filter which provides features similar to the mod_rewrite. We can make clean URL in Click Framework using Url Write Filter.

Url Rewrite Filter has a configuretion file WEB-INF/urlrewrite.xml. This is a very simple example of clean URL with a Click application.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite
  PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN"
  "http://tuckey.org/res/dtds/urlrewrite2.6.dtd">

<urlrewrite>
  <rule>
    <from>^/contents/([0-9]+).htm$</from>
    <to type="forward">/content.html?contentId=$1</to>
  </rule>
</urlrewrite>
For example, Url Rewrite Filter will forward /contents/001.htm to /content.htm?contentId=001.

If content.htm has possibility to receive any other query parameters, we can define following rules.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite
  PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN"
  "http://tuckey.org/res/dtds/urlrewrite2.6.dtd">

<urlrewrite>
  <!-- No Query String -->
  <rule>
    <from>^/contents/([0-9]+).htm$</from>
    <to type="forward">/content.html?contentId=$1</to>
  </rule>
  <!-- With Query String -->
  <rule>
    <from>^/contents/([0-9]+).htm?(.+)$</from>
    <to type="forward">/content.html?contentId=$1&$2</to>
  </rule>
</urlrewrite>
Of course, we can use Url Write Filter with other frameworks such as Struts. I think Url Write Filter is a simple solution to make clean URL in the Java web applications.

8/15/2008

Ajax Controls for Click Framework

I'm thinking about Ajax integration for Click Framework recently.

For example, see the below page class. If you clicks AjaxRequestButton, Click invokes getAllBooks() using XMLHttpRequest. And getAllBooks() renders a Java object as JSON. AjaxRequestButton generates a HTML button that invokes Ajax.Request of prototype.js.

public class AjaxPage extends AjaxPage {
  public AjaxRequestButton button
    = new AjaxRequestButton("search", this, "getAllBooks");
  
  public AjaxPage(){
    button.addAjaxHandler(
      AjaxRequestButton.ON_COMPLETE, "displayResult");
  }
  
  public boolean getAllBooks(){
    List<Book> books = bookService.getAllBooks();
    renderJSON(books);
    return false;
  }
}
Next example. AjaxSubmit control send Form using Ajax.Request.
public class AjaxPage extends AjaxPage {

  public Form form = new Form("form");
  private TextField keyword = new TextFiled("keyword");
  private AjaxSubmit search = new AjaxSubmit("search", this, "onSearch");
  
  public AjaxPage(){
    form.add(keyword);
    form.add(search);
  }
  
  public boolean onSearch(){
    List<Book> bookList = bookService.search(keyword.getValue());
    renderJSON(books);
    return false;
  }
}
Of course, these controls need more improvement. However I think this concept matches to Click Framework well.

8/14/2008

S2Click: Seasar2 integration for Click Framework

S2Click is Seasar2 integration for Click Framework. Seasar2 is an opensource DI container made in Japan. S2Click adds powerful features to Click.
  • HOT deploy - You don't have to restart application server when you modify your sourcecode.
  • Java5 annotation - S2Click provides some annotations for ease of development
  • Ajax & File download support - The page base class S2ClickPage provides methods to render Ajax & file downloading response.
  • public field handling - You can use public fields instead of setter & getter in many places.
  • Extended controls - S2ClickForm, ToolTip, ConfirmSubmit, AjaxLinks and AjaxButtons
Now, Seasar2 and S2Click focuses to Japanese developers (So documentation is provided with Japanese mainly).

However I will introduce S2Click detailed features in this blog. And also I will feedback these features to Click Framework from S2Click in the feature.

8/03/2008

Click Framework goes to ASF!

There are very good news. Click Framework will join to the Apache Incubator! The proposal has been accepted.

This is the first step of introducing Click Framework to many Java developers. I'll make effort to incubate Click Framework in the Apache Incubator.

6/20/2008

The page auto mapping without templates

Click Framework provides the page auto mapping. This is the important feature to decrease amount of configuration.

However Click maps page classes to request-path from HTML templates. So page classes which do not have corresponded HTML template is not mapped automatically.

For example:

  • pages which share a HTML template
  • the page which returns JSON or file (response is written in the page class)
I'm thinking about annotations on Click Framework. How about the @Path annotation which specifies the auto mapping path to page classes.
@Path("/file-download.htm")
public class FileDonwloadPage extends Page {

  /**
   * Writes response for file downloading in this method.
   */
  @Override public void onRender() {
    HttpServletResponse res = getContext().getResponse();
    OutputStream out = res.getOutputStream();
    ...
  }

  /**
   * This method returns null to not render template,
   * because this class writes response contents for file download.
   */
  public String getPath(){
    return null;
  }
}
This is one idea of using annotation in Click Framework.

4/21/2008

JJUG Cross Community Conference 2008 Spring

JJUG Cross Community Conference 2008 Spring will be held at Japan 30 Apr.

JJUG is an abbreviation of Japan Java User Group. In this conference, top Java engineers in Japan talk about hot topics in Java such as Web frameworks, EclipseLink, JAM, Scala and New Swing APIs.

I'll talk about Click Framework in this conference and join panel discussion with speakers of Grails, JRuby on Rails and Wicket.

I wish to make efforts to spread Click Framework in Japan.

3/14/2008

File download in Click Framework

Click Framework provides FileField to upload file, however Click does not provide any support for file downloading. I made AbstractDownloadPage to download file.

Usage:

 public class SampleDownloadPage extends AbstractDownloadPage {
  public SampleDownloadPage(){
    setFileName("sample.txt");
    setContents(SampleDownloadPage.class.getResourceAsStream("sample.txt"));
  }
} 

This page class does not have a template because response is written by this class. So auto-mapping does not work for file download pages. The extended page class have to be registered to click.xml.

3/10/2008

Click Framework + LiveValidation

Click controls provide JavaScript validation, but they are not easy to customize. Now I'm writing JavaScript validation framework for Click using LiveValidation. In the page class, ready the LivaValiator control like below:

Form form = new Form("form");
form.add(new TextField("name", true));
form.add(new PasswordField("password", true));
form.add(new Submit("login"));

addControl(new LivaValidator("validator", form));

In the page template, generates LiveValidation JavaScript code by the LiveValidator control:

<body>
  $form
  <script type="text/javascript">
    $validator
  </script>
</body>

We can also add customized validation rules by use of Validate.Custom.