Skip to content

Instantly share code, notes, and snippets.

View nialdarbey's full-sized avatar

Nial Darbey nialdarbey

View GitHub Profile
<pivotal-tracker:config name="pivotalTrackerConnector" trackerToken="${connector.token}" storiesUrl="${connector.stories.url}" username="" password="" />
package com.mulesoft.se.wikigenerator.model;
global org.mule.module.bpm.MessageService mule;
dialect "mvel"
rule "When elements and the complexTypes they refer to in their 'type' attribute are found, then wrap them and put them back on Mule"
lock-on-active
when
$elementDocument : DefaultDocument ( $element : rootElement, $element.qName.name == "element" )
$complexTypeDocument : DefaultDocument ( $complexType : rootElement, $complexType.qName.name == "complexType", name == $elementDocument.name )
<xsd:element name="sub-flow" type="subFlowType">
<xsd:annotation>
<xsd:documentation>
A chain of message processors processed synchronously that can be referenced and reused.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="subFlowType">
<xsd:complexContent>
<xsd:extension base="annotatedType">
when
$elementDocument : DefaultDocument ( $element : rootElement, $element.qName.name == "element" )
not ( Attribute ( qName.name == "type" ) from $element.attributes )
then
ElementSummary elementSummary = new ElementSummary($elementDocument, null);
Map map = new HashMap();
map.put("schemaName", $elementDocument.getName());
mule.generateMessage("vm://queue.elements", elementSummary, map, MessageExchangePattern.ONE_WAY);
end
<project name="hello" default="deploy">
<taskdef resource="org/mule/mulePackagingTasks.properties" />
<property name="dir.java" value="src" />
<property name="dir.conf" value="conf" />
<property name="dir.build" value="target" />
<property name="dir.classes" value="${dir.build}/classes" />
<property name="app.name" value="nialdarbey" />
<property name="app.jar" value="${dir.build}/${app.name}.jar" />
private String cloudHubUrl = "https://cloudhub.io";
@Override
public void execute() throws BuildException {
FileChecker checker = new FileChecker(getLocation());
checker.checkFile(applicationFile, "application file", false, false);
try {
Client client = Client.create();
client.addFilter(new HTTPBasicAuthFilter(username, password));
WebResource webResource = client.resource(cloudHubUrl);
<cloudHubDeploy username="myUsername" password="myPassword" domain="${app.name}" applicationFile="${app.file}" />
@nialdarbey
nialdarbey / gist:3886925
Created October 14, 2012 01:38
devkit sample
<!-- BEGIN_INCLUDE(ldap:search-1) -->
<!-- Case 1: Simple SUB_TREE search -->
<ldap:search baseDn="ou=people,dc=mulesoft,dc=org" filter="(&amp;(objectClass=person)(sn=Doe))" scope="SUB_TREE"/>
<!-- END_INCLUDE(ldap:search-1) -->
@nialdarbey
nialdarbey / gist:3886931
Created October 14, 2012 01:40
devkit sample ref
/**
* Performs a LDAP search returning a list with all the resulting LDAP entries.
* <p/>
* For queries returning large results it is recommended to use pagination (not all LDAP servers support this or are configured to support it).
* For that you need to provide a page size value that should be less or equal than max results (count limit). If you are getting a
* Sizelimit Exceeded exception then you should check that the authenticated user has enough privileges or the LDAP server is not
* limited by configuration.
* <p/>
* <h4>Returning all attributes for all persons that have Doe as surname</h4>
* {@sample.xml ../../../doc/mule-module-ldap.xml.sample ldap:search-1}
@nialdarbey
nialdarbey / gist:3886935
Created October 14, 2012 01:43
devkit connect
@Connector(name = "ldap", schemaVersion = "3.3", friendlyName="LDAP", minMuleVersion="3.2.0", description="LDAP Connector that allows you to connect to any LDAP server and perform every LDAP operation")