|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.svrCore.uploader.ExhibitHandlerBeanBase
public class ExhibitHandlerBeanBase
Base for a JavaBean to handle exhibit data for search or upload. Unset items are empty strings rather than null for simplest handling in JSPs.
This is thread-safe and Serializable so as to be able to be stored in a servlet session; nothing especially long-lived or sensitive.
| Field Summary | |
|---|---|
private AllExhibitProperties |
aep
The AllExhibitProperties data; never null. |
private java.util.List<java.lang.String> |
attributes
List of attribute words (String), or empty if none; immutable. |
private java.lang.String |
author
Author (initials) selected, or "" if none. |
private java.lang.String |
category
Category selected, or "" if none. |
protected boolean |
onlyAllowExtant
If true, limit selections to existing values in the database. |
private static long |
serialVersionUID
Unique Serialisation class ID generated by http://random.hd.org/. |
static java.lang.String |
SETTER_ALL
Used in a selector value or setter to mean all values or no item. |
private java.lang.String |
suffix
Suffix selected (starting with ``.''), or "" if none (ie all types OK). |
| Constructor Summary | |
|---|---|
protected |
ExhibitHandlerBeanBase()
Only allow selections from extant values. |
protected |
ExhibitHandlerBeanBase(boolean _onlyAllowExtant)
Choose whether new values of some fields are allowed. |
| Method Summary | |
|---|---|
void |
dedupAttrs()
Eliminates duplicate attribute words and sorts into lexical order. |
AllExhibitProperties |
getAep()
Get the AllExhibitProperties; never null. |
java.lang.String[] |
getAllAuthors()
Get all authors user is allowed to accept, sorted. |
java.lang.String[] |
getAllCategories()
Get all categories user is allowed to accept, sorted. |
java.lang.String[] |
getAllSuffixes()
Get all file suffixes user is allowed to select, sorted. |
java.lang.String |
getAttributeWords()
Get attribute words as a valid string of hyphen-separated words; can be "" but never null. |
java.util.List<java.lang.String> |
getAttributeWordsAsList()
Get attribute words as immutable List; can be zero-length but never null. |
java.lang.String |
getAuthor()
Returns author (initials) selected, or "" if none. |
java.lang.String |
getCategory()
Returns category selected, or "" if none. |
java.lang.String |
getInUseAttrWordListAsString(boolean inUse)
Get all acceptable attribute words that are in use as a single String for display to the user. |
java.lang.String |
getLegalAttrWordListAsString()
Get list of all acceptable attribute words as single String for display to user. |
java.lang.String |
getSuffix()
Get suffix selected (starting with ``.''), or "" if none (ie all types OK). |
java.lang.String |
makeAttributeSelectBody(boolean inUse,
java.lang.String selectedAttr)
Generates body of attribute HTML select statement (dependent on old value, if any). |
java.lang.String |
makeAttributeSelectBody(boolean inUse,
java.lang.String selectedAttr,
LocaleBeanBase localeBean)
Generates body of attribute HTML select statement (dependent on old value, if any). |
java.lang.String |
makeAuthorSelectBody()
Generates body of author HTML select statement (dependent on old value, if any). |
java.lang.String |
makeCategorySelectBody()
Generates body of category HTML select statement (dependent on old value, if any). |
java.lang.String |
makeCategorySelectBody(LocaleBeanBase localeBean)
Generates body of category HTML select statement (dependent on old value, if any). |
java.lang.String |
makeSuffixSelectBody()
Generates body of suffix HTML select statement (dependent on old value, if any). |
void |
setAep(AllExhibitProperties _aep)
Set the AllExhibitProperties; ignored if null and must happen before other properties are set. |
void |
setAttributeWords(java.util.List<java.lang.String> words)
Set attribute words; any invalid items will be silently discarded. |
void |
setAttributeWords(java.lang.String attributeWords)
Set attribute words; valid string of hyphen-separated words; can be "" or null. |
void |
setAttributeWords(java.lang.String[] words)
Set attribute words; any invalid items will be silently discarded. |
void |
setAuthor(java.lang.String auth)
Set author (initials) selected, or "" or SETTER_ALL if none (ie all types OK). |
void |
setCategory(java.lang.String cat)
Set category selected, or "" or SETTER_ALL if none (ie all types OK). |
void |
setCommonValuesForUnsetFields()
For some unset values, set the most common value. |
void |
setSuffix(java.lang.String suf)
Set suffix selected (starting with ``.''), or "" or SETTER_ALL if none (ie all types OK). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final boolean onlyAllowExtant
If true, file types and authors can only be selected from ones already represented in the production database.
public static final java.lang.String SETTER_ALL
private AllExhibitProperties aep
private java.lang.String suffix
private java.lang.String author
private java.lang.String category
private java.util.List<java.lang.String> attributes
This item may be replaced but is not mutated in situ and is immutable and so can be safely handed out to callers.
private static final long serialVersionUID
| Constructor Detail |
|---|
protected ExhibitHandlerBeanBase(boolean _onlyAllowExtant)
protected ExhibitHandlerBeanBase()
| Method Detail |
|---|
public void setCommonValuesForUnsetFields()
Should only be called in selected environments where an empty value is not useful anyway (eg not valid as a wildcard).
public void setAep(AllExhibitProperties _aep)
public AllExhibitProperties getAep()
public java.lang.String[] getAllSuffixes()
public java.lang.String getSuffix()
public void setSuffix(java.lang.String suf)
public java.lang.String makeSuffixSelectBody()
public java.lang.String[] getAllAuthors()
public java.lang.String getAuthor()
public void setAuthor(java.lang.String auth)
public java.lang.String makeAuthorSelectBody()
public java.lang.String[] getAllCategories()
public java.lang.String getCategory()
public void setCategory(java.lang.String cat)
public java.lang.String makeCategorySelectBody()
Assumed not to require localisation or internationalisation.
We munge the categories for display by stripping any non-alphanumerics (actually just ``-'' and ``_'') and converting everything to lower-case.
public java.lang.String makeCategorySelectBody(LocaleBeanBase localeBean)
We munge the categories for display by stripping any non-alphanumerics (actually just ``-'' and ``_'') and converting everything to lower-case.
localeBean - if non-null, used to lookup and localise
attribute descriptions
public java.lang.String makeAttributeSelectBody(boolean inUse,
java.lang.String selectedAttr)
Assumed not to require localisation or internationalisation.
We assume that all attribute words are safe for use as values.
We explicitly pass in the attribute word we want selected, or SETTER_ALL (or null) to select the default.
inUse - if true, only attributes currently in use in the Gallery
will be includes, else all legal attributes will be includedselectedAttr - if non-null and not SETTER_ALL and
and attribute in the final select list,
causes that item to be selected by default
public java.lang.String makeAttributeSelectBody(boolean inUse,
java.lang.String selectedAttr,
LocaleBeanBase localeBean)
We assume that all attribute words are safe for use as values.
We explicitly pass in the attribute word we want selected, or SETTER_ALL (or null) to select the default.
inUse - if true, only attributes currently in use in the Gallery
will be includes, else all legal attributes will be includedselectedAttr - if non-null and not SETTER_ALL and
and attribute in the final select list,
causes that item to be selected by defaultlocaleBean - if non-null, used to lookup and localise
attribute descriptionspublic java.lang.String getInUseAttrWordListAsString(boolean inUse)
The result is a space-separated sorted list.
This returns the empty string if no list is available.
public java.lang.String getLegalAttrWordListAsString()
This returns the empty string if no list is available.
public void dedupAttrs()
Assumes all entries are valid ie are non-null, legal attribute words.
Idempotent.
public java.util.List<java.lang.String> getAttributeWordsAsList()
public java.lang.String getAttributeWords()
public void setAttributeWords(java.lang.String[] words)
The argument may not be null nor contain nulls.
public void setAttributeWords(java.util.List<java.lang.String> words)
The argument may not be null nor contain nulls.
public void setAttributeWords(java.lang.String attributeWords)
All words must be attribute words and the trailing one may not be a number.
Any items that are not valid attribute words will just be silently deleted.
Any non-valid word characters (eg including spaces) will be converted to hyphens.
This tries very hard to keep as much of its input as possible.
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||