• Nicolas Vuillamy
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies
Hi,
In my lightning app I use a lot component inheritance.

Basically, i have a 'framework' component that contains most of the behaviours, and the only specific behaviours are defined on inheriting component. 
Since LockerServer,  the command component.getConcreteComponent().getDef().getHelper() doesn't work anymore, coz getDef() is not accessible. 
What is the workaround to do that ?

Note: my code follows the principle of this example : https://developer.salesforce.com/blogs/developer-relations/2015/03/salesforce-lightning-components-by-example-component-extension.html

Many thanks & best regards

 
Hi ,

In my lightning app, I use History.pushState , history.replaceState, etc ...

It was very convenient, but since the locker service activate, window.history is no longer accessible.

Is there some way to access it ?
If not, how/when can I manage SalesForce to provide a workaround for this regression due to Locker Service ?

Thanks & best regards
Hi ,

I'm struggling with SF docs / forums / google and I don't succeed to find a response to a simple question:

How to list classes inheriting from a super class ?

Example :
 
public abstract MyRootAbstractClass
{
      public virtual String getLabel() {return null ;}
}

public class MyFirstChildClass extends MyRootAbstractClass
{
      public override String getLabel() {return 'MyFirstChildClassLabel' ;}
}

public class MySecondChildClass extends MyRootAbstractClass
{
      public override String getLabel() {return 'MySecondChildClassLabel' ;}
}

I need to be able to create a method who can return 'MyFirstChildClassLabel','MySecondChildClassLabel'

I anyone is able to fill the blank part in my code, I would be enternally thankful :)
 
        Type RootClassType = Type.forName('MyRootAbstractClass');
        /////
        // WHAT TO PUT HERE ??? :'( 
        /////
        List<String> AvailableChildClassList = new List<String>();
        for (String ChildClass : ChildClassList)
        {
            ClassType = Type.forName(ChildClass);
            SomeInterface ClassInstance = (SomeInterface)ClassType.newInstance();
            String ChildClassLabel = ClassInstance.getLabel();
            AvailableChildClassList.add(ChildClassLabel);
        }
        return AvailableChildClassList;

Note: some code parts are missing about interface management but it's ok i know how to manage it :)

Many thanks , best regards & have a nice day :)
Hi :)

I tried lots of stuff but am now really stucked about the following problem: impossible to include a static resource in a lightning component when it is displayed in a Partner community ( using visual force page with inclusion of lightning )

My example is simple :
<aura:component controller="ccCmpUtils" extends="c:CmpRoot">
...
    <img src="/resource/PCLogoTwitter" width="36" height="36" alt="Twitter" />
...
</aura:component>

I have a static resource PCLogoFacebook which is a simple PNG image.
Its hardcoded link is https://xxxxxxx-dev-ed--c.na30.visual.force.com/resource/1456934890000/PCLogoTwitter

