Google Maps Internationalization

English: Wordmark of Google Maps

Google Maps API supports internationalization of user interface and locations names. In order to add language definition to our map we have to provide additional parameter language to <script> declaration.

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&language=sl"></script>

Source:
https://developers.google.com/maps/documentation/javascript/basics

With this kind of language declaration we can define only one language (if we forget JavaScript DOM manipulation). What we need is dynamically loaded Google Maps API and Google Loader is the right choice for this kind of job. It is capable of loading several JavaScript libraries like Google Maps API, Google Data APIsGoogle Visualization API… For more information click here. Google Loader API requires <script> declaration in header of HTML  document:

<script type="text/javascript" src="https://www.google.com/jsapi"></script>

And this is an example of dinamicly loaded Goolge Maps API with provided language and callback function which builds a new map:

<script type="text/javascript" src="https://www.google.com/jsapi">  function mapsLoaded() { ... }
   google.load("maps", "3", {"callback" : mapsLoaded, "language": "sl", "other_params": "sensor=false"});
</script>

And what is wrong whit this code?

The language is never set properly. What actually works is language declaration inside other_params like this:

<script type="text/javascript" src="https://www.google.com/jsapi">  function mapsLoaded() { ... }
   google.load("maps", "3", {"callback" : mapsLoaded, "other_params": "sensor=false&language=sl"});
</script>

Do not forget sensor parameter!

Advertisements

Liferay on GlassFish 3.1.2 [bug]

GlassFish Logo Java http https web server

Due to bug in GlassFish 3.1.2 we are unable to upload files in Liferay 6.1 portal. The problem should be resolved in next GlassFish release. Liferay 6.1 bundle already comes with older version of GlassFish, but for manual installations we have to set up GlassFish server, database, deploy portal .war file and try upload several files, before we notice the bug.

Link to Liferay issue: http://issues.liferay.com/browse/LPS-25899.

Javascript framework in Liferay portal

Why using jQuery when there is allready an equaly good javascript library Alloy. It has selectors, animations, ajax support… Alloy is javascript and CSS framework for building dynamic web components. It is based on YUI framework. Liferay also provides JSP tag library for some of alloy components.

Continue reading “Javascript framework in Liferay portal”

Tomcat Server running as Windows service

English: Logo of Русский: Логотип Apache Tomcat

How to install service for Tomcat 6.x/7.x to start automatically after reboot on Windows 7 or Windows Server 2008?

First of all you will need administration privileges to install service. This step by step guide is for standalone zip version of Tomcat Server.

Continue reading “Tomcat Server running as Windows service”

Set portlet public rendered parameters

Inter portlet communication (IPC) between portlets (JSR 286) can be done with public rendered parameters.

And how to append this parameters to links? Liferay Portal framework provides JSP taglib to generate portlet render and action links.

Continue reading “Set portlet public rendered parameters”