Skip to content

Commit

Permalink
[DS-381] community and collection homepage
Browse files Browse the repository at this point in the history
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4567 9c30dcfa-912a-0410-8fc2-9e0234be79fd
  • Loading branch information
benbosman committed Nov 30, 2009
1 parent 9fb947f commit a717862
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
Expand Up @@ -42,6 +42,8 @@
import java.io.IOException;
import java.io.Serializable;
import java.sql.SQLException;
import java.util.Map;
import java.util.HashMap;

import org.apache.cocoon.caching.CacheableProcessingComponent;
import org.apache.cocoon.environment.ObjectModelHelper;
Expand Down Expand Up @@ -287,9 +289,29 @@ public void addBody(Body body) throws SAXException, WingException,
"collection-browse");
browse.setHead(T_head_browse);
String url = contextPath + "/handle/" + collection.getHandle();
browse.addItemXref(url + "/browse?type=title",T_browse_titles);
browse.addItemXref(url + "/browse?type=author",T_browse_authors);
browse.addItemXref(url + "/browse?type=dateissued",T_browse_dates);

try
{
// Get a Map of all the browse tables
BrowseIndex[] bis = BrowseIndex.getBrowseIndices();
for (BrowseIndex bix : bis)
{
// Create a Map of the query parameters for this link
Map<String, String> queryParams = new HashMap<String, String>();

queryParams.put("type", bix.getName());

// Add a link to this browse
browse.addItemXref(super.generateURL(url + "/browse", queryParams),
message("xmlui.ArtifactBrowser.Navigation.browse_" + bix.getName()));
}
}
catch (BrowseException bex)
{
browse.addItemXref(url + "/browse?type=title",T_browse_titles);
browse.addItemXref(url + "/browse?type=author",T_browse_authors);
browse.addItemXref(url + "/browse?type=dateissued",T_browse_dates);
}
}

// Add the reference
Expand Down
Expand Up @@ -42,6 +42,8 @@
import java.io.IOException;
import java.io.Serializable;
import java.sql.SQLException;
import java.util.Map;
import java.util.HashMap;

import org.apache.cocoon.caching.CacheableProcessingComponent;
import org.apache.cocoon.environment.ObjectModelHelper;
Expand Down Expand Up @@ -308,9 +310,29 @@ public void addBody(Body body) throws SAXException, WingException,
"community-browse");
browse.setHead(T_head_browse);
String url = contextPath + "/handle/" + community.getHandle();
browse.addItemXref(url + "/browse?type=title",T_browse_titles);
browse.addItemXref(url + "/browse?type=author",T_browse_authors);
browse.addItemXref(url + "/browse?type=dateissued",T_browse_dates);

try
{
// Get a Map of all the browse tables
BrowseIndex[] bis = BrowseIndex.getBrowseIndices();
for (BrowseIndex bix : bis)
{
// Create a Map of the query parameters for this link
Map<String, String> queryParams = new HashMap<String, String>();

queryParams.put("type", bix.getName());

// Add a link to this browse
browse.addItemXref(super.generateURL(url + "/browse", queryParams),
message("xmlui.ArtifactBrowser.Navigation.browse_" + bix.getName()));
}
}
catch (BrowseException bex)
{
browse.addItemXref(url + "/browse?type=title",T_browse_titles);
browse.addItemXref(url + "/browse?type=author",T_browse_authors);
browse.addItemXref(url + "/browse?type=dateissued",T_browse_dates);
}
}

// Add main reference:
Expand Down
1 change: 1 addition & 0 deletions dspace/CHANGES
Expand Up @@ -122,6 +122,7 @@
- [DS-228] Community Admin XMLUI: Delegated Admins Patch

(Ben Bosman)
- [DS-381] community and collection homepage
- [DS-310] UTF-8 encoding in community and collection text
- [DS-307] Offer access in AbstractSearch to QueryResults for subclasses
- [DS-306] Option to disable mailserver
Expand Down

0 comments on commit a717862

Please sign in to comment.