use of org.olat.course.site.model.CourseSiteConfiguration in project OpenOLAT by OpenOLAT.
the class SitesAdminController method doCourseSite2Settings.
private void doCourseSite2Settings(UserRequest ureq) {
if (courseSite2Ctrl == null) {
CourseSiteConfiguration siteConfiguration = sitesModule.getConfigurationCourseSite2();
if (siteConfiguration == null) {
siteConfiguration = new CourseSiteConfiguration();
}
courseSite2Ctrl = new CourseSiteAdminController(ureq, getWindowControl(), siteConfiguration);
listenTo(courseSite2Ctrl);
}
mainVC.put("segmentCmp", courseSite2Ctrl.getInitialComponent());
}
use of org.olat.course.site.model.CourseSiteConfiguration in project OpenOLAT by OpenOLAT.
the class SitesAdminController method doCourseSite1Settings.
private void doCourseSite1Settings(UserRequest ureq) {
if (courseSite1Ctrl == null) {
CourseSiteConfiguration siteConfiguration = sitesModule.getConfigurationCourseSite1();
if (siteConfiguration == null) {
siteConfiguration = new CourseSiteConfiguration();
}
courseSite1Ctrl = new CourseSiteAdminController(ureq, getWindowControl(), siteConfiguration);
listenTo(courseSite1Ctrl);
}
mainVC.put("segmentCmp", courseSite1Ctrl.getInitialComponent());
}
use of org.olat.course.site.model.CourseSiteConfiguration in project OpenOLAT by OpenOLAT.
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.course.site.model.CourseSiteConfiguration in project openolat by klemens.
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.course.site.model.CourseSiteConfiguration in project openolat by klemens.
the class CourseSiteDef method getCourseSiteconfiguration.
protected CourseSiteConfiguration getCourseSiteconfiguration() {
SiteDefinitions siteModule = CoreSpringFactory.getImpl(SiteDefinitions.class);
CourseSiteConfiguration config = siteModule.getConfigurationCourseSite1();
return config;
}
Aggregations