Package org.dspace.core
Class LDN
java.lang.Object
org.dspace.core.LDN
Class representing an LDN message json
- Author:
- Mohamed Eskander (mohamed.eskander at 4science.com)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWrap ConfigurationService to prevent templates from modifying the configuration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgument(Object arg) Fill out the next argument in the templateGenerates the ldn message.static LDNgetLDNMessage(String ldnMessageFile) Get the VTL template for a ldn message.voidsetContent(String name, String cnt) Set the content of the message.
-
Constructor Details
-
LDN
public LDN()Create a new ldn message.
-
-
Method Details
-
setContent
Set the content of the message. Setting this also "resets" the message formatting -addArgumentwill start over. Comments and any "Subject:" line must be stripped.- Parameters:
name- a name for this messagecnt- the content of the message
-
addArgument
Fill out the next argument in the template- Parameters:
arg- the value for the next argument
-
generateLDNMessage
Generates the ldn message.- Throws:
jakarta.mail.MessagingException- if there was a problem sending the mail.IOException- if IO error
-
getLDNMessage
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
-