Example #1
0
    protected bool Util_HasInvalidDependency()
    {
        bool hasDependency = false;
        long[] targetJobs = (new List<long>() { m_iID }).ToArray();
        Ektron.Cms.BusinessObjects.Localization.L10nManager businessMgr = new Ektron.Cms.BusinessObjects.Localization.L10nManager(this.m_refContentApi.RequestInformationRef);
        string title = "Content Not Ready for Translation";

        LocalizationExportJob exportJob = new LocalizationExportJob(title);
        exportJob.SourceLanguageId = 1033;
        exportJob.Items = new List<LocalizableItem>();
        exportJob.Items.Add(new LocalizableItem(LocalizableCmsObjectType.LocaleTaxonomy, m_iID));
        exportJob.XliffVersion = this.xliffVersion;

        Criteria<LocalizationExportJob> criteria = new Criteria<LocalizationExportJob>();
        criteria.PagingInfo.RecordsPerPage = 50;
        List<Ektron.Cms.BusinessObjects.Localization.ILocalizable> items = businessMgr.GetNotReadyList(exportJob, criteria);

        if (items.Count > 0)
        {
            hasDependency = true;
            Util_ShowError("Dependencies are not ready for localization.");
            ltr_JobStatus.Text = "Warning";
            rptNotReadyContent.Visible = true;
            rptNotReadyContent.DataSource = items;
            rptNotReadyContent.DataBind();
        }
        invalidDependency = hasDependency;
        return hasDependency;
    }
Example #2
0
    /// <summary>
    /// Queries the selected locale taxonomy and renders a list of content that is marked "Not Ready for Translation"
    /// </summary>
    private void DoNotReadyQuery()
    {
        long[] targetJobs = this.GetSelectedLocaleTaxonomyIds();

        if (0 == targetJobs.Length)
        {
            rptNotReadyContent.Visible = false;
            lblNoResultsForNotReady.Visible = true;
            return;
        }

        Ektron.Cms.BusinessObjects.Localization.L10nManager l10nMgr = new Ektron.Cms.BusinessObjects.Localization.L10nManager(this.requestInfoRef);
        LocalizationExportJob job = this.CreateExportJob("Content Not Ready for Translation", l10nMgr); // No localization necessary, as this job never gets created (it's just for querying and needs a name)

        Criteria<LocalizationExportJob> criteria = new Criteria<LocalizationExportJob>();
        criteria.PagingInfo.RecordsPerPage = 50;
        List<Ektron.Cms.BusinessObjects.Localization.ILocalizable> items = l10nMgr.GetNotReadyList(job, criteria);

        if (0 == items.Count)
        {
            rptNotReadyContent.Visible = false;
            lblNoResultsForNotReady.Visible = true;
        }
        else
        {
            rptNotReadyContent.DataSource = items;
            rptNotReadyContent.DataBind();
        }
    }