How to open Internet downloaded apps on a Mac

macOS includes a technology called Gatekeeper, that’s designed to ensure that only trusted software runs on your Mac. The safest place to get apps for your Mac is the App Store. … If you download and install apps from the internet or directly from a developer, macOS continues to protect your Mac.

To disable the Gatekeeper you can do one of the following steps.

Open up the terminal( a command line utility) and enter the following
sudo spctl --master-disable
You will be prompted for your Administrator password.

Then you can now run the internet downloaded application.

To enable it back simply run the alternate command.
sudo spctl --master-enable

Passed the Mulesoft Certified Developer(Mule4) Level 1 Exam

This one was a very tough exam to prepare for. Even with having taken the online 5 day Fundamentals course last August. I failed my first attempt of the exam last week. So I booked another schedule the week after and really focused on the skills and concepts I was lacking.

The self study material is now available. Enroll and sign up here https://training.mulesoft.com/course/mulesoftu-fundamentals4

The format of the exam is a multiple choice. There are a total of 60 questions and passing score is 70 and you are alloted 120 minutes.

Start by reviewing the Study Guide

Here are my notes for passing the exam.

  • Creating Application Networks
    • Current IT landscape problem
      • IT cannot delivery fast enough
      • IT can build fast while still early but as time moves the IT project gets complex and harder to build on top of it
      • Solution: A new IT operating model IT builds reusable assets and data Business can self-serve on the assets
    • Modern API  approach
      • discoverable and accessible through self service
      • productized and designed for ease of consumption
      • easily managed for security, scalability and performance
      • API-Led Connectivity
        • Experience API
        • Process API
        • System API
    • What is C4E ?
      • Center for Enablement
      • A cross functional team
        • developers
        • lob it
        • central it
      • C4E make sure assets
        • are productized
        • consumable
        • fully leveraged
      • success is based on asset consumption
    • Deconstructing API
      • What is an API?
        • Acronym for Application Programming Interface
        • it provides information how to communicate with a software component
          • Operations – what to call
          • Inputs – what inputs are expected Output – results expected
          • Underlying data types ?
        • It defines functionalities independent of implementations
          • change what is behind the scenes without people changing how they call it
      • API can be of the following
        • API specification file
          • defines what to call, send and get back
        • web service
          • actual API implementation you can make calls
        • API proxy
          • application that controls access  to a web service, restricting access and usage through an api proxy
      • What are web services
        • different software systems often need to exchange data with each other
          • bridges platform, protocols, programming language and hardware architecture
        • is a method of communication between systems over the internet
        • system interaction manner is prescribed by some defined rules of communication
      • Parts of a web service API
        • The web service api
          • describes how to interact with the api
          • may or may not be defined in a file
        • web service interface implementing an api
          • code providing structure to the application/ combination
        • web service implementation itself
          • actual code and application
      • Two main API types
        • SOAP
          • traditional, more complex
          • communication rules are defined in an XML
        • RESTful
          • recent, simplier
          • uses existing HTTP communication protocol
          • Representational State Transfer
            • architecture pattern where clients and servers exchange representation of resources using HTTP protocols
            • http request methods
              • POST
                • creates new resource
              • GET
                • retrieves current state normally in XML or JSON
              • PUT
                • updates or creates a new one
              • PATCH
                • partially updates
              • DELETE
                • deletes a resource
            • data and resources are represented using URIs
            • resources are accessed or managed with a fixed set of operation
              • get /companies
              • get /companies?country=France
              • etc…
            • Example RESTful web service response
              • JSON (Javascript Object Notation)
                • supports maps and collections
                • lightweight data-interchange format
              • XML
          • Making calls
            • Unsecured API
              • no authentication required
            • Secure API
              • requires credentials or token
              • sometimes api proxies are used to govern access to an api
              • you can secure an api with different protocols OAuth, SAML and JWT
              • Http Status Codes
                • provides feedback for the outcome of the operation
                • good api should return status codes that align with the http spec
  • Designing APIs
    • Modern API
      • productized
      • easily govern
      • build for consumption – reusable
    • Anypoint Design Center
      • Design your api
      • API Designer
        • Uses RAML
    • AnyPoint Exchange
      • A repository
      • library of assets
      • private content only to available to people in your org
      • when a rest api is added to exchange it creates an api portal
      • Flow Designer lightweight version/ available on the web
      • Anypoint Studio for development
      • Anypoint Management Center
        • version proxy
        • rate limit
        • throttling visibility and
        • control scale your application
      • Runtime Services
        • deploy applications
        • lightweight java-based ESB
        • decouples point to point
        • can be deployed anywhere
        • enforces policies for api governance
      • Anypoint Platform
        • uniquely built
        • deploy anywhere
        • can build your own connector
        • have tons of pre-built connectors
        • implemented all the internal process eg. database connection etc..
      • Achieving Success
        • business outcome
        • org enabled technology
        • delivery
        • Paths
          • Plan for success
          • Establish the foundation
          • Build to scale
          • Measure impact
      • API Notebook
        • on exchange you can create documentation – plays your script
      • MUnit
        • test your mule application
    • Mule Applications
      • can be created visually or through xml
      • under the hood it is java using spring
      • mule apps are deployed to mule runtime
    • Mule Runtime Engine
      • lightweight java ESB and integration platform
      • decouples point to point
      • can be deployed anywhere
      • enforces policies for API governance
    • Mule 4 Applications and flows
      • Mule application receive events, process them and route them
      • A listener listens for events
      • an application can consist of single or multiple flows
      • mule event source
        • initiates the execution of flow
      • mule event processors
        • tranform, filter, enrich
    • Workers
      • dedicated instance of mule that runs the app
      • each worker runs in separate containers from every other application
      • can have different compute power
        • apps can be scaled vertically by change worker size
        • apps can be scaled horizontally by adding more workers
      • there are workers in different environments
  • Accessing and Modifying Mule Events
    • Mule event
      • Mule message – data that passes to the flow
      • attribute – metadata in the header payload – core info of the message
      • variables – metadata for the mule event – can be defined and referenced
  • Structuring Mule Applications
  • Building API Implementation Interfaces
  • Routing Events
  • Handling Errors
  • Writing DataWeave Transformations
  • Using Connectors
  • Processing Records
  • Debugging and Troubleshooting Mule Applications
  • Deploying and Managing APIs and Integrations

 

Apologies if this is incomplete but will continue to add the materials on the following days.

Custom Lightning Component Related List With Real Time REST Data

For this tutorial I’ll show a technique on how to integrate external data and display the data real time in Salesforce. This would not use an external object but a simple custom related list component that uses lightning:datatable base component and a controller than retrieves data via callout to an external REST resource and display them in Salesforce.

This is how it would look like.

For this I’m calling this a static REST resource which returns the following JSON response.

Next we need to display this data in a related list in Salesforce. We create a simple lightning component that we can add using Lightning App builder.

Start with the following lightning component markup.

And controller that calls a helper.

The helper creates a server side call that creates the REST callout. Then on successful response I’m setting the value for the mycolumns attribute by assigning a Javascript object assigning the properties of the column for the datatable. Then I simply assign the mydata attribute assigning and using JSON.parse to turn the response to a Javascript object. With that simple code I have a related list.

Note: you do not need the var actions as this is for another method I’m working on.

Then for my controller I have this simple call to my server

Then I simply drop the component on Lightning App Builder to the related list section for quick UI match. That should be it.

Salesforce Queueable Apex and Future annotations

Introduced for some time now particularly in Winter 15. Queueable Apex addresses some short coming of the @future methods. It’s an offspring of the marriage of @future methods and Batch Apex.

Queueable Apex allows you to submit jobs for asynchronous processing similar to future methods with the following additional benefits:

  • Non-primitive types – you can pass SObjects and custom apex types
  • Monitoring – you can monitor the job from the Apex jobs page in Setup or query the AsyncApexJob record
  • Chaining Jobs – create sequential jobs

How to use Queueable Apex:

  • Create a class that implements the Queueable interface
  • If you are going to make callouts you need to extend your implementation to Datatabase.AllowCallouts
  • To allow multiple primitive types create a contructor and call the public void execute method.
  • To execute the class, call it from your logic
  • There you can chain jobs by calling another Queueable class on the execute method.

Things to note: This counts to the your limit of 250 limit for asynchronous process per 24 hours.

How to parametize POST request on Salesforce Apex REST

On a standard POST call to a REST endpoint. The receiving endpoint expects a payload on the body of the POST. The service then parses the content of the body.

For example on the following Salesforce endpoint

https://integration-architect-dev-ed.lightning.force.com/apexrest/MyService

I created a POST request and sent on the body the following JSON:

{“companyName”:”GenePoint”,”caseType”:”Software”}

With Apex REST here are two ways you can create your REST POST service method

  • Create the method and supply the parameters for the function. Salesforce Apex REST will attempt to deserialize the payload data into those parameters.

Note: With this method passing the following XML payload will also work.

Consider the following when choosing which method to implement

  • If payload is easy and won’t change – method with parameters.
  • Do you have accept both JSON and XML payload – method parameters
  • For complex payload structure – method with User-defined type payload or the json String payload

Resource:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm