Class LicenseAgreement

java.lang.Object
com.iizix.server.agreement.LicenseAgreement

public class LicenseAgreement extends Object
Class to hold a license agreement in various languages.
Author:
Christopher Mindus
  • 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

      public 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 String toString()
      Returns the debug string.
      Overrides:
      toString in class Object
      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

      public static void main(String[] args)
      Add one or several license agreements.
      Parameters:
      args - The arguments:
      1. name
      2. description
      3. languageCode (e.g. "en", "fr" or "en-uk".
      4. fileName (the file name of agreement).
      5. languageCode (etc)
      6. fileName (etc)).