List<GenericValue> catMembs = delegator.findByAnd("ProductCategoryMember", UtilMisc.toMap(
"productCategoryId", categoryId,
"productId", productId));
catMembs = EntityUtil.filterByDate(catMembs);
if (catMembs.size() == 0) {
delegator.create("ProductCategoryMember",
UtilMisc.toMap("productCategoryId", categoryId, "productId", productId, "fromDate", fromDate));
}
} catch (GenericEntityException e) {
String errMsg = "Error adding to category: " + e.toString();
request.setAttribute("_ERROR_MESSAGE_", errMsg);