Unpack with Site Packager
Its time to create your first commerce site using Commerce Server. Navigate to the Commerce Sites node under Commerce Server Manager. Right-click the Commerce Sites folder and choose New, Unpack Site (see Figure 3.5).
The Unpack Site From dialog box allows the user to choose one of the solution sites. The solution sites are installed by default under the PuP Packages folder in the Microsoft Commerce Server installation directory. Note that the default installation doesn't insert any PuP files except a Blank file. The other PuP files are downloaded from the Web site discussed earlier. After downloading and installing the solution sites, Retail and SupplierActiveDirectory PuP files should be available along with Blank. For this example, choose Retail and then click the Open button (see Figure 3.6).
After a few seconds, the Site Packager (see Figure 3.7) shows the Unpack screen, which will allow you to quickly unpack the solution site into one of the predefined Web sites. This quick unpack will install both the e-commerce site as well as the BizDesk application under the same IIS Web site. To avoid this, as well as to explore detailed unpacking options, select the Custom Unpack option. Then click Next.
Figure 3.5 Starting to unpack a site.
Figure 3.6 Choosing the solution site retail for unpacking.
Figure 3.7 Performing a custom unpacking.
In the Unpack Method screen, select the Create a New Site option and click Next (see Figure 3.8).
Figure 3.8 Creating a new commerce site.
The Site Name screen asks the user to name the e-commerce site (see Figure 3.9). Call it Estore. Thus in the example, the names of the Commerce Server site and the Web site are the same for the sake of convenience. Go on to the next stage of the Site Packager by clicking the Next button.
Figure 3.9 Naming the commerce site.
The Select Resources screen (see Figure 3.10) gives the user the option to choose resources that will be used by this site. In Commerce Server terminology, a resource is an entity that provides functionality to the applications in a Commerce Server site. A resource is typically a COM based object whose services are used within the ASP pages of the application. For example, Direct Mailer runs as a service (DMLService.exe) and exposes COM interfaces to be used by applications to send mail. Resources are mainly classified into two types: global and site specific. Global resources are available to all the commerce server sites, whether the sites are on one or more servers. Site specific resources are really local to a site. If you want to know a little more about CS resources at this stage, feel free to jump to the section "CS Resources."
Continuing the exercise of unpacking the Retail solution site (refer to Figure 3.10), you can see that the items to the right side are resources that will be used for the site being installed. Keep all the resources selected in the Resources to Unpack box on the right side. Click the Next button. The Global Resource Pointers screen (see Figure 3.11) shows the mapping between the site-specific resources and global resources, if any.
If there is no global resource instance to map to, a new one will be created. If there already is a global resource instance, the user has the option to choose that instance. For example, we don't yet have a global resource instance for CS Authentication. Therefore an instance, CS Authentication (Estore), will be created at the global level. There would also be a site-level resource CS Authentication (Estore), which is just a pointer to the global resource. If we create another new site, the CS Authentication resource for Estore will be listed as being used. Thus, two sites could share the same global resource instance.
Figure 3.10 Selecting resources to be used.
Figure 3.11 Mapping to global resources--existing and new.
Clicking the Next button will bring up the Database Connection Strings screen, which creates the databases and connection strings for various resources we have chosen so far (see Figure 3.12).
Figure 3.12 Resources and their database.
As we can see from the screen (Figure 3.12), the datastore for resources can all be on a single database or split across different databases. Here we have chosen to have all resources, except Global Data Warehouse, on a single database called estore_commerce. Global Data Warehouse will be on a separate database.
The next input box asks you for the username and password for the master database. After you pass on the right values, Site Packager gives the list of applications that are in the solution site. Typically it will be the Retail site and the associated RetailBizDesk applications as shown in Figure 3.13.
Make sure that both the applications are chosen and then click the Next button. The Select IIS Web Sites and Virtual Directories screen is where you specify the Web sites for each of the applications. Choose the Retail application first and choose Estore as the Web site from the drop-down box. Also name the IIS application path as Estore (see Figure 3.14). This creates a virtual directory called Estore under the Estore Web site. If you choose to install the application files at the root of the site, you can leave this input box blank.
Similarly, choose the RetailBizDesk application to change its Web site to EstoreBizDesk and the IIS application path also to EstoreBizDesk. After this input, Site Packager goes into a frenzy of action for some time before it asks you for some data warehouse information that your site will use (see Figure 3.15)
Figure 3.13 Available applications in a packed solution site.
Figure 3.14 Commerce server site and IIS site mapping.
Give a meaningful name, such as Data Warehouse_Estore, to the site's data warehouse. Accept the default value of ESTORE_DW for the database name on the OLAP Server for the data warehouse. The OLAP Server is the server running the Analysis Service.
Click the OK button after giving the data warehouse details, and the Profiling System screens ask for schema definitions as shown in Figures 3.16 and 3.17. These XML files contain the definitions for creating the Profiles and Site Terms schema. The database schema, as well as initial data population, also can be accomplished by custom scripts using these screens.
Figure 3.15 Data warehouse settings.
Figure 3.16 First schema definition screen.
For one last time, Site Packager does the extraction and installation activity to install various resources and databases. The unpacking is complete and can be verified with the final screen of the process (see Figure 3.18). It gives information about the applications and databases created. Also, the entire unpacking process is written to a log file named Pup.log.
Figure 3.17 Second schema definition screen.
Figure 3.18 End of unpacking the solution site.
You can click the View Selected Application button in the final screen to launch either Estore or the EstoreBizDesk application. Before doing that, you will discover what Site Packager has accomplished as a result of unpacking and creating your starter applications.
Commerce Server resources are part of the core infrastructure from which a CS e-commerce site functions.
Table 3.1 lists the resources that are provided by Commerce Server.
Table 3.1 Available Resources
App Default Config
These resources store their data in the Commerce Server admin database as well as the site-specific database, depending on the resource. In the Commerce Server Manager, the global resources are visually organized under the Global Resources folder, whereas the site-specific resources are listed under Site Resources for each of the sites. I will discuss this after you have completed the unpacking with Site Packager. Also it is possible for a developer to create and add custom resources both at the global and site levels.
Even though we will deal with each of the resources in detail at appropriate places throughout the book, it would now be good to have a general understanding of each of these Commerce Server provided resources at this point.
Although there are only five distinct types of global resources, there could be more than one instance of a global resource. For instance, there could be a CS Authentication resource instance for Site 1, as well as a separate CS Authentication resource instance for Site 2. We will look at each of these resources more closely.
Direct Mailer (DM) runs as a Windows 2000 service (DMLService.exe). DM uses SQL Server 2000 or SQL Server 7.0 as its database and requires SQL Agent to be running in order to process e-mail jobs. Note that both DM and its database should be on the same computer. DM uses the services of Collaboration Data Objects(CDO), again a Windows 2000 object, to compose, format, and send mails using a Simple Mail Transfer Protocol (SMTP) server.
You can use the DM to send personalized and general e-mails to site users. A list of recipients could be generated from List Manager, a Commerce Server module, or by using a custom built query on your SQL Server database. The body of the e-mail message can be derived in many ways including Web pages, flat files, or an SQL Server database. DM can be run at the command line as well as called from ASP pages. A separate pipeline called the Direct Mailer Pipeline gives the capability to process the details of the e-mail in stages. The pipeline can be integrated with other modules of Commerce Server and also can be customized with third-party components.
Predictor runs as a Windows 2000 service (PredServ.exe) and uses a Data Warehouse configured on the server. The Predictor resource is used to build various models for analysis such as Predictor and Segment models. These models essentially establish a relationship between statistical data in your data warehouse. After a relationship is established, we could run through the model with minimum inputs to predict user behavior. Models use Cases, which are basically name/value pairs representing user profile data such as purchase history and clicks made. The schema for these models are called Model Configurations, and Commerce Server provides you with a default configuration called Transactions. It is possible to build new analysis model configurations with the Predictor schema.
After these models are built, ASP pages could use the Predictor Client object, a COM object, to access these models and get predictions based on a limited set of real-time inputs that are available about the current context.
Profiles is a Commerce Server 2000 object that manages two concepts in Commerce Server, namely Profiles and Site Terms. Profiles are aggregate information about your site that can be used in analysis of the site. Profile definitions are the schema for information to be collected either implicitly or explicitly from the Web site. For instance, you could define a user profile to collect site visitor information such as name, age, e-mail, and mailing address. When profiles are defined, they can be collected and stored in the data warehouse for analysis. The business desk module Profile Designer can also be used to manage profile definitions.
In order to make analysis and personalization more effective, you can make elements of a profile accept restricted values. If a site term called My Interests is defined with values such as Acrobatics, Movies, Food, and Baseball, this site term can be attached to a user profile called Interests. The Web site users will have to choose from the values that were defined for the site term.
The data warehouse in Commerce Server consists of a data warehouse SQL Server database for each commerce site, an OLAP database, and frequent processes that import data from various sources. Some of the sources of information about your site are Web site log files, user profiles, and transaction data. These can be imported into the data warehouse SQL Server database using Data Transformation Services (DTS). In the DTS task, you would define from where and what data to import.
From the data warehouse database, again DTS tasks are run to export a portion of data into an OLAP database. The OLAP database has structures called cubes into which data is stored and organized. The Commerce Server data warehouse has a logical schema that taps into the physical SQL Server and OLAP databases. You can build analysis models and run reports against the data warehouse.
Data warehousing is a specialized field of study in itself. However, we will look in more detail about data warehousing and analysis in a later chapter.
Commerce Server Authentication builds security on top of IIS authentication methods. CS installs an Internet Server API (ISAPI) filter called AuthFilter on the application Web sites. The AuthFilter can be configured to authenticate users against the Active Directory or made to look up against a custom data source. Also you can choose to automatically authenticate users by using the Autocookie feature of the AuthFilter.
CS also provides a COM object called AuthManager that can be used in ASP scripts to gather more information about the user and make decisions on content security. The AuthManager can also be used to validate users who don't accept cookies, thus enabling cookie-less browsing for your site visitors.
The site-specific resources affect the operations of their concerned sites and will not effect other sites on the server. We will take a brief look at what these resources provide to the sites.
App Default Config
This resource maintains the operational configuration of a commerce site and its associated business desk. It holds information that is used throughout the site such as the currency symbol, payment options accepted, and integration with BizTalk server. All of these are configurable according to the unique requirements of a site.
The other four site-specific resources define the database connection string for the commerce site. For example, the Campaigns resource defines the connection string to the database containing campaign data for the site, whereas the Transactions resource defines the information to connect to various transaction data of the site. These resources are used by many components of the site including the Business Desk.
If you had come to this section in the middle of the unpacking process, you could continue with the process and finish it (see Figure 3.10). If you have already unpacked the retail site, it's time to see what has been accomplished.
Explore the Changes
Commerce Server is tightly integrated with the products that form the Windows Distributed interNet Applications Architecture (DNA). Commerce Server applications are actually exposed as IIS Web sites. SQL Server is used to store information for the e-commerce site as well as for Commerce Server administration itself. OLAP Server is used to store the data warehouse requirements of a site. Further Commerce Server's COM objects operate using the COM+ infrastructure. Let's take a look at some of the key system changes that have happened after the unpacking and creation of our first store.
The nodes in Commerce Server Manager can be expanded as shown in Figure 3.19 to analyze the changes.
Figure 3.19 Changes after solution site unpacking is completed.
The IIS Sites
Because Commerce Server generated applications are Web sites under IIS, we should be able to see the Estore and EstoreBizDesk sites under the node for the Internet Information Services snap-in. In the example, these sites were created as virtual directories. We can also see the application files under Estore as well as EstoreBizDesk sites. These are the files that are served by the Web server in response to requests from browsers.
Commerce Server Manager
The commerce site Estore is added under the Commerce Sites folder. Each commerce site has its site-specific resources grouped under the Site Resources folder. For example, the App Default Config, Campaigns, and Product Catalog are found under that folder. Some of the site-specific resources such as Data Warehouse, Biz Data Service, and CS Authentication are also listed as Global Resources. When the site uses some of the global resources such as Predictor and Direct Mail, they are also listed under the Site Resources folder for the site. In short, all resource and commerce site uses will be listed under a single Site Resources folder for that site. In CSM, these global resource pointers are represented with a red arrow in the icon at the node.
Another folder to notice under the commerce site Estore is Applications. It lists all applications for that commerce site including the business desk. Because an application can run on one or more Web servers, the servers are listed under each application. In the example, Estore is a commerce application that runs on the physical Web server called ECOMMSRV. In a production environment, it is typical to have more than one Web server that runs a site. It is possible to add more servers in the Commerce Server Manager to start managing the application on a Web farm.
SQL Server Objects
Commerce Server creates a database called MSCS_Admin, which it uses to store administration information such as sites, resources, and Web servers. For each commerce site that is created using the Site Packager, a database is created with the naming convention <sitename>_commerce. This database holds all the database objects such as tables, stored procedures, triggers, and so on for the entire commerce site application. As already mentioned, high volume sites would typically create an application's database objects across multiple databases and servers.
If data warehouse is also part of the site resources, the data warehouse SQL Server database is also created using the name <sitename>_dw. In the example, these two databases are Estore_commerce and Estore_dw. For the data warehouse analysis, default OLAP cubes and dimensions are also created. This can be seen using the Analysis Manager. The Analysis Manager is available as a snap-in inside the CSM. Expand the node Analysis Servers (see Figure 3.20).
Figure 3.20 The OLAP server after unpacking the solution site.