on 02-25-2016 2:33 PM - last edited on 02-04-2024 3:12 AM by postmig_api_4
Hi,
I want to import ProductFeature in hybris using datahub. I want to know, do I need to explicitly define 'isoCode' in Raw, and model it accordingly in canonical and target? Also, while passing 'value' in hybris(ie in impex), what would the transformation expression be? I made a small implementation and while the impex runs successfully, no data is entered into the hybris database, and sometimes even if it does, it does not reflect in hMC. I am using CSV import method, and running datahub v5.5.1.0-RC9
Any pointers will be appreciated.
Regards, Nikhil
The first step for all Data Hub integration is to define the canonical model.
The canonical item attribute needs <localizable>true</localizable>
.
The second step is the raw model.
At this step you either use the predefined isoCode column or you will have to write your own composition handler where at the end you execute CanonicalItem.setField("attributeMultiLang", "Hello", new Locale("en"));
The third step is the target model.
The target item attribute also needs <localizable>true</localizable>
. There is no transformation needed as each value in their language remain unchanged.
At this point it is important to understand the meaning of <mandatoryInHeader>true</mandatoryInHeader>
. The mandatoryInHeader shall be true for all field [unique=true]
and fields with mandatory interceptor logic. Only the field marked with mandatoryInHeader will be repeated for importing the language specific lines. Yes, the Data Hub will generate multiple impex lines for the same canonical in order to import all the languages.
Unfortunately, many customers end up defining the 2-3 languages they use as separate not localized fields. And use 2-3 fields in the target with impex exportCode [lang=XX].
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robin,
Thanks for the valuable information. So I write a localization based handler for dealing with locale as follows.
private T copy(final T item, final Locale lang, final Object collValue) { try { @SuppressWarnings("unchecked") final T copy = (T) item.clone(); Map value = new HashMap(); value.put("value", collValue); copy.setField(canonicalAttributeName, value); copy.setField("language", lang); return copy;...
Then do I need to include 'isoCode' in Raw model?
Hi, We're also trying to transfer localized fields via y2ysync and datahub (v6.6). Since we have 12 languages and ~50 attributes, defining separate, not-localized fields is absolutely no option.
For e.g. Product
we defined the name
attribute <localizable>true</localizable>
for both canonical and target models.
From the hybris source system, we export Impex columns name_de
, name_en
, name_el
, etc. But how is the "automatic" composition done on datahub-side via this isoCode
column? I went through all datahub examples hybris provides but can't find how the isoCode
field on an attribute-level is supposed to work.
So I'm repeating Nikhil's question above: "Then do I need to include 'isoCode' in Raw model?" Would be great if you could provide an example, Thank you in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Found out that the "isoCode" field cannot be applied when the data is transferred to datahub via y2ysync. It can only be used in conjunction with "The CSV Web Service Extension" https://help.hybris.com/6.6.0/hcd/9677910439ac4268ba3d515e911279b5.html (see screenshot).
For our scenario I now created separate Y2YColumnDefinitions for each localized attribute (using impex includes to not having to copy all 12 languages for each localized attribute) on the source side. In the datahub's raw definition I also needed to define the 12 languages as separate raw attributes (name_en, name_de, ..), but again with an Include mechanism (java class executed via maven within raw module, which replicates a localized attribute within raw xml to all needed languages).
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.