var atomFeedCustomization = function()

in JSLib/src/odata-atom.js [144:182]


    var atomFeedCustomization = function (customizationModel, entityType, model, propertyName, suffix) {
        /// <summary>Creates an object describing a feed customization that was delcared in an OData conceptual schema.</summary>
        /// <param name="customizationModel" type="Object">Object describing the customization delcared in the conceptual schema.</param>
        /// <param name="entityType" type="Object">Object describing the entity type that owns the customization in an OData conceputal schema.</param>
        /// <param name="model" type="Object">Object describing an OData conceptual schema.</param>
        /// <param name="propertyName" type="String" optional="true">Name of the property to which this customization applies.</param>
        /// <param name="suffix" type="String" optional="true">Suffix to feed customization properties in the conceptual schema.</param>
        /// <returns type="Object">Object that describes an applicable feed customization.</returns>

        suffix = suffix || "";
        var targetPath = customizationModel["FC_TargetPath" + suffix];
        if (!targetPath) {
            return null;
        }

        var sourcePath = customizationModel["FC_SourcePath" + suffix];
        var targetXmlPath = expandedFeedCustomizationPath(targetPath);

        var propertyPath = propertyName ? propertyName + (sourcePath ? "/" + sourcePath : "") : sourcePath;
        var propertyType = propertyPath && lookupPropertyType(model, entityType, propertyPath);
        var nsURI = customizationModel["FC_NsUri" + suffix] || null;
        var nsPrefix = customizationModel["FC_NsPrefix" + suffix] || null;
        var keepinContent = customizationModel["FC_KeepInContent" + suffix] || "";

        if (targetPath !== targetXmlPath) {
            nsURI = atomXmlNs;
            nsPrefix = atomPrefix;
        }

        return {
            contentKind: customizationModel["FC_ContentKind" + suffix],
            keepInContent: keepinContent.toLowerCase() === "true",
            nsPrefix: nsPrefix,
            nsURI: nsURI,
            propertyPath: propertyPath,
            propertyType: propertyType,
            entryPath: targetXmlPath
        };
    };