Copyright© 2008-2026 Sitevision AB, all rights reserved.
@Requireable(value="Utils") public interface Utils
An instance of this interface can be obtained from your portlet via the request attribute "sitevision.utils".
Once you have obtained an Utils instance, you can use it to retrieve instances of all other interfaces in the Sitevision API.
In all JCR capable portlets that are bundled with Sitevision and exposes a "Custom template", you always have an Utils instance
available as "$sitevisionUtils" in the VelocityContext.
Example of how to get hold of a PropertyUtil instance from your JSR 286 portlet:
Utils utils = (Utils) aRequest.getAttribute("sitevision.utils");
PropertyUtil propertyUtil = utils.getPropertyUtil();
...
propertyUtil.get...
Example of how to get hold of a PropertyUtil instance in Velocity for a JCR capable
standard Sitevision portlet with a "Custom template" (e.g. the JCR Menu portlet):
#set($propertyUtil = $sitevisionUtils.propertyUtil)
...
$propertyUtil.get...
If sitevisionUtils is not available on the VelocityContext, you can use the PortletRequest instead if available (e.g. the Script portlet):
#set($propertyUtil = $request.getAttribute('sitevision.utils').propertyUtil)
| Modifier and Type | Method and Description |
|---|---|
AliasUtil |
getAliasUtil()
Gets an instance of an alias utility class.
|
ArchiveUtil |
getArchiveUtil()
Gets an instance of an archive utility class
|
ArticleUtil |
getArticleUtil()
Gets an instance of an article utility class
|
AuthenticationUtil |
getAuthenticationUtil()
Gets an instance of an authentication utility class
|
BookmarkUtil |
getBookmarkUtil()
Gets an instance of a bookmark utility class
|
BuddyIconRenderer |
getBuddyIconRenderer()
Creates and returns a new instance of a stateful buddy icon renderer.
|
ClientUtil |
getClientUtil()
Gets an instance of a client utility class
|
CollaborationFactory |
getCollaborationFactory()
Gets an instance of a factory for collaboration-related instances.
|
ColorUtil |
getColorUtil()
Gets an instance of a color utility class
|
ContentNodeUtil |
getContentNodeUtil()
Gets an instance of a content node utility class.
|
CreateContentFactory |
getCreateContentFactory()
Gets an instance of a content builder factory.
|
CurrencyFactory |
getCurrencyFactory()
Gets an instance of a currency factory class.
|
DateUtil |
getDateUtil()
Gets an instance of an date utility class.
|
DecorationUtil |
getDecorationUtil()
Gets an instance of a decoration utility class
|
DeviceUtil |
getDeviceUtil()
Gets an instance of a device utility class
|
DirectoryUtil |
getDirectoryUtil()
Gets an instance of a directory utility class
|
DocTypeUtil |
getDocTypeUtil()
Gets an instance of a deprecated DOCTYPE utility class
|
EndecUtil |
getEndecUtil()
Gets an instance of an encode/decode utility class
|
ExceptionSuppressingCollection |
getExceptionSuppressingCollection(Collection<?> aCollection)
Deprecated.
ExceptionSuppressingCollection is not supported, this method deprecated and will be removed in a future version of Sitevision
|
ExceptionSuppressingIterator |
getExceptionSuppressingIterator(Iterator<?> aIterator)
Deprecated.
ExceptionSuppressingIterator is not supported, this method deprecated and will be removed in a future version of Sitevision
|
ExceptionSuppressingProxy |
getExceptionSuppressingProxy(Object aObject)
Deprecated.
ExceptionSuppressingProxy is not supported, this method deprecated and will be removed in a future version of Sitevision
|
FileIconRenderer |
getFileIconRenderer()
Creates and returns a new instance of a stateful file icon renderer.
|
FileUtil |
getFileUtil()
Gets an instance of a file utility class
|
FolderUtil |
getFolderUtil()
Gets an instance of a folder utility class
|
FontUtil |
getFontUtil()
Gets an instance of a font utility class
|
FormatterBuilderFactory |
getFormatterBuilderFactory()
Gets an instance of a formatter builder factory class.
|
IconUtil |
getIconUtil()
Gets an instance of an icon utility class
|
ImageLinkRenderer |
getImageLinkRenderer()
Creates and returns a new instance of a stateful image link renderer.
|
ImageRenderer |
getImageRenderer()
Creates and returns a new instance of a stateful image renderer.
|
ImageScaler |
getImageScaler(int aMaxWidth,
int aMaxHeight)
Gets an instance of an immutable image scaler that enables scaling of images to a certain size.
|
ImageUtil |
getImageUtil()
Gets an instance of an image utility class
|
InstanceCreatorUtil |
getInstanceCreatorUtil()
Gets an instance of an instance creator utility class.
|
InstanceTypeUtil |
getInstanceTypeUtil()
Gets an instance of an instance type utility class
|
LandingPageUtil |
getLandingPageUtil()
Gets an instance of a landing page utility class.
|
LinkRenderer |
getLinkRenderer()
Creates and returns a new instance of a stateful link renderer.
|
LocaleUtil |
getLocaleUtil()
Gets an instance of a locale utility class.
|
LogUtil |
getLogUtil()
Gets an instance of a logging utility class
|
MailUtil |
getMailUtil()
Gets an instance of a mail utility class.
|
MessageDigesterFactory |
getMessageDigesterFactory()
Gets an instance of a message digester factory class.
|
MessagesFactory |
getMessagesFactory()
Gets an instance of a messages factory class.
|
MetadataDefinitionUtil |
getMetadataDefinitionUtil()
Gets an instance of an metadata definition utility class
|
MetadataUtil |
getMetadataUtil()
Gets an instance of a metadata utility class
|
MimeTypeUtil |
getMimeTypeUtil()
Gets an instance of a MIME type utility class
|
NodeComparatorUtil |
getNodeComparatorUtil()
Gets an instance of a node comparator utility class.
|
NodeFactoryUtil |
getNodeFactoryUtil()
Gets an instance of a node factory utility class.
|
NodeFilterUtil |
getNodeFilterUtil()
Gets an instance of a node filter utility class.
|
NodeIteratorUtil |
getNodeIteratorUtil()
Gets an instance of a node iterator utility class
|
NodeResolverUtil |
getNodeResolverUtil()
Gets an instance of a node resolver utility class.
|
NodeTreeUtil |
getNodeTreeUtil()
Gets an instance of a utility class for node trees.
|
NodeTypeUtil |
getNodeTypeUtil()
Gets an instance of a node type utility class
|
OutputUtil |
getOutputUtil()
Gets an instance of a output utility class
|
PageUtil |
getPageUtil()
Gets an instance of a page utility class
|
PermissionUtil |
getPermissionUtil()
Gets an instance of a permission utility class
|
PortletContextUtil |
getPortletContextUtil()
Gets an instance of a portlet context utility class
|
PortletUtil |
getPortletUtil()
Gets an instance of a portlet utility class
|
PrincipalUtil |
getPrincipalUtil()
Gets an instance of an principal utility class
|
PropertyUtil |
getPropertyUtil()
Gets an instance of a utility class for jcr properties
|
PublishingUtil |
getPublishingUtil()
Gets an instance of a publishing utility class
|
RedirectUtil |
getRedirectUtil()
Gets an instance of a redirect utility class.
|
RendererBuilderFactory |
getRendererBuilderFactory()
Gets an instance of a renderer builder factory class.
|
ResourceLocatorUtil |
getResourceLocatorUtil()
Gets an instance of a resource locator utility class
|
RoleUtil |
getRoleUtil()
Gets an instance of a role utility class.
|
ScriptUtil |
getScriptUtil()
Gets an instance of a scripting utility class
|
SearchFactory |
getSearchFactory()
Gets an instance of a factory for search-related instances.
|
SearchFieldUtil |
getSearchFieldUtil()
Deprecated.
|
SearchUtil |
getSearchUtil()
Gets an instance of a search utility class
|
SiteCookieUtil |
getSiteCookieUtil()
Gets an instance of a site cookie utility class.
|
StructureUtil |
getStructureUtil()
Gets an instance of a structure utility class
|
SubscriberUtil |
getSubscriberUtil()
Gets an instance of an subscriber utility class
|
SubscriptionUtil |
getSubscriptionUtil()
Gets an instance of an subscription utility class
|
TagUtil |
getTagUtil()
Gets an instance of a tag utility class.
|
TargetAudienceUtil |
getTargetAudienceUtil()
Gets an instance of a target audience utility class.
|
TemplateUtil |
getTemplateUtil()
Gets an instance of a template utility class
|
TextModuleRendererBuilder |
getTextModuleRendererBuilder()
Gets an instance of a Text module renderer builder class.
|
TimestampUtil |
getTimestampUtil()
Gets an instance of a timestamp utility class.
|
TranslationUtil |
getTranslationUtil()
Gets an instance of a translation utility class.
|
TrashcanUtil |
getTrashcanUtil()
Gets an instance of a trashcan utility class
|
UserFactory |
getUserFactory()
Gets an instance of a factory for user-related instances.
|
UserFieldRenderer |
getUserFieldRenderer()
Creates and returns a new instance of a stateful user field renderer.
|
UserUtil |
getUserUtil()
Deprecated.
use
getUserFactory() to get a SystemUserUtil and
UserIdentityUtil instead |
WebContentUtil |
getWebContentUtil()
Gets an instance of a web content utility class
|
WebResourceFactory |
getWebResourceFactory()
Gets an instance of a web resource factory utility class.
|
VelocityRenderer |
getVelocityRenderer()
Gets an instance of a Velocity renderer class.
|
VersionedPropertyUtil |
getVersionedPropertyUtil(int aVersion)
Gets an instance of a property utility class for a specified version.
|
VersionUtil |
getVersionUtil()
Gets an instance of a version utility class
|
XmlParserUtil |
getXmlParserUtil()
Gets an instance of a xml parser utility class.
|
XSLTUtil |
getXSLTUtil()
Gets an instance of a XSLT utility class.
|
PortletContextUtil getPortletContextUtil()
NodeIteratorUtil getNodeIteratorUtil()
NodeTreeUtil getNodeTreeUtil()
PropertyUtil getPropertyUtil()
LinkRenderer getLinkRenderer()
OutputUtil getOutputUtil()
ColorUtil getColorUtil()
DecorationUtil getDecorationUtil()
FontUtil getFontUtil()
ResourceLocatorUtil getResourceLocatorUtil()
EndecUtil getEndecUtil()
ScriptUtil getScriptUtil()
LogUtil getLogUtil()
IconUtil getIconUtil()
PermissionUtil getPermissionUtil()
DirectoryUtil getDirectoryUtil()
ClientUtil getClientUtil()
SearchUtil getSearchUtil()
@Deprecated SearchFieldUtil getSearchFieldUtil()
PortletUtil getPortletUtil()
MetadataUtil getMetadataUtil()
BookmarkUtil getBookmarkUtil()
PublishingUtil getPublishingUtil()
VersionUtil getVersionUtil()
ArchiveUtil getArchiveUtil()
FolderUtil getFolderUtil()
StructureUtil getStructureUtil()
WebContentUtil getWebContentUtil()
ArticleUtil getArticleUtil()
FileUtil getFileUtil()
ImageUtil getImageUtil()
PageUtil getPageUtil()
TrashcanUtil getTrashcanUtil()
TemplateUtil getTemplateUtil()
AuthenticationUtil getAuthenticationUtil()
PrincipalUtil getPrincipalUtil()
FileIconRenderer getFileIconRenderer()
ImageRenderer getImageRenderer()
ImageScaler getImageScaler(int aMaxWidth, int aMaxHeight)
Image scaler instance will respect the size ratio of the original image when scaling it.
Note that an image scaler must be created in context of a currently executing portlet. In other words:
if PortletContextUtil.getCurrentPortlet()
is null, no image scaler can be created (i.e. this method will return null).
aMaxWidth - max width in pixels for scaled images, must be 10 or higheraMaxHeight - max height in pixels for scaled images, must be 10 or higherImageRenderer.
If aMaxWidth or aMaxHeight has illegal values, null will be returned.@Deprecated ExceptionSuppressingProxy getExceptionSuppressingProxy(Object aObject)
aObject - an object to be proxied by an ExceptionSuppressingProxy@Deprecated ExceptionSuppressingCollection getExceptionSuppressingCollection(Collection<?> aCollection)
aCollection - a collection to be decorated by a ExceptionSuppressingCollection@Deprecated ExceptionSuppressingIterator getExceptionSuppressingIterator(Iterator<?> aIterator)
aIterator - an iterator to be decorated by a ExceptionSuppressingIteratorSubscriptionUtil getSubscriptionUtil()
SubscriberUtil getSubscriberUtil()
InstanceTypeUtil getInstanceTypeUtil()
NodeTypeUtil getNodeTypeUtil()
MetadataDefinitionUtil getMetadataDefinitionUtil()
ImageLinkRenderer getImageLinkRenderer()
MimeTypeUtil getMimeTypeUtil()
DocTypeUtil getDocTypeUtil()
VersionedPropertyUtil getVersionedPropertyUtil(int aVersion)
Note! This method returns an exotic sibling interface to PropertyUtil that
can be used to extract property values from an other version than the one you are currently executing in.
If you don't know what a version is or haven't thought much about it, you would typically use the common property extraction interface -
getPropertyUtil().
aVersion - VersionUtil.OFFLINE_VERSION or
VersionUtil.ONLINE_VERSIONOfflineVersionPropertyUtil or
OnlineVersionPropertyUtil.
if aVersion has an illegal value, null will be returned.PropertyUtilDeviceUtil getDeviceUtil()
@Deprecated UserUtil getUserUtil()
getUserFactory() to get a SystemUserUtil and
UserIdentityUtil insteadVelocityRenderer getVelocityRenderer()
InstanceCreatorUtil getInstanceCreatorUtil()
DateUtil getDateUtil()
LandingPageUtil getLandingPageUtil()
BuddyIconRenderer getBuddyIconRenderer()
UserFieldRenderer getUserFieldRenderer()
MailUtil getMailUtil()
SearchFactory getSearchFactory()
LocaleUtil getLocaleUtil()
UserFactory getUserFactory()
CollaborationFactory getCollaborationFactory()
ContentNodeUtil getContentNodeUtil()
NodeComparatorUtil getNodeComparatorUtil()
NodeFilterUtil getNodeFilterUtil()
RedirectUtil getRedirectUtil()
NodeResolverUtil getNodeResolverUtil()
NodeFactoryUtil getNodeFactoryUtil()
WebResourceFactory getWebResourceFactory()
TranslationUtil getTranslationUtil()
XSLTUtil getXSLTUtil()
TimestampUtil getTimestampUtil()
MessageDigesterFactory getMessageDigesterFactory()
XmlParserUtil getXmlParserUtil()
RoleUtil getRoleUtil()
SiteCookieUtil getSiteCookieUtil()
CurrencyFactory getCurrencyFactory()
FormatterBuilderFactory getFormatterBuilderFactory()
TextModuleRendererBuilder getTextModuleRendererBuilder()
TagUtil getTagUtil()
AliasUtil getAliasUtil()
MessagesFactory getMessagesFactory()
TargetAudienceUtil getTargetAudienceUtil()
RendererBuilderFactory getRendererBuilderFactory()
CreateContentFactory getCreateContentFactory()
Sitevision - Content Management Made Easy
Sitevision is an advanced Java enterprise portal product that implements Java Content Repository (JSR 283).
Copyright© 2008-2026 Sitevision AB, all rights reserved.