Skip to content

Instantly share code, notes, and snippets.

View alexed1's full-sized avatar

Alex Edelstein alexed1

View GitHub Profile
@alexed1
alexed1 / gist:512abc577a6efcda2842b79101905304
Created October 20, 2017 00:35
main component controller
({
onCometdLoaded : function(component, event, helper) {
var cometd = new org.cometd.CometD();
component.set('v.cometd', cometd);
if (component.get('v.sessionId') != null)
helper.connectCometd(component);
},
handleAcceptClick: function(component, event, helper) {
({
publishRecommendationRequest : function(component, event, helper) {
//Add callback behavior
//
console.log("inside publishRecommendationRequest");
this.callApex('c.pubRecommendationRequest','successfully sent Recommendation Request',component);
},
//centralize the mechanism for calling Apex
callApex : function(methodName, successMethod, component){
@alexed1
alexed1 / gist:0ec54f8e4d801c3c257ad26daec9455b
Created October 20, 2017 00:37
main component apex controller
public with sharing class NBAComponentController {
@AuraEnabled
public static String getSessionId() {
return UserInfo.getSessionId();
}
@AuraEnabled
@future
public static void launchFlow() {
<?xml version="1.0" encoding="UTF-8"?>
<RecommendationStrategy xmlns="http://soap.sforce.com/2006/04/metadata">
<description>Telecom Call-in Strategy</description>
<recommendationStrategyName>telecomCallin</recommendationStrategyName>
<masterLabel>SomeMasterLabel</masterLabel>
<!-- Root -->
<strategyNode>
<name>RootNode</name>
<description>the root</description>
<aura:component implements="flexipage:availableForAllPageTypes,flowruntime:availableForLocalInvocableActions,lightning:availableForFlowScreens" access="global">
<!-- input variables used to tell this component which things to make visible -->
<aura:attribute name="visibility_Dickens" type="Boolean" default="false"/>
<aura:attribute name="visibility_Austen" type="Boolean" default="false"/>
<aura:attribute name="visibility_Sailor" type="Boolean" default="false"/>
<!-- output variables used to pass checkbox values back to the Flow -->
<aura:attribute name="checkbox_Marthambles" type="Boolean" default="false"/>
<aura:attribute name="checkbox_Boodwrights_Canker" type="Boolean" default="false"/>
<aura:component implements="flexipage:availableForAllPageTypes,flowruntime:availableForLocalInvocableActions,lightning:availableForFlowScreens" access="global">
<aura:attribute name="foo" type="String[]" default="false"/>
<!-- input variables used to tell this component which things to make visible -->
<aura:attribute name="visibility_Dickens" type="Boolean" default="false"/>
<aura:attribute name="visibility_Austen" type="Boolean" default="false"/>
<aura:attribute name="visibility_Sailor" type="Boolean" default="false"/>
<!-- output variables used to pass checkbox values back to the Flow -->
<?xml version="1.0" encoding="UTF-8"?>
<RecommendationStrategy xmlns="http://soap.sforce.com/2006/04/metadata">
<description>Softbank Call-in Strategy</description>
<recommendationStrategyName>softbank_1</recommendationStrategyName>
<masterLabel>SomeMasterLabel</masterLabel>
<!-- Root -->
<strategyNode>
<name>RootNode</name>
<description>the root</description>
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>RecommendationStrategy</name>
</types>
<version>42.0</version>
</Package>
FROM debian:jessie
RUN apt-get update -y
RUN apt-get install -y git
RUN apt-get install -y curl
RUN apt-get install -y vim
RUN apt-get install -y tcpdump
RUN apt-get install -y screen
RUN apt-get install -y nano
<aura:component >
<aura:handler event="c:myEvent" action="{!c.handleMyEvent}"/>
I'm a child component
</aura:component>