All Frameworks  Class Hierarchy  This Framework  Next  Indexes

CATxPDMInterfaces Class CATxPDMFileServices

CATxPDMFileServices
 

Usage: you must use this class as is. You should never derive it.


public class CATxPDMFileServices

Class for PDM services working directly on files not necessary loaded in session.
Role: Except the CheckItemCompatibility method, all the methods of the class retrieve or create items. All the methods do not load in session the files associated with the returned items.

Before using these methods in a batch, a CATSession must be created even no documents will be loaded.

All the static methods of the class pre-requisites the PX1 license.

See also:
CATIxPDMItem


Method Index


o CheckItemCompatibility(CATIxPDMItem_var&,CATIxPDMItem_var&,ItemCompatibility&)
Checks that two items are compatible.
o CreateSendToService(CATIxPDMSendToService_var&,CATUnicodeString&,CATBoolean,CATUnicodeString&)
Creates a Send To service pointer.
o GetConsistentSetOfItems(CATIxPDMItem_var&,CATListValCATIxPDMItem_var&,CATListValCATIxPDMItem_var&)
Searches list of pointed items.
o GetConsistentSetOfItemsFromDirectory(CATIxPDMItem_var&,CATListOfCATUnicodeString,CATBoolean,CATListValCATIxPDMItem_var&,CATListValCATIxPDMItem_var&)
Searches list of pointed items in a specific list of directories.
o GetImpactedDrawingsFromDirectory(CATIxPDMItem_var&,CATListOfCATUnicodeString&,CATBoolean,CATListValCATIxPDMItem_var&)
Searches list of impacted Drawings.
o GetItemFromFile(CATUnicodeString&,CATIxPDMItem_var&)
Retrieves an item from a file path.
o SearchRootItems(CATListOfCATUnicodeString&,CATBoolean,CATListValCATIxPDMItem_var&)
Searches root items in a list of directories.

Enumerated Type Index


o ItemCompatibility
Compatibility status between two items.

Methods


o CheckItemCompatibility
public static HRESULT CheckItemCompatibility(CATIxPDMItem_var& iFirstItem,
CATIxPDMItem_var& iSecondItem,
ItemCompatibility& oCompatibility)
Checks that two items are compatible.
Role:This method checks that two items are compatible. This check is the mandatory condition to replace the first item by the second one.

Notice that this test is not enough to insure that links put on first item will solve on second item, but this is the minimum condition (it does not insure that pointed geometry is available in document for example).

This method does not require that the two files associated with the items are loaded in session.

Parameters:
iFirstItem
The first item to compare.
iSecondItem
The second item to compare.
oCompatibility
The result of comparison.
Returns:
  • S_OK: The comparison is successfully done
  • E_FAIL: The method has failed. The possible returned errors (listed by their identifier) are:
    • InputERR_1001:
    • The PX1 licence is not available.
    • InputERR_1002:
    • One input item is invalid.
o CreateSendToService
public static HRESULT CreateSendToService(CATIxPDMSendToService_var& oSendToServices,
const CATUnicodeString& iTargetDirectory,
const CATBoolean iKeepDirectory= CATFalse,
const CATUnicodeString& iReportFile= CATUnicodeString(""))
Creates a Send To service pointer.
Parameters:
iTargetDirectory
The destination directory where the sent files will be copied. The target directory must already exist on disk.
iKeepDirectory
The option to control the tree structure creation in the target directory.
  • iKeepDirectory=1: to preserve the relative tree structure of the files. This option will be effective only if there is a common root directory for all files.
  • iKeepDirectory=0: this is the default value. The files are directly copied in the destination directory.
iReportFile
Localization of the report file. If the null string value ("") is used, no report is done. Null string is the default value.
oSendToServices
The pointer to a new instance of Send To service.
Returns:
  • S_OK: if Send To service is successfully created.
  • E_FAIL: The method has failed. The possible returned errors (listed by their identifier) are:
    • InputERR_1001:
    • The PX1 licence is not available.
    • InputERR_2000:
    • Invalid Input.
    • InputERR_2001:
    • The target directory doesn't exist.
    • InputERR_2003:
    • The report file path does not exist.
