Skip to content

Instantly share code, notes, and snippets.

View sammso's full-sized avatar

Sampsa Sohlman sammso

View GitHub Profile
/**
* *********************************************************************************************************
*
* Usage:
*
* Run this Script Lifeay 6.2 's scripting console to trouble shot caches
*
* variable MIN_MISS_PERCENTAGE you can limit that itdoes not pring caches that fill rate is low.
* variable PRINT_SQL set this true if you want to print SQL statement ready to be inserted
* variable NODE_NAME is the node name for printSQL statement.

Users

portalUtilReference=(serviceReference "com.liferay.portal.kernel.util.PortalUtil")
portalUtil=(service $portalUtilReference)
defaultCompanyId=($portalUtil getDefaultCompanyId)
userServiceReference=(serviceReference "com.liferay.portal.kernel.service.UserLocalService")
userService=(service $userServiceReference)
users=$userService getCompanyUsers $defaultCompanyId 0 100   
each $users { $it getFullName }

Install java to Debian or Ubuntu

setup-java.sh

if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root run: sudo ./setup-java.sh" 1>&2
   exit 1
fi

Display all renderRequest attribute names

    <ul>
    <#list renderRequest.getAttributeNames() as name >
        <li>${name}</li>
    </#list>
    </ul>

Add following methods to ManufacturerAssetRendererFactory

	@Override
	public PortletURL getURLAdd(
		LiferayPortletRequest liferayPortletRequest,
		LiferayPortletResponse liferayPortletResponse) {
	
		try {
 ThemeDisplay themeDisplay =

This for replacement for AlloyUI Component exercise

<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@include file="/html/init.jsp" %>

<%
	boolean hasAddPermission = InventoryPermission.contains(
			permissionChecker, scopeGroupId, "ADD_MANUFACTURER");
	boolean hasConfigurePermission = InventoryPermission.contains(
@sammso
sammso / asset-hook.md
Last active July 27, 2016 15:14
Dev1 Training Leiden Extra 1

liferay-hook.xml

<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">

<hook>
	<custom-jsp-dir>/custom_jsps</custom-jsp-dir>
</hook>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
<%@ taglib uri="http://liferay.com/tld/security" prefix="liferay-security" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@ page import="java.util.List" %>