Skip to content

Instantly share code, notes, and snippets.

View dedunumax's full-sized avatar

Dedunu Dhananjaya dedunumax

View GitHub Profile
@dedunumax
dedunumax / service-context.xml
Created March 4, 2015 11:51
service-context.xml for FileSizeWebScript
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
@dedunumax
dedunumax / .gitignore Alfresco
Last active August 29, 2015 14:16
Complete .gitignore for Alfresco Maven Projects
##########################
## Alfresco
##########################
**/alf_data_dev
**/solr_home
**/solr.log*
**/share.log*
**/alfresco.log*
##########################
<webscript>
<shortname>Java based Sample Webscript</shortname>
<description>This simple WebScript prints Hello World</description>
<url>/dedunu/helloworld</url>
<authentication>user</authentication>
<format default="html"></format>
</webscript>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
package org.dedunu.alfresco;
import java.util.HashMap;
import java.util.Map;
import org.springframework.extensions.webscripts.Cache;
import org.springframework.extensions.webscripts.DeclarativeWebScript;
import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.WebScriptRequest;
@dedunumax
dedunumax / JMeterIMAPTest.java
Last active August 29, 2015 14:18
JMeter code for IMAP Testing
import java.util.*;
import javax.mail.Folder;
import javax.mail.Session;
import javax.mail.Store;
Properties props = System.getProperties();
props.setProperty("mail.store.protocol","imap");
Session session = Session.getDefaultInstance(props, null);
try {
@dedunumax
dedunumax / IMAPTest.java
Last active August 29, 2015 14:18
List down all the folders using IMAP protocol.
package org.dedunu.imap;
import java.util.Properties;
import javax.mail.Folder;
import javax.mail.Session;
import javax.mail.Store;
public class IMAPTest {
public static void main(String []args) {
Properties props = System.getProperties();
@dedunumax
dedunumax / nextTuple.java
Created May 14, 2015 04:42
nextTuple() for Alfresco
@Override
public void nextTuple() {
if(listIterator!= null && listIterator.hasNext()) {
// Returning node by node
Map<String, Object> item = listIterator.next();
JSONObject jsonObject = new JSONObject();
for (Map.Entry<String, Object> mapEntry : item.entrySet()) {
jsonObject.put(mapEntry.getKey(), mapEntry.getValue());
}
@dedunumax
dedunumax / alfresco.log
Created May 14, 2015 10:07
Alfresco error log for soffice
2015-05-14 10:04:16,607 ERROR [repo.content.JodConverterSharedInstance] [localhost-startStop-1] Unable to start JodConverter library. The following error is shown for informational purposes only.
org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
at org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:68)
at org.artofsolving.jodconverter.office.PooledOfficeManager.start(PooledOfficeManager.java:101)
at org.artofsolving.jodconverter.office.ProcessPoolOfficeManager.start(ProcessPoolOfficeManager.java:66)
at org.alfresco.enterprise.repo.content.JodConverterSharedInstance.afterPropertiesSet(JodConverterSharedInstance.java:239)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1572)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1510)
at org.springframework.b