o GetConsistentSetOfItems
public static HRESULT GetConsistentSetOfItems( const CATIxPDMItem_var& iRootItem,
CATListValCATIxPDMItem_var& oListOfExistingPointedItem,
CATListValCATIxPDMItem_var& oListOfMissingPointedItem)
Searches list of pointed items.
Role:This method allows identify recursively all pointed items by a given root item. The result is divided into two lists:

The concatenation of these two lists is the same list as those computed by the Send To services. In other words it is the consistent set of files for a file. This is the mandatory files list to insure that all links will be resolved.

Links between items are resolved with current activated locators. It means that result of this method will be greatly impacted by your current locator settings (See Tools/Options/General, Documents Tab).

Parameters:
iRootItem
The root item to compute the consistent set of files from.
oListOfExistingPointedItem
The list of existing pointed items. An existing item has a file found on disk using current locators (Relative Folder, Other Folders...). There is no garanty on this list order, it could be change at any time. iRootItem is always in this list.
oListOfMissingPointedItem
The list of missing pointed items. A missing item has a file not found on disk using current locators (Relative Folder, Other Folders...). There is no garanty on this list order, it could be change at any time.
Returns:
  • S_OK: The consistent set of items is successfully computed.
  • E_FAIL: The method has failed. The possible returned errors (listed by their identifier) are:
    • InputERR_1001:
    • The PX1 licence is not available.
    • InputERR_1006:
    • Error during the process.
    • InputERR_1119:
    • An item is loaded and modified in session, it should be saved before. Item name (the CATIxPDMItem.GetDocFileName string ) is available in message.
o GetConsistentSetOfItemsFromDirectory
public static HRESULT GetConsistentSetOfItemsFromDirectory( const CATIxPDMItem_var& iRootItem,
const CATListOfCATUnicodeString iListOfDirectory,
const CATBoolean iScanRecursively,
CATListValCATIxPDMItem_var& oListOfExistingPointedItem,
CATListValCATIxPDMItem_var& oListOfMissingPointedItem)
Searches list of pointed items in a specific list of directories.
Role:This method allows identify recursively all pointed items by a given root item. The result is divided into two lists:

The concatenation of these two lists is the same list as those computed by the Send To services. In other words it is the consistent set of files for a file. This is the mandatory files list to insure that all links will be resolved.

Links between items are resolved inside list of directories provided as input.

Parameters:
iRootItem
The root item to compute the consistent set of files from.
iListOfDirectory
The list of directories to scan. Each element of the list must be the absolute path of a directory. Like C:\tmp\MyDir(Windows) or /home/temp/MyDir (Unix).
iScanRecursively
If TRUE, sub-directoryies will be scanned also.
oListOfExistingPointedItem
The list of existing pointed items. An existing item has a file found on disk using current locators (Relative Folder, Other Folders...). There is no garanty on this list order, it could be change at any time. iRootItem is always in this list.
oListOfMissingPointedItem
The list of missing pointed items. A missing item has a file not found on disk using current locators (Relative Folder, Other Folders...). There is no garanty on this list order, it could be change at any time.
Returns:
  • S_OK: The consistent set of items is successfully computed.
  • E_FAIL: The method has failed. The possible returned errors (listed by their identifier) are:
    • InputERR_1001:
    • The PX1 licence is not available.
    • InputERR_1006:
    • Error during the process.
    • InputERR_1112:
    • Impossible to open a directory. The directory path name available in error message.
    • InputERR_1119:
    • An item is loaded and modified in session, it should be saved before. Item name (the CATIxPDMItem.GetDocFileName string ) is available in message.
o GetImpactedDrawingsFromDirectory
public static HRESULT GetImpactedDrawingsFromDirectory( const CATIxPDMItem_var& iRootItem,
const CATListOfCATUnicodeString& iListOfDirectory,
const CATBoolean iScanRecursively,
CATListValCATIxPDMItem_var& oListOfImpactedDrawingsItem)
Searches list of impacted Drawings.
Role:This method retrieves CATDrawings impacted by one item.