When I use this component from a force.com app ( URL https://xxxxxxxx-dev-ed.lightning.force.com/c/SomeApp.app ) , it is fetched and displayed correctly.

But then when I include it in a VF page like that ( end url = https://xxxxxxx-developer-edition.na30.force.com/PartnerXXX/apex/vfCmpAppIncluder?sfdc.tabName=01r360000000yt1 )
<apex:page standardStylesheets="false" sidebar="false">
    <apex:includeLightning />

    <div id="lightning" />

    <script>
        $Lightning.use("c:SomeApp", function() {
            $Lightning.createComponent("c:SomeComponent", // Component name
          {   // Component parameters
              'ShowHeader': false ,
              'ShowFooter' : false
          },
          "lightning",
          function(cmp) {
            // do some stuff
          });
        });
    </script> 
</apex:page>
I have a 404 error when getting the image because it looks in https://xxxxxxx-developer-edition.na30.force.com/PartnerXXX/resource/ instead than in base resource folder.

Has anyone already have this problem ?

Is there some way to solve it, other than to hardcode https://xxxxxxx-dev-ed--c.na30.visual.force.com/resource/1456934890000/PCLogoTwitter in my <img> tag ? ( this would make a component available for force.com OR community, but I need it to be includable in both )

Many thanks and best regards :)

 
Hi ,

I'm currently facing the following problem :

- I need to connect SalesForce via CallOut to a REST API hosted on AWS 
- The certificate on this AWS is not valid ( we're currently setting up the env )
- I tried to disable protocol security on the named credential
- I still have error System.CalloutException: java.security.cert.CertificateException: No name matching ec2-XXXXXXX.eu-west-1.compute.amazonaws.com found

Is there a way to really deactivate the certificate check , knowing that i can't have a valid certifiate for some time and I need to do tests asap ?

Some more infos :

Named Credential:
Label AIARESTAPI
Name AIARESTAPI
URL https://ec2-XXXXXXX.eu-west-1.compute.amazonaws.com/csc/insurance/
Certificate : none
Identity Type Anonymous
Authentication Protocol No Authentication

Remote site setting :
Remote Site Name GTAIA_SaaS_Omni
Remote Site URL https://ec2-XXXXXXX.eu-west-1.compute.amazonaws.com
Disable Protocol Security Checked
Active Checked

Code:
String uri ='quotes/' ;
String httpMethod = 'GET' ;

Http h = new Http();
HttpRequest req = new HttpRequest();

// Set endpoint
String endpoint = 'callout:AIARESTAPI/' + uri ;
req.setEndpoint(endpoint);
// Set Http method ( GET,POST,PUT ...)
req.setMethod(HttpMethod);

// Set Http headers
req.setHeader('Accept','*/*'); //'application/vnd.hal+json');
req.setTimeout(5000);

System.debug('Request: '+req);

// Process the call to remote API
HttpResponse res = h.send(req);
return res ;

Result:
System.CalloutException: java.security.cert.CertificateException: No name matching ecXXXXXXX.eu-west-1.compute.amazonaws.com found

Many thanks & best regards
Hi ,

I development some "framework reusable" components in a salesforce environment.

I would like to import then in a new environment.

I tried to use Force.com Eclipe plugin the following way :
- Source env project: refresh from server . Components are well downloaded.
- Source env projet: Export components as files
- Destination env project: Import components ( from export file): they well appear in the explorer
- Destination env project: Save to server

I always have the same error : unable to save resources: Filepath and/or project can not be null.

I could do hundreds of copy-pastes in the developer console but ... i'm sure there is a 3 clicks way to do that.

Please can you help me ?

Many thanks & best regards

 
Hi dear salesforce developers ,

I have built an integration between my company back-office application, Apex classes and Lightning components to build a front-end application.
Now the project is become mature, I'd like to version it ( I still do lots of enhancements and i'd like to keep backups of my previous versions ).

I saw the Eclipe plugin for Apex classes, and I can use it to export the Apex pages, but what about the Lightning components ?
I've browsed lots of forums but didn't find the answer yet.

Do anyone have a solution to export lightning components into files ? :)

Thanks & best regards
Hi,
In my lightning app I use a lot component inheritance.

Basically, i have a 'framework' component that contains most of the behaviours, and the only specific behaviours are defined on inheriting component. 
Since LockerServer,  the command component.getConcreteComponent().getDef().getHelper() doesn't work anymore, coz getDef() is not accessible. 
What is the workaround to do that ?

Note: my code follows the principle of this example : https://developer.salesforce.com/blogs/developer-relations/2015/03/salesforce-lightning-components-by-example-component-extension.html

Many thanks & best regards

 
Hi ,

I'm struggling with SF docs / forums / google and I don't succeed to find a response to a simple question:

How to list classes inheriting from a super class ?

Example :
 
public abstract MyRootAbstractClass
{
      public virtual String getLabel() {return null ;}
}

public class MyFirstChildClass extends MyRootAbstractClass
{
      public override String getLabel() {return 'MyFirstChildClassLabel' ;}
}

public class MySecondChildClass extends MyRootAbstractClass
{
      public override String getLabel() {return 'MySecondChildClassLabel' ;}
}

I need to be able to create a method who can return 'MyFirstChildClassLabel','MySecondChildClassLabel'

I anyone is able to fill the blank part in my code, I would be enternally thankful :)
 
        Type RootClassType = Type.forName('MyRootAbstractClass');
        /////
        // WHAT TO PUT HERE ??? :'( 
        /////
        List<String> AvailableChildClassList = new List<String>();
        for (String ChildClass : ChildClassList)
        {
            ClassType = Type.forName(ChildClass);
            SomeInterface ClassInstance = (SomeInterface)ClassType.newInstance();
            String ChildClassLabel = ClassInstance.getLabel();
            AvailableChildClassList.add(ChildClassLabel);
        }
        return AvailableChildClassList;

