Skip to content

Instantly share code, notes, and snippets.

View jamesfalkner's full-sized avatar

James Falkner jamesfalkner

View GitHub Profile
<#-- Add this code before the </#if> tag of your "Basic List" ADT -->
<#else>
${renderRequest.setAttribute("PORTLET_CONFIGURATOR_VISIBILITY", true)}
<#-- Copy this code to your "Enhanced List" ADT -->
<#assign aui = taglibLiferayHash["/WEB-INF/tld/aui.tld"] />
<#assign liferay_portlet = taglibLiferayHash["/WEB-INF/tld/liferay-portlet.tld"] />
<#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] />
<#if entries?has_content>
<#list entries as curEntry>
<#assign assetRenderer = curEntry.getAssetRenderer() />
<div class="asset-abstract container-fluid">
<div class="index span1" style="text-align:center">
<h1>${curEntry_index +1}<h1>
</div>
<div class="asset-image span2">
<img src="${assetRenderer.getThumbnailPath(renderRequest)}" />
</div>
<div class="asset-content span7">
<#-- Wrap the code inside the if clause of your "Enhanced List" ADT with this code -->
<@liferay_ui["tabs"]
names="list,chart"
refresh=false
type="pills"
value="chart"
>
<@liferay_ui["section"]>
<repositories>
<repository>
<id>lrce</id>
<url>https://repository.liferay.com/nexus/content/groups/liferay-ce/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
import com.liferay.portal.model.Layout;
import com.liferay.portal.service.LayoutLocalServiceUtil;
import com.liferay.portal.service.ServiceContext;
Layout toDelete = LayoutLocalServiceUtil.getFriendlyURLLayout(10182, false, "/somepage");
LayoutLocalServiceUtil.deleteLayout(toDelete, true, new ServiceContext());
@jamesfalkner
jamesfalkner / liferay-7-wcm-adt-dump.ftl
Created November 24, 2015 21:45
A simple utility template to dump all available Liferay 7 WCM/ADT variables and their values.
<#-- 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 />
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>exec-npm-install</id>
<phase>generate-sources</phase>
<configuration>
<executable>npm</executable>
echo "Hi this is revision 4"
@jamesfalkner
jamesfalkner / istio-coolstore.sh
Created March 14, 2018 21:33
Hack to install istio to OpenShift and deploy coolstore-microservice as an istio service mesh
#!/bin/bash
# This script will install istio and the coolstore-microservice demo as a service mesh.
# It does everything as a cluster-admin user because istio (the project) still needs it to
# work. Future versions will not require so many permissions!
#
# Maintainer: James Falkner <jfalkner@redhat.com>
#
# Prereqs:
#