
Classes | |
| class | ContextObserver |
| interface | Delegate |
| class | Resource |
Public Types | |
| enum | TagMissingBehavior { Top, Inline, Skip, SkipAndWarn } |
Static Public Member Functions | |
| static String | _htmlCloseHeadTag () |
| static boolean | addResourceInHead (WOResponse response, WOContext context, String framework, String fileName, String startTag, String endTag, String fallbackStartTag, String fallbackEndTag, TagMissingBehavior tagMissingBehavior) |
| static boolean | addResourceInHead (WOResponse response, WOContext context, String framework, String fileName, String startTag, String endTag, TagMissingBehavior tagMissingBehavior) |
| static void | addResourceInHead (WOResponse response, WOContext context, String framework, String fileName, String startTag, String endTag) |
| static void | addScriptCodeInHead (WOResponse response, WOContext context, String script, String scriptName) |
| static void | addScriptCodeInHead (WOResponse response, WOContext context, String script) |
| static void | addScriptResourceInHead (WOResponse response, WOContext context, String framework, String fileName) |
| static void | addStylesheetResourceInHead (WOResponse response, WOContext context, String framework, String fileName, String media) |
| static void | addStylesheetResourceInHead (WOResponse response, WOContext context, String framework, String fileName) |
| static NSMutableDictionary < String, Object > | ajaxPageUserInfo (WOContext context) |
| static boolean | insertInResponseBeforeHead (WOResponse response, WOContext context, String content, TagMissingBehavior tagMissingBehavior) |
| static boolean | insertInResponseBeforeTag (WOResponse response, WOContext context, String content, String tag, TagMissingBehavior tagMissingBehavior) |
| static boolean | isResourceAddedToHead (WOContext context, String frameworkName, String resourceName) |
| static NSMutableDictionary < String, Object > | pageUserInfo (WOComponent page) |
| static NSMutableDictionary < String, Object > | pageUserInfo (WOContext context) |
| static void | replaceAllInResponse (WOResponse response, WOContext context, Pattern pattern, String replacement) |
| static void | replaceFirstInResponse (WOResponse response, WOContext context, Pattern pattern, String replacement) |
| static void | resourceAddedToHead (WOContext context, String frameworkName, String resourceName) |
| static NSMutableSet< String > | resourcesAddedToHead (WOContext context) |
| static void | setDelegate (ERXResponseRewriter.Delegate delegate) |
Static Public Attributes | |
| static final Logger | log = Logger.getLogger(ERXResponseRewriter.class) |
Static Package Functions | |
| [static initializer] | |
Static Private Attributes | |
| static Map< WOComponent, NSMutableDictionary< String, Object > > | _ajaxPageUserInfos |
| static Delegate | _delagate |
| static Map< WOComponent, NSMutableDictionary< String, Object > > | _pageUserInfos |
| static final String | ADDED_RESOURCES_KEY = "ERXResponseRewriter.addedResources" |
| static final String | CONTEXT_OBSERVER_KEY = "ERXResponseRewriter.contextObserver" |
| static final String | ORIGINAL_CONTEXT_ID_KEY = "_originalContextID" |
| static final String | PENDING_INSERTS_KEY = "ERXResponseRewriter.pendingInserts" |
| static final String | SECURE_RESOURCES_KEY = "er.ajax.secureResources" |
| static final String | TOP_INDEX_KEY = "ERXResponseRewriter.topIndex" |
| enum TagMissingBehavior |
TagMissingBehavior specifies several ways the response rewriter should handle the case of having a missing tag that you attempted to insert in front of (for instance, if you ask to insert in the head tag and the head tag does not exist).
| [static initializer] | ( | ) | [static, package] |
| static String _htmlCloseHeadTag | ( | ) | [static] |
Returns the tag name that scripts and resources should be inserted above. Defaults to </head>, but this can be overridden by setting the property er.ajax.AJComponent.htmlCloseHead.
| static boolean addResourceInHead | ( | WOResponse | response, | |
| WOContext | context, | |||
| String | framework, | |||
| String | fileName, | |||
| String | startTag, | |||
| String | endTag, | |||
| String | fallbackStartTag, | |||
| String | fallbackEndTag, | |||
| TagMissingBehavior | tagMissingBehavior | |||
| ) | [static] |
Adds a reference to an arbitrary file with a correct resource url wrapped between startTag and endTag in the html head tag if it isn't already present in the response.
| response | ||
| context | ||
| framework | ||
| fileName | ||
| startTag | ||
| endTag | ||
| fallbackStartTag | ||
| fallbackEndTag | ||
| tagMissingBehavior |
| static boolean addResourceInHead | ( | WOResponse | response, | |
| WOContext | context, | |||
| String | framework, | |||
| String | fileName, | |||
| String | startTag, | |||
| String | endTag, | |||
| TagMissingBehavior | tagMissingBehavior | |||
| ) | [static] |
Adds a reference to an arbitrary file with a correct resource url wrapped between startTag and endTag in the html head tag if it isn't already present in the response.
| response | ||
| fileName | ||
| startTag | ||
| endTag |
| static void addResourceInHead | ( | WOResponse | response, | |
| WOContext | context, | |||
| String | framework, | |||
| String | fileName, | |||
| String | startTag, | |||
| String | endTag | |||
| ) | [static] |
Adds a reference to an arbitrary file with a correct resource url wrapped between startTag and endTag in the html head tag if it isn't already present in the response.
| context | the context | |
| response | the response | |
| framework | the framework that contains the file | |
| fileName | the name of the file to add | |
| startTag | the HTML to prepend before the URL | |
| endTag | the HTML to append after the URL |
| static void addScriptCodeInHead | ( | WOResponse | response, | |
| WOContext | context, | |||
| String | script, | |||
| String | scriptName | |||
| ) | [static] |
Adds javascript code in a script tag in the html head tag or inline if the request is an Ajax request.
| response | the response to write into | |
| script | the javascript code to insert | |
| scriptName | the name of the script to insert (for duplicate checking) |
| static void addScriptCodeInHead | ( | WOResponse | response, | |
| WOContext | context, | |||
| String | script | |||
| ) | [static] |
Adds javascript code in a script tag in the html head tag (without a name). If you call this method multiple times with the same script code, it will add multiple times. To prevent this, call addScriptCodeInHead(WOResponse, String, String) passing in a name for your script.
| response | the response to write into | |
| script | the javascript code to insert |
| static void addScriptResourceInHead | ( | WOResponse | response, | |
| WOContext | context, | |||
| String | framework, | |||
| String | fileName | |||
| ) | [static] |
Adds a script tag with a correct resource url into the html head tag if it isn't already present in the response, or inserts an Ajax OnDemand tag if the current request is an Ajax request.
| response | the response | |
| context | the context | |
| framework | the framework that contains the file | |
| fileName | the name of the javascript file to add |
| static void addStylesheetResourceInHead | ( | WOResponse | response, | |
| WOContext | context, | |||
| String | framework, | |||
| String | fileName, | |||
| String | media | |||
| ) | [static] |
Adds a stylesheet link tag with a correct resource url in the html head tag if it isn't already present in the response.
| context | the context | |
| response | the response | |
| framework | the framework that contains the file | |
| fileName | the name of the css file to add | |
| media | the media type of the stylesheet (or null for default) |
| static void addStylesheetResourceInHead | ( | WOResponse | response, | |
| WOContext | context, | |||
| String | framework, | |||
| String | fileName | |||
| ) | [static] |
Adds a stylesheet link tag with a correct resource url in the html head tag if it isn't already present in the response.
| context | the context | |
| response | the response | |
| framework | the framework that contains the file | |
| fileName | the name of the css file to add |
| static NSMutableDictionary<String, Object> ajaxPageUserInfo | ( | WOContext | context | ) | [static] |
Returns the page userInfo for the page component of the given context. If this is the first request for the page user info for a non-ajax request, the user info will be cleared (so that reloading a page doesn't make the system believe it has already rendered script and css tags, for instance). If you do not want this behavior, use pageUserInfo(WOContext) instead.
| context | the context to lookup |
| static boolean insertInResponseBeforeHead | ( | WOResponse | response, | |
| WOContext | context, | |||
| String | content, | |||
| TagMissingBehavior | tagMissingBehavior | |||
| ) | [static] |
Utility to add the given content into the response before the close of the head tag.
| response | the WOResponse | |
| context | the WOContext | |
| content | the content to insert. | |
| tagMissingBehavior | how to handle the case where the tag is missing |
| static boolean insertInResponseBeforeTag | ( | WOResponse | response, | |
| WOContext | context, | |||
| String | content, | |||
| String | tag, | |||
| TagMissingBehavior | tagMissingBehavior | |||
| ) | [static] |
Utility to add the given content into the response before a particular HTML tag.
| response | the WOResponse | |
| context | the WOContext | |
| content | the content to insert. | |
| tag | the tag to insert before (in html syntax) | |
| tagMissingBehavior | how to handle the case where the tag is missing |
| static boolean isResourceAddedToHead | ( | WOContext | context, | |
| String | frameworkName, | |||
| String | resourceName | |||
| ) | [static] |
Returns whether or not the given resource has been added to the HEAD tag.
| resourceName | the name of the resource to check |
| static NSMutableDictionary<String, Object> pageUserInfo | ( | WOComponent | page | ) | [static] |
Returns the page userInfo for the given page component. Unlike ajaxPageUserInfo, information put into pageUserInfo will stay associated with the page as long as the page exists.
| page | the component to lookup |
| static NSMutableDictionary<String, Object> pageUserInfo | ( | WOContext | context | ) | [static] |
Returns the page userInfo for the page component of the given context. Unlike ajaxPageUserInfo, information put into pageUserInfo will stay associated with the page as long as the page exists.
| context | the context to lookup |
| static void replaceAllInResponse | ( | WOResponse | response, | |
| WOContext | context, | |||
| Pattern | pattern, | |||
| String | replacement | |||
| ) | [static] |
Replaces all occurrences of the given pattern in the response with the replacement string.
| response | the response | |
| context | the context | |
| pattern | the pattern to match | |
| replacement | the replacement value |
| static void replaceFirstInResponse | ( | WOResponse | response, | |
| WOContext | context, | |||
| Pattern | pattern, | |||
| String | replacement | |||
| ) | [static] |
Replaces the first occurrence of the given pattern in the response with the replacement string.
| response | the response | |
| context | the context | |
| pattern | the pattern to match | |
| replacement | the replacement value |
| static void resourceAddedToHead | ( | WOContext | context, | |
| String | frameworkName, | |||
| String | resourceName | |||
| ) | [static] |
Records that the given resource (within the given framework) has been added to the head of this page.
| context | the WOContext | |
| frameworkName | the framework name of the resource | |
| resourceName | the name of the resource |
| static NSMutableSet<String> resourcesAddedToHead | ( | WOContext | context | ) | [static] |
Returns the resources that have been added to the head of this page.
| context | the WOContext |
| static void setDelegate | ( | ERXResponseRewriter.Delegate | delegate | ) | [static] |
Sets the response rewriter delegate to be used by this Application.
| delegate | the response rewriter delegate to be used by this Application, or null to use the default |
Map<WOComponent, NSMutableDictionary<String, Object> > _ajaxPageUserInfos [static, private] |
Map<WOComponent, NSMutableDictionary<String, Object> > _pageUserInfos [static, private] |
final String ADDED_RESOURCES_KEY = "ERXResponseRewriter.addedResources" [static, private] |
final String CONTEXT_OBSERVER_KEY = "ERXResponseRewriter.contextObserver" [static, private] |
final Logger log = Logger.getLogger(ERXResponseRewriter.class) [static] |
final String ORIGINAL_CONTEXT_ID_KEY = "_originalContextID" [static, private] |
final String PENDING_INSERTS_KEY = "ERXResponseRewriter.pendingInserts" [static, private] |
final String SECURE_RESOURCES_KEY = "er.ajax.secureResources" [static, private] |
final String TOP_INDEX_KEY = "ERXResponseRewriter.topIndex" [static, private] |
1.5.8