org.apache.stanbol.entityhub.jersey.resource
Class ReferencedSiteRootResource

java.lang.Object
  extended by org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
      extended by org.apache.stanbol.entityhub.jersey.resource.ReferencedSiteRootResource

public class ReferencedSiteRootResource
extends org.apache.stanbol.commons.web.base.resource.BaseStanbolResource

Resource to provide a REST API for the SiteManager

TODO: add description


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
org.apache.stanbol.commons.web.base.resource.BaseStanbolResource.MenuItem
 
Field Summary
static String LICENSE_PATH
          The relative path used to publish the license.
static Set<String> RDF_MEDIA_TYPES
           
 
Fields inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
LINK_RESOURCES, NAVIGATION_LINKS, ROOT_URL, SCRIPT_RESOURCES, servletContext, STATIC_RESOURCES_ROOT_URL, SYSTEM_CONSOLE, uriInfo
 
Constructor Summary
ReferencedSiteRootResource(String siteId, javax.servlet.ServletContext servletContext)
           
 
Method Summary
 javax.ws.rs.core.Response createEntity(String id, boolean allowUpdate, Map<String,org.apache.stanbol.entityhub.servicesapi.model.Representation> parsed, javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response deleteEntity(String id, javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response findEntity(String name, String parsedField, String language, Integer limit, Integer offset, String ldpath, javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response findEntitybyGet(String name, String field, String language, int limit, int offset, String ldpath, javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response getEntityById(String id, javax.ws.rs.core.HttpHeaders headers)
          Cool URI handler for Signs.
 javax.ws.rs.core.Response getHtmlInfo(javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response getInfo(javax.ws.rs.core.HttpHeaders headers, javax.ws.rs.core.UriInfo uriInfo)
          Provides metadata about this referenced site as representation
 javax.ws.rs.core.Response getLicenseInfo(javax.ws.rs.core.HttpHeaders headers, javax.ws.rs.core.UriInfo uriInfo, String name)
           
 javax.ws.rs.core.Response getQueryDocumentation(javax.ws.rs.core.HttpHeaders headers)
           
 org.apache.stanbol.entityhub.servicesapi.site.Site getSite()
           
 javax.ws.rs.core.Response handleCorsPreflight(javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response handleCorsPreflightEntity(javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response handleCorsPreflightFind(javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response handleCorsPreflightLDPath(javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response handleCorsPreflightQuery(javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response handleLDPathGet(Set<String> contexts, String ldpath, javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response handleLDPathPost(Set<String> contexts, String ldpath, javax.ws.rs.core.HttpHeaders headers)
           
 boolean isManagedSite()
           
 javax.ws.rs.core.Response queryEntities(org.apache.stanbol.entityhub.servicesapi.query.FieldQuery query, javax.ws.rs.core.HttpHeaders headers)
          Allows to parse any kind of FieldQuery in its JSON Representation.
 javax.ws.rs.core.Response updateEntity(String id, boolean allowCreate, Map<String,org.apache.stanbol.entityhub.servicesapi.model.Representation> parsed, javax.ws.rs.core.HttpHeaders headers)
           
 
Methods inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
getConsoleBaseUri, getMainMenuItems, getNavigationLinks, getPublicBaseUri, getRegisteredLinkResources, getRegisteredScriptResources, getRequestUri, getRootUrl, getStaticRootUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RDF_MEDIA_TYPES

public static final Set<String> RDF_MEDIA_TYPES

LICENSE_PATH

public static final String LICENSE_PATH
The relative path used to publish the license.

See Also:
Constant Field Values
Constructor Detail

ReferencedSiteRootResource

public ReferencedSiteRootResource(String siteId,
                                  @Context
                                  javax.servlet.ServletContext servletContext)
Method Detail

handleCorsPreflight

public javax.ws.rs.core.Response handleCorsPreflight(@Context
                                                     javax.ws.rs.core.HttpHeaders headers)

getHtmlInfo

public javax.ws.rs.core.Response getHtmlInfo(@Context
                                             javax.ws.rs.core.HttpHeaders headers)

getInfo

public javax.ws.rs.core.Response getInfo(@Context
                                         javax.ws.rs.core.HttpHeaders headers,
                                         @Context
                                         javax.ws.rs.core.UriInfo uriInfo)
Provides metadata about this referenced site as representation

Parameters:
headers - the request headers used to get the requested MediaType
uriInfo - used to get the URI of the current request
Returns:
the response

getLicenseInfo

public javax.ws.rs.core.Response getLicenseInfo(@Context
                                                javax.ws.rs.core.HttpHeaders headers,
                                                @Context
                                                javax.ws.rs.core.UriInfo uriInfo,
                                                String name)

handleCorsPreflightEntity

public javax.ws.rs.core.Response handleCorsPreflightEntity(@Context
                                                           javax.ws.rs.core.HttpHeaders headers)

getEntityById

public javax.ws.rs.core.Response getEntityById(String id,
                                               @Context
                                               javax.ws.rs.core.HttpHeaders headers)
Cool URI handler for Signs.

Parameters:
id - The id of the entity (required)
headers - the request headers used to get the requested MediaType
Returns:
a redirection to either a browser view, the RDF meta data or the raw binary content

createEntity

public javax.ws.rs.core.Response createEntity(String id,
                                              boolean allowUpdate,
                                              Map<String,org.apache.stanbol.entityhub.servicesapi.model.Representation> parsed,
                                              @Context
                                              javax.ws.rs.core.HttpHeaders headers)

updateEntity

public javax.ws.rs.core.Response updateEntity(String id,
                                              boolean allowCreate,
                                              Map<String,org.apache.stanbol.entityhub.servicesapi.model.Representation> parsed,
                                              @Context
                                              javax.ws.rs.core.HttpHeaders headers)

deleteEntity

public javax.ws.rs.core.Response deleteEntity(String id,
                                              @Context
                                              javax.ws.rs.core.HttpHeaders headers)

handleCorsPreflightFind

public javax.ws.rs.core.Response handleCorsPreflightFind(@Context
                                                         javax.ws.rs.core.HttpHeaders headers)

findEntitybyGet

public javax.ws.rs.core.Response findEntitybyGet(String name,
                                                 String field,
                                                 String language,
                                                 int limit,
                                                 int offset,
                                                 String ldpath,
                                                 @Context
                                                 javax.ws.rs.core.HttpHeaders headers)

findEntity

public javax.ws.rs.core.Response findEntity(String name,
                                            String parsedField,
                                            String language,
                                            Integer limit,
                                            Integer offset,
                                            String ldpath,
                                            @Context
                                            javax.ws.rs.core.HttpHeaders headers)

handleCorsPreflightQuery

public javax.ws.rs.core.Response handleCorsPreflightQuery(@Context
                                                          javax.ws.rs.core.HttpHeaders headers)

queryEntities

public javax.ws.rs.core.Response queryEntities(org.apache.stanbol.entityhub.servicesapi.query.FieldQuery query,
                                               @Context
                                               javax.ws.rs.core.HttpHeaders headers)
Allows to parse any kind of FieldQuery in its JSON Representation. Note that the maximum number of results (limit) and the offset of the

TODO: as soon as the entityhub supports multiple query types this need to be refactored. The idea is that this dynamically detects query types and than redirects them to the referenced site implementation.

Parameters:
query - The field query as parsed by FieldQueryReader
headers - the header information of the request
Returns:
the results of the query

getQueryDocumentation

public javax.ws.rs.core.Response getQueryDocumentation(@Context
                                                       javax.ws.rs.core.HttpHeaders headers)

handleCorsPreflightLDPath

public javax.ws.rs.core.Response handleCorsPreflightLDPath(@Context
                                                           javax.ws.rs.core.HttpHeaders headers)

handleLDPathGet

public javax.ws.rs.core.Response handleLDPathGet(Set<String> contexts,
                                                 String ldpath,
                                                 @Context
                                                 javax.ws.rs.core.HttpHeaders headers)

handleLDPathPost

public javax.ws.rs.core.Response handleLDPathPost(Set<String> contexts,
                                                  String ldpath,
                                                  @Context
                                                  javax.ws.rs.core.HttpHeaders headers)

isManagedSite

public boolean isManagedSite()

getSite

public org.apache.stanbol.entityhub.servicesapi.site.Site getSite()


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.