Share via


Adding Image Management to your Commerce Site Part(I)

In this post I hope to give you some ideas of how to manage images with Commerce Server. I am going to show how to associate multiple images\files to a product catalog data then upload the associated files to your commerce site. We will also solve the problem of when the products are removed the associated images are deleted as well.

Multiple File Requirements

Before going further lets understand some basic requirements:

  • We need to associate multiple files with a Product Catalog Data. These files can be images or other types of media like pdf files.
  • Provide mechanism for uploading files using Catalog Manager from business users desktop or network.
  • Allow business users to search for images.
  • Provide mechanism for moving files to a Commerce Site.
  • When Product Catalog Data is deleted so should the files associated.

So now we have our requirements let begin on how we are going to address the above requirement.

Multiple Files

To associate more than one file we need to extend the Product Catalog Schema. There are two ways you can do this. One know the number of files you allow a Product Catalog and add exact properties to the Product or Category definition. So lets say that we limit this to five files. The limitation to this is that in the future we may want to grow the size to a number larger than five. If your requirements are simple then this approach will suffice. If you don’t know how many files you may wish to associate to the Product Catalog Data and you have more complex requirements such as a file can be shared among many Product Catalog Data then you will need to create custom tables and associated it with the Product\Category Definition.

File Data Store

To support the latter part of the requirement above you need to create three external SQL Tables:

  • You need one Table to hold file association and image sequencing.
  • Another Table to hold file types images, pdf etc…
  • And one last table to hold the files

File Repository

The SQL Table holds the pointer to where the files are located but you will also need a file server to store files.

File Management

You then create views to use with Product Catalog SetJoin API for presentation and stored procedures for management. You will then extend the Commerce Server Product Catalog Web Service to support file management interfaces. Create and extend the Authorization Manager for new roles for image management.

Image Roles
  • You need this so that an administrator is responsible uploading images to the file repository.
  • You need another role for file editor to associate files with your Product Catalog Data and one last role to view images.
  • You will also need to modify the Catalog Manager to support the underplaying file management.

File Transport

How to move files from the business users desktop to a remote server? We will create a file transport provider and the mechanism are as follows:

  • FTP
  • HTTP PUT
  • File Upload over HTTP

File Security

While designing the multiple file engine we need to think about security at all times. We need to make sure that wherever we store files no execute permission are set only read, write and modify.

Summary

In this Post you understood the multiple file requirements and thought about how to solve it. In the next post we will design our system.