public override void Write(string message)
        {
            Regex regex = new Regex(@"RGB\((?<r>[0-9]+), (?<g>[0-9]+), (?<b>[0-9]+)\)");
            Match matchMessage = regex.Match(message);
            if (matchMessage.Success)
            {
                message = message.Replace(matchMessage.Groups[0].Value, "");
            }

            LogEntryMessageQueueItem messageItem = new LogEntryMessageQueueItem { Level = _logLevel, Message = message, Sender = this.GetType() };
            ConsoleMessageQueueFacade.Enqueue(messageItem, null);
        }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Error += Composite_Management_FlowUi_Error;
        _consoleId = Request.QueryString[_consoleIdParameterName];
        string flowHandleSerialized = Request.QueryString[_flowHandleParameterName];
        string elementProviderName = Request.QueryString[_elementProviderNameParameterName];

        if (string.IsNullOrEmpty(_consoleId)) throw new ArgumentNullException(_consoleIdParameterName, "Missing query string parameter");
        if (string.IsNullOrEmpty(flowHandleSerialized)) throw new ArgumentNullException(_flowHandleParameterName, "Missing query string parameter");
        if (string.IsNullOrEmpty(elementProviderName)) throw new ArgumentNullException(_elementProviderNameParameterName, "Missing query string parameter");

        FlowHandle flowHandle = FlowHandle.Deserialize(flowHandleSerialized);

        try
        {
            using (GlobalInitializerFacade.CoreIsInitializedScope)
            {
                Control webControl = WebFlowUiMediator.GetFlowUi(flowHandle, elementProviderName, _consoleId, out _uiContainerName);

                if (webControl == null)
                {
                    // TODO: check if "httpContext.ApplicationInstance.CompleteRequest();" can be used
                    Response.Redirect(UrlUtils.ResolveAdminUrl("content/flow/FlowUiCompleted.aspx"), true);
                }
                else
                {
                    this.Controls.Add(webControl);
                }
            }
        }
        catch (ThreadAbortException)
        {
            throw;
        }
        catch (Exception ex)
        {
            IConsoleMessageQueueItem errorLogEntry = new LogEntryMessageQueueItem
            {
                Sender = typeof(System.Web.UI.Page), Level = Composite.Core.Logging.LogLevel.Error, Message = ex.Message
            };
            ConsoleMessageQueueFacade.Enqueue(errorLogEntry, _consoleId);
            throw;
        }

        Response.Cache.SetCacheability(HttpCacheability.NoCache);
    }