Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View rotty3000's full-sized avatar

Raymond Augé rotty3000

View GitHub Profile
@rotty3000
rotty3000 / clp
Created July 5, 2011 16:06
Clone Liferay Projects
#!/bin/bash
usage()
{
cat << EOF
SYNOPSIS
$0 <options>
DESCRIPTION
Clone a repo on github into a 'new' local folder.
@rotty3000
rotty3000 / example.java
Created September 13, 2011 16:34
simple dialog with encoded (safe) content from a bean
<button id="createNew">Create a new Dialog</button>
<aui:script use="aui-base">
var myFunction = function(options) {
var dialog = new A.Dialog(
A.merge(options, {
bodyContent: options.content,
title: 'New Dialog',
xy: [150, 150],
modal: true
@rotty3000
rotty3000 / web.xml
Created September 15, 2011 13:57
jstl in portlet web.xml
<?xml version="1.0"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>
@rotty3000
rotty3000 / liferay-plugin-package.properties
Created September 15, 2011 14:01
borrow portal jstl dependency jars
portal-dependency-jars=\
jstl-api.jar,\
jstl-impl.jar
portal-dependency-tlds=\
c.tld
@rotty3000
rotty3000 / liferay-plugin-package.xml
Created September 15, 2011 14:19
the xml version of package props settings
<deployment-settings>
<setting name="portal-dependency-jars" value="jstl-api.jar,jstl-impl.jar" />
<setting name="portal-dependency-tlds" value="c.tld" />
</deployment-settings>
@rotty3000
rotty3000 / build.xml
Created September 17, 2011 00:47
to add localizations in a theme, add this compile section your your build.xml and the languages in the usual location
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="sevencogs-theme" basedir="." default="deploy">
<import file="../build-common-theme.xml" />
<property name="theme.parent" value="_styled" />
<target name="compile">
<mkdir dir="docroot/WEB-INF/classes"/>
@rotty3000
rotty3000 / FileUploadSample.java
Created September 17, 2011 19:31
simple sample client for fileupload to dl, requires commons-httpclient and it's dependencies.
import java.io.File;
import java.io.IOException;
import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.cookie.CookiePolicy;
@rotty3000
rotty3000 / Language.properties
Created September 21, 2011 20:12
Extremely Flexible and Light Portal Customization
show-breadcrumb=Show Breadcrumb
portal-main-color=Main Background Color
@rotty3000
rotty3000 / liferay-plugin-package.properties
Created September 23, 2011 19:52
boiler plate liferay-plugin-package.properties
name=@portlet.display.name@
module-group-id=liferay
module-incremental-version=1
tags=
short-description=
change-log=
page-url=http://www.liferay.com
author=Liferay, Inc.
licenses=LGPL
@rotty3000
rotty3000 / PortletAction.java
Created September 26, 2011 15:56
fix success message disabling
@@ -22,6 +22,7 @@ import com.liferay.portal.kernel.servlet.ServletResponseUtil;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.servlet.SessionMessages;
import com.liferay.portal.kernel.util.ContentTypes;
+import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.JavaConstants;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
@@ -168,6 +169,20 @@ public class PortletAction extends Action {
protected void addSuccessMessage(