lumis.portal.servlet
Class UniqueWriterController

Package class diagram package UniqueWriterController
java.lang.Object
  extended by lumis.portal.servlet.UniqueWriterController

public class UniqueWriterController
extends Object

Class responsible for controlling unique writes based on keys.
Guarantees uniqueness during a request.

Since:
7.0.0

Method Summary
 String getHeadEndMarkers()
          Returns the head end markers (or null if there's no marker to be inserted).
 String getHeadStartMarkers()
          Returns the head start markers (or null if there's no marker to be inserted).
static UniqueWriterController getInstance(HttpServletRequest request)
          Gets the instance that is controlling the writes in the given request.
 String getStringToLocallyWrite(String key, String text)
          Returns the string to be written locally (inline).
 Set<String> getUniqueKeys()
          Returns the unique keys used.
 String processHtml(String html)
          Process the HTML replacing the found markers for their text fragment accordingly.
 String processHtml(String html, Set<String> usedKeys)
          Process the HTML replacing the found markers for their text fragment accordingly.
 void writeHead(String key, String text, PortalPrintWriter.WritePosition itemPosition)
          Inserts the item to be written in head.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static UniqueWriterController getInstance(HttpServletRequest request)
Gets the instance that is controlling the writes in the given request. If there's no controller yet, creates a new one and returns it.

Parameters:
request - the request being controlled.
Returns:
the controller for the request.
Since:
7.0.0

getStringToLocallyWrite

public String getStringToLocallyWrite(String key,
                                      String text)
Returns the string to be written locally (inline).

Parameters:
key - the unique key.
text - the text fragment.
Returns:
the string to be written locally (inline).
Since:
7.0.0

writeHead

public void writeHead(String key,
                      String text,
                      PortalPrintWriter.WritePosition itemPosition)
Inserts the item to be written in head.

Parameters:
key - the unique key.
text - the text fragment.
itemPosition - the item position.
Throws:
IllegalArgumentException - if the itemPosition parameter is null or is not any of PortalPrintWriter.WritePosition.HEAD_START or PortalPrintWriter.WritePosition.HEAD_END.
Since:
7.0.0

processHtml

public String processHtml(String html)
Process the HTML replacing the found markers for their text fragment accordingly.

Parameters:
html - the HTML to be processed.
Returns:
the processed HTML.
Since:
7.0.0

processHtml

public String processHtml(String html,
                          Set<String> usedKeys)
Process the HTML replacing the found markers for their text fragment accordingly.

Parameters:
html - the HTML to be processed.
usedKeys - the used keys that will not be processed.
Returns:
the processed HTML.
Since:
7.0.0

getHeadStartMarkers

public String getHeadStartMarkers()
Returns the head start markers (or null if there's no marker to be inserted).

Returns:
the head start markers (or null if there's no marker to be inserted).
Since:
7.0.0

getHeadEndMarkers

public String getHeadEndMarkers()
Returns the head end markers (or null if there's no marker to be inserted).

Returns:
the head end markers (or null if there's no marker to be inserted).
Since:
7.0.0

getUniqueKeys

public Set<String> getUniqueKeys()
Returns the unique keys used.

Returns:
the unique keys used.
Since:
7.0.0


Lumisportal  7.0.0.121130 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.