UpdateReferences() private method

private UpdateReferences ( SenseNet.ContentRepository content, bool needToValidate ) : bool
content SenseNet.ContentRepository
needToValidate bool
return bool
Ejemplo n.º 1
0
        private static void UpdateReference(int contentId, string metadataPath, bool validate)
        {
            var contentInfo = new ContentInfo(metadataPath, null);

            LogWrite("  ");
            LogWriteLine(contentInfo.Name);
            SNC.Content content = SNC.Content.Load(contentId);
            if (content != null)
            {
                try
                {
                    if (!contentInfo.UpdateReferences(content, validate))
                    {
                        PrintFieldErrors(content, contentInfo.MetaDataPath);
                    }
                }
                catch (Exception e)
                {
                    PrintException(e, contentInfo.MetaDataPath);
                }
            }
            else
            {
                LogWrite("---------- Content does not exist. MetaDataPath: ");
                LogWrite(contentInfo.MetaDataPath);
                LogWrite(", ContentId: ");
                LogWrite(contentInfo.ContentId);
                LogWrite(", ContentTypeName: ");
                LogWrite(contentInfo.ContentTypeName);
            }
        }
Ejemplo n.º 2
0
        private static void UpdateReference(int contentId, string metadataPath, bool validate)
        {
            var contentInfo = new ContentInfo(metadataPath, null);

            LogWrite("  ");
            LogWriteLine(contentInfo.Name);
            SNC.Content content = SNC.Content.Load(contentId);
            if (content != null)
            {
                try
                {
                    if (!contentInfo.UpdateReferences(content, validate))
                        PrintFieldErrors(content, contentInfo.MetaDataPath);
                }
                catch (Exception e)
                {
                    PrintException(e, contentInfo.MetaDataPath);
                }
            }
            else
            {
                LogWrite("---------- Content does not exist. MetaDataPath: ");
                LogWrite(contentInfo.MetaDataPath);
                LogWrite(", ContentId: ");
                LogWrite(contentInfo.ContentId);
                LogWrite(", ContentTypeName: ");
                LogWrite(contentInfo.ContentTypeName);
            }
        }