Search in sources :

Example 11 with RepositoryEntryLifecycleVO

use of org.olat.restapi.support.vo.RepositoryEntryLifecycleVO in project openolat by klemens.

the class ObjectFactory method get.

public static RepositoryEntryVO get(RepositoryEntry entry) {
    RepositoryEntryVO vo = new RepositoryEntryVO();
    vo.setKey(entry.getKey());
    vo.setSoftkey(entry.getSoftkey());
    vo.setResourcename(entry.getResourcename());
    vo.setDisplayname(entry.getDisplayname());
    vo.setDescription(entry.getDescription());
    vo.setAuthors(entry.getAuthors());
    vo.setLocation(entry.getLocation());
    vo.setResourceableId(entry.getResourceableId());
    vo.setResourceableTypeName(entry.getResourceableTypeName());
    OLATResource resource = entry.getOlatResource();
    if (resource != null) {
        vo.setOlatResourceKey(resource.getKey());
        vo.setOlatResourceId(resource.getResourceableId());
        vo.setOlatResourceTypeName(resource.getResourceableTypeName());
    }
    vo.setExternalId(entry.getExternalId());
    vo.setExternalRef(entry.getExternalRef());
    vo.setManagedFlags(entry.getManagedFlagsString());
    if (entry.getLifecycle() != null) {
        vo.setLifecycle(new RepositoryEntryLifecycleVO(entry.getLifecycle()));
    }
    return vo;
}
Also used : RepositoryEntryVO(org.olat.restapi.support.vo.RepositoryEntryVO) OLATResource(org.olat.resource.OLATResource) RepositoryEntryLifecycleVO(org.olat.restapi.support.vo.RepositoryEntryLifecycleVO)

Example 12 with RepositoryEntryLifecycleVO

use of org.olat.restapi.support.vo.RepositoryEntryLifecycleVO in project openolat by klemens.

the class ObjectFactory method get.

public static CourseVO get(RepositoryEntry re, ICourse course) {
    CourseVO vo = new CourseVO();
    vo.setKey(course.getResourceableId());
    vo.setDisplayName(re.getDisplayname());
    vo.setDescription(re.getDescription());
    vo.setTitle(course.getCourseTitle());
    vo.setEditorRootNodeId(course.getEditorTreeModel().getRootNode().getIdent());
    vo.setSoftKey(re.getSoftkey());
    vo.setRepoEntryKey(re.getKey());
    OLATResource resource = re.getOlatResource();
    if (resource != null) {
        vo.setOlatResourceKey(resource.getKey());
        vo.setOlatResourceId(resource.getResourceableId());
        vo.setOlatResourceTypeName(resource.getResourceableTypeName());
    }
    vo.setAuthors(re.getAuthors());
    vo.setLocation(re.getLocation());
    vo.setExternalId(re.getExternalId());
    vo.setExternalRef(re.getExternalRef());
    vo.setManagedFlags(re.getManagedFlagsString());
    if (re.getLifecycle() != null) {
        vo.setLifecycle(new RepositoryEntryLifecycleVO(re.getLifecycle()));
    }
    return vo;
}
Also used : CourseVO(org.olat.restapi.support.vo.CourseVO) OLATResource(org.olat.resource.OLATResource) RepositoryEntryLifecycleVO(org.olat.restapi.support.vo.RepositoryEntryLifecycleVO)

Aggregations

RepositoryEntryLifecycleVO (org.olat.restapi.support.vo.RepositoryEntryLifecycleVO)12 Date (java.util.Date)6 RepositoryEntryLifecycle (org.olat.repository.model.RepositoryEntryLifecycle)6 RepositoryEntryVO (org.olat.restapi.support.vo.RepositoryEntryVO)6 URI (java.net.URI)4 Produces (javax.ws.rs.Produces)4 HttpResponse (org.apache.http.HttpResponse)4 Test (org.junit.Test)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 RepositoryEntryLifecycleDAO (org.olat.repository.manager.RepositoryEntryLifecycleDAO)4 OLATResource (org.olat.resource.OLATResource)4 InputStream (java.io.InputStream)2 ArrayList (java.util.ArrayList)2 Calendar (java.util.Calendar)2 Consumes (javax.ws.rs.Consumes)2 GET (javax.ws.rs.GET)2 POST (javax.ws.rs.POST)2 HttpGet (org.apache.http.client.methods.HttpGet)2 HttpPost (org.apache.http.client.methods.HttpPost)2 Roles (org.olat.core.id.Roles)2