How Dependent Is Commerce on Physical Location of Store Files?
ID: Q154532
|
The information in this article applies to:
-
Microsoft Commerce Server version 2.0
SUMMARY
Q. How dependent is Commerce Server on the physical location of the store
files? Can I import them to a Web site project using Visual Interdev?
A. Only the Commerce Server Host Administrator and the Store
Administration
objects depend on the store being in the Commerce Server directory
structure. You can move the files to another directory to use with
Visual Interdev. After you have done this, you need to correct the
Internet Information Server (IIS) virtual roots related to the store
(that is, the store, store_mgr, and store_assets virtual roots) to
point
to the new directory. You also need to edit the store's Shop\Global.asa
and Manager\Default.asp to correct the path of the Pipeline.pcf file.
MORE INFORMATION
If you move the files to another directory, the store will no longer be
listed in the Commerce Server Host Administrator, and the store's
management page will no longer be able to list the status (open or closed)
of a store or change that status. You can fix the latter by changing the
VBScript code used for this and replace it with your own code that
determines which Global.asa file is in use (the store open Global.asa or
the store closed Global.asa), and switch between the two Global.asa files.
You must create some sort of a file object and query for Global_opened.asa
or Global_closed.asa files in your store's shop directory. If
Global_closed.asa is found, the store is open, and vice-versa. When the
administrator clicks the Close Store button, you need to rename the
Global.asa file to Global_opened.asa and Global_closed.asa to Global.asa.
Conversely, when the administrator clicks the Open Store button, you must
rename the Global.asa to Global_closed.asa and Global_opened.asa to
Global.asa. Below is a code example that switches the Global_*.asa files
depending on the current store status. You may need to modify the example
to suit your directory structure.
In Default.ASP Under <yourstore>\Manager
Dim boolRet
set TempFileObj = Server.CreateObject("Commerce.AdminFiles")
boolRet =
TempFileObj.Exists("C:\inetpub\wwwroot\MSCSTestVI\global_closed.asa")
if boolRet = TRUE then
status = "Open"
RevStatus = "Close"
else
status = "Closed"
RevStatus = "Open"
End if
<%
REM -- open/close button
if status <> "Invalid" then
%>
<FORM METHOD="POST" ACTION="<% =
mscsPage.SURL("xt_change_status.asp") %>">
<INPUT TYPE="hidden"
NAME="Store"
VALUE="<% =Application("StoreName")%><rem %=
CurrStore.Name %>">
<INPUT TYPE=hidden name=status value="<%= status%>">
<INPUT TYPE="SUBMIT"
NAME="RevStatus"
VALUE="<%= RevStatus %> Store">
</FORM>
<% else %>
*****
<% end if %>
In Xt_Change_Status.ASP Under <yourstore>\Manager
set objAdmin = Server.CreateObject("Commerce.AdminFiles")
If Request.Form("Status")= "Open" then
call objAdmin.Rename("C:\inetpub\wwwroot\MSCSTestVI\global.asa",
"C:\inetpub\wwwroot\MSCSTestVI\global_opened.asa")
call
objAdmin.Rename("C:\inetpub\wwwroot\MSCSTestVI\global_closed.asa",
"C:\inetpub\wwwroot\MSCSTestVI\global.asa")
call objAdmin.Touch("C:\inetpub\wwwroot\MSCSTestVI\global.asa")
Else
call objAdmin.Rename("C:\inetpub\wwwroot\MSCSTestVI\global.asa",
"C:\inetpub\wwwroot\MSCSTestVI\global_closed.asa")
call
objAdmin.Rename("C:\inetpub\wwwroot\MSCSTestVI\global_opened.asa",
"C:\inetpub\wwwroot\MSCSTestVI\global.asa")
call objAdmin.Touch("C:\inetpub\wwwroot\MSCSTestVI\global.asa")
End IF
A tighter integration between Commerce Server and Visual Interdev will be
considered for a future release.
Additional query words:
kbfaq VI VID
Keywords : kbinterop
Version : 2.0
Platform : WINDOWS
Issue type : kbinfo