Skip to content

Commit

Permalink
SAK-25894 Linking a resource does not open in a new tab from Syllabus…
Browse files Browse the repository at this point in the history
… tool

git-svn-id: https://source.sakaiproject.org/svn/syllabus/trunk@307605 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
Bryan Holladay committed Mar 28, 2014
1 parent ce0f473 commit b6050d2
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.sakaiproject.site.api.SiteService;
import org.sakaiproject.site.api.ToolConfiguration;
import org.sakaiproject.tool.api.ToolManager;
import org.sakaiproject.util.FormattedText;

/**
* Entity provider for the Syllabus tool
Expand Down Expand Up @@ -373,8 +374,21 @@ public void updateEntity(EntityReference ref, Object entity, Map<String, Object>
}
}else if("body".equals(params.get("name"))){
String body = (String) params.get("value");
data.setAsset(body);
syllabusManager.saveSyllabus(data);
StringBuilder alertMsg = new StringBuilder();
String cleanedText = null;
try
{
cleanedText = FormattedText.processFormattedText(body, alertMsg);
if (alertMsg.length() > 0)
{
throw new IllegalArgumentException("Error formatting body text: " + alertMsg);
}else{
data.setAsset(cleanedText);
syllabusManager.saveSyllabus(data);
}
}catch(Exception e){
log.error(e.getMessage(), e);
}
}else if("startDate".equals(params.get("name"))){
String startDate = (String) params.get("value");
if(startDate == null || "".equals(startDate)){
Expand Down

0 comments on commit b6050d2

Please sign in to comment.