Excluded markets for Entries with ServiceAPI

Vote:
 

Hi,

Is there any way one could post/put the excluded markets when using the following api: http://world.episerver.com/documentation/Items/Episerver-Service-API/Catalog-subsystem-restful-operations/Catalog-entries/

I know there is a limitation for dictionary fields but surely there must be some way to achieve this without using the full catalog import api?

Thanks!

#146923
Mar 31, 2016 7:38
Vote:
 
"MetaFields": [
    {
      "Name": "_ExcludedCatalogEntryMarkets",
      "Type": "EnumMultiValue",
      "Data": [
        {
          "Language": "en",
          "Value": "DEFAULT"
        }
      ]
    }
]  
#146928
Mar 31, 2016 10:26
Vote:
 

Thanks Mark!

So if I would need to exclude multiple markets I would by your example do something like this, correct?

"MetaFields": [
    {
      "Name": "_ExcludedCatalogEntryMarkets",
      "Type": "EnumMultiValue",
      "Data": [
        {
          "Language": "en",
          "Value": "DEFAULT"
        },
        {
          "Language": "en",
          "Value": "DEFAULT2"
        }
      ]
    }
]

As we get an catalog.xml file exported from a PIM-system that's well over 2GB we have to process this file in another way so when converted to JSON it looks like the code below. Does this mean we have to transform each field to the layout you posted previously or is there another way around this?

"MetaFields":[
{
"Name":"_ExcludedCatalogEntryMarkets",
"Type":"EnumMultiValue",
"Data":[
{
"Language":"en",
"Value":"",
"Item":[
{
"Key":"ITOPA",
"Value":"ITOPA"
}
]
},
{
"Language":"en-ie",
"Value":"",
"Item":[
{
"Key":"ITOPA",
"Value":"ITOPA"
}
]
},
{
"Language":"en-gb",
"Value":"",
"Item":[
{
"Key":"ITOPA",
"Value":"ITOPA"
}
]
},
{
"Language":"en-sg",
"Value":"",
"Item":[
{
"Key":"ITOPA",
"Value":"ITOPA"
}
]
},
{
"Language":"en-us",
"Value":"",
"Item":[
{
"Key":"ITOPA",
"Value":"ITOPA"
}
]
},
{
"Language":"en-in",
"Value":"",
"Item":[
{
"Key":"ITOPA",
"Value":"ITOPA"
}
]
}
]



#146933
Edited, Mar 31, 2016 10:51
Vote:
 

Yes to the first question.

Is the catalog.xml the correct format?  You could split up the file in smaller chunks or make sure you have enough memory on the server to process the file.

#146934
Mar 31, 2016 11:01
Vote:
 

The catalog.xml should be the correct format as it's no problems to import smaller portions. If we in example export just one minor category with a few products it's imported correctly via commerce manager and the ServiceApi catalog import. 

The main issue is that the file will continue to grow and will probably (just a guesstimation) end up being well over 10gb of raw xml..
We run a nightly import of the catalog with the daily changes which keeps the size down but occasionally there will be changes to all of the items in the entire catalog if a field is added.
Today these changes needs to be handled manually.

To handle this we're looking in to the possibility of reading the catalog.xml line by line and basically convert the xml to JSON and use the ServiceAPIs restful operations and post node by node and entry by entry as this would reduce the stress on the server as well as keeping the machine size down as the amount of memory needed to process xml-files as they are processed in the PIMs connector would be ridiculous....

#146936
Mar 31, 2016 11:12
Vote:
 

Yes, I understand if the pim does not send smaller subsets of the data then it would be up to you to reduce the size.  Looking at the data in the response, it would seem the size would reduce greatly if the fields that are empty are not send to be processed.

Are all of the fields in the PIM sent over regradless if they are used on the website?

If you do process the file yourselves I would recommend not sending the empty fields.

#146937
Mar 31, 2016 11:33
Vote:
 

We need to be able to empty fields that has previously been filled with data this is why we export empty fields as well, mainly because the PIM in question does not support versioning and therefore doesn't know what fields have modified....

No, we have a subset of fields that gets exported that are used on the website.

Back to the first question, should the "Items"-field not be used but instead use multiple "Data"-attributes for the excluded markets?

#146944
Mar 31, 2016 12:49
Vote:
 

The bulk import schema is not used for the restful operations.  So any meta fields passed in must use the same format at the first example I posted as explained here

http://world.episerver.com/documentation/Items/Episerver-Service-API/Catalog-subsystem-restful-operations/Catalog-entries/#Put

#146947
Edited, Mar 31, 2016 13:32
Vote:
 

Hi Mikael

You should not repeat the Data attribute for _ExcludedCatalogEntryMarkets. If you check the Catalog UI in the CMS, you can only modify the MarketFilter in the Master Language, in other words, you should repeat item element

Below is the example, we craked yesterday, and worked very well. In our example, we disable the default market, and create an Australia market as default one. 

     <MetaField>
      <Name>_ExcludedCatalogEntryMarkets</Name>
      <Type>EnumMultiValue</Type>
      <Data language="en-Au">
        <!-- Value is the market ID -->
        <Item value="NZ" />
       <Item value="UK" />
        <Item value="INTL" />
        ......
      </Data>
    </MetaField>x

 

#146967
Apr 01, 2016 1:19
Vote:
 

To exclude multiple markets through the Service API:

    "MetaFields": [
        {
            "Name""_ExcludedCatalogEntryMarkets",
            "Type""EnumMultiValue",
            "Data": [
                {
                    "Value""DK"
                },
                {
                    "Value""FI"
                }
            ]
        }
    ],
No language needed since markets are configure only on master language.
#230685
Nov 11, 2020 8:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.