Exemplo n.º 1
0
 private static void EnableEnglish(IWebApiConnector connector, bool enabled)
 {
     connector.PostJson(UpdateLanguageApi, new
     {
         LanguageId = 1,
         Code       = EnglishLanguageCode,
         Enabled    = enabled,
     });
 }
Exemplo n.º 2
0
        private void RenameFolder(IWebApiConnector connector, int folderId, string newFolderName)
        {
            var apiUrl   = "API/DigitalAssets/ContentService/RenameFolder";
            var postData = new
            {
                folderId      = folderId,
                newFolderName = newFolderName
            };

            connector.PostJson(apiUrl, postData, GetRequestHeaders());
        }
Exemplo n.º 3
0
 private static void UpdateLanguageSettings(IWebApiConnector connector, dynamic languageSettings, string code)
 {
     connector.PostJson(UpdateLanguageSettingsApi, new
     {
         SiteDefaultLanguage = code,
         languageSettings.LanguageDisplayMode,
         languageSettings.EnableUrlLanguage,
         languageSettings.EnableBrowserLanguage,
         languageSettings.AllowUserUICulture,
         languageSettings.CultureCode,
         languageSettings.AllowContentLocalization,
     });
 }
Exemplo n.º 4
0
        private dynamic CreateNewFolder(IWebApiConnector connector)
        {
            var rootFolderId = GetRootFolderId();
            var apiUrl       = "API/DigitalAssets/ContentService/CreateNewFolder";
            var postData     = new
            {
                FolderName      = Guid.NewGuid().ToString(),
                ParentFolderId  = rootFolderId,
                FolderMappingId = GetStandardFolderMappingId(),
                MappedName      = string.Empty
            };

            var response = connector.PostJson(apiUrl, postData, GetRequestHeaders());

            return(Json.Deserialize <dynamic>(response.Content.ReadAsStringAsync().Result));
        }