Package com.iizix.server.agreement
Class LicenseAgreement
java.lang.Object
com.iizix.server.agreement.LicenseAgreement
Class to hold a license agreement in various languages.
- Author:
- Christopher Mindus
- Method SummaryModifier and TypeMethodDescription- static LicenseAgreement- createLicenseAgreement- (String name, String languageCode, String description, String text) Creates a new license agreement, possibly replacing an old one with this one for the defined texts.Gets the text of the agreement and loads it from the database if not yet done.- booleanChecks if this agreement is of "not-applicable" type.- static voidAdd one or several license agreements.- toString()Returns the debug string.
- Method Details- isNotApplicablepublic boolean isNotApplicable()Checks if this agreement is of "not-applicable" type.- Returns:
- true if name is "n/a", false otherwise.
 
- getAgreementTextGets the text of the agreement and loads it from the database if not yet done.- Returns:
- The Agreement text or "Failed loading agreement" in case of error from database.
 
- toStringReturns the debug string.
- createLicenseAgreementpublic static LicenseAgreement createLicenseAgreement- (String name, String languageCode, String description, String text) throws SQLException, NotFoundException Creates a new license agreement, possibly replacing an old one with this one for the defined texts.- Parameters:
- name- The agreement short name.
- languageCode- The language code (made lower case with '_' replaced with '-'.
- description- Short description of the agreement.
- text- The license agreement text, (with LF, CR/LF is replaced with just LF's).
- Returns:
- The newly created agreement.
- Throws:
- NotFoundException- If none is found (shouldn't happen).
- SQLException- For SQL exceptions.
 
- mainAdd one or several license agreements.- Parameters:
- args- The arguments:- name
- description
- languageCode (e.g. "en", "fr" or "en-uk".
- fileName (the file name of agreement).
- languageCode (etc)
- fileName (etc)).