Package org.cedj.geekseek.web.rest.core

Examples of org.cedj.geekseek.web.rest.core.ResourceLink


    public List<ResourceLink> getLinks() {
        List<ResourceLink> links = super.getLinks();
        if (getUriInfo() != null) {
            if(doesNotContainRel("self") && id != null) {
                links.add(
                    new ResourceLink(
                        "self",
                        getUriInfo().getBaseUriBuilder().clone()
                            .path(AttachmentResource.class)
                            .segment("{id}")
                            .build(id),
View Full Code Here


    public Response listAllResources() {

        RootRepresentation root = new RootRepresentation(REP_TYPE, uriInfo);
        for (TopLevelResource resource : resources) {
            root.addLink(
                    new ResourceLink(
                            toResourceName(resource.getResourceClass()),
                            uriInfo.getAbsolutePathBuilder().path(resource.getResourceClass()).build(),
                            resource.getResourceMediaType()));
        }
View Full Code Here

        URI uri = builder.path(BookmarkResource.class)
            .path(getResourceTypeName(source))
            .path(id)
            .build();

        return new ResourceLink("bookmark", uri, source.getResourceMediaType());
    }
View Full Code Here

                                            target.getSource().getType(),
                                            getTypeName(target.getTargetModel()));

            // TODO: Dynamically lookup MediaType
            representation.addLink(
                new ResourceLink(
                    target.getSource().getName(),
                    buidler.build(),
                    RelationResource.BASE_JSON_MEDIA_TYPE + "; type=" + getMediaTypeName(target.getTargetModel())));
        }
    }
View Full Code Here

        Warp.initiate(new Activity() {
            @Override
            public void perform() {
                given().
                    contentType(BASE_JSON_MEDIA_TYPE).
                    body(new ResourceLink("test", URI.create("http://test.org/api/test/" + TARGET_ID + "/"))).
                then().
                    contentType(BASE_JSON_MEDIA_TYPE).
                    statusCode(Status.OK.getStatusCode()).
                when().
                    patch(baseURL + "api/rel/{sourceObj}/{source}/{rel}/{targetObj}/",
View Full Code Here

    @Test @InSequence(3)
    public void shouldBeAbleToRemoveRelation() throws Exception {
        given().
            contentType(BASE_JSON_MEDIA_TYPE).
            body(new ResourceLink("test", URI.create("http://test.org/api/test/" + TARGET_ID + "/"))).
        then().
            statusCode(Status.NO_CONTENT.getStatusCode()).
        when().
            delete(baseURL + "api/rel/{sourceObj}/{source}/{rel}/{targetObj}/",
                "sourceobject", SOURCE_ID, type, "targetobject");
View Full Code Here

    public List<ResourceLink> getLinks() {
        List<ResourceLink> links = super.getLinks();
        if (getUriInfo() != null) {
            if(doesNotContainRel("self") && handle != null) {
                links.add(
                    new ResourceLink(
                        "self",
                        getUriInfo().getBaseUriBuilder().clone()
                            .path(UserResource.class)
                            .segment("{id}")
                            .build(handle),
View Full Code Here

    public List<ResourceLink> getLinks() {
        List<ResourceLink> links = super.getLinks();
        if (getUriInfo() != null) {
            if(doesNotContainRel("self") && id != null) {
                links.add(
                    new ResourceLink(
                        "self",
                        getUriInfo().getBaseUriBuilder().clone()
                            .path(ConferenceResource.class)
                            .segment("{id}")
                            .build(id)));
            }
            if(doesNotContainRel("session")) {
                links.add(
                    new ResourceLink(
                        "session",
                        getUriInfo().getAbsolutePathBuilder().clone()
                            .path("session")
                            .build()));
            }
View Full Code Here

    public List<ResourceLink> getLinks() {
        List<ResourceLink> links = super.getLinks();
        if (getUriInfo() != null) {
            if(doesNotContainRel("self") && id != null) {
                links.add(
                    new ResourceLink(
                        "self",
                        getUriInfo().getBaseUriBuilder()
                        .path(SessionResource.class)
                        .segment("{id}")
                        .build(id),
                        SessionResource.SESSION_XML_MEDIA_TYPE));
            }
            if(doesNotContainRel("parent") && parentId != null) {
                links.add(
                    new ResourceLink(
                        "parent",
                        getUriInfo().getBaseUriBuilder()
                        .path(ConferenceResource.class)
                        .segment("{id}")
                        .build(parentId),
View Full Code Here

TOP

Related Classes of org.cedj.geekseek.web.rest.core.ResourceLink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.