Skip to content

Commit

Permalink
SAK-41672 - Email archive mailbox not set up, instructor has no permi…
Browse files Browse the repository at this point in the history
…ssions, stack traces on server (sakaiproject#6841)
  • Loading branch information
jonespm authored and axxter99 committed Apr 22, 2019
1 parent a69cc72 commit 6e157f1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ public abstract class BaseMailArchiveService extends BaseMessage implements Mail
/** Dependency: AliasService */
@Setter protected AliasService aliasService;

@Setter private TimeService timeService;
@Setter private SiteService siteService;
@Setter private SecurityService securityService;
@Setter private FunctionManager functionManager;

/**********************************************************************************************************************************************************************************************************************************************************
Expand Down Expand Up @@ -541,7 +538,7 @@ public String[] myToolIds()
protected void enableMailbox(String siteId)
{
// form the email channel name
String channelRef = channelReference(siteId, siteService.MAIN_CONTAINER);
String channelRef = channelReference(siteId, m_siteService.MAIN_CONTAINER);

// see if there's a channel
MessageChannel channel = null;
Expand Down Expand Up @@ -611,7 +608,7 @@ protected void enableMailbox(String siteId)
protected void disableMailbox(String siteId)
{
// form the email channel name
String channelRef = channelReference(siteId, siteService.MAIN_CONTAINER);
String channelRef = channelReference(siteId, m_siteService.MAIN_CONTAINER);

// see if there's a channel
MessageChannel channel = null;
Expand Down Expand Up @@ -928,7 +925,7 @@ public void setOpen(boolean setting)
*/
public boolean allowAddMessage(User user)
{
return (!securityService.unlock(user, eventId(SECURE_ADD), getReference()));
return (!m_securityService.unlock(user, eventId(SECURE_ADD), getReference()));
}

/*
Expand Down Expand Up @@ -1238,7 +1235,7 @@ public BaseMailArchiveMessageHeaderEdit(Message msg, Element el)
// now extract the subject, from address, date sent
m_subject = el.getAttribute("subject");
m_fromAddress = el.getAttribute("mail-from");
m_dateSent = timeService.newTimeGmt(el.getAttribute("mail-date"));
m_dateSent = m_timeService.newTimeGmt(el.getAttribute("mail-date"));

// mail headers
NodeList children = el.getChildNodes();
Expand Down Expand Up @@ -1353,13 +1350,13 @@ public Time getDateSent()
@Override
public void setDateSent(Time sent)
{
m_dateSent = timeService.newTime(sent.getTime());
m_dateSent = m_timeService.newTime(sent.getTime());

} // setDateSent

@Override
public void setInstantSent(Instant sent) {
m_dateSent = timeService.newTime(sent.toEpochMilli());
m_dateSent = m_timeService.newTime(sent.toEpochMilli());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@
import org.sakaiproject.user.api.UserNotDefinedException;
import org.sakaiproject.util.*;

import lombok.Setter;
import lombok.experimental.Accessors;

/**
* BaseMessage is...
*/
@Slf4j
@Accessors(prefix = "m_" )
public abstract class BaseMessage implements MessageService, DoubleStorageUser
{
/** A Storage object for persistent storage. */
Expand All @@ -87,172 +91,52 @@ public abstract class BaseMessage implements MessageService, DoubleStorageUser
/** added to allow for scheduled notifications */
private static final String SCHED_INV_UUID = "schInvUuid";
//private static final String SCHINV_DELETE_EVENT = "schInv.delete";


/**
* Access this service from the inner classes.
*/
protected BaseMessage service()
{
return this;
}

/**********************************************************************************************************************************************************************************************************************************************************
* Constructors, Dependencies and their setter methods
*********************************************************************************************************************************************************************************************************************************************************/

/** Dependency: MemoryService. */
protected MemoryService m_memoryService = null;

/**
* Dependency: MemoryService.
*
* @param service
* The MemoryService.
*/
public void setMemoryService(MemoryService service)
{
m_memoryService = service;
}
@Setter protected MemoryService m_memoryService;

/** Dependency: ServerConfigurationService. */
protected ServerConfigurationService m_serverConfigurationService = null;

/**
* Dependency: ServerConfigurationService.
*
* @param service
* The ServerConfigurationService.
*/
public void setServerConfigurationService(ServerConfigurationService service)
{
m_serverConfigurationService = service;
}
@Setter protected ServerConfigurationService m_serverConfigurationService;

/** Dependency: SessionManager. */
protected SessionManager m_sessionManager = null;

/**
* Dependency: SessionManager.
*
* @param service
* The SessionManager.
*/
public void setSessionManager(SessionManager service)
{
m_sessionManager = service;
}
@Setter protected SessionManager m_sessionManager;

/** Dependency: AuthzGroupService. */
protected AuthzGroupService m_authzGroupService = null;

/**
* Dependency: AuthzGroupService.
*
* @param service
* The AuthzGroupService.
*/
public void setAuthzGroupService(AuthzGroupService service)
{
m_authzGroupService = service;
}
@Setter protected AuthzGroupService m_authzGroupService;

/** Dependency: SecurityService. */
protected SecurityService m_securityService = null;

/**
* Dependency: SecurityService.
*
* @param service
* The SecurityService.
*/
public void setSecurityService(SecurityService service)
{
m_securityService = service;
}
@Setter protected SecurityService m_securityService;

/** Dependency: TimeService. */
protected TimeService m_timeService = null;

/**
* Dependency: TimeService.
*
* @param service
* The TimeService.
*/
public void setTimeService(TimeService service)
{
m_timeService = service;
}
@Setter protected TimeService m_timeService;

/** Dependency: EventTrackingService. */
protected EventTrackingService m_eventTrackingService = null;

/**
* Dependency: EventTrackingService.
*
* @param service
* The EventTrackingService.
*/
public void setEventTrackingService(EventTrackingService service)
{
m_eventTrackingService = service;
}
@Setter protected EventTrackingService m_eventTrackingService;

/** Dependency: IdManager. */
protected IdManager m_idManager = null;

/**
* Dependency: IdManager.
*
* @param service
* The IdManager.
*/
public void setIdManager(IdManager service)
{
m_idManager = service;
}
@Setter protected IdManager m_idManager;

/** Dependency: SiteService. */
protected SiteService m_siteService = null;

/**
* Dependency: SiteService.
*
* @param service
* The SiteService.
*/
public void setSiteService(SiteService service)
{
m_siteService = service;
}
@Setter protected SiteService m_siteService;

/** Dependency: UserDirectoryService. */
protected UserDirectoryService m_userDirectoryService = null;

/**
* Dependency: UserDirectoryService.
*
* @param service
* The UserDirectoryService.
*/
public void setUserDirectoryService(UserDirectoryService service)
{
m_userDirectoryService = service;
}
@Setter protected UserDirectoryService m_userDirectoryService;

/** Dependency: ThreadLocalManager. */
protected ThreadLocalManager m_threadLocalManager = null;
@Setter protected ThreadLocalManager m_threadLocalManager;

/** Dependency: EntityManager. */
@Setter protected EntityManager m_entityManager;

/**
* Dependency: ThreadLocalManager.
*
* @param service
* The ThreadLocalManager.
* Access this service from the inner classes.
*/
public void setThreadLocalManager(ThreadLocalManager service)
protected BaseMessage service()
{
m_threadLocalManager = service;
return this;
}

/**
Expand All @@ -264,20 +148,6 @@ public void setThreadLocalManager(ThreadLocalManager service)
*/
public void setCaching(String value) {} // intentionally blank - remove this later

/** Dependency: EntityManager. */
protected EntityManager m_entityManager = null;

/**
* Dependency: EntityManager.
*
* @param service
* The EntityManager.
*/
public void setEntityManager(EntityManager service)
{
m_entityManager = service;
}

/**********************************************************************************************************************************************************************************************************************************************************
* Init and Destroy
*********************************************************************************************************************************************************************************************************************************************************/
Expand Down

0 comments on commit 6e157f1

Please sign in to comment.