Skip to content

Instantly share code, notes, and snippets.

View fjunior87's full-sized avatar

Francisco Ribeiro Junior fjunior87

View GitHub Profile
<transportReceiver name="oracleaq" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="myQueueConnectionFactory" locked="false">
<parameter name="java.naming.factory.initial" locked="false">oracle.jms.AQjmsInitialContextFactory</parameter>
<parameter name="db_url" locked="false">[[Oracle_AQ_JDBC_URL]]</parameter>
<parameter name="java.naming.security.principal" locked="false">[[ORacle_AQ_D_bUser]]</parameter>
<parameter name="java.naming.security.credentials" locked="false">[[Oracle_AQ_DB_Password]]</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
</transportReceiver>
defmodule RomanNumerals do
@vals %{
"I" => 1,
"V" => 5,
"X" => 10,
"L" => 50,
"C" => 100,
"D" => 500,
"M" => 1000
@Component
@Service
public class ContactListAdapterFactory implements AdapterFactory{
@Property(name="adapters")
public static final String[] ADAPTER_CLASSES = {
ContactList.class.getName()
};
@Property(name="adaptables")
@Component
@Service
public class ContactAdapterFactory implements AdapterFactory{
@Property(name="adapters")
public static final String[] ADAPTER_CLASSES = {
Contact.class.getName()
};
@Property(name="adaptables")
<sling:adaptTo adaptable="${slingRequest}" adaptTo="com.xicojunior.contacts.models.ContactList" var="contactList" />
<ul class="list-group" id="contact-list">
<c:set var="contacts" value="${contactList.contacts}" />
<c:forEach var="contact" items="${contacts}" >
<li class="list-group-item">
<div class="col-xs-12 col-sm-3">
<c:if test="${not empty contact.contactImage }">
<img src="${contact.contactImage}" alt="${contact.name}" class="img-responsive img-circle">
</c:if>
</div>
<c:forEach var="contact" items="${contacts}" >
<sling:adaptTo adaptable="${contact}" adaptTo="com.xicojunior.contacts.models.Contact" var="contactProps" />
<li class="list-group-item">
<div class="col-xs-12 col-sm-3">
<c:if test="${not empty contactProps.contactImage }">
<img src="${contactProps.contactImage}" alt="${contactProps.name}" class="img-responsive img-circle">
</c:if>
</div>
<div class="col-xs-12 col-sm-9">
@fjunior87
fjunior87 / contact_form.html
Last active July 30, 2016 19:23
Simple Contact Form leveraging the Sling Post Servlet
<form action="/content/contactsapp/contacts/*" method="post" enctype="multipart/form-data">
<fieldset class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" placeholder="Enter your name" name="name">
</fieldset>
<fieldset class="form-group">
<label for="email">Email address</label>
<input type="email" class="form-control" id="email" placeholder="Enter email" name="email">
<small class="text-muted">We'll never share your email with anyone else.</small>
</fieldset>
@fjunior87
fjunior87 / smooks_conf.xml
Created July 17, 2016 00:14
Smooks Config with a not strict CSVParser
<?xml version="1.0" encoding="UTF-8"?>
<localEntry key="smooks_conf" xmlns="http://ws.apache.org/ns/synapse">
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
<!--Configure the CSVParser to parse the message into a stream of SAX events. -->
<resource-config selector="org.xml.sax.driver">
<resource>org.milyn.csv.CSVParser</resource>
<param name="fields" type="string-list">id,name,email,phone</param>
<param name="strict" type="boolean">false</param>
<param name="ident" type="boolean">true</param>
</resource-config>
@fjunior87
fjunior87 / smooks_conf.xml
Created July 16, 2016 23:52
Smooks Config using the CSVParser
<?xml version="1.0" encoding="UTF-8"?>
<localEntry key="smooks_conf" xmlns="http://ws.apache.org/ns/synapse">
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
<!--Configure the CSVParser to parse the message into a stream of SAX events. -->
<resource-config selector="org.xml.sax.driver">
<resource>org.milyn.csv.CSVParser</resource>
<param name="fields" type="string-list">id,name,email,phone</param>
<param name="ident" type="boolean">true</param>
</resource-config>
</smooks-resource-list>
@fjunior87
fjunior87 / CSVReadService.xml
Created July 16, 2016 23:28
Sample Proxy Service that reads a CSV File from file system and parses it using Smooks Mediator
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="CSVReadService" startOnLoad="true" trace="disable"
transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
<target>
<property name="OUT_ONLY" value="true"/>
<inSequence>
<smooks config-key="smooks_conf">
<input type="text"/>
<output type="xml"/>
</smooks>