How to setup amazon s3 for amazon developer toolkit -



How to setup amazon s3 for amazon developer toolkit -

i installed amazon toolkit in salesforce developer org , created object of type aws credentials. in ec2consolecontroller, specified name of aws credential object after when seek open ec2 console tab giving me error

too many script statements: 200001 error in look '{!constructor}' in component <apex:page> in page ec2console

why facing error , how rid of this? please help

code of ec2console page

<apex:page controller="ec2consolecontroller" sidebar="true" action="{!constructor}"> <!-- <apex:messages /> --> <apex:pagemessages /> <apex:form > <apex:pageblock title="amazon ec2 console"> <apex:pageblockbuttons > <apex:commandbutton action="{!refreshinstances}" value="refresh" rerender="instancestable" status="instancesstatus" /> <apex:actionstatus id="instancesstatus" starttext="please wait ..."></apex:actionstatus> </apex:pageblockbuttons> <apex:pageblocksection title="instances"> <apex:pageblocktable value="{!instances}" var="ins" id="instancestable"> <apex:column value="{!ins.instanceid}"> <apex:facet name="header">id</apex:facet> </apex:column> <apex:column value="{!ins.imageid}"> <apex:facet name="header">image id</apex:facet> </apex:column> <apex:column value="{!ins.instancestatename}"> <apex:facet name="header">state</apex:facet> </apex:column> <apex:column value="{!ins.privatednsname}"> <apex:facet name="header">private dns</apex:facet> </apex:column> <apex:column value="{!ins.dnsname}"> <apex:facet name="header">public dns</apex:facet> </apex:column> <apex:column value="{!ins.amilaunchindex}"> <apex:facet name="header">launch index</apex:facet> </apex:column> <apex:column value="{!ins.launchtime}"> <apex:facet name="header">launch time</apex:facet> </apex:column> <apex:column value="{!ins.availabilityzone}"> <apex:facet name="header">zone</apex:facet> </apex:column> <apex:column > <apex:commandlink action="{!terminateinstances}" rendered="{!ins.instancestatename == 'running'}" status="instancesstatus"> <apex:param name="instanceid" value="{!ins.instanceid}"></apex:param> <apex:image url="{!$resource.ec2console_shutdownimage}" width="24" height="24" title="shutdown instance" /> </apex:commandlink> </apex:column> <apex:column > <apex:commandlink action="{!rebootinstances}" rendered="{!ins.instancestatename == 'running'}" status="instancesstatus"> <apex:param name="instanceid" value="{!ins.instanceid}"></apex:param> <apex:image url="{!$resource.ec2console_rebootimage}" width="24" height="24" title="reboot instance" /> </apex:commandlink> </apex:column> </apex:pageblocktable> </apex:pageblocksection> </apex:pageblock> </apex:form> </apex:page>

and ec2consolecontroller

public class ec2consolecontroller { ec2connection ec2; private string awscredentialname = 'amazon'; //modify string variable name of aws credential record contains proper aws keys , secret public list<ec2connection.ec2image> images {get;set;} public list<ec2connection.ec2instance> instances {get;set;} public string owner {get;set;} public ec2consolecontroller() { //ec2 = new ec2connection(awscredentialname); //this.owner = 'amazon'; //default owner //try { // getdescribeimages(); // getdescribeinstances(); // } catch( exception ee ) {} } /* method called when aws_s3_examples visualforce page loaded. verifies aws keys can found in awskeys__c custom object specified name, set in string variable awscredentialsname. errors added apexpage , displayed in visualforce page. */ public pagereference constructor(){ try{ awskeys credentials = new awskeys(awscredentialname); ec2 = new ec2connection(awscredentialname); this.owner = 'amazon'; //default owner seek { getdescribeimages(); getdescribeinstances(); } catch( exception ee ) {} }catch(awskeys.awskeysexception awsex){ system.debug('caught exception in aws_s3_examplecontroller: ' + awsex); apexpages.message errormsg = new apexpages.message(apexpages.severity.fatal, awsex.getmessage()); apexpages.addmessage(errormsg); //throw new awskeys.awskeysexception(awsex); //apexpages.addmessage(awsex); } homecoming null; } //get public ami images descriptions public void getdescribeimages() { this.images = ec2.describeimages(owner); } //get running instances public void getdescribeinstances() { this.instances = ec2.describeinstances(); } //start ec2 image public void runinstances() { string imageid = system.currentpagereference().getparameters().get('imageid'); ec2.runinstances(imageid); refreshinstances(); } //terminate ec2 image public void terminateinstances() { string instanceid = system.currentpagereference().getparameters().get('instanceid'); ec2.terminateinstances(instanceid); refreshinstances(); } //reboot ec2 image public void rebootinstances() { string instanceid = system.currentpagereference().getparameters().get('instanceid'); ec2.rebootinstances(instanceid); refreshinstances(); } //reload instances public void refreshinstances() { getdescribeinstances(); } //reload images public void refreshimages() { //system.debug('owner : '+owner); this.images = ec2.describeimages(owner); } //for owner selectlist public list<selectoption> getowners() { list<selectoption> options = new list<selectoption>(); options.add(new selectoption('amazon','amazon')); options.add(new selectoption('self','my images')); homecoming options; } private string createtestcredentials(){ awskey__c testkey = new awskey__c(name='test keys',key__c='key',secret__c='secret'); insert testkey; homecoming testkey.name; } // ec2consolecontroller.t1(); public static testmethod void t1() { ec2consolecontroller ecc = new ec2consolecontroller(); string credname = ecc.createtestcredentials(); ecc.awscredentialname = credname; ecc.constructor(); ecc.getdescribeinstances(); } public static testmethod void t2() { try{ ec2consolecontroller ecc = new ec2consolecontroller(); ecc.getdescribeimages(); }catch(exception ex){ } } public static testmethod void t3() { try{ ec2consolecontroller ecc = new ec2consolecontroller(); ecc.refreshimages(); }catch(exception ex){ } } public static testmethod void t4() { try{ ec2consolecontroller ecc = new ec2consolecontroller(); ecc.rebootinstances(); }catch(exception ex){ } } public static testmethod void t5() { try{ ec2consolecontroller ecc = new ec2consolecontroller(); ecc.getowners(); ecc.terminateinstances(); }catch(exception ex){ } } public static testmethod void t6() { try{ ec2consolecontroller ecc = new ec2consolecontroller(); ecc.runinstances(); }catch(exception ex){ } } }

and getting error on first line of ec2console page

<apex:page controller="ec2consolecontroller" sidebar="true" action="{!constructor}">

now please help how getird of error

amazon-web-services amazon-s3 salesforce

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -