
My name is Guido Bellomo. I'm the founder, with Stefano Vitta, of www.bloggers.it. I'm a ColdFusion developer and I work on CMS, Graphic User Interface based on AJAX, Search Engine Optimization and blog related projects. » Continue
Curriculum Vitae,
65 kb
wddxAjax v1.0
It's a AJAX framework for ColdFusion. It's similar to other framework but it widely use WDDX protocol for exchanging data between ColdFusion and HTML page. Click below for more information.

Anfame
Anfame is a small curses generator, written in Delphi during my years spent at University. Only specify how many Kb of curses should be generated. In Italian.
postSections
dontMiss
myPictures
postArchive
|
Cold Fusion
When you build your application it's likely you have to deal with a configuration file: you have to choose between script or XML file, for example
| XML style |
Script syle |
<config>
<mainDirectory>c:</mainDirectory>
</config> |
<cfscript>
mainDirectory = 'c:';
</cfscript> |
The main pre-requisite of a configuration file is that must NOT contain code. That is a practical reason: who has to setup your application doesn't need to know how your application works internally nor code anything.
For that reason many developers use XML, this has one big drawback: XML must be parsed, and parsing XML is slow. That means you can't afford parsing that XML configuration file each time a page is called, you have to cache that structure and provide some code to clear the cache each time the configuration file changes.
Of course, XML is more trendy, but was essentially developed to exchange data (would you like to share your config file?) and doesn't give more information than a script configuration file about the structure (that means that in both cases, in order to write a configuration file from scratch, you have to see a detailed example).
So, if you want to be trendy, then use a XML config file, otherwise I if you don't want to write code inside config file, simply don't do that and leave XML alone.
Tag: configuration files,xml
Cold Fusion
Here is a small function I used on www.bloggers.it to detect the language of a page signaled by a user. Givena bunch of words, it returns a two character code of the language.
At the moment it detects italian, english and german. It's quite simple, if anyone can improve with other languages... let me know!
<cffunction name="detectLanguage" access="public" returntype="string">
<cfargument name="text" required="yes" type="string">
<cfscript>
var strLanguage = StructNew();
var strPoints = StructNew();
var keys = "";
var languages = "";
var i = 0;
var result = "";
var maxPoints = 0;
var currentPoint = 0;
// Init structure StructInsert(strLanguage,"it","il,lo,la,gli,le,delle,dalle,dallo,ciao,che,questo,quello,quella,del,dal,in");
StructInsert(strLanguage,"en","the,where,to,one,that,those,in,out,is"); StructInsert(strLanguage,"de","der,die,das,es,dass,diese,wir,ihr,sie,aus,ein,jenes,diese,dieses,jene,und,nein,ja,auch,nicht,wieso,warum,weshlab,wie,was,warum,wer,durch,um,wegen,mit,ohne");
StructInsert(strPoints,"it",0);
StructInsert(strPoints,"en",0);
StructInsert(strPoints,"de",0);
keys = StructKeyList(strLanguage);
languages = StructKeyList(strLanguage);
// Clean HTML
text = ReReplace(text,"<.*?>","","ALL");
// Start race
for (i = 1; i lte ListLen(languages); i = i + 1) {
// Get test words
lang = ListGetAt(languages,i);
testWords = StructFind(strLanguage,lang);
for (k = 1; k lte ListLen(testWords); k = k + 1) {
if (ReFindNoCase("#ListGetAt(testWords,k)#",text)) {
StructInsert(strPoints,lang,StructFind(strPoints,lang)+1,true);
}
}
}
// Check the winning langage
for (i = 1; i lte ListLen(languages); i = i + 1) {
currentPoint = StructFind(strPoints,ListGetAt(languages,i));
if (currentPoint gt maxPoints) {
result = ListGetAt(languages,i);
maxPoints = currentPoint;
}
}
</cfscript>
<cfreturn result>
</cffunction>
Tag: coldfusion,detect language
Cold Fusion
Tomorrow I will attend CFDevCon conference in London, I hope I'll meet some CF-mate to exchange ideas...
Tag: coldfusion,cfdevcon
Ajax
This article on ClickZ network quoted by LevySoft speaks about the end of pageviews.
There are some interesting ideas: it's true that many sites that heavily use Ajax take some advantages on server load and usability but reduce the pgeviews. Or simply consider YouTube: the pageviews are not a measure of the time spent on a web site (for example a user can watch a 10 minutes long video and then go away).
This is not the end of pageviews, this is an important parameter, but now it's importance is reducing.
Tag: pageview,ajax
Ajax
Some users had problems with application/session scopes with wddxAjax. Method of component called by wddxAjax are able to read and write application and session (if the useSession attribute is set to true) of the calling pages.
To exploit this feature we need to be carefull on where to put the application.cfm of the whole site.
The script wddxAjax/ajaxEngine.cfm is the script that executes the methods of the components specified in the parameter ajaxComponent. For this reason, in order to share the same session/application scope between the pages that use wddxAjax and the methods on the ajax component, be sure that pages share the same application.cfm with ajaxEngine.cfm.
So for example, the following filte structure will be able to share session/application scope:

