March 9, 2007 at 7:14 pm
· Filed under Tech, Javeline
Javeline Markup Language
Although the colleagues at our naming department had a day off when this one was concucted, it does cover the meaning quite well. It is a subset of XML in which you can describe how your application looks and behaves. Let me give you an example:
Besides the basic XHTML elements there, i’m sure you notice the elements in the j: namespace. By clicking on the [View Example] button you will see a list containing five users. You can now play around with the small application. After the text ‘Loading…’ has dissapeard click on one of the users in the List. By pressing [F2] you can rename it. The list has full keyboard support; use the arrows and the [del] key for instance.
Declarative Development
What I’ve tried to accomplish with Platform is to combine the strengths of declaring your application with the imperative approach of JavaScript. Which one to use is in most cases very clear. There is a gray area however, in which it is up to you to decide which one to use. In essence everything that can be done declaratively can be done using JavaScript. Vice versa this is not the case. When declaring an application as you can think about your goals and forget about the specific implementation. Which, in my view, is the boring part; the stuff that is the same for every application. I feel it is important to tell you that when you go a little further than just placing elements, the way to think might require a change on your part.
In this part of this article I will discuss the basic JML tags and Components. In the parts to follow more feature will be discussed which introduce several tags you can use in declaring your application. To give you a general feel of what type of tags you can find here is an explanation of the ones from the example:
j:loader
The HTML and text within this tag is displayed during the load of the application.
j:settings
This tag is used to tell Platform how it should operate. In the example above the debugging features are turned on.
j:skin
Loads the skin file. It is possible to define skins within this tag.
j:include
Includes JML from a URL at the position of this tag.
j:List
This is a tag, which is actually one of many. If we would like a Button component we would write j:Button and so forth. This tag draws the component and gives it it’s properties such as a width, height etc.
j:Item
The tag is used by the List component to determine it’s data. Other components might required other tags (i.e. the Tab component requires a Page tag)
N.B. The cheatsheets contain all the available tags as well as several use examples.
A nice feature of using an XML based declarative approach is the ability to intermix Javeline components with XHTML elements. (From now on I will just show the relevant portions in examples):
<h1>My example list</h1>
<p>Check out this list</p>
<div style="border:2px solid red;padding:10px">
<j:List width="150" height="100" />
</div>
For bigger applications you don’t want to load a 100KB xml file just to load the interface. For this and other purposes you can insert JML dynamically, either using script or adding a src attribute on an element.
fig 1. Layers in architecture.
Javeline Platform has a strict way of seperating different layers. There’s not only an MVC seperation but also one of style (skin), state and language (See fig 1.). These are seperated such that each layer is changable whilst the application is running. This way of development makes it very easy to add otherwise difficult functionality. Working together with members of a team is less of a pain because you work in seperate layers. I will discuss each layer in the upcoming sections.
I have already sent two emails to the Javeline team via the “info@javeline.nl” email
address, but unfortunately I got no response
So I am contacting You directly here via this blog entry; because I have fallen in love with Your layout engine almost immediately ! I am currently doing some research with regard to layout in the native contemporary browsers, and Your approach seems to be really unique ! I have played around with it a little bit and am so impressed right now that I want to leverage Your layout engine ! I know that I can use the packager to extract only parts out of all the Javeline SDK stuff; but I couldn’t make it extract the layout parts … in fact I couldn’t get it to work at all …
I am also very much excited about Javeline in its whole glory, but this particular blog comment shall address the issue of leveraging Your layout engine separately. Is there a technical way to do it ? And what about licensing then ? Or do You know of other layout engines for browsers which are as capable as Yours seems to be ?
I just found your e-mail. It got lost in the spam box somehow. You will get a reply from me on that. It is possible to extract the layout engine using the packager. For what purpose would you like to use it? Please register to the internals mailinglist at http://developer.javeline.net/mailinglists.php and sent your answers there so the community can follow them as well.
Ajax applications connect to a backend. Most popular nowadays is to use REST to connect to a backend. This backend can be written in PHP, Perl, ASP, JSP or any other language. It’s the responsibility of that language to connect to a database using jdbc.
In Javeline PlatForm you would do something like this:
[…] early version of Javeline PlatForm and up untill that moment I had only positioned elements using anchoring. I did remember a nice feature that Visual Basic had, where I could align an element to one of the […]
Guys, I have gone thru the documentation available on javeline.com website nevertheless I am still unable to start with it. There are several examples which I have browse as well but would you have something like tutorial or learn by example so, I can quickly adopt and use your framework?
I’m trying to send a form in JPF. I use a set of form elements checkbox, textbox, etc. I would like to send all these elements with Teleport to a php-script to put the values in a database. I get it to work if I declare the variables within the tags. This seems not very efficient to me.
Is it possible (like plain HTML), to submit all the form elements in one, without declaring them again within the Teleport-tags?