Inheritance: EntityConfiguration
示例#1
0
        /// <summary>
        /// Adds a document type definition to the collection
        /// </summary>
        /// <param name="profileMapping"></param>
        public virtual void Add(ProfileMapping profileMapping)
        {
            ProfileMappingCollectionConfig configuration = ConfigurationHandler.GetConfigurationSection <ProfileMappingCollectionConfig>();

            if (!configuration.ContainsProfileMappingByName(profileMapping.Name))
            {
                configuration.AddProfileMapping(profileMapping);
            }
        }
示例#2
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     GlobalConfiguration.Configure(WebApiConfig.Register);
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     ProfileMapping.RegisterMappings();
 }
示例#3
0
        protected UddiId GetProfileTModelId(OiosiMessage message, DocumentTypeConfig docTypeConfig)
        {
            UddiId uddiId;

            // If doctype does't have a XPath expression to extract the document Profile
            // then we assume that the current document type does operate with OIOUBL profiles
            if (docTypeConfig.ProfileIdXPath == null)
            {
                uddiId = null;
            }
            else if (docTypeConfig.ProfileIdXPath.XPath == null)
            {
                uddiId = null;
            }
            else if (docTypeConfig.ProfileIdXPath.XPath.Equals(""))
            {
                uddiId = null;
            }
            else
            {
                // Fetch the OIOUBL profile name
                string profileName = DocumentXPathResolver.GetElementValueByXPathNavigator(
                    message.MessageXml,
                    docTypeConfig.ProfileIdXPath.XPath,
                    docTypeConfig.Namespaces);

                ProfileMappingCollectionConfig config = ConfigurationHandler.GetConfigurationSection <ProfileMappingCollectionConfig>();
                if (config.ContainsProfileMappingByName(profileName))
                {
                    ProfileMapping profileMapping    = config.GetMapping(profileName);
                    string         profileTModelGuid = profileMapping.TModelGuid;
                    uddiId = IdentifierUtility.GetUddiIDFromString(profileTModelGuid);
                }
                else
                {
                    throw new Exception("GetProfileTModelId failed for : " + profileName);
                }
            }

            return(uddiId);
        }
        public void InsertProfileMapping(string dnnProfilePropertyName, string aadClaimName, int portalId)
        {
            Requires.NotNullOrEmpty("DnnProfilePropertyName", dnnProfilePropertyName);
            Requires.NotNullOrEmpty("AadClaimName", aadClaimName);

            var profileMapping = new ProfileMapping
            {
                DnnProfilePropertyName = dnnProfilePropertyName,
                CreatedByUserId        = UserController.Instance.GetCurrentUserInfo().UserID,
                CreatedOnDate          = DateTime.UtcNow,
                AadClaimName           = aadClaimName,
                PortalId             = portalId,
                LastModifiedOnDate   = DateTime.UtcNow,
                LastModifiedByUserId = UserController.Instance.GetCurrentUserInfo().UserID
            };

            using (IDataContext ctx = DataContext.Instance())
            {
                var rep = ctx.GetRepository <ProfileMapping>();
                rep.Insert(profileMapping);
            }
        }
示例#5
0
        private static UddiId GetProfileTModelId(OiosiMessage message, DocumentTypeConfig docTypeConfig)
        {
            UddiId uddiId      = null;
            string profileName = GetProfileName(message, docTypeConfig);

            if (string.IsNullOrEmpty(profileName) == false)
            {
                var config = ConfigurationHandler.GetConfigurationSection <ProfileMappingCollectionConfig>();
                if (config.ContainsProfileMappingByName(profileName))
                {
                    ProfileMapping profileMapping    = config.GetMapping(profileName);
                    string         profileTModelGuid = profileMapping.TModelGuid;
                    uddiId = IdentifierUtility.GetUddiIDFromString(profileTModelGuid);
                }
                else
                {
                    throw new Exception("DocumentProfileMappingNotFoundException: " + profileName);
                }
            }

            return(uddiId);
        }
示例#6
0
        /// <summary>
        /// add mapping
        /// </summary>
        /// <param name="name"></param>
        /// <param name="tModelGuid"></param>
        public virtual void AddMapping(string name, string tModelGuid)
        {
            ProfileMapping profileMapping = new ProfileMapping(name, tModelGuid);

            Add(profileMapping);
        }