The file structure below will not be able to share session/application scope between calling pages and remote methods:

In this example, ColdFusion climbs the directory structure until it finds a valid application.cfm template: so for ajaxEngine.cfm the application scope is defined inside the green application.cfm, for the pages that calls remote methods with wddxAjax (under /html directory) is the red one.
Tag: coldfusion,ajax,wddxajax
Blogosphere
I'm at the press release of Accoona in Paris. Everything is cool, these guys are spending a lot of money for this launch.
The chairman has just introduced, fortunately in english, the new search engine claiming that their intenton is to "reinvent the search on internet", highlighting that Accoona supports now 7 languages and more to come. To be honest, techically, I haven't understood what is really new with this search engine.
All this scene is perlexing. Suddendly appears Karpov. We start wondering what a chess champion has to deal witha a search engine. Seems like these old style web 1.0 companies, where the members of the board are all former famous of something but none is really an expert of the core business of the company.
More perplexing is the strategy for this search engine. Suppose for a moment that Accoona is really the best search engine available. What are you going to do to make this the most used search engine? I don't believe that the double OO in logo like Google will make the fortune of this company.
Whene Google launched, first they grabbed the attention of the power users of that time with the uncomparable quality of their search result. These power users were great influencers and helped spread the word GOOGLE among normal users. Today no one on the planet doesn't know what Google is and what is used for.
Accoona strategy is far different. Some web2.0 functionality would be sufficient to grab the attention of those users that now are the grateates influencers on Internet: they are no longer the old style geek that keep passing the night coding in a garage, but are bloggers, flickerers and so on.
For example: the Accoona toolbar is only available for Windows and Internet Explorer. Ok, only 15% of internet population uses Firefox, but I'm sure they are able to influence the other 85%.
They invited a lot of bloggers here, but they actually don't know how blogsphere world works.
Tag: paris,accoona
Search engine
ColdFusion dynamic pages (as well as any other application server) suffer bad indexing with search engines.
There are few tricks that can improve the positioning of these pages: are not exoteric tricks, but simply best practise that many web developer forgot while creating a useless movie flash or AJAX gadget.
At the end of this article you will realize that are quite simple, once we understand the logic of a spider that loads a page and try to unserstand it following a standard.
Suppose you have a dinamic page that should output the result of this query:
<cfquery name="page">
SELECT title,body,keywords
</cfquery>
1. Title tag
The <title>...</title> tag is where is supposed to be the title of the page, not the title of site. So it's a good idea to put here the field title of the query. This is very important not only for the keyword in the title, but also because it's the very fisrt thing the user see in a SERP (Search Engine Result Page).
So, in ColdFusion:
<title>#page.title#</title>
2. Title and subtitles
The tags <h1> e <h2> are normally used for titles and sub-titles in the text, so it's normale tha search engine spider consider the text contained there pretty important.
It's important to put here the title of the article and, eventually, sub-titles and then use CSS to change color and font (default font for <h1> it's definitely ugly).
In ColdFusion:
<title>#page.title#</title>
3. URL rewriting
Generally the address of a dinamically generated page is like this
http://guidone.bloggers.it/index.cfm?action=permalink&id=1234. All search engines don't like this kind of address and don't give any information about the topic of the page.
So it's necessesary to translate this kind of address in something like http://guidone.bloggers.it/keyword1/keyword2/title-of-page.htm.
There are different technics to achieve that, called URL rewriting, the simpliest is to create a simple file at the second address that immediately bounce to the first with a <cflocation> command.
For example:
file: keyword1/keyword2/titolo-della-pagina.htm
<cflocation url="http://guidone.bloggers.it/index.cfm?action=permalink&id=1234">
There are many smarter techniques, this is not the best: ColdFusion application server answer with this header 302 Moved temporarily, which is not completely transparent for the spider.
4. Quality of SERP
It's important to be in the first positions of a SERP (Search Engine Result Page) but it's also important to have your pages well indexed by the spider and correctly use the tag <title> and <meta name="description" content="...">.
The last one is used by some search engine as a 'textual preview' of the site, the very first row below the link. This tag holds the description of the document, not of the entire site.
So it's a good place to put an abstract of the content of the page, for example stripping all the HTML tags and keeping only the first 200 chars. This is the result of the SERP:
It's rumored that Google and many other search engines, has systems to monitor the efficacy of the SERP: the ration between the number of a link appears and the number of click it receive.
This trick increase your efficacy and, indirectly, should the ranking inside the SERP.
In ColdFusion you can insert this code inside the <head> tag:
<meta name="description" content="#(Left(REReplace(page.body,"<([^>]| )*>","","ALL"),150)#">
5. Avoid repeated content
There are some clues that make me think that Google can recognize different bunch of words across sites: a site like this CopyScape it's able to discover plagiarism given the orginal site. Likely it uses that feature of Google or any other search engine. Since Google likes fresh and original content, I think that G dosn't like repeated content.
For example, suppose we have a list of news, sorted by date, and suppose there are more link to sort this page by author or by title. These are secondary pages, are only useful to show content in a different way, but the content it's the same, anyway they are indexed by Google as different single pages.
To avoid this, simply use the metatag <meta name="ROBOTS" content="INDEX,NOFOLLOW"> in the secondary pages (= with repeated content) or use the file robots.txt to exclude that pages from spidering.
This increase the efficacy of a SERP, without this trick a content may appear in different pages within a SERP (breaking the univocal relationship with pages and contents) and with the risk that a visitors lands in a secondary page of your site.
You can verify which pages of your site are indexed on Google, using the keyword site:yoursite.com: this is the result for this blog, no repetitions and more clean result.
6. Bold keyword
Keywords that appear in bold or with larger font within text are more important, so Google consider this.
If in our query we have the keywords fot the artcile, we can build our pages so this keyword can be automtically bolded.
<cfset keywordBody = page.body>
<cfloop list="#page.keywords#" index="idx">
<cfset keywordBody = ReplaceNoCase(keywordBody,idx,"<strong>" & idx & "</strong>","ALL")>
</cfloop>
7. Avoid browser dependent session variables
Sometimes may happen that a site presents diffferent pages based on some browser's variable, such as the language.
Some CMS detect the language of the browser, save this in a session variable and then use this variable to select the pages with the right language (in a multi language site).
Unfortunately the search engine spider is not exactly a browser, it doesn't have a language variable, in the best case, this server side session variable will be set to the defaul case and the spider will only index the default language page, in the worst case it will index an error page.
8. Resist to keyword temptation
Keywords metatag should contain the keyword of the pages (and not of the whole site). May be natural to put this ColdFusion lines between the tag <head>...</head>:
<meta name="keywords" content="#page.keywords#">
Actually many search engine doesn't consider this metatag (particularly Google) ma get easily offended if this keywords are not used inside the body tag (probably it starts to think you are a spammer).
So, my advice is that unless your are sure that the keywords are related with the content of the page, don't use them al all.
Tag: bologna,cms,engine,search
Ajax
Building multi language pages brings two main problems:
- create multi language query for database
- create multi language template (in few words, translating static words, those that are not inside a database)
The target is creating a single template that serves several languages, without having to create a single template for each language. The more a page is comples, the more this is important. Otherwise each enhancement should be replicated in each language version, this wuold be too complex even to test the web application.
So, for example, suppose we have a small page of news:
<cfquery name="selNews" datasource="..."> SELECT * FROM news WHERE language = '#Session.language#' </cfquery>
<cfoutput query="selNew"> Title: #title#<br> #body#<br> <a href="read_news.cfm?id=#id#">Continue reading</a><br> </cfoutput>
In this case I have fired a query and filtered each record with tha variable Session.language, which is supposed set to the default browser language. Is beyond the pourpose of this article how to extract data from a Db depending on the language (also it strongly depens on the cms).
Another problem is how to translate static text ("Title", "Continue reading", etc.) to avoid having two template for the same function.
I've developed a small library that handles this problem with a simple global function Application.Tx. This function solves the problems by inserting this static texts (labels) in a XML file (dictionary.xml that works like an associative array) with related translations for the each languages and to print out the right translation depending on the browser language. The code should be modified in this way:
<cfquery name="selNews" datasource="..."> SELECT * FROM news WHERE language = '#Session.language#' </cfquery> <cfoutput query="selNew"> #Application.Tx("Title")#: #title#<br> #body#<br> <a href="read_news.cfm?id=#id#">#Application.Tx("Continue reading")#</a><br> </cfoutput>
wrapping labels inside the function Application.Tx.
Tx function handles this labels, in particular:
- insert, if not exists, the label in the file dictionary.xml
- allow insertion of the translation for a label by clicking on a small icon beside the label (with a small ajax-driven window) and replacing on-the-fly the translated label, without reloading the page
- print out the right translation, if found inside dictionary.xml
In this way, templates are completely language indipendent and there's no need to create more templates for different languages. Moreover, being able to translate these labels directly on the page, it's easier to translate because we can consder the context in which reside.
Here a short video of how this Application.Tx works.
This library will be available shortly.
Tag: multilanguage,coldfusion,ajax
Blogosphere
The page on control panel, asking for a domain change is an april fool (so you don't need to transfer your domain to mibloggoaddosso.it). It's almost a tradition at Bloggers.it. I saw few april's fool around: the new Google service Google Romance, and this always useful list of best hoaxes ever (not bad the hambuger with all the ingredients rotated by 180 degree for left handed customers).
Sadly there was few april'fools this year. Someone may say there's nothing to laugh to (the elenctions fight, the crisis, etc.). Instead, for me, when you stop laughing, then is over.
Tag: blogosphere,bloggers,april fool
|