Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_refMsg = m_refSiteApi.EkMsgRef;
        ContentAPI capi = new ContentAPI();
        Ektron.Cms.API.Content.Taxonomy tax = new Ektron.Cms.API.Content.Taxonomy();
        TaxonomyRequest tr = new TaxonomyRequest();
        tr.IncludeItems = false;
        tr.Depth = 1;
        tr.Page = Page;
        tr.TaxonomyId = 0;
        tr.TaxonomyLanguage = capi.RequestInformationRef.ContentLanguage;
        tr.TaxonomyType = Ektron.Cms.Common.EkEnumeration.TaxonomyType.Content;
        tr.TaxonomyItemType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.Content;
        TaxonomyBaseData[] td = capi.EkContentRef.ReadAllSubCategories(tr);
        taxonomies.DataSource = td;
        taxonomies.DataBind();

        // Register JS
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronTreeviewJS);
    }
Пример #2
0
    /// <summary>
    /// Creates an export job
    /// </summary>
    /// <param name="title">The title of the job</param>
    /// <param name="l10nMgr">Reference to <see cref="L10nManager"/></param>
    /// <returns>An <see cref="LocalizationExportJob"/> object</returns>
    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;
    }
Пример #3
0
    void EditEvent(string settings)
    {
        try
        {
            string sitepath = _commonAPI.SitePath;
            string webserviceURL = sitepath + "widgets/taxonomysummary/TSHandler.ashx";
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
            Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronJQueryClueTipJS);
            JS.RegisterJSInclude(this, JS.ManagedScript.EktronScrollToJS);
            JS.RegisterJSInclude(this, sitepath + "widgets/taxonomysummary/behavior.js", "TaxonomySummaryWidgetBehaviorJS");

            if (TaxonomyId > 0)
            {
                TaxonomySelected = "";
                JS.RegisterJSBlock(this, "Ektron.PFWidgets.TaxonomySummary.webserviceURL = \"" + webserviceURL + "\"; Ektron.PFWidgets.TaxonomySummary.setupAll();Ektron.PFWidgets.TaxonomySummary.SetTabs.init(); ", "EktronPFWidgetsTSInit");
            }
            else
            {
                PropertySelected = "";
                JS.RegisterJSBlock(this, "Ektron.PFWidgets.TaxonomySummary.webserviceURL = \"" + webserviceURL + "\"; Ektron.PFWidgets.TaxonomySummary.setupAll(); ", "EktronPFWidgetsTSInit");
            }

            Css.RegisterCss(this, sitepath + "widgets/taxonomysummary/TSStyle.css", "TSWidgetCSS");

            taxonomyid.Text = TaxonomyId.ToString();
            pagesize.Text = PageSize.ToString();
            TeaserCheckBox.Checked = Teaser;

            EnablePagingCheckBox.Checked = EnablePaging;

            OrderKeyDropDownList.SelectedValue = OrderKey;
            DirectionSelectDropDownList.SelectedValue = Direction;

            ViewSet.SetActiveView(Edit);

            string[] dirs = System.IO.Directory.GetDirectories(Server.MapPath("~/widgets/TaxonomySummary/themes"));
            uxThemes.Items.Clear();
            uxThemes.Attributes.Add("onchange", "javascript:Ektron.PFWidgets.TaxonomySummary.themesPreview(this.id,'" + uxFramePreview.ClientID + "','" + sitepath + "')");

            if (!(dirs == null || dirs.Length == 0))
            {
                for (int themeC = 0; themeC < dirs.Length; themeC++)
                {
                    string folderName = dirs[themeC];
                    folderName = folderName.Substring(folderName.LastIndexOf('\\') + 1);
                    if (string.Compare(folderName, "default", true) != 0)
                    {
                        uxThemes.Items.Insert(0, new ListItem(folderName, folderName.ToLower()));
                    }

                }
            }

            uxThemes.Items.Insert(0, new ListItem("Default", "default"));

            object obj = uxThemes.Items.FindByValue(SelectedThemes);
            if (obj != null)
            {
                uxThemes.SelectedIndex = -1;
                ((ListItem)obj).Selected = true;
            }

            //uxFramePreview.Src = ResolveUrl("~/widgets/TaxonomySummary/themes/") + SelectedThemes + "/preview.jpg";

            headertext.Text = HeaderText;

            //set taxonomy path
            Ektron.Cms.API.Content.Taxonomy _apiTaxonomy = new Ektron.Cms.API.Content.Taxonomy();
            Ektron.Cms.TaxonomyRequest taxRequest = new Ektron.Cms.TaxonomyRequest();
            taxRequest.TaxonomyId = TaxonomyId;
            taxRequest.IncludeItems = false;
            taxRequest.TaxonomyLanguage = _apiTaxonomy.ContentLanguage;
            Ektron.Cms.TaxonomyData taxData = _apiTaxonomy.LoadTaxonomy(ref taxRequest);

            if (!(taxData == null || string.IsNullOrEmpty(taxData.Path)))
            {
                taxonomypath.Text = taxData.Path ;
                m_strTaxonomyPath = taxData.Path;
            }
            else
            {
                taxonomypath.Text = "";
                m_strTaxonomyPath = "";
            }
        }
        catch (Exception e)
        {
            errorLb.Text = e.Message + e.Data + e.StackTrace + e.Source + e.ToString();
            ViewSet.SetActiveView(View);
        }
    }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            m_refMsg = m_refSiteApi.EkMsgRef;
            ContentAPI capi = new ContentAPI();
            if (_fid > -1)
            {
                FolderData fd = capi.GetFolderById(_fid, true, false);
                if (fd != null)
                {
                    if (fd.FolderTaxonomy.Length == 0)
                    {
                        noTaxonomies.Text = m_refMsg.GetMessage("generic no taxonomy");
                        noTaxonomies.ToolTip = m_refMsg.GetMessage("generic no taxonomy");
                    }

                    taxRequired.InnerText = fd.CategoryRequired.ToString().ToLower();

                    if (!IsPostBack)
                    {
                        taxonomies.DataSource = fd.FolderTaxonomy;
                        taxonomies.DataBind();

                        if (fd.FolderTaxonomy.Length > 0 && defaultTaxID > -1)
                        {
                            //output path to selected taxonomy
                            TaxonomyRequest taxrequest = new TaxonomyRequest();
                            taxrequest.IncludeItems = false;
                            taxrequest.Page = Page;
                            taxrequest.TaxonomyLanguage = capi.RequestInformationRef.ContentLanguage;
                            taxrequest.TaxonomyId = defaultTaxID;
                            taxrequest.TaxonomyType = Ektron.Cms.Common.EkEnumeration.TaxonomyType.Content;
                            TaxonomyData td = capi.EkContentRef.LoadTaxonomy(ref taxrequest);
                            if (td != null)
                            {
                                txtselectedTaxonomyNodes.Text = td.TaxonomyPath;
                            }
                        }
                    }
                }
            }
            else
            {
                if (!IsPostBack)
                {
                    Ektron.Cms.API.Content.Taxonomy tax = new Ektron.Cms.API.Content.Taxonomy();
                    TaxonomyRequest tr = new TaxonomyRequest();
                    tr.IncludeItems = false;
                    tr.Depth = 1;
                    tr.Page = Page;
                    tr.TaxonomyId = 0;
                    tr.TaxonomyLanguage = capi.RequestInformationRef.ContentLanguage;
                    tr.TaxonomyType = Ektron.Cms.Common.EkEnumeration.TaxonomyType.Content;
                    tr.TaxonomyItemType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.Content;
                    TaxonomyBaseData[] td = capi.EkContentRef.ReadAllSubCategories(tr);
                    taxonomies.DataSource = td;
                    taxonomies.DataBind();
                }
            }

            // Register JS
            JS.RegisterJS(this, JS.ManagedScript.EktronJS);
            JS.RegisterJS(this, JS.ManagedScript.EktronTreeviewJS);

            // Register CSS
            Css.RegisterCss(this, Css.ManagedStyleSheet.EktronTreeviewCss);
        }