Skip to content

Commit

Permalink
DASH-92
Browse files Browse the repository at this point in the history
git-svn-id: https://source.sakaiproject.org/svn/dashboard/trunk@313040 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
zqian committed Nov 15, 2011
1 parent e98f205 commit 05440ca
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
8 changes: 6 additions & 2 deletions dashboard/bundles/resources/dash_entity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ announcement.metadata = Posted by {user-name} on {news-time}.
announcement.attachments = Attachments: {0}
announcement.news.time = Date posted: {0}
announcement.user.name = Posted by: {0}
announcement.info.link = More info.
announcement.info.link = View in Site
announcement.grouped.title = {0} announcements added to {1}
announcement.added = added

Expand All @@ -30,7 +30,11 @@ assignment.added = added

resource.user.name = Posted by: {0}
resource.news.time = Date posted: {0}
resource.info.link = Download this resource.
resource.info.link.file = Download File
resource.info.link.text = View Text
resource.info.link.html = View Page
resource.info.link.url = Go to Site
resource.info.link.citationlist = View Citation List
resource.grouped.title = {0} resources added to {1}
resource.added = added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public Map<String, Object> getValues(String entityReference,
Map<String,String> infoItem = new HashMap<String,String>();
infoItem.put(VALUE_INFO_LINK_URL, announcement.getUrl());
infoItem.put(VALUE_INFO_LINK_TITLE, rl.getString("announcement.info.link"));
infoItem.put(VALUE_INFO_LINK_TARGET, "_top");
infoList.add(infoItem);
values.put(VALUE_MORE_INFO, infoList);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.apache.commons.logging.LogFactory;
import org.sakaiproject.content.api.ContentCollection;
import org.sakaiproject.content.api.ContentResource;
import org.sakaiproject.content.api.ResourceType;
import org.sakaiproject.dash.listener.EventProcessor;
import org.sakaiproject.dash.logic.DashboardLogic;
import org.sakaiproject.dash.logic.SakaiProxy;
Expand Down Expand Up @@ -163,7 +164,7 @@ public Map<String, Object> getValues(String entityReference,
infoItem.put(VALUE_INFO_LINK_URL, resource.getUrl());
infoItem.put(VALUE_INFO_LINK_SIZE, Long.toString(resource.getContentLength()));
infoItem.put(VALUE_INFO_LINK_MIMETYPE, resource.getContentType());
infoItem.put(VALUE_INFO_LINK_TARGET, sakaiProxy.getTargetForMimetype(resource.getContentType()));
infoItem.put(VALUE_INFO_LINK_TARGET, "_blank");
// TODO: VALUE_INFO_LINK_TITLE depends on VALUE_INFO_LINK_TARGET. If new window, title might be "View the damned item". Otherwise "Download the stupid thing"?
infoItem.put(VALUE_INFO_LINK_TITLE, rl.getString("resource.info.link"));
infoList.add(infoItem);
Expand All @@ -173,6 +174,38 @@ public Map<String, Object> getValues(String entityReference,
}
return values ;
}

protected String getMoreInfoTitleForMimetype(String contentType)
{
String rv = null;
if (contentType.equals(ResourceType.TYPE_UPLOAD))
{
// uploaded file type
rv = "resource.info.link.file";
}
else if (contentType.equals(ResourceType.TYPE_TEXT))
{
// text type
rv = "resource.info.link.text";
}
else if (contentType.equals(ResourceType.TYPE_HTML))
{
// html type
rv = "resource.info.link.html";
}
else if (contentType.equals(ResourceType.TYPE_URL))
{
// url link type
rv = "resource.info.link.url";
}
else if (contentType.equals("org.sakaiproject.citation.impl.CitationList"))
{
// citation list type
rv = "resource.info.link.citationlist";
}

return rv;
}

/* (non-Javadoc)
* @see org.sakaiproject.dash.entity.EntityType#getProperties(java.lang.String, java.lang.String)
Expand Down

0 comments on commit 05440ca

Please sign in to comment.