Examples of RepresentationType


Examples of com.sun.research.ws.wadl.RepresentationType

     * @return
     * @see com.sun.jersey.server.impl.wadl.WadlGenerator#createRequestRepresentation(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod, javax.ws.rs.core.MediaType)
     */
    public RepresentationType createRequestRepresentation( AbstractResource r,
            AbstractResourceMethod m, MediaType mediaType ) {
        final RepresentationType result = _delegate.createRequestRepresentation( r, m, mediaType );
        final RepresentationDocType requestRepresentation = _resourceDoc.getRequestRepresentation( r.getResourceClass(), m.getMethod(), result.getMediaType() );
        if ( requestRepresentation != null ) {
            result.setElement( requestRepresentation.getElement() );
            addDocForExample( result.getDoc(), requestRepresentation.getExample() );
        }
        return result;
    }
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RepresentationType

    @Override
    @GET
    @Path("/")
    @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_LIST, RestfulMediaType.APPLICATION_JSON_ERROR })
    public Response services() {
        final RepresentationType representationType = RepresentationType.LIST;
        init(representationType);

        final List<ObjectAdapter> serviceAdapters = getResourceContext().getPersistenceSession().getServices();

        final RendererFactory factory = RendererFactoryRegistry.instance.find(representationType);
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RepresentationType

        });
    }

    @Test
    public void noop() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(representationType.getMediaType()));

        instantiateResourceContext(representationType);
    }
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RepresentationType

        instantiateResourceContext(representationType);
    }

    @Test
    public void happyCase() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(representationType.getMediaType()));

        instantiateResourceContext(representationType);
    }
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RepresentationType

        instantiateResourceContext(representationType);
    }

    @Test
    public void acceptGenericAndProduceGeneric() throws Exception {
        final RepresentationType representationType = RepresentationType.GENERIC;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(MediaType.APPLICATION_JSON_TYPE));

        instantiateResourceContext(representationType);
    }
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RepresentationType

        instantiateResourceContext(representationType);
    }

    @Test
    public void acceptGenericAndProduceSpecific() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(MediaType.APPLICATION_JSON_TYPE));

        instantiateResourceContext(representationType);
    }
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RepresentationType

        instantiateResourceContext(representationType);
    }

    @Test(expected = JsonApplicationException.class)
    public void nonMatching() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(MediaType.APPLICATION_ATOM_XML_TYPE));

        instantiateResourceContext(representationType);
    }
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RepresentationType

        instantiateResourceContext(representationType);
    }

    @Test(expected = JsonApplicationException.class)
    public void nonMatchingProfile() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(RepresentationType.USER.getMediaType()));

        instantiateResourceContext(representationType);
    }
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RepresentationType

        instantiateResourceContext(representationType);
    }

    @Test(expected = JsonApplicationException.class)
    public void nonMatchingProfile_ignoreGeneric() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList(RepresentationType.USER.getMediaType(), MediaType.APPLICATION_JSON_TYPE));

        instantiateResourceContext(representationType);
    }
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.RepresentationType

        instantiateResourceContext(representationType);
    }

    @Test(expected = JsonApplicationException.class)
    public void emptyList() throws Exception {
        final RepresentationType representationType = RepresentationType.HOME_PAGE;
        givenHttpHeadersGetAcceptableMediaTypesReturns(Arrays.<MediaType> asList());

        instantiateResourceContext(representationType);
    }
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.