private void SetBusinessDataContentSourceStartAddress(BusinessDataContentSource contentSource, SPServiceApplicationProxyGroup bdcServiceApplicationProxyGroup, Configuration myConfiguration)
        {
            BusinessDataContentSource businessDataContentSource = contentSource as BusinessDataContentSource;

            if (businessDataContentSource != null && bdcServiceApplicationProxyGroup != null)
            {
                string[] LOBSystemSet = myConfiguration.ContentSourceConfiguration.StartAddresses;
                string   text2        = bdcServiceApplicationProxyGroup.Name;
                if (string.IsNullOrEmpty(text2))
                {
                    text2 = "Default";
                }
                if (LOBSystemSet != null)
                {
                    for (int k = 0; k < LOBSystemSet.Length; k += 2)
                    {
                        if (k == LOBSystemSet.Length - 1)
                        {
                            throw new ArgumentException(LOBSystemSet[k]);
                        }
                        string lobSystemName         = LOBSystemSet[k];
                        string lobSystemInstanceName = LOBSystemSet[k + 1];
                        Uri    address = BusinessDataContentSource.ConstructStartAddress(text2, Guid.Empty, lobSystemName, lobSystemInstanceName);
                        businessDataContentSource.StartAddresses.Add(address);
                    }
                }
                else
                {
                    Uri address2 = BusinessDataContentSource.ConstructStartAddress(text2, Guid.Empty);
                    businessDataContentSource.StartAddresses.Add(address2);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Constructs a url start address for a given application name. If appName is empty the start address returned is one that will crawl all applications on the ssp
        /// </summary>
        /// <remarks>
        /// If {sitecollection} is used in the StartAddress's Url attribute, a SPSite must have been passed to the
        /// constructor of the class.
        /// </remarks>
        private static Uri ConstructBusinessDataStartAddress(XElement definition)
        {
            // Extract values from attributes
            var lobSystemName         = definition.Attribute("LobSystemName").ValueOrDefault(string.Empty);
            var lobSystemInstanceName = definition.Attribute("LobSystemInstanceName").ValueOrDefault(string.Empty);
            var bdcAppProxyGroupName  = definition.Attribute("BdcAppProxyGroupName").ValueOrDefault("Default");
            var partitionId           = new Guid(definition.Attribute("PartitionId").ValueOrDefault(Guid.Empty.ToString()));

            // Construct the start address
            return(BusinessDataContentSource.ConstructStartAddress(bdcAppProxyGroupName, partitionId, lobSystemName, lobSystemInstanceName));
        }