Package org.apache.stanbol.entityhub.servicesapi.site

Examples of org.apache.stanbol.entityhub.servicesapi.site.ReferencedSiteManager


   
    public ReferencedSiteRootResource(@PathParam(value = "site") String siteId,
                                      @Context ServletContext servletContext) {
        super();
        log.info("<init> with site {}", siteId);
        ReferencedSiteManager referencedSiteManager = ContextHelper.getServiceFromContext(
            ReferencedSiteManager.class, servletContext);
        if (siteId == null || siteId.isEmpty()) {
            log.error("Missing path parameter site={}", siteId);
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
        site = referencedSiteManager.getReferencedSite(siteId);
        if (site == null) {
            log.error("Site {} not found (no referenced site with that ID is present within the Entityhub",
                siteId);
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
View Full Code Here


            ResponseBuilder rb =  Response.ok(new Viewable("referenced", this));
            rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML+"; charset=utf-8");
            addCORSOrigin(servletContext, rb, headers);
            return rb.build();
        } else {
            ReferencedSiteManager referencedSiteManager = ContextHelper.getServiceFromContext(
                ReferencedSiteManager.class, servletContext);
            JSONArray referencedSites = new JSONArray();
            for (String site : referencedSiteManager.getReferencedSiteIds()) {
                referencedSites.put(String.format("%sentityhub/site/%s/", uriInfo.getBaseUri(), site));
            }
            ResponseBuilder rb =  Response.ok(referencedSites);
            rb.header(HttpHeaders.CONTENT_TYPE, acceptable+"; charset=utf-8");
            addCORSOrigin(servletContext, rb, headers);
View Full Code Here

                return Response.status(Status.BAD_REQUEST)
                    .entity("No or empty ID was parsed. Missing parameter id.\n")
                    .header(HttpHeaders.ACCEPT, acceptedMediaType).build();
            }
        }
        ReferencedSiteManager referencedSiteManager = ContextHelper.getServiceFromContext(
            ReferencedSiteManager.class, servletContext);
        Entity sign = referencedSiteManager.getEntity(id);
        if (sign != null) {
            ResponseBuilder rb = Response.ok(sign);
            rb.header(HttpHeaders.CONTENT_TYPE, acceptedMediaType+"; charset=utf-8");
            addCORSOrigin(servletContext, rb, headers);
            return rb.build();
View Full Code Here

    @Path("/ldpath")
    public Response handleLDPathPost(
             @FormParam(value = "context")Set<String> contexts,
             @FormParam(value = "ldpath")String ldpath,
             @Context HttpHeaders headers){
        ReferencedSiteManager referencedSiteManager = ContextHelper.getServiceFromContext(
            ReferencedSiteManager.class, servletContext);
        return handleLDPathRequest(this,new SiteManagerBackend(referencedSiteManager),
            ldpath, contexts, headers, servletContext);
    }
View Full Code Here

   
    public ReferencedSiteRootResource(@PathParam(value = "site") String siteId,
                                      @Context ServletContext servletContext) {
        super();
        log.info("<init> with site {}", siteId);
        ReferencedSiteManager referencedSiteManager = ContextHelper.getServiceFromContext(
            ReferencedSiteManager.class, servletContext);
        if (siteId == null || siteId.isEmpty()) {
            log.error("Missing path parameter site={}", siteId);
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
        site = referencedSiteManager.getReferencedSite(siteId);
        if (site == null) {
            log.error("Site {} not found (no referenced site with that ID is present within the Entityhub",
                siteId);
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.servicesapi.site.ReferencedSiteManager

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.