Esempio n. 1
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        msgHelper = _refCommonApi.EkMsgRef;
        string pageAction;
        Ektron.Cms.Content.EkContent objContentRef;
        objContentRef = _refContentApi.EkContentRef;
        RegisterResources();
        SetServerJSVariables();
        //Licensing For 7.6
        if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false))
        {
            Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("feature locked error"));
            return;
        }
        if (!(_refCommonApi.IsAdmin() || objContentRef.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.UrlAliasingAdmin, _refCommonApi.RequestInformationRef.UserId, false)))
        {
            Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("User not authorized"));
            return;
        }

        _manualAliasAPI = new Ektron.Cms.UrlAliasing.UrlAliasManualApi();

        //Labels got from resource file
        lblaliasname.Text = msgHelper.GetMessage("lbl alias");
        lblContentBlk = msgHelper.GetMessage("content block label");
        lblTitle.Text = msgHelper.GetMessage("generic title");
        lblLink.Text = msgHelper.GetMessage("lbl quick link") + ":";
        lblTemplates.Text = msgHelper.GetMessage("lbl quick link") + ":";
        lblPrimary.Text = msgHelper.GetMessage("lbl primary");
        lblActive.Text = msgHelper.GetMessage("active label");
        lblAddVar.Text = msgHelper.GetMessage("lbl alias additional variables");
        lblQueryStringAction.Text = msgHelper.GetMessage("lbl querstringaction");
        lblaliasname.ToolTip = lblaliasname.Text;
        lblTitle.ToolTip = lblTitle.Text;
        lblLink.ToolTip = lblLink.Text;
        lblTemplates.ToolTip = lblTemplates.Text;
        lblPrimary.ToolTip = lblPrimary.Text;
        lblActive.ToolTip = lblActive.Text;
        lblAddVar.ToolTip = lblAddVar.Text;
        lblQueryStringAction.ToolTip = lblQueryStringAction.Text;
        pageAction = Request.QueryString["action"];
        siteid = Request.QueryString["fId"];
        workareaDir = _refContentApi.RequestInformationRef.WorkAreaDir;
        if ((string)(pageAction) == "addalias")
        {
            DisplayAdd();
        }
        else if ((string)(pageAction) == "view")
        {
            DisplayView();
        }
        else if ((string)(pageAction) == "editalias")
        {
            DisplayEdit();
        }
        System.Collections.Generic.List<string> ext_alias = null;
        ext_alias = _manualAliasAPI.GetFileExtensions();
        listAliasExtension.DataSource = ext_alias;
        listAliasExtension.DataBind();
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        msgHelper = _refCommonApi.EkMsgRef;
        Ektron.Cms.Content.EkContent objContentRef;
        objContentRef = _refContentApi.EkContentRef;
        RegisterResources();
        SetServerJSVariables();
        string pageAction = "";
        long siteID = 0;

        //Licensing For 7.6
        if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false))
        {
            Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("feature locked error"));
            return;
        }
        if (!Utilities.ValidateUserLogin())
        {
            return;
        }
        if (_refCommonApi.RequestInformationRef.IsMembershipUser > 0 || _refCommonApi.RequestInformationRef.UserId == 0)
        {
            Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("msg login cms user"));
            return;
        }

        if (!(_refCommonApi.IsAdmin() || objContentRef.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.UrlAliasingAdmin, _refCommonApi.RequestInformationRef.UserId, false)))
        {
            Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("User not authorized"));
            return;
        }

        _manualAliasList = new Ektron.Cms.UrlAliasing.UrlAliasManualApi();
        _autoAliasList = new Ektron.Cms.UrlAliasing.UrlAliasAutoApi();
        _communityAliasList = new Ektron.Cms.UrlAliasing.UrlAliasCommunityApi();
        siteDictionary = new System.Collections.Generic.Dictionary<long, string>();

        PageLabel.Text = PageLabel.ToolTip = msgHelper.GetMessage("lbl pagecontrol page");
        OfLabel.Text = OfLabel.ToolTip = msgHelper.GetMessage("lbl pagecontrol of");

        FirstPage.ToolTip = msgHelper.GetMessage("lbl first page");
        PreviousPage1.ToolTip = msgHelper.GetMessage("lbl previous page");
        NextPage.ToolTip = msgHelper.GetMessage("lbl next page");
        LastPage.ToolTip = msgHelper.GetMessage("lbl last page");

        FirstPage.Text = "[" + msgHelper.GetMessage("lbl first page") + "]";
        PreviousPage1.Text = "[" + msgHelper.GetMessage("lbl previous page") + "]";
        NextPage.Text = "[" + msgHelper.GetMessage("lbl next page") + "]";
        LastPage.Text = "[" + msgHelper.GetMessage("lbl last page") + "]";

        if (!String.IsNullOrEmpty(Request.QueryString["LangType"]))
        {
            if (Request.QueryString["LangType"] != "")
            {
                contentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                _refContentApi.SetCookieValue("LastValidLanguageID", contentLanguage.ToString());
            }
            else
            {
                if (_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    contentLanguage = Convert.ToInt32(_refContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }
        }
        else
        {
            if (_refContentApi.GetCookieValue("LastValidLanguageID") != "")
            {
                contentLanguage = Convert.ToInt32(_refContentApi.GetCookieValue("LastValidLanguageID"));
            }
        }
        _refContentApi.FilterByLanguage = contentLanguage;
        _refCommonApi.EkContentRef.RequestInformation.ContentLanguage = contentLanguage;
        if (!String.IsNullOrEmpty(Request.QueryString["action"]))
        {
            pageAction = Request.QueryString["action"];
        }
        if (!String.IsNullOrEmpty(Request.QueryString["fId"]))
        {
            siteID = Convert.ToInt64(Request.QueryString["fId"]);
        }
        if (pageAction == "removealias")
        {
            AddDeleteMenuBar(siteID.ToString());
            DeleteAlias(siteID.ToString());
        }
        else if (pageAction == "refresh")
        {
            RefreshManualAliasList(siteID.ToString());
            return;
        }
        else if ((string)(pageAction) == "clearcache")
        {
            ClearAutoAliasCache(siteID.ToString());
            return;
        }
        else if ((string)(pageAction) == "clearcommunitycache")
        {
            ClearCommunityCache(siteID.ToString());
            return;
        }
        else if ((string)(pageAction) == "")
        {
            AddDefaultMenuBar(siteID.ToString());
        }

        if (((pageAction == "" || pageAction == "removealias") && !Page.IsPostBack) || ((pageAction == "" || pageAction == "removealias") && Page.IsPostBack && Request.Form[isCPostData.UniqueID] != ""))
        {
            if (siteID > 0)
            {
                LoadManualAliasList(siteID.ToString());
            }
            else
            {
                LoadManualAliasList(string.Empty);
            }
        }
    }
Esempio n. 3
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        msgHelper = _refCommonApi.EkMsgRef;
        string pageAction;
        Ektron.Cms.Content.EkContent objContentRef;
        objContentRef = _refContentApi.EkContentRef;
        RegisterResources();
        SetServerJSVariables();
        //Licensing For 7.6
        if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false))
        {
            Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("feature locked error"));
            return;
        }
        if (!(_refCommonApi.IsAdmin() || objContentRef.IsARoleMember((long)Ektron.Cms.Common.EkEnumeration.CmsRoleIds.UrlAliasingAdmin, _refCommonApi.RequestInformationRef.UserId, false)))
        {
            Utilities.ShowError(_refContentApi.EkMsgRef.GetMessage("User not authorized"));
            return;
        }

        _autoAliasAPI = new Ektron.Cms.UrlAliasing.UrlAliasAutoApi();
        _manualAliasAPI = new Ektron.Cms.UrlAliasing.UrlAliasManualApi();

        //Labels got from resource file
        lblPrimary.Text = msgHelper.GetMessage("lbl primary");
        lblPrimary.ToolTip = lblPrimary.Text;
        lblActive.Text = msgHelper.GetMessage("active label");
        lblActive.ToolTip = lblActive.Text;
        lblType.Text = msgHelper.GetMessage("lbl source") + " " + msgHelper.GetMessage("generic type");
        lblType.ToolTip = lblType.Text;
        lblSource.Text = msgHelper.GetMessage("lbl alias root");
        lblSource.ToolTip = lblSource.Text;
        lblExt.Text = msgHelper.GetMessage("lbl extension");
        lblExt.ToolTip = lblExt.Text;
        lblOriginal.Text = msgHelper.GetMessage("lbl original url");
        lblOriginal.ToolTip = lblOriginal.Text;
        lblExample.Text = msgHelper.GetMessage("lbl link ex preview");
        lblExample.ToolTip = lblExample.Text;
        lblNameSrc.Text = msgHelper.GetMessage("lbl alias format");
        lblNameSrc.ToolTip = lblNameSrc.Text;
        lblReplaceChar.Text = msgHelper.GetMessage("lbl rpl char");
        lblReplaceChar.ToolTip = lblReplaceChar.Text;
        lblPathList.Text = msgHelper.GetMessage("lbl exclude path");
        lblPathList.ToolTip = lblPathList.Text;
        lblQueryStringParam.Text = msgHelper.GetMessage("lbl querystringparam");
        lblQueryStringParam.ToolTip = lblQueryStringParam.Text;

        pageAction = Request.QueryString["action"];
        langType = Request.QueryString["Langtype"];
        folderId = Request.QueryString["fId"];

        int.TryParse(langType, out langId);
        _autoType = _autoAliasAPI.GetAutoAliasTypes();

        if ((string)(pageAction) == "addalias")
        {
            DisplayAdd();
        }
        else if ((string)(pageAction) == "view")
        {
            DisplayView();
        }
        else if ((string)(pageAction) == "editalias")
        {
            DisplayEdit();
        }
    }