@Test public void testReImportLocalizedAsset() throws RepositoryNameAlreadyUsedException, ExecutionException, InterruptedException, AssetUpdateException { baseTestImportLocalizedAsset(StatusForEqualTarget.APPROVED); RepositoryLocale repoLocale; try { repoLocale = repositoryService.addRepositoryLocale(repository, "fr-CA", "fr-FR", false); } catch (RepositoryLocaleCreationException e) { throw new RuntimeException(e); } String localizedAssetContent = "hello=Bonjour\nbye=Au revoir CA\nsource=target"; tmService.importLocalizedAssetAsync(assetId, localizedAssetContent, repoLocale.getLocale().getId(), StatusForEqualTarget.APPROVED, null, null).get(); tmService.importLocalizedAssetAsync(assetId, localizedAssetContent, repoLocale.getLocale().getId(), StatusForEqualTarget.APPROVED, null, null).get(); TextUnitSearcherParameters textUnitSearcherParameters = new TextUnitSearcherParameters(); textUnitSearcherParameters.setRepositoryIds(repository.getId()); textUnitSearcherParameters.setStatusFilter(StatusFilter.TRANSLATED); textUnitSearcherParameters.setLocaleId(repoLocale.getLocale().getId()); List<TextUnitDTO> textUnitDTOs = textUnitSearcher.search(textUnitSearcherParameters); Iterator<TextUnitDTO> iterator = textUnitDTOs.iterator(); TextUnitDTO next = iterator.next(); assertEquals("Au revoir CA", next.getTarget()); assertEquals(TMTextUnitVariant.Status.APPROVED, next.getStatus()); assertFalse(iterator.hasNext()); }
public PollableFuture<Void> importLocalizedAssetAsync( Long assetId, String content, Long localeId, StatusForEqualTarget statusForEqualtarget, FilterConfigIdOverride filterConfigIdOverride, List<String> filterOptions) { ImportLocalizedAssetJobInput importLocalizedAssetJobInput = new ImportLocalizedAssetJobInput(); importLocalizedAssetJobInput.setAssetId(assetId); importLocalizedAssetJobInput.setLocaleId(localeId); importLocalizedAssetJobInput.setContent(content); importLocalizedAssetJobInput.setStatusForEqualtarget(statusForEqualtarget); importLocalizedAssetJobInput.setFilterConfigIdOverride(filterConfigIdOverride); importLocalizedAssetJobInput.setFilterOptions(filterOptions); PollableFuture<Void> pollableFuture = quartzPollableTaskScheduler.scheduleJob(ImportLocalizedAssetJob.class, importLocalizedAssetJobInput); return pollableFuture; }
TMService { public PollableFuture<Void> importLocalizedAssetAsync( Long assetId, String content, Long localeId, StatusForEqualTarget statusForEqualtarget, FilterConfigIdOverride filterConfigIdOverride, List<String> filterOptions) { ImportLocalizedAssetJobInput importLocalizedAssetJobInput = new ImportLocalizedAssetJobInput(); importLocalizedAssetJobInput.setAssetId(assetId); importLocalizedAssetJobInput.setLocaleId(localeId); importLocalizedAssetJobInput.setContent(content); importLocalizedAssetJobInput.setStatusForEqualtarget(statusForEqualtarget); importLocalizedAssetJobInput.setFilterConfigIdOverride(filterConfigIdOverride); importLocalizedAssetJobInput.setFilterOptions(filterOptions); PollableFuture<Void> pollableFuture = quartzPollableTaskScheduler.scheduleJob(ImportLocalizedAssetJob.class, importLocalizedAssetJobInput); return pollableFuture; } }
TMService { public PollableFuture<Void> importLocalizedAssetAsync( Long assetId, String content, Long localeId, StatusForEqualTarget statusForEqualtarget, FilterConfigIdOverride filterConfigIdOverride, List<String> filterOptions) { ImportLocalizedAssetJobInput importLocalizedAssetJobInput = new ImportLocalizedAssetJobInput(); importLocalizedAssetJobInput.setAssetId(assetId); importLocalizedAssetJobInput.setLocaleId(localeId); importLocalizedAssetJobInput.setContent(content); importLocalizedAssetJobInput.setStatusForEqualtarget(statusForEqualtarget); importLocalizedAssetJobInput.setFilterConfigIdOverride(filterConfigIdOverride); importLocalizedAssetJobInput.setFilterOptions(filterOptions); PollableFuture<Void> pollableFuture = quartzPollableTaskScheduler.scheduleJob(ImportLocalizedAssetJob.class, importLocalizedAssetJobInput); return pollableFuture; }  }
TMService { public PollableFuture<Void> importLocalizedAssetAsync( Long assetId, String content, Long localeId, StatusForEqualTarget statusForEqualtarget, FilterConfigIdOverride filterConfigIdOverride, List<String> filterOptions) { ImportLocalizedAssetJobInput importLocalizedAssetJobInput = new ImportLocalizedAssetJobInput(); importLocalizedAssetJobInput.setAssetId(assetId); importLocalizedAssetJobInput.setLocaleId(localeId); importLocalizedAssetJobInput.setContent(content); importLocalizedAssetJobInput.setStatusForEqualtarget(statusForEqualtarget); importLocalizedAssetJobInput.setFilterConfigIdOverride(filterConfigIdOverride); importLocalizedAssetJobInput.setFilterOptions(filterOptions); PollableFuture<Void> pollableFuture = quartzPollableTaskScheduler.scheduleJob(ImportLocalizedAssetJob.class, importLocalizedAssetJobInput); return pollableFuture; }  TMTextUnit addTMTextUnit(Long tmId, Long assetId, String name, String content, String comment); TMTextUnit addTMTextUnit(
            TM tm,
            Asset asset,
            String name,
            String content,
            String comment,
            DateTime createdDate,
            PluralForm pluralForm,
            String pluralFormOther); TMTextUnit addTMTextUnit(
            TM tm,
            Asset asset,
            String name,
            String content,
            String comment,
            User createdByUser,
            DateTime createdDate,
            PluralForm pluralForm,
            String pluralFormOther); TMTextUnitVariant addCurrentTMTextUnitVariant(Long tmTextUnitId, Long localeId, String content); TMTextUnitVariant addCurrentTMTextUnitVariant(Long tmTextUnitId, Long localeId, String content, TMTextUnitVariant.Status status, boolean includedInLocalizedFile); TMTextUnitVariant addCurrentTMTextUnitVariant(Long tmTextUnitId, Long localeId, String content, TMTextUnitVariant.Status status, boolean includedInLocalizedFile, DateTime createdDate); TMTextUnitCurrentVariant addTMTextUnitCurrentVariant(Long tmTextUnitId, Long localeId, String content, String comment); TMTextUnitCurrentVariant addTMTextUnitCurrentVariant(Long tmTextUnitId, Long localeId, String content, String comment, TMTextUnitVariant.Status status); TMTextUnitCurrentVariant addTMTextUnitCurrentVariant(
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile); TMTextUnitCurrentVariant addTMTextUnitCurrentVariant(
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile,
            DateTime createdDate); AddTMTextUnitCurrentVariantResult addTMTextUnitCurrentVariantWithResult(
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile,
            DateTime createdDate); AddTMTextUnitCurrentVariantResult addTMTextUnitCurrentVariantWithResult(
            TMTextUnitCurrentVariant tmTextUnitCurrentVariant,
            Long tmId,
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile,
            DateTime createdDate,
            User createdBy); boolean isUpdateNeededForTmTextUnitVariant(
            TMTextUnitVariant.Status currentStatus,
            String currentContentMd5,
            boolean currentIncludedInLocalizedFile,
            String currentComment,
            TMTextUnitVariant.Status newStatus,
            String newContentMd5,
            boolean newIncludedInLocalizedFile,
            String newComment); TMTextUnitVariant addTMTextUnitVariant(
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile,
            DateTime createdDate); TMTextUnitVariant addTMTextUnitVariant(
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile,
            DateTime createdDate,
            User createdBy); UpdateTMWithXLIFFResult updateTMWithTranslationKitXLIFF(
            String xliffContent,
            TMTextUnitVariant.Status importStatus,
            String dropImporterUsernameOverride); UpdateTMWithXLIFFResult updateTMWithXLIFFById(
            String xliffContent,
            TMTextUnitVariant.Status importStatus); UpdateTMWithXLIFFResult updateTMWithXLIFFByMd5(
            String xliffContent,
            TMTextUnitVariant.Status importStatus,
            Repository repository); @Transactional String exportAssetAsXLIFF(Long assetId, String bcp47Tag); String generateLocalized(
            Asset asset,
            String content,
            RepositoryLocale repositoryLocale,
            String outputBcp47tag,
            FilterConfigIdOverride filterConfigIdOverride,
            List<String> filterOptions,
            Status status,
            InheritanceMode inheritanceMode); String generatePseudoLocalized(
            Asset asset,
            String content,
            FilterConfigIdOverride filterConfigIdOverride); PollableFuture<Void> importLocalizedAssetAsync(
            Long assetId,
            String content,
            Long localeId,
            StatusForEqualTarget statusForEqualtarget,
            FilterConfigIdOverride filterConfigIdOverride,
            List<String> filterOptions); void importLocalizedAsset(
            Long assetId,
            String content,
            Long localeId,
            StatusForEqualTarget statusForEqualtarget,
            FilterConfigIdOverride filterConfigIdOverride,
            List<String> filterOptions); @Pollable(async = true, message = "Export asset as xliff") PollableFuture<String> exportAssetAsXLIFFAsync(
            Long tmXliffId,
            Long assetId,
            String bcp47Tag,
            @InjectCurrentTask PollableTask currentTask); TMXliff createTMXliff(Long assetId, String bcp47Tag, String content, PollableTask pollableTask); }
