Example #1
0
 private string PostProcess(string content, CallbackPageContext context)
 {
     return(content.
            Replace("%USER_ID%", context.UserId.ToString()).
            Replace("%ESPACENAME%", context.ESpaceName).
            Replace("%ESPACEKEY%", context.ESpaceKey.ToString()).
            Replace("%OSPAGENAME%", context.WebScreenName).
            Replace("%OSPAGEINFOFORJAVASCRIPT%", context.OsPageInfo).
            Replace("%EMPTY%", string.Empty)); // the %EMPTY% must be the last one to allow escaping
 }
Example #2
0
        protected virtual string RetrieveContentInjection(AppInfo app, CallbackPageContext context)
        {
            string content = RetrieveContentInjectionInner(app, context);

            if (IsLocalizable && content == null)
            {
                // This may happen in sessions with different locales, in the first time the callback results are rendered
                StoreResultsInner(app, Invoke(app, null));
                content = RetrieveContentInjectionInner(app, context);
            }

            return(content);
        }
 public IEnumerable <string> RetrieveContentInjection(CodeInjectionFactory.Locations location, bool allowsCallbacks, AppInfo app, SessionInfo session, Callbacks.CallbackPageContext context)
 {
     foreach (var c in _injectionElements.Where(c => !IsBroken(c)))
     {
         string content = string.Empty;
         if (c.GetLocation() == location)
         {
             var callback = c as AbstractCallback;
             if (callback != null)
             {
                 if (allowsCallbacks)
                 {
                     try {
                         content = callback.RetrieveContentInjection(app, session, context);
                     } catch (Exception e) {
                         RegisterError(callback, CallbackEvent.Unknown, app, e);
                     }
                 }
             }
             else
             {
                 var js = c as InjectedJavascript;
                 if (!app.OsContext.hasDisabledScript(js.Name) && !app.OsContext.hasDisabledScript(""))
                 {
                     content = js.Dump();
                 }
             }
         }
         yield return(content);
     }
 }
Example #4
0
 protected abstract string RetrieveContentInjectionInner(AppInfo app, SessionInfo session, CallbackPageContext context);
Example #5
0
 public sealed override string RetrieveContentInjection(AppInfo app, SessionInfo session, CallbackPageContext context)
 {
     if (app.Context.Request.UserAgent != null &&
         app.Context.Request.UserAgent.Contains("RichMail") ||
         app.OsContext.ResponseDisabledTaskBox)
     {
         // disable content injection for RichMail requests and when taskbox is disabled
         return(string.Empty);
     }
     else
     {
         return(PostProcess(RetrieveContentInjectionInner(app, session, context), context));
     }
 }
 public abstract string RetrieveContentInjection(AppInfo app, SessionInfo session, CallbackPageContext context);
 protected sealed override string RetrieveContentInjectionInner(AppInfo app, SessionInfo session, CallbackPageContext context)
 {
     return(RetrieveResultsFromStorage(app.OsContext.CallbackResults));
 }
 public override string RetrieveContentInjection(AppInfo app, SessionInfo session, CallbackPageContext context)
 {
     return(string.Empty);
 }
Example #9
0
 protected virtual string RetrieveContentInjectionInner(AppInfo app, CallbackPageContext context)
 {
     return(RetrieveResultsFromStorage(app.CallbackResults));
 }
Example #10
0
 protected sealed override string RetrieveContentInjectionInner(AppInfo app, SessionInfo session, CallbackPageContext context)
 {
     return(RetrieveContentInjection(app, context));
 }