Skip to content

Instantly share code, notes, and snippets.

View amusarra's full-sized avatar

Antonio Musarra amusarra

View GitHub Profile
@amusarra
amusarra / lportal.sh
Created February 22, 2012 22:30
Liferay Portal Profile Script
# /etc/profile.d/lportal.sh
JAVA_HOME="/usr/java/jdk1.6.0_29"
JAVA_BIN="${JAVA_HOME}/bin"
LIFERAY_HOME="/app/liferay-portal-6.0.6"
JBOSS_HOME="${LIFERAY_HOME}/jboss-5.1.0"
JBOSS_USER=liferay
JBOSS_BIND_ADDR="0.0.0.0"
JBOSS_HOST="0.0.0.0"
@amusarra
amusarra / lportal.sh
Created February 22, 2012 22:32
Liferay Portal JBoss Init Script
#!/bin/sh
#
# $Id: jboss_init_redhat.sh 81068 2008-11-14 15:14:35Z dimitris@jboss.org $
#
# JBoss Control Script
#
# To use this script run it as root - it will switch to the specified user
#
# Here is a little (and extremely primitive) startup/shutdown script
# for RedHat systems. It assumes that JBoss lives in /usr/local/jboss,
@amusarra
amusarra / portal-ext.properties
Created October 16, 2012 08:16
Configuration portal-ext.properties for iFrame Portlet
##
## IFrame Portlet
##
#
# Specify a role name that a user must be associated with in order to
# configure the IFrame portlet to use the @password@ token. This token is
# used to post the password of users who access this portlet in order to
# automatically login to the framed site.
#
@amusarra
amusarra / IFrameUtil.java
Created October 16, 2012 08:20
Method getPassword of the class com.liferay.portlet.iframe.util.IFrameUtil
public static String getPassword(
PortletRequest portletRequest, String password)
throws PortalException, SystemException {
if (!isPasswordTokenEnabled(portletRequest)) {
return StringPool.BLANK;
}
if (Validator.isNull(password) || password.equals("@password@")) {
password = PortalUtil.getUserPassword(portletRequest);
@amusarra
amusarra / pom.xml
Created October 18, 2012 10:53
LiferayHookSugarCRM - Maven Liferay 6.1 Hook Example
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>it.dontesta.liferay.hook.sugarcrm</groupId>
<artifactId>liferay-hook-sugarcrm</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>LiferayHookSugarCRM</name>
<description>Maven Liferay 6.1 Hook Example</description>
@amusarra
amusarra / SimpleClientTest.java
Created October 31, 2012 08:54
SugarCRM Community Edition 6.4 (v4 API) SOAP Client - Maven Test
/**
*
*/
package it.shirus.labs.sugarcrm.client.soap;
import static org.junit.Assert.*;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.math.BigInteger;
@amusarra
amusarra / WebFormToLead.htm
Created March 20, 2013 15:43
SugarCRM Web form to lead.
<html lang='en_us'><body><script type="text/javascript" src="http://sugarcrmpgsql-shiruslabs.rhcloud.com/cache/include/javascript/sugar_grp1.js?v=QMfyElAturj9vuK-tY9lzw"></script>
<script type="text/javascript" src="http://sugarcrmpgsql-shiruslabs.rhcloud.com/cache/include/javascript/calendar.js?v=QMfyElAturj9vuK-tY9lzw"></script>
<form id="WebToLeadForm" action="http://sugarcrmpgsql-shiruslabs.rhcloud.com/index.php?entryPoint=WebToLeadCapture" method="POST" name="WebToLeadForm">
<table style="border-top-width: 1px; border-top-style: solid; border-bottom-width: 1px; border-bottom-style: solid; padding: 10px 6px 12px 10px; background-color: #e9f3ff; font-size: 12px; width: 100%; background-position: 50% 0%; background-repeat: repeat no-repeat;">
<tbody>
<tr style="color: #0069e1; font-family: Arial,Verdana,Helvetica,sans-serif; font-size: 18px; font-weight: bold; margin-bottom: 0px; margin-top: 0px;" align="center">
<td colspan="4">
<h2>Web to lead form for Campaign</h2>
</td>
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SugarCRMProxy"
transports="http"
statistics="enable"
trace="enable"
startOnLoad="true">
<target>
<outSequence>
<send/>
@amusarra
amusarra / getRelateDocument.php
Created September 4, 2013 13:21
Get Relate documents of Account
<?php
$url = "http://localhost:8888/sugarcrm_dev_WebServices/service/v4_1/rest.php";
$username = "admin";
$password = "admin";
//function to make cURL request
function call($method, $parameters, $url)
{
ob_start();
$curl_request = curl_init();
@amusarra
amusarra / SugarCRMProxyLBAccessForbidden.xml
Created September 8, 2013 20:37
Configuration WSO2 ESB Mediation Sequence SugarCRMProxyLBAccessForbidden
<sequence xmlns="http://ws.apache.org/ns/synapse" name="SugarCRMProxyLBAccessForbidden" trace="enable">
<makefault version="soap11">
<code xmlns:soap11Env="http://schemas.xmlsoap.org/soap/envelope/" value="soap11Env:VersionMismatch"/>
<reason value="403.6 - IP address rejected. Status code in response to a request from a client for a web page or resource to indicate that the server can be reached and understood the request, but refuses to take any further action. "/>
<role></role>
</makefault>
<send/>
</sequence>