Class idx.app.WorkspaceType


Extends dijit._Widget, idx._ArgumentMixer.
WorkspaceType widget describes how any Launcher widget may create a Workspace (which is analogous to a Dojo ContentPane). WorkspaceType's are used within the TabMenuLauncher to create the tabs (and possibly create Open menu options in the future). Each WorkspaceType references an external URL in order to obtain content, and thus eases development of different workspaces by different developers. Additionally, the referenced URLs need only provide the page fragment for their content (including any dojo.require() calls for specific modules that may be required by that workspace).
Defined in: <idx\app\WorkspaceType.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 

Field Summary

Field Attributes Field Name and Description
 
Indiciates if workspaces of this type can be closed.
 
Indicates whether or not workspaces of this type should ask the user for confirmation before closing whether or not the workspace has been marked as dirty.
 
The message template to use to confirm closing workspaces of this type when the workspace is NOT flagged as "dirty" (e.g.
 
The message template to use to confirm closing workspaces of this type when the workspace is flagged as "dirty" (e.g.
 
The flag indicating if the user can directly launch workspaces of this type type independant of other workspaes.
 
icon 
The optional URL for the icon to associate with this workspace type.
 
The number of workspaces of this type that should be initially opened.
 
The maximum number of workspaces of this type that can be open at any time.
 
The text resources to use with workspaces of this type.
 
The URL template for obtaining the content for workspaces of this type.
 
The workspace arguments to use when constructing the workspace.
 
The unique key for identifying workspaces of this type.
 
The name of the workspace type.

Method Summary

Method Attributes Method Name and Description
 
constructor(args, node)
Constructor - Currently does nothing
 
Formats the message for confirming the closing of the workspace with the user.
 
Formats the message for a failed load of a workspace of this type.
 
formatLoadingMessage(title, args)
Formats the message to display while loading a workspace of this type.
 
Formats the title for workspaces of this type.
 
formatURL(args)
Formats the URL for workspaces of this type using the specified URL template.
 
Overrides dijit._Widget.postMixInProperties() to handle the loading/overriding of resources.

Constructor Detail

idx.app.WorkspaceType()

	   Example usage:
	   <div dojoType="idx.app.TabMenuLauncher" 
			 defaultWorkspaceTypeID="HOME" 
			 stateCookieName="idx.app.launcher">
	   			<div dojoType="idx.app.WorkspaceType"
	   				 workspaceTypeID="HOME" 
	   				 urlTemplate="tests/home.html" 
	   				 mixinArgs="{workspaceTypeName: 
	   				 resources.homeTabTitle}"/>
	   </div>
See:
idx.app.TabMenuLauncher
idx.app.TabMenuDock

Field Detail

{boolean} closeable

Indiciates if workspaces of this type can be closed. Typically, this is only set to false in the case of permanently-displayed workspaces.
Default Value:
false --> never implemented, but needs to be

{boolean} confirmClose

Indicates whether or not workspaces of this type should ask the user for confirmation before closing whether or not the workspace has been marked as dirty. If the workspace has been marked as dirty then confirmation will always be asked for before closing the workspace.
Default Value:
false --> not implemented, may need to be

confirmCloseMessage

The message template to use to confirm closing workspaces of this type when the workspace is NOT flagged as "dirty" (e.g.: no unsaved changes). If set to empty string or null then an attempt is made to find the message template in "this.resources". If no message can be resolved then no confirmation is performed.

confirmDirtyCloseMessage

The message template to use to confirm closing workspaces of this type when the workspace is flagged as "dirty" (e.g.: unsaved changes). If set to empty string or null then an attempt is made to find the message template in "this.resources". If it still cannot be found then it falls back to "this.confirmDirtyMessage" which may also be specified in resources. If no message is available for confirmation of closing the workspace then no confirmation is performed.

{boolean} directOpen

The flag indicating if the user can directly launch workspaces of this type type independant of other workspaes. If true, then the user is typically provided with a means to directly create a new workspace of this type, if false then the means to create this workspace depends on another workpace programmatically triggering the event to open it (usually with some sort context provided).
Default Value:
true --> would be used to hide from open menu and only programmatically opening is possible --> i'm sure this is not be used in practice (i don't think this is fully implemented)

{String} icon

The optional URL for the icon to associate with this workspace type.
Default Value:
""

{int} initialOpen

The number of workspaces of this type that should be initially opened. Currently values of 0 and 1 make sense for this. Specifying a value higher than 1 would seem to indicate the need for parameterizing the URL template on construction.
Default Value:
1 --> believe this is ALWAYS 1 in practice currently (0 is possible in ConsoleFrame)

{int} maxOpen

The maximum number of workspaces of this type that can be open at any time. If set to zero (0) then the it is effectively unlimited. If set to one (1) then any attempt to open a workspace of this type beyond the first, should simply bring focus to the one that was originally opened, if greater than one (1) then any attempt to open workspaces of this type beyond the first should result in an error displayed to the user.
Default Value:
1 --> believe this is ALWAYS 1 in practice currently

resources

The text resources to use with workspaces of this type. If not provided then the default resources are used. type Object
Default Value:
null

{String} urlTemplate

The URL template for obtaining the content for workspaces of this type. This is a "template" because a future enhancement may provide for specifying query-parameter substititution values. This would be useful for workspace types that are initially hidden but later openned programmatically.
Default Value:
""

{Object} workspaceArgs

The workspace arguments to use when constructing the workspace.
Default Value:
null

{String} workspaceTypeID

The unique key for identifying workspaces of this type. This can be used with the launcher to create a new workspace.

{String} workspaceTypeName

The name of the workspace type. This should come from an application-defined resource bundle as a displayable name for the workspace type.
Default Value:
""

Method Detail

constructor(args, node)

Constructor - Currently does nothing
Parameters:
{Object} args
{Object} node

{String} formatConfirmCloseMessage(workspace)

Formats the message for confirming the closing of the workspace with the user. This can be overridden by workspace type via the specified resources or by overriding this method.
Parameters:
{Workspace} workspace
Returns:
{String} msg

{String} formatFailedLoadMessage(title, args)

Formats the message for a failed load of a workspace of this type.
Parameters:
{String} title
{Object} args
Returns:
{String} msg

{String} formatLoadingMessage(title, args)

Formats the message to display while loading a workspace of this type.
Parameters:
{String} title
{Object} args
Returns:
{String} msg

{String} formatTitle(args)

Formats the title for workspaces of this type. This uses the "templateTitle" resources along with the properties of this widget and the specified arguments. The default template title is "${workspaceTypeName}" and using this widget to format that yields a title that is equivalent to the workspace type name.
Parameters:
{Object} args
Returns:
{String} title

{String} formatURL(args)

Formats the URL for workspaces of this type using the specified URL template. The specified arguments can be used to pass parameters to the URL. If the urlTemplate ends in "?*" then all of the arguments are tacked on at the end as query parameters.
Parameters:
{Object} args
Returns:
{String} url

postMixInProperties()

Overrides dijit._Widget.postMixInProperties() to handle the loading/overriding of resources.
See:
dijit._Widget.postMixInProperties