Esempio n. 1
0
        protected bool ShouldExecuteProvider(ID itemId)
        {
            var item = SerializedDatabase.GetItem(itemId);

            if (item == null)
            {
                return(false);
            }

            var result = _filter.Includes(item);

            return(result.IsIncluded);
        }
Esempio n. 2
0
        public SerializationDataProvider(string connectionStringName)
        {
            Assert.ArgumentNotNullOrEmpty(connectionStringName, "connectionStringName");

            var connectionString = ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;

            Log.Info("RhinoSerializationDataProvider is initializing...", this);
            var sw = new Stopwatch();

            sw.Start();

            _database = new SerializedDatabase(connectionString, true);

            sw.Stop();
            Log.Info(string.Format("Rhino: loaded {0} serialized items into memory index in {1}ms", SerializedDatabase.Count, sw.ElapsedMilliseconds), this);
        }
Esempio n. 3
0
        public override ID ResolvePath(string itemPath, CallContext context)
        {
            Assert.ArgumentNotNull(itemPath, "itemPath");

            var existingPath = SerializedDatabase.GetItem(itemPath);

            if (existingPath == null)
            {
                return(null);
            }

            if (!ShouldExecuteProvider(existingPath.GetSitecoreId()))
            {
                return(null);
            }

            context.Abort();
            return(base.ResolvePath(itemPath, context));
        }