Drawings are searched inside list of directories provided as input.

If some CATDrawing are still loaded and modified in session, API will fail because it will not be able to check its links correctly.

Parameters:
iRootItem
The root item to compute the consistent set of files from. This item should be a CATPart or a CATProduct.
iListOfDirectory
The list of directories to scan. Each element of the list must be the absolute path of a directory. Like C:\tmp\MyDir(Windows) or /home/temp/MyDir (Unix).
iScanRecursively
If TRUE, sub-directoryies will be scanned also.
oListOfImpactedDrawingsItem
The list of impacted CATDrawing by iRootItem. There is no garanty on this list order, it could be change at any time.
Returns:
  • S_OK: The list has been successfully computed (it could be empty).
  • E_FAIL: The method has failed. The possible returned errors (listed by their identifier) are:
    • InputERR_1001:
    • The PX1 licence is not available.
    • InputERR_1006:
    • Error during the process.
    • InputERR_1112:
    • Impossible to open a directory. The directory path name available in error message.
    • InputERR_1132:
    • A CATDrawing is still opened and modified in session, CATDrawing name available in error message.
o GetItemFromFile
public static HRESULT GetItemFromFile( const CATUnicodeString& iInputFilePath,
CATIxPDMItem_var& oPDMItem)
Retrieves an item from a file path.
Role:This method creates,or retrieves in session, an item from a file path. This method does not load the file in session.
Parameters:
iInputFilePath
The path of the input file
oPDMItem
The returned item.
Returns:
  • S_OK: method successful, oPDMItem is correctly returned.
  • E_FAIL: The method has failed. The possible returned errors (listed by their identifier) are:
    • InputERR_1001:
    • The PX1 licence is not available.
    • InputERR_1113:
    • iInputFilePath not found on disk.
o SearchRootItems
public static HRESULT SearchRootItems( const CATListOfCATUnicodeString& iListOfDirectory,
const CATBoolean iScanRecursively,
CATListValCATIxPDMItem_var& oListOfRootItem)
Searches root items in a list of directories.
Role:This method scans all files in the input directories to find which one are root files. Root file means not pointed by another file contained into a directory of the input list.

For example, a file A1 in directory A is pointed by another file B1 in directory B. If you call this method with directory A and B, only B1 will be returned as root.

The item associated with a root file is either created or retrieved in session, and added in the output list.

Parameters:
iListOfDirectory
The list of directories to scan. Each element of the list must be the absolute path of a directory. Like C:\tmp\MyDir(Windows) or /home/temp/MyDir (Unix).
iScanRecursively
If TRUE, sub-directoryies will be scanned also.
oListOfRootItem
The list of root items.
Returns:
  • S_OK: The root list is successfully computed.
  • E_FAIL: The method has failed. The possible returned errors (listed by their identifier) are:
    • InputERR_1001:
    • The PX1 licence is not available.
    • InputERR_1008:
    • The input directory list is empty.
    • InputERR_1112:
    • Impossible to open a directory. The directory path name available in error message.
    • InputERR_1113:
    • A file could not be read ( no read access right for example ). The file name available in error message.
    • InputERR_1122:
    • Some files are involved in a cycle, no roots can be found for those files. In this case, this method return E_FAIL with list of file involved in cycle in error message but other roots are (without cycle) are computed and returned normally in oListOfRootItem.

Enumerated Types


o ItemCompatibility
enum ItemCompatibility {
  FullCompatible,
  CompatibleExeptFileName,
  NotCompatible
}
Compatibility status between two items.
Parameters:
FullCompatible
The two items are fully compatible.
CompatibleExeptFileName
The two items are compatible except file name. Rename one file on your disk to be FullCompatible
NotCompatible
The two items are not compatible.
See also:
CATxPDMFileServices.CheckItemCompatibility

This object is included in the file: CATxPDMFileServices.h
If needed, your Imakefile.mk should include the module: CATxPDMInterfaces

Copyright © 2003, Dassault Systèmes. All rights reserved.