Ejemplo n.º 1
0
        /// <summary>
        /// TODO:  Need to implement this method once the xml is stored in the database and is ready to be used from
        /// that centrally stored location - currently the xml is in xml files
        /// </summary>
        /// <returns></returns>
        public override RuleFields GetData(Guid applicationID, Guid typeID,
                                           DotNetNancy.Rules.RuleSet.DataAccess.Enumerations.ConfigurationTypes configurationType)
        {
            RuleFields ruleField = null;

            SqlParameter[] parameters = new SqlParameter[3] {
                SqlHelper.PrepareParameter(DataAccessConstants.ApplicationTable.APPLICATION_ID, applicationID),
                SqlHelper.PrepareParameter(DataAccessConstants.ConfigurationFileTable.TYPE_ID,
                                           typeID), SqlHelper.PrepareParameter(DataAccessConstants.ConfigurationFileTable.CONFIGURATION_TYPE_ID,
                                                                               (int)configurationType)
            };

            SqlDataReader reader = SqlHelper.ExecuteReader(SqlHelper.Connections[0],
                                                           CommandType.StoredProcedure, DataAccessConstants.GET_CONFIGURATION_FILE, parameters);

            DotNetNancy.Rules.RuleSet.DataAccess.DTO.List.ConfigurationFile files =
                new DotNetNancy.Rules.RuleSet.DataAccess.DTO.List.ConfigurationFile(reader);

            //there should only be one for this type and configuration type
            if (files.Count == 0)
            {
                throw new ApplicationException(string.Format("No configuration file found for application id {0}", applicationID.ToString()));
            }

            ruleField = new RuleFields(files[0].ConfigurationFile_Property);
            return(ruleField);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// TODO:  forced to have these files with the executing application that is consuming the components really needs to
        /// be addressed at some point.  bascially each UI that consumes this needs to have a copy of these files and if you need to
        /// make a "global" change you would have to make it with each application as well in each individual application
        /// </summary>
        /// <returns></returns>
        public override RuleFields GetData(Guid applicationID, Guid typeID,
                                           DotNetNancy.Rules.RuleSet.DataAccess.Enumerations.ConfigurationTypes configurationType)
        {
            throw new NotImplementedException();
            XmlDocument sourceXmlDocument = new XmlDocument();

            string pathToExecutingAssembly =
                Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);

            sourceXmlDocument.Load(pathToExecutingAssembly + @"\" + _filePathOrUrl);
            return(new RuleFields(sourceXmlDocument));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// load this object
 /// </summary>
 public void Load(Guid applicationID, Guid typeID,
                  DotNetNancy.Rules.RuleSet.DataAccess.Enumerations.ConfigurationTypes configurationType)
 {
     foreach (RuleOperatorsProvider provider in DataAccess.InitRuleOperatorsProvider.Providers)
     {
         if (provider.IsCurrentBusinessObjectProvider)
         {
             Load(provider.GetData(applicationID, typeID, configurationType));
             break;
         }
     }
 }
Ejemplo n.º 4
0
 public RuleOperators(Guid applicationID, Guid typeID,
                      DotNetNancy.Rules.RuleSet.DataAccess.Enumerations.ConfigurationTypes configurationType)
 {
     Load(applicationID, typeID, configurationType);
 }
 public abstract RuleOperators GetData(Guid applicationID, Guid typeID,
                                       DotNetNancy.Rules.RuleSet.DataAccess.Enumerations.ConfigurationTypes configurationType);