Skip to content

Instantly share code, notes, and snippets.

View marcellustavares's full-sized avatar

Marcellus Tavares marcellustavares

View GitHub Profile
@marcellustavares
marcellustavares / user_template.vm
Created January 19, 2012 20:27
User List Template
## Get the reference of DDL Record Service via serviceLocator, which is automatically set in the context
#set ($ddlRecordService = $serviceLocator.findService('com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService'))
## $reserved_record_set_id is also an object set in the context and it has the value of the list id configured for the portlet instance
#set ($recordSetId = $getterUtil.getInteger($reserved_record_set_id.data, 0))
## call to the retrieve all records of the list
/**
* Copyright (c) 2000-2013 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
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
@marcellustavares
marcellustavares / gist:5702042
Created June 3, 2013 22:33
Close Pull Request with Diff
def close_pull_request(repo_name, pull_request_ID, comment = None):
default_comment = options['close-default-comment']
if comment is None:
comment = default_comment
if comment is None or comment == default_comment:
try:
f = open(get_tmp_path('git-pull-request-treeish-%s' % pull_request_ID), 'r')
branch_info = json.load(f)
@marcellustavares
marcellustavares / gist:6380587
Created August 29, 2013 16:51
TabView unit tests
YUI.add('module-tests', function(Y) {
//--------------------------------------------------------------------------
// AUI TabView Unit Tests
//--------------------------------------------------------------------------
var suite = new Y.Test.Suite('aui-tabview'),
tabView;
tabView = new Y.TabView({
@marcellustavares
marcellustavares / gist:ad170c2ca66ecd3ce0a6
Created June 3, 2014 19:31
Kaleo-web deployment on liferay-portal-ee 7.0.x
Exception in thread "liferay/hot_deploy-2" java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/catalina/loader/WebappClassLoader) previously initiated loading for a different type with name "com/liferay/portal/kernel/dao/orm/ActionableDynamicQuery"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
[
{
"autoGeneratedName":false,
"width":"50",
"localizable":"true",
"label":"Company",
"type":"text",
"tip":"",
"hiddenAttributes":[
"readOnly"
@marcellustavares
marcellustavares / gist:1ae00dd1919fa5df3363
Created December 4, 2014 14:22
TemplateManager Registry
/**
* 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
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
/**
* 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
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
java.lang.InstantiationException: com.liferay.portlet.dynamicdatamapping.query.impl.DDMFormValuesQueryImpl
at java.lang.Class.newInstance0(Class.java:357)
at java.lang.Class.newInstance(Class.java:325)
at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:253)
at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:127)
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:871)
at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:838)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:850)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:419)
at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:376)
Bundle-Name: Liferay DDM Query
Bundle-SymbolicName: com.liferay.dynamicdatamapping.query
Bundle-Version: 1.0.0
Import-Package:\
!javax.swing.*,\
!javax.imageio.*,\
!javax.print.*,\
!org.antlr.*,\
!org.stringtemplate.*,\
*