Skip to content

Instantly share code, notes, and snippets.

View rotty3000's full-sized avatar

Raymond Augé rotty3000

View GitHub Profile
@rotty3000
rotty3000 / query.java
Created July 31, 2013 15:57
use a StringQuery to set boost
Query stringQuery = StringQueryFactoryUtil.create("field:term^4");
BooleanClause clause = BooleanClauseFactoryUtil.create(searchContext, stringQuery, BooleanClauseOccur.SHOULD.toString());
searchContext.setBooleanClauses(new BooleanClause[] {clause});
@rotty3000
rotty3000 / web.xml
Created July 16, 2013 18:17
faces with fix
<?xml version="1.0"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<display-name>jsf2-portlet</display-name>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
@rotty3000
rotty3000 / SASSWrapper.java
Created July 12, 2013 20:21
from ruby to java via jrubyc
package com.liferay.portal.servlet.filters.dynamiccss;
import org.jruby.Ruby;
import org.jruby.RubyObject;
import org.jruby.javasupport.util.RuntimeHelpers;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.javasupport.JavaUtil;
import org.jruby.RubyClass;
@rotty3000
rotty3000 / add_bookmarks.js
Last active January 20, 2016 07:19
add bookmarks in Liferay via AUI
AUI().use('aui-io', function(A) {
var data = [];
if(confirm('add custom data?')) {
var start = prompt('start index');
var end = prompt('end index');
for (var i = start; i < end; i++) {
data.push('Bookmark' + i);
}
@@ -125,8 +125,8 @@ String onClick = GetterUtil.getString((String)request.getAttribute("liferay-ui:t
else {
if (values[i].equals("&raquo;")) {
- curURL = url + separator + param + "=" + values[0] + anchor;
+ curURL = url + separator + namespace + param + "=" + values[0] + anchor;
}
else {
- curURL = url + separator + param + "=" + values[i] + anchor;
+ curURL = url + separator + namespace + param + "=" + values[i] + anchor;
}
<target name="jar" depends="compile">
<if>
<not>
<uptodate targetfile="${jar.file}.jar">
<srcfiles dir="classes" includes="**/*.*"/>
</uptodate>
</not>
<then>
<if>
<available file="bnd.bnd" />
@rotty3000
rotty3000 / DataSourceWrapper.java.patch
Last active December 19, 2015 06:38
using the @SinceJava annotation
@@ -15,4 +15,6 @@
package com.liferay.portal.dao.jdbc.util;
+import com.liferay.portal.tools.sourceformatter.SinceJava;
+
import java.io.PrintWriter;
@@ -55,8 +57,6 @@ public class DataSourceWrapper implements DataSource {
}
@rotty3000
rotty3000 / TestJSONWebService.java
Created June 20, 2013 22:58
osgi + SRC + Liferay webservice
package com.liferay.test.jsonwebservice;
import aQute.bnd.annotation.component.Component;
import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
/**
* @author Raymond Augé
*/
@Component(
@rotty3000
rotty3000 / log.log
Created June 14, 2013 18:01
double execution of portlet
13:58:41,212 WARN [RuntimePageImpl-5][FileChecker:106] Attempted to read on file /home/rotty/AS/liferay-portal/tomcat-7.0.40/webapps/chat-portlet/css/main.css
13:58:41,216 WARN [RuntimePageImpl-5][RuntimeChecker:106] Attempted to get class loader
13:58:41,223 WARN [RuntimePageImpl-5][RuntimeChecker:106] Attempted to get class loader
13:58:41,962 WARN [RuntimePageImpl-5][RuntimeChecker:106] Attempted to get class loader
13:58:41,963 WARN [RuntimePageImpl-5][RuntimeChecker:106] Attempted to get class loader
13:58:41,966 WARN [RuntimePageImpl-5][RuntimeChecker:106] Attempted to get class loader
13:58:41,967 WARN [RuntimePageImpl-5][RuntimeChecker:106] Attempted to get class loader
13:58:41,968 WARN [RuntimePageImpl-5][RuntimeChecker:106] Attempted to get class loader
13:58:41,969 WARN [RuntimePageImpl-5][RuntimeChecker:106] Attempted to get class loader
13:58:41,970 WARN [RuntimePageImpl-5][RuntimeChecker:106] Attempted to get class loader
---------- portal-service/src/com/liferay/portal/model/BaseModel.java ----------
index 1845673..9865d28 100644
@@ -84,6 +84,15 @@ public interface BaseModel<T>
public boolean isNew();
/**
+ * Returns <code>true</code> if this model instance is the same instance
+ * which was returned from the create operation.
+ *
+ * @return <code>true</code> if this model is the same instance which was