Examples of LinkRepresentation


Examples of org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation

        final DomainObjectMemberRepresentation actionRepr = repr.getAction("visibleAndInvocableAction");
        assertThat(actionRepr, isMap());

        assertThat(actionRepr.getDisabledReason(), is(nullValue()));

        final LinkRepresentation actionDetailsLink = actionRepr.getLinkWithRel(Rel.DETAILS);
        assertThat(actionDetailsLink, isLink(this.client)
                                        .rel(Rel.DETAILS)
                                        .httpMethod(RestfulHttpMethod.GET)
                                        .href(Matchers.endsWith(":39393/services/BusinessRulesEntities/actions/visibleAndInvocableAction"))
                                        .returning(HttpStatusCode.OK).build());
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation

        final DomainObjectMemberRepresentation actionRepr = repr.getAction("visibleButNotInvocableAction");
        assertThat(actionRepr, isMap());

        assertThat(actionRepr.getDisabledReason(), is("Always disabled"));

        final LinkRepresentation actionDetailsLink = actionRepr.getLinkWithRel(Rel.DETAILS);

        // even though not invocable, still can traverse to its details page
        assertThat(actionDetailsLink, isLink(this.client)
                                        .href(Matchers.endsWith(":39393/services/BusinessRulesEntities/actions/visibleButNotInvocableAction"))
                                        .returning(HttpStatusCode.OK).build());
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation

        // given
        final Response actionPromptResp = domainObjectResource.actionPrompt("RTNE", "78", "contains");
        final RestfulResponse<ObjectActionRepresentation> actionPromptJsonResp = RestfulResponse.ofT(actionPromptResp);
        final ObjectActionRepresentation actionPromptRepr = actionPromptJsonResp.getEntity();
        final LinkRepresentation selfLink = actionPromptRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation deleteLink = selfLink.withMethod(RestfulHttpMethod.DELETE);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);

        // then
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation

        // given
        final Response actionPromptResp = domainObjectResource.actionPrompt("RTNE", "78", "contains");
        final RestfulResponse<ObjectActionRepresentation> actionPromptJsonResp = RestfulResponse.ofT(actionPromptResp);
        final ObjectActionRepresentation actionPromptRepr = actionPromptJsonResp.getEntity();
        final LinkRepresentation selfLink = actionPromptRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation deleteLink = selfLink.withMethod(RestfulHttpMethod.PUT);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);

        // then
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation

        // given
        final Response actionPromptResp = serviceResource.actionPrompt("ActionsEntities", "subListWithOptionalRange");
        final RestfulResponse<ObjectActionRepresentation> actionPromptJsonResp = RestfulResponse.ofT(actionPromptResp);
        final ObjectActionRepresentation actionPromptRepr = actionPromptJsonResp.getEntity();
        final LinkRepresentation selfLink = actionPromptRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation deleteLink = selfLink.withMethod(RestfulHttpMethod.DELETE);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);

        // then
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation

        // given
        final Response actionPromptResp = serviceResource.actionPrompt("ActionsEntities", "subListWithOptionalRange");
        final RestfulResponse<ObjectActionRepresentation> actionPromptJsonResp = RestfulResponse.ofT(actionPromptResp);
        final ObjectActionRepresentation actionPromptRepr = actionPromptJsonResp.getEntity();
        final LinkRepresentation selfLink = actionPromptRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation postLink = selfLink.withMethod(RestfulHttpMethod.PUT);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(postLink);

        // then
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation

        // given
        final Response serviceResp = domainServiceResource.service("ActionsEntities");
        final RestfulResponse<DomainObjectRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
        final DomainObjectRepresentation serviceRepr = serviceJsonResp.getEntity();
        final LinkRepresentation upLink = serviceRepr.getLinkWithRel(Rel.UP);
        final LinkRepresentation deleteLink = upLink.withMethod(RestfulHttpMethod.DELETE);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);

        // then
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation

        // given
        final Response serviceResp = homePageResource.homePage();
        final RestfulResponse<HomePageRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
        final HomePageRepresentation serviceRepr = serviceJsonResp.getEntity();
        final LinkRepresentation selfLink = serviceRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation deleteLink = selfLink.withMethod(RestfulHttpMethod.DELETE);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);

        // then
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation

        // given
        final Response serviceResp = domainServiceResource.service("ActionsEntities");
        final RestfulResponse<DomainObjectRepresentation> serviceJsonResp = RestfulResponse.ofT(serviceResp);
        final DomainObjectRepresentation serviceRepr = serviceJsonResp.getEntity();
        final LinkRepresentation selfLink = serviceRepr.getLinkWithRel(Rel.SELF);
        final LinkRepresentation deleteLink = selfLink.withMethod(RestfulHttpMethod.DELETE);

        // when
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);

        // then
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.LinkRepresentation

    @Test
    public void followLink() throws Exception {

        // when
        final LinkRepresentation link = Util.serviceActionListInvokeFirstReference(client, "PrimitiveValuedEntities");
        final LinkRepresentation deleteLink = link.withMethod(RestfulHttpMethod.POST);
        final RestfulResponse<JsonRepresentation> restfulResponse = client.follow(deleteLink);

        assertThat(restfulResponse.getStatus(), is(RestfulResponse.HttpStatusCode.METHOD_NOT_ALLOWED));
        assertThat(restfulResponse.getHeader(RestfulResponse.Header.WARNING), is("Posting to object resource is not allowed."));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.