public boolean siteCanUseReviewService(Site site) { String type = site.getType(); if (type != null ) { if (type.equals("course")) return true; } return false; }
public String getSiteType(String siteId, String defaultType) { try { Site s = siteService.getSite(siteId); return s.getType(); } catch (IdUnusedException e) { return defaultType; } }
public SiteContentAdvisor getContentAdvisor(Site site) { if ( site == null ) { return null; } SiteContentAdvisorProvider scap = siteContentAdvisorsProviders.get(site.getType()); if ( scap == null ) { return null; } return scap.getContentAdvisor(site); }
private boolean isPortfolioSite(String siteId) { boolean rv = false; try { Site s = getSite(siteId); List<String> portfolioSiteTypes = getSiteTypeStrings("portfolio"); if (portfolioSiteTypes.contains(s.getType())) return true; } catch (IdUnusedException e) { log.warn("isPortfolioSite(): no site with id: " + siteId); } return rv; }
private boolean isProjectSite(String siteId) { boolean rv = false; try { Site s = getSite(siteId); List<String> projectSiteTypes = getSiteTypeStrings("project"); if (projectSiteTypes.contains(s.getType())) return true; } catch (IdUnusedException e) { log.warn("isProjectSite(): no site with id: " + siteId); } return rv; }
private boolean isCourseSite(String siteId) { boolean rv = false; try { Site s = getSite(siteId); List<String> courseSiteTypes = getSiteTypeStrings("course"); if (courseSiteTypes.contains(s.getType())) return true; } catch (IdUnusedException e) { log.warn("isCourseSite(): no site with id: " + siteId); } return rv; }
/** * Returns the type ("course", "project", "workspace", "mySpecialSiteType", * etc) of the given site; special handling of returning "workspace" for * user workspace sites. This method is tightly coupled to site skinning. */ public String calcSiteType(String siteId) { String siteType = null; if (siteId != null && siteId.length() != 0) { if (SiteService.isUserSite(siteId)) { siteType = "workspace"; } else { try { siteType = SiteService.getSite(siteId).getType(); } catch (IdUnusedException ex) { // ignore, the site wasn't found } } } if (siteType != null && siteType.trim().length() == 0) siteType = null; return siteType; }
/** * Returns the type ("course", "project", "workspace", "mySpecialSiteType", * etc) of the given site; special handling of returning "workspace" for * user workspace sites. This method is tightly coupled to site skinning. */ public String calcSiteType(String siteId) { String siteType = null; if (siteId != null && siteId.length() != 0) { if (SiteService.isUserSite(siteId)) { siteType = "workspace"; } else { try { siteType = SiteService.getSite(siteId).getType(); } catch (IdUnusedException ex) { // ignore, the site wasn't found } } } if (siteType != null && siteType.trim().length() == 0) siteType = null; return siteType; }
/** * Allow Turnitin for this site? */ @Override public boolean isSiteAcceptable(Site s) { if (s == null) { return false; } log.debug("isSiteAcceptable: " + s.getId() + " / " + s.getTitle()); // Delegated to another bean if (siteAdvisor != null) { return siteAdvisor.siteCanUseReviewService(s); } // Check site property ResourceProperties properties = s.getProperties(); String prop = (String) properties.get(TURNITIN_SITE_PROPERTY); if (prop != null) { log.debug("Using site property: " + prop); return Boolean.parseBoolean(prop); } // Check list of allowed site types, if defined if (enabledSiteTypes != null && !enabledSiteTypes.isEmpty()) { log.debug("Using site type: " + s.getType()); return enabledSiteTypes.contains(s.getType()); } // No property set, no restriction on site types, so allow return true; }
/** * Figure the site's authorization group template, based on type and if it's a user site. * * @param site * The site to figure the realm for. * @return the site's authorization group template, based on type and if it's a user site. */ protected String siteAzgTemplate(Site site) { String azgTemplate = null; if (isUserSite(site.getId())) { azgTemplate = "!site.user"; } else { // use the type's template, if defined azgTemplate = "!site.template"; String type = site.getType(); if (type != null) { azgTemplate = azgTemplate + "." + type; } } return azgTemplate; }
/** * Figure the authorization group template for a group of this site, based on type and if it's a user site. * * @param site * The site to figure the authorization group templates for. * @return the authorization group template for a group of this site, based on type and if it's a user site. */ protected String groupAzgTemplate(Site site) { String azgTemplate = null; if (isUserSite(site.getId())) { azgTemplate = "!group.user"; } else { // use the type's template, if defined azgTemplate = "!group.template"; String type = site.getType(); if (type != null) { azgTemplate = azgTemplate + "." + type; } } return azgTemplate; }
public void setupPageCategory(String toolId) { String defaultCategory = null; if (m_site != null) { Map<String, String> toolCategories = siteService.serverConfigurationService() .getToolToCategoryMap(m_site.getType()); defaultCategory = toolCategories.get(toolId); } if (getProperties().get(PAGE_CATEGORY_PROP) == null && defaultCategory != null) { getProperties().addProperty(PAGE_CATEGORY_PROP, defaultCategory); } }
protected boolean updateSite(AuthzGroup defaultTemplate, Site site, String role) { String siteType = site.getType(); if (siteType != null && !siteType.isEmpty()) { String templateId = TEMPLATE_PREFIX + "." + siteType;
protected boolean updateSite(AuthzGroup defaultTemplate, Site site, String role) { String siteType = site.getType(); if (siteType != null && !siteType.isEmpty()) { String templateId = TEMPLATE_PREFIX + "." + siteType;
try { Site site = siteService.getSite(siteId); if (type == null || type.isEmpty() || type.equals(site.getType())) { if (updateSite(context, site)) { log.info("Updated site: "+ siteId);
try { Site site = siteService.getSite(siteId); if (type == null || type.isEmpty() || type.equals(site.getType())) { if (updateSite(context, site)) { log.info("Updated site: "+ siteId);
try { Site site = siteService.getSite(siteId); if (type != null && !type.equals(site.getType())) { log.error("Both site ID and type specified but site doesn't match."); } else {
try { Site site = siteService.getSite(siteId); if (type != null && !type.equals(site.getType())) { log.error("Both site ID and type specified but site doesn't match."); } else {
public static void addSiteInfo(Properties props, Properties lti2subst, Site site) { if (site != null) { String context_type = site.getType(); if (context_type != null && context_type.toLowerCase().contains("course")) { setProperty(props, BasicLTIConstants.CONTEXT_TYPE, BasicLTIConstants.CONTEXT_TYPE_COURSE_SECTION);