@Path(value="/") @Consumes(value={"application/json","application/x-www-form-urlencoded"}) @Produces(value="application/json;charset=utf-8") @Secured(value={"ROLE_USER","ROLE_ADMIN"}) public class ContentQueryService<C extends Content<CA,CF>,CA extends AbstractContentAttribute,CF extends AbstractContentFacet> extends SiteAuthorizableSecurableService implements IQueryService<C>, CacheLookups
ContentDescriber
DatabaseModifier and Type | Field and Description |
---|---|
protected org.apache.commons.collections.Transformer |
contentTransformer
A
Transformer that accepts a AbstractContentFacet and can return a any Object back. |
authorizationModule
applicationContext, CACHE, NO_CACHE, request, response
CONTENT_PUBLISH_CACHE_NAME, PRODUCT_LOOKUP_CACHE_NAME, PRODUCT_SEARCH_CACHE_NAME, TEMPLATEPAGE_MAPPING_CACHE_NAME
Constructor and Description |
---|
ContentQueryService() |
ContentQueryService(boolean checkAuthFiltered) |
Modifier and Type | Method and Description |
---|---|
String |
clearCache()
Clear all the
ContentDescriber cache |
String |
clearTemplates()
Clear all the
ContentDescriber cache |
Long |
count(Query<C> query) |
org.apache.commons.collections.Transformer |
getContentTransformer() |
GenericContentService |
getService() |
String |
getURL(String name,
Locale l) |
Map<String,String> |
getURLs(Collection<String> names,
Locale l) |
protected User |
getUser(javax.servlet.http.HttpServletRequest request)
Get
User for the current HttpServletRequest |
String |
index()
Re-Index all the
Product data |
C |
load(Long id) |
List<CF> |
loadFacetArray(Long contentId,
String facetName,
Collection<Integer> indeces) |
Collection<CF> |
loadFacets(Long contentId,
Collection<String> names)
Fetch
ContentFacet for specific types |
List<C> |
loadHierarchy(String name,
Locale l) |
List<C> |
query(Query<C> query) |
Object |
query(String contextNameId,
String queryNameId,
String json)
|
Object |
querySpringBean(String contextNameId,
String beanClassName,
String accessor) |
List |
search(com.neurosys.spider.domain.SearchParams searchParams,
PageInfo pageInfo,
String categoryName,
String indexName,
Boolean useCache)
Do a Search using the Indexing API on terms
Sample: SearchParams |
int |
searchCount(com.neurosys.spider.domain.SearchParams searchParams,
String categoryName,
String indexName,
Boolean useCache)
Search Count
Sample: SearchParams |
void |
setContentTransformer(org.apache.commons.collections.Transformer contentTransformer) |
void |
setService(GenericContentService service) |
adminCheck, getAuthorizableIdAssignable, getAuthorizableService, getAuthorizationModule, getCurrentUserAuths, getModuleName, getUserAuths, isAdmin, isUser, setAuthorizationModule
filter, getAuthorizableId, getAuthorizations, setAuthorizableId, setAuthorizations
checkAuthFilterInvoked, query
filter, getCacheDef, getTestString, query
protected transient org.apache.commons.collections.Transformer contentTransformer
Transformer
that accepts a AbstractContentFacet
and can return a any Object back.
and applies a filter one last time before its sent out.
public ContentQueryService()
public ContentQueryService(boolean checkAuthFiltered)
protected User getUser(javax.servlet.http.HttpServletRequest request)
AuthorizableSecurableService
User
for the current HttpServletRequest
getUser
in class SiteAuthorizableSecurableService
request
- as HttpServletRequest
User
@POST @Path(value="queryListSize") @Produces(value="text/plain") public Long count(@FormParam(value="query") Query<C> query) throws Exception
@POST @Path(value="queryList") public List<C> query(@FormParam(value="query") Query<C> query) throws Exception
@GET @Path(value="load/{id}") @Consumes(value={"text/plain","application/x-www-form-urlencoded"}) public C load(@PathParam(value="id") Long id) throws Exception
@GET @Path(value="loadHierarchy/{name}") @Consumes(value={"text/plain","application/x-www-form-urlencoded"}) public List<C> loadHierarchy(@PathParam(value="name") String name, @QueryParam(value="locale") Locale l) throws Exception
Exception
@GET @Path(value="url/{name}") @Consumes(value={"text/plain","application/x-www-form-urlencoded"}) public String getURL(@PathParam(value="name") String name, @QueryParam(value="locale") Locale l) throws Exception
Exception
@GET @Path(value="urls") @Consumes(value={"text/plain","application/x-www-form-urlencoded"}) public Map<String,String> getURLs(@QueryParam(value="names") Collection<String> names, @QueryParam(value="locale") Locale l) throws Exception
Exception
@GET @Path(value="loadFacets") @Consumes(value={"text/plain","application/x-www-form-urlencoded"}) public Collection<CF> loadFacets(@QueryParam(value="contentId") Long contentId, @QueryParam(value="facetNames") Collection<String> names) throws Exception
ContentFacet
for specific typescontentId
- as String for Contentnames
- as List of names @nullable trueContentFacet
Exception
@GET @Path(value="loadFacetArray") @Consumes(value={"text/plain","application/x-www-form-urlencoded"}) public List<CF> loadFacetArray(@QueryParam(value="contentId") Long contentId, @QueryParam(value="facetName") String facetName, Collection<Integer> indeces) throws Exception
Exception
@GET @Path(value="namedQuery/{contextNameId}/{queryNameId}") @Produces(value="application/json") public Object query(@PathParam(value="contextNameId") String contextNameId, @PathParam(value="queryNameId") String queryNameId, @QueryParam(value="p") String json) throws Exception
contextNameId
- as String; a classification for the manner in which the Query is called. Can allow for better and custom security or context or SEO related aspects.queryNameId
- as String (should match a Spring Transformer bean id that accepts an Object array as params)p
- as JSON Array String @nullable trueException
@GET @Path(value="admin/query/{contextNameId}/{beanClassName}/{accessor}") @Produces(value="application/json") public Object querySpringBean(@PathParam(value="contextNameId") String contextNameId, @PathParam(value="beanClassName") String beanClassName, @PathParam(value="accessor") String accessor) throws Exception
Exception
@POST @Path(value="search") public List search(@FormParam(value="searchParams") com.neurosys.spider.domain.SearchParams searchParams, @FormParam(value="pageInfo") PageInfo pageInfo, @FormParam(value="categoryName") String categoryName, @FormParam(value="indexName") String indexName, @FormParam(value="useCache") Boolean useCache) throws Exception
SearchParams
TODO: Provide Same & @Description on Param JSON Format
@POST @Path(value="searchCount") public int searchCount(@FormParam(value="searchParams") com.neurosys.spider.domain.SearchParams searchParams, @FormParam(value="categoryName") String categoryName, @FormParam(value="indexName") String indexName, @FormParam(value="useCache") Boolean useCache) throws Exception
SearchParams
TODO: Provide Same & @Description on Param JSON Format
Exception
@GET @Path(value="admin/index") public String index() throws Exception
Product
dataException
@GET @Path(value="admin/clearcache") public String clearCache() throws Exception
ContentDescriber
cacheException
@GET @Path(value="admin/cleartemplates") public String clearTemplates() throws Exception
ContentDescriber
cacheException
public GenericContentService getService()
public void setService(GenericContentService service)
public org.apache.commons.collections.Transformer getContentTransformer()
public void setContentTransformer(org.apache.commons.collections.Transformer contentTransformer)
Copyright © 2018. All rights reserved.