Ejemplo n.º 1
0
        protected void PrefillEventControls()
        {
            if (EventData != null)
            {
                Title = EventData.DisplayTitle;
                Location = EventData.Location;
                Subject = EventData.Description;
                AllDay = EventData.IsAllDay;

                MetadataSelector.ContentID = EventData.Id;
                MetadataSelector.MetaUpdateString = "update";

                TaxonomyBaseData[] tbd = _contentApi.ReadAllAssignedCategory(EventData.Id);
                TaxonomySelector.SelectedTaxonomies.Clear();
                foreach(TaxonomyBaseData t in tbd){
                    TaxonomySelector.PreselectedTaxonomies.Add(t.Id);
                }
                TaxonomySelector.ForceFill();

                Ektron.Cms.UrlAliasing.UrlAliasManualApi m_aliaslist = new Ektron.Cms.UrlAliasing.UrlAliasManualApi();
                Ektron.Cms.Common.UrlAliasManualData event_alias = new Ektron.Cms.Common.UrlAliasManualData(0, 0, string.Empty, string.Empty);
                event_alias = m_aliaslist.GetDefaultAlias(EventData.Id);
                if (event_alias != null)
                {
                    ManualAliasExtension = event_alias.FileExtension;
                    ManualAliasName = event_alias.AliasName;
                }
            }
            else if (Provider.DataSources.Count > 0)
            {
                TaxonomySelector.defaultTaxID = Provider.DataSources[0].SelectedTaxID;
                TaxonomySelector.ForceFill();
            }
        }
Ejemplo n.º 2
0
        private void Display_AliasTab()
        {
            StringBuilder sbHtml = new StringBuilder();
            Ektron.Cms.UrlAliasing.UrlAliasManualApi _manualAliasApi = new Ektron.Cms.UrlAliasing.UrlAliasManualApi();
            Ektron.Cms.UrlAliasing.UrlAliasAutoApi _autoaliasApi = new Ektron.Cms.UrlAliasing.UrlAliasAutoApi();
            System.Collections.Generic.List<string> aliasExtensions;
            string ext = "";
            int i;

            Ektron.Cms.Common.UrlAliasManualData defaultManualAlias = new Ektron.Cms.Common.UrlAliasManualData(0, 0, string.Empty, string.Empty);
            System.Collections.Generic.List<UrlAliasAutoData> autoAliasList = new System.Collections.Generic.List<UrlAliasAutoData>();

            aliasExtensions = _manualAliasApi.GetFileExtensions();
            if (entry_edit_data != null)
            {
                defaultManualAlias = _manualAliasApi.GetDefaultAlias(entry_edit_data.Id);
            }
            sbHtml.Append("<div>");
            if (_urlAliasSettingApi.IsManualAliasEnabled)
            {
                if (m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias))
                {
                    sbHtml.Append("<fieldset><legend><strong>" + m_refMsg.GetMessage("lbl tree url manual aliasing") + "</strong></legend>");
                    sbHtml.Append("<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">");
                    sbHtml.Append("<tr><td colspan=4>&nbsp;<br></td></tr>");
                    sbHtml.Append("<tr><td>&nbsp;</td><td class=\"info\" nowrap=\"true\">" + m_refMsg.GetMessage("lbl primary") + " " + m_refMsg.GetMessage("lbl alias name") + ":&nbsp;");
                    sbHtml.Append("<td>&nbsp;<input type=\"hidden\" name=\"frm_manalias_id\" value=\"" + defaultManualAlias.AliasId + "\"></td>");
                    sbHtml.Append("<td>&nbsp;<input type=\"hidden\" name=\"prev_frm_manalias_name\" value=\"" + defaultManualAlias.AliasName + "\"></td>");
                    sbHtml.Append("<td>&nbsp;<input type=\"hidden\" name=\"prev_frm_manalias_ext\" value=\"" + defaultManualAlias.FileExtension + "\"></td>");
                    if (catalog_data.IsDomainFolder)
                    {
                        sbHtml.Append("<td width=\"95%\">http://" + catalog_data.DomainProduction + "/<input type=\"text\"  size=\"35\" id=\"frm_manalias\" name=\"frm_manalias\" value=\"" + defaultManualAlias.AliasName + "\">");
                    }
                    else
                    {
                        sbHtml.Append("<td width=\"95%\">" + m_refContentApi.SitePath + "<input type=\"text\"  size=\"35\" id=\"frm_manalias\" name=\"frm_manalias\" value=\"" + defaultManualAlias.AliasName + "\">");
                    }

                    for (i = 0; i <= aliasExtensions.Count - 1; i++)
                    {
                        if (ext != "")
                        {
                            ext = ext + ",";
                        }
                        ext = ext + aliasExtensions[i];
                    }
                    sbHtml.Append(m_refContentApi.RenderHTML_RedirExtensionDD("frm_ManAliasExt", defaultManualAlias.FileExtension, ext));
                    sbHtml.Append("<br/></td>");
                    sbHtml.Append("</tr></table></fieldset>");
                    sbHtml.Append("<br/><br/><br/>");
                }
                else
                {
                    sbHtml.Append("<input type=\"hidden\" name=\"frm_manalias_id\" value=\"" + defaultManualAlias.AliasId + "\">");
                    sbHtml.Append("<input type=\"hidden\" name=\"frm_manalias\" value=\"" + defaultManualAlias.AliasName + defaultManualAlias.FileExtension + "\">");
                }

            }
            if (_urlAliasSettingApi.IsAutoAliasEnabled)
            {
                if (entry_edit_data != null)
                {
                    autoAliasList = _autoaliasApi.GetListForContent(entry_edit_data.Id);
                }
                sbHtml.Append("<div class=\"autoAlias\" style=\"width: auto; height: auto; overflow: auto;\" id=\"autoAliasList\">");
                sbHtml.Append("<fieldset><legend><strong>" + m_refMsg.GetMessage("lbl automatic") + "</strong></legend><br/>");
                sbHtml.Append("<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">");
                sbHtml.Append("<tr><td><u><strong>" + m_refMsg.GetMessage("generic type") + "</strong></u></td>");
                sbHtml.Append("<td><u><strong>" + m_refMsg.GetMessage("lbl alias name") + "</strong></u></td></tr>");
                for (i = 0; i <= autoAliasList.Count() - 1; i++)
                {
                    sbHtml.Append("<tr><td>" + autoAliasList[i].AutoAliasType.ToString() + "</td>");
                    sbHtml.Append("<td>" + autoAliasList[i].AliasName + "</td></tr>");
                }
                sbHtml.Append("</table></fieldset></div>");
            }
            sbHtml.Append("</div>");
            ltrEditAlias.Text = sbHtml.ToString();
        }
Ejemplo n.º 3
0
    private string EditAliasHtmlScripts(ContentData content_edit_data, FolderData folder_data, Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings)
    {
        StringBuilder sbHtml = new StringBuilder();
        Ektron.Cms.UrlAliasing.UrlAliasManualApi m_aliaslist = new Ektron.Cms.UrlAliasing.UrlAliasManualApi();
        Ektron.Cms.UrlAliasing.UrlAliasAutoApi m_autoaliasApi = new Ektron.Cms.UrlAliasing.UrlAliasAutoApi();
        System.Collections.Generic.List<string> ext_alias;
        string ext = "";
        int i;

        Ektron.Cms.Common.UrlAliasManualData d_alias = new Ektron.Cms.Common.UrlAliasManualData(0, 0, string.Empty, string.Empty);
        System.Collections.Generic.List<UrlAliasAutoData> auto_aliaslist = new System.Collections.Generic.List<UrlAliasAutoData>();

        bool IsStagingServer;

        IsStagingServer = this.m_ContentApi.RequestInformationRef.IsStaging;

        ext_alias = m_aliaslist.GetFileExtensions();
        if (content_edit_data != null)
        {
            d_alias = m_aliaslist.GetDefaultAlias(content_edit_data.Id);
        }
        string m_strManualAliasExt = d_alias.AliasName;
        string m_strManualAlias = d_alias.FileExtension;

        //sbHtml.Append("<div id=\"dvAlias\">");
        if (m_urlAliasSettings.IsManualAliasEnabled)
        {
            if (m_ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias))
            {
                sbHtml.Append("<input type=\"hidden\" name=\"frm_manalias_id\" value=\"" + d_alias.AliasId + "\">");
                sbHtml.Append("<input type=\"hidden\" id=\"prev_frm_manalias_name\" name=\"prev_frm_manalias_name\" value=\"" + d_alias.AliasName + "\">");
                sbHtml.Append("<input type=\"hidden\" name=\"prev_frm_manalias_ext\" value=\"" + d_alias.FileExtension + "\">");
                sbHtml.Append("<div class=\"ektronHeader\">" + m_refMsg.GetMessage("lbl tree url manual aliasing") + "</div>");
                sbHtml.Append("<table class=\"ektronForm\">");
                sbHtml.Append("<tr>");
                sbHtml.Append("<td class=\"label\">");
                sbHtml.Append(m_refMsg.GetMessage("lbl primary") + " " + m_refMsg.GetMessage("lbl alias name") + ":");
                sbHtml.Append("</td>");
                sbHtml.Append("<td class=\"value\">");

                if (IsStagingServer && folder_data.DomainStaging != string.Empty)
                {
                    sbHtml.Append("<td width=\"95%\">http://" + folder_data.DomainStaging + "/<input type=\"text\" id=\"frm_manalias\" size=\"35\" name=\"frm_manalias\" value=\"" + d_alias.AliasName + "\">");
                }
                else if (folder_data.IsDomainFolder)
                {
                    sbHtml.Append("http://" + folder_data.DomainProduction + "/<input type=\"text\" id=\"frm_manalias\" size=\"35\" name=\"frm_manalias\" value=\"" + d_alias.AliasName + "\">");
                }
                else
                {
                    sbHtml.Append(m_ContentApi.SitePath + "<input type=\"text\" id=\"frm_manalias\" size=\"35\" name=\"frm_manalias\" value=\"" + d_alias.AliasName + "\">");
                }
                for (i = 0; i <= ext_alias.Count - 1; i++)
                {
                    if (ext != "")
                    {
                        ext = ext + ",";
                    }
                    ext = ext + ext_alias[i];
                }
                sbHtml.Append(m_ContentApi.RenderHTML_RedirExtensionDD("frm_ManAliasExt", d_alias.FileExtension, ext));
                sbHtml.Append("</td>");
                sbHtml.Append("</tr>");
                sbHtml.Append("</table>");
                if (m_ContentApi.RedirectorManExt.IndexOf(",") + 1 <= 0)
                {
                    //ast_frm_manaliasExt.Value = m_ContentApi.RedirectorManExt;
                }
            }

        }
        return sbHtml.ToString();
    }