Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- how to call rest apex class "AdobeConnectEvents from "CommandButtonParamController " class for passing the details.
- <apex:page standardController="LightiningEd__Login__c"
- extensions="CommandButtonParamController">
- <apex:form >
- <apex:pageBlock title="Login To Adobe">
- <apex:pageBlockSection >
- <apex:inputField value="{!LightiningEd__Login__c.LightiningEd__Username__c}"/><br/>
- <apex:inputField value="{!LightiningEd__Login__c.LightiningEd__Password__c}"/><br/>
- <apex:inputField value="{!LightiningEd__Login__c.LightiningEd__URL__c}"/>
- </apex:pageBlockSection>
- <center>
- <apex:commandButton id="saveBtn" value="Login" action="{!processButtonClick}" />
- <apex:param name="username" value="{!LightiningEd__Login__c.LightiningEd__Username__c}" assignTo="{!username}"/>
- <apex:param name="password" value="{!LightiningEd__Login__c.LightiningEd__Password__c}" assignTo="{!password}"/>
- <apex:param name = "url" value="{!LightiningEd__Login__c.LightiningEd__URL__c}" assignTo="{!url}"/>
- </center><br/>
- </apex:pageBlock>
- </apex:form>
- private ApexPages.StandardController controller {get; set;}
- private LightiningEd__Login__c login {get;set;}
- public String username{
- get;
- set {
- username= value;
- System.debug('value: '+value);
- }
- }
- public String password{
- get;
- set {
- password= value;
- System.debug('value: '+value);
- }
- }
- public String url{
- get;
- set {
- url= value;
- System.debug('value: '+value);
- }
- }
- public CommandButtonParamController(ApexPages.StandardController controller) {
- this.controller = controller;
- this.login= (LightiningEd__Login__c)controller.getRecord();
- }
- public PageReference processButtonClick() {
- System.debug('username: '+username);
- System.debug('password: '+username);
- System.debug('url: '+username);
- PageReference pageref = new PageReference('/apex/Display_All_Webinars');
- return pageref;
- }
- @future (callout=true)
- global static void getParticipants(String username, String password,String url){
- Http http = new Http();
- HttpRequest req = new HttpRequest();
- HttpResponse res = new HttpResponse();
- Blob headerValue = Blob.valueOf(username + ':' + password);
- String authorizationHeader = 'BASIC ' +
- EncodingUtil.base64Encode(headerValue);
- req.setHeader('Authorization', authorizationHeader);
- req.setEndpoint(url+'/api/xml?action=report-my-events&account-id=1309160790&&session=apac1breezdhqaxms9bksbrsmt');
- req.setMethod('GET');
- req.setHeader('Content-Type', 'application/json');
- req.setHeader('Accept','application/json');
- try {
- res = http.send(req);
- System.debug('MyResult == :'+res.getBody());
- XMLParserCopy s = new XMLParserCopy(res.getBody());
- System.debug('Response value'+s);
- }catch(System.CalloutException e){
- System.debug('Callout error: '+ e);
- }//return res;
Add Comment
Please, Sign In to add comment