Request Handling by Spring
Handlers
They are beans that can handle a request. An OOTB handler has been provided to handle requests to build components - com.ptc.mvc.components.ComponentController. It prepares a ModelAndView (org.springframework.web.servlet.ModelAndView) which can be handled by the DispatcherServlet
To build a component, we need its description and the data to be presented. We have introduced the concept of builders, which will provide these artifacts. Component description will be represented via ComponentConfig and a ComponentConfigBuilder provides them. Component data will be represented via ComponentData and a ComponentDataBuilder provide them.
ComponentConfig and ComponentData together define the component information to be shown in the UI and will be represented by ComponentDefintion. It is the Model in MVC paradigm, where as the ComponentController is the Controller.
How find a builder?
A typical MVC resource to build a component will be ptc1/<handler_key>/<componentId> where
handler_key is used to map the request to a handler.
componentId represent the component to be build.
ComponentController is injected with a ComponentBuilderResolver, which will find the respective builders for the given componentId.
Internal artifacts of ComponentController
Few notable internals of a ComponentController
ComponentBuilderResolver, finds the ComponentConfigBuilder and ComponentDataBuilder for the componentId specified in the resource
defaultMappings defines the default views for different ComponentConfig.
ComponentParamsFactory create ComponentParams from request and response that will be made available in the builders.
The builders provide ComponentConfig and ComponentData, from which the Model, ComponentDefinition is made. ModelAndView is populated with ComponentDefinition and the view information comes either from the ComponentConfig or from the defaultMapping provided.
The artifacts that are in green are Windchill Client Architecture (e.g JCA) specific ones. The black ones are the ones provided by the component owners.
Was this helpful?