Importing TTX and SDL XLIFF Programmatically

I am trying to put together an app that imports SDLXLIFF or TTX files. When calling either 

_import.FileTypeManager = new PocoFilterManager(true);

or 

_import.FileTypeManager = _import.GetDefaultFileTypeManager();

I am getting the error message "No Application specific plug-in directory found". How can the application-specific plug-in directory be set?

Thank you

Ziad

using Sdl.FileTypeSupport.Framework;
using Sdl.FileTypeSupport.Framework.Integration;

            FileBasedTranslationMemory tm = new FileBasedTranslationMemory("C:\\Users\\test\\Desktop\\Sample Files\\en-de.sdltm");
           TranslationMemoryImporter _import = new TranslationMemoryImporter(tm.LanguageDirection);
           _import.ImportSettings.IsDocumentImport = true;
           _import.FileTypeManager = new PocoFilterManager(true);
          //_import.FileTypeManager = _import.GetDefaultFileTypeManager();
           _import.Import("C:\\Users\\test\\Desktop\\TTX\\Configuration.doc.ttx");

Sdl.Core.PluginFramework.PluginFrameworkException wurde nicht behandelt. HResult=-2146233088 Message=No Application specific plug-in directory found. Source=Sdl.Core.PluginFramework StackTrace: bei Sdl.Core.PluginFramework.DefaultPluginLocator..ctor() bei Sdl.Core.PluginFramework.PluginManager.get_DefaultPluginRegistry() bei Sdl.FileTypeSupport.Framework.Integration.PocoFilterManager.LoadAllDefaultFileTypeDefinitions() bei Sdl.FileTypeSupport.Framework.Integration.PocoFilterManager..ctor(Boolean autoLoadFileTypes) bei WindowsFormsApplication1.Form1.Form1_Load(Object sender, EventArgs e) in C:\Users\zchama\Documents\Visual Studio 2010\Projects\WindowsFormsApplication2\WindowsFormsApplication2\Form1.cs:Zeile 36. bei System.Windows.Forms.Form.OnLoad(EventArgs e) bei System.Windows.Forms.Form.OnCreateControl() bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) bei System.Windows.Forms.Control.CreateControl() bei System.Windows.Forms.Control.WmShowWindow(Message& m) bei System.Windows.Forms.Control.WndProc(Message& m) bei System.Windows.Forms.ScrollableControl.WndProc(Message& m) bei System.Windows.Forms.Form.WmShowWindow(Message& m) bei System.Windows.Forms.Form.WndProc(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) InnerException:

Parents
  • First of all PocoFilterManager shouldn't be used directly since is not part of the public API. You should use instead this to create the filter manager. 

    Now the reason you get this error is because the filter manager is looking after a Plugins folder inside the application folder which is used to deliver Studio system plugins. Since you have a stand-alone app and not a plugin the filter manager is not able to locate such a folder. To fix this you have this options:

    1. Use DefaultFileTypeManager.CreateInstance() to create the filter manager. This will not attempt to load all the file types which are located in the plugins folder. The problem with this is that you don't have the file types available

    2. You try to use assembly resolver. More about that here. Keep in mind that is not yet updated for Studio 2015.

    3. Deploy your app in the Studio Folder. 

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

Reply
  • First of all PocoFilterManager shouldn't be used directly since is not part of the public API. You should use instead this to create the filter manager. 

    Now the reason you get this error is because the filter manager is looking after a Plugins folder inside the application folder which is used to deliver Studio system plugins. Since you have a stand-alone app and not a plugin the filter manager is not able to locate such a folder. To fix this you have this options:

    1. Use DefaultFileTypeManager.CreateInstance() to create the filter manager. This will not attempt to load all the file types which are located in the plugins folder. The problem with this is that you don't have the file types available

    2. You try to use assembly resolver. More about that here. Keep in mind that is not yet updated for Studio 2015.

    3. Deploy your app in the Studio Folder. 

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

Children