Skip to content

Instantly share code, notes, and snippets.

View martinlau's full-sized avatar

Martin Lau martinlau

View GitHub Profile
@martinlau
martinlau / SiteCreator.java
Last active May 23, 2017 08:02
Sample code to create a site in liferay (don't do this)
public class SiteCreator {
public static void createGroup() throws Exception {
// Don't do this!
long groupId = CounterLocalServiceUtil.increment(Group.class.getName());
Group group = GroupLocalServiceUtil.createGroup(groupId);
group.setName("Test Site");
@martinlau
martinlau / GroupLocalServiceImpl.java
Last active December 10, 2015 20:49
GroupLocalServiceImpl snippet
/**
* Adds a group.
*
* @param userId the primary key of the group's creator/owner
* @param parentGroupId the primary key of the parent group
* @param className the entity's class name
* @param classPK the primary key of the entity's instance
* @param liveGroupId the primary key of the live group
* @param name the entity's name
* @param description the group's description (optionally
@martinlau
martinlau / keybase.md
Created September 23, 2014 05:02
keybase.md

Keybase proof

I hereby claim:

  • I am martinlau on github.
  • I am msl (https://keybase.io/msl) on keybase.
  • I have a public key whose fingerprint is 7682 47A7 93C4 0F6C 3BCC 7816 E4D1 D636 209A D697

To claim this, I am signing this object: