use of org.olat.core.gui.control.navigation.SiteDefinition in project openolat by klemens.
the class SitesConfigurationController method reload.
protected void reload() {
List<SiteDefRow> configs = new ArrayList<SiteDefRow>();
for (Map.Entry<String, SiteDefinition> entryDef : siteDefs.entrySet()) {
String id = entryDef.getKey();
SiteDefinition siteDef = entryDef.getValue();
String title = translate(siteDef.getClass().getSimpleName());
SiteConfiguration config = sitesModule.getConfigurationSite(id);
SiteDefRow row = new SiteDefRow(siteDef, config, title, formLayout);
configs.add(row);
}
Collections.sort(configs, new RowOrderComparator());
model.setObjects(configs);
}
use of org.olat.core.gui.control.navigation.SiteDefinition in project OpenOLAT by OpenOLAT.
the class GuestBFWCParts method getSiteInstances.
/**
* @see org.olat.core.commons.fullWebApp.BaseFullWebappControllerParts#getSiteInstances(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
*/
@Override
public List<SiteInstance> getSiteInstances(UserRequest ureq, WindowControl wControl) {
SiteDefinitions sitedefs = CoreSpringFactory.getImpl(SiteDefinitions.class);
List<SiteInstance> sites = new ArrayList<SiteInstance>();
for (SiteDefinition sitedef : sitedefs.getSiteDefList()) {
SiteInstance site = sitedef.createSite(ureq, wControl);
if (site != null) {
// site == null means that site is not visible to the current user
sites.add(site);
}
}
return sites;
}
use of org.olat.core.gui.control.navigation.SiteDefinition in project OpenOLAT by OpenOLAT.
the class CourseSiteContextEntryControllerCreator method getRepositoryEntry.
private RepositoryEntry getRepositoryEntry(UserRequest ureq, ContextEntry ce) {
if (repoEntry == null) {
if (ce.getOLATResourceable() instanceof RepositoryEntry) {
repoEntry = (RepositoryEntry) ce.getOLATResourceable();
} else {
OLATResourceable ores = ce.getOLATResourceable();
if ("CourseSite".equals(ores.getResourceableTypeName())) {
int id = ores.getResourceableId().intValue();
CourseSiteDef courseSiteDef = null;
List<SiteDefinition> siteDefList = getSitesDefinitions().getSiteDefList();
if (id == 2) {
for (SiteDefinition siteDef : siteDefList) {
if (siteDef instanceof CourseSiteDef2) {
courseSiteDef = (CourseSiteDef) siteDef;
}
}
} else if (id == 1) {
for (SiteDefinition siteDef : siteDefList) {
if (siteDef instanceof CourseSiteDef) {
courseSiteDef = (CourseSiteDef) siteDef;
}
}
}
if (courseSiteDef != null) {
CourseSiteConfiguration config = courseSiteDef.getCourseSiteconfiguration();
LanguageConfiguration langConfig = courseSiteDef.getLanguageConfiguration(ureq, config);
if (langConfig != null) {
String softKey = langConfig.getRepoSoftKey();
RepositoryManager rm = RepositoryManager.getInstance();
repoEntry = rm.lookupRepositoryEntryBySoftkey(softKey, false);
}
}
} else {
RepositoryManager rm = RepositoryManager.getInstance();
repoEntry = rm.lookupRepositoryEntry(ores.getResourceableId());
}
}
}
return repoEntry;
}
use of org.olat.core.gui.control.navigation.SiteDefinition in project openolat by klemens.
the class CourseSiteContextEntryControllerCreator method getCourseSite.
private CourseSiteDef getCourseSite(UserRequest ureq, RepositoryEntry re) {
if (re == null)
return null;
List<SiteDefinition> siteDefList = getSitesDefinitions().getSiteDefList();
for (SiteDefinition siteDef : siteDefList) {
if (siteDef instanceof CourseSiteDef) {
CourseSiteDef courseSiteDef = (CourseSiteDef) siteDef;
CourseSiteConfiguration config = courseSiteDef.getCourseSiteconfiguration();
LanguageConfiguration langConfig = courseSiteDef.getLanguageConfiguration(ureq, config);
if (langConfig == null)
continue;
String softKey = langConfig.getRepoSoftKey();
if (re.getSoftkey() != null && re.getSoftkey().equals(softKey)) {
return courseSiteDef;
}
}
}
return null;
}
use of org.olat.core.gui.control.navigation.SiteDefinition in project openolat by klemens.
the class AuthBFWCParts method getSiteInstances.
/**
* @see org.olat.core.commons.fullWebApp.BaseFullWebappControllerParts#getSiteInstances(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
*/
@Override
public List<SiteInstance> getSiteInstances(UserRequest ureq, WindowControl wControl) {
SiteDefinitions sitedefs = CoreSpringFactory.getImpl(SiteDefinitions.class);
List<SiteInstance> sites = new ArrayList<SiteInstance>();
for (SiteDefinition sitedef : sitedefs.getSiteDefList()) {
SiteInstance site = sitedef.createSite(ureq, wControl);
if (site != null) {
// site == null means that site is not visible to the current user
sites.add(site);
}
}
return sites;
}
Aggregations