|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.layout.dlm.processing.ProcessingPipe
public class ProcessingPipe
Handles chaining of layout parameter request processing for the DistributedLayoutManager object and provides assistance during generation of the SAX event stream during rendering by wrapping the ultimate ContentHandler to which all events will be pushed. Conceptually, the pipe performs as if sitting between UserInstance and the DistributedLayoutManager instance as shown below. The call to processLayoutParameters and the call to render the layout via the getUserLayout call pass through the pipe along with the resulting SAX event stream. This is conceptual only. The pipe is actually embedded within the DistributedLayoutManager.
time proceeds forward moving downward
|
|
V
process optionally +-------------+
+----------+ Layout +-----------+ specific layout | Distributed |
| User | Parameters | Processor | action calls to | Layout |
| Instance | (...) | Pipe | the manager | Manager |
| |----------------->| |---------------->| |
| | | | | |
| | getUserLayout() | | getUserLayout() | |
| |----------------->| |---------------->| |
| | | | | |
| | SAX Events flow | | SAX Events flow | |
| | back to User | | back to Pipe's | |
| | Instance's | | ContentHandler | |
| | ContentHandler | | | |
| |<-----------------| |<----------------| |
| | | | | |
+----------+ +-----------+ +-------------+
This pipe allows us to do specific URL parameter handling that may be unique
to a structure and theme stylesheet set. A special parameter uP_dlmPrc is
also looked for which causes an optional processor to be embedded within the
pipe until a further occurrance of this parameter either replaces that
processor with a new processor or removes it by specifying an empty value.
This allows a specific dlm stylesheet set to use custom processing for things
like adding channel targets, adding column or tab targets, adding targets for
moving channels and a different policy for adding targets for moving columns
or tabs, etc.
There are two types of processors supported, a fixed set which does not
change and an optional set from which a single processor can be added to the
pipe via the uP_dlmPrc parameter. All are configured via the
"properties/context/layoutContext.xml" file.
The pipe provides a "front" ContentHandler to the DistributedLayoutManager
representing the front of the pipe for SAX events generated in the
getUserLayout() method. The ContentHandler passed in from UserInstance via
the getUserLayout() method is set as the "back" ContentHandler to which all
events exiting the pipe are pushed.
As such this pipe can act on incoming layout parameters and then influence
the perceived layout seen by UserInstance by altering the SAX stream
accordingly as it flows back toward UserInstance's ContentHandler.
| Field Summary | |
|---|---|
static String |
CHANGE_PROCESSOR_PARAM
The parameter watched for by this pipe in the request whose value if included should be an empty String or a value that matches one of the keys in the optionalProcessors Map. |
static String |
PROCESSING_PIPE_BEAN_ID
Holds the name of the bean configured in the context file that is a factory for instances of this class. |
| Constructor Summary | |
|---|---|
ProcessingPipe()
Construct a pipe. |
|
| Method Summary | |
|---|---|
String |
getCacheKey()
Returns a cache key indicative of the affect that the pipe has on the SAX event stream. |
ContentHandler |
getContentHandler(ContentHandler handler)
Sets the ContentHandler to which all SAX events passing through the pipe will be passed including any modifications made to that stream by any of the fixed processors if any or the currently selected optional processor if any. |
void |
processParameters(UserPreferences prefs,
HttpServletRequest request)
Passes a request to the set of processors that are currently part of the pipe allowing them to act on query or post parameters embedded in the request. |
void |
setFixedProcessors(List fixedProcessors)
Sets the configured set of fixed processors in the order that they are allowed to process layout parameters and filter the SAX event stream. |
void |
setOptionalProcessors(Map optionalProcessors)
Sets the map of optional processors that can be included in the processing and SAX event pipe by inclusion of the uP_dlmPrc parameter being included with a value corresponding to a key in this map. |
void |
setResources(IPerson person,
DistributedLayoutManager dlm)
Hands the passed-in instances or IPerson and DistributedLayoutManager to all configured fixed and optional processors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CHANGE_PROCESSOR_PARAM
public static final String PROCESSING_PIPE_BEAN_ID
| Constructor Detail |
|---|
public ProcessingPipe()
| Method Detail |
|---|
public void setFixedProcessors(List fixedProcessors)
fixedProcessors - public void setOptionalProcessors(Map optionalProcessors)
optionalProcessors -
public void setResources(IPerson person,
DistributedLayoutManager dlm)
setResources in interface IParameterProcessorIParameterProcessor.setResources(org.jasig.portal.security.IPerson, org.jasig.portal.layout.dlm.DistributedLayoutManager)
public void processParameters(UserPreferences prefs,
HttpServletRequest request)
processParameters in interface IParameterProcessorIParameterProcessor.processParameters(org.jasig.portal.UserPreferences,
javax.servlet.http.HttpServletRequest)public String getCacheKey()
public ContentHandler getContentHandler(ContentHandler handler)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||