# Patent

## Title
Associating command surfaces with multiple active components

## Abstract

The same command surface on a page may be associated with unrelated components and applications. Each of the components registers the commands associated with a shared command surface that they will be utilizing. Each component may utilize an arbitrary number of commands that are associated with the command surface. The command manager acts as a message broker between the components on the page and the command surfaces. When a command that is associated with a command surface is received, the command manager dispatches the command message to the appropriate components.

## Background
BACKGROUND
In order to accommodate the diverse components supported by web platforms and applications, many online products and services implement user interface designs with distributed commands. These user interfaces feature numerous, distinct command surfaces such that each component in the application has its own command set. Each application is tightly integrated with its associated component in the user interface. For example, a web page may include two different components that include similar functionality (i.e. two different textboxes) but each component includes its own independent command surface.
SUMMARY
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
The same command surface may be associated with unrelated components and applications on a page. Components register the commands associated with a shared command surface that they will be utilizing. Each component may utilize an arbitrary number of commands that are associated with the command surface. A command manager acts as a message broker between the components on the page and the shared command surfaces. When a command that is associated with a command surface is received, the command manager dispatches the command message to the appropriate components.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 illustrates an exemplary computing system;
FIG. 2 shows a system for associating command surfaces with multiple active components;
FIG. 3 illustrates a process for associating a command surface with multiple components; and
FIG. 4 shows a process for receiving and dispatching a command to components that is received from a command surface.



