org.sakaiproject.mailsender.model.EmailEntry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mailsender-api Show documentation
Show all versions of mailsender-api Show documentation
Mail Sender Interfaces (API)
/**********************************************************************************
* Copyright 2008-2009 Sakai Foundation
*
* Licensed under the Educational Community License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.opensource.org/licenses/ECL-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
**********************************************************************************/
package org.sakaiproject.mailsender.model;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class EmailEntry
{
private boolean allIds = false;
private Map roleIds = new HashMap();
private Map sectionIds = new HashMap();
private Map groupIds = new HashMap();
private Map userIds = new HashMap();
private String from;
private List otherRecipients = new ArrayList();
private String subject = "";
private String content = "";
private List attachments = new ArrayList();
private ConfigEntry config;
private String csrf = null;
public EmailEntry(ConfigEntry config)
{
this.config = config;
}
public String getFrom()
{
return from;
}
public void setFrom(String from)
{
this.from = from;
}
public List getOtherRecipients()
{
return otherRecipients;
}
public void setOtherRecipients(String otherRecipients)
{
this.otherRecipients = new ArrayList();
if (otherRecipients != null && otherRecipients.trim().length() > 0)
{
String[] rcpts = otherRecipients.replace(';', ',').split(",");
for (String rcpt : rcpts)
{
this.otherRecipients.add(rcpt.trim());
}
}
}
public String getSubject()
{
return subject;
}
public void setSubject(String subject)
{
if (subject == null || subject.trim().length() == 0)
{
this.subject = "";
}
else
{
this.subject = subject;
}
}
public String getContent()
{
return content;
}
public void setContent(String content)
{
if (content == null || content.trim().length() == 0)
{
this.content = "";
}
else
{
this.content = content;
}
}
public String getCsrf() {
return this.csrf;
}
public void setCsrf (String s) {
this.csrf = s;
}
public List getAttachments()
{
return attachments;
}
public void setAttachments(List attachments)
{
this.attachments = attachments;
}
public ConfigEntry getConfig()
{
return config;
}
// RSF Has a problem with overloaded setters so we force it to use the String one.
public void setOtherRecipientsList(List otherRecipients)
{
this.otherRecipients = otherRecipients;
}
public void setConfig(ConfigEntry config)
{
this.config = config;
}
public boolean isAllIds()
{
return allIds;
}
public void setAllIds(boolean allIds)
{
this.allIds = allIds;
}
public Map getRoleIds()
{
return roleIds;
}
public void setRoleIds(Map roleIds)
{
this.roleIds = roleIds;
}
public Map getSectionIds()
{
return sectionIds;
}
public void setSectionIds(Map sectionIds)
{
this.sectionIds = sectionIds;
}
public Map getGroupIds()
{
return groupIds;
}
public void setGroupIds(Map groupIds)
{
this.groupIds = groupIds;
}
public Map getUserIds()
{
return userIds;
}
public void setUserIds(Map userIds)
{
this.userIds = userIds;
}
}