This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Id, Name, Body FROM Attachment WHERE Id = '#[message.inboundProperties['id']]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.mule.sfdc2boxnet.transformer; | |
import java.util.List; | |
import java.util.Map; | |
import org.mule.api.MuleMessage; | |
import org.mule.api.transformer.TransformerException; | |
import org.mule.transformer.AbstractMessageTransformer; | |
import org.mule.transformer.codec.Base64Decoder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<sfdc:query config-ref="Salesforce" query="SELECT Id, Name, Body FROM Attachment WHERE Id = '#[message.inboundProperties['id']]'" /> | |
<choice> | |
<when expression="return ((ArrayList)payload).size > 0"> | |
<processor-chain> | |
<expression-transformer expression="return payload[0]"/> | |
<set-variable variableName="attachName" value="#[payload['name']]" /> | |
<set-payload value="#[payload['body']]" /> | |
<base64-decoder-transformer /> | |
<scripting:transformer doc:name="to InputStream"> | |
<scripting:script engine="Groovy"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
payload.getRowNumber() > 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<set-payload value="#[jxpath://cells[columnNumber = '2']/evaluatedValue]"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<google-calendars:get-events | |
config-ref="google-calendars" | |
calendarId="#[variable:googleUser]" | |
lastUpdated="#[variable:formatedLastSyncDate]" | |
showDeleted="true" | |
accessTokenId="#[variable:googleTokenId]" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="authorize" doc:name="authorize"> | |
<http:inbound-endpoint exchange-pattern="request-response" | |
host="localhost" port="8081" path="authorize" /> | |
<google-spreadsheets:authorize config-ref="google-spreadsheets" state="#[message.inboundProperties['user']]"/> | |
<scripting:transformer> | |
<scripting:script engine="Groovy"> | |
<scripting:text><![CDATA[ | |
org.mule.examples.google.sfdc2google.UserIdMapping mapping = new org.mule.examples.google.sfdc2google.UserIdMapping(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GoogleCalendarConnectorOAuthState implements Serializable | |
{ | |
public String accessToken; | |
public String authorizationUrl; | |
public String accessTokenUrl; | |
public String refreshToken; | |
/** | |
* Retrieves accessToken |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SharedOAuthTokenTransformer extends AbstractMessageTransformer { | |
private ObjectStore<Serializable> objectStore; | |
@Override | |
public Object transformMessage(MuleMessage message, String outputEncoding) throws TransformerException { | |
String accessTokenId = message.getInvocationProperty("OAuthAccessTokenId"); | |
if (StringUtils.isBlank(accessTokenId)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="authorize"> | |
<https:inbound-endpoint exchange-pattern="request-response" host="localhost" port="${https.port}" path="authorize"> | |
<google-calendars:authorize config-ref="google-calendars" /> | |
<logger message="Access token id is #[flowVars['OAuthAccessTokenId']]" /> | |
<transformer ref="shareOAuthStateTransformer" /> | |
</flow> |