CatalogManager3.ExportXML Method (PIA)

Use this method to export catalog data to an Extensible Markup Language (XML) file.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
…
Public Sub ExportXML(vrXML As Object,Optional strCatalogsToExport As ObjectOptionalfRunSynchronously As BooleanOptional eXMLFmt As CatalogXMLFmtEnumOptional strLang As String,
)

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
…
public void ExportXML(ObjectvrXML,
  objectstrCatalogsToExport,boolfRunSynchronouslyCatalogXMLFmtEnumeXMLFmtstringstrLang,
);

Parameters

[Visual Basic .NET]

  • vrXML
    An Object that contains the XML file name or IStream object that is the target of the export.
  • strCatalogsToExport
    An Object that contains the catalogs to export. See the Remarks section for more information.
  • fRunSynchronously
    A Boolean that specifies whether the method should be run synchronously. A value of True indicates that the method will not return until the export is completed. A value of False indicates that the method will return immediately after spawning the export thread. The default value is False.
  • eXMLFmt
    A CatalogXMLFmtEnum enumeration that specifies the XML format. See the Remarks section for valid values.
  • strLang
    A String that contains the language identifier.

[C#]

  • vrXML
    An Object that contains the XML file name or IStream object that is the target of the export.
  • strCatalogsToExport
    An object that contains the catalogs to export. See the Remarks section for more information. To export all catalogs, specify Type.Missing.
  • fRunSynchronously
    A bool that specifies whether the method should be run synchronously. A value of True indicates that the method will not return until the export is completed. A value of False indicates that the method will return immediately after spawning the export thread.
  • eXMLFmt
    A CatalogXMLFmtEnum enumeration that specifies the XML format. See the Remarks section for valid values.
  • strLang
    A string that contains the language identifier.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

The following table shows the custom COM errors that a COMException can wrap.

Constant Value Description
E_CAT_IMPORT_IN_PROGRESS

[C#] 0x88980025

[Visual Basic .NET] &H88980025

There was an existing import method call that had not yet completed. This method cannot run while an import is in progress.
E_CAT_FILE_CREATION_FAILED

[C#] 0x88980018

[Visual Basic .NET] &H88980018

The method was unable to create the output file.

Remarks

If the parameter strCatalogsToExport is missing, or contains an empty string, then all catalogs are exported. Otherwise the parameter strCatalogsToExport is a comma-separated list of catalog names to be exported.

If the strLang parameter is not specified, then data will be exported in all the languages supported by the catalog. If the strLang parameter is specified, then multilingual data will be exported only in the specified language.

The following table shows the values in the CatalogXMLFmtEnum enumeration, and shows their associated names, and describes their use.

Name Value Description
cscFmtElementCentric 0 Export in Commerce Server 2000 format. (Default)
cscFmtAttributeCentric 1 Export in Commerce Server 2002 format.
cscFmtXDR 2 Export the Commerce Server 2002 schema as XML Data Reduced (XDR). (No data)

This method runs in a separate thread. Prior to spawning the thread, it checks that there is not an existing ExportCSV, ExportXML, ImportCSV or ImportXML method in progress. Once the new thread is spawned, this method returns immediately, if fRunSynchronously is False, with no errors. Any errors that occurred while importing the catalog are logged to the Windows NT Event Log. Use the Windows Event Viewer to view the Windows NT Event Log.

If there is a temporary loss of the SQL Server connection, longer than two minutes, an import or export will be aborted. Other methods should work after the interruption.

Ee798215.caution(en-US,CS.20).gif Caution

  • Changes made to the catalog while an export is in progress may or may not be reflected in the output file. Additions and deletions made during the export could result in a corrupt file. Changes should be avoided during an export.

[Visual Basic .NET]

Example

myCatalogManager.ExportXML("c:\exports\ourcatalog.xml", "OurStore", 1, "en-US")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cataloglib (in cataloglib.dll)

See Also

CatalogManager3 Class

CatalogManager3.ExportCSV

CatalogManager3.ImportXML

Copyright © 2005 Microsoft Corporation.
All rights reserved.