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 S3FileController { | |
@AuraEnabled | |
public static string getFileUrl(string record) | |
{ | |
try | |
{ | |
List<FileStore__c> files=[SELECT S3ServerUrl__c,FileExtension__c FROM FileStore__c | |
where Id=:record]; | |
FileStore__c file=files[0]; | |
return file.S3ServerUrl__c; |
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 S3Controller { | |
@AuraEnabled | |
public static FileData GetS3FileUsingFileId(string recordId) | |
{ | |
String key = '**************'; | |
String secret = '*********************************'; | |
String bucket = 'salesforcecodex'; | |
String host = 's3-us-west-1.amazonaws.com'; | |
String method = 'GET'; |
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
<aura:component controller="GoogleAuthService" implements="lightning:isUrlAddressable,force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" > | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> | |
<aura:attribute name="accessToken" type="String" /> | |
<lightning:card title="Google Transcription"> | |
<lightning:button variant="brand" label="Authorize Google" title="Google Drive Auth" onclick="{! c.doAuth }" /> | |
</lightning:card> | |
</aura:component> |
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 MetadataService { | |
public static void UpdateCustomMetadata(string token) { | |
Metadata.CustomMetadata customMetadata = new Metadata.CustomMetadata(); | |
customMetadata.fullName = 'GoogleAuthSetting.AccessToken'; | |
customMetadata.label = 'AccessToken'; | |
customMetadata.protected_x = true; | |
Metadata.CustomMetadataValue accessToken = new Metadata.CustomMetadataValue(); | |
accessToken.field = 'AccessToken__c'; |
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
<aura:component controller="GoogleSpeechService" implements="lightning:isUrlAddressable,force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" > | |
<aura:attribute name="recordId" type="String"/> | |
<lightning:card title="Google Transcription"> | |
<lightning:button variant="brand" label="Convert Audio to Text" title="Convert Audio to Text" onclick="{! c.translate }" /> | |
<lightning:textarea name="translatedText" label="" value="Transcript Placeholder" /> | |
</lightning:card> | |
</aura:component> |
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
<aura:component controller="CommandController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" > | |
<aura:attribute name="commandText" type="string" /> | |
<lightning:card title="Capture Screen"> | |
<p> | |
<button id="start" onclick="{! c.takeScreenShot }">Start Capture</button> | |
<button id="stop">Stop Capture</button> | |
</p> | |
<div style="display: none;"> | |
<video id="video" autoplay="true"></video> |
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 without sharing class FileReader { | |
private static final String BASE_URL = URL.getSalesforceBaseUrl().toExternalForm(); | |
//Reterives all files of one case or account record | |
@AuraEnabled | |
public static List<FileData> GetEntityRecordFiles(string recordId) | |
{ | |
List<ContentDocumentLink> links=[SELECT ContentDocumentId,LinkedEntityId FROM ContentDocumentLink where LinkedEntityId=:recordId]; | |
Set<Id> ids=new Set<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
<aura:component | |
controller="FileReader" | |
implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" | |
access="global"> | |
<aura:attribute name="data" type="String" /> | |
<aura:attribute name="previewUrl" type="String" /> | |
<aura:attribute name="urlLink" type="String" /> | |
<aura:attribute name="recordId" type="String" /> | |
<aura:attribute name="files" type="object[]" /> | |
<aura:attribute name="file" type="object" /> |
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 EmailHelper { | |
public boolean sendErrorNotification(string jobId) | |
{ | |
Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage(); | |
message.toAddresses = new String[] { 'itops@salesforcecodex.com' }; | |
message.subject = 'Error in Job :' +jobId ; | |
message.htmlbody = 'Hello Admin, </br>There is error in job.</br> Please check</br></br>. Apex Job'; | |
Messaging.SingleEmailMessage[] messages = new List<Messaging.SingleEmailMessage> {message}; | |
Messaging.SendEmailResult[] results = Messaging.sendEmail(messages); | |
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 UpdateCaseQueuable implements Queueable { | |
public List<Case> caseList ; | |
public UpdateCaseQueuable(List<Case> cases){ | |
this.caseList = cases ; | |
} | |
public void execute(QueueableContext context) { | |
for(Case a :caseList){ | |
a.Description ='Updated from UpdateCaseQueuable'; | |
a.Status='Closed'; |