Esempio n. 1
0
        public virtual ID ResolvePath(string itemPath, CallContext context)
        {
            if (DisableSerialization || DisableTransparentSync)
            {
                return(null);
            }

            // return null if not present
            var item = _targetDataStore.GetByPath(itemPath, Database.Name).FirstOrDefault();

            if (item == null || !_predicate.Includes(item).IsIncluded)
            {
                return(null);
            }

            return(new ID(item.Id));
        }
Esempio n. 2
0
        public IItemData[] GetRootSerializedItems()
        {
            var items = new List <IItemData>();

            foreach (var include in _predicate.GetRootPaths())
            {
                var item = _targetDataStore.GetByPath(include.Path, include.DatabaseName).ToArray();

                if (item.Length == 1)
                {
                    items.Add(item[0]);
                }
                else
                {
                    _logger.Error("Unable to resolve root serialized item for predicate root path {0}:{1}. Either the path did not exist, or multiple items matched the path. It has been skipped.".FormatWith(include.DatabaseName, include.Path));
                }
            }

            return(items.ToArray());
        }
Esempio n. 3
0
        public IItemData[] GetRootSerializedItems()
        {
            var items = new List <IItemData>();

            foreach (var include in _predicate.GetRootPaths())
            {
                var item = _targetDataStore.GetByPath(include.Path, include.DatabaseName).ToArray();

                if (item.Length == 1)
                {
                    items.Add(item[0]);
                }
                else if (item.Length == 0)
                {
                    _logger.Error("Unable to resolve serialized item for included root path {0}:{1}. The item does not exist in {2}. It has been skipped. Perhaps you need to perform an initial serialization from the control panel?".FormatWith(include.DatabaseName, include.Path, _targetDataStore.FriendlyName));
                }
                else
                {
                    _logger.Error("Multiple serialized items matched included root path {0}:{1} in {2}. You cannot have a root path that is not unique. It has been skipped.".FormatWith(include.DatabaseName, include.Path, _targetDataStore.FriendlyName));
                }
            }

            return(items.ToArray());
        }