Handlers, etc. Everything needed to translate a web request into data that can be passed into a regular Python function and vice versa.
Typically this would be imported into an app like this.
| public class CommunityTopicListItemController { | |
| @AuraEnabled | |
| public static void subscribe(Id entityId) { | |
| ConnectApi.Subscription subscription = | |
| ConnectApi.ChatterUsers.follow(Network.getNetworkId(), 'me', entityId); | |
| } | |
| @AuraEnabled | |
| public static void unsubscribe(Id subscriptionId) { |
| @Service | |
| public class AdvertiserListingTaskService { | |
| public void executeWithConfig(TaskConfig config) { | |
| AdvertiserListingTask task = getTask(); | |
| task.apply(config); | |
| task.run(); // Or something like executor.execute(task) | |
| } | |
| @Lookup |
| @Service | |
| public class IntegrationService { | |
| @Autowired | |
| private TaskExecutor integrationTaskExecutor; | |
| @Autowired | |
| private IntegrationTaskFactory integrationTaskFactory; | |
| /** |
| @Configuration | |
| public class AppConfig { | |
| public @Bean Foo fooer() { | |
| return new Foo("fooer"); | |
| } | |
| public @Bean Foo fooey() { | |
| return new Foo("fooey"); | |
| } |
| public class SimpleDomain { | |
| ObjectId _id; | |
| String code; | |
| int numberOfUses; | |
| } |
| package script; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.nio.charset.Charset; | |
| import java.nio.file.Files; | |
| import java.nio.file.Path; | |
| import java.nio.file.Paths; | |
| import java.util.Arrays; | |
| import java.util.List; |
| <apex:page controller="ActionSupportParamDemoController"> | |
| <apex:form> | |
| <apex:repeat value="{!accounts}" var="account"> | |
| <apex:inputCheckbox value="{!account.IsActive__c}"> | |
| <apex:actionSupport event="onchange" | |
| action="{!handleAccountCheckboxChange}"> | |
| <apex:param id="account" name="accountId" value="{!account.Id}" | |
| assignTo="{!targetAccountId}"/> | |
| </apex:actionSupport> | |
| </apex:inputCheckbox> |
| trigger SetNewOwner on Case (before insert, before update) { | |
| for (Case eachCase : Trigger.new) { | |
| if (eachCase.NewOwner__c != null) { | |
| eachCase.OwnerId = eachCase.NewOwner__c; | |
| eachCase.NewOwner__c = null; | |
| } | |
| } | |
| } |