Wednesday, May 8, 2013

Liferay + Direct Web Remoting(DWR)

Direct Web Remoting


DWR is a Java library that enables Java on the server and JavaScript in a browser to interact and call each other as simply as possible.

DWR will generate the JavaScript to allow web browsers to securely call into Java code almost as if it was running locally. It can marshal virtually any data including collections, POJOs, XML and binary data like images and PDF files. All that is required is a security policy that defines what is allowed.

For Information check this link.

SAMPLE APPLICATION


The sample application has been developed to show the integration of DWR, Liferay MVC Portlet and it doesn't attempt to show all the features of these frameworks but only shows how the integration works. It sets the stage for developing more complex portlets which can extensively make use of these frameworks.

Sample application consists of 3 portlets:

  1. Orders

  2. Order details

  3. Customer details .


Dependency jars:

  • dwr.jar


Step 1: Create a New Liferay portlet project .

Step 2: Add dwr.jar to the your project in the /docroot/WEB-INF/lib directory.

Step3: Update web.xml file by adding the below code.This adds the DWR servlet to the application. This servlet is used in the background to process requests and send responses back to the browser.

[sourcecode language="xml"]

<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>

[/sourcecode]

Step 4: Create a file called dwr.xml in the WEB-INF directory using the below code.This is the DWR configuration file, which tells the container which classes are available in JavaScript. DWR reads this XML file and dynamically generates JavaScript code to represent Java classes as JavaScript classes. This enables you to offer the functionality offered by those Java classes in the browser.

[sourcecode language="xml"]

<?xml version="1.0"?>
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
<allow>
<create creator="new" javascript="MessagingBean">
<param name="class" value="com.liferay.dwr.sample.portlet.connector.MessagingBean"/>
</create>
</allow>
</dwr>

[/sourcecode]

Create MockupDB and MessagingBean java classes:

MockupDB is a singleton class that simulates a database of customer orders

[sourcecode language="java"]

package com.liferay.dwr.sample.portlet.database;

import java.util.Hashtable;
import java.util.Map;

public class MockupDB {

private static MockupDB instance=new MockupDB();

private String[] orders=new String[4];
private Map orderDetails=new Hashtable();
private Map customerDetails=new Hashtable();

private MockupDB()
{
String ordStart="ORD";
orders[0]=ordStart+"00112";
orders[1]=ordStart+"00221";
orders[2]=ordStart+"00312";
orders[3]=ordStart+"00445";

orderDetails.put(orders[0],"1. WebSphere Everyplace Connection Manager<br/>"+ "2. WebSphere Portal");
orderDetails.put(orders[1],"1. DB2 Universal Database<br/>2. DB2 Everyplace");
orderDetails.put(orders[2],"1. Tivoli Access Manager for e-business <br/>2."+ "Tivoli Directory Integrator");
orderDetails.put(orders[3],"1. IBM System z9<br/>2. IBM System p5 550 Express");

customerDetails.put(orders[0],"<b>Systems and Technology Group</b><br/>"+ "Some Road<br/>Finland");
customerDetails.put(orders[1],"<b>Global Financing</b><br/>Another Street"+ "<br/>Finland");
customerDetails.put(orders[2],"<b>Software</b><br/>Yet Another Road"+ "<br/>Finland");
customerDetails.put(orders[3],"<b>Global Services</b><br/>Still Another "+ "Street<br/>Finland");
}

public static MockupDB getInstance()
{
return instance;
}

public String[] getOrders()
{
return orders;
}

public String getOrderDetails(String orderNro)
{
return (String)orderDetails.get(orderNro);
}

public String getCustomerDetails(String orderNro)
{
return (String)customerDetails.get(orderNro);
}
}

[/sourcecode]

MessagingBean is a simple POJO.

[sourcecode language="java"]

package com.liferay.dwr.sample.portlet.connector;

import javax.servlet.http.HttpSession;

import com.liferay.dwr.sample.portlet.database.MockupDB;

public class MessagingBean {

public MessagingBean()
{
}

public String getOrderDetails(String orderNumber,HttpSession httpSession)
{

String orderDetails=MockupDB.getInstance().getOrderDetails(orderNumber);
httpSession.setAttribute("orderDetailsOrderNumber",orderNumber);
httpSession.setAttribute("orderDetails",orderDetails);
return orderDetails;
}

public String getCustomerDetails(String orderNumber,HttpSession httpSession)
{
String customerDetails=MockupDB.getInstance().getCustomerDetails(orderNumber);
httpSession.setAttribute("customerDetailsOrderNumber",orderNumber);
httpSession.setAttribute("customerDetails",customerDetails);
return customerDetails;
}
}

