Posts

Showing posts from June, 2015

Disable telephone detectors in Safari/Hybrid app (x-apple-data=detectors)

Image
Problem:  You see an unexpected hyperlink against numbers in your text.  Solution: Include the following in your landing html page at the top. <meta name="format-detection" content="telephone=no">  Reference: http://stackoverflow.com/questions/2106102/disabling-data-detectors-for-a-specific-html-element-in-a-uiwebview http://stackoverflow.com/questions/10655815/disable-telephone-anchor

Hosting A Static Website In Google App Engine - Eclipse, Java

A few months ago, I played around with Google app engine. Somebody asked to set up a personal website which is nothing but a collection of static pages, images and JS widget to do a carousel/gallery. I tried my hand at Google app engine. In another instance, I hosted Google Course Builder on app engine. In both instance, my experience is smooth. Used Google app engine launcher.  Configured .yaml file (Replace application name with the unique application name you set up on google.)What if you want to setup your site using Java on AppEngine. Generally, java developers start with Eclipse. Generally, we follow the tutorial by Google.  https://cloud.google.com/appengine/docs/java/gettingstarted/introduction The question is how to put our static files on AppEngine and point index.html as the startup page. Answer - include static file location to app-webengine.xml.  In this case I created "static" folder under war folder. Also, set the expiration date. Using this setting, serve

Generate token signing .CER from ADFS Federation Metadata XML

Image
While workging on Force.com SSO, our ADFS team has provided me with federation metadata xml only. As per this link , you also need a token-signing certificate from provider to complete the setup and provide the Force.com XML file to ADFS. Now, the question is how to generate .pem/.cer file out of FederationMetadata.xml file.  Edit FederationMetadata.xml file, and search for  <KeyDescriptor use="signing">. You should find more than one entry. Pick any one of them.      2.  Pick the X500Certificate value and save the text as .der file     3.  openssl x509 -in <(base64 --decode FILE_FROM_STEP2.der) -inform DER -out OUTPUT.pem Use <OUTPUT>.per as Identity Provider Certificate.  Reference:  https://ask.auth0.com/t/how-to-convert-saml-federationmetadata-xml-key-to-pem-or-cer/24

Get Complete Package.xml

Below are a few interesting post about preparing package.xml automatically. https://github.com/JitendraZaa/AutoGenerate_Package.xml_Ant http://www.tquila.com/blog/2014/02/11/salesforce-packagexml-builder https://packagebuilder.herokuapp.com/ There is no way to figure out wild card metadata components (*) using API. Also, there is no way to figure out what components are not supported as part of force.com migration tool.  Out of above posts, I found Jitendra's post very interesting and useful. Whereas packagebuilder by Tquila guys, generates an exhaustive list of package.xml file for your organization.  On a side note Tquila guys have build a few interesting heroku apps.  https://sfswitch.herokuapp.com/  - To switch components between orgs.  sforgcompare.herokuapp.com    - To compare metadata between orgs. Watch this space for more info!

Performance tuning of a visualforce page

Image
It's my strong belief that a developer should always keep the performance in the top of the priority list. As I was working on a big Visualforce page with lot of aggregations, I wondered how to get best performance out of APEX and VF.  I went through  Apex Code Best Practices  and  salesforce_visualforce_best_practices.pdf .  Both were really helpful, until I ran into following statements.  Apex Best Practice # 4 states " Use the power of the SOQL  where  clause to query all data needed in a single query. "   Visualforce guide states " When writing Apex or SOQL for use with a Visualforce page:  • Perform calculations in SOQL instead of in Apex, whenever possible. • Never perform DML inside a loop.  • Filter in SOQL first, then in Apex, and finally in Visualforce " Now, I am confused on writing a single SOQL and do the aggregations such as (max,min, sum, avg) in APEX or writing multiple aggregate SOQL's relay the data to VF thr