Search in sources :

Example 6 with TaskListImpl

use of org.olat.course.nodes.gta.model.TaskListImpl in project openolat by klemens.

the class GTAManagerImpl method createIfNotExists.

@Override
public TaskList createIfNotExists(RepositoryEntry entry, GTACourseNode cNode) {
    TaskList tasks = getTaskList(entry, cNode);
    if (tasks == null) {
        TaskListImpl tasksImpl = new TaskListImpl();
        Date creationDate = new Date();
        tasksImpl.setCreationDate(creationDate);
        tasksImpl.setLastModified(creationDate);
        tasksImpl.setEntry(entry);
        tasksImpl.setCourseNodeIdent(cNode.getIdent());
        dbInstance.getCurrentEntityManager().persist(tasksImpl);
        tasks = tasksImpl;
    }
    return tasks;
}
Also used : TaskList(org.olat.course.nodes.gta.TaskList) TaskListImpl(org.olat.course.nodes.gta.model.TaskListImpl) Date(java.util.Date) TaskDueDate(org.olat.course.nodes.gta.TaskDueDate) TaskRevisionDate(org.olat.course.nodes.gta.TaskRevisionDate) DueDate(org.olat.course.nodes.gta.model.DueDate)

Aggregations

TaskListImpl (org.olat.course.nodes.gta.model.TaskListImpl)6 Date (java.util.Date)4 TaskList (org.olat.course.nodes.gta.TaskList)4 Test (org.junit.Test)2 GTACourseNode (org.olat.course.nodes.GTACourseNode)2 TaskDueDate (org.olat.course.nodes.gta.TaskDueDate)2 TaskRevisionDate (org.olat.course.nodes.gta.TaskRevisionDate)2 DueDate (org.olat.course.nodes.gta.model.DueDate)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2