| java.lang.Object org.apache.roller.ui.rendering.model.UtilitiesModel
UtilitiesModel | public class UtilitiesModel implements Model(Code) | | Model which provides access to a set of general utilities.
|
Method Summary | |
public static String | addNofollow(String html) Code (stolen from Pebble) to add rel="nofollow" string to all links in HTML. | public static String | autoformat(String s) Autoformat. | final public static String | decode(String s) URL decoding. | final public static String | encode(String s) URL encoding. | public static String | encodeEmail(String str) | public static boolean | equals(String str1, String str2) | public static String | escapeHTML(String str) | public static String | escapeXML(String str) | public static String | format8charsDate(Date date) Return a date in RFC-822 format. | public String | formatDate(Date d, String fmt) Format date using SimpleDateFormat format string. | public static String | formatDate(Date d, String fmt, TimeZone tzOverride) Format date using SimpleDateFormat format string. | public static String | formatIso8601Date(Date d) Format date in ISO-8601 format. | public static String | formatIso8601Day(Date d) Format date in ISO-8601 format. | public static String | formatRfc822Date(Date date) Return a date in RFC-822 format. | public String | getModelName() | public static Date | getNow() Return date for current time. | public static String | hexEncode(String str) | public void | init(Map initData) | public static boolean | isAlphanumeric(String str) | public static boolean | isEmpty(String str) | public static boolean | isNotEmpty(String str) | public boolean | isUserAuthenticated() | public boolean | isUserAuthorizedToAdmin(WebsiteDataWrapper weblog) | public boolean | isUserAuthorizedToAuthor(WebsiteDataWrapper weblog) | public static String | left(String str, int length) | public static String | removeHTML(String str) Remove occurences of html, defined as any text
between the characters "<" and ">". | public static String | removeHTML(String str, boolean addSpace) Remove occurences of html, defined as any text
between the characters "<" and ">". | public static String | replace(String src, String target, String rWith) | public static String | replace(String src, String target, String rWith, int maxCount) | public static String[] | split(String str1, String str2) | public static String[] | stripAll(String[] strs) | public static String | toBase64(byte[] aValue) | public static String | transformToHTMLSubset(String s) Transforms the given String into a subset of HTML displayable on a web
page. | public static String | truncate(String str, int lower, int upper, String appendToEnd) Strips HTML and truncates. | public static String | truncateNicely(String str, int lower, int upper, String appendToEnd) | public static String | truncateText(String str, int lower, int upper, String appendToEnd) | public static String | unescapeHTML(String str) | public static String | unescapeXML(String str) |
addNofollow | public static String addNofollow(String html)(Code) | | Code (stolen from Pebble) to add rel="nofollow" string to all links in HTML.
|
decode | final public static String decode(String s)(Code) | | URL decoding.
Parameters: s - a URL-encoded string to be URL-decoded URL decoded value of s using character encoding UTF-8; null if s is null. |
encode | final public static String encode(String s)(Code) | | URL encoding.
Parameters: s - a string to be URL-encoded URL encoding of s using character encoding UTF-8; null if s is null. |
format8charsDate | public static String format8charsDate(Date date)(Code) | | Return a date in RFC-822 format.
|
formatDate | public String formatDate(Date d, String fmt)(Code) | | Format date using SimpleDateFormat format string.
|
formatIso8601Date | public static String formatIso8601Date(Date d)(Code) | | Format date in ISO-8601 format.
|
formatIso8601Day | public static String formatIso8601Day(Date d)(Code) | | Format date in ISO-8601 format.
|
formatRfc822Date | public static String formatRfc822Date(Date date)(Code) | | Return a date in RFC-822 format.
|
getModelName | public String getModelName()(Code) | | Template context name to be used for model
|
getNow | public static Date getNow()(Code) | | Return date for current time.
|
isAlphanumeric | public static boolean isAlphanumeric(String str)(Code) | | |
isNotEmpty | public static boolean isNotEmpty(String str)(Code) | | |
isUserAuthenticated | public boolean isUserAuthenticated()(Code) | | |
isUserAuthorizedToAdmin | public boolean isUserAuthorizedToAdmin(WebsiteDataWrapper weblog)(Code) | | |
isUserAuthorizedToAuthor | public boolean isUserAuthorizedToAuthor(WebsiteDataWrapper weblog)(Code) | | |
removeHTML | public static String removeHTML(String str)(Code) | | Remove occurences of html, defined as any text
between the characters "<" and ">". Replace
any HTML tags with a space.
|
removeHTML | public static String removeHTML(String str, boolean addSpace)(Code) | | Remove occurences of html, defined as any text
between the characters "<" and ">".
Optionally replace HTML tags with a space.
|
toBase64 | public static String toBase64(byte[] aValue)(Code) | | Convert a byte array into a Base64 string (as used in mime formats)
|
transformToHTMLSubset | public static String transformToHTMLSubset(String s)(Code) | | Transforms the given String into a subset of HTML displayable on a web
page. The subset includes <b>, <i>, <p>, <br>,
<pre> and <a href> (and their corresponding end tags).
Parameters: s - the String to transform the transformed String |
truncate | public static String truncate(String str, int lower, int upper, String appendToEnd)(Code) | | Strips HTML and truncates.
|
|
|