public class PagePersonalizationUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_HOLDER_PERSONALIZED_BY_CONTENT
Name of holder's service interface instance custom property that contains a boolean value indicating if that
holder is personalized by content.
|
Constructor and Description |
---|
PagePersonalizationUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addNewWidgets(Collection<String> oldWidgetInstancesIds,
Collection<String> updateWidgetInstancesIds,
ISourceField field,
SourcePreUpdateDataEvent event)
Compare two list of widgets instances and process the widgets whom exists on the updated list and does not exist
on the other list.
|
static String |
encodeHtmlEditorControl(String html)
Method that receives a html string, search for widget instance pattern and encode it with data.
|
static String |
getHolderContentId(String holderServiceInterfaceInstanceId,
String contentId)
Returns the identifier of the content the holder is personalized for.
|
static String |
getWidgetInstanceHolderInterfaceInstanceId(String interfaceInstanceId)
Returns the widget holder's interface instance id for a widget instance that corresponds to the specified
interface instance only if it's a holder widget instance.
|
static boolean |
isHolderPersonalizedByContent(String holderInterfaceInstanceId)
Returns whether a widget holder is configured to be personalized by content.
|
static void |
processWidgetInstaceInHtmlAdded(String html,
ISourceField field,
SourcePostAddDataEvent event)
Process the html field widget instance after it be added.
|
static void |
processWidgetInstaceInHtmlDelete(Collection<String> itemIds)
Process the html field widget instance to be deleted.
|
static void |
processWidgetInstaceInHtmlUpdate(String newHtml,
String originalHtml,
ISourceField field,
SourcePreUpdateDataEvent event)
Process the html field widget instance to be updated.
|
static void |
removeDeletedWidgets(Collection<String> oldWidgetInstancesIds,
Collection<String> updateWidgetInstancesIds)
Compare a list of old widgets and a updated list of widget instances and remove de widgets instances that does
not exists in the updated list.
|
static String |
renderWidgetInHtml(String html,
HttpServletRequest httpServletRequest,
IServiceInterfaceRenderRequest originalRenderRequest,
HttpServletResponse httpServletResponse)
Method that create a request to get html from a widget instance in a html content field and substitute the dummy
widget instance for his html content.
|
public static final String PROPERTY_HOLDER_PERSONALIZED_BY_CONTENT
public static String getWidgetInstanceHolderInterfaceInstanceId(String interfaceInstanceId)
interfaceInstanceId
- the widget instance's interface instance identifier.public static boolean isHolderPersonalizedByContent(String holderInterfaceInstanceId) throws PortalException
holderInterfaceInstanceId
- the holder's service interface instance identifier.true
if the holder is configured to be personalized by content, false
otherwise.PortalException
public static String getHolderContentId(String holderServiceInterfaceInstanceId, String contentId) throws PortalException
holderServiceInterfaceInstanceId
- the holder's service interface instance identifier.contentId
- the content identifier provided in the request being processed.null
if the holder is not configured to be personalized for content or
if the request does not specify a valid content to base the holder on.PortalException
public static String encodeHtmlEditorControl(String html) throws PortalException
html
- PortalException
public static String renderWidgetInHtml(String html, HttpServletRequest httpServletRequest, IServiceInterfaceRenderRequest originalRenderRequest, HttpServletResponse httpServletResponse) throws PortalException
html
- the orignal content htmlhttpServletRequest
- the http servlet requestoriginalRenderRequest
- the original render requesthttpServletResponse
- the http servlet ResponsePortalException
public static void processWidgetInstaceInHtmlDelete(Collection<String> itemIds) throws PortalException
itemId
- the content version item identifierPortalException
public static void processWidgetInstaceInHtmlUpdate(String newHtml, String originalHtml, ISourceField field, SourcePreUpdateDataEvent event) throws PortalException
newHtml
- the new html fieldoriginalHtml
- the original html fieldevent
- the pre update eventPortalException
public static void removeDeletedWidgets(Collection<String> oldWidgetInstancesIds, Collection<String> updateWidgetInstancesIds) throws PortalException
oldWidgetInstancesIds
- list of old widgets instancesupdateWidgetInstancesIds
- list of widgets instances updatedPortalException
public static void addNewWidgets(Collection<String> oldWidgetInstancesIds, Collection<String> updateWidgetInstancesIds, ISourceField field, SourcePreUpdateDataEvent event) throws PortalException
oldWidgetInstancesIds
- the list of old widgets instancesupdateWidgetInstancesIds
- the updated list of widgets instancesevent
- the pre update eventPortalException
public static void processWidgetInstaceInHtmlAdded(String html, ISourceField field, SourcePostAddDataEvent event) throws PortalException
html
- the html fieldevent
- the post add eventPortalException
LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.