Search in sources :

Example 11 with LinkVO

use of org.olat.restapi.support.vo.LinkVO in project OpenOLAT by OpenOLAT.

the class CatalogVOFactory method link.

public static CatalogEntryVO link(CatalogEntryVO entryVo, UriInfo uriInfo) {
    if (uriInfo != null) {
        UriBuilder baseUriBuilder = uriInfo.getBaseUriBuilder();
        URI getUri = baseUriBuilder.path("catalog").path(entryVo.getKey().toString()).build();
        entryVo.getLink().add(new LinkVO("self", getUri.toString(), ""));
        entryVo.getLink().add(new LinkVO("jumpin", Settings.getServerContextPathURI() + "/url/CatalogEntry/" + entryVo.getKey(), ""));
        entryVo.getLink().add(new LinkVO("edit", getUri.toString(), ""));
        entryVo.getLink().add(new LinkVO("delete", getUri.toString(), ""));
        URI childrenUri = baseUriBuilder.path("catalog").path(entryVo.getKey().toString()).path("children").build();
        entryVo.getLink().add(new LinkVO("children", childrenUri.toString(), ""));
    }
    return entryVo;
}
Also used : LinkVO(org.olat.restapi.support.vo.LinkVO) UriBuilder(javax.ws.rs.core.UriBuilder) URI(java.net.URI)

Example 12 with LinkVO

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

the class CatalogVOFactory method link.

public static CatalogEntryVO link(CatalogEntryVO entryVo, UriInfo uriInfo) {
    if (uriInfo != null) {
        UriBuilder baseUriBuilder = uriInfo.getBaseUriBuilder();
        URI getUri = baseUriBuilder.path("catalog").path(entryVo.getKey().toString()).build();
        entryVo.getLink().add(new LinkVO("self", getUri.toString(), ""));
        entryVo.getLink().add(new LinkVO("jumpin", Settings.getServerContextPathURI() + "/url/CatalogEntry/" + entryVo.getKey(), ""));
        entryVo.getLink().add(new LinkVO("edit", getUri.toString(), ""));
        entryVo.getLink().add(new LinkVO("delete", getUri.toString(), ""));
        URI childrenUri = baseUriBuilder.path("catalog").path(entryVo.getKey().toString()).path("children").build();
        entryVo.getLink().add(new LinkVO("children", childrenUri.toString(), ""));
    }
    return entryVo;
}
Also used : LinkVO(org.olat.restapi.support.vo.LinkVO) UriBuilder(javax.ws.rs.core.UriBuilder) URI(java.net.URI)

Aggregations

LinkVO (org.olat.restapi.support.vo.LinkVO)12 URI (java.net.URI)8 InputStream (java.io.InputStream)6 UriBuilder (javax.ws.rs.core.UriBuilder)6 HttpResponse (org.apache.http.HttpResponse)6 HttpGet (org.apache.http.client.methods.HttpGet)6 Test (org.junit.Test)6 VFSContainer (org.olat.core.util.vfs.VFSContainer)6 RepositoryEntry (org.olat.repository.RepositoryEntry)6 Date (java.util.Date)4 PathSegment (javax.ws.rs.core.PathSegment)4 Response (javax.ws.rs.core.Response)4 VFSItem (org.olat.core.util.vfs.VFSItem)4 VFSLeaf (org.olat.core.util.vfs.VFSLeaf)4 SystemItemFilter (org.olat.core.util.vfs.filters.SystemItemFilter)4 Identity (org.olat.core.id.Identity)2 ReadOnlyCallback (org.olat.core.util.vfs.callbacks.ReadOnlyCallback)2 ICourse (org.olat.course.ICourse)2 CourseConfig (org.olat.course.config.CourseConfig)2 RepositoryService (org.olat.repository.RepositoryService)2