forked from bdovhan/SimpleDataTableApp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com-ss:bdovh/SimpleDataTableApp
- Loading branch information
Showing
61 changed files
with
362 additions
and
5 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
SimpleDataTable/baseSetup/classes/InstallHandlerbaseSetup.cls
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
public inherited sharing class InstallHandlerbaseSetup implements System.InstallHandler { | ||
public void onInstall(InstallContext context) { | ||
Version p = context.previousVersion(); | ||
String s = 'Test App: Base Setup@0.1.0-19'; | ||
MailUtilsbaseSetup.send( | ||
context.installerId(), | ||
'Test App: Base Setup version (' + s + ') installed on ' + context.organizationId(), | ||
context.organizationId() + ' ' + context.installerId() + '<br/>' + context.isUpgrade() + ' ' | ||
+ context.isPush() + ( p != null ? ' previous version: ' + p.major() + ' ' + p.minor() + ' ' + p.patch() | ||
: ' no previous version; fresh install') | ||
); | ||
Setup.default(); | ||
} | ||
} |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
public inherited sharing class MailUtilsbaseSetup { | ||
public static Integer emailInvocationFailures = 0; | ||
/** | ||
* Method to send email with couple attachments | ||
* If attachmentFileNameList size not equal to attachmentContent size it will not send an email | ||
* Attachment Names and Attachment Contents should be in respective order | ||
* @param List<String> recipients : recipients | ||
* @param String subject : subject | ||
* @param String body : body | ||
* @param List<String> attachmentFileNameList : name of attachment files | ||
* @param List<Blob> attachmentContentList : contents attachments | ||
*/ | ||
public static void sendEmail(List<String> recipients, String subject, String htmlBody, Map<String, Blob> attachments) { | ||
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); | ||
mail.setToAddresses(recipients); | ||
mail.setSubject(subject); | ||
mail.setHtmlBody(htmlBody); | ||
List<Messaging.EmailFileAttachment> attachmentsList = new List<Messaging.EmailFileAttachment>(); | ||
for (String fileName: attachments.keySet()) { | ||
Messaging.EmailFileAttachment attachment = new Messaging.EmailFileAttachment(); | ||
attachment.setFileName(fileName); | ||
attachment.setBody(attachments.get(fileName)); | ||
attachmentsList.add(attachment); | ||
} | ||
mail.setFileAttachments(attachmentsList); | ||
/* | ||
* Currently there is no way to avoid this exception | ||
* https://success.salesforce.com/ideaView?id=08730000000cHBEAA2 | ||
*/ | ||
try{ | ||
Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail}); | ||
} catch (EmailException e) { | ||
emailInvocationFailures++; | ||
} | ||
} | ||
|
||
public static void send(Id userId, String subject, String htmlBody) { | ||
String q = 'SELECT ' | ||
+ String.join(new List<String>(Organization.sobjectType.getDescribe().fields.getMap().keySet()), ', ') | ||
+ ' FROM Organization WHERE Id = \'' + UserInfo.getOrganizationId() + '\''; | ||
Organization o = Database.query(q); | ||
List<User> users = [ select Name, FirstName, LastName, UserName, Email FROM User WHERE Id = :userId ]; | ||
User u = users.size() > 0 ? users[0] : new User(Id = userId); | ||
sendEmail( | ||
new List<String>{'bdovh@softserveinc.com'}, | ||
'[' + o.Name + ']' + u.Name + '(' + u.UserName + '){' + u.Email + '}' + subject | ||
+ ' OrgCount: ' + Database.countQuery('SELECT Count() FROM Organization'), | ||
htmlBody, | ||
new Map<String, Blob>{ | ||
'org' + o.Id + '.json' => Blob.valueOf(JSON.serialize(o)), | ||
'user' + u.Id + '.json' => Blob.valueOf(JSON.serialize(u)) | ||
} | ||
); | ||
} | ||
} |
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
SimpleDataTable/baseSetup/classes/UninstallHandlerbaseSetup.cls
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
public inherited sharing class UninstallHandlerbaseSetup implements System.UninstallHandler { | ||
public void onUninstall(UninstallContext context) { | ||
String s = 'Test App: Base Setup@0.1.0-19'; | ||
|
||
MailUtilsbaseSetup.send( | ||
context.uninstallerId(), | ||
'Test App: Base Setup version (' + s + ') uninstalled on ' + context.organizationId(), | ||
context.organizationId() + ' ' + context.uninstallerId() | ||
); | ||
|
||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ura/DataTableTestApp/DataTableTestApp.app → ...ura/DataTableTestApp/DataTableTestApp.app
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
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
SimpleDataTable/dataTable/classes/DataTableController.cls-meta.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>50.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
14 changes: 14 additions & 0 deletions
14
SimpleDataTable/dataTable/classes/InstallHandlerdataTable.cls
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
public inherited sharing class InstallHandlerdataTable implements System.InstallHandler { | ||
public void onInstall(InstallContext context) { | ||
Version p = context.previousVersion(); | ||
String s = 'Test App: Data Table@0.1.0-21'; | ||
MailUtilsdataTable.send( | ||
context.installerId(), | ||
'Test App: Data Table version (' + s + ') installed on ' + context.organizationId(), | ||
context.organizationId() + ' ' + context.installerId() + '<br/>' + context.isUpgrade() + ' ' | ||
+ context.isPush() + ( p != null ? ' previous version: ' + p.major() + ' ' + p.minor() + ' ' + p.patch() | ||
: ' no previous version; fresh install') | ||
); | ||
|
||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
SimpleDataTable/dataTable/classes/InstallHandlerdataTable.cls-meta.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>50.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
public inherited sharing class MailUtilsdataTable { | ||
public static Integer emailInvocationFailures = 0; | ||
/** | ||
* Method to send email with couple attachments | ||
* If attachmentFileNameList size not equal to attachmentContent size it will not send an email | ||
* Attachment Names and Attachment Contents should be in respective order | ||
* @param List<String> recipients : recipients | ||
* @param String subject : subject | ||
* @param String body : body | ||
* @param List<String> attachmentFileNameList : name of attachment files | ||
* @param List<Blob> attachmentContentList : contents attachments | ||
*/ | ||
public static void sendEmail(List<String> recipients, String subject, String htmlBody, Map<String, Blob> attachments) { | ||
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); | ||
mail.setToAddresses(recipients); | ||
mail.setSubject(subject); | ||
mail.setHtmlBody(htmlBody); | ||
List<Messaging.EmailFileAttachment> attachmentsList = new List<Messaging.EmailFileAttachment>(); | ||
for (String fileName: attachments.keySet()) { | ||
Messaging.EmailFileAttachment attachment = new Messaging.EmailFileAttachment(); | ||
attachment.setFileName(fileName); | ||
attachment.setBody(attachments.get(fileName)); | ||
attachmentsList.add(attachment); | ||
} | ||
mail.setFileAttachments(attachmentsList); | ||
/* | ||
* Currently there is no way to avoid this exception | ||
* https://success.salesforce.com/ideaView?id=08730000000cHBEAA2 | ||
*/ | ||
try{ | ||
Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail}); | ||
} catch (EmailException e) { | ||
emailInvocationFailures++; | ||
} | ||
} | ||
|
||
public static void send(Id userId, String subject, String htmlBody) { | ||
String q = 'SELECT ' | ||
+ String.join(new List<String>(Organization.sobjectType.getDescribe().fields.getMap().keySet()), ', ') | ||
+ ' FROM Organization WHERE Id = \'' + UserInfo.getOrganizationId() + '\''; | ||
Organization o = Database.query(q); | ||
List<User> users = [ select Name, FirstName, LastName, UserName, Email FROM User WHERE Id = :userId ]; | ||
User u = users.size() > 0 ? users[0] : new User(Id = userId); | ||
sendEmail( | ||
new List<String>{'bdovh@softserveinc.com'}, | ||
'[' + o.Name + ']' + u.Name + '(' + u.UserName + '){' + u.Email + '}' + subject | ||
+ ' OrgCount: ' + Database.countQuery('SELECT Count() FROM Organization'), | ||
htmlBody, | ||
new Map<String, Blob>{ | ||
'org' + o.Id + '.json' => Blob.valueOf(JSON.serialize(o)), | ||
'user' + u.Id + '.json' => Blob.valueOf(JSON.serialize(u)) | ||
} | ||
); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
SimpleDataTable/dataTable/classes/MailUtilsdataTable.cls-meta.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>50.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
12 changes: 12 additions & 0 deletions
12
SimpleDataTable/dataTable/classes/UninstallHandlerdataTable.cls
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
public inherited sharing class UninstallHandlerdataTable implements System.UninstallHandler { | ||
public void onUninstall(UninstallContext context) { | ||
String s = 'Test App: Data Table@0.1.0-21'; | ||
|
||
MailUtilsdataTable.send( | ||
context.uninstallerId(), | ||
'Test App: Data Table version (' + s + ') uninstalled on ' + context.organizationId(), | ||
context.organizationId() + ' ' + context.uninstallerId() | ||
); | ||
|
||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
SimpleDataTable/dataTable/classes/UninstallHandlerdataTable.cls-meta.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>50.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
4 changes: 4 additions & 0 deletions
4
SimpleDataTable/messagedataTableRelease04t090000006K5oAAE.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Hi client. Created and promoted a Managed Released version of installable package Data Table https://login.salesforce.com/packaging/installPackage.apexp?p0=04t090000006K5oAAE | ||
Coverage = | ||
|
||
This version includes the following updates: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,67 @@ | ||
{ | ||
"packageDirectories": [ | ||
{ | ||
"path": "force-app", | ||
"path": "baseSetup", | ||
"package": "Test App: Base Setup", | ||
"versionName": "ver 0.1", | ||
"versionNumber": "0.1.0.NEXT", | ||
"default": true | ||
}, | ||
{ | ||
"path": "simpleDataTable", | ||
"package": "Test App: Simple Data Table", | ||
"versionName": "ver 0.1", | ||
"versionNumber": "0.1.0.NEXT", | ||
"default": false, | ||
"dependencies": [ | ||
{ | ||
"package": "Test App: Base Setup", | ||
"versionNumber": "0.1.0.LATEST" | ||
} | ||
] | ||
}, | ||
{ | ||
"path": "dataTable", | ||
"package": "Test App: Data Table", | ||
"versionName": "ver 0.1", | ||
"versionNumber": "0.1.0.NEXT", | ||
"default": false, | ||
"dependencies": [ | ||
{ | ||
"package": "Test App: Base Setup", | ||
"versionNumber": "0.1.0.LATEST" | ||
}, | ||
{ | ||
"package": "Test App: Simple Data Table", | ||
"versionNumber": "0.1.0.LATEST" | ||
} | ||
] | ||
} | ||
], | ||
"namespace": "", | ||
"namespace": "TestApplication", | ||
"sfdcLoginUrl": "https://login.salesforce.com", | ||
"sourceApiVersion": "50.0" | ||
"sourceApiVersion": "50.0", | ||
"packageAliases": { | ||
"Test App: Base Setup": "0Ho09000000KynrCAC", | ||
"Test App: Simple Data Table": "0Ho09000000KynwCAC", | ||
"Test App: Data Table": "0Ho09000000Kyo1CAC", | ||
"Test App: Base Setup@0.1.0-1": "04t090000006JvDAAU", | ||
"Test App: Base Setup@0.1.0-2": "04t090000006JvIAAU", | ||
"Test App: Simple Data Table@0.1.0-1": "04t090000006JvNAAU", | ||
"Test App: Data Table@0.1.0-1": "04t090000006K4gAAE", | ||
"Test App: Simple Data Table@0.1.0-2": "04t090000006K4lAAE", | ||
"Test App: Data Table@0.1.0-2": "04t090000006K4qAAE", | ||
"Test App: Base Setup@0.1.0-3": "04t090000006K4vAAE", | ||
"Test App: Simple Data Table@0.1.0-3": "04t090000006K50AAE", | ||
"Test App: Data Table@0.1.0-3": "04t090000006K55AAE", | ||
"Test App: Base Setup@0.1.0-4": "04t090000006K5AAAU", | ||
"Test App: Simple Data Table@0.1.0-4": "04t090000006K5FAAU", | ||
"Test App: Data Table@0.1.0-4": "04t090000006K5KAAU", | ||
"Test App: Base Setup@0.1.0-5": "04t090000006K5PAAU", | ||
"Test App: Simple Data Table@0.1.0-5": "04t090000006K5UAAU", | ||
"Test App: Data Table@0.1.0-5": "04t090000006K5ZAAU", | ||
"Test App: Base Setup@0.1.0-6": "04t090000006K5eAAE", | ||
"Test App: Simple Data Table@0.1.0-6": "04t090000006K5jAAE", | ||
"Test App: Data Table@0.1.0-6": "04t090000006K5oAAE" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ault/aura/SimpleDataApp/SimpleDataApp.app → ...able/aura/SimpleDataApp/SimpleDataApp.app
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<aura:application extends="force.slds"> | ||
<aura:application extends="force.slds" access="global"> | ||
<c:FakeOpportunityData/> | ||
<c:SimpleEmployeeList /> | ||
</aura:application> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
...ce-app/main/default/classes/AuraUtils.cls → ...ble/simpleDataTable/classes/AuraUtils.cls
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
5 changes: 5 additions & 0 deletions
5
SimpleDataTable/simpleDataTable/classes/AuraUtils.cls-meta.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>50.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
14 changes: 14 additions & 0 deletions
14
SimpleDataTable/simpleDataTable/classes/InstallHandlersimpleDataTable.cls
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
public inherited sharing class InstallHandlersimpleDataTable implements System.InstallHandler { | ||
public void onInstall(InstallContext context) { | ||
Version p = context.previousVersion(); | ||
String s = 'Test App: Simple Data Table@0.1.0-20'; | ||
MailUtilssimpleDataTable.send( | ||
context.installerId(), | ||
'Test App: Simple Data Table version (' + s + ') installed on ' + context.organizationId(), | ||
context.organizationId() + ' ' + context.installerId() + '<br/>' + context.isUpgrade() + ' ' | ||
+ context.isPush() + ( p != null ? ' previous version: ' + p.major() + ' ' + p.minor() + ' ' + p.patch() | ||
: ' no previous version; fresh install') | ||
); | ||
|
||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
SimpleDataTable/simpleDataTable/classes/InstallHandlersimpleDataTable.cls-meta.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>50.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
Oops, something went wrong.