org.apache.stanbol.contenthub.web.resources
Class FeaturedSearchResource

java.lang.Object
  extended by org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
      extended by org.apache.stanbol.contenthub.web.resources.FeaturedSearchResource

public class FeaturedSearchResource
extends BaseStanbolResource

This class is the web resource which provides RESTful and HTTP interfaces for FeaturedSearch services.

Author:
anil.sinaci, suat

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
BaseStanbolResource.MenuItem
 
Field Summary
 
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, uriInfo
 
Constructor Summary
FeaturedSearchResource(javax.servlet.ServletContext context, java.lang.String indexName)
           
 
Method Summary
 javax.ws.rs.core.Response get(java.lang.String queryTerm, java.lang.String solrQuery, java.lang.String jsonCons, java.lang.String graphURI, int offset, int limit, java.lang.String fromStore, javax.ws.rs.core.HttpHeaders headers)
          HTTP GET method to make a featured search over Contenthub.
 java.lang.String getChosenFacets()
           
 java.lang.Object getDocuments()
           
 java.lang.String getIndexName()
           
 java.lang.Object getMoreRecentItems()
           
 int getOffset()
           
 java.lang.Object getOlderItems()
           
 java.lang.Object getOntologies()
           
 int getPageSize()
           
 java.lang.Object getQueryTerm()
           
 java.lang.Object getSearchResults()
           
 javax.ws.rs.core.Response handleCorsPreflight(javax.ws.rs.core.HttpHeaders headers)
           
 
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
 

Constructor Detail

FeaturedSearchResource

public FeaturedSearchResource(@Context
                              javax.servlet.ServletContext context,
                              java.lang.String indexName)
                       throws java.io.IOException,
                              org.osgi.framework.InvalidSyntaxException
Parameters:
context -
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
Throws:
java.io.IOException
org.osgi.framework.InvalidSyntaxException
Method Detail

handleCorsPreflight

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

get

public final javax.ws.rs.core.Response get(java.lang.String queryTerm,
                                           java.lang.String solrQuery,
                                           java.lang.String jsonCons,
                                           java.lang.String graphURI,
                                           int offset,
                                           int limit,
                                           java.lang.String fromStore,
                                           @Context
                                           javax.ws.rs.core.HttpHeaders headers)
                                    throws java.lang.IllegalArgumentException,
                                           SearchException,
                                           java.lang.InstantiationException,
                                           java.lang.IllegalAccessException,
                                           org.apache.solr.client.solrj.SolrServerException,
                                           java.io.IOException
HTTP GET method to make a featured search over Contenthub.

Parameters:
queryTerm - A keyword a statement or a set of keywords which can be regarded as the query term.
solrQuery - Solr query string. This is the string format which is accepted by a Solr server. For example, q="john doe"&fl=score is a valid value for this parameter. If this parameter exists, search is performed based on this solrQuery and any queryTerms are neglected.
jsonCons - Constrainst in JSON format. These constraints are tranformed to corresponding Solr queries to enable faceted search. Each constraint is a facet field and values of the constraints maps to the values of the facet fields in Solr queries.
graphURI - URI of the ontology in which related keywords will be searched by RelatedKeywordSearchManager.getRelatedKeywordsFromOntology(String, String)
offset - The offset of the document from which the resultant documents will start as the search result. offset and limit parameters can be used to make a pagination mechanism for search results.
limit - Maximum number of resultant documents to be returned as the search result. offset and limit parameters can be used to make a pagination mechanism for search results.
fromStore - Special parameter for HTML view only.
headers - HTTP headers
Returns:
HTML view or JSON representation of the search results or HTTP BAD REQUEST(400)
Throws:
java.lang.IllegalArgumentException
SearchException
java.lang.InstantiationException
java.lang.IllegalAccessException
org.apache.solr.client.solrj.SolrServerException
java.io.IOException

getMoreRecentItems

public java.lang.Object getMoreRecentItems()

getOlderItems

public java.lang.Object getOlderItems()

getOffset

public int getOffset()

getPageSize

public int getPageSize()

getSearchResults

public java.lang.Object getSearchResults()

getDocuments

public java.lang.Object getDocuments()

getOntologies

public java.lang.Object getOntologies()

getQueryTerm

public java.lang.Object getQueryTerm()

getChosenFacets

public java.lang.String getChosenFacets()

getIndexName

public java.lang.String getIndexName()


Copyright © 2011-2012 The Apache Software Foundation. All Rights Reserved.