|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.step.processor.conversion.SchemaConverter
A base class for specific subclasses that implement import and export conversions between two schemas. Supports the use of multiple schemas for import and export through a schemas directory structure.
getExportSchemaNames()
,
getImportSchemaNames()
Nested Class Summary | |
(package private) static class |
SchemaConverter.ExtensionFilter
|
Field Summary | |
private static SchemaConverter |
_converterInstance
The schema converter instance used for all STEP Schema conversions. |
private static FileFilter |
_directoryFilter
|
private static SchemaConverter.ExtensionFilter |
_mappingFileFilter
|
private static SchemaConverter.ExtensionFilter |
_schemaFileFilter
|
private static String |
SCHEMA_CONVERTER_CLASS
The class implementing the SchemaConverter interface which can be used to convert between Windchill and other schemas |
private static String |
SCHEMA_CONVERTER_LOGFILE
|
protected static String |
SCHEMAS_DIR_PROP
Translation schema and express/X file access |
protected static String |
WINDCHILL_SCHEMA_NAME_PROP
|
Constructor Summary | |
SchemaConverter()
|
Method Summary | |
static void |
clearConversionLog()
Clears the conversion log file. |
abstract void |
convertForExport(String srcFilename,
String targetFilename,
String exportSchemaName)
Converts the source file from Windchill schema to that defined by the converters configuration. |
abstract void |
convertForImport(String srcFilename,
String targetFilename,
String importSchemaName)
Converts the source file to Windchill schema from that defined by the converters configuration. |
static String |
getConversionLog()
Provides access to the contents of the Schema Conversion log file. |
static SchemaConverter |
getConverterInstance()
|
protected File |
getExportMappingFile(String schemaName)
The export mapping is found in the directory {schemasDir}/{schemaName}/export/{mappingName}.xpx Note: The mapping name MUST match the filename with extension .xpx |
static String[] |
getExportSchemaNames()
Lists schemas which have 'export' mappings, that is mappings from Windchill Schema to their Schema for export. |
protected String |
getExpressNameFromFile(File file)
Converts a File to its Express name which is the filename without path or extension. |
protected File |
getImportMappingFile(String schemaName)
The import mapping is found in the directory {schemasDir}/{schemaName}/import/{mappingName}.xpx Note: The mapping name MUST match the filename with extension .xpx |
static String[] |
getImportSchemaNames()
Lists schemas which have 'import' mappings, that is mappings from their schema to the Windchill schema that can be imported. |
protected static String |
getLogFilename()
Gets the filename for the schema converters log. |
protected static String |
getMandatoryProperty(String propertyName)
Gets a property value. |
protected static String |
getProperty(String propertyName)
|
protected static File |
getSchemaFile(String schemaName)
Access the File that matches a schema name, that is: {wt.step.schemasDir}/{schema-name}/{something}.xpx |
private static String[] |
getSchemaNamesFor(String schemaFunction)
Searchs the schemas dir for sub-directories (schemas) which have the required subdirectory/function ("import" or "export"). |
protected static File |
getSingleTypedFile(File dir,
SchemaConverter.ExtensionFilter filter)
Get a single file matching a given filename filter in the given directory. |
static String |
getWindchillSchemaFilename()
Returns the name of the Windchill schema so that it may be used during schema conversions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String SCHEMAS_DIR_PROP
protected static final String WINDCHILL_SCHEMA_NAME_PROP
private static final String SCHEMA_CONVERTER_CLASS
private static final String SCHEMA_CONVERTER_LOGFILE
private static SchemaConverter _converterInstance
private static SchemaConverter.ExtensionFilter _schemaFileFilter
private static SchemaConverter.ExtensionFilter _mappingFileFilter
private static FileFilter _directoryFilter
Constructor Detail |
public SchemaConverter()
Method Detail |
public static SchemaConverter getConverterInstance() throws TransferException
TransferException
public static void clearConversionLog()
public static String getConversionLog()
public static String[] getExportSchemaNames() throws TransferException
TransferException
getExpressNameFromFile(java.io.File)
public static String[] getImportSchemaNames() throws TransferException
TransferException
getExpressNameFromFile(java.io.File)
private static String[] getSchemaNamesFor(String schemaFunction) throws TransferException
TransferException
public static String getWindchillSchemaFilename() throws TransferException
TransferException
protected static File getSchemaFile(String schemaName) throws TransferException
TransferException
protected static File getSingleTypedFile(File dir, SchemaConverter.ExtensionFilter filter)
protected String getExpressNameFromFile(File file)
protected File getExportMappingFile(String schemaName) throws TransferException
TransferException
protected File getImportMappingFile(String schemaName) throws TransferException
TransferException
protected static String getMandatoryProperty(String propertyName) throws TransferException
TransferException
protected static String getProperty(String propertyName)
protected static String getLogFilename()
public abstract void convertForExport(String srcFilename, String targetFilename, String exportSchemaName) throws ConversionException, TransferException
exportSchemaName
- The name of the schema to export to. This should
ConversionException
TransferException
public abstract void convertForImport(String srcFilename, String targetFilename, String importSchemaName) throws ConversionException, TransferException
ConversionException
TransferException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |