This repository has been archived by the owner on Jul 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
Conflicts: lib/mm_response_handlers.py mavensmate.py mavensmate.sublime-settings messages.json packages.json util.py
- Loading branch information
Showing
38 changed files
with
1,262 additions
and
77 deletions.
There are no files selected for viewing
Empty file.
Empty file modified
0
lib/apex/metadata-templates/ApexClass/ApexClassNoConstructor.cls
100644 → 100755
Empty file.
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
lib/apex/metadata-templates/ApexClass/BDDUnitTestApexClass.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,16 @@ | ||
@isTest | ||
private class {{ api_name }} | ||
{ | ||
@isTest | ||
static void itShould() | ||
{ | ||
// Given | ||
|
||
|
||
// When | ||
|
||
|
||
// Then | ||
|
||
} | ||
} |
Empty file.
Empty file.
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,57 @@ | ||
/** | ||
* See https://github.com/financialforcedev/fflib-apex-common for more info | ||
* | ||
* Install library via | ||
* https://githubsfdeploy.herokuapp.com/app/githubdeploy/financialforcedev/fflib-apex-common | ||
*/ | ||
|
||
/** | ||
* Encapsulates all behaviour logic relating to the {{ object_name }} object | ||
* | ||
* For more guidelines and details see | ||
* https://developer.salesforce.com/page/Apex_Enterprise_Patterns_-_Domain_Layer | ||
* | ||
**/ | ||
public class {{ api_name }} extends fflib_SObjectDomain | ||
{ | ||
public {{ api_name }}(List<{{ object_name }}> records) | ||
{ | ||
super(records); | ||
} | ||
|
||
public override void onValidate() | ||
{ | ||
for({{ object_name }} record : (List<{{ object_name }}>) Records) | ||
{ | ||
} | ||
} | ||
|
||
public override void onValidate(Map<Id,SObject> existingRecords) | ||
{ | ||
for({{ object_name }} record : (List<{{ object_name }}>) Records) | ||
{ | ||
} | ||
} | ||
|
||
public override void onBeforeInsert() | ||
{ | ||
for({{ object_name }} record : (List<{{ object_name }}>) Records) | ||
{ | ||
} | ||
} | ||
|
||
public void someMethod() | ||
{ | ||
for({{ object_name }} record : (List<{{ object_name }}>) Records) | ||
{ | ||
} | ||
} | ||
|
||
public class Constructor implements fflib_SObjectDomain.IConstructable | ||
{ | ||
public fflib_SObjectDomain construct(List<SObject> sObjectList) | ||
{ | ||
return new {{ api_name }}(sObjectList); | ||
} | ||
} | ||
} |
Empty file modified
0
lib/apex/metadata-templates/ApexClass/EmailServiceApexClass.cls
100644 → 100755
Empty file.
Empty file.
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,28 @@ | ||
@isTest | ||
public class {{ api_name }} implements HttpCalloutMock { | ||
|
||
protected Integer code; | ||
protected String status; | ||
protected String body; | ||
protected Map<String, String> responseHeaders; | ||
|
||
public {{ api_name }}(Integer code, String status, String body, Map<String, String> responseHeaders) { | ||
this.code = code; | ||
this.status = status; | ||
this.body = body; | ||
this.responseHeaders = responseHeaders; | ||
} | ||
|
||
public HTTPResponse respond(HTTPRequest req) { | ||
//System.assertEquals('http://api.salesforce.com/foo/bar', req.getEndpoint()); | ||
//System.assertEquals('GET', req.getMethod()); | ||
|
||
// Create a fake response | ||
HttpResponse res = new HttpResponse(); | ||
res.setHeader('Content-Type', 'application/json'); | ||
res.setBody('{"foo":"bar"}'); | ||
res.setStatusCode(200); | ||
return res; | ||
} | ||
|
||
} |
Empty file modified
0
lib/apex/metadata-templates/ApexClass/SchedulableApexClass.cls
100644 → 100755
Empty file.
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,50 @@ | ||
/** | ||
* See https://github.com/financialforcedev/fflib-apex-common for more info | ||
* | ||
* Install library via | ||
* https://githubsfdeploy.herokuapp.com/app/githubdeploy/financialforcedev/fflib-apex-common | ||
*/ | ||
|
||
/** | ||
* Class encapsulates query logic for {{ object_name }} | ||
* | ||
* https://developer.salesforce.com/page/Apex_Enterprise_Patterns_-_Selector_Layer | ||
**/ | ||
public class {{ api_name }} extends fflib_SObjectSelector | ||
{ | ||
public List<Schema.SObjectField> getSObjectFieldList() | ||
{ | ||
return new List<Schema.SObjectField> { | ||
{{ object_name }}.Id | ||
}; | ||
} | ||
|
||
public Schema.SObjectType getSObjectType() | ||
{ | ||
return {{ object_name }}.sObjectType; | ||
} | ||
|
||
public List<{{ object_name }}> selectById(Set<ID> idSet) | ||
{ | ||
return (List<{{ object_name }}>) selectSObjectsById(idSet); | ||
} | ||
|
||
/* | ||
* For more examples see https://github.com/financialforcedev/fflib-apex-common-samplecode | ||
* | ||
public List<{{ object_name }}> selectBySomethingElse(List<String> somethings) | ||
{ | ||
assertIsAccessible(); | ||
return (List<{{ object_name }}>) Database.query( | ||
String.format( | ||
'select {0}, ' + | ||
'from {1} ' + | ||
'where Something__c in :somethings ' + | ||
'order by {2}', | ||
new List<String> { | ||
getFieldListString(), | ||
getSObjectName(), | ||
getOrderBy() } ) ); | ||
} | ||
*/ | ||
} |
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,21 @@ | ||
/** | ||
* See https://github.com/financialforcedev/fflib-apex-common for more info | ||
* | ||
* Install library via | ||
* https://githubsfdeploy.herokuapp.com/app/githubdeploy/financialforcedev/fflib-apex-common | ||
*/ | ||
|
||
/** | ||
* Encapsulates all service layer logic for a given function or module in the application | ||
* | ||
* For more guidelines and details see | ||
* https://developer.salesforce.com/page/Apex_Enterprise_Patterns_-_Service_Layer | ||
* | ||
**/ | ||
public class {{ api_name }} | ||
{ | ||
public static void doSomething() | ||
{ | ||
|
||
} | ||
} |
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,84 @@ | ||
public class {{ api_name }} | ||
{ | ||
/** | ||
* Enum representing each of before/after CRUD events on Sobjects | ||
*/ | ||
public enum Evt | ||
{ | ||
afterdelete, afterinsert, afterundelete, | ||
afterupdate, beforedelete, beforeinsert, beforeupdate | ||
} | ||
|
||
/* | ||
* Simplistic handler to implement on any of the event. It doesn't require or enforces any pattern except the | ||
* method name to be "handle()". | ||
*/ | ||
public interface HandlerInterface | ||
{ | ||
void handle(); | ||
} | ||
|
||
// Internal mapping of handlers | ||
Map<String, List<HandlerInterface>> eventHandlerMapping = new Map<String, List<HandlerInterface>>(); | ||
|
||
/** | ||
* Core API to bind handlers with events | ||
*/ | ||
public {{ api_name }} bind(Evt event, HandlerInterface eh) | ||
{ | ||
List<HandlerInterface> handlers = eventHandlerMapping.get(event.name()); | ||
if (handlers == null) | ||
{ | ||
handlers = new List<HandlerInterface>(); | ||
eventHandlerMapping.put(event.name(), handlers); | ||
} | ||
handlers.add(eh); | ||
return this; | ||
} | ||
|
||
/** | ||
* Invokes correct handlers as per the context of Trigger and available registered handlers | ||
*/ | ||
public void manage() | ||
{ | ||
Evt ev = null; | ||
if(Trigger.isInsert && Trigger.isBefore) | ||
{ | ||
ev = Evt.beforeinsert; | ||
} | ||
else if(Trigger.isInsert && Trigger.isAfter) | ||
{ | ||
ev = Evt.afterinsert; | ||
} | ||
else if(Trigger.isUpdate && Trigger.isBefore) | ||
{ | ||
ev = Evt.beforeupdate; | ||
} | ||
else if(Trigger.isUpdate && Trigger.isAfter) | ||
{ | ||
ev = Evt.afterupdate; | ||
} | ||
else if(Trigger.isDelete && Trigger.isBefore) | ||
{ | ||
ev = Evt.beforedelete; | ||
} | ||
else if(Trigger.isDelete && Trigger.isAfter) | ||
{ | ||
ev = Evt.afterdelete; | ||
} | ||
else if(Trigger.isundelete) | ||
{ | ||
ev = Evt.afterundelete; | ||
} | ||
|
||
List<HandlerInterface> handlers = eventHandlerMapping.get(ev.name()); | ||
|
||
if (handlers != null && ! handlers.isEmpty()) | ||
{ | ||
for (HandlerInterface h : handlers) | ||
{ | ||
h.handle(); | ||
} | ||
} | ||
} | ||
} |
Empty file.
Empty file modified
0
lib/apex/metadata-templates/ApexClass/UrlRewriterApexClass.cls
100644 → 100755
Empty file.
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,19 @@ | ||
@isTest | ||
public class {{ api_name }} implements WebServiceMock { | ||
public void doInvoke( | ||
Object stub, | ||
Object request, | ||
Map<String, Object> response, | ||
String endpoint, | ||
String soapAction, | ||
String requestName, | ||
String responseNS, | ||
String responseName, | ||
String responseType) { | ||
|
||
// Create response element from the autogenerated class. | ||
// Populate response element. | ||
// Add response element to the response parameter, as follows: | ||
//response.put('response_x', responseElement); | ||
} | ||
} |
Empty file.
Empty file modified
0
lib/apex/metadata-templates/ApexComponent/ApexComponent.component
100644 → 100755
Empty file.
Empty file.
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,11 @@ | ||
<apex:page showHeader="true" sidebar="true"> | ||
<apex:sectionHeader title="MyHeaderTitle" subtitle="MyHeaderSubTitle" /> | ||
<apex:pageBlock title="MyPageBlockTitle"> | ||
<apex:pageBlockButtons location="top"> | ||
|
||
</apex:pageBlockButtons> | ||
<apex:pageBlockSection title="MyPageBlockSectionTitle"> | ||
|
||
</apex:pageBlockSection> | ||
</apex:pageBlock> | ||
</apex:page> |
Empty file.
17 changes: 17 additions & 0 deletions
17
lib/apex/metadata-templates/ApexTrigger/ApexTriggerAllEvents.trigger
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,17 @@ | ||
trigger {{ api_name }} on {{ object_name }} ( | ||
before insert, | ||
before update, | ||
before delete, | ||
after insert, | ||
after update, | ||
after delete, | ||
after undelete) { | ||
|
||
if (Trigger.isBefore) { | ||
//call your handler.before method | ||
|
||
} else if (Trigger.isAfter) { | ||
//call handler.after method | ||
|
||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
lib/apex/metadata-templates/ApexTrigger/ApexTriggerBulk.trigger
100644 → 100755
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
19 changes: 19 additions & 0 deletions
19
lib/apex/metadata-templates/ApexTrigger/DomainTrigger.trigger
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,19 @@ | ||
/** | ||
* See https://github.com/financialforcedev/fflib-apex-common for more info | ||
* | ||
* Install library via | ||
* https://githubsfdeploy.herokuapp.com/app/githubdeploy/financialforcedev/fflib-apex-common | ||
*/ | ||
|
||
/** | ||
* Boiler plate Apex Trigger to route events to the respective Domain class methods | ||
* | ||
* For more guidelines and details see | ||
* https://developer.salesforce.com/page/Apex_Enterprise_Patterns_-_Domain_Layer | ||
**/ | ||
trigger {{ api_name }} on {{ object_name }} (after delete, after insert, after update, | ||
before delete, before insert, before update) | ||
{ | ||
// Creates Domain class instance and calls appropriate methods | ||
fflib_SObjectDomain.triggerHandler({{ api_name }}.class); | ||
} |
Oops, something went wrong.