@Path(value="/") @Consumes(value={"application/json","application/text","text/html","application/x-www-form-urlencoded"}) @Produces(value="application/json;charset=utf-8") @Secured(value={"ROLE_USER","ROLE_ADMIN"}) public class ProductQueryService extends SiteAuthorizableSecurableService implements IQueryService<Product>, CacheLookups
Product
DatabaseModifier and Type | Field and Description |
---|---|
protected ProductDao<Product> |
dao |
protected org.apache.commons.collections.Transformer |
productTransformer
A
Transformer that accepts a Product and can return a any Object back. |
protected ProductService<Product> |
service |
audit, 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 |
---|
ProductQueryService() |
ProductQueryService(boolean checkAuthFiltered) |
Modifier and Type | Method and Description |
---|---|
String |
clearCache()
Clear all the
Product cache |
Long |
count(Query<Product> query) |
List |
getParents(Long id) |
org.apache.commons.collections.Transformer |
getProductTransformer() |
ProductService<Product> |
getService() |
String |
index()
Re-Index all the
Product data |
Product |
load(Long id) |
List |
loadByFieldName(String fieldNameValJSON) |
Product |
loadByName(String name) |
List |
productsInSetOfIds(String idsStr) |
List |
query(Query<Product> query) |
Object |
query(String contextNameId,
String queryNameId,
String json)
|
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 |
setProductTransformer(org.apache.commons.collections.Transformer productTransformer) |
void |
setService(ProductService<Product> service) |
adminCheck, getAuthorizableIdAssignable, getAuthorizableService, getAuthorizationModule, getCurrentUserAuths, getModuleName, getUser, getUserAuths, isAdmin, isUser, setAuthorizationModule
filter, getAuthorizableId, getAuthorizations, setAuthorizableId, setAuthorizations
checkAuthFilterInvoked, query
filter, getCacheDef, getTestString, query
protected transient ProductService<Product> service
protected transient ProductDao<Product> dao
protected transient org.apache.commons.collections.Transformer productTransformer
Transformer
that accepts a Product
and can return a any Object back.
and applies a filter one last time before its sent out.
public ProductQueryService()
public ProductQueryService(boolean checkAuthFiltered)
@POST @Path(value="queryListSize") @Produces(value="text/plain") public Long count(@FormParam(value="query") Query<Product> query) throws Exception
count
in interface IQueryService<Product>
Exception
@POST @Path(value="queryList") public List query(@FormParam(value="query") Query<Product> query) throws Exception
query
in interface IQueryService<Product>
Exception
@GET @Path(value="load/{id}") @Consumes(value="text/plain") public Product load(@PathParam(value="id") Long id) throws Exception
load
in interface IQueryService<Product>
Exception
@GET @Path(value="loadByName/{name}") @Consumes(value="text/plain") public Product loadByName(@PathParam(value="name") String name) throws Exception
Exception
@GET @Path(value="loadByFieldName") @Consumes(value="application/json") public List loadByFieldName(@QueryParam(value="fieldNameValJSON") String fieldNameValJSON) throws Exception
Exception
@GET @Path(value="parents/{id}") @Consumes(value="text/plain") public List getParents(@PathParam(value="id") Long id) throws Exception
Exception
@GET @Path(value="loadSet") @Consumes(value="text/plain") public List productsInSetOfIds(@QueryParam(value="ids") String idsStr) 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
@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
{"intra_intersect":false,"inter_intersect":true,"numericRangeQueryFields":["inventory","cost"],"sortParams":[],"terms":["super","excited"],"termsForFields":{"inventory":["200","600"],"cost":["35.5D","85.4D"]}} {"intra_intersect":false,"inter_intersect":true,"numericRangeQueryFields":["regularPrice","currentInventory"],"sortParams":[],"terms":["red"],"termsForFields":{"regularPrice":["1100","1400"]."currentInventory":["15","40"]}}
@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
{"intra_intersect":false,"inter_intersect":true,"numericRangeQueryFields":["inventory","cost"],"sortParams":[],"terms":["super","excited"],"termsForFields":{"inventory":["200","600"],"cost":["35.5D","85.4D"]}} {"intra_intersect":false,"inter_intersect":true,"numericRangeQueryFields":["regularPrice","currentInventory"],"sortParams":[],"terms":["red"],"termsForFields":{"regularPrice":["1100","1400"]."currentInventory":["15","40"]}}
@GET @Path(value="admin/index") public String index() throws Exception
Product
dataException
@GET @Path(value="admin/clearcache") public String clearCache() throws Exception
Product
cacheException
public ProductService<Product> getService()
public void setService(ProductService<Product> service)
public org.apache.commons.collections.Transformer getProductTransformer()
public void setProductTransformer(org.apache.commons.collections.Transformer productTransformer)
Copyright © 2018. All rights reserved.