Skip to content

Instantly share code, notes, and snippets.

View rotty3000's full-sized avatar

Raymond Augé rotty3000

View GitHub Profile
@rotty3000
rotty3000 / test.vm
Created December 16, 2011 20:50
log from velocity
#set ($logFactory = $portal.getClass().forName('com.liferay.portal.kernel.log.LogFactoryUtil'))
#set ($log = $logFactory.getLog('mylog'))
$log.error("Here!")
@rotty3000
rotty3000 / sql.patch
Created December 21, 2011 20:28
SQL differences between beat4 and trunk (RC-ish)
diff --git a/sql/portal-tables.sql b/sql/portal-tables.sql
index 01a01ca..1cf2ef6 100644
--- a/sql/portal-tables.sql
+++ b/sql/portal-tables.sql
@@ -224,7 +224,7 @@ create table BlogsEntry (
trackbacks TEXT null,
smallImage BOOLEAN,
smallImageId LONG,
- smallImageURL VARCHAR(75) null,
+ smallImageURL STRING null,
@rotty3000
rotty3000 / PortalImpl.java.patch
Created December 23, 2011 17:04
PHP Portlet sample portlet.xml file
@@ -1842,9 +1842,10 @@ public class PortalImpl implements Portal {
if (pos >= 0) {
host = host.substring(0, pos);
}
- }
- else {
- host = null;
+
+ if (!Validator.isDomain(host)) {
+ host = null;
@rotty3000
rotty3000 / navigation.vm
Created December 30, 2011 17:59
only show certain top pages in the navigation
<nav class="$nav_css_class" id="navigation">
<h1>
<span>#language("navigation")</span>
</h1>
<ul>
## CUSTOM LINE
#set ($topNavPages = ['/products','/support','/howtobuy','/events','/partners'])
#foreach ($nav_item in $nav_items)
#* @vtlvariable name="portletNamespace" type="java.lang.String" *#
#* @vtlvariable name="portal" type="com.liferay.portal.util.Portal" *#
#* @vtlvariable name="getterUtil" type="com.liferay.portal.kernel.util.GetterUtil" *#
#* @vtlvariable name="stringUtil" type="com.liferay.portal.kernel.util.StringUtil" *#
#* @vtlvariable name="max-members" type="com.liferay.portlet.journal.util.TemplateNode" *#
#* @vtlvariable name="team-name" type="com.liferay.portlet.journal.util.TemplateNode" *#
#* @vtlvariable name="section-members" type="com.liferay.portlet.journal.util.TemplateNode" *#
#* @vtlvariable name="groupId" type="java.lang.String" *#
#* @vtlvariable name="sectionMembers" type="java.lang.String" *#
#* @vtlvariable name="locale" type="java.util.Locale" *#
@rotty3000
rotty3000 / ex.jsp
Created January 9, 2012 14:45
auto complete
<aui:script use="aui-base,datasource-io,datasource-jsonschema,querystring-stringify-simple">
<portlet:resourceURL var="findUserURL">
<portlet:param name="action" value="findUser" />
</portlet:resourceURL>
var coachSearch = A.one('#<portlet:namespace />coachSearch'),
userDataSource = new A.DataSource.IO({
source: '<%= findUserURL %>'
}),
coachSearchCallbacks = {
@rotty3000
rotty3000 / liferay-web.xml
Created January 10, 2012 16:14
NTLM ignore upload requests
<filter>
<filter-name>SSO Ntlm Post Filter</filter-name>
<filter-class>com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter</filter-class>
<init-param>
<param-name>url-regex-ignore-pattern</param-name>
<!-- for 6.0.x, not sure about 6.1 -->
<param-value>^.*(p_p_id=20).*(_20_struts_action=%2Fdocument_library%2Fedit_file_entry).*(_20_cmd=add).*$</param-value>
</init-param>
</filter>
@rotty3000
rotty3000 / script.groovy
Created February 2, 2012 16:29
Delete a rogue file entry from the database properly using the portal's script console (groovy)
import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil
fileEntry = DLFileEntryLocalServiceUtil.getFileEntry(51189, '17101')
DLFileEntryLocalServiceUtil.deleteFileEntry(fileEntry)
@rotty3000
rotty3000 / index.html
Created February 15, 2012 16:12
display a portlet in a random location
<script src="http://localhost:8080/html/js/liferay/widget.js" type="text/javascript"></script>
<script type="text/javascript">
Liferay.Widget({ url: 'http://localhost:8080/widget/web/guest/home/-/{portletId}'});
</script>
@rotty3000
rotty3000 / extra-custom.css
Created February 18, 2012 00:25
justlift.ca extra css
/*
The old color #203d65
*/
.lfr-actions.portlet-options .lfr-trigger strong a {
text-indent: -9999px;
}
.opens-new-window-accessible {
display: none;