Merge r7827 from nihvivo-rel-1.2-maint branch: fix display of classgroups with no public name on index and home pages.
This commit is contained in:
parent
78c3294102
commit
1e03e2b5a8
5 changed files with 38 additions and 33 deletions
|
@ -174,7 +174,6 @@ public class BrowseDataGetter implements PageDataGetter {
|
|||
map.put("classes", classes);
|
||||
|
||||
map.put("classGroup", new VClassGroupTemplateModel(vcg));
|
||||
map.put("classGroupName", vcg.getPublicName());
|
||||
map.put("classGroupUri", vcg.getURI());
|
||||
|
||||
return map;
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.web.templatemodels;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
@ -43,6 +43,15 @@ public class VClassGroupTemplateModel extends BaseTemplateModel {
|
|||
return vClassGroup.getPublicName();
|
||||
}
|
||||
|
||||
// Protect the template against a group without a name.
|
||||
public String getDisplayName() {
|
||||
String displayName = getPublicName();
|
||||
if (StringUtils.isBlank(displayName)) {
|
||||
displayName = getLocalName().replaceFirst("vitroClassGroup", "");
|
||||
}
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public List<VClassTemplateModel> getClasses() {
|
||||
if (classes == null) {
|
||||
List<VClass> classList = vClassGroup.getVitroClassList();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue