Skip to content
Snippets Groups Projects
Commit 02ec8b4c authored by srosse's avatar srosse
Browse files

FXOLAT-296: some enhancements ofr OMA, group infos, display name for course

parent 0731cc5d
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
package org.olat.restapi.group; package org.olat.restapi.group;
import static org.olat.restapi.security.RestSecurityHelper.isGroupManager; import static org.olat.restapi.security.RestSecurityHelper.isGroupManager;
import static org.olat.restapi.support.ObjectFactory.getInformation;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
...@@ -70,7 +71,6 @@ import org.olat.group.BusinessGroupManagerImpl; ...@@ -70,7 +71,6 @@ import org.olat.group.BusinessGroupManagerImpl;
import org.olat.group.properties.BusinessGroupPropertyManager; import org.olat.group.properties.BusinessGroupPropertyManager;
import org.olat.group.ui.BGConfigFlags; import org.olat.group.ui.BGConfigFlags;
import org.olat.modules.fo.Forum; import org.olat.modules.fo.Forum;
import org.olat.modules.fo.ForumManager;
import org.olat.modules.fo.restapi.ForumWebService; import org.olat.modules.fo.restapi.ForumWebService;
import org.olat.restapi.security.RestSecurityHelper; import org.olat.restapi.security.RestSecurityHelper;
import org.olat.restapi.support.ObjectFactory; import org.olat.restapi.support.ObjectFactory;
...@@ -285,29 +285,7 @@ public class LearningGroupWebService { ...@@ -285,29 +285,7 @@ public class LearningGroupWebService {
} }
} }
GroupInfoVO info = new GroupInfoVO(); GroupInfoVO info = getInformation(bg);
//forum
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(bg);
if(collabTools.isToolEnabled(CollaborationTools.TOOL_FORUM)) {
info.setForumKey(collabTools.getForum().getKey());
}
String news = collabTools.lookupNews();
info.setNews(news);
if (collabTools.isToolEnabled(CollaborationTools.TOOL_WIKI)) {
info.setHasWiki(Boolean.TRUE);
} else {
info.setHasWiki(Boolean.FALSE);
}
if (collabTools.isToolEnabled(CollaborationTools.TOOL_FOLDER)) {
info.setHasFolder(Boolean.TRUE);
} else {
info.setHasFolder(Boolean.FALSE);
}
return Response.ok(info).build(); return Response.ok(info).build();
} }
......
...@@ -122,6 +122,7 @@ public class ObjectFactory { ...@@ -122,6 +122,7 @@ public class ObjectFactory {
public static CourseVO get(RepositoryEntry re, ICourse course) { public static CourseVO get(RepositoryEntry re, ICourse course) {
CourseVO vo = new CourseVO(); CourseVO vo = new CourseVO();
vo.setKey(course.getResourceableId()); vo.setKey(course.getResourceableId());
vo.setDisplayName(re.getDisplayname());
vo.setTitle(course.getCourseTitle()); vo.setTitle(course.getCourseTitle());
vo.setEditorRootNodeId(course.getEditorTreeModel().getRootNode().getIdent()); vo.setEditorRootNodeId(course.getEditorTreeModel().getRootNode().getIdent());
vo.setSoftKey(re.getSoftkey()); vo.setSoftKey(re.getSoftkey());
......
...@@ -45,6 +45,7 @@ public class CourseVO { ...@@ -45,6 +45,7 @@ public class CourseVO {
private String softKey; private String softKey;
private Long repoEntryKey; private Long repoEntryKey;
private String title; private String title;
private String displayName;
private String editorRootNodeId; private String editorRootNodeId;
...@@ -87,6 +88,14 @@ public class CourseVO { ...@@ -87,6 +88,14 @@ public class CourseVO {
this.title = title; this.title = title;
} }
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getEditorRootNodeId() { public String getEditorRootNodeId() {
return editorRootNodeId; return editorRootNodeId;
} }
......
...@@ -98,6 +98,7 @@ public class Examples { ...@@ -98,6 +98,7 @@ public class Examples {
SAMPLE_KEYVALUEVOes.getPairs().add(SAMPLE_KEYVALUEVO); SAMPLE_KEYVALUEVOes.getPairs().add(SAMPLE_KEYVALUEVO);
SAMPLE_COURSEVO.setKey(777l); SAMPLE_COURSEVO.setKey(777l);
SAMPLE_COURSEVO.setDisplayName("Demo course");
SAMPLE_COURSEVO.setTitle("Demo course"); SAMPLE_COURSEVO.setTitle("Demo course");
SAMPLE_COURSEVOes.setTotalCount(0); SAMPLE_COURSEVOes.setTotalCount(0);
SAMPLE_COURSEVOes.setCourses(new CourseVO[]{SAMPLE_COURSEVO}); SAMPLE_COURSEVOes.setCourses(new CourseVO[]{SAMPLE_COURSEVO});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment