IBM



Site components

The WebSphere Commerce Flow Repository describes a set of JSP pages and the relationships among them. The JSP pages are grouped into the following abstract component hierarchy:

site; for example, ConsumerDirect

area; for example, ShoppingArea

section; for example, CheckoutSection

subsection; for example, StandardCheckoutSubsection

virtual-page; for example, ShippingAddressPage

actual-page; for example, ActualSingleShippingAddressPage

Each component has an interface, and each interface can have one or more implementations. In particular, the repository must contain at least one top-level interface-for the site-and at least one implementation of that interface. An interface describes how to enter and leave the component by specifying entry-ports and exit-ports. An implementation specifies the interfaces that it contains, as well as the following implementation aspects:

How the entry and exit ports of the containing interface map to the entry and exit ports of the contained interfaces

How the contained interfaces are linked to each other

For example, the XML fragment in Example 2-1 describes an area component, ShoppingArea, of a store.

Example 2-1 ShoppingArea description

<area id="ShoppingArea"/>

<interface id="ShoppingArea.i1" component-id="ShoppingArea">

   
<entry-port id="ShoppingArea.i1.e1" type="EntryPortType1"/>

   
<entry-port id="ShoppingArea.i1.e2" type="EntryPortType1"/>

</interface>

<implementation id="ShoppingArea.i1.impl1" interface-id="ShoppingArea.i1">

   
<component-interface id="ShoppingArea.i1.impl1.ci1" interface="CheckoutSection.i1" always-enabled="yes"/>

   
<entry-port-map id="ShoppingArea.i1.impl1.epm1" interface-entry-ports="ShoppingArea.i1.e1" component-entry-port="CheckoutSection.i1.e1"/>

   
<entry-port-map id="ShoppingArea.i1.impl1.epm2" interface-entry-ports="ShoppingArea.i1.e2" component-entry-port="CheckoutSection.i1.e2"/>

</implementation>

The actual-page components, found at the bottom of the component hierarchy, represent JSP pages of the site. Each actual-page component has an actual-page-interface, which represents the links in the JSP page as exit-ports. For example, the XML fragment in Example 2-2 describes an actual page, ActualSingleShippingAddressPage, of a store:

Example 2-2 ActualSingleShippingAddressPage description

<actual-page id="ActualSingleShippingAddressPage" file="SingleShippingAddressDisplay.jsp"/>

<actual-page-interface id="ActualSingleShippingAddressPage.i1" actual-page-id="ActualSingleShippingAddressPage">

   
<exit-port id="ActualSingleShippingAddressPage.i1.xNext" type="ExitPortType1"/>

</actual-page-interface>

In addition to JSP pages, WebSphere Commerce Flow Repository can describe non-JSP and non-HTML Web assets such as style sheets or images. These assets are represented by virtual-file components. Each virtual-file component can have one or more virtual-file-implementations. In Example 2-3, the virtual-file mechanism specifies the possible paths to the image color directory.

Example 2-3 Possible paths to the image color directory

<virtual-file id="vfile.color"/>

<virtual-file-implementation virtual-file-id="vfile.color" url="images/colors/color1/" id="vfile.color1.dir"/>

<virtual-file-implementation virtual-file-id="vfile.color" url="images/colors/color2/" id="vfile.color2.dir"/>

<virtual-file-implementation virtual-file-id="vfile.color" url="images/colors/color3/" id="vfile.color3.dir"/>

The repository enables a site to be built in many different ways, because for any component there can be several available implementations. Each implementation can describe a different flow or, in the case of virtual-file components, a different style. For instance, one implementation of the StandardCheckoutSubsection component might allow for splitting the order during the checkout while another implementation might not. Only one implementation of a component can be active for a particular configuration of the store (allowing the directory path in the preceding example to be determined at run time). The choice of which implementation is active at run time is conveyed by the features aspect of the repository. // Clear related topics


Redbooks
ibm.com/redbooks


+

Search Tips   |   Advanced Search