/// <summary>Creates a new instance of the RequestLifeCycleHandler class.</summary> /// <param name="webContext">The web context wrapper.</param> public RequestLifecycleHandler(IWebContext webContext, EventBroker broker, InstallationManager installer, IRequestDispatcher dispatcher, IErrorHandler errors, AdminSection editConfig, HostSection hostConfig) : this(webContext, broker, installer, dispatcher, errors) { checkInstallation = editConfig.Installer.CheckInstallationStatus; //installerUrl = editConfig.Installer.InstallUrl; rewriteMethod = hostConfig.Web.Rewrite; _adminConfig = editConfig; }
/// <summary>Rewrites a dynamic/computed url to an actual template url.</summary> public virtual void RewriteRequest(PathData path, RewriteMethod rewriteMethod) { if (path == null || path.IsEmpty() || !path.IsRewritable || path.Ignore || rewriteMethod == RewriteMethod.None) return; string templateUrl = GetHandlerPath(path); WebContext.HttpContext.RewritePath(templateUrl, false); }
/// <summary>Rewrites a dynamic/computed url to an actual template url.</summary> public virtual void RewriteRequest(PathData path, RewriteMethod rewriteMethod) { if (path == null || path.IsEmpty() || !path.IsRewritable || path.Ignore || rewriteMethod == RewriteMethod.None) { return; } string templateUrl = GetHandlerPath(path); WebContext.HttpContext.RewritePath(templateUrl, false); }
/// <summary>Creates a new instance of the RequestLifeCycleHandler class.</summary> /// <param name="webContext">The web context wrapper.</param> /// <param name="broker"></param> /// <param name="dispatcher"></param> /// <param name="adapters"></param> /// <param name="errors"></param> /// <param name="configuration"></param> public RequestLifeCycleHandler(IWebContext webContext, EventBroker broker, RequestPathProvider dispatcher, IContentAdapterProvider adapters, IErrorNotifier errors, ConfigurationManagerWrapper configuration) { rewriteMethod = configuration.Sections.Web.Web.Rewrite; managementUrl = configuration.Sections.Management.ManagementInterfaceUrl; this.webContext = webContext; this.broker = broker; this.adapters = adapters; this.errors = errors; this.dispatcher = dispatcher; }
/// <summary>Creates a new instance of the RequestLifeCycleHandler class.</summary> /// <param name="webContext">The web context wrapper.</param> /// <param name="broker"></param> /// <param name="dispatcher"></param> /// <param name="adapters"></param> /// <param name="errors"></param> /// <param name="configuration"></param> public RequestLifeCycleHandler(IWebContext webContext, EventBroker broker, RequestPathProvider dispatcher, IContentAdapterProvider adapters, IErrorNotifier errors, ConfigurationManagerWrapper configuration) { rewriteMethod = configuration.Sections.Web.Web.Rewrite; managementUrl = configuration.Sections.Management.Paths.ManagementInterfaceUrl; this.webContext = webContext; this.broker = broker; this.adapters = adapters; this.errors = errors; this.dispatcher = dispatcher; }
/// <summary>Rewrites a dynamic/computed url to an actual template url.</summary> public virtual void RewriteRequest(RewriteMethod rewriteMethod) { if (Path == null || Path.IsEmpty()) return; string templateUrl = GetHandlerPath(); if (rewriteMethod == RewriteMethod.RewriteRequest) Engine.Resolve<IWebContext>().RewritePath(templateUrl); else if (rewriteMethod == RewriteMethod.TransferRequest) Engine.Resolve<IWebContext>().TransferRequest(templateUrl); }
/// <summary>Rewrites a dynamic/computed url to an actual template url.</summary> public virtual void RewriteRequest(PathData path, RewriteMethod rewriteMethod) { if (path == null || path.IsEmpty() || !path.IsRewritable || path.Ignore) return; string templateUrl = GetHandlerPath(path); if(rewriteMethod == RewriteMethod.BeginRequest || rewriteMethod == RewriteMethod.SurroundMapRequestHandler) WebContext.RewritePath(templateUrl); else if(rewriteMethod == RewriteMethod.TransferRequest) WebContext.TransferRequest(templateUrl); }
public override Query Parse(String query) { if (isPass2ResolvingPhrases) { RewriteMethod oldMethod = MultiTermRewriteMethod; try { // Temporarily force BooleanQuery rewrite so that Parser will // generate visible // collection of terms which we can convert into SpanQueries. // ConstantScoreRewrite mode produces an // opaque ConstantScoreQuery object which cannot be interrogated for // terms in the same way a BooleanQuery can. // QueryParser is not guaranteed threadsafe anyway so this temporary // state change should not // present an issue MultiTermRewriteMethod = MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE; return(base.Parse(query)); } finally { MultiTermRewriteMethod = oldMethod; } } // First pass - parse the top-level query recording any PhraseQuerys // which will need to be resolved complexPhrases = new List <ComplexPhraseQuery>(); Query q = base.Parse(query); // Perform second pass, using this QueryParser to parse any nested // PhraseQueries with different // set of syntax restrictions (i.e. all fields must be same) isPass2ResolvingPhrases = true; try { using (IEnumerator <ComplexPhraseQuery> enumerator = complexPhrases.GetEnumerator()) { while (enumerator.MoveNext()) { currentPhraseQuery = enumerator.Current; currentPhraseQuery.ParsePhraseElements(this); } } } finally { isPass2ResolvingPhrases = false; } return(q); }
/// <summary>Creates a new instance of the RequestLifeCycleHandler class.</summary> /// <param name="webContext">The web context wrapper.</param> /// <param name="broker"></param> /// <param name="installer"></param> /// <param name="dispatcher"></param> /// <param name="adapters"></param> /// <param name="errors"></param> /// <param name="editConfig"></param> /// <param name="hostConfig"></param> /// <param name="managementUrls"></param> public RequestLifeCycleHandler(IWebContext webContext, EventBroker broker, InstallationManager installer, RequestPathProvider dispatcher, IContentAdapterProvider adapters, IErrorHandler errors, IEditUrlManager editUrlManager, EditSection editConfig, HostSection hostConfig) { checkInstallation = editConfig.Installer.CheckInstallationStatus; welcomeUrl = editConfig.Installer.WelcomeUrl; managementUrl = editConfig.ManagementInterfaceUrl; rewriteMethod = hostConfig.Web.Rewrite; this.webContext = webContext; this.broker = broker; this.adapters = adapters; this.errors = errors; this.editUrlManager = editUrlManager; this.installer = installer; this.dispatcher = dispatcher; }
public override void SetRewriteMethod(RewriteMethod method) { throw new System.NotSupportedException("FuzzyQuery cannot change rewrite method"); }
static MultiTermQuery() { CONSTANT_SCORE_AUTO_REWRITE_DEFAULT = new AnonymousClassConstantScoreAutoRewrite(); }
/// <summary> Sets the rewrite method to be used when executing the /// query. You can use one of the four core methods, or /// implement your own subclass of {@link RewriteMethod}. /// </summary> public virtual void SetRewriteMethod(RewriteMethod method) { rewriteMethod = method; }
/// <summary>Changes of mode are not supported by this class (fixed to constant score rewrite mode) </summary> public override void SetRewriteMethod(RewriteMethod method) { throw new System.NotSupportedException("Use TermRangeQuery instead to change the rewrite method."); }