Skip to content

Commit

Permalink
SAK-33818 msgcntr tool: cover => api (sakaiproject#5189)
Browse files Browse the repository at this point in the history
* SAK-33818 msgcntr tool: cover => api

* SAK-33818 covers => api
  • Loading branch information
axxter99 authored and jonespm committed Mar 13, 2018
1 parent f724417 commit 9d81f9d
Show file tree
Hide file tree
Showing 10 changed files with 393 additions and 180 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
**********************************************************************************/
package org.sakaiproject.tool.messageforums;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.Enumeration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.content.api.ContentResource;
import org.sakaiproject.content.cover.ContentHostingService;
import org.sakaiproject.content.api.ContentHostingService;
import org.sakaiproject.email.api.AddressValidationException;
import org.sakaiproject.email.api.EmailAddress;
import org.sakaiproject.email.api.EmailAddress.RecipientType;
Expand All @@ -52,8 +52,8 @@
import org.sakaiproject.exception.ServerOverloadException;
import org.sakaiproject.exception.TypeException;
import org.sakaiproject.site.api.Site;
import org.sakaiproject.site.cover.SiteService;
import org.sakaiproject.time.cover.TimeService;
import org.sakaiproject.site.api.SiteService;
import org.sakaiproject.time.api.UserTimeService;
import org.sakaiproject.tool.api.ToolManager;
import org.sakaiproject.tool.messageforums.ui.DiscussionMessageBean;
import org.sakaiproject.util.FormattedText;
Expand Down Expand Up @@ -143,7 +143,8 @@ public void send() {
String sitetitle = "";
BaseForum baseforum = reply.getTopic().getBaseForum();
try {
currentSite = SiteService.getSite(getToolManager()
SiteService siteService = ComponentManager.get(SiteService.class);
currentSite = siteService.getSite(getToolManager()
.getCurrentPlacement().getContext());
} catch (IdUnusedException e) {
log.error("ForumsEmailService.send(), Site ID not found: "
Expand All @@ -158,7 +159,8 @@ public void send() {
String topictitle = topic.getTitle();
String threadtitle = threadhead.getMessage().getTitle();
SimpleDateFormat formatter = new SimpleDateFormat(DiscussionForumTool.getResourceBundleString("date_format"), new ResourceLoader().getLocale());
formatter.setTimeZone(TimeService.getLocalTimeZone());
UserTimeService userTimeService = ComponentManager.get(UserTimeService.class);
formatter.setTimeZone(userTimeService.getLocalTimeZone());
content.append(DiscussionForumTool
.getResourceBundleString("email.body.location")
+ " "
Expand Down Expand Up @@ -226,7 +228,7 @@ public void send() {
msg.addAttachment(attachment);
}

EmailService instance = org.sakaiproject.email.cover.EmailService.getInstance();
EmailService instance = ComponentManager.get(EmailService.class);
instance.send(msg);
} catch (AddressValidationException e) {
log.error("Failed to send all emails: "+ e.getMessage());
Expand All @@ -252,7 +254,8 @@ public void send() {
private File getAttachedFile(String resourceId) throws PermissionException,
IdUnusedException, TypeException, ServerOverloadException,
IOException {
ContentResource cr = ContentHostingService.getResource(resourceId);
ContentHostingService contentHostingService = ComponentManager.get(ContentHostingService.class);;
ContentResource cr = contentHostingService.getResource(resourceId);
byte[] data = cr.getContent();
StringBuilder sbPrefixedPath = new StringBuilder(prefixedPath);
sbPrefixedPath.append("/email_tmp/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

import java.util.Comparator;

import lombok.extern.slf4j.Slf4j;

import org.sakaiproject.entity.api.EntityPropertyNotDefinedException;
import org.sakaiproject.entity.api.EntityPropertyTypeException;
import org.sakaiproject.site.api.Group;

public class GroupComparator implements Comparator {
Expand Down
Loading

0 comments on commit 9d81f9d

Please sign in to comment.