/// <summary> /// This function is used to delete an EndPointAliasEntity. /// </summary> /// <param name="alias">Alias</param> /// <param name="siteuid">Site Unique ID</param> /// <param name="sectionuid">Section Unique ID</param> /// <returns>True on success, false on fail.</returns> public static bool Delete(string alias, int sectionuid) { EndPointAliasEntity epea = new EndPointAliasEntity(sectionuid, alias); DataAccessAdapter ds = new DataAccessAdapter(); return(ds.DeleteEntity(epea)); }
/// <summary> /// This function is used to insert a EndPointAliasEntity in the storage area. /// </summary> /// <param name="alias">Alias</param> /// <param name="siteuid">Site Unique ID</param> /// <param name="sectionuid">Section Unique ID</param> /// <param name="pageuid">Page Unique ID</param> /// <param name="endpoint">End Point</param> /// <returns>True on success, False on fail</returns> public static bool Insert(string alias, int sectionuid, int pageuid, string endpoint) { EndPointAliasEntity epae = new EndPointAliasEntity(); epae.Alias = alias; epae.SectionUID = sectionuid; epae.PageUID = pageuid; epae.EndPoint = endpoint; DataAccessAdapter ds = new DataAccessAdapter(); return(ds.SaveEntity(epae)); }
public void ProcessUrl(BASEApplication app) { int overridepageUID = WebUtils.QS.ToInt32ElseMin(app.Request.QueryString[BASEQS.PageUID]); if (overridepageUID != int.MinValue) { app.BASERequest._pageUID = overridepageUID; return; } Logging.Logger.Log("EndPointResolver.ProcessUrl: " + app.Request.Url.OriginalString, BASE.Logging.LogPriority.Info); string path = app.Request.Url.AbsolutePath; EndPointAliasEntity epa = EndPointAliasDataHalper.SelectSingle(path.Trim(new char[1] { '/' }), app.BASERequest.SectionUID); if (epa == null) { return; } //This code is temporary only. //TODO: USE StringBuilder string newurl = "/"; switch (epa.EndPointType) { case (int)EndPointAliasType.Virtual: //Virtual newurl += "VirtualPage.aspx"; app.BASERequest._pageUID = epa.PageUID.Value; app.Context.RewritePath(newurl + app.Request.Url.Query); break; default: app.Response.Write("EndPointAlias not resolved"); app.Response.Flush(); app.Response.End(); break; } //TODO: Change the path. //All sucsite and sections should be already stripped at this point. //We can now take the final segment(s) and do a lookup in the alias table. //If there is not an alias, we assume it is a physical location being accesses. This will be handled by the BASE handler for physical file mapping //If it is an alias, we check which type, and setup the actual page, pageUID, and/or query string info. }
/// <summary> /// This method is used to retreive a single EndPointAliasEntity by it Primary Key /// </summary> /// <param name="alias">Alias</param> /// <param name="sectionUID">Section Unique ID</param> /// <returns>An entity if found, null if nothing found.</returns> public static EndPointAliasEntity SelectSingle(string alias, int sectionUID) { EndPointAliasEntity epae = new EndPointAliasEntity(sectionUID, alias); DataAccessAdapter ds = new DataAccessAdapter(); if (ds.FetchEntity(epae) == true) { return(epae); } else { return(null); } }