Package com.iizix.server.agreement
Class LicenseAgreement
- java.lang.Object
- com.iizix.server.agreement.LicenseAgreement
public class LicenseAgreement extends java.lang.Object
Class to hold a license agreement in various languages.- Author:
- Christopher Mindus
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LicenseAgreement
createLicenseAgreement(java.lang.String name, java.lang.String languageCode, java.lang.String description, java.lang.String text)
Creates a new license agreement, possibly replacing an old one with this one for the defined texts.java.lang.String
getAgreementText()
Gets the text of the agreement and loads it from the database if not yet done.boolean
isNotApplicable()
Checks if this agreement is of "not-applicable" type.static void
main(java.lang.String[] args)
Add one or several license agreements.java.lang.String
toString()
Returns the debug string.
Method Detail
isNotApplicable
public boolean isNotApplicable()
Checks if this agreement is of "not-applicable" type.- Returns:
- true if name is "n/a", false otherwise.
getAgreementText
public java.lang.String 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
public java.lang.String toString()
Returns the debug string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The debug string.
createLicenseAgreement
public static LicenseAgreement createLicenseAgreement(java.lang.String name, java.lang.String languageCode, java.lang.String description, java.lang.String text) throws java.sql.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).java.sql.SQLException
- For SQL exceptions.
main
public static void main(java.lang.String[] args)
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)).