Command, view, and URL registries

The command, view, and URL registries are part of the WebSphere Commerce command framework.

The WebSphere Commerce command framework determines how a command will execute and then returns a response based on the view returned by the executed command. The command execution and response is store dependent, which means that the same command can be implemented differently for each store, as well as return different responses for each store.

The following diagram illustrates the command, view, and URL registry structure in the WebSphere Commerce Server.

D

URL registry

The URL registry maps a command name to the actual interface of the command to be executed. Each URL registry entry is store sensitive, that is, each store can define a different interface for the same URL value. If the store version of the URL registry cannot be found, then the URL registry defined for the site (store 0) is used. By default, all URL registries are defined for the site.

URLs defined and registered in one store may be used by other stores. In order for one store to use URLs defined in another store, a store relationship of type com.ibm.commerce.URL must be created between the stores.

Command registry

Every command, whether it is a controller or task command, can be defined in the command registry. If a command is defined in the command registry, that definition will be used as the command implementation when the command is executed. If the command is not defined in the command registry, a default implementation will be used instead. Every command interface is assigned a default implementation that is used if the command is not defined the command registry.

If a command is defined in the command registry as a site level command (store 0), the site level implementation is used, except when the command is executed for a store that has defined a different implementation of the command.

The command registry allows different stores to use the same commands but to extend part or all of the implementations without changing the original flow of the command.

Commands defined and registered in one store may be used by other stores. In order for one store to use commands defined in another store a store relationship of type com.ibm.commerce.command must be created between the stores.

View registry

After a command is executed, in most cases, the requester of the command requires a response to be returned. When determining the response, the command framework considers the following factors:

  • The view found in the response properties after the command is executed.

  • The store on whose behalf the command was executed.

  • The device format of the request when the request was made.

Every view that returns a response must be defined in the view registry, either per store, or by default, by site. Each store will normally define the view for each possible device format of the incoming request. However, if a view is not defined by a store, the default view for the site will be used. The adapter handling the request will decide which device format and the default device format to use when determining which view to call. There is no one generic device format, so depending on the different types of requests that can be accepted by WebSphere Commerce, there may be a view defined for each device format.

Views defined and registered in one store may be used by other stores. In order for one store to use views defined in another store a store relationship of type com.ibm.commerce.view must be created between the stores.

Related concepts

Related reference