|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.stanbol.commons.web.base.resource.BaseStanbolResource
org.apache.stanbol.contenthub.web.resources.StoreResource
public class StoreResource
Resource to provide a CRU[D] REST API for content items and there related enhancements.
Creation is achieved using either POST requests on the root of the store or as PUT requests on the expected content item URI.
Retrieval is achieved using simple GET requests on the content item or enhancement public URIs.
Update is achieved by issue a PUT request on an existing content item public URI.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource |
|---|
BaseStanbolResource.MenuItem |
| Field Summary | |
|---|---|
static java.util.Set<java.lang.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 |
| Constructor Summary | |
|---|---|
StoreResource(javax.servlet.ServletContext context,
javax.ws.rs.core.UriInfo uriInfo,
java.lang.String indexName)
|
|
| Method Summary | |
|---|---|
javax.ws.rs.core.Response |
createContentItem(byte[] data,
javax.ws.rs.core.HttpHeaders headers)
HTTP POST method to create a content item in Contenthub. |
javax.ws.rs.core.Response |
createContentItemFromForm(java.io.File file,
com.sun.jersey.core.header.FormDataContentDisposition disposition,
com.sun.jersey.multipart.FormDataBodyPart body,
java.lang.String jsonCons,
java.lang.String title,
javax.ws.rs.core.HttpHeaders headers)
HTTP POST method to create a content item from file. |
javax.ws.rs.core.Response |
createContentItemFromForm(java.lang.String content,
java.lang.String url,
java.lang.String jsonCons,
java.lang.String title,
javax.ws.rs.core.HttpHeaders headers)
HTTP POST method to create a content item in Contenthub. |
javax.ws.rs.core.Response |
createContentItemWithId(java.lang.String contentURI,
byte[] data,
javax.ws.rs.core.HttpHeaders headers)
HTTP POST method to create a content item in Contenthub. |
javax.ws.rs.core.Response |
deleteContentItem(java.lang.String contentURI,
javax.ws.rs.core.HttpHeaders headers)
HTTP DELETE method to delete a content item from Contenhub. |
javax.ws.rs.core.Response |
downloadContentItem(java.lang.String type,
java.lang.String contentURI,
javax.ws.rs.core.HttpHeaders headers)
HTTP GET method specific for download operations. |
javax.ws.rs.core.Response |
editContentItem(java.lang.String contentURI,
javax.ws.rs.core.HttpHeaders headers)
This method creates the JSON string of a content item (to be edited) to display it in the HTML view. |
javax.ws.rs.core.Response |
getContent(java.lang.String contentURI,
javax.ws.rs.core.HttpHeaders headers)
Cool URI handler for the uploaded resource. |
javax.ws.rs.core.Response |
getContentItemMetaData(java.lang.String contentURI,
javax.ws.rs.core.HttpHeaders headers)
HTTP GET method to retrieve the metadata of the content item. |
ContentItemResource |
getContentItemView(java.lang.String contentURI)
|
java.lang.String |
getIndexName()
|
java.net.URI |
getMoreRecentItemsUri()
|
java.net.URI |
getOlderItemsUri()
|
javax.ws.rs.core.Response |
getRawContent(java.lang.String contentURI,
javax.ws.rs.core.HttpHeaders headers)
HTTP GET method to retrieve the raw content item. |
java.util.List<DocumentResult> |
getRecentlyEnhancedItems()
|
com.sun.jersey.api.view.Viewable |
getView(javax.servlet.ServletContext context,
int offset,
int pageSize)
|
javax.ws.rs.core.Response |
handleCorsPreflight(javax.ws.rs.core.HttpHeaders headers)
|
javax.ws.rs.core.Response |
handleCorsPreflightContent(javax.ws.rs.core.HttpHeaders headers)
|
javax.ws.rs.core.Response |
handleCorsPreflightDownload(javax.ws.rs.core.HttpHeaders headers)
|
javax.ws.rs.core.Response |
handleCorsPreflightEdit(javax.ws.rs.core.HttpHeaders headers)
|
javax.ws.rs.core.Response |
handleCorsPreflightMetadata(javax.ws.rs.core.HttpHeaders headers)
|
javax.ws.rs.core.Response |
handleCorsPreflightRaw(javax.ws.rs.core.HttpHeaders headers)
|
javax.ws.rs.core.Response |
handleCorsPreflightUpdate(javax.ws.rs.core.HttpHeaders headers)
|
javax.ws.rs.core.Response |
handleCorsPreflightURI(javax.ws.rs.core.HttpHeaders headers)
|
javax.ws.rs.core.Response |
updateContentItemFromForm(java.lang.String contentURI,
java.io.File file,
com.sun.jersey.core.header.FormDataContentDisposition disposition,
com.sun.jersey.multipart.FormDataBodyPart body,
java.lang.String jsonCons,
java.lang.String title,
javax.ws.rs.core.HttpHeaders headers)
HTTP POST method to update an existing content item. |
javax.ws.rs.core.Response |
updateContentItemFromForm(java.lang.String contentURI,
java.lang.String content,
java.lang.String url,
java.lang.String jsonCons,
java.lang.String title,
javax.ws.rs.core.HttpHeaders headers)
HTTP POST method to update an existing content item. |
| Methods inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource |
|---|
getMainMenuItems, getNavigationLinks, getPublicBaseUri, getRegisteredLinkResources, getRegisteredScriptResources, getRootUrl, getStaticRootUrl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Set<java.lang.String> RDF_MEDIA_TYPES
| Constructor Detail |
|---|
public StoreResource(@Context
javax.servlet.ServletContext context,
@Context
javax.ws.rs.core.UriInfo uriInfo,
java.lang.String indexName)
context - uriInfo - indexName - Name of the LDPath program (name of the Solr core/index) to be used while storing this
content item. LDPath programs can be managed through SemanticIndexManagerResource or
SemanticIndexManager| Method Detail |
|---|
public javax.ws.rs.core.Response handleCorsPreflight(@Context
javax.ws.rs.core.HttpHeaders headers)
public javax.ws.rs.core.Response handleCorsPreflightContent(@Context
javax.ws.rs.core.HttpHeaders headers)
public javax.ws.rs.core.Response handleCorsPreflightDownload(@Context
javax.ws.rs.core.HttpHeaders headers)
public javax.ws.rs.core.Response handleCorsPreflightMetadata(@Context
javax.ws.rs.core.HttpHeaders headers)
public javax.ws.rs.core.Response handleCorsPreflightRaw(@Context
javax.ws.rs.core.HttpHeaders headers)
public javax.ws.rs.core.Response handleCorsPreflightEdit(@Context
javax.ws.rs.core.HttpHeaders headers)
public javax.ws.rs.core.Response handleCorsPreflightURI(@Context
javax.ws.rs.core.HttpHeaders headers)
public javax.ws.rs.core.Response handleCorsPreflightUpdate(@Context
javax.ws.rs.core.HttpHeaders headers)
public javax.ws.rs.core.Response getContent(java.lang.String contentURI,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws StoreException
contentURI - The URI of the resource in the Stanbol Contenthub storeheaders - HTTP headers
StoreException
public javax.ws.rs.core.Response downloadContentItem(java.lang.String type,
java.lang.String contentURI,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws java.io.IOException,
StoreException
type - Type can be "metadata" or "raw". Based on the type, related parts of the
content item will be prepared for download.contentURI - URI of the resource in the Stanbol Contenthub store
java.io.IOException
StoreException
public javax.ws.rs.core.Response getContentItemMetaData(java.lang.String contentURI,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws java.io.IOException,
StoreException
contentURI - URI id of the resource in the Stanbol Contenthub store
java.io.IOException
StoreException
public javax.ws.rs.core.Response getRawContent(java.lang.String contentURI,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws java.io.IOException,
StoreException
contentURI - URI of the resource in the Stanbol Contenthub store
java.io.IOException
StoreException
public javax.ws.rs.core.Response editContentItem(java.lang.String contentURI,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws StoreException
contentURI - URI id of the resource in the Stanbol Contenthub store
SolrContentItem
StoreException
public javax.ws.rs.core.Response createContentItem(byte[] data,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws java.net.URISyntaxException,
EngineException,
StoreException
data - Raw data of the content itemheaders - HTTP Headers
java.net.URISyntaxException
EngineException
StoreException
public javax.ws.rs.core.Response createContentItemWithId(java.lang.String contentURI,
byte[] data,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws java.net.URISyntaxException,
EngineException,
StoreException
contentURI - URI for the content item. If not supplied, Contenthub automatically assigns a unique ID
(uri) to the content item.data - Raw data of the content itemheaders - HTTP headers
java.net.URISyntaxException
EngineException
StoreException
public javax.ws.rs.core.Response createContentItemFromForm(java.lang.String content,
java.lang.String url,
java.lang.String jsonCons,
java.lang.String title,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws java.net.URISyntaxException,
EngineException,
java.net.MalformedURLException,
java.io.IOException,
StoreException
content - Actual content in text format. If this parameter is supplied, url is ommitted.url - URL where the actual content resides. If this parameter is supplied (and content is
null, then the content is retrieved from this url.jsonCons - Constraints in JSON format. Constraints are used to add supplementary metadata to the
content item. For example, author of the content item may be supplied as {author:
"John Doe"}. Then, this constraint is added to the Solr and will be indexed if the
corresponding Solr schema includes the author field. Solr indexed can be created/adjusted
through LDPath programs.title - The title for the content item. Titles can be used to present summary of the actual content.
For example, search results are presented by showing the titles of resultant content items.headers - HTTP headers (optional)
java.net.URISyntaxException
EngineException
java.net.MalformedURLException
java.io.IOException
StoreException
public javax.ws.rs.core.Response createContentItemFromForm(java.io.File file,
com.sun.jersey.core.header.FormDataContentDisposition disposition,
com.sun.jersey.multipart.FormDataBodyPart body,
java.lang.String jsonCons,
java.lang.String title,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws java.net.URISyntaxException,
EngineException,
java.net.MalformedURLException,
java.io.IOException,
StoreException
file - File which contains the content for the content item.disposition - Additional information about the file parameterjsonCons - Constraints in JSON format. Constraints are used to add supplementary metadata to the
content item. For example, author of the content item may be supplied as {author:
"John Doe"}. Then, this constraint is added to the Solr and will be indexed if the
corresponding Solr schema includes the author field. Solr indexed can be created/adjusted
through LDPath programs.title - The title for the content item. Titles can be used to present summary of the actual content.
For example, search results are presented by showing the titles of resultant content items.headers - HTTP headers (optional)
java.net.URISyntaxException
EngineException
java.net.MalformedURLException
java.io.IOException
StoreException
public javax.ws.rs.core.Response updateContentItemFromForm(java.lang.String contentURI,
java.lang.String content,
java.lang.String url,
java.lang.String jsonCons,
java.lang.String title,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws java.net.URISyntaxException,
EngineException,
java.net.MalformedURLException,
java.io.IOException,
StoreException
contentURI - URI of the content item to be updated.content - Actual content in text format. If this parameter is supplied, url is ommitted.url - URL where the actual content resides. If this parameter is supplied (and content is
null, then the content is retrieved from this url.jsonCons - Constraints in JSON format. Constraints are used to add supplementary metadata to the
content item. For example, author of the content item may be supplied as {author:
"John Doe"}. Then, this constraint is added to the Solr and will be indexed if the
corresponding Solr schema includes the author field. Solr indexed can be created/adjusted
through LDPath programs.title - The title for the content item. Titles can be used to present summary of the actual content.
For example, search results are presented by showing the titles of resultant content items.headers - HTTP headers (optional)
java.net.URISyntaxException
EngineException
java.net.MalformedURLException
java.io.IOException
StoreException
public javax.ws.rs.core.Response updateContentItemFromForm(java.lang.String contentURI,
java.io.File file,
com.sun.jersey.core.header.FormDataContentDisposition disposition,
com.sun.jersey.multipart.FormDataBodyPart body,
java.lang.String jsonCons,
java.lang.String title,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws java.net.URISyntaxException,
EngineException,
java.net.MalformedURLException,
java.io.IOException,
StoreException
contentURI - URI of the content item to be updated.file - File which contains the content for the content item.disposition - Additional information about the file parameterjsonCons - Constraints in JSON format. Constraints are used to add supplementary metadata to the
content item. For example, author of the content item may be supplied as {author:
"John Doe"}. Then, this constraint is added to the Solr and will be indexed if the
corresponding Solr schema includes the author field. Solr indexed can be created/adjusted
through LDPath programs.title - The title for the content item. Titles can be used to present summary of the actual content.
For example, search results are presented by showing the titles of resultant content items.headers - HTTP headers (optional)
java.net.URISyntaxException
EngineException
java.net.MalformedURLException
java.io.IOException
StoreException
public javax.ws.rs.core.Response deleteContentItem(java.lang.String contentURI,
@Context
javax.ws.rs.core.HttpHeaders headers)
throws StoreException
contentURI - URI of the content item to be deleted.
StoreException
public com.sun.jersey.api.view.Viewable getView(@Context
javax.servlet.ServletContext context,
int offset,
int pageSize)
throws java.lang.IllegalArgumentException,
java.io.IOException,
org.osgi.framework.InvalidSyntaxException
java.lang.IllegalArgumentException
java.io.IOException
org.osgi.framework.InvalidSyntaxException
public ContentItemResource getContentItemView(java.lang.String contentURI)
throws java.io.IOException,
StoreException
java.io.IOException
StoreException
public java.util.List<DocumentResult> getRecentlyEnhancedItems()
throws org.apache.clerezza.rdf.core.sparql.ParseException
org.apache.clerezza.rdf.core.sparql.ParseExceptionpublic java.net.URI getMoreRecentItemsUri()
public java.net.URI getOlderItemsUri()
public java.lang.String getIndexName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||