|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.portal.core.util.RewriteHelper
Rewrite helper class.
This class features a set of methods to rewrite markup content with unique identifiers. It can be used for WSRP consumer rewrite. The default implementation of all methods replaces the 'wsrp_rewrite_' token with the provided prefix token.
Field Summary | |
static java.lang.String |
HEADER_CONTENT
Constant to set the content that should be injected into the HEAD tag of the pages markup. |
static java.lang.String |
NAMESPACE_PREFIX
Constant to set a prefix value to use during the rewrite. |
static java.lang.String |
REWRITE_FLAG
Constant to signal in a portlet that rewrite is requested. |
Constructor Summary | |
RewriteHelper()
|
Method Summary | |
static java.lang.String |
rewriteContent(java.util.regex.Pattern pattern,
java.lang.String content,
java.lang.String prefix)
Rewrite the content. |
static java.lang.String |
wsrpRewriteContent(java.lang.String content,
java.lang.String prefix)
Rewrite the content. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String REWRITE_FLAG
A portlet can set this flag as a response property (set to "true") to signal to the theme layer that the content needs to be rewritten. If the flag is set the theme layer will detect it and replace all 'wsrp_rewite_' tokens with the provided prefix
public static final java.lang.String NAMESPACE_PREFIX
This prefix is equivalent to the producer write paradigm defined in WSRP. The portlet can set any arbitrary value to use for the rewrite, by providing this token as a response property. It is up to the portlet to decide where to get the value from.
public static final java.lang.String HEADER_CONTENT
The content set in a portlet response property with this flag will be injected into the HEAD tag, if the portal layout features the headercontent tag.
Constructor Detail |
public RewriteHelper()
Method Detail |
public static java.lang.String wsrpRewriteContent(java.lang.String content, java.lang.String prefix)
Rewrite the provided content by parsing for the 'wsrp_rewrite_' token and replacing it with the
provided prefix
.
content
- the content to parse and potentially rewriteprefix
- the replacement string for the 'wsrp_rewrite_' token(s)
public static java.lang.String rewriteContent(java.util.regex.Pattern pattern, java.lang.String content, java.lang.String prefix)
Rewrite the provided content by parsing for the provided pattern, and replacing each occurence with the provided prefix.
pattern
- the compiled regular expression to parse the content forcontent
- the content to parse and potentially rewriteprefix
- the replacement string for the 'wsrp_rewrite_' token(s)
java.util.regex.Pattern#compile()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |