public Site getSiteOrNull(String siteId) { Site site = null; try { site = siteService.getSite(siteId); } catch (IdUnusedException idue) { log.warn("No site with id '" + siteId + "'"); } return site; }
public Set<String> getSiteUsers(String siteId) { try { Site site = siteService.getSite(siteId); return site.getUsers(); } catch (Exception e) { log.error(e.getMessage(), e); } return null; }
public static org.sakaiproject.site.api.Site getSite(java.lang.String param0) throws org.sakaiproject.exception.IdUnusedException { org.sakaiproject.site.api.SiteService service = getInstance(); if (service == null) return null; return service.getSite(param0); }
public String getSiteType(String siteId, String defaultType) { try { Site s = siteService.getSite(siteId); return s.getType(); } catch (IdUnusedException e) { return defaultType; } }
public static org.sakaiproject.site.api.Site getSite(java.lang.String param0) throws org.sakaiproject.exception.IdUnusedException { org.sakaiproject.site.api.SiteService service = getInstance(); if (service == null) return null; return service.getSite(param0); }
/** * {@inheritDoc} */ public Group getGroup(String siteId, String groupId) throws IdUnusedException { Site site = siteService.getSite(siteId); return site.getGroup(groupId); }
/** * {@inheritDoc} */ public String getLocationTitle(String locationId) { try { Site site = siteService.getSite(locationId); return site.getTitle(); } catch (IdUnusedException e) { log.warn("Cannot get the info about locationId: " + locationId); return "----------"; } }
public int getTotalSiteUsers(String siteId){ if(siteId == null){ throw new IllegalArgumentException("Null siteId"); }else{ try{ return M_ss.getSite(siteId).getMembers().size(); }catch(IdUnusedException e){ LOG.warn("Unable to get total site users for site id: "+siteId, e); return 0; } } }
private Optional<Site> getCurrentSite() { Optional<Site> site = null; try { String context = toolManager.getCurrentPlacement().getContext(); site = Optional.of(siteService.getSite(context)); } catch (Exception e) { // sakai failed to get us a location so we can assume we are not ins // ide the portal site = Optional.empty(); } return site; }
public Date getInitialActivityDate(String siteId) { Date date = null; try{ date = new Date(M_ss.getSite(siteId).getCreatedTime().getTime()); }catch(Exception e){ return new Date(0); } return date; }
public String getCommonsToolId(String siteId) { try { Site site = siteService.getSite(siteId); ToolConfiguration tc = site.getToolForCommonId("sakai.commons"); return tc.getId(); } catch (Exception e) { return ""; } }
public static Site siteForPID(SiteService siteservice, String pid) { Site togo = null; try { ToolConfiguration tc = siteservice.findTool(pid); String siteID = tc.getSiteId(); togo = siteservice.getSite(siteID); } catch (Exception iue) { // In Mercury, we may get an NPE since there is no ToolConfiguration } return togo; }
public boolean isAllowedFunction(String function, String siteId) { try { Site site = siteService.getSite(siteId); Role role = getCurrentUserRoleForSite(site); return isAllowedFunction(function, role); } catch (Exception e) { return false; } }
public static Site siteForPID(SiteService siteservice, String pid) { Site togo = null; try { ToolConfiguration tc = siteservice.findTool(pid); String siteID = tc.getSiteId(); togo = siteservice.getSite(siteID); } catch (Exception iue) { // In Mercury, we may get an NPE since there is no ToolConfiguration } return togo; }
private boolean isCurrentUserFromGroup(final String gradebookUid, final String studentId) { boolean isFromGroup = false; try { final Site s = this.siteService.getSite(gradebookUid); final Group g = s.getGroup(studentId); isFromGroup = (g != null) && (g.getMember(this.authn.getUserUid()) != null); } catch (final Exception e) { // Id not found log.error("Error in isCurrentUserFromGroup: ", e); } return isFromGroup; }
private boolean isCurrentUserFromGroup(final String gradebookUid, final String studentId) { boolean isFromGroup=false; try { final Site s = this.siteService.getSite(gradebookUid); final Group g = s.getGroup(studentId); isFromGroup = (g != null) && (g.getMember(this.authn.getUserUid()) != null); } catch (final Exception e) { // Id not found log.error("Error in isCurrentUserFromGroup: ", e); } return isFromGroup; }
public Set<String> getSiteUsers(String siteId) { try{ if(siteId == null) { siteId = M_tm.getCurrentPlacement().getContext(); } return M_ss.getSite(siteId).getUsers(); }catch(IdUnusedException e){ LOG.warn("Inexistent site for site id: "+siteId); } return null; }
public String getCurrentLocationReference() { String location = null; try { String context = toolManager.getCurrentPlacement().getContext(); Site s = siteService.getSite( context ); location = s.getReference(); // get the entity reference to the site } catch (Exception e) { // sakai failed to get us a location so we can assume we are not inside the portal location = null; } return location; }
public boolean checkLockOnCurrentUserAndSite(String authzfunction) { String context = toolmanager.getCurrentPlacement().getContext(); try { Site site = siteService.getSite(context); return securityService.unlock(authzfunction, site.getReference()); } catch (IdUnusedException e) { throw UniversalRuntimeException.accumulate(e, "Could not fetch the site for context " + context); } }
public boolean checkLockOnCurrentUserAndSite(String authzfunction) { String context = toolmanager.getCurrentPlacement().getContext(); try { Site site = siteService.getSite(context); return securityService.unlock(authzfunction, site.getReference()); } catch (IdUnusedException e) { throw UniversalRuntimeException.accumulate(e, "Could not fetch the site for context " + context); } }