[/sourcecode]

Step 5:  Create init.jsp file in the /docroot/html/common directory :

[sourcecode language="html"]

<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>

<%@ page contentType="text/html"%>

<%@ page import="javax.portlet.PortletSession"%>
<%@ page import="com.liferay.dwr.sample.portlet.database.MockupDB"%>

<portlet:defineObjects />

[/sourcecode]

Create javascript.jsp file file in the /docroot/html/orders directory :

This file imports a JavaScript library from DWR (engine.js) and the dynamically created library MessagingBean.js. Notice that MessagingBean.js uses the same name as the Java bean introduced in dwr.xml file, DWR generates MessagingBean.js. The DWR framework uses the engine.js library.

sendOrderNr() functions call to the MessagingBean functions defined in MessagingBean POJO class. DWR adds the HttpSession automatically to the method call. The last parameter in the JavaScript function is the callback function.

[sourcecode language="html"]

<%@include file="/html/common/init.jsp"%>

<script type="text/javascript"
src='<%=renderResponse.encodeURL(renderRequest.getContextPath()
+ "/dwr/interface/MessagingBean.js")%>'></script>
<script type="text/javascript"
src='<%=renderResponse.encodeURL(renderRequest.getContextPath()
+ "/dwr/engine.js")%>'></script>

<script type="text/javascript">
function <portlet:namespace />sendOrderNr(orderNr) {
document.getElementById("orderDetailsOrderNumber").innerHTML = orderNr;
document.getElementById("customerDetailsOrderNumber").innerHTML = orderNr;
MessagingBean.getOrderDetails(orderNr,
<portlet:namespace />showOrderDetails);
MessagingBean.getCustomerDetails(orderNr,
<portlet:namespace />showCustomerDetails);

return false;
}

function <portlet:namespace />showOrderDetails(orderDetails) {
document.getElementById("orderDetails").innerHTML = orderDetails;
return false;
}

function <portlet:namespace />showCustomerDetails(customerDetails) {
document.getElementById("customerDetails").innerHTML = customerDetails;
return false;
}
</script>

[/sourcecode]

Create view.jsp file file in the /docroot/html/orders directory :

[sourcecode language="html"]

<%@ include file="/html/common/init.jsp"%>
<%-- <%@ include file="/html/orders/javascript.jsp" %> --%>

<jsp:include page="/html/orders/javascript.jsp" />

<div style="margin: 6px">
<H4 style="margin-bottom: 3px">Orders</H4>
<table cellspacing="0" cellpadding="5" border="1">
<%
MockupDB database = MockupDB.getInstance();

String[] orders = database.getOrders();
for (int i = 0; i < orders.length; i++) {
%>
<tr>

<td><%="000" + String.valueOf(i + 1)%></td>
<td><a href=""
onclick="return <portlet:namespace />sendOrderNr('<%=orders[i]%>');"><%=orders[i]%></a></td>
</tr>
<%
}
%>

</table>
</div>

[/sourcecode]

Create view.jsp file in the /docroot/html/orderdetails directory :

[sourcecode language="html"]

<%@include file="/html/common/init.jsp"%>

<div style="margin: 6px">

<H4 style="margin-bottom: 3px">Order details</H4>

<table border="1">
<tr>
<th>Order number</th>
<th>Order details</th>
</tr>

<tr>
<%
String orderDetailsOrderNumber = (String) renderRequest
.getPortletSession().getAttribute(
"orderDetailsOrderNumber",
PortletSession.APPLICATION_SCOPE);
String orderDetails = (String) renderRequest.getPortletSession()
.getAttribute("orderDetails",
PortletSession.APPLICATION_SCOPE);

if (orderDetailsOrderNumber == null) {
orderDetailsOrderNumber = "";
}

if (orderDetails == null) {
orderDetails = "";
}
%>
<td><div id="orderDetailsOrderNumber"><%=orderDetailsOrderNumber%></div></td>
<td><div id="orderDetails"><%=orderDetails%></div></td>
</tr>

</table>
</div>

[/sourcecode]

Create view.jsp file in the /docroot/html/customerdetails directory :

[sourcecode language="html"]

<%@include file="/html/common/init.jsp"%>

<div style="margin: 6px">

