Commerce Server General - How to control the ImportXML method if it's finished

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > August 2004 > How to control the ImportXML method if it's finished





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to control the ImportXML method if it's finished
Fernando Possebon

2004-08-07, 5:49 pm

Hi guys,

We're developing a routine that does a replication of a catalog to other
stores. Basically we are exporting a "main" catalog, changing their names
(each one to a specific store). Each catalog is created in a separated XML
file.

When we try to import them in a sequence, we have some problems: the first
catalog works fine, but others seems to be messed, the categories are not the
same way that the first one, or either the "main" catalog.

We're suspecting that this is caused because we are importing one after
other, without waiting to finish, that's where I need a help.

How can I control the status of a ImportXML method programatically? Using
BizDesk, I have to look at Event Viewer.

I'm using Microsoft.CatalogServer.CatalogContext.ImportXML method. Any help
on this issue will be very appreciated.

Best regards and thanks in advance.

Fernando Possebon
Vinayak Tadas[MSFT]

2004-08-17, 5:50 pm

Check the sample in the cs2002_agentapi.chm file
// Importing an XML file
XmlImportOptions xmlImportOptions = new XmlImportOptions();
xmlImportOptions.FileName = @"file path";
xmlImportOptions.Mode = CatalogImportMode.Full;
int operationId = catalogContext.ImportXml(xmlImportOptions);
while( catalogContext.GetImportProgress(operationId).Status ==
CatalogOperationsStatus.InProgress)
{
// The import is in progress so add some sleep here before chcecking
the status again
System.Threading.Thread.Sleep(5000);
}

See the methods CatalogContext.ImportXml and
CatalogContext.GetImportProgress for determining the status of the import
operation


--------------------
Thread-Topic: How to control the ImportXML method if it's finished
thread-index: AcR8twccxX7Lm15+SpmfnlDVn+jCAg==
X-WBNR-Posting-Host: 200.248.206.130
From: "=?Utf-8?B?RmVybmFuZG8gUG9zc2Vib24=?=" <Fernando
Possebon@discussions.microsoft.com>
Subject: How to control the ImportXML method if it's finished
Date: Sat, 7 Aug 2004 12:45:01 -0700
Lines: 23
Message-ID: <F401B6CB-DF29-452C-A000-A3347BEFBD93@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.general
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.general:14460
X-Tomcat-NG: microsoft.public.commerceserver.general

Hi guys,

We're developing a routine that does a replication of a catalog to other
stores. Basically we are exporting a "main" catalog, changing their names
(each one to a specific store). Each catalog is created in a separated XML
file.

When we try to import them in a sequence, we have some problems: the first
catalog works fine, but others seems to be messed, the categories are not
the
same way that the first one, or either the "main" catalog.

We're suspecting that this is caused because we are importing one after
other, without waiting to finish, that's where I need a help.

How can I control the status of a ImportXML method programatically? Using
BizDesk, I have to look at Event Viewer.

I'm using Microsoft.CatalogServer.CatalogContext.ImportXML method. Any help
on this issue will be very appreciated.

Best regards and thanks in advance.

Fernando Possebon


Thanks
Vinayak Tadas
Microsoft
http://blogs.msdn.com/vinayakt

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Get Secure! For more info visit http://www.microsoft.com/security. Please
reply to the newsgroups only. Thanks

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com