|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsunlabs.brazil.template.Template
sunlabs.brazil.template.ChangedTemplate (view source)
public class ChangedTemplate
This Template
adds an icon to HREFs to indicate when the
file being referred to is new, changed, or unchanged with respect
to the user's session.
In order for the ChangedTemplate
to work, the following
must happen.
ChangedTemplate
. All HREFs seen between
<changed>
and </changed>
tags
will be rewritten so that an appropriate icon appears next to the
HREF.
ChangedTemplate
. Whenever the
ChangedTemplate
sees a file that was named in some
previously seen <changed>
section, that file's
last-accessed time will be updated. Only the files named in a
<changed>
section are tracked.
ChangedTemplate
may have to keep track of a lot of data
per session, specifically, the names of all the files being tracked and
the last time the user accessed them.
The ChangedTemplate
examines the property "fileName", set
(for example) by the FileHandler
, in order to update the
last-accessed time of a file as it passes by. If the "fileName" property
is not set, the last-accessed time will not be updated.
The ChangedTemplate
also assumes that all local HREFs it sees
can be directly translated into the corresponding file name based on the
"root" property and the URL of the current file. Getting that file name
is necessary so its last-modified time (on disk) can be compared to its
last-accessed time (per session).
The ChangedTemplate
uses the following properties:
Handler
or other code may set this
property if it wishes the file to be tracked.
ChangedTemplate
always
rewrites the HREFs, instead of just when they appear within the
<changed>
and </changed>
tags.
Field Summary |
---|
Fields inherited from class sunlabs.brazil.template.Template |
---|
debug |
Constructor Summary | |
---|---|
ChangedTemplate()
|
Method Summary | |
---|---|
boolean |
done(RewriteContext hr)
Called after all tags have been processed, one final chance. |
boolean |
init(RewriteContext hr)
Records that this file has just been accessed. |
void |
tag_a(RewriteContext hr)
|
void |
tag_changed(RewriteContext hr)
|
void |
tag_slash_changed(RewriteContext hr)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChangedTemplate()
Method Detail |
---|
public boolean init(RewriteContext hr)
init
in interface TemplateInterface
init
in class Template
public boolean done(RewriteContext hr)
Template
done
in interface TemplateInterface
done
in class Template
public void tag_changed(RewriteContext hr)
public void tag_slash_changed(RewriteContext hr)
public void tag_a(RewriteContext hr)
|
Version Kenai-svn-r24, Generated 08/18/09 Copyright (c) 2001-2009, Sun Microsystems. |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |