Skip to content

Instantly share code, notes, and snippets.

View amusarra's full-sized avatar

Antonio Musarra amusarra

View GitHub Profile
@amusarra
amusarra / EMAIL_HTML5_VIDEO.html
Created January 29, 2014 23:08
Simple test for video support in email using HTML5
<!DOCTYPE html><html>
<head>
<meta charset="UTF-8" />
<title>Video For Everybody Test Page</title>
<style type="text/css">
body {width: 640px; margin: 0 auto 20px;
font: 11px "Helvetica Neue", Arial, sans-serif; color: #3b3d3c;}
</style>
</head>
<body>
@amusarra
amusarra / HTTPSClientExampleAllOK.log
Last active August 29, 2015 13:56
HTTPS Client Example
2014-02-12 23:53:10,637 [main] INFO it.dontesta.blog.ssl.HTTPSClientExample - Try to connect to the URL https://www.goodreads.com/book/show/18734728-enterprise-integration-with-wso2-esb?from_search=true ...
2014-02-12 23:53:13,221 [main] INFO it.dontesta.blog.ssl.HTTPSClientExample - HTTP Response Code 200
2014-02-12 23:53:13,221 [main] INFO it.dontesta.blog.ssl.HTTPSClientExample - HTTP Response Message OK
2014-02-12 23:53:13,221 [main] INFO it.dontesta.blog.ssl.HTTPSClientExample - HTTP Content Length -1
2014-02-12 23:53:13,221 [main] INFO it.dontesta.blog.ssl.HTTPSClientExample - HTTP Content Type text/html; charset=utf-8
2014-02-12 23:53:13,221 [main] INFO it.dontesta.blog.ssl.HTTPSClientExample - HTTP Cipher Suite TLS_RSA_WITH_AES_256_CBC_SHA
2014-02-12 23:53:13,221 [main] INFO it.dontesta.blog.ssl.HTTPSClientExample - Certificate Type X.509
2014-02-12 23:53:13,222 [main] INFO it.dontesta.blog.ssl.HTTPSClientExample - Certificate Subject DN CN=*.goodreads.com, O=Goodreads, L=San Francisco, ST=Cal
@amusarra
amusarra / .htaccess
Last active August 29, 2015 13:56
SugarCRM 7.1 - Web Server Configuration
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Replace <basepath> with the relative web root path to your instance
RewriteBase /<basepath>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^rest/(.*)$ api/rest.php?__sugar_url=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
@amusarra
amusarra / SizeOfTheLiferayDocumentLibrary.sql
Created March 18, 2014 09:55
Size of the Liferay Document Library
SELECT DLFILEENTRY.REPOSITORYID,
(SUM(DLFILEENTRY.SIZE_) / 1048576) SIZE_MBYTE
FROM DLFILEENTRY
GROUP BY DLFILEENTRY.REPOSITORYID
ORDER BY SIZE_MBYTE;
@amusarra
amusarra / RESTfulTestBycURL.txt
Created March 19, 2014 23:25
Test RESTful Service by cURL
$ curl -v http://localhost:8080/services/horses.xml | xmllint --format -
$ curl -v http://localhost:8080/services/horses.json | jsonlint -
##
# XML Output
##
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<horses>
<count>3</count>
<horse>
@amusarra
amusarra / service.xml
Created March 28, 2014 09:55
Listato 1 Configurazione del Service Builder sul file service.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd">
<service-builder package-path="it.dontesta.shirus.labs.liferay.ws.example">
<author>amusarra</author>
<namespace>shirus_labs_liferay_ws_example</namespace>
<entity name="CustomUsers" local-service="true" remote-service="true">
</entity>
<exceptions>
<exception>UsersNotFound</exception>
</exceptions>
@amusarra
amusarra / CustomUsersLocalServiceImpl-partial.java
Created March 28, 2014 09:57
Listato 2 Implementazione del metodo getUsersCompanyByTagName per l’interfaccia locale.
public com.liferay.portal.model.UserSoap[] getUsersCompanyByTagName(long companyId, String tagName,
Integer userStatus, int start, int end) throws PortalException,
SystemException {
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
searchContext.setEntryClassNames(new String[] { User.class.getName() });
@amusarra
amusarra / CustomUsersServiceImpl-partial.java
Created March 28, 2014 09:59
Listato 3 Implementazione del metodo getUsersCompanyByTagName per l’interfaccia remota.
public UserSoap[] getUsersCompanyByTagName(long companyId, String tagName,
Integer userStatus, int start, int end) throws PortalException,
SystemException {
return CustomUsersLocalServiceUtil.getUsersCompanyByTagName(companyId, tagName, userStatus, start, end);
}
@amusarra
amusarra / TestGetUsersCompanyByTagNameService.java
Created March 28, 2014 09:59
Listato 4 Esempio di accesso al servizio SOAP tramite il client generato dall’SDK.
public class TestGetUsersCompanyByTagNameService {
static final String LIFERAY_USER_NAME = (System.getProperty("username") != null) ? System
.getProperty("username") : "test@liferay.com";
static final String LIFERAY_USER_PASSWORD = (System.getProperty("password") != null) ? System
.getProperty("username") : "test";
static final String USER_SERVICE = "Portal_UserService";
/**
@amusarra
amusarra / get-users-company-by-tag-name
Created March 28, 2014 10:00
Listato 5 Test del servizio JSON tramite curl.
curl http://localhost:8080/api/jsonws/ShirusLabsExampleServices-portlet.customusers/get-users-company-by-tag-name \
-u test@liferay.com:test \
-d companyId=10157 \
-d tagName='crm' \
-d userStatus=0 \
-d start=0 \
-d end=3