doT.sYs

November 16, 2009

DOJO Key Links

Filed under: Scripting Language, AJAX

A lot of sites, blogs and forums have emerged nowadays, you might find yourself cluttered with information that doesn’t really solved your DOJO needs. It is always a good practice to keep one solid reference that you can come back every time you stumble into your codes.

Here are useful links that might help you begin and work around with DOJO.

DOJO API

DOJO FORUM

September 14, 2009

Web Publisher *grrr

I’ve done minimal programming stuffs for two months now. It is a sign that things are not going too well, I miss squeezing juice of logic from my brain from time to time (*sad). I miss using programming IDEs and having headaches due to overtime work. Weird huh? Yes, I guess I am.

Maybe you’re wondering what I have been up to, here is a gist of what my work is like for the past two months.

I’ve been maintaining the company corporate web site, cool isn’t? big time! Sounds fun and interesting and seems to have tons of programming stuffs to be done right? But you’re wrong. In the beginning of the project we all thought that we’ll be doing a lot of programming jobs and expecting to encounter complicated codes especially dojo scripts (my knowledge in dojo is the reason why I was chosen to be part of the project). But to my dismay, the company uses a web publisher that allows any key employee to update the content anytime as they desire but not the layout and other technical details of the site, because that task belongs to us, the maintenance team.

We change layouts, files, flash even pictures and sometimes fix *text bugs. Read it right, yes we often edit text contents, which I previously mentioned can be done by any marketing stuff. It has never been my pleasure to design, it’s not my inclination I guess, yet I’ve been doing design edits for pete sake! I’ve been changing menu and page layouts, resizing pictures, doing a new flash file, and the like and all to be uploaded in that web publisher. Where the hell is PROGRAMMING in that?

My usual know-how about websites are done coding all throughout the site, yet by using this *certain web publisher, less codes are needed, you only deal with xml files (you don’t need much logic in it). To non-IT, the tool is a great help, even fantastic, the tool was created in Java, reliability and functionality is not a question. But to programmers like me it is a pain in the ass. I’ve noticed numerous things that can be easily done when you code it. Plus the publisher took a lot of time for development, aside from its slowness, you need to checkout the files if is already existing and checkin an edited one or the latest file or simply import a new file, but that does not end there, you still need to promote it from three stages (WIP, Staging, Active) and finally publish it. See what I mean? Four key steps that you need to do. *haist it just simply bores me.

Ahhh d***! I need to stop complaining *sigh. I guess I just miss my programming days.

*Cheers to all programmers!

July 29, 2009

Apache Solr and Nutch

I have not post for quite a long time since my last post. I’ve been busy doing the new project I am now into. As a sweet fruit of labor, I would like to share some knowledge I have gained in this new venture.

I was assigned to the global IT projects together with two more colleagues. A lot of new technologies that we need to cope up with, especially dealing with the critical and gem departments of the company - marketing and sales, every detail is scrutinized and case studied thoroughly. Quality and reliability of the system is the top most importance of the development. A portion of everything done is the server configuration and optimization; this is to aid the system for the search management and site hits. The standard tools used by the company are Solr and Nutch working together pretty well, thus we end up studying these technologies.

A brief description:

Apache Solr - is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, and a web administration interface. It runs in a Java servlet container such as Apache Tomcat. [Wikipedia.org]

NUTCH - is open source web-search software. It was built on Lucene Java, adding web-specifics, such as a crawler, a link-graph database, and parsers for HTML and other document formats. [Lucene.apache.org]

It is coded completely in the Java programming language, but data is written in language-independent formats.
Nutch has a highly modular architecture allowing developers to create plugins for the following activities: media-type parsing, data retrieval, querying and clustering.
The fetcher (”robot” or “web crawler”) has been written from scratch solely for this project. [Wikipedia.org]

