/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type BuddyIconSize from "../BuddyIconRenderer.BuddyIconSize"; import type { Node } from "../../types/javax/jcr/Node"; import type { BuddyIconInfo } from "../../types/senselogic/sitevision/api/render/BuddyIconRenderer.BuddyIconInfo"; import type { String } from "../../types/java/lang/String"; /** * BuddyIconRenderer is a stateful utility interface for rendering of buddy icons for user identities and collaboration groups. * *
* An instance of the Sitevision class implementing this interface can be obtained via {@link senselogic.sitevision.api.Utils#getBuddyIconRenderer()}.
* See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the Utils interface.
*
* BuddyIconRenderer has few attributes: *
*null.
* BuddyIconSize.SMALL. Note that image size
* settings are followed with best effort. Images will never be upscaled.
* true.
* * Using the BuddyIconRenderer is pretty straightforward, if you remember that it is stateful and that the previously * loaded buddy icon node will be cleared whenever you try to load a new one. Conceptually you would typically use it like this: *
** When you have rendered once, you can re-use the BuddyIconRenderer until you are done. Something like: *
*
* Example of how this strategy could be implemented in Velocity:
* (You want to do a simple listing of buddy icons for some collaboration groups, collaboration group pages, user identities or users)
*
* ## Get BuddyIconRenderer
* #set ($buddyIconRenderer = $sitevisionUtils.buddyIconRenderer)
*
* ## Iterate through the list of nodes and render a buddy icon for all supported nodes
* <ul class="sv-no-list-style">
* #foreach ($item in $items)
* ## Check if this node can be rendered as a buddy icon
* #if ($buddyIconRenderer.isRenderable($item))
* ## Update the renderer and render
* $buddyIconRenderer.update($item)
* <li>
* $buddyIconRenderer.render()
* </li>
* #end
* #end
* </ul>
*
* @author Magnus Lövgren
* @since Sitevision 3.5.3
*/
export interface BuddyIconRenderer {
/**
* Sets the size for rendered buddy icons.
*
* Default is BuddyIconSize.SMALL
setBuddyIconSize(BuddyIconSize.SMALL)
* @see #setBuddyIconSize(senselogic.sitevision.api.render.BuddyIconRenderer.BuddyIconSize)
* @see BuddyIconSize#SMALL
*/
forceUseSmallBuddyIconSize(): void;
/**
* Utility method for executing setBuddyIconSize(BuddyIconSize.LARGE)
* @see #setBuddyIconSize(senselogic.sitevision.api.render.BuddyIconRenderer.BuddyIconSize)
* @see BuddyIconSize#LARGE
*/
forceUseLargeBuddyIconSize(): void;
/**
* Utility method for executing setBuddyIconSize(BuddyIconSize.X_LARGE)
* @since Sitevision 8.2
* @see #setBuddyIconSize(senselogic.sitevision.api.render.BuddyIconRenderer.BuddyIconSize)
* @see BuddyIconSize#X_LARGE
*/
forceUseXLargeBuddyIconSize(): void;
/**
* Whether or not rendered buddy icons should be linked.
*
* Default is true
setLinkBuddyIcon(false)
* @see #setLinkBuddyIcon(boolean)
*/
clearUseLinkBuddyIcon(): void;
/**
* Utility method for executing setLinkBuddyIcon(true)
* @see #setLinkBuddyIcon(boolean)
*/
forceUseLinkBuddyIcon(): void;
/**
* Updates the renderer with a new buddy icon supported node.
*
*
* If aBuddyIconNode is not a type that can be represented by a buddy icon, the argument will be considered as null,
* i.e. the renderer will not have any renderable node in subsequent render execution.
*
true if a renderable node is loaded, false if not.
*/
isLoaded(): boolean;
/**
* Helper method to check if a certain node can be rendered as a buddy icon.
*
* * Nodes with the following primary node types are potentially renderable: *
*sv:userIdentitysv:user (non-anonymous) » will be renderable if a sv:userIdentity can be extractedsv:simpleUser » will be renderable if a sv:userIdentity can be extractedsv:systemUser » will be renderable if a sv:userIdentity can be extractedsv:collaborationGroupsv:collaborationGroupPage » will be renderable if a sv:collaborationGroup can be extractedtrue if aNode is supported by this renderer, false if not
*/
isRenderable(aNode: Node): boolean;
/**
* BuddyIconInfo for current state.
*
* * * The data this method provides is used by the {@link #render()} method. * The intent of this method is to facilitate custom buddy icon rendering solutions. * See {@link BuddyIconInfo} for such example. * *
* *
* Note! Returned BuddyIconInfo object is never null but its uri will potentially be null and its
* width/height might be zero.
* Typically when this renderer has no valid/renderable node loaded, see {@link #isLoaded()}.
*
null.
*/
render(): string;
}
declare namespace BuddyIconRenderer {}
declare var buddyIconRenderer: BuddyIconRenderer;
export default buddyIconRenderer;