function checkRenameUri(collectionId, data, renameUri, onSave) {
  if (renameUri && !data.description.language) {   // It will not change welsh url
    swal({
      title: "Warning",
      text: "You have changed the title or edition and this could change the uri. Are you sure you want to proceed?",
      type: "warning",
      showCancelButton: true,
      confirmButtonText: "Change url",
      cancelButtonText: "Cancel",
      closeOnConfirm: true
    }, function (result) {
      if (result === true) {
        // Does it have edition?
        if (data.description.edition) {
          //Special case dataset editions. They have edition but not title
          if (data.description.title) {
            var titleNoSpace = data.description.title.replace(/[^A-Z0-9]+/ig, "").toLowerCase();
          }
          var editionNoSpace = data.description.edition.replace(/[^A-Z0-9]+/ig, "").toLowerCase();
          var tmpNewUri = data.uri.split("/");
          if (data.type === 'dataset') {
            tmpNewUri.splice([tmpNewUri.length - 1], 1, editionNoSpace);
          } else {
            tmpNewUri.splice([tmpNewUri.length - 2], 2, titleNoSpace, editionNoSpace);
          }
          var newUri = tmpNewUri.join("/");
          //is it a compendium? Rename children array
          if (data.type === 'compendium_landing_page') {
            if (data.chapters) {
              data.chapters = renameCompendiumChildren(data.chapters, titleNoSpace, editionNoSpace);
            }
            if (data.datasets) {
              data.datasets = renameCompendiumChildren(data.datasets, titleNoSpace, editionNoSpace);
            }
          }
          moveContent(collectionId, data.uri, newUri,
            onSuccess = function () {
              Florence.globalVars.pagePath = newUri;
              onSave(collectionId, newUri, JSON.stringify(data));
            },
            onError = function () {
              onSave(collectionId, data.uri, JSON.stringify(data));
            }
          );
          // is it an adHoc?
        } else if (data.type === 'static_adhoc') {
          var titleNoSpace = data.description.title.replace(/[^A-Z0-9]+/ig, "").toLowerCase();
          var referenceNoSpace = data.description.reference.replace(/[^A-Z0-9]+/ig, "").toLowerCase();
          var tmpNewUri = data.uri.split("/");
          tmpNewUri.splice([tmpNewUri.length - 1], 1, referenceNoSpace + titleNoSpace);
          var newUri = tmpNewUri.join("/");
          moveContent(collectionId, data.uri, newUri,
            onSuccess = function () {
              Florence.globalVars.pagePath = newUri;
              onSave(collectionId, newUri, JSON.stringify(data));
            },
            onError = function () {
              onSave(collectionId, data.uri, JSON.stringify(data));
            }
          );
        } else {
          var titleNoSpace = data.description.title.replace(/[^A-Z0-9]+/ig, "").toLowerCase();
          var tmpNewUri = data.uri.split("/");
          //Articles with no edition. Add date as edition
          if (data.type === 'article' || data.type === 'article_download') {
            var editionDate = $.datepicker.formatDate('yy-mm-dd', new Date());
            tmpNewUri.splice([tmpNewUri.length - 2], 2, titleNoSpace, editionDate);
          } else {
            tmpNewUri.splice([tmpNewUri.length - 1], 1, titleNoSpace);
          }
          var newUri = tmpNewUri.join("/");
          //if it is a dataset rename children array
          if (data.type === 'dataset_landing_page') {
            if (data.datasets) {
              data.datasets = renameDatasetChildren(data.datasets, titleNoSpace);
            }
          }
          moveContent(collectionId, data.uri, newUri,
            onSuccess = function () {
              Florence.globalVars.pagePath = newUri;
              onSave(collectionId, newUri, JSON.stringify(data));
            },
            onError = function () {
              onSave(collectionId, data.uri, JSON.stringify(data));
            }
          );
        }
      } else {
        refreshPreview(data.uri);
        loadPageDataIntoEditor(data.uri, collectionId);
      }
    });
  } else {
    onSave(collectionId, data.uri, JSON.stringify(data));
  }
}


@@ -1214,32 +1214,181 @@
 wUri.join(%22/%22);%0A
+          moveContent(collectionId, data.uri, newUri,%0A            onSuccess = function () %7B%0A              Florence.globalVars.pagePath = newUri;%0A    
           //is i
@@ -1417,32 +1417,36 @@
  children array%0A
+    
           if (da
@@ -1490,32 +1490,36 @@
 ) %7B%0A            
+   
+ 
 if (data.chapter
@@ -1519,24 +1519,28 @@
 chapters) %7B%0A
+    
             
@@ -1632,32 +1632,36 @@
 e);%0A            
+    
 %7D%0A            if
@@ -1650,32 +1650,36 @@
   %7D%0A            
+ 
+   
 if (data.dataset
@@ -1675,32 +1675,36 @@
 ata.datasets) %7B%0A
+    
               da
@@ -1790,32 +1790,24 @@
 ace);%0A      
-      %7D%0A
           %7D%0A
@@ -1820,142 +1820,13 @@
     
-moveContent(collectionId, data.uri, newUri,%0A            onSuccess = function () %7B%0A              Florence.globalVars.pagePath = newUri;
+    %7D
 %0A   
@@ -3443,32 +3443,181 @@
 wUri.join(%22/%22);%0A
+          moveContent(collectionId, data.uri, newUri,%0A            onSuccess = function () %7B%0A              Florence.globalVars.pagePath = newUri;%0A    
           //if i
@@ -3655,32 +3655,36 @@
 array%0A          
+ 
+   
 if (data.type ==
@@ -3715,32 +3715,36 @@
 ) %7B%0A            
+    
 if (data.dataset
@@ -3740,32 +3740,36 @@
 ata.datasets) %7B%0A
+    
               da
@@ -3836,32 +3836,24 @@
 ace);%0A      
-      %7D%0A
           %7D%0A
@@ -3866,142 +3866,13 @@
     
-moveContent(collectionId, data.uri, newUri,%0A            onSuccess = function () %7B%0A              Florence.globalVars.pagePath = newUri;
+    %7D
 %0A   

Change children (dataset and compendium) url renaming process