Versions Compared

Key

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



Class Description: This class instantiates the Layout container and the workspace menus. It has to be noted that this class gets instantiated by the workspace manager, when a workspace gets activated, and hence it is internally dependent on the library to get instantiated.

...

APIs to be supported: NA

Registry Signature :

        CLCR.registerCmp({'COMP_TYPE':'WORKSPACE_CONTAINER'}, <<Your workspace container class here>>);

Scope: The workspace manager passes the workspace ID and other workspace related info about the workspace that has been activated.

Sample Code Snippet:

Code Block
languagejs
cbx.lib.workspaceContainer = Class(cbx.core.Component, {

...


	workspaceID: '',

...


	proportion: '',

...


	containerObj : null,

...


	constructor: function(config) {

...


	cbx.lib.workspaceContainer.$super.call(this);

...


	this.workspaceID = config.WORKSPACE_ID;

...


	this.createContainer();

...


	if($("#"+this.workspaceID)[0]){

...


		$("#"+this.workspaceID)[0].style.display="block";

...


		this.createItems();

...


			$("#"+this.workspaceID).children().remove();

...


			$("#"+this.workspaceID).append(this.containerObj);

...


	}

...


else{

...


	LOGGER.error("The workspace trying to be enabled is not a valid "

...


	+ "workspace for this channel.."

...


	+ " WORKSPACE ID: "+this.workspaceID);

...


	}

...


},

...


/Returns Workspace container object/

...


getWSContainer: function() {

...


	return this.getItem(0);

...


	},

...


createContainer : function(){

...


	var wsContainerConfig ={

...


		"eleType":"div",

...


		"id":this.workspaceID+"_WORKSPACE_CONTAINER"

...


	};

...


var container = new cbx.lib.layer(wsContainerConfig).getLayer();

...


	$(this.workspaceID).append(container);

...


	this.containerObj = container;

...


	this.addItem(this.containerObj)

...


	},

...


createItems: function() {

...


	var menuContainerConfig = {

...


	"eleType":"div",

...


	"class":this.workspaceID+"_MENU_CONTAINER",

...


	"id":this.workspaceID+"_MENU_CONTAINER"

...


	}

...


	var menuContainer = new cbx.lib.layer(menuContainerConfig).getLayer();

...


	var menuItems = iportal.menuitems.metadata.getMenuTools(this.workspaceID);

...


	var layoutContainerConfig = {

...


		"eleType":"div",

...


		"class":this.workspaceID+"_LAYOUT_CONTAINER",

...


		"id":this.workspaceID+"_LAYOUT_CONTAINER"

...


	}

...


var subWorkspaceConf = {

...


	"elem":layoutContainerParent,

...


	"workspaceId":this.workspaceID

...


	}

...


/**

...


* Instantiate layout manager on this Container

...

 
*/

...


this.layoutManager = new cbx.core.LayoutManager(subWorkspaceConf);

...

 
	},

...


getLayoutManagerObject: function() {

...


	return this.layoutManager;

...

 
	},

...


getLayoutManagerDOM: function() {

...


	return this.layoutManager.getContainer();

...


},

...


getWorkspaceWidgets: function() {

...


	return this.layoutManager.getWidgetContainerComponent();

...


},

...


getWidgetContainer : function(){

...


	return this.layoutManager.widgetContainer;

...


},

...


getLayoutContainer : function(){

...


	return this.layoutManager.widgetContainer;

...


	}

...


});

...


CLCR.registerCmp({'COMP_TYPE':'WORKSPACE_CONTAINER'}, cbx.lib.workspaceContainer);