Skip to content

Instantly share code, notes, and snippets.

YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {};
Y.mix(YUI.Env[Y.version].modules, {
"aui-base": {
"use": [
"oop",
"yui-throttle",
"aui-classnamemanager",
"aui-debounce",
"aui-base-core",
"aui-base-lang",
@eduardolundgren
eduardolundgren / gist:4260723
Created December 11, 2012 18:08
Liferay JSON Web Services (Object Composition)

Liferay JSON Web Services

JSON RPC

/jsonws/calendar-portlet/calendar/get-calendar/calendar-id/10466

Simple JavaScript API

protected void addCalendarJSONObject(
PortletRequest portletRequest, JSONArray jsonArray,
long classNameId, long classPK, String permissionAction)
throws PortalException, SystemException {
CalendarResource calendarResource =
CalendarResourceUtil.getCalendarResource(
portletRequest, classNameId, classPK);
if (calendarResource == null) {
@eduardolundgren
eduardolundgren / gist:4149429
Created November 26, 2012 17:12
XMLFormatter from Kaleo Designer
var STR_CHAR_CRLF = '\r\n';
var STR_BLANK = '';
var STR_CHAR_TAB = '\t';
var repeat = function(str, length) {
return new Array(length + 1).join(str);
};
var XMLUtil = {
REGEX_TOKEN_1: /(>)(<)(\/*)/g,
var ServiceUtil = {
invoke: function(payload, ioConfig) {
var instance = this;
if (ioConfig) {
if (!owns(ioConfig, 'cache') && REGEX_METHOD_GET.test(ioConfig.method)) {
ioConfig.cache = false;
}
if (Liferay.PropsValues.NTLM_AUTH_ENABLED && Liferay.Browser.isIe()) {
AUI.add(
'liferay-asset-categories-selector',
function(A) {
var Lang = A.Lang;
var AObject = A.Object;
var BOUNDING_BOX = 'boundingBox';
var CSS_TAGS_LIST = 'lfr-categories-selector-list';
Liferay = window.Liferay || {};
(function(A, Liferay) {
var Lang = A.Lang;
var owns = A.Object.owns;
Liferay.namespace = A.namespace;
A.mix(
<%--
/**
* Copyright (c) 2000-2012 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
DisjointSet = function(size) {
var instance = this,
parent_,
i;
size = instance.size = size || 0;
parent_ = instance.parent = new Uint32Array(size);
for (i = 0; i < size; i++) {
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js"></script>
</head>
<body>
<h1>Modules</h1>