DETAILED DESCRIPTION
Referring now to the drawings, in which like numerals represent like elements, various embodiments will be described. In particular, FIG. 1 and the corresponding discussion are intended to provide a brief, general description of a suitable computing environment in which embodiments may be implemented.
Generally, program modules include routines, programs, components, data structures, and other types of structures that perform particular tasks or implement particular abstract data types. Other computer system configurations may also be used, including hand-held devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, minicomputers, mainframe computers, and the like. Distributed computing environments may also be used where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote memory storage devices.
Referring now to FIG. 1, an illustrative computer architecture for a computer 100 utilized in the various embodiments will be described. While computer 100 is generally illustrated as a client computing device, computer 100 may be configured as a client, a server, mobile device, or any other computing device. Computer 100 includes a central processing unit 5 (“CPU”), a system memory 7, including a random access memory 9 (“RAM”) and a read-only memory (“ROM”) 10, and a system bus 12 that couples the memory to the CPU 5. A basic input/output system containing the basic routines that help to transfer information between elements within the computer, such as during startup, is stored in the ROM 10. The computer 100 further includes a mass storage device 14 for storing an operating system 16, application programs 24, and other program modules, which will be described in greater detail below.
The mass storage device 14 is connected to the CPU 5 through a mass storage controller (not shown) connected to the bus 12. The mass storage device 14 and its associated computer-readable media provide non-volatile storage for the computer 100. Although the description of computer-readable media contained herein refers to a mass storage device, such as a hard disk or CD-ROM drive, the computer-readable media can be any available media that can be accessed by the computer 100.
By way of example, and not limitation, computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, digital versatile disks (“DVD”), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by the computer 100.
According to various embodiments, computer 100 may operate in a networked environment using logical connections to remote computers through a network 18, such as the Internet. The computer 100 may connect to the network 18 through a network interface unit 20 connected to the bus 12. The network connection may be wireless and/or wired. The network interface unit 20 may also be utilized to connect to other types of networks and remote computer systems. The computer 100 may also include an input/output controller 22 for receiving and processing input from a number of other devices, including a keyboard, mouse, or electronic stylus (not shown in FIG. 1). Similarly, an input/output controller 22 may provide output to a display screen that includes a user interface 28, a printer, or other type of output device. Computer 100 may also be coupled to data source(s) (not shown) through a network connection 18, and/or some other connection.
As mentioned briefly above, a number of program modules and data files may be stored in the mass storage device 14 and RAM 9 of the computer 100, including an operating system 16 suitable for controlling the operation of a networked personal computer, such as the WINDOWS VISTA® operating system from MICROSOFT CORPORATION of Redmond, Wash. The mass storage device 14 and RAM 9 may also store one or more program modules. In particular, the mass storage device 14 and the RAM 9 may store one or more application programs 24, such as a web browser application 25. For example, browser program 25 may be the MICROSOFT INTERNET EXPLORER® application.
Server 23 is configured to provide site services for computer 100. As illustrated, server 23 includes site software that is configured to provide a site that is accessed through browser application 25 on client 100. According to one embodiment, the site software, such as MICROSOFT SHAREPOINT SERVICES® may be used to provide collaboration tools, document storage tools and workflow tools that are associated with a site. For example, a site may be created with components that provide users (team members) with ways to share documents; share calendar or event information; generate and discuss ideas about a project; and adding, assigning, and tracking tasks concerning a project. The site may be configured as an Internet Site, Extranet Site, and/or an Intranet site or any other site that is accessible to users.
User interface (UI) 28 is designed to provide a user with a visual way to view the site and to interact with command surfaces and components on a web page. Instead of each command surface on a page being directly coupled to only one component on a page, the command surface may be coupled to more than one component on a page, even when the components are associated with different applications. As illustrated in UI 28, the same command surface on a page is associated with two different components (C1 and C2). The command surface may be a command surface such as a Ribbon, a toolbar, a pie menu, and the like. The components on the page may be unrelated and associated with different applications. Generally, each component registers the commands associated with a command surface that they will be utilizing with command manager 26. Command manager 26 acts as a message broker between the components on the page and the command surfaces. Each component may utilize an arbitrary number of commands that are associated with the command surface. For example, component C1 may use three of the commands from the command surface and C2 could use two of the commands. A component (e.g. C3) could be a component that is not visible to a user. For example, component C3 could be a spell checker that registers to be informed of a save command that is associated with the command surface. The components may also attach or detach from a command surface or dynamically change the number of commands during runtime. A component may register a command to be a focused command or a global command. When a command is registered as a global command by a component, then even when the component does not have the current focus it still receives the command when the command is activated on the command surface. When a command is registered as a focused command, then the component receives notification of the command when it is currently has the focus. When a command that is associated with a command surface is received, the command manager 26 dispatches the command message to the appropriate components. The operation of command manager 26 is described in more detail below.
FIG. 2 shows a system for associating command surfaces with multiple active components. As illustrated, system 200 includes page 205, component 210, component 212, component 214 and command manager 26 that includes command dispatcher 220, focus manager 225, undo manager 230, and command surfaces 235.
As discussed above, command manager 26 manages the interaction between the command surfaces and the different components. While command dispatcher 220, focus manager 225, undo manager 230, and command surfaces 235 are shown as integrated within command manager 26, some or all of their functionality may be located externally from command manager 26.
The components on page 205 may represent numerous applications and controls that are hosted in web sites, including web services and web applications. For example, rich text editors, clocks, spread sheet modules, data forms, drawing tools, and the like, are components that may be included on a page.
Any component that desires to utilize a shared command surface registers with command manager 26. After registering, or during registration, the component specifies the commands that they wish to be notified of when they occur on a command surface. According to one embodiment, the commands are specified to the command manager in a list of one or more commands (i.e. commands 211, 213 and 215). A component may specify the command to be a global command or a focused command. A global command is dispatched to the component by the command manager 26 even when that component does not have focus. In this way, a component may react to a command on a command surface even when that component is not active. A focused command is only dispatched to the component when that component has focus. A component may attach a command or detach a command from a command surface at any time. For example, a component may change the active commands available on the command surface based on the change of state of an application. The component may also specify whether or not it may receive focus.
The command manager 26 may periodically, or as a side effect of a particular event on the page, poll the registered components on behalf of the command surfaces in order to determine the state of each command that they are hosting. In one embodiment, this command state is composed of whether the command is currently enabled or disabled in the component and an collection of other state information associated with the command. For example, a “Bold” button may poll for whether it is currently enabled (turned on) or not in addition to whether the button is active in the command surface. According to one embodiment, when a command is received on a command surface (i.e. user clicks on a command) the command manager sends the command to the command dispatcher 220.
Command Dispatcher 220 interacts with the registered components on a page. In this example, command dispatcher 220 is configured to interact with component 210, component 212 and component 214. The command dispatcher is configured to dispatch commands to the components, request the state of commands and determine if the commands are enabled. The command dispatcher keeps a record of the command handlers registered for the commands and uses this information to route the commands and messages to the components. According to one embodiment, the command dispatcher 220 may send other messages to the components and/or additional information along with the dispatched commands. For example, the information may relate to data used in processing the command, state information, and the like. Commands from the command dispatcher may also run through the focus manager 225 as a proxy to help ensure that the correct components receive the commands. According to one embodiment, the focus manager is coupled between the main command dispatcher 220 and the components. In this embodiment, the focused commands are registered with the focus manager 225 and the focus manager 225 in turn registers for them with the main command dispatcher 220. When a command is dispatched through the main command dispatcher 220 into the focus manager 225, the focus manager 225 can then route the command according to which component, if any, currently has the focus.
The focus manager 225 manages the selection of components on page 200. The focus manager 225 is configured to keep track of the component that currently has the focus on the page (the active component). When an event occurs on the page (a user click for example), the component that detects the event may request, with the focus manager 225, that it become the active component. The focus manager 225 will then tell the previously active component to yield the focus. The focus manager 225 will then notify the requesting component that it now has the focus. When a selection occurs outside of an active component on the page, the focus manager may send a message to the components that no component is active, such that each of the components may detach focus. When the component receives focus, the command manager 26 sends a notification to the component such that it may request the current focus. Similarly, the component losing focus may be informed such that it may yield the current focus. According to one embodiment, when another component requests focus, the previously focused component is asked to yield focus by command manager 26.
Undo Manager 230 is used to undo/redo commands that have been executed. Undo manager 230 keeps track of the commands that have been executed, and when an undo or redo command is requested, it helps to ensure that the correct component receives the request to undo or redo the command.
Command surfaces 235 keeps track of the command surface(s) that are associated with the components on the page. The command surface may be any type of command surface such as a Ribbon, a toolbar, a pie menu, and the like. The command surface itself does not handle the processing of a command that is associated with it. Instead, when a command is activated on a command surface, the command manager 26 directs the command to the appropriate components on the page. According to one embodiment, command surfaces in command surfaces 235 support messages to refresh the control states of the commands that are associated as well as to enable/disable the commands for the components. The command surfaces also include defined methods for utilizing the command surface. For example, a method may be provided in a Ribbon control to show a previously unseen contextual tab. Upon initialization of the command surface by command manager 26, it draws its default content. According to one embodiment, the data associated with the command surface is stored within an XML file.
While not illustrated in FIG. 2, other functionality may be included within command manager 26. For example, other managers may be implemented. For instance, a task manager could be programmed to process work requests related to the components.
Referring now to FIG. 3, an illustrative process for associating a command surface with multiple components is described.
When reading the discussion of the routines presented herein, it should be appreciated that the logical operations of various embodiments are implemented (1) as a sequence of computer implemented acts or program modules running on a computing system and/or (2) as interconnected machine logic circuits or circuit modules within the computing system. The implementation is a matter of choice dependent on the performance requirements of the computing system implementing the invention. Accordingly, the logical operations illustrated and making up the embodiments described herein are referred to variously as operations, structural devices, acts or modules. These operations, structural devices, acts and modules may be implemented in software, in firmware, in special purpose digital logic, and any combination thereof.
After a start operation, process 300 flows to operation 310 where the command manager is initialized. The command manager acts as a message broker between the components on a page and the command surfaces. According to one embodiment, the command manager initializes the command dispatcher, the focus manager, the undo manager and the command surface(s) that are to be shared among components on the page.
Moving to operation 320, the components on the page are registered with the command manager. Any component on a page that desires to utilize a shared command surface registers with the command manager.
Flowing to operation 330, the components register the commands they wish to be notified of when they occur on a command surface. A component may register to receive focused commands or global commands. When a command is registered as a global command by a component, then even when that component does not have the current focus it still receives the command when the command is activated on the command surface. When a command is registered as a focused command, then that component receives notification of the command only when it is currently has the focus. The component also provides methods to handle the commands when the component is called on to execute the command.
Transitioning to operation 340, the command surface(s) to be associated with the components are initialized. The command surface may be any type of command surface such as a Ribbon, a toolbar, a pie menu, and the like. Command surfaces support messages to refresh the control states of the commands that are associated with components as well as to enable/disable the commands for the components. The command surfaces also include defined methods for utilizing the command surface.
The process then flows to an end operation and returns to processing other actions.
FIG. 4 shows a process for receiving and dispatching a command to components that is received from a command surface.
After a start operation, process 400 flows to operation 410 where the command is received from a command surface. When a command is activated on a command surface the command is redirected to the command manager that handles the routing of the command to the appropriate components.
Moving to operation 420, the components that are to receive the dispatched command are determined. Generally, the determination of where to dispatch the command is based on which components registered to receive notification of the commands as well as the current focus of the component. For example, as discussed above, some components desire to be informed of a command whenever it occurs, whereas other components desire to be informed only when they have the focus.
At operation 430, a determination may be made as to whether the determined components are ready to process the command. Before dispatching the command to the component(s), the command manager may poll the component(s) to determine if each component is ready to process the command.
For each component that is ready to process the command, the process moves to operation 440 where the command is dispatched to those determined components.
Moving to operation 450, a record is maintained regarding the commands that have been executed on the page and what components were notified. In this way, when an undo or redo command is requested, it helps to ensure that the correct component receives the request to undo or redo the command.
The process then flows to an end operation and returns to processing other actions.
The above specification, examples and data provide a complete description of the manufacture and use of the composition of the invention. Since many embodiments of the invention can be made without departing from the spirit and scope of the invention, the invention resides in the claims hereinafter appended.

