Page Life Cycle: Hello World Step - akumina/AkuminaTraining GitHub Wiki

Applies to

Akumina Foundation 3.4.0.0

Hello World Custom Step

We will create a custom function and add it as a custom step. When the Page Life Cycle reaches the step the alert will fire.

How to Deploy

  1. Download digitalworkplace.custom.js from the “/Style Library/DigitalWorkplace/JS” folder within SharePoint
  2. Paste the Code within digitalworkplace.custom.js
  3. Upload the updated digitalworkplace.custom.js to the “/Style Library/DigitalWorkplace/JS” folder within SharePoint
  4. Navigate to a page on your Digital Workplace site
  5. Flush your cache by clicking on the Akumina icon in the left rail, clicking the refresh icon, then clicking “Refresh All Cache”
  6. Refresh the page. The alert should fire.

Code

var AdditionalSteps = AdditionalSteps || {
}
if ((typeof AdditionalSteps.MoreSteps) === 'undefined') {
    AdditionalSteps.MoreSteps = {

        Init: function () {
            console.log('AdditionalSteps.MoreSteps.Init');
			var steps = [];
            steps.push({ stepName: "Auto Clear Local Cache", additionalSteps: [{ name: "Hello World Step", callback: HelloWorld}] });
            return steps;
        }
    }
}
function HelloWorld() {
    alert("Hello World");
    Akumina.Digispace.AppPart.Eventing.Publish('/loader/onexecuted/');
}

Result

image 1

References

To learn how to customize the Page Life Cycle using the Akumina Framework see the following articles: