-
1. Re: How to create range dimensions in ATG 11.1
Daciano Apr 13, 2017 1:31 PM (in response to .omi)Hi, I see two possibilities,
First, use the current format that you are indexing, make the range filter with Navigation Query,
for example: ?Nf=product.hours|BTWN+1+5
Second: index a new dimension by grouping the range values.
If you need help creating this new dimension you can return.
I hope I have helped
-
2. Re: How to create range dimensions in ATG 11.1
.omi Apr 13, 2017 1:39 PM (in response to Daciano)Thanks for replying.
Even though the first option seems acceptable, I will need help implementing the second one.
Can you provide some more details?
-
3. Re: How to create range dimensions in ATG 11.1
Daciano Apr 13, 2017 2:05 PM (in response to .omi)1 person found this helpfulOf course .omi, I'll try to explain.
You will have to index a new dimension (product.hours_range), and add in the property-accessor=/Atg/commerce/endeca/index/accessor/ActivePriceAccessor.
After that you will have to work on the native component of DCS PriceDimensionValueExporter.properties, this component is responsible for the automatic range, in it will have all range settings, such as defaultFacetDefinitionRangeTiersString, where it defines the result: 0-1, 1-2, 2- 3, 3-4.
You will have to add this component in productCatalogOutputConfig, below a documentation link, I believe it can help you.
Oracle Commerce Platform - Price Range Refinements Configuration
Any doubt returns. I hope I have helped.
-
4. Re: How to create range dimensions in ATG 11.1
.omi Apr 13, 2017 2:33 PM (in response to Daciano)I'm not seeing the PriceDimensionValueExporter.properties in my instance but I'm assuming I can just add it in /atg/commerce/endeca/index/ path of my app.
Are you recommending that I use the existing settings and override the dimension name (dimensionName=product.price_range) with my product.hours_range or create a new PriceDimensionValueExporter.properties file and my custom dimension there?
Thanks
-
5. Re: How to create range dimensions in ATG 11.1
Daciano Apr 13, 2017 8:04 PM (in response to .omi)Good afternoon,
yes, you can add PriceDimensionValueExporter.properties
and override them as properties according to your implementation.
-
6. Re: How to create range dimensions in ATG 11.1
RJ Nunes Apr 13, 2017 8:56 PM (in response to .omi)1 person found this helpfulHi .omi,
Just an ideia.
Using Property Accessors https://docs.oracle.com/cd/E41069_01/Platform.11-0/ATGEndecaIntegrationGuide/html/s0502usingpropertyaccessors01.html
<property name="hours" is-non-repository-property="true" text-searchable="false" type="set" is-dimension="true" multiselect-type="multi-or" property-accessor="/com/accessors/HourRangeAccessor"/>
Your .properties file: /com/accessors/HourRangeAccessor
$class=com.accessors.HourRangeAccessor
Your HourRangeAccessor class extends PropertyAccessorImpl
@Override public Object getTextOrMetaPropertyValue(Context pContext, RepositoryItem pItem, String pPropertyName, PropertyTypeEnum pType) { Set<String> hourRanges = new HashSet<>(); Double hour = (Double) pItem.getPropertyValue("hour"); if (hour != null) { if (hour > 0D && hour < 3D) { hourRanges.add("1 - 2"); } else if (hour >= 3D && hour < 6D) { hourRanges.add("3 - 5"); } else { hourRanges.add("6 - to infinity and beyond"); } return hourRanges; } return null; }
-
7. Re: How to create range dimensions in ATG 11.1
.omi Apr 13, 2017 10:15 PM (in response to RJ Nunes)I'm also looking into this.
Does PropertyTypeEnum belong to atg.repository.search.indexing.specifier?
So basically,
- A custom processor (Hours Processor) used in the PSOC.
- Create the HoursDimensionValueExporter properties file dimensionName, sourceOutputPropertyNames etc.just like what's here Oracle Commerce Platform - Price Range Refinements Configuration
- Add HoursDimensionValueExporter to the ProductCatalogSimpleIndexingAdmin.properties and SchemaExporter.properties
- Update the index-config.json file
Do you think I'm missing anything?
Regards,
omi
ProductCatalogSimpleIndexingAdmin.properties
-
8. Re: How to create range dimensions in ATG 11.1
RJ Nunes Apr 17, 2017 1:25 PM (in response to .omi)Hi .omi
Yes, PropertyTypeEnum belong to atg.repository.search.indexing.specifier.
What you really need may be simpler.
- A custom processor (Hours Processor) used in the PSOC.
- Update the index-config.json file
- Not necessary create a HoursDimensionValueExporter, because who will generate the range is your custom accessor (getTextOrMetaPropertyValue method in the HourRangeAccessor class extending PropertyAccessorImpl), otherwise you would need the exporter to generate ranges automatically, but as I said, your method will make the range.
Regards,
Nunes
-
9. Re: How to create range dimensions in ATG 11.1
.omi Apr 17, 2017 8:08 PM (in response to RJ Nunes)Neither approach is working for me.
Custom Property Accessor I
- Updated PSOC (tried with both type=set and float)
<property name=hours_range" output-name="product.credit_hours" is-dimension="true" autogen-dimension-values="false" text-searchable="false" type="set"
is-non-repository-property="true" multiselect-type="multi-or" property-accessor="/atg/commerce/endeca/index/accessor/HoursPropertyAccessor" />
- Included HoursPropertyAccessor.properties with $class=atg.repository.search.indexing.accessor.HoursPropertyAccessor
- Added class that with the method getTextOrMetaPropertyValue
- Updated the index...json file
- The range dimension/values doesn't exist
Custom Property Accessor II
- Updated PSOC (tried with both type=set and float)
<property name=hours" output-name="product.credit_hours" is-dimension="true" autogen-dimension-values="false" text-searchable="false" type="set"
is-non-repository-property="true" multiselect-type="multi-or" property-accessor="/atg/commerce/endeca/index/accessor/HoursPropertyAccessor" />
- Included HoursPropertyAccessor.properties with $class=atg.repository.search.indexing.accessor.HoursPropertyAccessor
- Added class that with the method getTextOrMetaPropertyValue
- Updated the index...json file
- The range dimension/values doesn't exist
My index...json contains
"hours_range" : {
"multiSelectType" : "OR",
"jcr:primaryType" : "endeca:dimension",
"rangeComparisonType" : "FLOAT",
"sourcePropertyNames" : [ "product.hours" ]
}
PriceDimensionValueExporter I
- Used the same settings Daciano mentioned earlier
- Updated dimensionName=hours_range
- Updated useCurrencyNumberFormat=false
This works for the most part. I have both hours (flat) and hours_range dimensions. The only problem is that I'm overriding the Price range configs.
Concern: What happens to price if I decided to use it in the guided navigation as a range dimension.
PriceDimensionValueExporter II
- Used the same settings Daciano mentioned earlier
- For every price related file and config option I created a "hours" one. Example PriceDimensionValueExporter.properties => HoursDimensionValueExporter.properties,
This doesn't work because I think I need to create a DynamicPriceValueSynchronization for hours but this seems like I'm going down a rabbit hole. If a future release requires a new range dimension, I'd have to a those 3-5 files.
-
10. Re: How to create range dimensions in ATG 11.1
RJ Nunes Apr 17, 2017 9:29 PM (in response to .omi)1 person found this helpfulLooking for the first method: Custom Property Accessor I
Please ensure, that the value in accessor class is correct.
If the property hours is a attribute of product.
Then in PSOC file :
<item item-descriptor-name="product">
<properties>
<property name=hours_range" output-name="product.credit_hours" is-non-repository-property="true" text-searchable="false" type="set" is-dimension="true" multiselect-type="multi-or" property-accessor="/com/accessors/HourRangeAccessor"/>
The "hours" property must be exactly the product in the customCatalog.xml (Mapping file of catalog properties), because you use the getPropertyValue.
customCatalog.xml:
<item-descriptor name="product"
<table name=" ................
<property name="hour" data-type="double" column-name="hour" display-name-resource="product.hour" category="categoryInfo">
Accessor Class:
Double hour = (Double) pItem.getPropertyValue("hour");
Are these values correct?
-
11. Re: How to create range dimensions in ATG 11.1
.omi Apr 17, 2017 10:20 PM (in response to RJ Nunes)The PSOC looks like what you have, while the customCatalog.xml is:
<table name=" ................
<property name="hours" data-type="double" column-name="course_hours" display-name-resource="hours" category="categoryInfo">
-
12. Re: How to create range dimensions in ATG 11.1
RJ Nunes Apr 18, 2017 8:50 PM (in response to .omi)Weird, I implemented something similar and it worked.
Something is missing...
Custom Property Accessor I
In your HourRangeAccessor class, put a debug:
@Override public Object getTextOrMetaPropertyValue(Context pContext, RepositoryItem pItem, String pPropertyName, PropertyTypeEnum pType) { logDebug("Id " + pItem.getRepositoryId()); logDebug("Hour " + pItem.getPropertyValue("hour")); ................
Run a baseline index in the ProductCatalogSimpleIndexingAdmin.
What do we have in the debug?