How to work with map property in RQL (Oracle's ATG Web Commerce) - repository

We use Oracle's ATG Web Commerce for our project. And currently we need construct RQL query which obtain products which SKU's tacticalTradeStatuses contains certain status and ordered by status value.
I briefly describe the relationship between entities: Product item descriptor contains list of SKUs. Each SKU contains map tacticalTradeStatuses (key - tactical trade status, value - sequense)
For example, how to obtain all products which SKU's tacticalTradeStatuses property contains key 'BEST_SELLER' and ordered by value associated with key 'BEST_SELLER'.
Key by which we want to select products we want to pass as RQL parameter.

i have two ways to doing that
1) first create a query which fetches all the product based on map key BEST_SELLER
2) Now pass it to foreach droplet and add sort properties. which help to sort the result based on your requirements
for sorting please refer to below link
http://docs.oracle.com/cd/E23095_01/Platform.93/PageDevGuide/html/s1316foreach01.html
2 way i think is to use query options in RQLStatement.. which work same as sort properties in for each
If you provide some XML Repository structure that will be good..hope it will help you

Related

Entity joining in xml

I have run into a little roadblock in regards to joining mantle entities. I would like to have a single depicting fields from two mantle entities, but am unsuccessful in joining them. Specifically, I have linked a list of party relationships (as contacts) to a single partyId (vendor), with the goal to make a vendor contacts page. However I am unable to link that form-list with the PartyContactMech and ContactMech entities (in order to display email and phone number in the same form-list). More generally, my question is how can one map lists to each other the same way one can map a list to a single object (using entity-find-one and value-field does not work when tried with entity-find)?
There is no need to make a view-entity (join entities) to do that. Simply do a query on the PartyRelationship entity in the main 'actions' part of your screen specifying the toParty (vendor). Then in your Form-List, use 'row-actions' to query the PartyContactMech and so on for each fromPartyId (contact) entry that the previous query returned. Also have a look at the PartyViewEntities file in Mantle USL. There are some helpful view-enties already defined for you there such as PartyToAndRelationship, PartyFromAndRelationship etc. Also note that entity-find-one returns a single "map" (value-field) as it queries on the PK. Whereas entity-find returns a list of maps (list). They are separate query types. If I understand your question correctly.

SOLR: populate with data from children

I have Products in my SOLR index. I need to create calculated fields for each product. These fields are based on product's children.
Is it possible to create such calculated fields?
For example, I have a Product with id 1, I need to add all the Detail entities, which have "parentId" field value 1. Here is a brief schema: https://www.screencast.com/t/EkNG8NpFp.
I need to have values "v1", "v3" from the example above.
not sure what you exactly mean by "create such calculated fields"...
if you mean if you can query for Products and then for example get the average of field 'value'. Yes you can do stuff like that, look at json facets and how you can use children docs.
if you mean how you can add some new field to your Product doc, based on the values of the children docs, then you can probably do it with Streaming Expressions. You need to use the current collection as a source, and compute the new fields, and finally add the new docs (including the new field) into a new collection

Searching products using details.name and details.value using the Best Buy API

The Best Buy Search allows to search products specifying a criterion on details.name and details.value fields.
http://api.remix.bestbuy.com/v1/products(details.name="Processor Speed" & details.value="2.4Ghz")?apiKey=YOURKEY
However details is a collection. The query above actually returns all products has a detail entry named "processor" and a detail entry whose value is "2.4Ghz" but not necessarily in the same details entry. Is there a way to create a query that will return only products for which those value and name are for the same details entry ?
Unfortunately there is no way to do this unless the particular detail you are interested in has been exposed as a top level attribute (processor speed has not). To accomplish this you will need to run your query as you have described, and then comb through the results and remove the irrelevant products in your own code.

When relating 3 entities in CRM 2011 using Advanced Find only 2 entities show up in edit columns

I'm trying to create a view in CRM 2011 that will show a few columns from Customers (Account), Orders (SalesOrder), and Order Products (SalesOrderDetail). I already know I need to start at the child-most entity so under Advanced Find I select "Order Products" under Look for. When I do this I'm able to select columns from Orders but unable to select columns from Customers.
Is this even possible to accomplish in CRM?
I'm trying to create the following result set:
Account.Name,
Account.Email,
SalesOrder.OrderNumber,
SalesOrderDetail.NetAmount,
SalesOrderDetail.ShipDate
I verified that you cannot manually add a second link within a view query. To my knowledge it is also not possible to add these columns though javascript. You can get the account name in your view simply by using the account lookup on the Order. If you need for the account email to also be in the view, then I suggest you add this field to the order entity and populate it with post callout logic on the account.
I Second Zach’s idea, but suggest adding a direct relationship between customer and orderdetail . This way you can use fetchxml to show account.email or any other account.* for that matter.
The downside is you’ll need to sync order.customer changes to orderdetail.customer.
The better option is to simply create a report and show that in an iframe or a webresource.
This is not possible even if we edit the fetch xml it wont work

How do I filter/sort a sequenced document that belongs in multiple categories in Solr without grouping?

I'm looking for some help and wisdom on how to properly design the schema for indexing documents for my situation. Basically I have products which can belong in multiple categories. Within those categories these products may or may not be sequenced. Ideally I'd like to keep just one unique document per product.
I'm using Solr 3.4.0 and currently have documents with this structure:
{
productId : "1",
sku : "ABC123",
productName : "My Product",
categorySequence : ["123-1", "456-7", "789-noseq", "000-noseq"],
description : "Product description",
rating: "4.36"
}
The categorySequence is where I'm having trouble. It's a multi value field which contains strings that are formatted with the category id and the sequence of my product within that category id separated by a dash. In cases where the product is not sequenced in the category I've arbitrarily appended "noseq".
Since my product can exist in multiple categories, I do a filter query on the categorySequence field like this:
fq=categorySequence:123-*
which is working for me to bring back only products which are in the category with the id "123".
However my problem now as I have discovered is that you can't sort on multi value fields. I initially was hoping this would be a quick way to sort the filtered products in the appropriate sequence.
I've seen some other suggestions on here regarding grouping and having multiple documents for the same product. However my products can exist in lots of categories and as you can imagine would create a lot of documents.
I'm hoping to stick with a single document representing a single product. Can someone help point me in the right direction? I guess I'm basically looking at doing a filter and a sort on a two dimensional field?
Faced an similar issue, and here is what we implemented -
Create dynamic field for each product involving the product id and the sort sequence.
Field -
<dynamicField name="*_sort_seq" type="string" indexed="true" stored="false" sortMissingLast="true"/>
data fed to Solr -
123_sort_seq=1
456_sort_seq=7
Do not need to store ones without any sort sequence. The positions of these can be handled with sortMissingLast & sortMissingFirst attributes.
These fields will maintain the position/sequence of products for the categories.
As you know the category id you can easily filter and sort for products.
fq=categorySequence:123-*&sort=123_sort_seq asc
Won't need to maintain multiple copies of the products.