|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kom.gateway.DBLow | +--kom.gateway.DBHigh | +--kom.gateway.KOMutil | +--kom.gateway.Form
HTML forms (templates) handling for the KOM 2000 system
Inner classes inherited from class kom.gateway.KOMutil |
KOMutil.LookupTables,
KOMutil.UFtable |
Field Summary | |
(package private) boolean |
acceptform
True if used within an "accept" (moderator view) display |
(package private) boolean |
added
Keeps track of whether a language-dependent string has been handled |
(package private) java.lang.String |
bodytext
|
(package private) java.lang.String |
curform
|
(package private) java.lang.String |
formcodes
Special variable, may contain codes used in interpreting a template |
(package private) boolean |
isHTML
Set true if current text is determined to be HTML-formatted |
(package private) boolean |
isVote
Set true if current text is determined to contain a voting form |
(package private) static int |
kBase
|
(package private) static int |
kBbody
|
(package private) static int |
kCname
|
(package private) static int |
kCuser
|
(package private) static int |
kDColor
|
(package private) static int |
kFBase
|
(package private) static java.lang.String |
KFC
Special key, used in templates to refer to formcodes |
(package private) static int |
kHColor
|
(package private) static int |
kIcons
|
(package private) static int |
kKFC
|
(package private) static int |
kLColor
|
(package private) static int |
kPboard
|
(package private) static int |
kPcomm
|
(package private) static int |
kPdate
|
(package private) static int |
kPhtml
|
(package private) static int |
kPhtmldef
|
(package private) static int |
kPinterval
|
(package private) static int |
kPnotif
|
(package private) static int |
kPshort
|
(package private) static int |
kPtype
|
(package private) static int |
kServer
|
(package private) static int |
kTarea
|
private java.lang.StringBuffer |
oldOutput
|
protected java.lang.StringBuffer |
outputText
Buffer for constructing the current HTML page |
(package private) boolean |
submitted
Set true if current text is determined to contain a vote |
(package private) static java.util.Hashtable |
substkey
Special key table |
Fields inherited from class kom.gateway.KOMutil |
ACT,
anyAccess,
arglist,
argsep,
argtab,
attachments,
BOK,
BOUNDARYSTART,
CAT,
CHA,
cidTable,
CLO,
config,
curNgd,
DIC,
environment,
gateway,
gavePassword,
GEN,
GRA,
GRP,
inlineCurr,
inlines,
INT,
LINE_CUTOFF,
LINE_FUDGE,
LIS,
lt,
MAILIT,
messageRecipientTypeCode,
MIM,
MOD,
N_RECTY,
N_RECTYPECODE,
newsclient,
newsClients,
newsData,
nntpAuth,
NWS,
NWSART,
objCache,
oCurr,
oldnews,
POSTIT,
RAT,
REC_BCC,
REC_CC,
REC_TO,
recTypeCode,
REP,
response,
rLoc,
savednews,
sCursor,
servletBase,
session,
THR,
userData,
USR,
VOT |
Fields inherited from class kom.gateway.DBHigh |
AdminURL,
cache,
HomeURL,
UsersURL |
Fields inherited from class kom.gateway.DBLow |
absCDBpath,
config,
fSep,
fSeparator,
msgAuth,
msgParts |
Constructor Summary | |
Form(ServerConfig config,
HTTPResponse response,
Gateway gateway)
Class constructor |
Method Summary | |
(package private) static void |
|
void |
add(java.lang.String str)
Adds a string to the page buffer |
(package private) void |
addBody(java.lang.String body)
Adds body text to page buffer. |
private void |
addv(java.lang.String value)
|
(package private) java.lang.String |
checkHTML(java.lang.String body,
KomData ht)
|
private void |
checkHTTP(java.lang.String line)
|
private void |
checkTag(java.lang.String tag,
java.util.Hashtable lev)
|
private java.lang.String |
checkVote(java.lang.String text,
java.util.Hashtable lev)
|
private java.lang.String |
complete(java.lang.String tag,
java.lang.String text,
java.util.Hashtable lev)
|
private boolean |
contains(java.lang.String result,
java.lang.String value)
Checks if a string contains another string (delimited by ,-s) |
(package private) void |
dispauth(KomData ht)
|
private void |
dispbody(java.lang.String body,
KomData ht)
Adds body text to page buffer. |
private void |
dispcheck(java.lang.String property,
java.lang.String wanted)
Adds " checked" to the desired choice. |
(package private) void |
dispname(java.lang.String name,
KomData ht,
java.lang.String limit)
Displays a name in the current HTML page buffer. |
private void |
dispselect(java.lang.String sel,
java.lang.String wanted)
Adds " selected" to the desired selection item. |
private void |
disptype(java.lang.String type,
java.lang.String arg)
Shows object type in HTML form or adds a check mark to a choice. |
void |
form(java.lang.String tmplid)
Finds a template text and adds it to the current HTML buffer after performing any transformations indicated by special markup strings. |
void |
form(java.lang.String tmplid,
KomData ht)
Finds a template text and adds it to the current HTML buffer after performing any transformations indicated by special markup strings. |
void |
form(java.lang.String tmplid,
KomData ht,
java.lang.String codes)
Finds a template text and adds it to the current HTML buffer after performing any transformations indicated by special markup strings. |
void |
form(java.lang.String tmplid,
java.lang.String codes)
Finds a template text and adds it to the current HTML buffer after performing any transformations indicated by special markup strings. |
int |
formsegment(java.lang.String tmpl,
int pos,
int last,
KomData ht)
Handles a segment of a form (template). |
private void |
getAreaResult(KomData ht,
java.lang.String name,
boolean pub)
|
java.lang.String |
getForm(java.lang.String tmplid,
java.lang.String codes)
Creates an HTML-formatted String from a template. |
private java.lang.String |
getHTML(java.lang.String body,
java.util.Hashtable lev)
|
protected java.lang.StringBuffer |
getOutputText()
Gets a reference to the current html output page buffer |
(package private) java.util.Vector |
getQryValues()
Returns a Vector of KomData.toString() values, containing one value each, with key = "Bscaletext". |
private void |
getResultBox(KomData ht,
java.lang.String name,
java.lang.String value,
boolean pub)
|
private void |
getResultText(KomData ht,
java.lang.String name,
boolean pub)
|
private java.util.Vector |
getSelect1(java.lang.String old,
java.lang.String text,
java.lang.String norm)
|
private java.lang.String |
getSelect2(java.lang.String old,
java.lang.String inside,
java.lang.String outside)
|
private void |
getSelectResult(KomData ht,
java.lang.String name,
java.util.Vector vals,
boolean pub)
|
private void |
getTag(java.lang.String tag,
int inc,
java.util.Hashtable lev)
|
private void |
getVote(java.lang.String text,
KomData ht)
|
private int |
getVoteArea(java.lang.String tag,
java.lang.String norm,
int end,
KomData vote,
java.lang.String text,
KomData ht,
boolean pub)
|
private void |
getVoteCheck(java.lang.String text,
java.lang.String norm,
java.lang.String old)
|
private int |
getVoteSelect(java.lang.String tag,
java.lang.String norm,
int end,
KomData vote,
java.lang.String text,
KomData ht,
boolean pub)
|
private void |
getVoteSubmit(KomData ht,
java.lang.String text,
boolean pub)
|
private java.lang.String |
getVoteTag(KomData ht,
java.lang.String text,
KomData vote,
boolean pub)
|
private void |
getVoteText(java.lang.String text,
java.lang.String norm,
java.lang.String old)
|
private void |
insertSelect(KomData ht,
java.lang.String name,
java.lang.String value,
boolean pub)
|
java.lang.String |
makeHTML()
Creates the HTML page |
(package private) int |
nextmatching(java.lang.String tmpl,
java.lang.String key,
int pos,
int end)
|
private java.lang.String |
normalize(java.lang.String text)
|
(package private) java.lang.String |
restoreOutput()
Restores the old HTML output buffer |
(package private) void |
saveOutput()
Saves the HTML output buffer as oldOutput and starts another output buffer. |
(package private) java.lang.String |
textareaSubst(java.lang.String t,
boolean back)
Replaces "textarea" with $Tarea() to avoid confusion with actual textarea tag, or reverses the substitution. |
void |
transform(int keyindex,
java.lang.String arg,
java.lang.String value,
KomData ht)
|
void |
translate(java.lang.String lang,
java.lang.String text)
Adds a text string to the output HTML buffer if the language matches. |
private KomData |
trbody(java.lang.String place,
KomData ht,
java.lang.String key,
java.lang.String name)
|
Methods inherited from class kom.gateway.KOMutil |
a,
accessCont,
accessCont,
accessObj,
addInfoData,
addrToLocal,
changeEnvironment,
cidReplace,
contType,
decodeText,
deleted,
dispMailMessage,
doAction,
equal,
excluded,
fetchNews,
findId,
findId,
findlocal,
findLogin,
findOwner,
findUser,
getActId,
getcont,
getcont,
getcontV,
getcontV,
getCurNgd,
getmemb,
getMsgParts,
getMsgText,
getNews,
getNewsAuth,
getobj,
getobject,
getold,
getParent,
getPart,
getSimpleFileName,
getSimpleFileName,
getStream,
getTail,
getTextPart,
getVal,
getVal,
isAllowed,
isarg,
isMember,
isOrganizer,
isOrganizer,
ispunct,
isType,
isValidEmailAddress,
loggedIn,
mailDate,
mailDate,
mimeMessage,
mimeMessageStream,
mkdate,
mkdate,
noQuote,
parseArglist,
parseArgs,
setCids,
setNewsAuth,
setValidMsgPwd,
showBody,
showHeader,
showHeader,
showHeaders,
showInputStream,
showMailMessage,
showMessage,
showMultipart,
toString,
transbody,
urlexpand,
userGavePassword,
userGavePassword,
wrap |
Methods inherited from class kom.gateway.DBHigh |
addContent,
addContent,
addDraft,
addInfo,
addLast,
addMember,
addNews,
addObj,
addObj,
addObject,
addObject,
addQuery,
cleanDrafts,
contentCount,
createNews,
depth,
expungeRef,
findContent,
findDraft,
findDraftData,
findInfo,
findMemb,
findNews,
findObject,
findObject,
findQuery,
getFormContents,
getQryDefault,
getQueries,
getseq,
getStringValues,
getValues,
invalidateCount,
isEmpty,
isStandard,
listDraft,
makeArea,
modObject,
msgExists,
nextDraft,
queryExists,
ref2path,
refExists,
removeDraft,
removeQuery,
replaceObject,
Stream2String,
String2Stream,
StringBuffer2Stream,
updateCount,
updCount,
updref,
updseq |
Methods inherited from class kom.gateway.DBLow |
accessPart,
addFile,
areaExists,
basedRef,
createArea,
debugLog,
errorLog,
expungeFile,
File2Stream,
File2String,
findPart,
getFile,
getFileContents,
getFileStream,
getPath,
getStandard,
isMailSpool,
lastModified,
length,
listFiles,
makePart,
msgPartStream,
partfile,
partpath,
printStackTrace,
readObject,
removeFile,
replaceMime,
updseq1,
validate,
validate,
writeObject |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
Field Detail |
boolean added
boolean isHTML
boolean isVote
boolean submitted
boolean acceptform
java.lang.String curform
java.lang.String formcodes
static final java.lang.String KFC
protected java.lang.StringBuffer outputText
private java.lang.StringBuffer oldOutput
java.lang.String bodytext
static java.util.Hashtable substkey
static final int kBase
static final int kIcons
static final int kFBase
static final int kLColor
static final int kHColor
static final int kDColor
static final int kBbody
static final int kPtype
static final int kPboard
static final int kPhtml
static final int kPhtmldef
static final int kPinterval
static final int kPcomm
static final int kCuser
static final int kCname
static final int kPshort
static final int kPdate
static final int kServer
static final int kPnotif
static final int kTarea
static final int kKFC
Constructor Detail |
public Form(ServerConfig config, HTTPResponse response, Gateway gateway)
config
- Server configuration dataresponse
- HTTP response objectgateway
- Reference to client supervisorMethod Detail |
static void()
protected java.lang.StringBuffer getOutputText()
public java.lang.String getForm(java.lang.String tmplid, java.lang.String codes)
tmplid
- Template idcodes
- Special code string to control substitutionspublic void form(java.lang.String tmplid)
userData
object.tmplid
- Id of templatepublic void form(java.lang.String tmplid, java.lang.String codes)
userData
object.tmplid
- Id of templatecodes
- Special codes to be checked in the templatepublic void form(java.lang.String tmplid, KomData ht)
tmplid
- Id of templateht
- KomData instancepublic void form(java.lang.String tmplid, KomData ht, java.lang.String codes)
tmplid
- Id of templatecodes
- Special codes to be checked in the templateht
- KomData instancepublic int formsegment(java.lang.String tmpl, int pos, int last, KomData ht)
ht
structure). Any unrecognized $xx string is assumed to be a
language markup, such as $sv(svensk text)$en(English text), which
shows two versions of a text fragment, the first one containing
the Swedish version, the second containing the English
version. If the current language matches one of these markers,
the corresponding text (inside the parentheses) is copied to the
current HTML page, otherwise the English version is chosen.tmpl
- Template namepos
- First position in template textlast
- Last position in template text + 1ht
- Data structure containing values which may be substituted
into the final formint nextmatching(java.lang.String tmpl, java.lang.String key, int pos, int end)
public void transform(int keyindex, java.lang.String arg, java.lang.String value, KomData ht)
private void addv(java.lang.String value)
private void disptype(java.lang.String type, java.lang.String arg)
type
- Object type codearg
- = "1": Show attributes of the current object.
other: If part of type, add check mark.private final void dispcheck(java.lang.String property, java.lang.String wanted)
property
- Identifier of some propertywanted
- Desired propertyprivate final void dispselect(java.lang.String sel, java.lang.String wanted)
sel
- Selection keywanted
- Desired selection keyprivate final void dispbody(java.lang.String body, KomData ht)
body
- Raw textht
- Current internal message representationfinal void addBody(java.lang.String body)
body
- Raw textprivate void checkHTTP(java.lang.String line)
void dispauth(KomData ht)
void dispname(java.lang.String name, KomData ht, java.lang.String limit)
name
- Name stringht
- Data determining HTML text statuslimit
- Truncate if name is longer than limit+3java.lang.String checkHTML(java.lang.String body, KomData ht)
private java.lang.String getHTML(java.lang.String body, java.util.Hashtable lev)
private void checkTag(java.lang.String tag, java.util.Hashtable lev)
private void getTag(java.lang.String tag, int inc, java.util.Hashtable lev)
private java.lang.String complete(java.lang.String tag, java.lang.String text, java.util.Hashtable lev)
private java.lang.String checkVote(java.lang.String text, java.util.Hashtable lev)
private void getVote(java.lang.String text, KomData ht)
private int getVoteArea(java.lang.String tag, java.lang.String norm, int end, KomData vote, java.lang.String text, KomData ht, boolean pub)
private int getVoteSelect(java.lang.String tag, java.lang.String norm, int end, KomData vote, java.lang.String text, KomData ht, boolean pub)
private java.util.Vector getSelect1(java.lang.String old, java.lang.String text, java.lang.String norm)
private java.lang.String getSelect2(java.lang.String old, java.lang.String inside, java.lang.String outside)
private java.lang.String normalize(java.lang.String text)
private java.lang.String getVoteTag(KomData ht, java.lang.String text, KomData vote, boolean pub)
private void getResultBox(KomData ht, java.lang.String name, java.lang.String value, boolean pub)
private void getResultText(KomData ht, java.lang.String name, boolean pub)
private void getVoteCheck(java.lang.String text, java.lang.String norm, java.lang.String old)
private void getVoteText(java.lang.String text, java.lang.String norm, java.lang.String old)
private void getVoteSubmit(KomData ht, java.lang.String text, boolean pub)
private void getAreaResult(KomData ht, java.lang.String name, boolean pub)
private KomData trbody(java.lang.String place, KomData ht, java.lang.String key, java.lang.String name)
private void getSelectResult(KomData ht, java.lang.String name, java.util.Vector vals, boolean pub)
private void insertSelect(KomData ht, java.lang.String name, java.lang.String value, boolean pub)
private boolean contains(java.lang.String result, java.lang.String value)
result
- String containing some values delimited by commasvalue
- Value to be checked forpublic void translate(java.lang.String lang, java.lang.String text)
lang
- Language code for the text string. Checked against
command languagetext
- Text string in that language, or in English (default)
The variable added is set to true if a match is
found. The English text is assumed to be the last alternative, as
in $sv(svensk text)$en(English text).void saveOutput()
java.lang.String restoreOutput()
public void add(java.lang.String str)
str
- String to be addedpublic java.lang.String makeHTML()
java.lang.String textareaSubst(java.lang.String t, boolean back)
t
- (HTML) textback
- Reverse replacement<$Tarea() ...>$Tarea()>, or vice versa.
java.util.Vector getQryValues()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |