View PagingSortingController.cls
global class PagingSortingController { | |
@AuraEnabled global static Account[] getAccounts() { | |
return [SELECT Name, Industry, AnnualRevenue FROM Account LIMIT 1000]; | |
} | |
} |
View AWS.apxc
public abstract class AWS { | |
// Post initialization logic (after constructor, before call) | |
protected abstract void init(); | |
// XML Node utility methods that will help read elements | |
public static Boolean getChildNodeBoolean(Dom.XmlNode node, String ns, String name) { | |
try { | |
return Boolean.valueOf(node.getChildElement(name, ns).getText()); | |
} catch(Exception e) { | |
return null; |
View AWS.cls
/* | |
// Example implementation as follows: | |
public class AWSS3_GetService extends AWS { | |
public override void init() { | |
endpoint = new Url('https://s3.amazonaws.com/'); | |
resource = '/'; | |
region = 'us-east-1'; | |
service = 's3'; | |
accessKey = 'my-key-here'; | |
method = HttpMethod.XGET; |
View Scheduled.apxc
public class Scheduled implements Schedulable { | |
@TestVisible static Boolean executed = false; | |
public void execute(SchedulableContext c) { | |
executed = true; | |
} | |
} |
View progressRing.cmp
<aura:component > | |
<aura:attribute name="value" type="Integer" default="0" /> | |
<aura:attribute name="variant" type="String" /> | |
<aura:attribute name="hasVariant" type="Boolean" access="private" default="{!false}" /> | |
<aura:attribute name="ringClass" type="String" access="private" /> | |
<aura:attribute name="iconName" type="String" access="private" /> | |
<aura:attribute name="altText" type="String" access="private" /> | |
<aura:handler name="init" value="{!this}" action="{!c.updateView}" /> |
View DragDrop.app
<aura:application > | |
<aura:attribute name="values" | |
type="String[]" | |
access="private" /> | |
<aura:attribute name="dragid" | |
type="Integer" | |
access="private" /> | |
<aura:handler name="init" | |
value="{!this}" | |
action="{!c.doInit}" /> |
View UpdateChangedFieldsController.cls
public class UpdateChangedFieldsController { | |
SObject oldRecord, currentRecord; | |
public UpdateChangedFieldsController(ApexPages.StandardController controller) { | |
oldRecord = controller.getRecord().clone(); | |
currentRecord = controller.getRecord(); | |
} | |
public PageReference saveChanges() { | |
SObject newClone = currentRecord.getSObjectType().newSObject(currentRecord.Id); | |
Map<String, Object> | |
oldValues = oldRecord.getPopulatedFieldsAsMap(), |
View AWSTranscribeExample.cls
public class AWSTranscribeExample extends AWS { | |
public override void init() { | |
endpoint = new Url('https://transcribe.us-west-2.amazonaws.com/'); | |
resource = '/'; | |
region = 'us-west-2'; | |
service = 'transcribe'; | |
accessKey = 'my-key-here'; | |
method = HttpMethod.XPOST; | |
payload = Blob.valueOf('{"LanguageCode": "en-US","Media": {"MediaFileUri": "S3 audio file link"},"MediaFormat": "mp4","MediaSampleRateHertz": 44100,"TranscriptionJobName": "SampleRestJob7"}'); | |
setHeader('x-amz-target','Transcribe.StartTranscriptionJob'); |
NewerOlder