Skip to content

Instantly share code, notes, and snippets.

View jamesfalkner's full-sized avatar

James Falkner jamesfalkner

View GitHub Profile
## AJAXification with well-formed JSON result construction
## AJAXification with AUI and JSON parameters
#set ($pns = $request.portlet-namespace)
#if ($request.lifecycle == "RENDER_PHASE")
<body onload="${pns}doit()">
<p><em>Demo 5: AlloyUI AJAX call to WCM App, JSON parameters construcuted with JSONFactory</em></p>
## AJAXification with AUI and JSON parameters
#set ($pns = $request.portlet-namespace)
#if ($request.lifecycle == "RENDER_PHASE")
<body onload="${pns}doit()">
<p><em>Demo 4: AlloyUI AJAX call to WCM App, JSON parameters</em></p>
<p>
<a href="${request.resource-url}">See what WCM App's RESOURCE_PHASE emits</a>
## Passing parameters
#set ($pns = $request.portlet-namespace)
#if ($request.lifecycle == "RENDER_PHASE")
<p><em>Demo 3: Resource phase concepts and simple parameter passing to WCM app</em></p>
<h4><a href="${request.resource-url}">1. See what WCM App's RESOURCE_PHASE emits</a></h4>
<img style="float:right;" src="http://www.liferay.com/osb-community-theme/images/custom/heading.png">
## Portlet lifecycle: long-running process in RESOURCE_PHASE
#if ($request.lifecycle == "RENDER_PHASE")
<em>Demo 2: Long-running process that doesn't hang</em>
<h1>Hello, Liferay!</h1>
<img src="http://www.liferay.com/osb-community-theme/images/custom/heading.png">
<h3>Didn't take very long, did it?</h3>
#elseif ($request.lifecycle == "RESOURCE_PHASE")
## Long-running process hanging render
<em>Demo 2: Long-running process that hangs the rendering for about 10 seconds</em>
<h1>Hello, Liferay!</h1>
<img src="http://www.liferay.com/osb-community-theme/images/custom/heading.png">
## long-running process
#set ($start = $dateUtil.newDate())
#foreach ($i in [1..15000000])
#end
## Super-simple example of a WCM app
#set ($userLocalService = $serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
<em>Demo 1: Super-simple example of a WCM app</em>
<h1>Hello, Liferay!</h1>
<img src="http://www.liferay.com/osb-community-theme/images/custom/heading.png">
<h3>User Count: $userLocalService.getUsersCount()</h3>
<h3>Config Setting: $appconfig1.data</h3>
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
AUI().use("anim-color", "anim-easing", "aui-base", "aui-live-search", "liferay-poller", "stylesheet", "swfobject", function (a) {
var h = a.Lang;
var d = h.now;
var f = a.config.doc;
var e = a.config.win.webkitNotifications;
var c = 0;
var g = 1;
var b = '\u004e\u0065\u0077\u0020\u004d\u0065\u0073\u0073\u0061\u0067\u0065\u0020\u0066\u0072\u006f\u006d\u0020\u007b\u0030\u007d';
Liferay.namespace("Chat");
a.one(f.documentElement).toggleClass("desktop-notifications", !!e);
./document_library/10154/0/document_thumbnail
./document_library/10154/0/document_thumbnail/10180
./document_library/10154/0/document_thumbnail/10180/229
./document_library/10154/0/document_thumbnail/10180/229/11493
./document_library/10154/0/document_thumbnail/10180/229/11493/11494.png
./document_library/10154/0/document_thumbnail/10180/229/11493/11494.png/1.0
./document_library/10154/0/document_thumbnail/10546
./document_library/10154/0/document_thumbnail/10546/207
./document_library/10154/0/document_thumbnail/10546/207/10703
./document_library/10154/0/document_thumbnail/10546/207/10703/10704.png
@jamesfalkner
jamesfalkner / asd
Created January 23, 2012 16:51
asd
package pt.agap2.custom_login;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;