Package lumis.portal.servlet
Class UniqueWriterControllerTestWrapper
- java.lang.Object
-
- lumis.portal.servlet.UniqueWriterControllerTestWrapper
-
- All Implemented Interfaces:
IUniqueWriterController
public class UniqueWriterControllerTestWrapper extends java.lang.Object implements IUniqueWriterController
Wrapper forIUniqueWriterController
to be used in tests.- Since:
- 17.1.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface lumis.portal.servlet.IUniqueWriterController
IUniqueWriterController.UniqueWriterControllerListener
-
-
Constructor Summary
Constructors Constructor Description UniqueWriterControllerTestWrapper(IUniqueWriterController delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTracedKey(java.lang.String key)
Add a key to#tracedItems
.boolean
equals(java.lang.Object obj)
java.lang.String
getHeadEndMarkers()
Returns the head end markers (ornull
if there's no marker to be inserted).java.lang.String
getHeadStartMarkers()
Returns the head start markers (ornull
if there's no marker to be inserted).java.util.Map<java.lang.String,java.util.Map<PortalPrintWriter.WritePosition,java.lang.String>>
getItems()
Returns the items.java.lang.String
getStringToLocallyWrite(java.lang.String key, java.lang.String text)
Returns the string to be written locally (inline).java.util.Set<java.lang.String>
getUniqueKeys()
Returns the unique keys used.java.util.List<java.lang.String>
getUntracedKeys()
A list containing all items fromIUniqueWriterController.getUniqueKeys()
without the items present in#tracedItems
.int
hashCode()
java.lang.String
processHtml(java.lang.String html, boolean isServerSide)
Process the HTML replacing the found markers for their text fragment accordingly.java.lang.String
processHtml(java.lang.String html, boolean isServerSide, IPageWebResourceRenderRequest renderRequest)
Process the HTML replacing the found markers for their text fragment accordingly.java.lang.String
processHtml(java.lang.String html, java.util.Set<java.lang.String> usedKeys, boolean isServerSide, IPageWebResourceRenderRequest renderRequest)
Process the HTML replacing the found markers for their text fragment accordingly.void
removeListener()
Removes this unique writer controller listener.void
setListener(IUniqueWriterController.UniqueWriterControllerListener listener)
Sets this unique writer controller listener.java.lang.String
toString()
void
writeHead(java.lang.String key, java.lang.String text, PortalPrintWriter.WritePosition itemPosition)
Inserts the item to be written in head.
-
-
-
Constructor Detail
-
UniqueWriterControllerTestWrapper
public UniqueWriterControllerTestWrapper(IUniqueWriterController delegate)
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getStringToLocallyWrite
public java.lang.String getStringToLocallyWrite(java.lang.String key, java.lang.String text)
Description copied from interface:IUniqueWriterController
Returns the string to be written locally (inline).- Specified by:
getStringToLocallyWrite
in interfaceIUniqueWriterController
- Parameters:
key
- the unique key.text
- the text fragment.- Returns:
- the string to be written locally (inline).
-
writeHead
public void writeHead(java.lang.String key, java.lang.String text, PortalPrintWriter.WritePosition itemPosition)
Description copied from interface:IUniqueWriterController
Inserts the item to be written in head.- Specified by:
writeHead
in interfaceIUniqueWriterController
- Parameters:
key
- the unique key.text
- the text fragment.itemPosition
- the item position.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
processHtml
public java.lang.String processHtml(java.lang.String html, boolean isServerSide) throws PortalException
Description copied from interface:IUniqueWriterController
Process the HTML replacing the found markers for their text fragment accordingly.- Specified by:
processHtml
in interfaceIUniqueWriterController
- Parameters:
html
- the HTML to be processed.- Returns:
- the processed HTML.
- Throws:
PortalException
-
processHtml
public java.lang.String processHtml(java.lang.String html, boolean isServerSide, IPageWebResourceRenderRequest renderRequest) throws PortalException
Description copied from interface:IUniqueWriterController
Process the HTML replacing the found markers for their text fragment accordingly.- Specified by:
processHtml
in interfaceIUniqueWriterController
- Parameters:
html
- the HTML to be processed.- Returns:
- the processed HTML.
- Throws:
PortalException
-
processHtml
public java.lang.String processHtml(java.lang.String html, java.util.Set<java.lang.String> usedKeys, boolean isServerSide, IPageWebResourceRenderRequest renderRequest) throws PortalException
Description copied from interface:IUniqueWriterController
Process the HTML replacing the found markers for their text fragment accordingly.- Specified by:
processHtml
in interfaceIUniqueWriterController
- Parameters:
html
- the HTML to be processed.usedKeys
- the used keys that will not be processed.- Returns:
- the processed HTML.
- Throws:
PortalException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getHeadStartMarkers
public java.lang.String getHeadStartMarkers()
Description copied from interface:IUniqueWriterController
Returns the head start markers (ornull
if there's no marker to be inserted).- Specified by:
getHeadStartMarkers
in interfaceIUniqueWriterController
- Returns:
- the head start markers (or
null
if there's no marker to be inserted).
-
getHeadEndMarkers
public java.lang.String getHeadEndMarkers()
Description copied from interface:IUniqueWriterController
Returns the head end markers (ornull
if there's no marker to be inserted).- Specified by:
getHeadEndMarkers
in interfaceIUniqueWriterController
- Returns:
- the head end markers (or
null
if there's no marker to be inserted).
-
getUniqueKeys
public java.util.Set<java.lang.String> getUniqueKeys()
Description copied from interface:IUniqueWriterController
Returns the unique keys used.- Specified by:
getUniqueKeys
in interfaceIUniqueWriterController
- Returns:
- the unique keys used.
-
setListener
public void setListener(IUniqueWriterController.UniqueWriterControllerListener listener)
Description copied from interface:IUniqueWriterController
Sets this unique writer controller listener.- Specified by:
setListener
in interfaceIUniqueWriterController
- Parameters:
listener
- the listener.
-
removeListener
public void removeListener()
Description copied from interface:IUniqueWriterController
Removes this unique writer controller listener.- Specified by:
removeListener
in interfaceIUniqueWriterController
-
getUntracedKeys
public java.util.List<java.lang.String> getUntracedKeys()
Description copied from interface:IUniqueWriterController
A list containing all items fromIUniqueWriterController.getUniqueKeys()
without the items present in#tracedItems
.- Specified by:
getUntracedKeys
in interfaceIUniqueWriterController
- Returns:
-
addTracedKey
public void addTracedKey(java.lang.String key)
Description copied from interface:IUniqueWriterController
Add a key to#tracedItems
. The list is used byIUniqueWriterController.getUntracedKeys()
to returnIUniqueWriterController.getUniqueKeys()
without the keys present in#tracedItems
.- Specified by:
addTracedKey
in interfaceIUniqueWriterController
- Parameters:
key
- The key to be added to the list.
-
getItems
public java.util.Map<java.lang.String,java.util.Map<PortalPrintWriter.WritePosition,java.lang.String>> getItems()
Returns the items.- Returns:
- the items.
- Since:
- 17.1.0
-
-