Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Landing  Landing page is the first page or screen that opens up once you log on to the application. Landing page can have an image or any workspaces. By default, Canvas Technology provides sample-landing-page as the default page that contains the icons of the workspaces.

...

Code Block
languageactionscript3
canvas.ns('canvas.applnlayout.utkarsh.landingpage');
/**
*@namespace"canvas.applnlayout.card"
*@description This component is currently responsible Jquery Framework to
*rendered card layout header.
*/
canvas.applnlayout.utkarsh.landingpage = Class({
	/**
	*@class"canvas.applnlayout.utkarsh.landingpage"
	*@description The constructor gets the metadata and parent element(#HEADER).
	*/
	parentElem: null,
	constructor: function(config) {
		this.parentElem = config.parentElem;
		this.itemList = wsArr = canvas.workspace.metadata.getWorkspaces();
		/**
		*This loop is to support multilingual. It gets the value of the String
		*correspondingtothevalueofWORKSPACEcorresponding to the value o fWORKSPACE_DISPLAY_NMinthepropertyfileNM in the property file
		*givenintheBUNDLE_KEY.
		*/
		for (var index = 0; index <this.itemList.length; index++) {
			this.itemList[index].ITEM_LABEL = !canvas.isEmpty(CRB.getBundleValue(this.itemList[index].BUNDLE_KEY, this.itemList[index].WORKSPACE_DISPLAY_NM)) ? CRB.getBundleValue (this.itemList[index].BUNDLE_KEY, this.itemList[index].WORKSPACE_DISPLAY_NM) : this.itemList[index].WORKSPACE_DISPLAY_NM;
		}
	},

/**
*@method getHeaderDOM
*@memberof "canvas.applnlayout.utkarsh.landingpage"
*@description This method is responsible for loading the user picture, user
*info, last login time with the template(cardheader.cttpl).
*/
getLandingDOM: function() {
	var componentJSON = {};
	var tmpLayer = canvas.templateManager.createTemplate(
	'al-landing-page.cttpl', this.itemList,canvas.util.getTemplatePath());
	tmpLayer.getTemplate(this.applyTemplate, this);
	},

/**
*@method applyTemplate
*@memberof "canvas.applnlayout.utkarsh.landingpage"
*@description This method gets the template,appends it to the parent
*element and adds click listener for user preferences and
*logout.
*/
applyTemplate: function(template, tmpClass) {
	if (!canvas.core.isEmpty(this.parentElem)) {
	$(this.parentElem).append(template); 
	} 
$(this.parentElem).find('.workspaceIconBlock').on('click', function(e) {
	var workspaceID = $(this).attr('data-itemid');
	canvas.workspace.metadata.getWorkspaceManager().getContainer().switchWorkspace(workspaceID);
	});
doIScroll('CONTENT_DIV', 'refresh');
} 
}); 

CLCR.registerCmp({
	"COMPONENT": "utkarsh-sample-landing-page",
	"APPLICATION_FW": "JQM"
}, canvas.applnlayout.utkarsh.landingpage); 

...