Note: some code parts are missing about interface management but it's ok i know how to manage it :)

Many thanks , best regards & have a nice day :)
Hi,
In my lightning app I use a lot component inheritance.

Basically, i have a 'framework' component that contains most of the behaviours, and the only specific behaviours are defined on inheriting component. 
Since LockerServer,  the command component.getConcreteComponent().getDef().getHelper() doesn't work anymore, coz getDef() is not accessible. 
What is the workaround to do that ?

Note: my code follows the principle of this example : https://developer.salesforce.com/blogs/developer-relations/2015/03/salesforce-lightning-components-by-example-component-extension.html

Many thanks & best regards

 
Hi ,

I'm currently facing the following problem :

- I need to connect SalesForce via CallOut to a REST API hosted on AWS 
- The certificate on this AWS is not valid ( we're currently setting up the env )
- I tried to disable protocol security on the named credential
- I still have error System.CalloutException: java.security.cert.CertificateException: No name matching ec2-XXXXXXX.eu-west-1.compute.amazonaws.com found

Is there a way to really deactivate the certificate check , knowing that i can't have a valid certifiate for some time and I need to do tests asap ?

Some more infos :

Named Credential:
Label AIARESTAPI
Name AIARESTAPI
URL https://ec2-XXXXXXX.eu-west-1.compute.amazonaws.com/csc/insurance/
Certificate : none
Identity Type Anonymous
Authentication Protocol No Authentication

Remote site setting :
Remote Site Name GTAIA_SaaS_Omni
Remote Site URL https://ec2-XXXXXXX.eu-west-1.compute.amazonaws.com
Disable Protocol Security Checked
Active Checked

Code:
String uri ='quotes/' ;
String httpMethod = 'GET' ;

Http h = new Http();
HttpRequest req = new HttpRequest();

// Set endpoint
String endpoint = 'callout:AIARESTAPI/' + uri ;
req.setEndpoint(endpoint);
// Set Http method ( GET,POST,PUT ...)
req.setMethod(HttpMethod);

// Set Http headers
req.setHeader('Accept','*/*'); //'application/vnd.hal+json');
req.setTimeout(5000);

System.debug('Request: '+req);

// Process the call to remote API
HttpResponse res = h.send(req);
return res ;

Result:
System.CalloutException: java.security.cert.CertificateException: No name matching ecXXXXXXX.eu-west-1.compute.amazonaws.com found

Many thanks & best regards
Hi dear salesforce developers ,

I have built an integration between my company back-office application, Apex classes and Lightning components to build a front-end application.
Now the project is become mature, I'd like to version it ( I still do lots of enhancements and i'd like to keep backups of my previous versions ).

I saw the Eclipe plugin for Apex classes, and I can use it to export the Apex pages, but what about the Lightning components ?
I've browsed lots of forums but didn't find the answer yet.

Do anyone have a solution to export lightning components into files ? :)

Thanks & best regards
i am trying to build a lightning component that shows nearby contacts based on the users current location. i am getting an error when trying to access the users current location through navigator.geoLocation. I get the following error.
"Uncaught error in actionCallback : navigator.geoLocation is undefined"

Here is my component and its controller logic.

Component:
<aura:component >
    
   <aura:attribute name="latitude" type="Decimal"/>
    <aura:attribute name="longitude" type="Decimal"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
  
</aura:component>
Controller:
({
	doInit : function(component, event, helper) {
        if(navigator.geoLocation){
            console.log("capability is there");
            
        }else{
            console.log("No Capability");
        }
        navigator.geoLocation.getCurrentPosition(function(position){
            this.latitude=component.set("v.latitude",position.coords.latitude);
            this.longitude=component.set("v.longitude", position.coords.longitude);
            console.log("Latitude is:"+this.latitude);
            console.log("Longitude is:" +this.longitude);
        });
		
	}
})
debugging  console log shows that my else part is only written to console. does that mean that geolocation is not supported in lightning? Am i doing anything wrong ? Any help would be appreciated.
 
Hi,

I am calling an external web service from Salesforce.
The error I'm getting is:
 
java.security.cert.CertificateException: No subject alternative names matching IP address x.x.x.x found

Is it possible to tell Salesforce that this is a trusted address and to Ignore the certificate error? Similar when indicating the same to a Web Browser.
We are testing with a development environment but the certificate is for the production domain. So we are working with a trusted specific address that is not covered by the certificate.

Thanks,