@Override public String getOwningCommunity(Context context, Item item) { try { List<Community> comms = itemService.getCommunities(context, item); if (comms.size() > 0) { return comms.get(0).getName(); } else { return " "; } } catch (SQLException e) { log.error(e.getMessage()); return e.getMessage(); } }
public List<Map.Entry<String, Integer>> getCommunities(Context context) throws SQLException { List<Map.Entry<String, Integer>> cl = new java.util.ArrayList<>(); List<Community> top_communities = communityService.findAllTop(context); for (Community c : top_communities) { cl.add( new java.util.AbstractMap.SimpleEntry<>(c.getName(), itemService.countItems(context, c)) ); } return cl; } }
public DSpaceSet(Community c) { super("com_" + c.getHandle().replace('/', '_'), checkName(c.getName())); }
name.insert(0, com.getName() + separator);
/** * Produce a list of DSpaceCommunitySet. The list is a segment of the full * list of Community ordered alphabetically by name. * * @param offset start this far down the list of Community. * @param length return up to this many Sets. * @return some Sets representing the Community list segment. */ private List<Set> community(int offset, int length) { List<Set> array = new ArrayList<Set>(); try { List<Community> communityList = communityService.findAll(_context, length, offset); for (Community community : communityList) { array.add(DSpaceSet.newDSpaceCommunitySet( community.getHandle(), community.getName())); } } catch (SQLException e) { log.error(e.getMessage(), e); } return array; }
continue; HierarchyCommunity mycomm = new HierarchyCommunity(comm.getID().toString(), comm.getName(), comm.getHandle()); parentComms.add(mycomm);
name = comm.getName();
System.out.println("Community " + t + " " + t.getName());
break; name = comm.getName();
} else { log.info( "Omitted restricted subCommunity: " + subCommunity.getID() + " _ " + subCommunity.getName());
defaultTitle = comm.getName(); feed.setDescription(communityService.getMetadata(comm, "short_description")); logo = comm.getLogo();
main.setHead(T_main_head.parameterize(thisCommunity.getName()));
main.setHead(T_main_head.parameterize(thisCommunity.getName()));
main.setHead(T_main_head.parameterize(thisCommunity.getName()));