Skip to content

Instantly share code, notes, and snippets.

View lahirue's full-sized avatar

Lahiru J Ekanayake lahirue

View GitHub Profile
@lahirue
lahirue / ChunkyCache.gs
Created March 14, 2020 13:56 — forked from pilbot/ChunkyCache.gs
Using the Google Apps Script Cache Service for objects above 100Kb
function ChunkyCache(cache, chunkSize){
return {
put: function (key, value, timeout) {
var json = JSON.stringify(value);
var cSize = Math.floor(chunkSize / 2);
var chunks = [];
var index = 0;
while (index < json.length){
cKey = key + "_" + index;
chunks.push(cKey);
@lahirue
lahirue / ChunkyCache.gs
Created March 14, 2020 13:56 — forked from pilbot/ChunkyCache.gs
Using the Google Apps Script Cache Service for objects above 100Kb
function ChunkyCache(cache, chunkSize){
return {
put: function (key, value, timeout) {
var json = JSON.stringify(value);
var cSize = Math.floor(chunkSize / 2);
var chunks = [];
var index = 0;
while (index < json.length){
cKey = key + "_" + index;
chunks.push(cKey);
@lahirue
lahirue / WSO2 Carbon Component.xml
Created October 21, 2015 06:55
WSO2 Carbon Component.xml
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://products.wso2.org/carbon">
<menus>
<menu>
<id>TestServiceMenu</id>
<i18n-key>TestService.menu</i18n-key>
<i18n-bundle>org.wso2.carbon.testService.ui.i18n.Resources</i18n-bundle>
<parent-menu>manage_menu</parent-menu>
<link>../AnyName/MyPage.jsp</link>
<region>region1</region>
@lahirue
lahirue / WSO2 Carbon Component UI JSP Page with Back End Web Service
Created October 21, 2015 06:54
WSO2 Carbon Component UI JSP Page with Back End Web Service
<%@ page import="org.apache.axis2.context.ConfigurationContext"%>
<%@ page import="org.wso2.carbon.CarbonConstants"%>
<%@ page import="org.wso2.carbon.ui.CarbonUIUtil"%>
<%@ page import="org.wso2.carbon.utils.ServerConstants"%>
<%@ page import="org.wso2.carbon.ui.CarbonUIMessage"%>
<%@ page import="org.wso2.carbon.testService.ui.types.*"%>
<%@ page import="org.wso2.carbon.testService.ui.types.data.User"%>
<%@ page import="org.wso2.carbon.testService.ui.*"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"
@lahirue
lahirue / WSO2 Carbon Component UI Service Client
Created October 21, 2015 06:53
WSO2 Carbon Component UI Service Client
package org.wso2.carbon.testService.ui;
import java.rmi.RemoteException;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.ConfigurationContext;
import org.wso2.carbon.testService.ui.types.data.User;
public class UserClient {
@lahirue
lahirue / WSO2 Carbon Component UI with Back End Sevice pom.XML
Created October 21, 2015 06:51
WSO2 Carbon Component UI with Back End Sevice pom.XML
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.testService.ui</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
@lahirue
lahirue / Carbon Web Service data Package Class
Created October 21, 2015 06:49
Carbon Web Service data Package Class
package org.wso2.carbon.testService.data;
public class User {
private String name;
private int age;
public User() {
}
@lahirue
lahirue / WSO2 Carbon Component Web Service
Created October 21, 2015 06:48
WSO2 Carbon Component Web Service
package org.wso2.carbon.testService;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.List;
@lahirue
lahirue / WSO2 Carbon Component Service pom.XML
Created October 21, 2015 06:47
WSO2 Carbon Component Service pom.XML
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.testService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - TestService</name>
@lahirue
lahirue / Carbon Component UI Dependency
Created October 21, 2015 06:44
Carbon Component UI Dependency
<hideadminservicewsdls>false</hideadminservicewsdls>