This class provides access control for all requests in the Project
Billboard application, by looking for the authentication token in
the session and forwarding to the login page if not found.
Creates nodes for properties and attributes of the provided
component and adds them as branches under the provided node,
and then recursively calls itself for each child and facet
of the provided component.
Sets the "id" property of the provided ReportEntry and saves a
copy of the ReportEntry (so that changes to the provided instance
doesn't change the content of the report).
Add a TreeNode instance for each entry in the Map, with the
entry key (converted to a String) as the node name, the entry value
(converted to a String) as the node value, and with the "leafNode"
property set to "true".
Adds the message matching the key in the application's
resource bundle, formatted with the parameters (if any),
the the JSF message queue as a global message.
Saves the view state before the regular processing of the view
in the current phase by calling capturePhaseData(), unless
the current phase is Restore View (there's no view available
in this case).
If the event is a ChildEvent, unwraps the real event, calls
setNodeId() with the node ID in the ChildEvent and delegates
the processing to the real event source.
Returns the UIViewRoot for the specified view, by parsing
the view specification file and processing the elements in
the specification with an instance of the ViewSpecHandler
class.
Loops over all children and calls processDecodes() on the
child's "label" facet for all children with the "rendered"
property set to "false" (the one with "rendered" set to
"true" is decoded by the default processing).
If invoked without a "viewId" parameter, renders a response
with links back to itself for all views available in the
session scope variable "com.mycompany.debug".
Before delegating to the superclass, resets the saved
per-node state for facet input components unless it is
needed to rerender the current page with errors, as
determined by the keepSaved() method.
Ensures that only one child has "rendered" set to "true",
renders an HTML table with one row and one cell per child
"label" facet, with a "class" attribute for the "table"
element set to the "labelAreaClass" component attribute
value, and one of "selectedLabelClass" or "unselectedLabelClass"
as the "class" attribute value for the "td" elements.
Renders the component by letting its UIColumn children process
one row at a time, starting with the row specified by the "first"
attribute for the number of rows specified by the "rows" attribute,
or until the lasy row is reached.
Calls encodeNodes() to write the HTML elements for all nodes,
within a "span" element with an "id" attribute set to the
component's client ID if explicitly set.
Returns a client ID composed from the regular client ID
(returned by the superclass getClientId() method) and the
current node ID (if any) separated by a colon.
Returns the cached model, if any, or the components value,
as-is if it's a TreeModel or wrapped in a new TreeModel if
it's a TreeNode, saving a reference in the "model" variable.
Returns a List with SelectItem instances matching the
standard expense type choices with labels localized
for the view's locale, from a resource bundle with the
base name "entryTypes".
getId() -
Method in class com.mycompany.expense.Report
Returns a String representing the path to this node, with
the names of each parent node separated by a slash and ending
with the name of the current node.
Returns the resource matching the provided key after
replacing all spaces with underscores, or a String
containing the key embedded in question marks if no
resource matches the key.
Returns the TreeNode for the tree root, from the Map saved
as a session scope variable named "com.mycompany.debug" or
a new instance if it's not found or the found instance is
for a previous request.
Returns the status codes for displayed reports, or the
code for "Submitted" if no status code is set and the
current user is a manager, or all status codes if no
status code is set and the current user isn't a manager.
Creates a String containing the buffered characters and another
String representing the element structure the characters belong to
and lets the subclass handle it.
This class is a JSF Validator that validates that the java.util.Date
value of the component it's attached to is later than the
java.util.Date value of another component.
Locates the component's grandparent (holding all components
acting as tabs), gets all its children (the tab components),
and sets the "rendered" property to "true" for this component's
parenent and to "false" for all others.
If "rendered" is true, resets the cached model and saved
per-node state, calls processNodes() with a PhaseId for
this phase, resets the node ID, and calls the decode() method.
Recursively process all nodes at the root of the tree and
all nodes under an open node for the provided phase, i.e.,
by calling processDecodes(), processValidators() or
processUpdates() on the facet representing the node type.
If the current report isn't new (i.e., not yet stored),
refreshes the current report with a copy from the registry
to ensure the local copy is the latest version.
Removes the entry represented by the current row in the entries
DataModel from the current report, or queues an error message if
the current user isn't allowed to do that or the registry
throws an exception.
Removes the specified entry from the current report, or queues
an error message if the current user isn't allowed to do that or
the registry throws an exception.
Writes a "select" element with "option" elements based on
the List with SelectItem instances, with a "selected"
attribute for the SelectItem matching the selected value.
Recursively renders the provided component and all its children
by calling encodeBegin(), encodeChildren() (if the component
renders its children) and encodeEnd().
Renders the view represented by the provided root component by
parsing the template file for the view and processing the elements in
the template with an instance of the TemplateHandler class.
Gets the view state to save, if any, and puts a reference to
the state in a request scope variable where it can be picked
up by the writeState() method, and renders the view represented
by the provided UIViewRoot instance by calling renderResponse().
This class is a servlet that produces a response showing the
state captured by the CaptureStatePhaseListener, as a tree
with links for opening and closing nodes.
This class is an example of a pure Java view representation for
a fictitious newsletter subscription service subscription interface,
used by the example ClassViewHandler implementation.
This class is an example of the type of class that acts as an adaptor
for JSF-independent business logic classes (such as Subscriber)
to make them accessible to JSF components.
saved -
Variable in class com.mycompany.jsf.component.UITree
This map contains SavedState instances for each node in the
tree, keyed by the client identifier of the component representing
node, which contains the nodeId value for uniqueness.
Sets the index for the first row to display in the reports
table to the index of the top row for the previou page, or
to zero if there is no more page.
Makes the report at the current row in the reports DataModel the
current report, or queues an error message if the current user isn't
allowed to do that or the registry throws an exception.
Sets the node ID, saving the state of all facet components
for the previous node ID and restoring it for the new
if it was saved for the new node ID previously, and exposes the
node for the new node ID and the NodeToggler through their
request scope variables.
Sets the component's model value, which must be a JSF value
binding expression for a "javax.faces.model.DataModel" instance
or a data type for which there is a wrapper model.
Sets the component's value, which must be a JSF value binding
expression for a "com.mycompany.jsf.model.TreeModel" or a
"com.mycompany.jsf.model.TreeNode" instance.
Throws an IllegalArgumentException if the name is "var",
"varToggler" or "nodeId" (these properties must be set
to explicit values); otherwise, delegates to the superclass.
Sets the value of the "varNodeToggler" property, i.e., the name of
the request scope variable that holds an instance of a class
with a toggleExpanded() action method that toggles the value
of the "expanded" property for the node it's bound to.
Asks the current RenderKit to create a ResponseWriter around
the OutputStream for the response body and sets the
Content-Type response header to the MIME type selected by
the ResponseWriter from the alternatives listed in the
Accept request header.
Writes buffered text, if any, and tries to locate a component
with the ID defined by the "id" attribute by calling
the findComponent() method on the root component.
If the element is a "component" element, calls createComponent()
to create the corresponding component, adds it as a child of
the component at the top of the stack, and pushes the new
component onto the stack.
Creates a new NewsItemBean and sets its properties based
on the "category" and "msg" request parameters, plus
the firstName and lastName properties of the authenticated
user (an EmployeeBean accessible as the "validUser" session
attribute).
Uses the entry represented by the current row in the entries
DataModel to update the corresponding entry in the current report,
or queues an error message if the current user isn't allowed to
do that or the registry throws an exception.
Uses the provided entry to update the corresponding entry in the
current report, or queues an error message if the current user
isn't allowed to do that or the registry throws an exception.
Compares the provided value to the value of the peer component,
and throws a ValidatorException with an appropriate FacesMessage
if the provided value doesn't represent a later date or if
there are problems accessing the peer component value.