<H4 style="margin-bottom: 3px">Customer details</H4>
<table cellspacing="0" cellpadding="5" border="1">
<tr>
<th>Order number</th>
<th>Customer details</th>
</tr>

<tr>
<%
String customerDetailsOrderNumber = (String) renderRequest
.getPortletSession().getAttribute(
"customerDetailsOrderNumber",
PortletSession.APPLICATION_SCOPE);
String customerDetails = (String) renderRequest.getPortletSession()
.getAttribute("customerDetails",
PortletSession.APPLICATION_SCOPE);

if (customerDetailsOrderNumber == null) {
customerDetailsOrderNumber = "";
}

if (customerDetails == null) {
customerDetails = "";
}
%>
<td><div id="customerDetailsOrderNumber"><%=customerDetailsOrderNumber%></div></td>
<td><div id="customerDetails"><%=customerDetails%></div></td>
</tr>

</table>
</div>

[/sourcecode]

Portlet.xml

[sourcecode language="html"]
<?xml version="1.0"?>

<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0">

<portlet>
<portlet-name>orders</portlet-name>
<display-name>Orders Portlet</display-name>
<portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/orders/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<resource-bundle>content/Language</resource-bundle>
<portlet-info>
<title>Orders Portlet</title>
<short-title>Orders Portlet</short-title>
<keywords></keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
<portlet>
<portlet-name>customerdetails</portlet-name>
<display-name>Customer Details Portlet</display-name>
<portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/customerdetails/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
<title>Customer Details Portlet</title>
<short-title>Customer Details Portlet</short-title>
<keywords></keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
<portlet>
<portlet-name>orderdetails</portlet-name>
<display-name>Order Details Portlet</display-name>
<portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/orderdetails/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<resource-bundle>content/Language</resource-bundle>
<portlet-info>
<title>Order Details Portlet</title>
<short-title>Order Details Portlet</short-title>
<keywords></keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
</portlet-app>
[/sourcecode]

CheckPoint:

dwr

Friday, February 8, 2013

Dependency dropdown(Selection/Combo box) using aui script

Populate/fill second conbo box values based on first combo box selection.

Sample Code
[sourcecode language="html"]
<aui:script>
AUI().ready('aui-dialog',"node",function(A){
        A.one("#<portlet:namespace />country").on("change",function(e){
var countrySelect=  A.one("#country").val();
A.one("#<portlet:namespace />state").val("");
if(countrySelect == "CA"){
document.<portlet:namespace />fm.state.options.length=0;
document.<portlet:namespace />fm.state.options[0]=new Option("Select State...","");
                    document.<portlet:namespace />fm.state.options[1]=new Option("Canada State1","LA");
                    document.<portlet:namespace />fm.state.options[2]=new Option("Canada State2","LA2");
A.one("label[for='state']").html("Province ");  //Replace the state label to Province
}else{
document.<portlet:namespace />fm.state.options.length=0;
document.<portlet:namespace />fm.state.options[0]=new Option("Select State...","");
document.<portlet:namespace />fm.state.options[1]=new Option("Los angiles","LA");
document.<portlet:namespace />fm.state.options[2]=new Option("Los angiles1","LA1");
A.one("label[for='state']").html("State ");
}
        });

});
<!--<span class="hiddenSpellError" pre=""-->aui:script>
[/sourcecode]

[sourcecode language="html"]
<aui:form name="fm" method="post">
<table>
<tr>
<td><label for="country">Country</label></td>
<aui:select label="" name="country">
<aui:option value="">Select Country...
<aui:option value="US">United State
<aui:option value="CA">Canada
<!--<span class="hiddenSpellError" pre=""-->aui:select>
</tr>
<tr>
&nbsp;
</tr>
<tr>
<td><label for="state">State </label></td>
<aui:select label="State" name="state" label="">
<aui:option value="">Select Country...
<!--<span class="hiddenSpellError" pre=""-->aui:select>
</tr>
</table>
<!--<span class="hiddenSpellError" pre=""-->aui:form>

[/sourcecode]

Friday, January 25, 2013

AUI script tab

Sample Code

[sourcecode language="html"]

<h2>From markup</h2>

<div id="markupTabs">
<ul id="test">
<li><a href="javascript:;">Hello A</a></li>
<li><a href="javascript:;">Hello B</a></li>
<li><a href="javascript:;">Hello C</a></li>
</ul>

