public void UpdateProperties(string repositoryId, string objectId, CmisProperties properties) { Kooboo.CMS.Content.Models.Repository repository = new Models.Repository(repositoryId); string folderId; TryPraseObjectId(objectId, out folderId); var folder = CmisFolderHelper.Parse(repository, folderId); var values = properties.ToNameValueCollection(); if (folder is TextFolder) { var textFolder = (TextFolder)folder; if (values["DisplayName"] != null) { textFolder.DisplayName = values["DisplayName"]; } if (values["SchemaName"] != null) { textFolder.SchemaName = values["SchemaName"]; } if (values["CategoryFolders"] != null) { textFolder.CategoryFolders = values["CategoryFolders"].Split(",".ToArray(), StringSplitOptions.RemoveEmptyEntries); } ServiceFactory.TextFolderManager.Update(repository, textFolder, textFolder); } else { var mediaFolder = (MediaFolder)folder; if (values["DisplayName"] != null) { mediaFolder.DisplayName = values["DisplayName"]; } if (values["AllowedExtensions"] != null) { mediaFolder.AllowedExtensions = values["AllowedExtensions"].Split(",".ToArray(), StringSplitOptions.RemoveEmptyEntries); } ServiceFactory.MediaFolderManager.Update(repository, mediaFolder, mediaFolder); } }
public void UpdateProperties(string repositoryId, string objectId, CmisProperties properties) { throw new NotImplementedException(); }
public void UpdateProperties(string repositoryId, string objectId, CmisProperties properties) { throw new NotImplementedException(); }
public void UpdateProperties(string repositoryId, string objectId, CmisProperties properties) { Kooboo.CMS.Content.Models.Repository repository = new Models.Repository(repositoryId); string folderId; TryPraseObjectId(objectId, out folderId); var folder = CmisFolderHelper.Parse(repository, folderId); var values = properties.ToNameValueCollection(); if (folder is TextFolder) { var textFolder = (TextFolder)folder; if (values["DisplayName"] != null) { textFolder.DisplayName = values["DisplayName"]; } if (values["SchemaName"] != null) { textFolder.SchemaName = values["SchemaName"]; } if (values["CategoryFolders"] != null) { textFolder.CategoryFolders = values["CategoryFolders"].Split(",".ToArray(), StringSplitOptions.RemoveEmptyEntries); } ServiceFactory.TextFolderManager.Update(repository, textFolder, textFolder); } else { var mediaFolder = (MediaFolder)folder; if (values["DisplayName"] != null) { mediaFolder.DisplayName = values["DisplayName"]; } if (values["AllowedExtensions"] != null) { mediaFolder.AllowedExtensions = values["AllowedExtensions"].Split(",".ToArray(), StringSplitOptions.RemoveEmptyEntries); } ServiceFactory.MediaFolderManager.Update(repository, mediaFolder, mediaFolder); } }
public static NameValueCollection ToNameValueCollection(this CmisProperties properties) { return(properties.Items.ToDictionary(it => it.PropertyDefinitionId, it => it.Value).ToNameValueCollection()); }