Beispiel #1
0
        internal bool UpdateReferences(SNC.Content content, bool needToValidate)
        {
            if (_transferringContext == null)
            {
                _transferringContext = new ImportContext(_xmlDoc.SelectNodes("/ContentMetaData/Fields/*"), null, false, needToValidate, true);
            }
            else
            {
                _transferringContext.UpdateReferences = true;
            }

            var node = content.ContentHandler;

            node.ModificationDate        = node.ModificationDate;
            node.VersionModificationDate = node.VersionModificationDate;
            node.ModifiedBy        = node.ModifiedBy;
            node.VersionModifiedBy = node.VersionModifiedBy;

            if (!content.ImportFieldData(_transferringContext))
            {
                return(false);
            }
            if (!HasPermissions && !HasBreakPermissions)
            {
                return(true);
            }
            var permissionsNode = _xmlDoc.SelectSingleNode("/ContentMetaData/Permissions");

            content.ContentHandler.Security.ImportPermissions(permissionsNode, this._metaDataPath);

            return(true);
        }
Beispiel #2
0
        public bool SetMetadata(SNC.Content content, string currentDirectory, bool isNewContent, bool needToValidate, bool updateReferences)
        {
            if (_xmlDoc == null)
            {
                return(true);
            }
            _transferringContext = new ImportContext(
                _xmlDoc.SelectNodes("/ContentMetaData/Fields/*"), currentDirectory, isNewContent, needToValidate, updateReferences);
            bool result = content.ImportFieldData(_transferringContext);

            _contentId = content.ContentHandler.Id;
            return(result);
        }