/*
 Script to activate the XLIFF 1.2 filter
 */
BEGIN
  DECLARE @icount INT;

  SELECT @icount = count(filterInfoId)
  FROM filterInfos
  WHERE name LIKE 'XLIFF 1.2 File Type' AND filterInfoId = 72

  IF (@icount = 0)
    BEGIN
      PRINT '-->Activating XLIFF 1.2 filter'

      INSERT INTO filterInfos
      (filterInfoId, name, filterClass, type, icon, filterInfoGroup, configurationDate)
      VALUES
        (72, 'XLIFF 1.2 File Type', 'com.idiominc.ws.filters.fts.FSXLIFFv1_2ProxyFilter', 2, 'XLIFF_2.svg', 1, GETDATE())

      INSERT INTO mediaTypes
      (mediaTypeId, mediaType, description, isText, defaultExtension, externalMediaType, filterInfoId) values
      (46, 'text/xliff', 'XLIFF 1.2 File', 1, 'xliff', 'text/xliff', 72);

      INSERT INTO mediaTypeMappings (path, extension, mediaTypeId) VALUES
      ('', 'xliff', 46);
    END
  ELSE
    BEGIN
      PRINT '-->XLIFF 1.2 filter already activated'
    END

END;