## Claims

1. A method for associating a command surface with active components, comprising:
associating a command surface on a web page with a first component associated with a first application and associating the command surface on the web page with a second component associated with a second application that is unrelated to the first component; wherein the command surface includes user selectable commands for performing actions;
accessing a first command list for the first component that identifies the commands included on the command surface that the first component is registering to receive notifications from and accessing a second command list for the second component that identifies the commands included on the command surface that the second component is registering to receive notifications from, wherein the first component and the second component are both registering to receive notifications from at least one same user selectable command on the command surface;
associating each of the commands in the first command list with the first component and associating each of the commands in the second command list with the second component;
determining when one of the commands included on the command surface is activated;
determining when the first component should receive the command based on the command being associated with the first component and determining when the second component should receive the command based on the command being associated with the second component; and
dispatching the command to the first component for processing when determined that the first component should receive the command and dispatching the command to the second component for processing when determined that the second component should receive the command.

2. The method of claim 1, wherein accessing the first command list and the second command list comprises polling the first component to acquire the first command list and polling the second component to determine the second command list; wherein the first and second components are able to modify their command registration.

3. The method of claim 1, wherein each of the commands in the first command list and the second command list is a global command or a focused command; wherein the global command indicates to dispatch the command regardless of a current focus on a component and wherein the focused command indicates to dispatch the command based on the current focus on the component.

4. The method of claim 3, further comprising determining that the first component is to receive the command when the command is associated with the first component as a global command or a focused command when the first component has the current focus; determining that the second component is to receive the command when the command is associated with the second component as a global command when the first component has the current focus.

5. The method of claim 3, further comprising changing the current focus in response to receiving a request from either the first component or the second component to change the focus or other code on the web page.

6. The method of claim 4, further comprising polling the first component before dispatching the command to determine whether the first component is ready to process the command and polling the second component before dispatching the command to determine whether the second component is ready to process the command.

7. The method of claim 4, further comprising maintaining record of commands that have been processed; and when an undo procedure is initiated informing components of commands to undo.

8. The method of claim 1, wherein the first component and the second component can detach an associated command during runtime.

9. The method of claim 1, wherein the first application and the second application are different applications.

10. A non-transitory computer-readable storage medium having computer-executable instructions that when executed by at least one processor perform a method for associating a command surface with active components, the method comprising:
initializing a command manager that is configured to act as a broker between a command surface on a web page and active components, including a first component and a second component that is unrelated to the first component; wherein the command surface is not directly coupled to either the first component or the second component and includes user selectable commands for performing actions;
accessing a first command list for the first component that identifies at least one of the user selectable commands included on the command surface that the first component is registering to receive notifications from and accessing a second command list for the second component that identifies at least one of the user selectable commands included on the command surface that the second component is registering to receive notifications from; wherein the first command list and the second command list comprises commands included on the command surface and wherein the first command list and the second command list each include at least one same user selectable command on the command surface, and wherein the first component and the second component are both registering to receive notifications from at least one same user selectable command on the command surface;
registering with the command manager each of the commands in the first command list for the first component and each of the commands in the second command list for the second component;
determining when the first component should receive a command activated on the command surface based on the commands registered for the first component and determining when the second component should receive the command based on the commands registered for the second component; and
dispatching, by the command manager, the command to the first component for processing when determined that the first component should receive the command and dispatching the command to the second component for processing when determined that the second component should receive the command.

11. The computer-readable storage medium of claim 10, the method further comprising registering the first component and the second component with the command manager and polling the first component and the second component to acquire the first command list and the second command list.

12. The computer-readable storage medium of claim 10, the method further comprising identifying each of the commands in the first command list and each of the commands in the second command list as a global command or a focused command; wherein the global command indicates to dispatch the command regardless of a current focus on a component and wherein the focused command indicates to dispatch the command based on the current focus on the component.

13. The computer-readable storage medium of claim 10, the method further comprising polling the first component and the second component to determine whether the first component is ready to process the command and to determine whether the second component is ready to process the command.

14. The computer-readable storage medium of claim 10, the method further comprising maintaining record of commands that have been processed; and when an undo procedure is initiated informing components of commands to undo.

15. The computer-readable storage medium of claim 10, the method further comprising detaching one or more of the commands that are registered with the command manager during runtime.

16. A system for associating a command surface with components; comprising:
at least one processor; a memory; and a computer-readable medium;
an operating environment stored on the computer-readable medium and executable on the at least one processor;
a display that is configured to display a web page that includes a command surface that includes user selectable commands; a first component that is associated with a first application and a second component that is unrelated to the first component and is associated with a second application, wherein the command surface is not directly coupled to either the first component or the second component; and
a command manager that is configured to:
receive a registration request from the first component and the second component to associate with the command surface;
receive and access a first command list from the first component that identifies the commands included on the command surface that the first component is registering to receive notifications from and a second command list from the second component that identifies the commands included on the command surface that the second component is registering to receive notifications from; wherein the first command list and the second command list each identify commands included on the command surface and include at least one same user selectable command and wherein the first component and the second component are both registering to receive notifications from at least one same user selectable command on the command surface;
register each of the commands in the first command list for the first component and register each of the commands in the second command list for the second component;
receive a command from the command surface when activated and determine when the first component should receive the command based on the commands registered for the first component and determine when the second component should receive the command based on the commands registered for the second component; and
dispatch the command to the first component for processing when determined that the first component should receive the command and dispatch the command to the second component for processing when determined that the second component should receive the command.

17. The system of claim 16, wherein the command manager is further configured to classify each of the commands in the first command list and each of the commands in the second command list as a global command or a focused command; wherein the global command indicates to dispatch the command regardless of a current focus on a component and wherein the focused command indicates to dispatch the command based on the current focus on the component.

18. The system of claim 16, wherein the command manager is further configured, before dispatching the command to the first component for processing, to poll the first component to determine whether the first component is ready to process the command and, before dispatching the command to the second component for processing, to poll the second component to determine whether the second component is ready to process the command.

19. The system of claim 16, wherein the command manager is further configured to maintain record of commands that have been processed; and when an undo procedure is initiated inform components of the commands to undo.