<div id="testContent">
<div>
<h3>1. New tab content</h3><br />
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
<div>
<h3>2. New tab content</h3><br />
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
<div>
<h3>3. New tab content</h3><br />
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</div>
</div>

[/sourcecode]

 

[sourcecode language="javascript"]

<script type="text/javascript" charset="utf-8">

AUI().ready(
'aui-tabs', 'substitute',
function(A) {
var tabs1 = new A.TabView(
{
boundingBox: '#markupTabs',
listNode: '#test',
contentNode: '#testContent'
}
);
tabs1.render();
}
);

</script>

[/sourcecode]

 

Check Point:

AUI-Tab

How to get List journalarticle filter by Tags ? Asset Publisher

Liferay version : 6.1.20EE

To get List of journal Article filter by Tags use the below code.

[sourcecode language="java"]


public void doView(RenderRequest renderRequest,
RenderResponse renderResponse) throws IOException, PortletException {

ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest
.getAttribute(WebKeys.THEME_DISPLAY);
try {
List<JournalArticle> journalArticles = getArticleByTags(themeDisplay.getScopeGroupId(), "help");
renderRequest.setAttribute("journalArticles", journalArticles);
} catch (SystemException e) {
e.getMessage();
} catch (PortalException e) {
e.getMessage();
}

public List<JournalArticle> getArticleByTags(long groupId, String tagName)
throws PortalException, SystemException {

AssetEntryQuery assetEntryQuery = new AssetEntryQuery();

long[] anyTagIds = AssetTagLocalServiceUtil.getTagIds(groupId, new String[] { "alllocation", tagName });
assetEntryQuery.setAnyTagIds(anyTagIds);

List<AssetEntry> assetEntryList = AssetEntryLocalServiceUtil.getEntries(assetEntryQuery);
List<JournalArticle> journalArticleList = new ArrayList<JournalArticle>();

for (AssetEntry ae : assetEntryList) {
JournalArticleResource journalArticleResourceObj = JournalArticleResourceLocalServiceUtil.getJournalArticleResource(ae.getClassPK());
JournalArticle journalArticleObj = JournalArticleLocalServiceUtil.getArticle(groupId, journalArticleResourceObj.getArticleId());
journalArticleList.add(journalArticleObj);
}

return journalArticleList;
}


[/sourcecode]

In jsp file add this below code

[sourcecode language="html"]

<%
List journalArticles =(List) renderRequest.getAttribute("journalArticles");
for(JournalArticle journalArticle : journalArticles){
%>
<%=journalArticle.getTitle("en_US") %>
<%
}
%>

[/sourcecode]

Youtube Feed Callback

To display uploaded You tube video, title views count, description Published date ...

[sourcecode langauge="javascript"]
<script type="text/javascript">
function youtubeFeedCallback(data) {
var s = '';
s += '



<span>'+ Math.floor(data.entry.media$group.yt$duration.seconds / 60) + ':' + (data.entry.media$group.yt$duration.seconds % 60)+'</span><br/>';
s += '<h1>' + data.entry.title.$t + '</h1>';
s += '<p>' + data.entry.yt$statistics.viewCount + ' view(s)</p>';

s += '<p>by ' + data.entry.author[0].name.$t + ' On ' + new Date(data.entry.published.$t).toLocaleDateString() + '</p>';
s += '<p>'+data.entry.media$group.media$description.$t.replace(/\n/g,'<br/>' ) +'</p><hr/>';

s += '<p><strong><a href="$videoViewMoreLink.getData()" target="_blank">View All Videos</a></strong></p></div>';
document.write(s);

}
</script>
<script type="text/javascript" src="http://gdata.youtube.com/feeds/api/videos/vR_r06JVpj8?v=2&alt=json-in-script&callback=youtubeFeedCallback"></script>
[/sourcecode]

Check point:

http://www.youtube.com/watch?v=vR_r06JVpj8

youtube

for more information check the below reference link

https://developers.google.com/youtube/2.0/developers_guide_json

https://developers.google.com/youtube/js_api_reference

Thursday, January 24, 2013

Creating table view in mysql and oracle database server

Oracle SQL to create  table view

To fetch distinct row based on the max version of the article from liferay database.

[sourcecode language="html"]
CREATE VIEW LATEST_JOURNALARTICLE
AS
(SELECT JA.GROUPID,
JA.ARTICLEID,
JA.VERSION AS MAX_VERSION,
JA.TITLE,
JA.DISPLAYDATE,
JA.EXPIRATIONDATE
FROM JOURNALARTICLE JA,
(  SELECT GROUPID, ARTICLEID, MAX (VERSION) AS MAX_VERSION
FROM JOURNALARTICLE J
GROUP BY GROUPID, ARTICLEID) JD
WHERE     JA.GROUPID = JD.GROUPID
AND JA.ARTICLEID = JD.ARTICLEID
AND JA.VERSION = JD.MAX_VERSION);
[/sourcecode]

MySQL Query and Rules

A view definition is subject to the following restrictions:

The SELECT statement cannot contain a subquery in the FROM clause.

The SELECT statement cannot refer to system or user variables.

The SELECT statement cannot refer to prepared statement parameters .

[sourcecode language="html"]
CREATE VIEW MAX_VERSION_JOURNALARTICLE
AS
(SELECT GROUPID, ARTICLEID, MAX(VERSION) AS MAX_VERSION
FROM JOURNALARTICLE J
GROUP BY GROUPID, ARTICLEID);
[/sourcecode]
[sourcecode language="html"]
CREATE VIEW LATEST_JOURNALARTICLE
AS
(SELECT JA.GROUPID,
JA.ARTICLEID,
JA.VERSION AS MAX_VERSION,
JA.TITLE,
JA.DISPLAYDATE,
JA.EXPIRATIONDATE
FROM JOURNALARTICLE JA, MAX_VERSION_JOURNALARTICLE JD
WHERE JA.GROUPID = JD.GROUPID AND
JA.ARTICLEID = JD.ARTICLEID AND
JA.VERSION = JD.MAX_VERSION);
[/sourcecode]

AUI form Validation using AUI Validation tag library

Sample example

[sourcecode language="html"]

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui" %>

<aui:form name="fm2" action="" method="post">
<table>
<tr>
<td>
<aui:input name="phoneNumber" value='${phoneNumber}' label="Enter number#" inlineLabel="left">
<!-- Pre defined validation -->
<aui:validator name="required"  errorMessage="Phone number format as (xxx) xxx-xxxx"  />
<aui:validator name="minLength" errorMessage="Phone number format as (xxx) xxx-xxxx" >14</aui:validator>
<aui:validator name="maxLength" errorMessage="Phone number format as (xxx) xxx-xxxx" >14</aui:validator>
</aui:input>
</td>
<td>
<aui:input name="phoneNumber" value='${phoneNumber}' label="Enter number#" inlineLabel="left">
<!-- Custom validation -->
<aui:validator name="required"  errorMessage="Phone number format as (xxx) xxx-xxxx"  />
<aui:validator name="custom" errorMessage="Please check term of use">
function (val, fieldNode, ruleValue) {
var result = false;

if (val == "true") {
result = true;
}
return result;
}
</aui:validator>
</aui:input>
</td>
<td>
<aui:button type="submit" name="numberSearch" value="Number Search" />
</td>
</tr>
</table>
</aui:form>

[/sourcecode]

Validator file path : %LIFERAY_HOME%\webapps\ROOT\html\js\liferay\form.js

DEFAULTS FORM VALIDATOR STRINGS:

DEFAULT: Liferay.Language.get('please-fix-this-field'),
acceptFiles: Liferay.Language.get('please-enter-a-file-with-a-valid-extension-x'),
alpha: Liferay.Language.get('please-enter-only-alpha-characters'),
alphanum: Liferay.Language.get('please-enter-only-alphanumeric-characters'),
date: Liferay.Language.get('please-enter-a-valid-date'),
digits: Liferay.Language.get('please-enter-only-digits'),
email: Liferay.Language.get('please-enter-a-valid-email-address'),
equalTo: Liferay.Language.get('please-enter-the-same-value-again'),
max: Liferay.Language.get('please-enter-a-value-less-than-or-equal-to-x'),
maxLength: Liferay.Language.get('please-enter-no-more-than-x-characters'),
min: Liferay.Language.get('please-enter-a-value-greater-than-or-equal-to-x'),
minLength: Liferay.Language.get('please-enter-at-list-x-characters'),
number: Liferay.Language.get('please-enter-a-valid-number'),
range: Liferay.Language.get('please-enter-a-value-between-x-and-x'),
rangeLength: Liferay.Language.get('please-enter-a-value-between-x-and-x-characters-long'),
required: Liferay.Language.get('this-field-is-required'),
url: Liferay.Language.get('please-enter-a-valid-url')