/** * {@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 "----------"; } }
protected String calcSiteName() { if (siteId == null) { return ""; } Site site = null; try { site = SiteService.getSite(siteId); } catch (IdUnusedException ignore) { return ""; } return " (" + site.getTitle() + ")"; }
/** * {@inheritDoc} */ public String getUserSpecificSiteTitle(Site site, String userID, List<String> siteProviders) { if( m_siteTitleAdvisor != null ) { return m_siteTitleAdvisor.getUserSpecificSiteTitle( site, userID, siteProviders ); } else { return site.getTitle(); } }
/** * Get the site name. * @param siteId site id * @return the site name. */ public String getSiteName(String siteId){ String siteName=null; try{ siteName = SiteService.getSite(siteId).getTitle(); } catch (Exception ex){ log.warn("getSiteName : " + ex.getMessage()); log.warn("SiteService not available. " + "This needs to be fixed if you are not running a unit test."); } return siteName; }
/** * Get the site name. * @param siteId site id * @return the site name. */ public String getSiteName(String siteId){ String siteName=null; try{ siteName = SiteService.getSite(siteId).getTitle(); } catch (Exception ex){ log.warn("getSiteName : " + ex.getMessage()); log.warn("SiteService not available. " + "This needs to be fixed if you are not running a unit test."); } return siteName; }
/** * Get the current site name. * @return the site name. */ public String getCurrentSiteName(boolean accessViaUrl){ // access via url => users does not login via any sites-daisyf String currentSiteName = null; if (!accessViaUrl) { try{ currentSiteName = SiteService.getSite(getCurrentSiteId(accessViaUrl)).getTitle(); } catch (Exception e){ log.warn("getCurrentSiteName : " + e.getMessage()); } } return currentSiteName; }
public String getSiteTile(String siteId) { Site site; try { site = siteService.getSite(siteId); return site.getTitle(); } catch (IdUnusedException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
/** * Get the current site name. * @return the site name. */ public String getCurrentSiteName(boolean accessViaUrl){ // access via url => users does not login via any sites-daisyf String currentSiteName = null; if (!accessViaUrl) { try{ currentSiteName = SiteService.getSite(getCurrentSiteId(accessViaUrl)).getTitle(); } catch (Exception e){ log.warn("getCurrentSiteName : " + e.getMessage()); } } return currentSiteName; }
/** * @inheritDoc */ public int compareTo(Object obj) { if (!(obj instanceof Site)) throw new ClassCastException(); // if the object are the same, say so if (obj == this) return 0; // start the compare by comparing their sort names int compare = getTitle().compareTo(((Site) obj).getTitle()); // if these are the same if (compare == 0) { // sort based on (unique) id compare = getId().compareTo(((Site) obj).getId()); } return compare; }
@Override public boolean isSiteAcceptable(Site site) { if (site == null) { return false; } log.debug("isSiteAcceptable ("+siteAdvisor+"): " + site.getId() + " / " + site.getTitle()); // Delegated to another bean if (siteAdvisor != null) { return siteAdvisor.siteCanUseReviewService(site); } // Check site property ResourceProperties properties = site.getProperties(); String prop = (String) properties.get(COMPILATIO_SITE_PROPERTY); if (StringUtils.isNotBlank(prop)) { log.debug("Using site property: " + prop); return Boolean.parseBoolean(prop); } // No property set, no restriction on site types, so allow return true; }
@Override public boolean isSiteAcceptable(Site site) { if (site == null) { return false; } log.debug("isSiteAcceptable: {} / {}", site.getId(), site.getTitle()); // Delegated to another bean if (siteAdvisor != null) { return siteAdvisor.siteCanUseReviewService(site); } // Check site property ResourceProperties properties = site.getProperties(); String prop = (String) properties.get(URKUND_SITE_PROPERTY); if (StringUtils.isNotBlank(prop)) { log.debug("Using site property: {}", prop); return Boolean.parseBoolean(prop); } // No property set, no restriction on site types, so allow return true; }
/** * Creates a course from a sakai Site * * @param site The Sakai site */ public CourseImpl(Site site) { this.site = site; this.uuid = site.getReference(); this.title = site.getTitle(); this.siteContext = site.getId(); this.externallyManaged = Boolean.valueOf(site.getProperties().getProperty(CourseImpl.EXTERNALLY_MAINTAINED)).booleanValue(); this.selfRegistrationAllowed = Boolean.valueOf(site.getProperties().getProperty(CourseImpl.STUDENT_REGISTRATION_ALLOWED)).booleanValue(); this.selfSwitchingAllowed = Boolean.valueOf(site.getProperties().getProperty(CourseImpl.STUDENT_SWITCHING_ALLOWED)).booleanValue(); }
/** * Creates a course from a sakai Site * * @param site The Sakai site */ public CourseImpl(Site site) { this.site = site; this.uuid = site.getReference(); this.title = site.getTitle(); this.siteContext = site.getId(); this.externallyManaged = Boolean.valueOf(site.getProperties().getProperty(CourseImpl.EXTERNALLY_MAINTAINED)).booleanValue(); this.selfRegistrationAllowed = Boolean.valueOf(site.getProperties().getProperty(CourseImpl.STUDENT_REGISTRATION_ALLOWED)).booleanValue(); this.selfSwitchingAllowed = Boolean.valueOf(site.getProperties().getProperty(CourseImpl.STUDENT_SWITCHING_ALLOWED)).booleanValue(); }
/** * 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; }
public String getSiteTitle() { String siteId = ((AssignmentSubmission)getObject()).getAssignment().getContext(); String title = getSite(siteId).getTitle(); return title; }
public SiteSerialized(Site site, String termProp){ this.id = site.getId(); this.url = site.getUrl(); this.title = site.getTitle(); Object prop = site.getProperties().get(termProp); term = ""; if(prop != null){ term = prop.toString(); } this.reference = site.getReference(); this.setPublished(site.isPublished()); }
public SiteSerialized(Site site, String termProp){ this.id = site.getId(); this.url = site.getUrl(); this.title = site.getTitle(); Object prop = site.getProperties().get(termProp); term = ""; if(prop != null){ term = prop.toString(); } this.reference = site.getReference(); this.setPublished(site.isPublished()); }
/** * Format a to address, to the related site, but with no reply. * * @param event * The event that matched criteria to cause the notification. * @return a to address, to the related site, but with no reply. */ protected String getToSiteNoReply(Event event) { Reference ref = EntityManager.newReference(event.getResource()); // use either the configured site, or if not configured, the site (context) of the resource String siteId = (getSite() != null) ? getSite() : ref.getContext(); // get a site title String title = siteId; try { Site site = SiteService.getSite(siteId); title = site.getTitle(); } catch (Exception ignore) { } return "\"" + title + "\" <"+ ServerConfigurationService.getString("setup.request","no-reply@" + ServerConfigurationService.getServerName()) + ">"; }
/** * {@inheritDoc} */ public String getEntityDescription(Reference ref) { // double check that it's mine if (!APPLICATION_ID.equals(ref.getType())) return null; String rv = rb.getFormattedMessage("entdsc.sit", new Object[]{ref.getReference()}); try { Site site = getSite(ref.getId()); rv = rb.getFormattedMessage("entdsc.sit_usr", new Object[]{ site.getTitle() + " (" + site.getId() + ")", site.getCreatedTime().toStringLocalFull(), site.getCreatedBy().getDisplayName() + " (" + site.getCreatedBy().getDisplayId() + ")", StringUtil.limit((site.getDescription() == null ? "" : site.getDescription()), 30)}); } catch (IdUnusedException e) { } catch (NullPointerException e) { } return rv; }