Skip to content

Instantly share code, notes, and snippets.

<%@ include file="/init.jsp" %>
<aui:input name='<%= ContentTargetingUtil.GUID_REPLACEMENT + "myField" %>' label="label" value="<%= initialValue %>">
<aui:validator name="required" />
</aui:input>
<%--
/**
* Copyright (c) 2000-present 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
com.liferay.asset.list.service.persistence.test.AssetListEntrySegmentsEntryRelPersistenceTest > testFindAll FAILED
java.lang.IllegalArgumentException: Unknown column name assetListEntrySegmentsEntryRelId
at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.getColumnName(BasePersistenceImpl.java:693)
at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.appendOrderByComparator(BasePersistenceImpl.java:603)
at com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl.appendOrderByComparator(BasePersistenceImpl.java:583)
at com.liferay.asset.list.service.persistence.impl.AssetListEntrySegmentsEntryRelPersistenceImpl.findAll(AssetListEntrySegmentsEntryRelPersistenceImpl.java:3524)
at com.liferay.asset.list.service.persistence.impl.AssetListEntrySegmentsEntryRelPersistenceImpl.findAll(AssetListEntrySegmentsEntryRelPersistenceImpl.java:3469)
at com.liferay.asset.list.service.persistence.test.AssetListEntrySegme
@epgarcia
epgarcia / gist:6b75a460fb423e28f71635979035d686
Created February 19, 2018 09:28
Results Experiment with MeSH
pubmed: P-value for Cosine similarity: 0.13045559828886724
pubmed: P-value for Jaccard similarity: 0.05097589818052343
pubmed: P-value for Simon White similarity: 0.04875541884229425
disnet: P-value for Cosine similarity: 0.013325397869621879
disnet: P-value for Jaccard similarity: 0.017692082410809086
disnet: P-value for Simon White similarity: 0.010407490221588118
Same: P-value for Cosine similarity: 2.2089962894983994E-5
Same: P-value for Jaccard similarity: 9.541772000480971E-4
Same: P-value for Simon White similarity: 6.187622451270979E-5
@epgarcia
epgarcia / blog_image.ftl
Last active March 23, 2021 20:19
Get BlogEntry image in ADT (FTL)
<#assign
blogEntry = assetRenderer.getAssetObject()
coverImageURL = blogEntry.getCoverImageURL(themeDisplay)
/>
<!-- Cover Image (as background). The div must have some dimensions -->
<#if validator.isNotNull(coverImageURL)>
<div class="cover-image-container" style="background-image: url(${coverImageURL})"></div>
</#if>
diff --git a/content-targeting-api/src/main/java/com/liferay/content/targeting/util/UserSegmentUtil.java b/content-targeting-api/src/main/java/com/liferay/content/targeting/util/UserSegmentUtil.java
index 0bb2408a4..95c2d28a2 100644
--- a/content-targeting-api/src/main/java/com/liferay/content/targeting/util/UserSegmentUtil.java
+++ b/content-targeting-api/src/main/java/com/liferay/content/targeting/util/UserSegmentUtil.java
@@ -28,6 +28,7 @@
import com.liferay.portal.kernel.search.Indexer;
import com.liferay.portal.kernel.search.IndexerRegistryUtil;
import com.liferay.portal.kernel.service.ServiceContext;
+import com.liferay.portal.kernel.service.ServiceContextThreadLocal;
import com.liferay.portal.kernel.util.ArrayUtil;
<#if !entries?has_content>
<#if !themeDisplay.isSignedIn()>
${renderRequest.setAttribute("PORTLET_CONFIGURATOR_VISIBILITY", true)}
</#if>
<div class="alert alert-info">
<@liferay_ui["message"]
key="there-are-no-results"
/>
</div>
<#--
General concept: use ADT for list specific markup, and web content template for web content fields markup
Your Asset Publisher ADT:
-->
<#-- List your assets -->
<#if entries?has_content>
<#list entries as curEntry>
@epgarcia
epgarcia / gist:5809d17705d77fe9bcaaa315896811b2
Created July 11, 2017 09:20
Running build-app on 6.2.x/1.x
11:04 AM ~/Proyectos/Liferay/6.2.x/plugins [6.2.x * u=]
⤷ git log -1
commit 0e661cc70fda9e4db56dc8308b21daed788e725a
Author: Jeffrey Yang <[email protected]>
Date: Fri Jun 30 11:35:13 2017 -0700
LRIS-26877 Liferay Sync Connector changelog and hash
✔ 11:04 AM ~/Proyectos/Liferay/6.2.x/plugins [6.2.x * u=]
⤷ echo $JAVA_HOME
@epgarcia
epgarcia / sample.ftl
Last active January 11, 2022 16:54
Freemarker sample to iterate the portletPreferences variable on a Liferay Application Display Template
<#--
portletPreferences: Represents the preferences of the application that are used to display content
through this template. Use the map API of the selected template language to get the values of the
preferences.
-->
<#if portletPreferences?has_content>
<h1>Portlet Preferences</h1>
<ul>