Class LDN

java.lang.Object
org.dspace.core.LDN

public class LDN extends Object
Class representing an LDN message json
Author:
Mohamed Eskander (mohamed.eskander at 4science.com)
  • Constructor Details

    • LDN

      public LDN()
      Create a new ldn message.
  • Method Details

    • setContent

      public void setContent(String name, String cnt)
      Set the content of the message. Setting this also "resets" the message formatting - addArgument will start over. Comments and any "Subject:" line must be stripped.
      Parameters:
      name - a name for this message
      cnt - the content of the message
    • addArgument

      public void addArgument(Object arg)
      Fill out the next argument in the template
      Parameters:
      arg - the value for the next argument
    • generateLDNMessage

      public String generateLDNMessage()
      Generates the ldn message.
      Throws:
      jakarta.mail.MessagingException - if there was a problem sending the mail.
      IOException - if IO error
    • getLDNMessage

      public static LDN getLDNMessage(String ldnMessageFile) throws IOException
      Get the VTL template for a ldn message. The message is suitable for inserting values using Apache Velocity.
      Parameters:
      ldnMessageFile - full name for the ldn template, for example "/dspace/config/ldn/request-review".
      Returns:
      the ldn object, configured with body.
      Throws:
      IOException - if IO error, if the template couldn't be found, or there was some other error reading the template