Package org.apache.stanbol.commons.viewable

Examples of org.apache.stanbol.commons.viewable.Viewable


          rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
          addCORSOrigin(servletContext, rb, headers);
          return rb.build();
     
    }
       ResponseBuilder rb = Response.ok(new Viewable("service", this));
         rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
         addCORSOrigin(servletContext, rb, headers);
         return rb.build();
    }
View Full Code Here


    private Response build(Object object){
        if (isHTML()) {
            OutputStream out = stream(object);
           
            ResponseBuilder rb = Response.ok(
                   new Viewable("result",
                       new ReasoningPrettyResultResource(
                           context, info, out)
                       )
                    );
           
View Full Code Here

        if (isHTML()) {
            if (isConsistent) {
                log.debug("The input is consistent");
               
                ResponseBuilder rb = Response.ok(
                    new Viewable("result",
                        new ReasoningPrettyResultResource(
                            context, info, "The input is consistent :)")
                        )
                     );
            
                rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
                addCORSOrigin(context, rb, headers);
                return rb.build();
            
               /*return Response.ok(
                        new Viewable("result",
                                new ReasoningPrettyResultResource(
                                        context, info,
                                        "The input is consistent :)")),
                        TEXT_HTML).build();*/
            } else {
                log.debug("The input is not consistent");
                ResponseBuilder rb = Response.status(Status.CONFLICT);
                rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
                addCORSOrigin(context, rb, headers);
                rb.entity(new Viewable("result", new ReasoningPrettyResultResource(context, info,
                        "The input is NOT consistent :(")));
                return rb.build();
               
                /*return Response
                        .status(Status.CONFLICT)
View Full Code Here

        URI location = URI.create(getPublicBaseUri() + "jobs/" + jid);
        this.jobLocation = location.toString();
        /**
         * If everything went well, we return 201 Created We include the header Location: with the Job URL
         */
        Viewable view = new Viewable("created", this);
        return Response.created(location).entity(view).build();
    }
View Full Code Here

    private Response processRealTimeRequest() {
        // If all parameters are missing we produce the service/task welcome
        // page
        if (this.parameters.isEmpty()) {
            // return Response.ok(new Viewable("index", this)).build();
            ResponseBuilder rb = Response.ok(new Viewable("index", this));
            rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
            addCORSOrigin(servletContext, rb, headers);
            return rb.build();
        }
        try {
View Full Code Here

    }

    @GET
    @Produces(TEXT_HTML)
    public Response get(@Context HttpHeaders headers) {
        ResponseBuilder responseBuilder = Response.ok(new Viewable("index", this), TEXT_HTML);
        addCORSOrigin(servletContext, responseBuilder, headers);
        return responseBuilder.build();
    }
View Full Code Here

                ruleList.add(rule);

                recipe = new RecipeImpl(recipe.getRecipeID(), recipe.getRecipeDescription(), ruleList);
            }

            responseBuilder = Response.ok(new Viewable("rules", new RulesPrettyPrintResource(servletContext,
                    uriInfo, recipe)));

        } catch (NoSuchRecipeException e) {
            log.error(e.getMessage(), e);
            responseBuilder = Response.status(Status.NOT_FOUND);
View Full Code Here

    }

    @GET
    @Produces(TEXT_HTML)
    public Response get(@Context HttpHeaders headers) {
        ResponseBuilder rb = Response.ok(new Viewable("index", this));
        rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
        addCORSOrigin(servletContext, rb, headers);
        return rb.build();
    }
View Full Code Here

    }

    @GET
    @Produces(TEXT_HTML)
    public Response get(@Context HttpHeaders headers) {
        ResponseBuilder rb = Response.ok(new Viewable("index", this));
        rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
        addCORSOrigin(servletContext, rb, headers);
        return rb.build();
    }
View Full Code Here

    }

    @GET
    @Produces(TEXT_HTML)
    public Response get(@Context HttpHeaders headers) {
        ResponseBuilder res = Response.ok(new Viewable("index", this, AbstractEnhancerUiResource.class), TEXT_HTML);
        addCORSOrigin(servletContext, res, headers);
        return res.build();
    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.commons.viewable.Viewable

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.