Skip to content

Commit

Permalink
SAK-43381: admin workspace > announcements > fix cache refresh (sakai…
Browse files Browse the repository at this point in the history
  • Loading branch information
bjones86 authored Mar 6, 2020
1 parent 71bbe9a commit fb87313
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ public void update(Observable arg0, Object arg) {
}
}

/*
* Utility method to generate the channel ID based on the event reference.
* Normal channel ID: "/announcement/channel/<siteID>/main"
* Admin Workspace channel ID: "/announcement/channel/!site/motd"
*/
private String getChannel(final Event event) {
final String[] resourceSplitted = event.getResource().split("/");
final String site = resourceSplitted[3];
return "/announcement/channel/" + site + "/main";
final String site = "!admin".equals(resourceSplitted[3]) ? "!site" : resourceSplitted[3];
return "/announcement/channel/" + site + ("!site".equals(site) ? "/motd" : "/main");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ protected MessageChannel findChannel(String ref)
{
if (ref == null) return null;

// Used to resolve Site objects; "!site" refers to "!admin" site
if ("!site".equals(ref)) {
ref = "!admin";
}

MessageChannel channel = (MessageChannel) m_threadLocalManager.get(ref);
if (channel == null)
{
Expand Down Expand Up @@ -2219,8 +2224,8 @@ public void startNotifyThread(Event event) {
*/
public String getContext()
{
return m_context;

// Used to resolve Site objects; "!site" refers to "!admin" site
return "!site".equals(m_context) ? "!admin" : m_context;
} // getContext

/**
Expand Down

0 comments on commit fb87313

Please sign in to comment.