In general, Solr and Nutch harmoniously work together as it is both in-house software of Lucene project. Solr generally is responsible for the search and return capability of the system. If the user first searched an item, Solr technology is the one responsible for caching the search and the returned results. It has great API for JSON, XML as the format of the returned results. Other than caching, Solr have also these following features :

• Uses the Lucene library for full-text search
• Faceted navigation
• JSON, XML, PHP, Ruby, Python and custom Java binary output formats over HTTP
• HTML administration interface
• Replication to other Solr servers
• Extensible through plugins
• Distributed Search
• Caching

On the other hand, Nutch acts as the crawler, a mimic of the “goolge crawler” and other search engine crawler (im totaly a big fun of google. *grin). After hitting the search button, nutch would look for the search item into the entire web application and indexed its location and return its details to Solr if it is found.

To incorporate these in your web application, download the latest release of Solr and Nutch, and install it to your server and follow the configuration guidelines for each. Viola! Your system would have its own search engine with no sweat! *wink

May 7, 2009

Prototype, Dojo, Script.aculo.us (JavaScript Framework)

These three famous Javascript frameworks are certainly in the top list of every web developer. They are a proven help in developing dynamic and creative web portals. Without their birth, how in the earth “google” could produce a fanstatic portal such as “igoogle” ( hhmmmm have you thought of it? ).

Now, if you are just starting to explore the usage and advantages of either of these frameworks, let me give you a little hint of the best tool to use in your application (*wink).

Advantages …

1. AJAX Function

All of these frameworks enable you to deal with AJAX with ease and they are also cross-browser compliant. Besides simple requests, they also provide various ways to handle the response from the server, either through XML, JSON or plain text. My advise here, if you only need a way to use AJAX functions and customized UIs is not a concern, use the primitive framework – prototype. Prototype is the best tool to use as it is just a one file function compared to the other two customized, bulky in size frameworks, and if you are the type of developer who codes their way to customize, prototype is the most flexible.

Sample Code

new Ajax.Request('your_url’,
  {
    method:'get',
    onSuccess: function(transport){
      var response = transport.responseText || \"no response text\";
      alert(\"Success! \n\n\" + response);
    },
    onFailure: function(){ alert('Something went wrong...') }
  });

Expandable Code

new Ajax.Request('your_url’,
  {
    method:'get',
    onSuccess: transport,
    onFailure: doError
  });

Functions “transport” and “doError” must be declared somewhere in your code. This way, codes are more flexible and expandable. Do something like this

function transport (x) {
          loadXML( x.responseText );
         …
}

2. Widgets

Script.aculo.us and Dojo are add-on libraries to the Prototype framework primarily for visual effects and interface behaviors. Several widgets, DOM utilities, and animations can be found here. These are actually the highlights of the outset of prototype where group of individuals created and customized the prototype framework to produce dynamic and ready to use widgets.

You can find various component animations in Script.aculo.us such as different effect combination, draggable objects, movie effect and etc. Click here for more reference and see their DEMOs.

To date, DOJO seems to be most useful for corporate websites. It can cater large dataset to be turned into a displayable grid without performance penalty. It also has the most wanted charting utility for your reports. It is fully internationalized, DOJO comes with translations supporting over 100 languages, even scripts like Arabic and Hebrew.

The latest tools I have used in DOJO are the TAB enabled div, drag and drop, and the package loading. All these helped me developed the site I wanted. Here are some sample screenshots and codes.

dojotab

The code

<div  dojoType=\"dijit.layout.TabContainer\" refreshOnShow=\"true\" style=\"height:450px;\">
<div dojoType=\"dijit.layout.ContentPane\" title=\"Equipment Registration\">…</div>
<div dojoType=\"dijit.layout.ContentPane\" title=\"Equipment Update\"> … </div>
<div dojoType=\"dijit.layout.ContentPane\" title=\"Configure\"> … </div>
</div>
 

draggable

Refer to the official DOJO site for more codes and demos.

I hope this post helped you somehow.



Blog Redesigned by Karen Eve R. Eso