There are already two Questions in SO regarding the same topic. Which are (Creating XLIFF file of a Content in Ektron,Content export in ektron). As both the threads doesn't have an end,i am discussing the same topic with little more details here.
I need to generate the XLIFF file of a particular content in the workarea through the API's that is used by ektron for providing the same option. I have gone through the corresponding workarea files and the corresponding Tables in the Database. But couldn't figure out whether the XLIFF zip files are stored somewhere or not.Seems like it is not stored in any physical directories.Also it is not stored as XLIFF files in any tables.I need to pull the XLIFF file of a content using API,how can i achieve that? When i investigated in the workarea files the XLIFF is generated through the following : depending on the selection of content and Language,
<div class="ektronBorder">
<iframe src="localizationjobs.aspx" height="360" width="100%" title="History"></iframe>
</div>
Is there is any way i can generate and store the XLIFF files through API rather than relying on this?
There isn't a "1 function" api to perform both these jobs, however to export to xliff the following code block should help you get started, you'll need to change a few variable names/references:
Ektron.Cms.BusinessObjects.Localization.L10nManager l10nMgr = new Ektron.Cms.BusinessObjects.Localization.L10nManager(this.requestInfoRef);
LocalizationExportJob exportJob = this.CreateExportJob(title, l10nMgr);
exportJob.XliffVersion = xliffVersion;
exportJob.MaxCompressedFileSize = maxCompressedFileSize;
l10nMgr.StartExportForTranslation(exportJob);
private LocalizationExportJob CreateExportJob(string title, Ektron.Cms.BusinessObjects.Localization.L10nManager l10nMgr)
{
long[] taxonomyIds = this.GetSelectedLocaleTaxonomyIds();
if (String.IsNullOrEmpty(title))
{
title = this.defaultJobTitle;
if (taxonomyIds != null && 1 == taxonomyIds.Length)
{
long id = taxonomyIds[0];
Ektron.Cms.API.Content.Taxonomy taxonomyApi = new Ektron.Cms.API.Content.Taxonomy();
Ektron.Cms.TaxonomyRequest req = new Ektron.Cms.TaxonomyRequest();
req.TaxonomyId = id;
req.TaxonomyLanguage = this.commonApi.ContentLanguage;
Ektron.Cms.TaxonomyData data = taxonomyApi.ReadTaxonomy(ref req);
if (data != null)
{
title = data.TaxonomyName;
}
}
}
LocalizationExportJob job = new LocalizationExportJob(title);
job.SourceLanguageId = this.GetSelectedSourceLanguage();
foreach (long id in taxonomyIds)
{
job.AddItem(LocalizableCmsObjectType.LocaleTaxonomy, id);
}
return job;
}
Unfortunately the Import is much less accessible and is only found in the Ektron business logic. (Embedded in the DLL's)