Class StringReplacePostLoadProcessor
- java.lang.Object
-
- lumis.service.portalmanagement.audit.StringReplacePostLoadProcessor
-
- All Implemented Interfaces:
IPostLoadProcessor
public class StringReplacePostLoadProcessor extends java.lang.Object implements IPostLoadProcessor
A post load processor that replaces strings in the fields of the source. The StringReplacePostLoadProcessor uses 3 parameters: - from the string that will be replaced - to the string that will replace - fieldId the field id where the replace will occur StringReplacePostLoadProcessor has some constants. To use them, the attribute useConstant must be used with true and the parameter's value must be the constant name.Example usage:
rigth right fieldId Example to use StringReplacePostLoadProcessor's constants:
SYSTEM_NEW_LINE HTML_BR fieldId - Since:
- 6.0.0
- Version:
- $Revision$ $Date$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StringReplacePostLoadProcessor.StringConstant
Enum containing the constants.
-
Constructor Summary
Constructors Constructor Description StringReplacePostLoadProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
processSource(SessionConfig sessionConfig, Source source, org.w3c.dom.Node parametersNode, ITransaction transaction)
protected java.lang.String
readParameterValue(java.lang.String parameterName, org.w3c.dom.Node parametersNode)
Reads the value of a given parameter using its name.protected void
replaceStrings(Source<?> source, java.lang.String fieldId, java.lang.String from, java.lang.String to)
Replace the from string by the to string in a field of a source.
-
-
-
Method Detail
-
processSource
public void processSource(SessionConfig sessionConfig, Source source, org.w3c.dom.Node parametersNode, ITransaction transaction) throws PortalException
- Specified by:
processSource
in interfaceIPostLoadProcessor
- Throws:
PortalException
-
readParameterValue
protected java.lang.String readParameterValue(java.lang.String parameterName, org.w3c.dom.Node parametersNode) throws PortalException
Reads the value of a given parameter using its name.- Parameters:
parameterName
- parameter's name.parametersNode
- parent node.- Returns:
- the string value of the parameter.
- Throws:
PortalException
- whenever an error occur.- Since:
- 6.0.0
-
replaceStrings
protected void replaceStrings(Source<?> source, java.lang.String fieldId, java.lang.String from, java.lang.String to) throws PortalException
Replace the from string by the to string in a field of a source.- Parameters:
source
- the source instance.fieldId
- the id of the desired field.from
- the string that will be replaced.to
- the string that will replace.- Throws:
PortalException
- whenever an error occur.- Since:
- 6.0.0
-
-