• Welcome to KonaKart Community Forum. Please login or sign up.
 

Is there possible to write dynamic query

Started by srinivasanj, October 27, 2007, 12:53:26 pm

Previous topic - Next topic

srinivasanj

Hi...
i am using konakart, i saw the features of konakart new version its nice.
i tried to search the product by attributes Is there any possible to write dynamic query.

Brian

Hi srinivasanj,

For obvious reasons you should use the API wherever you possibly can because this is the way to ensure your program will continue working in the future since future releases will always honour the APIs - except under certain extreme conditions that would be clearly documented as exceptions.

The API is quite flexible for searching for products, eg. from the javadoc of the searchForProducts call (http://www.konakart.com/javadoc/server/com/konakart/appif/KKEngIf.html#searchForProducts(java.lang.String, com.konakart.appif.DataDescriptorIf, com.konakart.appif.ProductSearchIf, int)) in the KonaKart server API:

(Note that the javadoc for KonaKart is available within every download kit for convenient local access and on our website)

ProductsIf searchForProducts(java.lang.String sessionId,
                             DataDescriptorIf dataDesc,
                             ProductSearchIf prodSearch,
                             int languageId)
                             throws com.konakart.app.KKException

Returns all products using the given language.
The ProductSearch class contains the search criteria.

Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. Also only the first two custom fields are returned (custom1 and custom2). The specialPrice is null if a special offer doesn't exist for the product.

dataDesc may be null. In this case, the number of retrieved products is limited to a default number, the products are ordered by the ProductId and the offset is set to zero. However, by setting the attributes of dataDesc, the following functionality may be controlled :

  • The maximum number of Product objects returned.

  • The offset which defaults to zero. This is useful when there are many Product objects, in order to return them using multiple calls to this method.

  • Whether or not to return invisible products.

  • Criteria on the custom attributes. If a custom attribute is set then only products with a matching custom attribute value are returned.



The Products may be sorted by :

  • Price Ascending

  • Price Descending

  • Date Added

  • Manufacturer

  • Times Viewed


Quotei tried to search the product by attributes Is there any possible to write dynamic query.

You can write whatever query you like outside the API but you do so at your own risk of it not working in the future so be prepared for that.

If you think the functionality you require is something that a wider audience might like to see supported by the KonaKart APIs you can always make a suggestion/request, however people with KonaKart support contracts always take priority :-)

Regards
Brian