This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#-- dump.ftl | |
-- | |
-- Generates tree representations of data model items. | |
-- | |
-- Usage: | |
-- <#import "dump.ftl" as dumper> | |
-- | |
-- <#assign foo = something.in["your"].data[0].model /> | |
-- | |
-- <@dumper.dump foo /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#attempt> | |
<#assign black_list = ["class", "request", "getreader", "getinputstream", "writer"] /> | |
<#macro dump key data> | |
<#if data?is_enumerable> | |
<p><b>${key}</b> | |
<@printList data,[] /> | |
<#elseif data?is_hash_ex> | |
<p><b>${key}</b> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.liferay.portal.util.*; | |
import com.liferay.portal.service.*; | |
import com.liferay.portal.model.*; | |
import com.liferay.portal.kernel.util.*; | |
import com.liferay.portal.kernel.workflow.*; | |
import javax.xml.parsers.*; | |
import javax.xml.xpath.*; | |
import java.io.*; | |
import org.xml.sax.*; | |
import org.w3c.dom.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APACHE_LOG_FILE=/var/log/apache2/jenkinsrow-access_log | |
LINES_TO_SCAN=100000 | |
EXCLUDED_ENTITIES="(router.asus.com|NewRelicPinger|Googlebot|slurp|spider|bingbot)" | |
tail $APACHE_LOG_FILE -n $LINES_TO_SCAN | egrep -v "$EXCLUDED_ENTITIES" | sed -r 's!^[^ ]* ([^ ]*) .*!\1!g' | uniq -c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute( | |
WebKeys.THEME_DISPLAY); | |
String oldScopeName = getOldScopeName(actionRequest, portlet); | |
PortletPreferences portletPreferences = actionRequest.getPreferences(); | |
String scopeType = ParamUtil.getString(actionRequest, "scopeType"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.security.AllPermission; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.HashSet; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.liferay.portal.bean.BeanLocatorImpl; | |
import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; | |
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; | |
import com.liferay.portal.kernel.log.Log; | |
import com.liferay.portal.kernel.log.LogFactoryUtil; | |
String[] vals = PortalBeanLocatorUtil.getBeanLocator().getNames(); | |
for (String val : vals) { | |
out.println( val ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Problem import dump from Win to linux | |
# Win mysql tables lowercase; and case insensitive as the default | |
# LInux mysql tables have case; and are case sensitive as the default | |
# So dumping from Win to Linux breaks things | |
# This script needs reference schema with case; it will use that to convert the dump file | |
# I have tested this with Liferay 6.2; ubuntu version 14.04 | |
# This file is based on answer by l0co on StackOverflow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<br /> | |
.main: <br /> | |
<#list .main?keys as var> | |
<br/>Key : <strong>${var} </strong> | |
<br/>Val : | |
| |
<#if .main[var]?is_sequence> | |
<#list .main[var] as varkey> | |
<br/> ${varkey} | |
</#list> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this = 'this' reference (XThis) to Bsh object: NameSpace: global (bsh.NameSpace@2bc198b5) | |
this.variables = [Ljava.lang.String;@3310a984 | |
taskComments | |
taskName | |
workflowTaskAssignees | |
serviceContext | |
entryType | |
groupId | |
userId | |
entryClassPK |