http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/theme_resource_util.js
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/theme_resource_util.js
 
b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/theme_resource_util.js
deleted file mode 100644
index 919dad9..0000000
--- 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/theme_resource_util.js
+++ /dev/null
@@ -1,849 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var myEditor = null;
-function loadThemeResourcePage(path, viewMode, consumerID, targetDiv) {
-    return loadThemeJSPPage('theme_advanced', path, viewMode, consumerID, 
targetDiv);
-}
-
-function loadThemeJSPPage(pagePrefixName, path, viewMode, consumerID, 
targetDiv) {
-    if (viewMode != undefined && viewMode != null && 'inlined' == viewMode) {
-        pagePrefixName = "resource";
-        var suffix = "&resourceViewMode=inlined";
-        if (consumerID != undefined && consumerID != null && consumerID != "") 
{
-            suffix += "&resourcePathConsumer=" + consumerID;
-        }
-
-        if (targetDiv == null || targetDiv == undefined || targetDiv == "" || 
targetDiv == "null") {
-            targetDiv = 'registryBrowser';
-        }
-
-        suffix += "&targetDivID=" + targetDiv;
-
-        if (path == "#") {
-            path = '/';
-        }
-
-        var url = '../tenant-theme/' + pagePrefixName + 
'_ajaxprocessor.jsp?path=' + path + suffix;
-
-        /* document.getElementById(targetDiv).style.display = ""; */
-        jQuery("#popupContent").load(url, null,
-                function(res, status, t) {
-                    if (status != "success") {
-                        
CARBON.showWarningDialog(org_wso2_carbon_registry_resource_ui_jsi18n["error.occured"]);
-                    }
-                    // Add necessary logic to handle these scenarios if needed
-                    if (res || t) {}
-                });
-        return false;
-    } else {
-        document.location.href = '../tenant-theme/' + pagePrefixName + 
'.jsp?path=' + path + "&screenWidth=" + screen.width;
-    }
-    return true;
-}
-
-function submitImportThemeContentForm() {
-
-    var rForm = document.forms["resourceImportForm"];
-    if (!rForm.redirectWith || rForm.redirectWith.value == "") {
-        sessionAwareFunction(function() {}, 
org_wso2_carbon_registry_resource_ui_jsi18n["session.timed.out"]);
-    }
-
-    var reason = "";
-    reason += validateEmpty(rForm.fetchURL, 
org_wso2_carbon_registry_resource_ui_jsi18n["url"]);
-    if (reason == "") {
-        reason += validateEmpty(rForm.resourceName, 
org_wso2_carbon_registry_resource_ui_jsi18n["name"]);
-    }
-    if (reason == "") {
-        reason += validateIllegal(rForm.resourceName, 
org_wso2_carbon_registry_resource_ui_jsi18n["name"]);
-    }
-    if (reason == "") {
-        reason += validateImage(rForm.resourceName);
-    }
-    if (reason == "") {
-        reason += validateResourcePathAndLength(rForm.resourceName);
-    }
-    if (reason == "") {
-        reason += validateForInput(rForm.mediaType, 
org_wso2_carbon_registry_resource_ui_jsi18n["media.type"]);
-    }
-    /*if (reason == "") {
-        reason += validateForInput(rForm.description, 
org_wso2_carbon_registry_resource_ui_jsi18n["description"]);
-    }
-    if (reason == "") {
-        reason += validateDescriptionLength(rForm.description);
-    } */
-    var resourcePath= rForm.path.value + '/' + rForm.resourceName.value;
-    resourcePath = resourcePath.replace("//", "/");
-    if (reason == "") {
-        reason += validateExists(resourcePath);
-    }
-
-    if (reason != "") {
-        CARBON.showWarningDialog(reason);
-        if (document.getElementById('add-resource-div')) {
-            document.getElementById('add-resource-div').style.display = "";
-        }
-        document.getElementById('whileUpload').style.display = "none";
-        return false;
-    }
-
-    var parentPath = document.getElementById('irParentPath').value;
-    var resourceName = document.getElementById('irResourceName').value;
-    var mediaType = document.getElementById('irMediaType').value;
-    var description = ""; //document.getElementById('irDescription').value;
-    var fetchURL = document.getElementById('irFetchURL').value;
-    var redirectWith = "";
-    if (document.getElementById('irRedirectWith')) {
-        redirectWith = document.getElementById('irRedirectWith').value;
-    }
-
-    var isAsync = "false";
-
-    // If this is a wsdl we need to make a async call to make sure we dont 
timeout cause wsdl
-    // validation takes long.
-    var params;
-    if ((mediaType == "application/wsdl+xml") || (mediaType == 
"application/x-xsd+xml")  || (mediaType == "application/policy+xml")) {
-//                    isAsync = "true";
-        params = {parentPath: parentPath, resourceName: resourceName,
-            mediaType: mediaType, description: description, fetchURL: fetchURL,
-            isAsync : isAsync, symlinkLocation: parentPath, redirectWith: 
redirectWith};
-    } else {
-        params = {parentPath: parentPath, resourceName: resourceName,
-            mediaType: mediaType, description: description, fetchURL: fetchURL,
-            isAsync : isAsync, redirectWith: redirectWith};
-    }
-
-    new Ajax.Request('../tenant-theme/import_resource_ajaxprocessor.jsp',
-    {
-        method:'post',
-        parameters: params,
-
-        onSuccess: function() {
-            refreshThemeMetadataSection(parentPath);
-            refreshThemeContentSection(parentPath);
-            //document.getElementById('add-resource-div').style.display = "";
-            document.getElementById('whileUpload').style.display = "none";
-            
CARBON.showInfoDialog(org_wso2_carbon_registry_resource_ui_jsi18n["successfully.uploaded"],function(){
-                location.reload(true);
-            });
-
-        },
-
-        onFailure: function() {
-            refreshThemeMetadataSection(parentPath);
-            refreshThemeContentSection(parentPath);
-            document.getElementById('whileUpload').style.display = "none";
-            
CARBON.showErrorDialog(org_wso2_carbon_registry_resource_ui_jsi18n["unable.to.upload"]);
-        }
-    });
-}
-
-
-function submitThemeTextContentForm() {
-    var rForm = document.forms["textContentForm"];
-    /* Validate the form before submit */
-
-    var reason = "";
-    reason += validateEmpty(rForm.filename, 
org_wso2_carbon_registry_resource_ui_jsi18n["name"]);
-    if (reason == "") {
-        reason += validateForInput(rForm.filename, 
org_wso2_carbon_registry_resource_ui_jsi18n["name"]);
-    }
-    if (reason == "") {
-        reason += validateIllegal(rForm.filename, 
org_wso2_carbon_registry_resource_ui_jsi18n["name"]);
-    }
-    if (reason == "") {
-        reason += validateResourcePathAndLength(rForm.filename);
-    }
-    if (reason == "") {
-        reason += validateForInput(rForm.mediaType, 
org_wso2_carbon_registry_resource_ui_jsi18n["media.type"]);
-    }
-    /*if (reason == "") {
-        reason += validateForInput(rForm.description, 
org_wso2_carbon_registry_resource_ui_jsi18n["description"]);
-    }
-    if (reason == "") {
-        reason += validateDescriptionLength(rForm.description);
-    } */
-    var resourcePath= rForm.path.value + '/' + rForm.filename.value;
-    resourcePath = resourcePath.replace("//", "/");
-    if (reason == "") {
-        reason += validateExists(resourcePath);
-    }
-
-    if (reason != "") {
-        CARBON.showWarningDialog(reason);
-        if (document.getElementById('add-resource-div')) {
-            document.getElementById('add-resource-div').style.display = "";
-        }
-       document.getElementById('whileUpload').style.display = "none";
-        return false;
-    }
-
-    var parentPath = document.getElementById('trParentPath').value;
-    var fileName = document.getElementById('trFileName').value;
-    var mediaType = document.getElementById('trMediaType').value;
-    var description = ""; //document.getElementById('trDescription').value;
-    var content = '';
-
-    var radioObj = document.textContentForm.richText;
-    var selected = "";
-    for(var i=0;i<radioObj.length;i++){
-       if(radioObj[i].checked)selected = radioObj[i].value;
-    }
-    if(selected == 'rich'){
-       if (textContentEditor) {
-               textContentEditor.saveHTML();
-               content = textContentEditor.get('textarea').value;
-               textContentEditor.destroy();
-               textContentEditor = null;
-       }
-    } else{
-        if (textContentEditor) {
-               textContentEditor.destroy();
-               textContentEditor = null;
-       }
-       content = $('trPlainContent').value;
-    }
-
-    new Ajax.Request('../tenant-theme/add_text_resource_ajaxprocessor.jsp',
-    {
-        method:'post',
-        parameters: {parentPath: parentPath, fileName: fileName, mediaType: 
mediaType, description: description, content: content},
-
-        onSuccess: function() {
-            refreshThemeMetadataSection(parentPath);
-            refreshThemeContentSection(parentPath);
-            document.getElementById('whileUpload').style.display = "none";
-            
CARBON.showInfoDialog(org_wso2_carbon_registry_resource_ui_jsi18n["successfully.added.text.content"],loadData);
-        },
-
-        onFailure: function() {
-        }
-    });
-    return true;
-}
-
-function submitThemeCollectionAddForm() {
-    sessionAwareFunction(function() {
-
-        var parentPath = document.getElementById('parentPath').value;
-        var collectionName = document.getElementById('collectionName').value;
-        var mediaType = document.getElementById('mediaType').value;
-        if (mediaType == "other") {
-            mediaType = document.getElementById('mediaTypeOtherValue').value;
-        }
-        var description = ""; // document.getElementById('colDesc').value;
-
-        var reason = "";
-        reason += validateEmpty(document.getElementById('collectionName'), 
org_wso2_carbon_registry_resource_ui_jsi18n["name"]);
-        if (reason == "") {
-            reason += 
validateIllegal(document.getElementById('collectionName'), 
org_wso2_carbon_registry_resource_ui_jsi18n["name"]);
-        }
-        if (reason == "") {
-            reason += 
validateResourcePathAndLength(document.getElementById('collectionName'));
-        }
-        /*if (reason == "") {
-            reason += validateForInput(document.getElementById('colDesc'), 
org_wso2_carbon_registry_resource_ui_jsi18n["description"]);
-        }
-        if (reason == "") {
-            reason += 
validateDescriptionLength(document.getElementById('colDesc'));
-        } */
-        var resourcePath= document.getElementById('parentPath').value + '/' + 
document.getElementById('collectionName').value;
-        resourcePath = resourcePath.replace("//", "/");
-        if (reason == "") {
-            reason += validateExists(resourcePath);
-        }
-
-        if (document.getElementById('collectionName').value.indexOf('/') == 0) 
{
-            document.getElementById('collectionName').value = 
document.getElementById('collectionName').value.slice(1);
-        }
-        if (document.getElementById('collectionName').value.indexOf('//') == 
0) {
-            document.getElementById('collectionName').value = 
document.getElementById('collectionName').value.slice(2);
-        }
-        if (document.getElementById('collectionName').value.indexOf('///') == 
0) {
-            document.getElementById('collectionName').value = 
document.getElementById('collectionName').value.slice(3);
-        }
-        if (document.getElementById('collectionName').value.indexOf('////') == 
0) {
-            document.getElementById('collectionName').value = 
document.getElementById('collectionName').value.slice(4);
-        }
-
-
-        if (reason != "") {
-            CARBON.showWarningDialog(reason);
-            return false;
-        }
-
-        var addSuccess = true;
-        new Ajax.Request('../tenant-theme/add_collection_ajaxprocessor.jsp',
-        {
-            method:'post',
-            parameters: {parentPath: parentPath, collectionName: 
collectionName, mediaType: mediaType, description: description},
-
-            onSuccess: function() {
-                refreshThemeMetadataSection(parentPath);
-                refreshThemeContentSection(parentPath);
-                
CARBON.showInfoDialog(org_wso2_carbon_registry_resource_ui_jsi18n["successfully.added.collection"],loadData);
-            },
-
-            onFailure: function(transport) {
-                addSuccess = false;
-                
CARBON.showErrorDialog(org_wso2_carbon_registry_resource_ui_jsi18n["failed.to.add.collection"]
 + transport.responseText,loadData);
-            }
-        });
-    }, org_wso2_carbon_registry_resource_ui_jsi18n["session.timed.out"]);
-
-    loadData();
-}
-
-function navigateThemePages(wantedPage, resourcePath, viewMode, consumerID, 
targetDivID) {
-    fillThemeContentSection(resourcePath, wantedPage, viewMode, consumerID, 
targetDivID);
-}
-
-function fillThemeContentSection(path, pageNumber, viewMode, consumerID, 
targetDivID) {
-    var random = Math.floor(Math.random() * 2000);
-    new Ajax.Updater('contentDiv', 
'../tenant-theme/content_ajaxprocessor.jsp', { method: 'get', parameters: 
{path: path, requestedPage: pageNumber, mode: 
'standard',resourceViewMode:viewMode,resourcePathConsumer:consumerID,targetDivID:targetDivID,random:random}
 });
-}
-
-
-function viewAddResourceUI() {
-    var addSelector = document.getElementById('addMethodSelector');
-    var selectedValue = addSelector.options[addSelector.selectedIndex].value;
-
-    var uploadUI = document.getElementById('uploadContentUI');
-    var importUI = document.getElementById('importContentUI');
-
-    if (selectedValue == "upload") {
-
-        uploadUI.style.display = "";
-        importUI.style.display = "none";
-
-    } else if (selectedValue == "import") {
-
-        uploadUI.style.display = "none";
-        importUI.style.display = "";
-
-    }
-    if ($('add-folder-div')) {
-        if ($('add-folder-div').style.display != 
"none")$('add-folder-div').style.display == "none";
-    }
-}
-
-function validateImage(filename) {
-    var validExts = [".bmp", ".gif", ".jpg", ".png", ".jpeg"];
-    var filenameLower = filename.value.toLowerCase();
-    for (i = 0; i < validExts.length; i ++) {
-        if (filenameLower.lastIndexOf(validExts[i]) != -1) {
-            return "";
-        }
-    }
-    return "The image extension should be one of the following values, '.bmp', 
'.gif', '.png', '.jpeg'";
-}
-
-
-
-function submitUploadThemeContentForm() {
-
-    var rForm = document.forms["resourceUploadForm"];
-
-    if (!rForm.redirectWith || rForm.redirectWith.value == "") {
-        sessionAwareFunction(function() {}, 
org_wso2_carbon_registry_resource_ui_jsi18n["session.timed.out"]);
-    }
-    
-    /* Validate the form before submit */
-    var filePath = rForm.upload;
-    var reason = "";
-
-    if (filePath.value.length == 0) {
-        reason += "The required field File Path has not been filled in.<br />"
-    }
-    reason += validateEmpty(rForm.filename, "Name");
-    if (reason == "") {
-        reason = validateImage(rForm.upload);
-    }
-    reason += validateIllegal(rForm.filename, "Name");
-    reason += validateResourcePathAndLength(rForm.filename);
-    reason += validateForInput(rForm.filename, "Name");
-    reason += validateForInput(rForm.mediaType, "Media type");
-    //reason += validateForInput(rForm.description, "Description");
-
-    if (reason != "") {
-        if (document.getElementById('add-resource-div')) {
-           document.getElementById('add-resource-div').style.display = "";
-        }
-       document.getElementById('whileUpload').style.display = "none";
-       CARBON.showWarningDialog(reason);
-        return false;
-    } else {
-        if (document.getElementById('add-resource-div')) {
-            document.getElementById('add-resource-div').style.display = "none";
-        }
-        rForm.submit();
-    }
-}
-
-
-function fillThemeResourceUploadMediaTypes() {
-
-    var filepath = document.getElementById('uResourceFile').value;
-
-    var filename = "";
-    if (filepath.indexOf("\\") != -1) {
-        filename = filepath.substring(filepath.lastIndexOf('\\') + 1, 
filepath.length);
-    } else {
-        filename = filepath.substring(filepath.lastIndexOf('/') + 1, 
filepath.length);
-    }
-
-    var extension = filename.substring(filename.lastIndexOf(".") + 1, 
filename.length);
-
-    var mediaType = "";
-    if (extension.length > 0) {
-        mediaType = getMediaType(extension.toLowerCase());
-        if (mediaType == undefined) {
-            mediaType = "";
-        }
-    }
-
-    document.getElementById('uResourceMediaType').value = mediaType;
-}
-
-function fillThemeResourceUploadDetails() {
-
-    var filepath = document.getElementById('uResourceFile').value;
-
-    var filename = "";
-    if (filepath.indexOf("\\") != -1) {
-        filename = filepath.substring(filepath.lastIndexOf('\\') + 1, 
filepath.length);
-    } else {
-        filename = filepath.substring(filepath.lastIndexOf('/') + 1, 
filepath.length);
-    }
-
-    document.getElementById('uResourceName').value = filename;
-    fillThemeResourceUploadMediaTypes();
-}
-
-function fillThemeResourceImportMediaTypes() {
-
-    var filepath = document.getElementById('irFetchURL').value;
-
-    var filename = "";
-    if (filepath.indexOf("\\") != -1) {
-        filename = filepath.substring(filepath.lastIndexOf('\\') + 1, 
filepath.length);
-               filename = filename.replace("?", ".");
-       } else {
-        filename = filepath.substring(filepath.lastIndexOf('/') + 1, 
filepath.length);
-               filename = filename.replace("?", ".");
-    }
-
-    var extension = filename.substring(filename.lastIndexOf(".") + 1, 
filename.length);
-
-    var mediaType = "";
-    if (extension.length > 0) {
-        mediaType = getMediaType(extension);
-        if (mediaType == undefined) {
-            mediaType = "";
-        }
-    }
-       else {
-               extension = filename.substring(filename.lastIndexOf("?") + 1, 
filename.length);
-           if (extension.length > 0) {
-               mediaType = getMediaType(extension);
-           if (mediaType == undefined) {
-                   mediaType = "";
-               }
-       }
-       }
-
-    document.getElementById('irMediaType').value = mediaType;
-}
-
-function fillThemeResourceImportDetails() {
-
-    var filepath = document.getElementById('irFetchURL').value;
-
-    var filename = "";
-    if (filepath.indexOf("\\") != -1) {
-        filename = filepath.substring(filepath.lastIndexOf('\\') + 1, 
filepath.length);
-               filename = filename.replace("?", ".");
-       } else {
-        filename = filepath.substring(filepath.lastIndexOf('/') + 1, 
filepath.length);
-               filename = filename.replace("?", ".");
-    }
-
-    document.getElementById('irResourceName').value = filename;
-    fillThemeResourceImportMediaTypes();
-}
-
-function refreshThemeMetadataSection(path) {
-    var random = Math.floor(Math.random() * 2000);
-    //new Ajax.Updater('metadataDiv', 
'../tenant-theme/metadata_ajaxprocessor.jsp', { method: 'get', parameters: 
{path: path,random:random} });
-}
-
-function refreshThemeContentSection(path) {
-    var random = Math.floor(Math.random() * 2000);
-    new Ajax.Updater('contentDiv', 
'../tenant-theme/content_ajaxprocessor.jsp', { method: 'get', parameters: 
{path: path,random:random} });
-}
-
-function fillThemeContentSection(path, pageNumber, viewMode, consumerID, 
targetDivID) {
-    var random = Math.floor(Math.random() * 2000);
-    new Ajax.Updater('contentDiv', 
'../tenant-theme/content_ajaxprocessor.jsp', { method: 'get', parameters: 
{path: path, requestedPage: pageNumber, mode: 
'standard',resourceViewMode:viewMode,resourcePathConsumer:consumerID,targetDivID:targetDivID,random:random}
 });
-}
-
-
-function viewStandardThemeContentSection(path) {
-    var random = Math.floor(Math.random() * 2000);
-    new Ajax.Updater('contentDiv', 
'../tenant-theme/content_ajaxprocessor.jsp', { method: 'get', parameters: 
{path: path, mode: 'standard',random:random} });
-}
-
-
-function resetThemeResourceForms(){
-    var addSelector = document.getElementById('addMethodSelector');
-    addSelector.selectedIndex = 0;
-
-    document.getElementById('uploadContentUI').style.display = "";
-    document.getElementById('importContentUI').style.display = "none";
-    document.getElementById('textContentUI').style.display = "none";
-
-}
-
-
-
-function displayThemeContentAsText(resourcePath) {
-
-    new Ajax.Request('../tenant-theme/display_text_content_ajaxprocessor.jsp',
-    {
-        method:'post',
-        parameters: {path: resourcePath},
-
-        onSuccess: function(transport) {
-            document.getElementById('generalContentDiv').innerHTML = 
transport.responseText;
-        },
-
-        onFailure: function(transport){
-            if (trim(transport.responseText)) {
-               
CARBON.showWarningDialog(org_wso2_carbon_registry_resource_ui_jsi18n["unsupported.media.type.to.display"]
 + " " + transport.responseText);
-            } else {
-               
CARBON.showWarningDialog(org_wso2_carbon_registry_resource_ui_jsi18n["unsupported.media.type.to.display"]);
-            }
-        }
-    });
-
-    var textDiv = document.getElementById('generalContentDiv');
-    textDiv.style.display = "block";
-}
-var myEditor = null;
-var imagePaths = null;
-function cssEditorDisplay(resourcePath,toDiv,imagePaths){
-    this.imagePaths = imagePaths;
-    new Ajax.Request('../tenant-theme/edit_text_content_ajaxprocessor.jsp',
-    {
-        method:'post',
-        parameters: {path: resourcePath},
-
-        onSuccess: function(transport) {
-            document.getElementById(toDiv).innerHTML = transport.responseText;
-            YAHOO.util.Event.onAvailable('editTextContentID', function() {
-                editAreaLoader.init({
-                    id : "editTextContentID"        // textarea id
-                    ,syntax: "css"            // syntax to be uses for 
highgliting
-                    ,start_highlight: true        // to display with highlight 
mode on start-up
-                });
-            });
-        },
-
-        onFailure: function(transport) {
-            if (trim(transport.responseText)) {
-                
CARBON.showInfoDialog(org_wso2_carbon_registry_resource_ui_jsi18n["unsupported.media.type.to.edit"]
 + " " + transport.responseText);
-            } else {
-                
CARBON.showInfoDialog(org_wso2_carbon_registry_resource_ui_jsi18n["unsupported.media.type.to.edit"]);
-            }
-        }
-    });
-}
-function save_text(id, content){
-
-                       alert("Here is the content of the EditArea '"+ id +"' 
as received by the save callback function:\n"+content);
-               
-}
-function displayEditThemeContentAsText(resourcePath) {
-    new Ajax.Request('../tenant-theme/edit_text_content_ajaxprocessor.jsp',
-    {
-        method:'post',
-        parameters: {path: resourcePath},
-
-        onSuccess: function(transport) {
-               document.getElementById('generalContentDiv').innerHTML = 
transport.responseText;
-        },
-
-        onFailure: function(transport){
-                if (trim(transport.responseText)) {
-                       
CARBON.showInfoDialog(org_wso2_carbon_registry_resource_ui_jsi18n["unsupported.media.type.to.edit"]
 + " " + transport.responseText);
-                } else {
-                       
CARBON.showInfoDialog(org_wso2_carbon_registry_resource_ui_jsi18n["unsupported.media.type.to.edit"]);
-                }
-        }
-    });
-
-    var textDiv = document.getElementById('generalContentDiv');
-    textDiv.style.display = "block";
-}
-function cancelTextContentEdit(displayCssEditor){
-    if(displayCssEditor){
-         location.reload(true);
-    }
-}
-function updateThemeTextContent(resourcePath,displayCssEditor) {
-    var cssText = editAreaLoader.getValue("editTextContentID");
-
-    //$('saveContentButtonID').disabled = true;
-    new Ajax.Request('../tenant-theme/update_text_content.jsp',
-    {
-        method:'post',
-        parameters: {resourcePath: resourcePath, contentText: cssText},
-
-        onSuccess: function() {
-            if(displayCssEditor){
-                //alert(resourcePath);
-
-                location.reload(true);
-                
-            }
-            //refreshThemeContentSection(resourcePath);
-        },
-
-        onFailure: function(transport) {
-            
showRegistryError(org_wso2_carbon_registry_resource_ui_jsi18n["failed.to.update"]
 + " " + transport.responseText);
-            document.getElementById('saveContentButtonID').disabled = false;
-        }
-    });
-
-    var textDiv = document.getElementById('generalContentDiv');
-    //textDiv.style.display = "block";
-}
-
-
-
-function renameThemeResource(parentPath, oldResourcePath, resourceEditDivID, 
wantedPage, type) {
-
-    var reason = "";
-    document.getElementById(resourceEditDivID).value = 
ltrim(document.getElementById(resourceEditDivID).value);
-    reason += validateEmpty(document.getElementById(resourceEditDivID), 
org_wso2_carbon_registry_resource_ui_jsi18n["name"]);
-    if (reason == "") {
-        reason += validateIllegal(document.getElementById(resourceEditDivID), 
org_wso2_carbon_registry_resource_ui_jsi18n["name"]);
-    }
-    if (reason == "") {
-        reason += 
validateResourcePathAndLength(document.getElementById(resourceEditDivID));
-    }
-    var resourcePath= parentPath + '/' + 
document.getElementById(resourceEditDivID).value;
-    resourcePath = resourcePath.replace("//", "/");
-    if (reason == "") {
-        reason += validateExists(resourcePath);
-    }
-
-    if (reason != "") {
-        CARBON.showWarningDialog(reason);
-        return false;
-
-    } else {
-
-        var newName = document.getElementById(resourceEditDivID).value;
-
-        new Ajax.Request('../tenant-theme/rename_resource_ajaxprocessor.jsp',
-        {
-            method:'post',
-            parameters: {parentPath: parentPath, oldResourcePath: 
oldResourcePath, newName: newName, type: type},
-
-            onSuccess: function() {
-                displaySuccessMessage(resourcePath, 
org_wso2_carbon_registry_resource_ui_jsi18n["renamed"]);
-                fillThemeContentSection(parentPath, wantedPage);
-            },
-
-            onFailure: function(transport) {
-                addSuccess = false;
-                CARBON.showErrorDialog(transport.responseText);
-            }
-        });
-    }
-    return true;
-    loadData();
-}
-
-
-var deleteConfirms = 0;
-function deleteThemeResource(pathToDelete, parentPath) {
-    if(deleteConfirms != 0){
-    return;
-    }
-    deleteConfirms++;
-
-
-    sessionAwareFunction(function() {
-        
CARBON.showConfirmationDialog(org_wso2_carbon_registry_resource_ui_jsi18n["are.you.sure.you.want.to.delete"]
 + "<strong>'" + pathToDelete + "'</strong> " + 
org_wso2_carbon_registry_resource_ui_jsi18n["permanently"], function() {
-        deleteConfirms = 0;
-            var addSuccess = true;
-            new Ajax.Request('../tenant-theme/delete_ajaxprocessor.jsp',
-            {
-                method:'post',
-                parameters: {pathToDelete: pathToDelete},
-
-                onSuccess: function() {
-                    refreshThemeContentSection(parentPath);
-
-                },
-
-                onFailure: function() {
-                    addSuccess = false;
-                }
-            });
-        },
-        function() {
-            deleteConfirms = 0;
-        }
-        ,function() {
-            deleteConfirms = 0;
-        }
-        );
-
-     }, org_wso2_carbon_registry_resource_ui_jsi18n["session.timed.out"]);     
  
-    loadData();
-
-}
-
-
-function hideThemeOthers(id, type) {
-    var renamePanel = document.getElementById("rename_panel" + id);
-
-
-    if (type == "rename") {
-    }
-    if (type == "del") {
-        if (renamePanel.style.display != "none") renamePanel.style.display = 
"none";
-    }
-}
-function toggleImagePathPicker(){
-    
-}
-function filterImagePathPicker() {
-    YAHOO.util.Event.onAvailable('flickr_search', function() {
-
-        $('flickr_results').innerHTML = "";
-        var selectedImages = new Array();
-        var showAll = true;
-        var illegalChars = /([^a-zA-Z0-9_\-\x2E\&\?\/\:\,\s\*])/;
-if($('flickr_search').value == "")
-{
-//CARBON.showWarningDialog("Enter string");
-}
-else
-{
-        if (illegalChars.test($('flickr_search').value)) 
-       {
-            //CARBON.showWarningDialog("Ileagal characters");
-
-        }
-        if ( $('flickr_search').value == "*")
-       {
-            selectedImages = imagePaths;
-        } else {
-            var imgRegExp = new RegExp($('flickr_search').value);
-            for (var i = 0; i < imagePaths.length; i++) {
-                if (imagePaths[i].search(imgRegExp) != -1) {
-                    selectedImages.push(imagePaths[i]);
-                }
-            }
-        }
-}
-        var ulObj = document.createElement("UL");
-        YAHOO.util.Dom.addClass(ulObj, "imageList");
-        for (i = 0; i < selectedImages.length; i++) {
-
-            var imgObj = '<li><a id="flickimg' + i + '">' + selectedImages[i] 
+ '</a></li>';
-            ulObj.innerHTML += imgObj;
-
-        }
-        $('flickr_results').appendChild(ulObj);
-
-        for (i = 0; i < selectedImages.length; i++) {
-
-            YAHOO.util.Event.addListener("flickimg" + i, "click", function(e, 
obj) {
-                //insertAtCursor($('editTextContentID'),obj);
-                addToSelected(obj);
-            }, selectedImages[i]);
-
-        }
-    });
-}
-function addToSelected(obj){
-    YAHOO.util.Event.onAvailable('flickr_selected', function() {
-        $('flickr_selected').style.display = "";
-        $('flickr_selected').innerHTML = obj;
-    });
-}
-function previewImagePath() {
-    var imagePath = $('flickr_selected').innerHTML;
-    var imageData = '<div style="padding:20px"><img 
src="'+getThemeResourceViewAsImageURL(imagePath)+'" id="imagePreviwer" /></div>'
-    CARBON.showPopupDialog(imageData,"Image Preview");
-}
-function insertImagePath(){
-    var text = $('flickr_selected').innerHTML;
-    editAreaLoader.setSelectedText('editTextContentID', text);
-}
-function getThemeResourceViewAsImageURL(path) {
-        return "../../registry/themeResourceContent?path=" + path + 
"&viewImage=1";
-}
-//myField accepts an object reference, myValue accepts the text strint to add
-function insertAtCursor(myField, myValue) {
-    //IE support
-    var scrollPos = myField.scrollTop;
-    if (document.selection) {
-        myField.focus();
-        //in effect we are creating a text range with zero
-        //length at the cursor location and replacing it
-        //with myValue
-        sel = document.selection.createRange();
-        sel.text = myValue;
-    }
-   
-    //Mozilla/Firefox/Netscape 7+ support
-    else if (myField.selectionStart || myField.selectionStart == '0'){
-
-    //Here we get the start and end points of the
-    //selection. Then we create substrings up to the
-    //start of the selection and from the end point
-    //of the selection to the end of the field value.
-    //Then we concatenate the first substring, myValue,
-    //and the second substring to get the new value.
-    var startPos = myField.selectionStart;
-    var endPos = myField.selectionEnd;
-    myField.value = myField.value.substring(0, startPos) + myValue + 
myField.value.substring(endPos, myField.value.length);
-}
-else
-{
-    myField.value += myValue;
-}
-    myField.scrollTop = scrollPos;
-}
-
-function whileThemeResourceUpload(){
-    if(document.getElementById('add-resource-div')) {
-        document.getElementById('add-resource-div').style.display = "none";
-    }
-    document.getElementById('whileUpload').style.display = "";
-
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/logo_mgt.jsp
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/logo_mgt.jsp
 
b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/logo_mgt.jsp
deleted file mode 100644
index 360d3b5..0000000
--- 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/logo_mgt.jsp
+++ /dev/null
@@ -1,221 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"; %>
-<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"; 
prefix="carbon" %>
-<%@ page import="org.wso2.carbon.registry.common.utils.RegistryUtil" %>
-<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
-<%@ page import="org.apache.stratos.theme.mgt.ui.utils.ThemeUtil" %>
-<%@ page 
import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-response.setHeader("Pragma", "no-cache");
-%>
-
-<jsp:include page="../dialog/display_messages.jsp"/>
-
-<!-- YUI inculudes for rich text editor -->
-<link rel="stylesheet" type="text/css"
-      href="../yui/build/editor/assets/skins/sam/simpleeditor.css"/>
-<link type="text/css" href="css/tenent-theme.css" rel="stylesheet" />
-<link rel="stylesheet" type="text/css" href="../yui/assets/yui.css" >
-<link rel="stylesheet" type="text/css" 
href="../yui/build/menu/assets/skins/sam/menu.css" />
-<link rel="stylesheet" type="text/css" 
href="../yui/build/button/assets/skins/sam/button.css" />
-<link rel="stylesheet" type="text/css" 
href="../yui/build/container/assets/skins/sam/container.css" />
-<link rel="stylesheet" type="text/css" 
href="../yui/build/autocomplete/assets/skins/sam/autocomplete.css" />
-<link rel="stylesheet" type="text/css" 
href="../yui/build/editor/assets/skins/sam/editor.css" />
-
-<script type="text/javascript" 
src="../yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
-<script type="text/javascript" 
src="../yui/build/element/element-beta-min.js"></script>
-<script type="text/javascript" 
src="../yui/build/container/container_core-min.js"></script>
-<script type="text/javascript" 
src="../yui/build/editor/simpleeditor-min.js"></script>
-
-<script type="text/javascript" src="../admin/js/jquery.js"></script>
-<script type="text/javascript" src="../admin/js/jquery.form.js"></script>
-<script type="text/javascript" 
src="../dialog/js/jqueryui/jquery-ui.min.js"></script>
-
-<!-- other includes -->
-<jsp:include page="../registry_common/registry_common-i18n-ajaxprocessor.jsp"/>
-<script type="text/javascript" 
src="../registry_common/js/registry_validation.js"></script>
-<script type="text/javascript" 
src="../registry_common/js/registry_common.js"></script>
-<script type="text/javascript" src="../ajax/js/prototype.js"></script>
-<script type="text/javascript" 
src="../tenant-theme/js/theme_resource_util.js"></script>
-<jsp:include page="../resources/resources-i18n-ajaxprocessor.jsp"/>
-<script type="text/javascript" src="../resources/js/resource_util.js"></script>
-<script type="text/javascript" 
src="../tenant-theme/js/theme_resource_util.js"></script>
-<link rel="stylesheet" type="text/css" href="../resources/css/registry.css"/>
-<link rel="stylesheet" type="text/css" href="../tenant-theme/css/tenant.css"/>
-<link rel="stylesheet" type="text/css" 
href="../tenant-theme/css/theme-mgt.css"/>
-
-<script language="javascript" type="text/javascript">
-
-</script>
-<%--Syntax hylighter include--%>
-<script language="javascript" type="text/javascript" 
src="../tenant-theme/js/editarea/edit_area/edit_area_full.js"></script>
-
-
-<fmt:bundle basename="org.apache.stratos.theme.mgt.ui.i18n.Resources">
-
-<% 
-    String updateThemeVal = request.getParameter("updateTheme");
-     if("Failed".equals(updateThemeVal)){
-%>
-
-    <script type="text/javascript">
-        jQuery(document).ready(function() {
-            CARBON.showErrorDialog('Error in updating the theme, Please try 
again setting the theme again.');
-        });
-    </script>
-<%
-    }
-
-    String onceMessageShowed = 
(String)session.getAttribute("once-message-showed");
-    if ("Success".equals(updateThemeVal) && !"true".equals(onceMessageShowed)) 
{
-%>
-    <script type="text/javascript">
-        // we need to refresh the page to load the theme
-        jQuery(document).ready(function() {
-            CARBON.showWarningDialog('The theme successfully updated. Please 
refresh the page to load the theme.');
-        });
-    </script>
-<%
-        session.setAttribute("once-message-showed", "true");
-    }
-    if ("Success".equals(updateThemeVal) && "true".equals(onceMessageShowed)) {
-        session.setAttribute("once-message-showed", "false");
-%>
-    <script type="text/javascript">
-        // we need to refresh the page to load the theme
-        window.location.href="logo_mgt.jsp";
-    </script>
-<%
-    }
-
-
-    String parentPathToUpload = "/";
-    String logoFilename = "logo.gif";
-
-    // to derive the thumbnail url
-    //Customization of UI theming per tenant
-
-
-%>
-
-
-<carbon:breadcrumb label="resources"
-                       
resourceBundle="org.apache.stratos.theme.mgt.ui.i18n.Resources"
-                       topPage="true" request="<%=request%>"/>
-<div id="middle">
-<h2><fmt:message key="logo.management"/></h2>
-<div id="workArea">
-
-
-<div class="subtopic"><fmt:message key="change.the.logo"/></div>
-<div class="subcontent">
-
-<table>
-<tbody>
-<tr>
-    <td colspan="2">
-       <table class="normal">
-               <tr>
-                   <td style="width:117px;*width:120px;">
-                <img width="300px" src="<%=ThemeUtil.getLogoURL(config, 
session)%>"></td>
-                   <td>
-            <!-- we are creating another sub table here -->
-            <table></tr></td>
-                       <select id="addMethodSelector" 
onchange="viewAddResourceUI()">
-                           <option value="upload" 
selected="selected"><fmt:message key="update.logo.image.from.file"/></option>
-                           <option value="import"><fmt:message 
key="update.logo.image.from.url"/></option>
-                </select>
-                   </td>
-            </tr>
-            <tr>
-                <td>
-
-<table>
-<!-- upload file UI -->
-<tr  id="uploadContentUI">
-<td colspan="2">
-<form onsubmit="return submitUploadThemeContentForm();" method="post" 
name="resourceUploadForm"
-      id="resourceUploadForm"
-      action="../../fileupload/themeResource?redirectto=logo_mgt" 
enctype="multipart/form-data" target="_self">
-    <input type="hidden" id="path" name="path" 
value="<%=parentPathToUpload%>"/>
-    <input id="uResourceFile" type="file" name="upload" 
style="background-color:#cccccc" onkeypress="return blockManual(event)"
-                   onchange="fillThemeResourceUploadMediaTypes();"/>
-    <input type="button" value="Update" 
onclick="whileThemeResourceUpload();submitUploadThemeContentForm();"/>
-            <div class="helpText" id="fileHelpText">
-
-<fmt:bundle basename="org.apache.stratos.theme.mgt.ui.i18n.Resources">
-                <fmt:message key="image.path.help.text"/>
-</fmt:bundle>
-            </div>
-            <input id="uResourceName" name="filename" type="hidden" 
value="<%=logoFilename%>"
-                   style="margin-bottom:10px;"/>
-            <input id="uResourceMediaType" type="hidden" name="mediaType"
-                   style="margin-bottom:10px;"/>
-</form>
-</td>
-</tr>
-
-<!-- import content UI -->
-
-<tr id="importContentUI" style="display:none;">
-<td colspan="2">
-<form method="post" name="resourceImportForm"
-      id="resourceImportForm"
-      action="/wso2registry/system/fetchResource">
-    <input type="hidden" id="irParentPath" name="path" 
value="<%=parentPathToUpload%>"/>
-    <input id="irFetchURL" type="text" name="fetchURL"
-           onchange="fillThemeResourceImportMediaTypes();"/>
-    <input type="button" value="Update" 
onclick="whileThemeResourceUpload();submitImportThemeContentForm();"/>
-
-            <div class="helpText" id="urlHelpText" style="color:#9a9a9a;">
-                <fmt:message key="image.url.help.text"/>
-            </div>
-            <input id="irResourceName" name="resourceName" type="hidden" 
value="<%=logoFilename%>"
-                   style="margin-bottom:10px;"/>
-            <input id="irMediaType" type="hidden" name="mediaType"
-                   style="margin-bottom:10px;"/>
-</form>
-</td>
-</tr>
-
-</table>    
-            </td>
-        </tr>
-            </table>
-            </td>
-            </tr>
-       </table>
-
-        <div id="whileUpload" 
style="display:none;padding-top:0px;margin-top:20px;margin-bottom:20px;" 
class="ajax-loading-message">
-            <img align="top" src="../resources/images/ajax-loader.gif"/>
-            <span><fmt:message key="wait.message"/></span>
-        </div>
-    </td>
-</tr>
-
-
-</tbody>
-</table>
-</div>
-   
-</div>
-
-</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/metadata_resourcepath.jsp
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/metadata_resourcepath.jsp
 
b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/metadata_resourcepath.jsp
deleted file mode 100644
index 2614f10..0000000
--- 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/metadata_resourcepath.jsp
+++ /dev/null
@@ -1,107 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-<%@ page import="org.wso2.carbon.registry.core.RegistryConstants" %>
-<%@ page 
import="org.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.MetadataBean"
 %>
-<%@ page 
import="org.apache.stratos.theme.mgt.stub.registry.resource.stub.common.xsd.WebResourcePath"
 %>
-<%@ page import="org.wso2.carbon.registry.resource.ui.Utils" %>
-<%@ page 
import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-    String cookie = (String) 
session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-    String viewMode = Utils.getResourceViewMode(request);
-    String synapseRegistryMetaDataRootPath =
-            RegistryConstants.ROOT_PATH + "carbon" + 
RegistryConstants.PATH_SEPARATOR + "synapse-registries";
-    String resourceConsumer = Utils.getResourceConsumer(request);
-    String targetDivID = Utils.getTargetDivID(request);
-    MetadataBean metadata;
-    try {
-        if(request.getParameter("item") != null){
-            ThemeMgtServiceClient client = new ThemeMgtServiceClient(cookie, 
config, session);
-            metadata = 
client.getMetadata(request,request.getParameter("item"));
-//            metadata = client.getMetadata(request);
-
-        }
-        else{
-
-            ThemeMgtServiceClient client = new ThemeMgtServiceClient(cookie, 
config, session);
-            metadata = client.getMetadata(request);
-        }
-    } catch (Exception e) {
-        request.setAttribute(CarbonUIMessage.ID,new 
CarbonUIMessage(null,null,e));
-%>
-<jsp:forward page="../admin/error.jsp?<%=e.getMessage()%>"/>
-<%
-        return;
-    }
-%>
-
-<table cellspacing="0" cellpadding="0" border="0" style="width:100%">
-    <tr class="top-toolbar-back">
-        <td valign="middle" style="width:35px;">
-
-            <!-- Page resource path prints here -->
-
-            <%
-                WebResourcePath[] iNavPaths = metadata.getNavigatablePaths();
-                String path = "";
-                if (iNavPaths.length > 0) {
-                    WebResourcePath rootPath = iNavPaths[0];
-                    path = RegistryConstants.ROOT_PATH;
-
-            %>
-            <a href="#" 
style="font-size:10px;font-weight:bold;position:absolute;margin-top:-10px;margin-left:5px;"
-               
onclick="loadThemeResourcePage('<%=rootPath.getNavigatePath()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"
-               title="Go to root resource">Root<br/><img
-                    src="../resources/images/to-root.gif" border="0" 
align="top"/></a>
-        </td>
-        <td valign="middle" style="padding-left:0px;"><a 
class="registry-breadcrumb"
-                                                         href="#"
-                                                         
onclick="loadThemeResourcePage('<%=rootPath.getNavigatePath()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"
-                                                         title="root">/</a><%
-
-
-            if (iNavPaths.length > 1) {
-                WebResourcePath childPath = iNavPaths[1];
-                path = childPath.getNavigatePath();
-
-        %><a class="registry-breadcrumb" href="#"
-             
onclick="loadThemeResourcePage('<%=childPath.getNavigatePath()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"><%=childPath.getNavigateName()%></a><%
-
-
-            }
-
-            if (iNavPaths.length > 2) {
-                for (int i = 2; i < iNavPaths.length; i++) {
-                    WebResourcePath resourcePath = iNavPaths[i];
-                    path = resourcePath.getNavigatePath();
-
-        %>/<a class="registry-breadcrumb" href="#"
-              
onclick="loadThemeResourcePage('<%=resourcePath.getNavigatePath()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"><div
 style="display:inline" id=<%="pathResult"+i 
%>><%=resourcePath.getNavigateName()%></div></a><%
-                }
-            }
-                }
-            %>
-
-            <span style="clear:both;"/>
-        </td>
-
-    </tr>
-</table>

http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/raw-collection-content.jsp
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/raw-collection-content.jsp
 
b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/raw-collection-content.jsp
deleted file mode 100644
index cf362fc..0000000
--- 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/raw-collection-content.jsp
+++ /dev/null
@@ -1,756 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"; %>
-
-<%@ page import="org.wso2.carbon.registry.common.ui.UIConstants" %>
-<%@ page import="org.wso2.carbon.registry.common.ui.utils.UIUtil" %>
-<%@ page import="org.wso2.carbon.registry.core.RegistryConstants" %>
-<%@ page 
import="org.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.CollectionContentBean"
 %>
-<%@ page 
import="org.apache.stratos.theme.mgt.stub.registry.resource.stub.common.xsd.ResourceData"
 %>
-<%@ page import="org.wso2.carbon.registry.resource.ui.Utils" %>
-<%@ page 
import="org.wso2.carbon.registry.resource.ui.clients.ResourceServiceClient" %>
-<%@ page 
import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="org.apache.stratos.theme.mgt.ui.utils.ThemeUtil" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page import="java.util.LinkedList" %>
-<%@ page import="java.util.List" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-
-<%
-    String cookie = (String) 
session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-    String viewMode = Utils.getResourceViewMode(request);
-    String actionStyle = "inlined".equals(viewMode) ? "display:none;" : "";
-    String resourceConsumer = Utils.getResourceConsumer(request);
-    String targetDivID = Utils.getTargetDivID(request);
-    String requestedPage = request.getParameter(UIConstants.REQUESTED_PAGE);
-
-    CollectionContentBean ccb;
-    ResourceServiceClient resourceServiceClient;
-    ThemeMgtServiceClient client;
-    try {
-        resourceServiceClient = new ResourceServiceClient(cookie, config, 
session);
-
-        client = new ThemeMgtServiceClient(cookie, config, session);
-        ccb = client.getCollectionContent(request);
-    } catch (Exception e) {
-%>
-<jsp:forward page="../admin/error.jsp?<%=e.getMessage()%>"/>
-<%
-        return;
-    }
-%>
-<fmt:bundle basename="org.wso2.carbon.registry.resource.ui.i18n.Resources">
-
-<div id="whileUpload" 
style="display:none;padding-top:0px;margin-top:20px;margin-bottom:20px;" 
class="ajax-loading-message">
-       <img align="top" src="../resources/images/ajax-loader.gif"/>
-       <span>Process may take some time. Please wait..</span>
-</div>
-<div class="add-resource-div" id="add-resource-div" style="display:none;">
-
-
-<input type="hidden" name="path" value="<%=ccb.getPathWithVersion()%>"/>
-
-<div class="validationError" id="resourceReason" style="display:none;"></div>
-
-<table cellpadding="0" cellspacing="0" border="0" class="styledLeft noBorders">
-<thead>
-<fmt:bundle basename="org.apache.stratos.theme.mgt.ui.i18n.Resources">
-<tr>
-    <th colspan="2"><strong><fmt:message key="add.image"/></strong></th>
-</tr>
-</thead>
-<tbody>
-<tr>
-    <td colspan="2">
-       <table class="normal">
-               <tr>
-                   <td style="width:117px;*width:120px;"><fmt:message 
key="method"/></td>
-                   <td>
-                       <select id="addMethodSelector" 
onchange="viewAddResourceUI()">
-                           <option value="upload" 
selected="selected"><fmt:message key="upload.image.from.file"/></option>
-                           <option value="import"><fmt:message 
key="import.image.from.url"/></option>
-                </select>
-                   </td>
-               </tr>
-
-       </table>
-    </td>
-</tr>
-</fmt:bundle>
-
-
-
-
-<!-- upload file UI -->
-<tr  id="uploadContentUI">
-<td colspan="2">
-<form onsubmit="return submitUploadThemeContentForm();" method="post" 
name="resourceUploadForm"
-      id="resourceUploadForm"
-      action="../../fileupload/themeResource" enctype="multipart/form-data" 
target="_self">
-    <input type="hidden" id="path" name="path" 
value="<%=ccb.getPathWithVersion()%>"/>
-
-
-    <table class="styledLeft">
-    <tr>
-        <td class="middle-header" colspan="2"><fmt:message 
key="upload.content.from.file1"/></td>
-    </tr>
-    <tr>
-        <td valign="top" style="width:120px;">
-            <span><fmt:message key="file"/> <span 
class="required">*</span></span></td>
-        <td>
-            <input id="uResourceFile" type="file" name="upload" 
style="background-color:#cccccc" onkeypress="return blockManual(event)"
-                   onchange="fillThemeResourceUploadDetails()"/>
-
-            <div class="helpText" id="fileHelpText">
-
-<fmt:bundle basename="org.apache.stratos.theme.mgt.ui.i18n.Resources">
-                <fmt:message key="image.path.help.text"/>
-</fmt:bundle>                
-            </div>
-        </td>
-    </tr>
-    <tr>
-        <td valign="top"><fmt:message key="name"/> <span 
class="required">*</span></td>
-
-        <td><input id="uResourceName" type="text" name="filename"
-                   style="margin-bottom:10px;"/>
-            <input id="uResourceMediaType" type="hidden" name="mediaType"
-                   style="margin-bottom:10px;"/></td>  
-    </tr>
-    <!--<tr>
-        <td valign="top"><fmt:message key="media.type"/></td>
-
-        <td>
-            <input id="uResourceMediaType" type="text" name="mediaType"
-                   style="margin-bottom:10px;"/>
-
-        </td>
-    </tr>
-    <tr>
-        <td valign="top"><fmt:message key="description"/></td>
-        <td><textarea name="description" 
class="normal-textarea"></textarea></td>
-    </tr>  -->
-    <tr>
-        <td class="buttonRow" colspan="2">
-            <input type="button" class="button" value="<fmt:message 
key="add"/>"
-                   
onclick="whileThemeResourceUpload();submitUploadThemeContentForm();"/>
-            <input type="button" class="button" value="<fmt:message 
key="cancel"/>"
-                   onclick="showHide('add-resource-div')"/>
-        </td>
-    </tr>
-    </table>
-
-</form>
-</td>
-</tr>
-
-<!-- import content UI -->
-
-<tr id="importContentUI" style="display:none;">
-<td colspan="2">
-<form method="post" name="resourceImportForm"
-      id="resourceImportForm"
-      action="/wso2registry/system/fetchResource">
-    <input type="hidden" id="irParentPath" name="path" 
value="<%=ccb.getPathWithVersion()%>"/>
-
-
-    <table class="styledLeft">
-    <tr>
-        <td class="middle-header" colspan="2"><fmt:message 
key="import.content.from.url1"/></td>
-    </tr>
-    <tr>
-        <td valign="top" style="width:120px;">
-            <span><fmt:message key="url"/> <span 
class="required">*</span></span></td>
-        <td>
-            <input id="irFetchURL" type="text" name="fetchURL"
-                   onchange="fillThemeResourceImportDetails()"/>
-
-            <div class="helpText" id="urlHelpText" style="color:#9a9a9a;">
-<fmt:bundle basename="org.apache.stratos.theme.mgt.ui.i18n.Resources">
-                <fmt:message key="image.url.help.text"/>
-</fmt:bundle>
-            </div>
-        </td>
-    </tr>
-    <tr>
-        <td valign="top"><fmt:message key="name"/> <span 
class="required">*</span></td>
-
-        <td><input id="irResourceName" type="text" name="resourceName"
-                   style="margin-bottom:10px;"/>
-            <input id="irMediaType" type="hidden" name="mediaType"
-                   style="margin-bottom:10px;"/></td>
-    </tr>
-    <!--<tr>
-        <td valign="top"><fmt:message key="media.type"/></td>
-
-        <td>
-            <input id="irMediaType" type="text" name="mediaType"
-                   style="margin-bottom:10px;"/>
-
-        </td>
-    </tr>
-    <tr>
-        <td valign="top"><fmt:message key="description"/></td>
-        <td><textarea id="irDescription" name="description" 
class="normal-textarea"></textarea></td>
-    </tr>  -->
-    <tr>
-        <td colspan="2" class="buttonRow"><input type="button" class="button"
-                                                 value="<fmt:message 
key="add"/>"
-                                                 
onclick="whileThemeResourceUpload();submitImportThemeContentForm();"/> <input
-                type="button" class="button"
-                value="<fmt:message key="cancel"/>"
-                style="margin-top:10px;"
-                onclick="showHide('add-resource-div')"/>
-        </td>
-    </tr>
-    </table>
-
-</form>
-</td>
-</tr>
-
-<!-- text content UI -->
-
-<tr id="textContentUI" style="display:none;">
-<td colspan="2">
-<form name="textContentForm" id="textContentForm" 
action="/wso2registry/system/addTextResource"
-      method="post">
-    <input type="hidden" id="trParentPath" name="path" 
value="<%=ccb.getPathWithVersion()%>"/>
-
-    <table class="styledLeft">
-    <tr>
-        <td class="middle-header" colspan="2"><fmt:message 
key="text.content1"/></td>
-    </tr>
-    <tr>
-        <td valign="top" style="width:120px;"><fmt:message key="name"/> <span
-                class="required">*</span></td>
-        <td><input type="text" id="trFileName" name="filename" 
style="margin-bottom:10px;"/>
-            <input type="hidden" id="trMediaType" name="mediaType" 
value="text/plain"
-                   style="margin-bottom:10px;"/></td>
-    </tr>
-    <!--<tr>
-        <td valign="top"><fmt:message key="media.type"/></td>
-        <td><input type="text" id="trMediaType" name="mediaType" 
value="text/plain"
-                   style="margin-bottom:10px;"/></td>
-    </tr>
-    <tr>
-        <td valign="top"><fmt:message key="description"/></td>
-        <td>
-            <textarea id="trDescription" name="description"></textarea>
-        </td>
-    </tr>  -->
-    <tr>
-        <td style="vertical-align:top !important;"><fmt:message 
key="content"/></td>
-        <td>
-            <div>
-               <input type="radio" name="richText" checked="checked" 
value="rich" onclick="handleRichText()" /> Rich Text Editor
-               <input type="radio" name="richText" value="plain" 
onclick="handleRichText()" /> Plain Text Editor
-            </div>
-            <textarea id="trPlainContent" 
style="display:none;width:99%;height:200px"></textarea>
-            <div class="yui-skin-sam" id="textAreaPanel">
-                <textarea id="trContent" name="trContent" 
style="display:none;"></textarea>
-            </div>
-        </td>
-    </tr>
-    <tr>
-        <td colspan="2" class="buttonRow">
-            <input type="button" class="button" value="<fmt:message 
key="add"/>"
-                   style="margin-top:10px;"
-                   
onclick="whileThemeResourceUpload();submitThemeTextContentForm();"/>
-            <input type="button" class="button"
-                   value="<fmt:message key="cancel"/>"
-                   onclick="showHide('add-resource-div')"/>
-        </td>
-    </tr>
-    </table>
-
-</form>
-</td>
-</tr>
-
-</tbody>
-</table>
-</div>
-
-
-<!-- Add folder div -->
-<div class="add-resource-div" id="add-folder-div" style="display:none;">
-
-    <form name="collectionForm" method="post" 
action="add_collection_ajaxprocessor.jsp"
-          onsubmit="return submitThemeCollectionAddForm();">
-        <input id="parentPath" type="hidden" name="parentPath"
-               value="<%=ccb.getPathWithVersion()%>"/>
-
-        <div class="validationError" id="collectionReason" 
style="display:none;"></div>
-        <table width="100%" border="0" cellspacing="0" cellpadding="0" 
class="styledLeft noBorders">
-            <tbody>
-            <tr>
-                <td class="middle-header" colspan="2"><strong><fmt:message
-                        key="add.collection"/></strong></td>
-            </tr>
-            <tr>
-                <td valign="top" style="width:120px;"><fmt:message 
key="name"/> <span
-                        class="required">*</span></td>
-
-                <td><input type="text" id="collectionName" 
name="collectionName"/>
-                <input id="mediaType" type="hidden" value="<fmt:message 
key="none"/>"/>
-                </td>
-            </tr>
-            <!--
-            <tr>
-                <td valign="top"><fmt:message key="media.type1"/></td>
-                <td>
-                    <select id="mediaType" onchange="updateOther('mediaType', 
'<fmt:message key="other"/>')">
-                        <option value=""><fmt:message key="none"/></option>
-                    <option value="<fmt:message key="other"/>"><fmt:message 
key="other"/></option>
-                </select>&nbsp;&nbsp;
-                <span id="mediaTypeOther" style="display:none"><fmt:message 
key="other.display"/>&nbsp;
-                    <input type="text" id="mediaTypeOtherValue"/>
-                </span>
-                </td>
-            </tr>
-            <tr>
-                <td valign="top"><fmt:message key="description"/></td>
-                <td><textarea name="description" id="colDesc" 
class="normal-textarea"></textarea>
-                </td>
-            </tr> -->
-            <tr>
-                <td class="buttonRow" colspan="2">
-                    <input type="button" class="button"
-                           value="<fmt:message key="add"/>"
-                           onclick="submitThemeCollectionAddForm()"/>
-                    <input type="button" class="button"
-                           value="<fmt:message key="cancel"/>"
-                           onclick="showHide('add-folder-div')"/>
-                </td>
-            </tr>
-            </tbody>
-        </table>
-    </form>
-</div>
-<div id="entryListReason" class="validationError" style="display: none;"></div>
-<div id="entryList">
-<%
-
-%>
-<table cellpadding="0" cellspacing="0" border="0" style="width:100%"
-       class="styledLeft" id="resourceColTable">
-<%
-    if (ccb.getChildCount() != 0) {
-%>
-<thead>
-<tr>
-    <th><fmt:message key="name"/></th>
-    <th style="width:250px;"><fmt:message key="action"/></th>
-</tr>
-</thead>
-<tbody>
-<%
-    int totalCount = ccb.getChildCount();
-
-    int start;
-    int end;
-    int itemsPerPage = RegistryConstants.ITEMS_PER_PAGE;
-
-    int pageNumber;
-    if (requestedPage != null) {
-        pageNumber = new Integer(requestedPage).intValue();
-    } else {
-        pageNumber = 1;
-    }
-
-    int numberOfPages = 1;
-    if (totalCount % itemsPerPage == 0) {
-        numberOfPages = totalCount / itemsPerPage;
-    } else {
-        numberOfPages = totalCount / itemsPerPage + 1;
-    }
-
-    if (totalCount < itemsPerPage) {
-        start = 0;
-        end = totalCount;
-    } else {
-        start = (pageNumber - 1) * itemsPerPage;
-        end = (pageNumber - 1) * itemsPerPage + itemsPerPage;
-    }
-    String[] nodes = Utils.getSortedChildNodes(ccb.getChildPaths());
-    List<String> availableNodes = new LinkedList<String>();
-    for (String node : nodes) {
-        try {
-            if (node != null && client.getResourceTreeEntry(node) != null) {
-                availableNodes.add(node);
-            }
-        } catch (Exception ignore) {}
-    }
-    String[] allChildNodes = availableNodes.toArray(new 
String[availableNodes.size()]);
-    ResourceData[] resourceDataSet;
-    try {
-        resourceDataSet = client.getResourceData(UIUtil.getChildren(start, 
itemsPerPage, allChildNodes));
-    } catch(Exception e) {
-        %>
-<jsp:include page="../admin/error.jsp"/>
-<%
-        return;
-    }
-    int entryNumber = 0;
-
-    //for (int i = start; i <= end; i++) {
-    for (int ri = 0; ri < resourceDataSet.length; ri++) {
-        ResourceData resourceData = resourceDataSet[ri];
-        //    ResourceData resourceData = (ResourceData) 
collection.getResourceDataList().get(i);
-        entryNumber++;
-%>
-
-<tr id="1">
-
-    <td valign="top">
-
-
-               <% if 
(resourceData.getResourceType().equals(UIConstants.COLLECTION)) { %>
-               <a class=<% if(resourceData.getLink()){
-                               if (!resourceData.getMounted()) {
-                               %>"folder-small-icon-link-y"<%
-                               }else{
-                               %>"folder-small-icon-link-x"<%
-                               }
-                       }else {
-                        %>"folder-small-icon-link"<%
-                        } %>
-                  
onclick="loadThemeResourcePage('<%=resourceData.getResourcePath()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"
-                  id="resourceView<%=entryNumber%>"
-                  
title="<%=resourceData.getName()%>"><%=resourceData.getName()%>
-               </a>
-
-
-               <% } else { %>
-                <a class=<% if(resourceData.getLink()){
-                               if (!resourceData.getMounted()) {
-                               %>"resource-icon-link-y"<%
-                               }else{
-                               %>"resource-icon-link-x"<%
-                               }
-                       }else {
-                        %>"resource-icon-link trimer"<%
-                        } %>
-                  <% if(!resourceData.getExternalLink()){ %>
-               
onclick="loadThemeResourcePage('<%=resourceData.getResourcePath()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"
-             <% }%>
-                  id="resourceView<%=entryNumber%>" 
title="<%=resourceData.getName()%>">
-                   <%=resourceData.getName()%>
-               </a>
-
-               <% } %>
-        </td>
-        <td>
-                <%
-       if (!ccb.getVersionView()) { %>
-
-            <% if 
(resourceData.getResourceType().equals(UIConstants.COLLECTION)) { %>
-
-                   <% if (resourceData.getPutAllowed()){ %>
-                           <a class="edit-icon-link"
-                              
onclick="javascript:showHideCommon('rename_panel<%=entryNumber%>');hideThemeOthers(<%=entryNumber%>,'rename');if($('rename_panel<%=entryNumber%>').style.display!='none')$('resourceEdit<%=entryNumber%>').focus();">
-                               <fmt:message key="rename"/></a>
-                    <% }
-                     if(resourceData.getDeleteAllowed()){%>
-                <a class="delete-icon-link"
-                      onclick="this.disabled = true; 
hideThemeOthers(<%=entryNumber%>,'del');deleteThemeResource('<%=resourceData.getResourcePath()%>',
 '<%=ccb.getPathWithVersion()%>'); this.disabled = false; "
-                           >
-                       <fmt:message key="delete"/></a>
-                <%}%>
-
-
-            <% } else { %>
-                   <% if(resourceData.getDeleteAllowed()){ %>
-                <a class="edit-icon-link"
-                      
onclick="javascript:showHideCommon('rename_panel<%=entryNumber%>');hideThemeOthers(<%=entryNumber%>,'rename');if($('rename_panel<%=entryNumber%>').style.display!='none')$('resourceEdit<%=entryNumber%>').focus();">
-                       <fmt:message key="rename"/></a>
-                <a class="delete-icon-link" style="margin-left:5px"
-                      
onclick="hideThemeOthers(<%=entryNumber%>,'del');deleteThemeResource('<%=resourceData.getResourcePath()%>',
 '<%=ccb.getPathWithVersion()%>')">
-                       <fmt:message key="delete"/></a>
-                   <%} %>
-
-
-            <% } %>
-   <% } %>
-
-    <% if (!ccb.getVersionView() && !resourceData.getAbsent().equals("true")) 
{ %>
-           <% if 
(!resourceData.getResourceType().equals(UIConstants.COLLECTION)) {
-            String path;
-            if (resourceData.getRealPath() != null) {
-                path = resourceData.getRealPath();
-            } else {
-                path = resourceData.getResourcePath();
-            }
-            if (path.startsWith("http")) {
-                %>
-                <a class="download-icon-link"
-                          href="<%=path%>"
-                          target="_blank"><fmt:message key="download"/></a>
-       <%
-            } else {
-        %>
-           <a class="download-icon-link"
-                          
href="<%=ThemeUtil.getThemeResourceDownloadURL(path)%>"
-                          target="_blank"><fmt:message key="download"/></a>
-           <% } }%>
-    <% } %>
-
-
-    </td>
-</tr>
-
-<!--
-<tr class="copy-move-panel" id="copy_panel<%=entryNumber%>" 
style="display:none;">
-    <td colspan="4" align="left">
-        <table cellpadding="0" cellspacing="0" class="styledLeft">
-            <thead>
-            <tr>
-                <th colspan="2">Copy <%=resourceData.getResourceType()%>
-                </th>
-            </tr>
-            </thead>
-            <tbody>
-            <tr>
-                <td><fmt:message key="destination.path"/><span 
class="required">*</span></td>
-                <td><input type="text" 
id="copy_destination_path<%=entryNumber%>"/><input
-                        type="button"
-                        title="<fmt:message key="resource.tree"/>"
-                        
onclick="showCollectionTree('copy_destination_path<%=entryNumber%>');"
-                        value=".." class="button"/></td>
-            </tr>
-            <tr>
-                <td class="buttonRow" colspan="2">
-                    <input type="button" class="button" value="<fmt:message 
key="copy"/>"
-                           onclick="this.disabled = true; 
copyResource('<%=ccb.getPathWithVersion()%>', 
'<%=resourceData.getResourcePath()%>','copy_destination_path<%=entryNumber%>','<%=resourceData.getName()%>',<%=pageNumber%>);
 this.disabled = false;"/>
-                    <input
-                            type="button" style="margin-left:5px;" 
class="button"
-                            value="<fmt:message key="cancel"/>"
-                            
onclick="showHideCommon('copy_panel<%=entryNumber%>')"/></td>
-            </tr>
-            </tbody>
-        </table>
-    </td>
-</tr>
-<tr class="copy-move-panel" id="move_panel<%=entryNumber%>" 
style="display:none;">
-    <td colspan="4" align="left">
-        <table cellpadding="0" cellspacing="0" class="styledLeft">
-            <thead>
-            <tr>
-                <th colspan="2"><fmt:message key="move"/> 
<%=resourceData.getResourceType()%>
-                </th>
-            </tr>
-            </thead>
-            <tbody>
-            <tr>
-                <td><fmt:message key="destination.path"/><span 
class="required">*</span></td>
-                <td><input type="text" 
id="move_destination_path<%=entryNumber%>"/> <input
-                        type="button"
-                        class="button"
-                        title="<fmt:message key="resource.tree"/>"
-                        
onclick="showCollectionTree('move_destination_path<%=entryNumber%>');"
-                        value=".."/></td>
-            </tr>
-            <tr>
-                <td class="buttonRow" colspan="2">
-                    <input type="button" class="button" value="<fmt:message 
key="move"/>"
-                           onclick="this.disabled = true; 
moveResource('<%=ccb.getPathWithVersion()%>', 
'<%=resourceData.getResourcePath()%>','move_destination_path<%=entryNumber%>','<%=resourceData.getName()%>',<%=pageNumber%>);
 this.disabled = false;"/>
-                    <input
-                            type="button" style="margin-left:5px;" 
class="button"
-                            value="<fmt:message key="cancel"/>"
-                            
onclick="showHideCommon('move_panel<%=entryNumber%>')"/></td>
-            </tr>
-            </tbody>
-        </table>
-    </td>
-</tr> -->
-<tr class="copy-move-panel" id="rename_panel<%=entryNumber%>" 
style="display:none;">
-    <td colspan="2" align="left">
-        <table cellpadding="0" cellspacing="0" class="styledLeft">
-            <thead>
-            <tr>
-                <th><fmt:message key="editing.name"/> 
<%=resourceData.getResourceType()%> <fmt:message key="editing.name.name"/>
-                </th>
-            </tr>
-            </thead>
-            <tbody>
-            <tr>
-                <td>New <% if 
(resourceData.getResourceType().equals(UIConstants.COLLECTION)) { %>
-                    <fmt:message key="collection"/><% } else {%><fmt:message 
key="resource"/><% } %>
-                    Name <span class="required">*</span>  <input 
value="<%=resourceData.getName()%>" type="text"
-                                id="resourceEdit<%=entryNumber%>"/></td>
-            </tr>
-            <tr>
-                <td class="buttonRow">
-                    <input type="button" class="button" value="<fmt:message 
key="rename"/>"
-                           onclick="this.disabled = true; 
renameThemeResource('<%=ccb.getPathWithVersion()%>', 
'<%=resourceData.getResourcePath()%>', 
'resourceEdit<%=entryNumber%>',<%=pageNumber%>, <% if 
(resourceData.getResourceType().equals(UIConstants.COLLECTION)) { 
%>'collection'<% } else { %>'resource'<% } %>);this.disabled = false;"/>
-                    <input
-                        type="button" style="margin-left:5px;" class="button"
-                        value="<fmt:message key="cancel"/>"
-                        
onclick="showHideCommon('rename_panel<%=entryNumber%>')"/>
-                </td>
-            </tr>
-            </tbody>
-        </table>
-
-    </td>
-</tr>
-<tr class="copy-move-panel" id="del_panel<%=entryNumber%>" 
style="display:none;">
-    <td colspan="2" align="left">
-        <table cellpadding="0" cellspacing="0" class="styledLeft">
-            <thead>
-            <tr>
-                <th><fmt:message key="confirm.delete"/> 
<%=resourceData.getResourceType()%>
-                </th>
-            </tr>
-            </thead>
-            <tbody>
-            <tr>
-                <td><fmt:message key="confirm.remove.resource.message"/>
-                    <%=resourceData.getResourceType()%> 
'<%=resourceData.getName()%>'
-                    <br/><strong><fmt:message key="warning"/>: </strong>
-                    <fmt:message key="undo.warning.message"/>
-                </td>
-            </tr>
-            <tr>
-                <td class="buttonRow">
-                    <input type="button" class="button" value="<fmt:message 
key="yes"/>"
-                           
onclick="deleteThemeResource('<%=resourceData.getResourcePath()%>', 
'<%=ccb.getPathWithVersion()%>')"/>
-                    <input style="margin-left:5px;" class="button" 
type="button"
-                           value="<fmt:message key="no"/>"
-                           
onclick="showHideCommon('del_panel<%=entryNumber%>')"/>
-                </td>
-            </tr>
-            </tbody>
-        </table>
-    </td>
-</tr>
-
-<% }
-    if (totalCount <= itemsPerPage) {
-        //No paging
-    } else {
-%>
-<tr>
-    <td colspan="2" class="pagingRow" style="padding-top:10px; 
padding-bottom:10px;">
-
-        <%
-            if (pageNumber == 1) {
-        %>
-        <span class="disableLink">< Prev</span>
-        <%
-        } else {
-        %>
-        <a class="pageLinks"
-           onclick="navigateThemePages(<%=(pageNumber-1)%>, 
'<%=ccb.getPathWithVersion()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"><
-            <fmt:message key="prev"/></a>
-        <%
-            }
-            if (numberOfPages <= 10) {
-                for (int pageItem = 1; pageItem <= numberOfPages; pageItem++) 
{ %>
-
-        <a class=<% if(pageNumber==pageItem){ %>"pageLinks-selected"<% } else 
{ %>
-        "pageLinks" <% } %>
-        onclick="navigateThemePages(<%=pageItem%>, 
'<%=ccb.getPathWithVersion()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"
 ><%=pageItem%></a>
-        <% }
-        } else {
-            String place = "middle";
-            int pageItemFrom = pageNumber - 2;
-            int pageItemTo = pageNumber + 2;
-
-            if (numberOfPages - pageNumber <= 5) place = "end";
-            if (pageNumber <= 5) place = "start";
-
-            if (place == "start") {
-                pageItemFrom = 1;
-                pageItemTo = 7;
-            }
-            if (place == "end") {
-                pageItemFrom = numberOfPages - 7;
-                pageItemTo = numberOfPages;
-            }
-
-            if (place == "end" || place == "middle") {
-
-
-                for (int pageItem = 1; pageItem <= 2; pageItem++) { %>
-
-        <a class="pageLinks"
-           onclick="navigateThemePages(<%=pageItem%>, 
'<%=ccb.getPathWithVersion()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"><%=pageItem%>
-        </a>
-        <% } %>
-        ...
-        <%
-            }
-
-            for (int pageItem = pageItemFrom; pageItem <= pageItemTo; 
pageItem++) { %>
-
-        <a class=<% if(pageNumber==pageItem){ %>"pageLinks-selected"<% } else 
{%>"pageLinks"<% } %>
-        onclick="navigateThemePages(<%=pageItem%>, 
'<%=ccb.getPathWithVersion()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"><%=pageItem%></a>
-        <% }
-
-            if (place == "start" || place == "middle") {
-        %>
-        ...
-        <%
-            for (int pageItem = (numberOfPages - 1); pageItem <= 
numberOfPages; pageItem++) { %>
-
-        <a class="pageLinks"
-           onclick="navigateThemePages(<%=pageItem%>, 
'<%=ccb.getPathWithVersion()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')"
-           style="margin-left:5px;margin-right:5px;"><%=pageItem%>
-        </a>
-        <% }
-        }
-
-            if (place == "middle") {
-
-            }
-            //End middle display
-        }
-            if (pageNumber == numberOfPages) {
-        %>
-        <span class="disableLink"><fmt:message key="next"/> ></span>
-        <%
-        } else {
-        %>
-        <a class="pageLinks"
-           onclick="navigateThemePages(<%=(pageNumber+1)%>, 
'<%=ccb.getPathWithVersion()%>','<%=viewMode%>','<%=resourceConsumer%>','<%=targetDivID%>')">Next
-            ></a>
-        <%
-            }
-        %>
-       <span id="xx<%=pageNumber%>" style="display:none" />
-    </td>
-</tr>
-<%
-        }
-    }
-
-%>
-<tr>
-        <%--This empty td is required to solve the bottom margin problem on 
IE. Do not remove!!--%>
-    <td align="left" colspan="2" style="height:0px;border-bottom:0px;">
-    </td>
-</tr>
-</tbody>
-</table>
-
-</div>
-</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/rename_resource_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/rename_resource_ajaxprocessor.jsp
 
b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/rename_resource_ajaxprocessor.jsp
deleted file mode 100644
index 8888424..0000000
--- 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/rename_resource_ajaxprocessor.jsp
+++ /dev/null
@@ -1,42 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-<%@ page 
import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-    String parentPath = request.getParameter("parentPath");
-    String oldResourcePath = request.getParameter("oldResourcePath");
-    String newName = request.getParameter("newName");
-
-    String cookie = (String) request.
-            getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-
-    try {
-        ThemeMgtServiceClient client =
-                new ThemeMgtServiceClient(cookie, config, 
request.getSession());
-        client.renameResource(parentPath, oldResourcePath, newName);
-
-
-    } catch (Exception e) {
-        String type = "resource";
-        response.setStatus(500);
-        out.write("Failed to rename " + type + " " + oldResourcePath + " To " 
+ newName);
-        return;
-    }
-%>

http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_advanced.jsp
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_advanced.jsp
 
b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_advanced.jsp
deleted file mode 100644
index 89d37e2..0000000
--- 
a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_advanced.jsp
+++ /dev/null
@@ -1,140 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"; %>
-<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"; 
prefix="carbon" %>
-<%@ page 
import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-
-
-<jsp:include page="../dialog/display_messages.jsp"/>
-
-<!-- YUI inculudes for rich text editor -->
-<link rel="stylesheet" type="text/css"
-      href="../yui/build/editor/assets/skins/sam/simpleeditor.css"/>
-<link rel="stylesheet" type="text/css" href="../yui/assets/yui.css" >
-<link rel="stylesheet" type="text/css" 
href="../yui/build/menu/assets/skins/sam/menu.css" />
-<link rel="stylesheet" type="text/css" 
href="../yui/build/button/assets/skins/sam/button.css" />
-<link rel="stylesheet" type="text/css" 
href="../yui/build/container/assets/skins/sam/container.css" />
-<link rel="stylesheet" type="text/css" 
href="../yui/build/autocomplete/assets/skins/sam/autocomplete.css" />
-<link rel="stylesheet" type="text/css" 
href="../yui/build/editor/assets/skins/sam/editor.css" />
-
-<script type="text/javascript" 
src="../yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
-<script type="text/javascript" 
src="../yui/build/element/element-beta-min.js"></script>
-<script type="text/javascript" 
src="../yui/build/container/container_core-min.js"></script>
-<script type="text/javascript" 
src="../yui/build/editor/simpleeditor-min.js"></script>
-
-<!-- other includes -->
-<jsp:include page="../registry_common/registry_common-i18n-ajaxprocessor.jsp"/>
-<script type="text/javascript" 
src="../registry_common/js/registry_validation.js"></script>
-<script type="text/javascript" 
src="../registry_common/js/registry_common.js"></script>
-<script type="text/javascript" src="../ajax/js/prototype.js"></script>
-<jsp:include page="../resources/resources-i18n-ajaxprocessor.jsp"/>
-<script type="text/javascript" src="../resources/js/resource_util.js"></script>
-<script type="text/javascript" 
src="../tenant-theme/js/theme_resource_util.js"></script>
-<link rel="stylesheet" type="text/css" href="../resources/css/registry.css"/>
-<link rel="stylesheet" type="text/css" href="../tenant-theme/css/tenant.css"/>
-
-<%--Syntax hylighter include--%>
-<script language="javascript" type="text/javascript" 
src="../tenant-theme/js/editarea/edit_area/edit_area_full.js"></script>
-
-<fmt:bundle basename="org.wso2.carbon.registry.resource.ui.i18n.Resources">
-<%
-    ThemeMgtServiceClient client = new ThemeMgtServiceClient(config, session);
-    boolean resourceExists = false;
-    try {
-        if (client.getResourceTreeEntry("/") != null) {
-            resourceExists = true;
-        }
-    } catch (Exception e) {
-        resourceExists = false;
-    }
-%>
-
-<script type="text/javascript">
-  <!--
-  sessionAwareFunction(function() {
-  <% if (!resourceExists) {
-  //TODO: We should be able to distinguish the two scenarios below. An 
authorization failure
-  //generates a AuthorizationFailedException which doesn't seem to arrive at 
this page.
-  %>
-      CARBON.showErrorDialog("<fmt:message 
key="unable.to.browse"/>",function(){
-          location.href="../admin/index.jsp";
-          return;
-      });
-  <% } else { %>
-      loadMediaTypes();
-  <% } %>
-  }, "<fmt:message key="session.timed.out"/>");
-  // -->
-
-  </script>
-
-<%
-    if (!resourceExists) {
-        return;
-    }
-%>
-
-<carbon:breadcrumb label="resources"
-                       
resourceBundle="org.wso2.carbon.registry.resource.ui.i18n.Resources"
-                       topPage="false" request="<%=request%>"/>
-
-    <%
-        String contraction = "min";
-       if(session.getAttribute( "contraction" )!=null){
-               contraction = (String)session.getAttribute( "contraction" );
-       }
-    %>
-    <style type="text/css">
-        .yui-skin-sam h3 {
-            font-size: 10px !important;
-        }
-
-        .yui-toolbar-container .yui-toolbar-titlebar h2 a {
-            font-size: 11px !important;
-        }
-    </style>
-    <div id="middle">
-
-<fmt:bundle basename="org.apache.stratos.theme.mgt.ui.i18n.Resources">
-        <h2><fmt:message key="theme.management"/></h2>
-</fmt:bundle>
-        <div id="workArea">
-            
-            
-            <jsp:include page="css-editor.jsp" />
-            <div class="resource-path">
-                <jsp:include page="metadata_resourcepath.jsp"/>
-            </div>
-            <div id="contentDiv">
-                <jsp:include page="content_ajaxprocessor.jsp"/>
-            </div>
-        </div>
-
-    </div>
-
-<%--    <div id="resourceTree" style="display:none" class="resourceTreePage">
-        <div class="ajax-loading-message">
-            <img src="/wso2registry/admin/images/ajax-loader.gif" align="top"/>
-            <span><fmt:message key="resource.tree.loading.please.wait"/> 
..</span>
-        </div>
-    </div>
-    <div id="popup-main" style="display:none" class="popup-main">
-    </div>--%>
-</fmt:bundle>

Reply via email to