Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Replaced 'cbx' and 'ct' with 'canvas'.

Class Description: This class is expected to render the application container and create the workspaces configured as per the meta data.

Called By: cbx canvas.core.WSManager

Meta data to be considered: ct canvas.metadata.getWorkspaces() → Returns an array of configured workspaces. The application container has to have that many child items as the length of this array

...

Code Block
languagejs
CLCR.registerCmp({'COMP_TYPE':'APPLICATION_CONTAINER'}, <<Application container class>>);

...

Scope: The core layer passes on view port container element to this class, so that it does not have to query the DOM to get the parent element on which it has to be appended.

...

Code Block
languagejs
canvas.lib.ApplicationContainer = Class(cbxcanvas.core.Component, 
{
	layoutManager: '',
	constructor: function(config)
	{
		this.wsManagerConfig = config;
		canvas.lib.ApplicationContainer.$super.call(this);
		this.createItems();
	},
	createItems: function() 
	{
		var appContainerConfig = 
		{
			"eleType":"div",
			"id":"application-container"
		};
		var appContainerObj = new canvas.lib.layer(appContainerConfig).getLayer();
		this.addItem(appContainerObj);
		delete appContainerConfig;
		//* Start process of creating the workspace and layout */
		var wsContainerConfig;
		var wsArr = cbxcanvas.core.ws.metadata.getWorkspaces();
		canvas.lib.workspacehandler.createWorkspaces(wsArr,this);
		 
	},
	//* Return the object of app container containing the workspaces*/
	getAppContainer: function() 
	{
		return this.getItem(0);
	}
});
CLCR.registerCmp({'COMP_TYPE':'APPLICATION_CONTAINER'},canvas.lib.ApplicationContainer);

...

Code Block
languagejs
var workspaceContainerConfig = 
{
				"eleType": "div",
				"id" : wsArray[index].WORKSPACE_ID,
				"class": "workspace "+wsArray[index].WORKSPACE_ID,
				"style": 
	{
					"display":"none"
				}
			};
			var wcContainerObject = new canvas.lib.layer(workspaceContainerConfig).getLayer();
			$(this.appContainer.getItem(0)).append($(wcContainerObject));

...

Code Block
languagejs
activateWorkspace: function(workspaceId,index,callBackFn,scope)
{

		callBackFn = cbxcanvas.isFunction(callBackFn)?callBackFn:cbxcanvas.emptyFn;

		scope = scope?scope: this;

		var config = 
	{
				WORKSPACE_ID:workspaceId,
				SYSTEM_WORKSPACE_IND:SYSTEM_WORKSPACE_IND
		};

		//**
		 * Pre workspace activate operations here
		 */
		cbxcanvas.core.ws.metadata.getWorkspaceManager().wsSelectionHandler(config,null,function(wsContainer)
	{
			//** 			 * Post workspace activate operations here
			 */
		},scope);
	}