|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.terms.TermsAndConditions
public class TermsAndConditions
This is the container for the operator specific sections of Terms and Conditions with all its translations. Any translation refers to a Terms and Conditions template which serves as a 'frame' in which the operator specific sections are displayed. This enables reusability of very common terms which are needed by all operators. operator. A terms and conditions container is referenced by the subject key identifier of its operator. The translations are stored in the context of this object and are referenced by the two letter country code. A Terms and conditions container is either empty or must at least provide the default translation. An empty container cannot be transferred into an XML-DOM-structure.
Nested Class Summary | |
---|---|
private class |
TermsAndConditions.Translation
Class that represents a translation of the enclosing terms and conditions. |
Field Summary | |
---|---|
private boolean |
accepted
|
static java.lang.String |
DATE_FORMAT
|
private TermsAndConditions.Translation |
defaultTl
|
private java.util.Date |
m_date
|
private static java.lang.String |
MSG_DISPLAY_ERROR
|
private ServiceOperator |
operator
|
private static java.util.Hashtable |
tcHashtable
|
private java.util.Hashtable |
translations
|
static java.lang.String |
XML_ATTR_ACCEPTED
|
static java.lang.String |
XML_ATTR_DATE
|
static java.lang.String |
XML_ELEMENT_CONTAINER_NAME
|
static java.lang.String |
XML_ELEMENT_NAME
|
static java.lang.String |
XML_ELEMENT_TRANSLATION_NAME
|
Fields inherited from interface anon.util.IXMLEncodable |
---|
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION |
Constructor Summary | |
---|---|
TermsAndConditions(org.w3c.dom.Element termsAndConditionRoot)
Creates a TermsAndConditions container from the given XML DOM element with all translation that are stored within this element. |
|
TermsAndConditions(org.w3c.dom.Element termsAndConditionRoot,
ServiceOperator operator,
boolean withSignatureCheck)
Creates a TermsAndConditions container from the given XML DOM element with all translation that are stored within this element. |
|
TermsAndConditions(ServiceOperator operator,
java.util.Date date)
Creates an empty Terms And Condition object for the specified id and validation date which serves as a container for the different translations. |
|
TermsAndConditions(ServiceOperator operator,
java.lang.String date)
|
Method Summary | |
---|---|
void |
addTranslation(org.w3c.dom.Element translationRoot)
adds a T&C translation which specified by the DOMElement translationRoot |
private void |
addTranslation(TermsAndConditions.Translation t,
boolean withSignatureCheck)
|
int |
compareTo(java.lang.Object o)
|
org.w3c.dom.Element |
createTCRoot(org.w3c.dom.Document doc)
|
org.w3c.dom.Element |
createXMLOutput(org.w3c.dom.Document doc)
|
boolean |
equals(java.lang.Object anotherTC)
|
static org.w3c.dom.Element |
getAllTermsAndConditionsAsXMLElement(org.w3c.dom.Document ownerDoc)
|
java.util.Enumeration |
getAllTranslations()
returns all translations of this T&C container |
java.util.Date |
getDate()
return a date object which holds the date from when these T&Cs became valid |
java.lang.String |
getDateString()
returns the date as String in the format 'yyyyMMdd' from when these T&Cs became valid |
TermsAndConditionsTranslation |
getDefaultTranslation()
returns the default translation of the T&C which is displayed if there is no translation available for current display language |
java.lang.String |
getHTMLText(java.util.Locale locale)
|
java.lang.String |
getHTMLText(java.lang.String language)
|
static java.lang.String |
getHTMLText(TermsAndConditionsTranslation translation)
|
ServiceOperator |
getOperator()
returns the ServiceOperator-DBEntry referring to the operator to whom these T&C belong. |
java.lang.String |
getTemplateReferenceId(java.lang.String locale)
return the id of the template which is needed to render the translation specified by the two-letter language code |
static TermsAndConditions |
getTermsAndConditions(ServiceOperator operator)
|
TermsAndConditionsTranslation |
getTranslation(java.util.Locale locale)
returns the translation of the T&C specified by the corresponding locale object |
TermsAndConditionsTranslation |
getTranslation(java.lang.String locale)
returns the translation of the T&C specified by the two letter language code |
boolean |
hasDefaultTranslation()
for checking if a default translation is specified which must be true if this T&C container is not empty. |
boolean |
hasTranslation(java.util.Locale locale)
for checking if this T&C container provides a translation specified by the given locale object |
boolean |
hasTranslation(java.lang.String locale)
returns if this T&C container provides a translation specified by the two-letter language code |
boolean |
hasTranslations()
for checking whether this T&C container has stored translations at all |
TermsAndConditionsTranslation |
initializeEmptyTranslation(java.util.Locale locale)
|
TermsAndConditionsTranslation |
initializeEmptyTranslation(java.lang.String locale)
|
boolean |
isAccepted()
returns whether these T&C are accepted by the user this is true if and only if they were read and accepted. |
boolean |
isMostRecent(java.util.Date toWhichDate)
true if the date of the T&Cs are equal or more recent than 'toWhichDate' |
boolean |
isMostRecent(java.lang.String toWhichDate)
|
boolean |
isSignatureObsolete()
|
static void |
loadTermsAndConditionsFromXMLElement(org.w3c.dom.Element listRoot)
|
static void |
removeTermsAndConditions(ServiceOperator operator)
|
static void |
removeTermsAndConditions(TermsAndConditions tc)
|
TermsAndConditionsTranslation |
removeTranslation(java.util.Locale locale)
|
TermsAndConditionsTranslation |
removeTranslation(java.lang.String locale)
|
void |
setAccepted(boolean accepted)
marks the T&Cs as accepted if 'accepted' is true or rejected otherwise |
void |
setDate(java.util.Date date)
|
static void |
storeTermsAndConditions(TermsAndConditions tc)
|
org.w3c.dom.Element |
toXmlElement(org.w3c.dom.Document doc)
Return an element that can be appended to the document. |
private org.w3c.dom.Element |
xmlOut(org.w3c.dom.Document doc,
boolean signedTranslations)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String XML_ATTR_ACCEPTED
public static final java.lang.String XML_ATTR_DATE
private static final java.lang.String MSG_DISPLAY_ERROR
public static final java.lang.String XML_ELEMENT_CONTAINER_NAME
public static final java.lang.String XML_ELEMENT_NAME
public static final java.lang.String XML_ELEMENT_TRANSLATION_NAME
public static final java.lang.String DATE_FORMAT
private ServiceOperator operator
private java.util.Date m_date
private java.util.Hashtable translations
private TermsAndConditions.Translation defaultTl
private boolean accepted
private static final java.util.Hashtable tcHashtable
Constructor Detail |
---|
public TermsAndConditions(ServiceOperator operator, java.lang.String date) throws java.text.ParseException
java.text.ParseException
public TermsAndConditions(ServiceOperator operator, java.util.Date date) throws java.text.ParseException
java.text.ParseException
public TermsAndConditions(org.w3c.dom.Element termsAndConditionRoot) throws XMLParseException, java.text.ParseException, java.security.SignatureException
termsAndConditionRoot
- the DOM Element from which the Container will be created
XMLParseException
- if termsAndConditionsRoot does not provide a valid operator SKI
or the date attribute is missing
java.text.ParseException
- if the date is in a wrong format (must be .
java.security.SignatureException
- if the signature of a Terms and Conditions translation
has no valid signature.public TermsAndConditions(org.w3c.dom.Element termsAndConditionRoot, ServiceOperator operator, boolean withSignatureCheck) throws XMLParseException, java.text.ParseException, java.security.SignatureException
termsAndConditionRoot
- the DOM Element from which the Container will be createdop
- the Operator to whom these Terms And Conditions belong
XMLParseException
- if op is null and termsAndConditionsRoot does not provide a valid operator SKI
or the date attribute is missing
java.text.ParseException
- if the date is in a wrong format.
java.security.SignatureException
- if the signature of a Terms and Conditions translation
has no valid signature.Method Detail |
---|
public java.lang.String getDateString()
public void addTranslation(org.w3c.dom.Element translationRoot) throws XMLParseException, java.security.SignatureException
translationRoot
- the DOMELement form which the translation should be appended to the
T&Cs container
XMLParseException
- if the translation does not refer to a valid T&C template or the
'locale' attribute which specifies the language is not set.
java.security.SignatureException
- if translationRoot does not contain a valid signaturepublic TermsAndConditionsTranslation removeTranslation(java.lang.String locale)
public TermsAndConditionsTranslation removeTranslation(java.util.Locale locale)
public TermsAndConditionsTranslation initializeEmptyTranslation(java.lang.String locale)
public TermsAndConditionsTranslation initializeEmptyTranslation(java.util.Locale locale)
private void addTranslation(TermsAndConditions.Translation t, boolean withSignatureCheck) throws java.security.SignatureException
java.security.SignatureException
public TermsAndConditionsTranslation getDefaultTranslation()
public TermsAndConditionsTranslation getTranslation(java.util.Locale locale)
locale
- the locale refering to the desired translation language
public TermsAndConditionsTranslation getTranslation(java.lang.String locale)
the
- two letter code specifying the desired translation langugae
public java.util.Enumeration getAllTranslations()
public java.lang.String getTemplateReferenceId(java.lang.String locale)
locale
-
public boolean hasTranslation(java.lang.String locale)
locale
- the two letter-code of the language
public boolean hasTranslation(java.util.Locale locale)
locale
- locale object referring to the corresponding language
public boolean hasTranslations()
public boolean hasDefaultTranslation()
public ServiceOperator getOperator()
public void setDate(java.util.Date date)
public java.util.Date getDate()
public void setAccepted(boolean accepted)
accepted
- true stands for accept, false for rejectpublic boolean isAccepted()
public static void storeTermsAndConditions(TermsAndConditions tc)
public static TermsAndConditions getTermsAndConditions(ServiceOperator operator)
public static void removeTermsAndConditions(TermsAndConditions tc)
public static void removeTermsAndConditions(ServiceOperator operator)
public static org.w3c.dom.Element getAllTermsAndConditionsAsXMLElement(org.w3c.dom.Document ownerDoc)
public static void loadTermsAndConditionsFromXMLElement(org.w3c.dom.Element listRoot)
public java.lang.String getHTMLText(java.util.Locale locale)
public java.lang.String getHTMLText(java.lang.String language)
public static java.lang.String getHTMLText(TermsAndConditionsTranslation translation)
public boolean isSignatureObsolete()
public boolean equals(java.lang.Object anotherTC)
equals
in class java.lang.Object
public int compareTo(java.lang.Object o)
public boolean isMostRecent(java.lang.String toWhichDate) throws java.text.ParseException
java.text.ParseException
public boolean isMostRecent(java.util.Date toWhichDate)
private org.w3c.dom.Element xmlOut(org.w3c.dom.Document doc, boolean signedTranslations)
public org.w3c.dom.Element createTCRoot(org.w3c.dom.Document doc)
public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document doc)
IXMLEncodable
toXmlElement
in interface IXMLEncodable
doc
- a document
public org.w3c.dom.Element createXMLOutput(org.w3c.dom.Document doc)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |