Wednesday, January 2, 2013

Solving Can't find resource for bundle com.liferay.portlet.PortletResourceBundle, key javax.portlet.title

I have seeing many of you dealing with this error.
 I spent hours reading and trying to figure out what was the problem. These are my findings ...

 Example code. (ERROR)

Using Eclipse (I didn't test with another IDE) the Ctrl+Shift+F command will indent your code, but for some reason this breaks the xml
We are interested in this specific line
And should be

  That's it! Hope it helps you.

Monday, December 10, 2012

JDK Installation - Ubuntu Distribution

1) Download the bin file from http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html (JDK 5.0 Update 13, Linux self-extracting file) to /usr/local/ or another directory.

Change permisions using chmod.
chmod +x jdk-1_5_0_12-linux-i586.bin

2 ) Then we need to configure JAVA

We have 2 options here, use the console or a GUI.

A) Console approach.

sudo update-alternatives --install /usr/bin/java java /home/psabbate/dev/java/jdk1.7.0_XX/bin 70

Command: update-alternatives 
Installation Param: --install
Link Path: /usr/bin/java
Link Name: java
JDK Path: /home/psabbate/dev/java/jdk1.7.0_XX/bin
Priority: 70 (The higher, the best)
Then execute
sudo update-alternatives --config java

B) GUI approach

Use galternatives

sudo aptitude install galternatives
sudo galternatives

Search “java” and go to the JDK directory.

3 ) Enviroment Variables:

Please Edit
sudo vi /etc/bash.bashrc:

Add at the bottom of the file
export JAVA_HOME=(JDK Path)
export PATH=$JAVA_HOME/bin:$PATH

Wednesday, October 17, 2012

How do I run a batch file from my Java Application?

Sometimes we want to run a batch file from our Java Application. This batch could be either a .bat file or a .sh file, it depends on which operating system are we using.

After some research ... I created a class that do the job.

Basically, we have 4 parameters.


  • programAbsolutePath: Where is the batch file to execute?
  • parameters: Which are the parameters of the batch file?
  • environmentVariables: If you want to override some environment variables
  • baseDirectory: Which will be the base directory of the batch?. This could be usefull when the batch file use relative paths in its process.

This class only executes batches for unix/windows. If you want to use it in other Operating Systems you should specify which are the execution path (like EXEC_WINDOWS and EXEC_UNIX constants)

That's all.

Friday, August 31, 2012

What is SEO? Techniques and Examples (Part 2)


Aspects of a Successful SEO Implementation


The search engines look at so many aspects of a Web site to judge them through extremely complex algorithms. These algorithms use similar components to each other and do not change drastically very often. The tough thing is no search engine will reveal 100% of how theirs works.

Here are some techniques.


1) Page Title Tags -- <title></title>

  • These are by far the most important piece of the site’s code/content and
  • everything feeds off of these.
  • The site’s key words should be clearly spelled out and prioritized on these.
  • Never overload a page with too much information on the title tags

2) Page Heading Tags - <H1>, <H2>, <H3>

  • These tags should match up with the Title tags on the same page. If the page is about this information then it should be described as such.

3) Page Text Content - <p>content</p>

  • This is all of the text on the site that is NOT in a Flash file or in an Image.
  • Keywords need to be placed inside of the text that match the Title and Heading
    tags

4) User Sitemap and XML Sitemap

  • The creation of a sitemap can support the search engines in finding all of the
    pages on the site without having to follow links
  • These sitemaps can also serve to name the links that the search engines are
    following.

5) Site URLs structure


6) Site Navigation

  • The links in the main navigation should describe exactly where the user is
    navigating to on the site.
  • Be sure to NOT use images, hotspots or flash because these cannot be indexed by
    the search engines
  • If a link is named something, then perhaps it actually means that

7) Internal Links between pages

  • When writing content for the site; make many keyword phrases into hyperlinks
    between internal pages. These links allow keyword stuffing and also tell the
    search engines what the page they are looking at mean/include.

8) Meta Description and Keyword Tags

  • These tags are normally only seen by the search engines
  • Google actually pays little attention to these tags because visitors of the site
    cannot see these on the page, so false information can be placed here
  • Bing does place some validity on these if they match the Title and Heading tags
    on the site

9) Construction

  • Avoid using tables <table>, <tr>, <td> These make it really difficult for the search engines to index the site
  • Use divisions/dividers or <div></div>.These make clear separations in the code and also can be named in theCSS
  • Do not use any of the following tags on any site
    • <font></font>
    • <b></b>
    • <i></i>
  • Use CSS first and foremost and
    • <strong></strong>
    • <em></em>

10) How often the site gets updated with relevant content?

  • A site that gets updated and pages added to it on a regular basis is seen as more
    valid to the search engines.
  • If a site sits stagnant for long periods of time then search engines tend to let it fall
    down its rankings because it is stale

11) How mature is the domain of the site?

  • Did the site just go up or has it been there for a long time?
  • Has the content of the site been consistent throughout its lifetime or has it
    changed

12) How relative is the domain of the site?

  • Does the domain say what the site is or does?
    • Good use = http://www.insurance.com
    • Poor use = http://www.yfrog.com/

Monday, August 20, 2012

What is SEO? Techniques and Examples

SEO IS AN ACRONYM FOR "SEARCH ENGINE OPTIMIZATION". 


Definition 

SEO is the process of improving the visibility of a web site or a web page in search engines via the "natural" or un-paid ("organic" or "algorithmic") search results. Other forms of search engine marketing (SEM) target paid listings. In general, the earlier (or higher on the page), and more frequently a site appears in the search results list, the more visitors it will receive from the search engine.


So ... Why is it important??

An SEO professional or company can potentially and drastically improve a site’s rank on the major search engines including Google and Bing. These rankings can then increase the income for the owner of the site.

  • Keep in mind that the Google, Yahoo and Bing’s search results page include organic search results and paid advertisements (denoted by the heading "Sponsored Links“).
  • These results are the answer from a strict and advanced formula or algorithm that will never be 100% revealed and is constantly evolving


Ok, I got it ... when to SEO?

  • The best time to optimize a site is NOW… or Early and Often!
  • The next best time is when one is doing a rebuild/redesign. That way the site owner can save time and ensure that their site is search enginefriendly from the bottom up. However, a good SEO can also help improve an existing site.


Important things to remember ...

  • No one can guarantee a #1 ranking on Google. Beware of this claim as no one can make this guarantee of rankings.  There is no priority submit for Google.  The only way to submit a site to Google directly is through our add URL page or by submitting a Sitemap and anyone can do this at no cost. 
  • Be sure to understand where the hours/efforts go. While Google or Bing NEVER sell better ranking in our search results, several other search engines combine pay-per-click or pay-for-inclusion results with their regular web search results.  Be sure to compare results only on creditable engines only.
  • More than 70% of users click on the first 3 search engine results.
  • Nearly 90% of all search engine traffic comes from the 1st page.


What Can You Do With SEO?

Question: "What good is SEO when the site is already ranked number one?” 
Response: It depends ... what is it ranked #1 for? If it's the name of the company than I'll bet the company is not getting very much traffic. 
Small to medium-sized businesses need to achieve high organic rankings for the terms prospective customers are search on - which isn't your company name!


Just an example ...

Go to Google and type "oratoria córdoba" or "curso intensivo oratoria córdoba". What's on the first page of results?
"Curso Intensivo de Oratoria en Córdoba" which is not the home page ... "Nissi Group"

In the next post we will cover some examples and I will explain the techniques to achieve your SEO goals

Part 2 Here

Friday, August 10, 2012

How to inject Spring properties using annotations?


I started to change a couple of projects from xml configuration to annotations and it wasn't trivial.
One of these items was the injection of properties using annotations.

First of all, we need a property configurer


The configuration file is a common property file.

application.title = My Application Title

In my case, I want to define a configuration bean, so I put in one place all the configurations. But you can use the same approach injecting the properties in your specific beans.

Hope it help you ...