TMService { public PollableFuture<Void> importLocalizedAssetAsync( Long assetId, String content, Long localeId, StatusForEqualTarget statusForEqualtarget, FilterConfigIdOverride filterConfigIdOverride, List<String> filterOptions) { ImportLocalizedAssetJobInput importLocalizedAssetJobInput = new ImportLocalizedAssetJobInput(); importLocalizedAssetJobInput.setAssetId(assetId); importLocalizedAssetJobInput.setLocaleId(localeId); importLocalizedAssetJobInput.setContent(content); importLocalizedAssetJobInput.setStatusForEqualtarget(statusForEqualtarget); importLocalizedAssetJobInput.setFilterConfigIdOverride(filterConfigIdOverride); importLocalizedAssetJobInput.setFilterOptions(filterOptions); PollableFuture<Void> pollableFuture = quartzPollableTaskScheduler.scheduleJob(ImportLocalizedAssetJob.class, importLocalizedAssetJobInput); return pollableFuture; }  TMTextUnit addTMTextUnit(Long tmId, Long assetId, String name, String content, String comment); TMTextUnit addTMTextUnit(
            TM tm,
            Asset asset,
            String name,
            String content,
            String comment,
            DateTime createdDate,
            PluralForm pluralForm,
            String pluralFormOther); TMTextUnit addTMTextUnit(
            TM tm,
            Asset asset,
            String name,
            String content,
            String comment,
            User createdByUser,
            DateTime createdDate,
            PluralForm pluralForm,
            String pluralFormOther); TMTextUnitVariant addCurrentTMTextUnitVariant(Long tmTextUnitId, Long localeId, String content); TMTextUnitVariant addCurrentTMTextUnitVariant(Long tmTextUnitId, Long localeId, String content, TMTextUnitVariant.Status status, boolean includedInLocalizedFile); TMTextUnitVariant addCurrentTMTextUnitVariant(Long tmTextUnitId, Long localeId, String content, TMTextUnitVariant.Status status, boolean includedInLocalizedFile, DateTime createdDate); TMTextUnitCurrentVariant addTMTextUnitCurrentVariant(Long tmTextUnitId, Long localeId, String content, String comment); TMTextUnitCurrentVariant addTMTextUnitCurrentVariant(Long tmTextUnitId, Long localeId, String content, String comment, TMTextUnitVariant.Status status); TMTextUnitCurrentVariant addTMTextUnitCurrentVariant(
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile); TMTextUnitCurrentVariant addTMTextUnitCurrentVariant(
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile,
            DateTime createdDate); AddTMTextUnitCurrentVariantResult addTMTextUnitCurrentVariantWithResult(
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile,
            DateTime createdDate); AddTMTextUnitCurrentVariantResult addTMTextUnitCurrentVariantWithResult(
            TMTextUnitCurrentVariant tmTextUnitCurrentVariant,
            Long tmId,
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile,
            DateTime createdDate,
            User createdBy); boolean isUpdateNeededForTmTextUnitVariant(
            TMTextUnitVariant.Status currentStatus,
            String currentContentMd5,
            boolean currentIncludedInLocalizedFile,
            String currentComment,
            TMTextUnitVariant.Status newStatus,
            String newContentMd5,
            boolean newIncludedInLocalizedFile,
            String newComment); TMTextUnitVariant addTMTextUnitVariant(
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile,
            DateTime createdDate); TMTextUnitVariant addTMTextUnitVariant(
            Long tmTextUnitId,
            Long localeId,
            String content,
            String comment,
            TMTextUnitVariant.Status status,
            boolean includedInLocalizedFile,
            DateTime createdDate,
            User createdBy); UpdateTMWithXLIFFResult updateTMWithTranslationKitXLIFF(
            String xliffContent,
            TMTextUnitVariant.Status importStatus,
            String dropImporterUsernameOverride); UpdateTMWithXLIFFResult updateTMWithXLIFFById(
            String xliffContent,
            TMTextUnitVariant.Status importStatus); UpdateTMWithXLIFFResult updateTMWithXLIFFByMd5(
            String xliffContent,
            TMTextUnitVariant.Status importStatus,
            Repository repository); @Transactional String exportAssetAsXLIFF(Long assetId, String bcp47Tag); String generateLocalized(
            Asset asset,
            String content,
            RepositoryLocale repositoryLocale,
            String outputBcp47tag,
            FilterConfigIdOverride filterConfigIdOverride,
            List<String> filterOptions,
            Status status,
            InheritanceMode inheritanceMode); String generatePseudoLocalized(
            Asset asset,
            String content,
            FilterConfigIdOverride filterConfigIdOverride); PollableFuture<Void> importLocalizedAssetAsync(
            Long assetId,
            String content,
            Long localeId,
            StatusForEqualTarget statusForEqualtarget,
            FilterConfigIdOverride filterConfigIdOverride,
            List<String> filterOptions); void importLocalizedAsset(
            Long assetId,
            String content,
            Long localeId,
            StatusForEqualTarget statusForEqualtarget,
            FilterConfigIdOverride filterConfigIdOverride,
            List<String> filterOptions); @Pollable(async = true, message = "Export asset as xliff") PollableFuture<String> exportAssetAsXLIFFAsync(
            Long tmXliffId,
            Long assetId,
            String bcp47Tag,
            @InjectCurrentTask PollableTask currentTask); TMXliff createTMXliff(Long assetId, String bcp47Tag, String content, PollableTask pollableTask);  }