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 Summary
Modifier and TypeMethodDescriptionstatic 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.boolean
Checks if this agreement is of "not-applicable" type.static void
Add one or several license agreements.toString()
Returns the debug string.
Method Details
isNotApplicable
public boolean isNotApplicable()Checks if this agreement is of "not-applicable" type.- Returns:
- true if name is "n/a", false otherwise.
getAgreementText
Gets 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.
toString
Returns the debug string.createLicenseAgreement
public 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.
main
Add 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)).