# Marfeel definitions

There are several types of definition at Marfeel. Find them explained in this article.

# Definition.json

Definition.json is a configuration file containing the main settings of the tenant such as the name, the sections, configurations flags...

Scope

Flags added to the global configuration of a tenant's definition will affect all sections.

# sectionDefinitions

sectionDefinitions is the key containing an array of objects within a defintion.json file. Each object is the configuration of a section.

 



















    "sectionDefinitions": [
        {
            "name": "home",
            "styles": "photo",
            "title": "Home",
                "configuration": {
                    "cronRefresh": "0 0/3 * 1/1 * ? *"
                }
            "feedDefinitions": [
                {
                    "uri": "https://sectionurl.com",
                    "alibabaDefinition": {}
                }
            ],
        },
        .
        .
        .
    ]

Scope

The flags added to the configuration object within a sectionDefinition will only affect that section.

WARNING

Any configuration related to Article extraction shouldn't be set for just one section since it will not apply when navigating to the article via deep-linking.

Article extraction must always be configured globally for each tenant to prevent inconsistencies.

This also applies to whitelist and blacklist configuration flags.

# feedDefinitions

feedDefintions is an array within a section configuration object containing one or more objects, with the URL articles will be fetched from when extracting that section.

TIP

There should be only one object per feedDefinitions. Configure Section pagination when more content needs to be extracted from a specific section.








 
 





 "sectionDefinitions":[
     {
            "name":"sectionName",
            "title":"Title",
            "configuration": {
                "cronRefresh": "0 0/3 * 1/1 * ? *"
            },
            "feedDefinitions":[{
                "uri":"https://www.sectionurl.com/section/",
                "alibabaDefinition":{}
            }]
        }
 ]

WARNING

Old tenants might have several URLs inside the feedDefinitions. In those cases, if one of the URL doesn't return content, the whole section extraction will fail.

# alibabaDefinition

alibabaDefinition is an object within a section feedDefintions configuration object that allows the configuration of Alibaba for that specific feed.

Usage

Different whitecollar files can be configured for different URL feeds within the same section.







 
 
 
 











 {
    "name": "sectionName",
    "title": "Title",
    "feedDefinitions": [
      {
        "uri": "http://www.sectionurl.es/section-slug/",
        "alibabaDefinition": {
          "configuration": {
            "whiteCollarScript": "../../marfeel/whiteCollar/main.js"
          }
        }
      },
       {
        "uri": "http://www.sectionurl.es/section-slug/page/2",
        "alibabaDefinition": {
          "configuration": {
            "whiteCollarScript": "../../marfeel/whiteCollar/section.js"
          }
        }
      }