You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2013/07/11 13:55:15 UTC

[01/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Updated Branches:
  refs/heads/master fcb90b183 -> f63308342


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/service-stubs/org.wso2.carbon.theme.mgt.stub/4.1.0/src/main/resources/ThemeMgtService.wsdl
----------------------------------------------------------------------
diff --git a/service-stubs/org.wso2.carbon.theme.mgt.stub/4.1.0/src/main/resources/ThemeMgtService.wsdl b/service-stubs/org.wso2.carbon.theme.mgt.stub/4.1.0/src/main/resources/ThemeMgtService.wsdl
deleted file mode 100644
index c32d10b..0000000
--- a/service-stubs/org.wso2.carbon.theme.mgt.stub/4.1.0/src/main/resources/ThemeMgtService.wsdl
+++ /dev/null
@@ -1,1157 +0,0 @@
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-                  xmlns:ns1="http://org.apache.axis2/xsd"
-                  xmlns:ns="http://services.mgt.theme.carbon.wso2.org"
-                  xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
-                  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
-                  xmlns:ax2334="http://common.registry.carbon.wso2.org/xsd"
-                  xmlns:ax2332="http://beans.resource.registry.carbon.wso2.org/xsd"
-                  xmlns:xs="http://www.w3.org/2001/XMLSchema"
-                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
-                  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
-                  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
-                  targetNamespace="http://services.mgt.theme.carbon.wso2.org">
-    <wsdl:documentation>ThemeMgtService</wsdl:documentation>
-    <wsdl:types>
-        <xs:schema xmlns:ax2336="http://common.registry.carbon.wso2.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://beans.resource.registry.carbon.wso2.org/xsd">
-            <xs:import namespace="http://common.registry.carbon.wso2.org/xsd" />
-            <xs:complexType name="ResourceTreeEntryBean">
-                <xs:sequence>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="children" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="collection" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="symlink" nillable="true" type="xs:string" />
-                </xs:sequence>
-            </xs:complexType>
-            <xs:complexType name="MetadataBean">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="activeResourcePath" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="author" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="collection" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="contentPath" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="deleteLocked" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="formattedCreatedOn" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="formattedLastModified" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="lastUpdater" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string" />
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="navigatablePaths" nillable="true" type="ax2336:WebResourcePath" />
-                    <xs:element minOccurs="0" name="path" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="pathWithVersion" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="permalink" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="putAllowed" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="resourceVersion" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="serverBaseURL" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="versionView" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="writeLocked" nillable="true" type="xs:string" />
-                </xs:sequence>
-            </xs:complexType>
-            <xs:complexType name="ContentDownloadBean">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="content" nillable="true" type="xs:base64Binary" />
-                    <xs:element minOccurs="0" name="lastUpdatedTime" nillable="true" type="xs:dateTime" />
-                    <xs:element minOccurs="0" name="mediatype" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="resourceName" nillable="true" type="xs:string" />
-                </xs:sequence>
-            </xs:complexType>
-            <xs:complexType name="ContentBean">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="absent" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="collection" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="contentPath" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="loggedIn" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="pathWithVersion" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="putAllowed" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="realPath" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="versionView" type="xs:boolean" />
-                </xs:sequence>
-            </xs:complexType>
-            <xs:complexType name="CollectionContentBean">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="childCount" type="xs:int" />
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childPaths" nillable="true" type="xs:string" />
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="collectionTypes" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="pathWithVersion" nillable="true" type="xs:string" />
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="remoteInstances" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="versionView" type="xs:boolean" />
-                </xs:sequence>
-            </xs:complexType>
-        </xs:schema>
-        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://common.registry.carbon.wso2.org/xsd">
-            <xs:complexType name="ResourceData">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="absent" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="authorUserName" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="averageRating" type="xs:float" />
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="averageStars" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="createdOn" nillable="true" type="xs:dateTime" />
-                    <xs:element minOccurs="0" name="deleteAllowed" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="externalLink" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="formattedCreatedOn" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="getAllowed" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="link" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="mounted" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="name" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="putAllowed" type="xs:boolean" />
-                    <xs:element minOccurs="0" name="realPath" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="relativePath" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="resourcePath" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="resourceType" nillable="true" type="xs:string" />
-                    <xs:element maxOccurs="unbounded" minOccurs="0" name="tagCounts" nillable="true" type="ax2334:TagCount" />
-                </xs:sequence>
-            </xs:complexType>
-            <xs:complexType name="TagCount">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="key" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="value" nillable="true" type="xs:long" />
-                </xs:sequence>
-            </xs:complexType>
-            <xs:complexType name="WebResourcePath">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="navigateName" nillable="true" type="xs:string" />
-                    <xs:element minOccurs="0" name="navigatePath" nillable="true" type="xs:string" />
-                </xs:sequence>
-            </xs:complexType>
-        </xs:schema>
-        <xs:schema xmlns:ax2335="http://common.registry.carbon.wso2.org/xsd" xmlns:ax2333="http://beans.resource.registry.carbon.wso2.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.mgt.theme.carbon.wso2.org">
-            <xs:import namespace="http://beans.resource.registry.carbon.wso2.org/xsd" />
-            <xs:import namespace="http://common.registry.carbon.wso2.org/xsd" />
-            <xs:element name="ThemeMgtServiceException">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="ThemeMgtServiceException" nillable="true" type="ns:Exception" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:complexType name="Exception">
-                <xs:sequence>
-                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string" />
-                </xs:sequence>
-            </xs:complexType>
-            <xs:element name="updateTextContent">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="resourcePath" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="contentText" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="renameResource">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="parentPath" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="oldResourcePath" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="newResourceName" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="importResource">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="parentPath" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="resourceName" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="description" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="fetchURL" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="symlinkLocation" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="tenantPass" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getTextContent">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getTextContentResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getSessionResourcePath">
-                <xs:complexType>
-                    <xs:sequence />
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getSessionResourcePathResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getResourceTreeEntry">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="resourcePath" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getResourceTreeEntryResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax2333:ResourceTreeEntryBean" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getResourceData">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="paths" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getResourceDataResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax2335:ResourceData" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getMetadata">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getMetadataResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax2333:MetadataBean" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getContentDownloadBean">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getContentDownloadBeanResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax2333:ContentDownloadBean" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getContentBean">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getContentBeanResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax2333:ContentBean" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getCollectionContent">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getCollectionContentResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="ax2333:CollectionContentBean" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getAllThemes">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="tenantPass" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getAllThemesResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getAllPaths">
-                <xs:complexType>
-                    <xs:sequence />
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="getAllPathsResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="delete">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="pathToDelete" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="applyTheme">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="themeName" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="tenantPass" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="addTextResource">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="parentPath" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="fileName" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="description" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="content" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="addResource">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="description" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="content" nillable="true" type="xs:base64Binary" />
-                        <xs:element minOccurs="0" name="symlinkLocation" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="tenantPass" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="addCollection">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="parentPath" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="collectionName" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string" />
-                        <xs:element minOccurs="0" name="description" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-            <xs:element name="addCollectionResponse">
-                <xs:complexType>
-                    <xs:sequence>
-                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
-                    </xs:sequence>
-                </xs:complexType>
-            </xs:element>
-        </xs:schema>
-    </wsdl:types>
-    <wsdl:message name="deleteRequest">
-        <wsdl:part name="parameters" element="ns:delete" />
-    </wsdl:message>
-    <wsdl:message name="deleteResponse" />
-    <wsdl:message name="ThemeMgtServiceException">
-        <wsdl:part name="parameters" element="ns:ThemeMgtServiceException" />
-    </wsdl:message>
-    <wsdl:message name="getContentBeanRequest">
-        <wsdl:part name="parameters" element="ns:getContentBean" />
-    </wsdl:message>
-    <wsdl:message name="getContentBeanResponse">
-        <wsdl:part name="parameters" element="ns:getContentBeanResponse" />
-    </wsdl:message>
-    <wsdl:message name="getContentDownloadBeanRequest">
-        <wsdl:part name="parameters" element="ns:getContentDownloadBean" />
-    </wsdl:message>
-    <wsdl:message name="getContentDownloadBeanResponse">
-        <wsdl:part name="parameters" element="ns:getContentDownloadBeanResponse" />
-    </wsdl:message>
-    <wsdl:message name="getResourceDataRequest">
-        <wsdl:part name="parameters" element="ns:getResourceData" />
-    </wsdl:message>
-    <wsdl:message name="getResourceDataResponse">
-        <wsdl:part name="parameters" element="ns:getResourceDataResponse" />
-    </wsdl:message>
-    <wsdl:message name="getResourceTreeEntryRequest">
-        <wsdl:part name="parameters" element="ns:getResourceTreeEntry" />
-    </wsdl:message>
-    <wsdl:message name="getResourceTreeEntryResponse">
-        <wsdl:part name="parameters" element="ns:getResourceTreeEntryResponse" />
-    </wsdl:message>
-    <wsdl:message name="addTextResourceRequest">
-        <wsdl:part name="parameters" element="ns:addTextResource" />
-    </wsdl:message>
-    <wsdl:message name="addTextResourceResponse" />
-    <wsdl:message name="importResourceRequest">
-        <wsdl:part name="parameters" element="ns:importResource" />
-    </wsdl:message>
-    <wsdl:message name="importResourceResponse" />
-    <wsdl:message name="updateTextContentRequest">
-        <wsdl:part name="parameters" element="ns:updateTextContent" />
-    </wsdl:message>
-    <wsdl:message name="updateTextContentResponse" />
-    <wsdl:message name="getSessionResourcePathRequest">
-        <wsdl:part name="parameters" element="ns:getSessionResourcePath" />
-    </wsdl:message>
-    <wsdl:message name="getSessionResourcePathResponse">
-        <wsdl:part name="parameters" element="ns:getSessionResourcePathResponse" />
-    </wsdl:message>
-    <wsdl:message name="getMetadataRequest">
-        <wsdl:part name="parameters" element="ns:getMetadata" />
-    </wsdl:message>
-    <wsdl:message name="getMetadataResponse">
-        <wsdl:part name="parameters" element="ns:getMetadataResponse" />
-    </wsdl:message>
-    <wsdl:message name="addCollectionRequest">
-        <wsdl:part name="parameters" element="ns:addCollection" />
-    </wsdl:message>
-    <wsdl:message name="addCollectionResponse">
-        <wsdl:part name="parameters" element="ns:addCollectionResponse" />
-    </wsdl:message>
-    <wsdl:message name="renameResourceRequest">
-        <wsdl:part name="parameters" element="ns:renameResource" />
-    </wsdl:message>
-    <wsdl:message name="renameResourceResponse" />
-    <wsdl:message name="addResourceRequest">
-        <wsdl:part name="parameters" element="ns:addResource" />
-    </wsdl:message>
-    <wsdl:message name="addResourceResponse" />
-    <wsdl:message name="applyThemeRequest">
-        <wsdl:part name="parameters" element="ns:applyTheme" />
-    </wsdl:message>
-    <wsdl:message name="applyThemeResponse" />
-    <wsdl:message name="getCollectionContentRequest">
-        <wsdl:part name="parameters" element="ns:getCollectionContent" />
-    </wsdl:message>
-    <wsdl:message name="getCollectionContentResponse">
-        <wsdl:part name="parameters" element="ns:getCollectionContentResponse" />
-    </wsdl:message>
-    <wsdl:message name="getAllThemesRequest">
-        <wsdl:part name="parameters" element="ns:getAllThemes" />
-    </wsdl:message>
-    <wsdl:message name="getAllThemesResponse">
-        <wsdl:part name="parameters" element="ns:getAllThemesResponse" />
-    </wsdl:message>
-    <wsdl:message name="getAllPathsRequest">
-        <wsdl:part name="parameters" element="ns:getAllPaths" />
-    </wsdl:message>
-    <wsdl:message name="getAllPathsResponse">
-        <wsdl:part name="parameters" element="ns:getAllPathsResponse" />
-    </wsdl:message>
-    <wsdl:message name="getTextContentRequest">
-        <wsdl:part name="parameters" element="ns:getTextContent" />
-    </wsdl:message>
-    <wsdl:message name="getTextContentResponse">
-        <wsdl:part name="parameters" element="ns:getTextContentResponse" />
-    </wsdl:message>
-    <wsdl:portType name="ThemeMgtServicePortType">
-        <wsdl:operation name="delete">
-            <wsdl:input message="ns:deleteRequest" wsaw:Action="urn:delete" />
-            <wsdl:output message="ns:deleteResponse" wsaw:Action="urn:deleteResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:deleteThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="getContentBean">
-            <wsdl:input message="ns:getContentBeanRequest" wsaw:Action="urn:getContentBean" />
-            <wsdl:output message="ns:getContentBeanResponse" wsaw:Action="urn:getContentBeanResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getContentBeanThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="getContentDownloadBean">
-            <wsdl:input message="ns:getContentDownloadBeanRequest" wsaw:Action="urn:getContentDownloadBean" />
-            <wsdl:output message="ns:getContentDownloadBeanResponse" wsaw:Action="urn:getContentDownloadBeanResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getContentDownloadBeanThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="getResourceData">
-            <wsdl:input message="ns:getResourceDataRequest" wsaw:Action="urn:getResourceData" />
-            <wsdl:output message="ns:getResourceDataResponse" wsaw:Action="urn:getResourceDataResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getResourceDataThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="getResourceTreeEntry">
-            <wsdl:input message="ns:getResourceTreeEntryRequest" wsaw:Action="urn:getResourceTreeEntry" />
-            <wsdl:output message="ns:getResourceTreeEntryResponse" wsaw:Action="urn:getResourceTreeEntryResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getResourceTreeEntryThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="addTextResource">
-            <wsdl:input message="ns:addTextResourceRequest" wsaw:Action="urn:addTextResource" />
-            <wsdl:output message="ns:addTextResourceResponse" wsaw:Action="urn:addTextResourceResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:addTextResourceThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="importResource">
-            <wsdl:input message="ns:importResourceRequest" wsaw:Action="urn:importResource" />
-            <wsdl:output message="ns:importResourceResponse" wsaw:Action="urn:importResourceResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:importResourceThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="updateTextContent">
-            <wsdl:input message="ns:updateTextContentRequest" wsaw:Action="urn:updateTextContent" />
-            <wsdl:output message="ns:updateTextContentResponse" wsaw:Action="urn:updateTextContentResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:updateTextContentThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="getSessionResourcePath">
-            <wsdl:input message="ns:getSessionResourcePathRequest" wsaw:Action="urn:getSessionResourcePath" />
-            <wsdl:output message="ns:getSessionResourcePathResponse" wsaw:Action="urn:getSessionResourcePathResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getSessionResourcePathThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="getMetadata">
-            <wsdl:input message="ns:getMetadataRequest" wsaw:Action="urn:getMetadata" />
-            <wsdl:output message="ns:getMetadataResponse" wsaw:Action="urn:getMetadataResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getMetadataThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="addCollection">
-            <wsdl:input message="ns:addCollectionRequest" wsaw:Action="urn:addCollection" />
-            <wsdl:output message="ns:addCollectionResponse" wsaw:Action="urn:addCollectionResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:addCollectionThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="renameResource">
-            <wsdl:input message="ns:renameResourceRequest" wsaw:Action="urn:renameResource" />
-            <wsdl:output message="ns:renameResourceResponse" wsaw:Action="urn:renameResourceResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:renameResourceThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="addResource">
-            <wsdl:input message="ns:addResourceRequest" wsaw:Action="urn:addResource" />
-            <wsdl:output message="ns:addResourceResponse" wsaw:Action="urn:addResourceResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:addResourceThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="applyTheme">
-            <wsdl:input message="ns:applyThemeRequest" wsaw:Action="urn:applyTheme" />
-            <wsdl:output message="ns:applyThemeResponse" wsaw:Action="urn:applyThemeResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:applyThemeThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="getCollectionContent">
-            <wsdl:input message="ns:getCollectionContentRequest" wsaw:Action="urn:getCollectionContent" />
-            <wsdl:output message="ns:getCollectionContentResponse" wsaw:Action="urn:getCollectionContentResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getCollectionContentThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="getAllThemes">
-            <wsdl:input message="ns:getAllThemesRequest" wsaw:Action="urn:getAllThemes" />
-            <wsdl:output message="ns:getAllThemesResponse" wsaw:Action="urn:getAllThemesResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getAllThemesThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="getAllPaths">
-            <wsdl:input message="ns:getAllPathsRequest" wsaw:Action="urn:getAllPaths" />
-            <wsdl:output message="ns:getAllPathsResponse" wsaw:Action="urn:getAllPathsResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getAllPathsThemeMgtServiceException" />
-        </wsdl:operation>
-        <wsdl:operation name="getTextContent">
-            <wsdl:input message="ns:getTextContentRequest" wsaw:Action="urn:getTextContent" />
-            <wsdl:output message="ns:getTextContentResponse" wsaw:Action="urn:getTextContentResponse" />
-            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getTextContentThemeMgtServiceException" />
-        </wsdl:operation>
-    </wsdl:portType>
-    <wsdl:binding name="ThemeMgtServiceSoap11Binding" type="ns:ThemeMgtServicePortType">
-        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
-        <wsdl:operation name="delete">
-            <soap:operation soapAction="urn:delete" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getContentBean">
-            <soap:operation soapAction="urn:getContentBean" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getContentDownloadBean">
-            <soap:operation soapAction="urn:getContentDownloadBean" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getResourceData">
-            <soap:operation soapAction="urn:getResourceData" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getResourceTreeEntry">
-            <soap:operation soapAction="urn:getResourceTreeEntry" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="importResource">
-            <soap:operation soapAction="urn:importResource" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="addTextResource">
-            <soap:operation soapAction="urn:addTextResource" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="updateTextContent">
-            <soap:operation soapAction="urn:updateTextContent" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getMetadata">
-            <soap:operation soapAction="urn:getMetadata" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getSessionResourcePath">
-            <soap:operation soapAction="urn:getSessionResourcePath" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="addCollection">
-            <soap:operation soapAction="urn:addCollection" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="addResource">
-            <soap:operation soapAction="urn:addResource" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="renameResource">
-            <soap:operation soapAction="urn:renameResource" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="applyTheme">
-            <soap:operation soapAction="urn:applyTheme" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getCollectionContent">
-            <soap:operation soapAction="urn:getCollectionContent" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getAllThemes">
-            <soap:operation soapAction="urn:getAllThemes" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getAllPaths">
-            <soap:operation soapAction="urn:getAllPaths" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getTextContent">
-            <soap:operation soapAction="urn:getTextContent" style="document" />
-            <wsdl:input>
-                <soap:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:binding name="ThemeMgtServiceSoap12Binding" type="ns:ThemeMgtServicePortType">
-        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
-        <wsdl:operation name="delete">
-            <soap12:operation soapAction="urn:delete" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getContentBean">
-            <soap12:operation soapAction="urn:getContentBean" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getContentDownloadBean">
-            <soap12:operation soapAction="urn:getContentDownloadBean" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getResourceData">
-            <soap12:operation soapAction="urn:getResourceData" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getResourceTreeEntry">
-            <soap12:operation soapAction="urn:getResourceTreeEntry" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="importResource">
-            <soap12:operation soapAction="urn:importResource" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="addTextResource">
-            <soap12:operation soapAction="urn:addTextResource" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="updateTextContent">
-            <soap12:operation soapAction="urn:updateTextContent" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getMetadata">
-            <soap12:operation soapAction="urn:getMetadata" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getSessionResourcePath">
-            <soap12:operation soapAction="urn:getSessionResourcePath" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="addCollection">
-            <soap12:operation soapAction="urn:addCollection" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="addResource">
-            <soap12:operation soapAction="urn:addResource" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="renameResource">
-            <soap12:operation soapAction="urn:renameResource" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="applyTheme">
-            <soap12:operation soapAction="urn:applyTheme" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getCollectionContent">
-            <soap12:operation soapAction="urn:getCollectionContent" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getAllThemes">
-            <soap12:operation soapAction="urn:getAllThemes" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getAllPaths">
-            <soap12:operation soapAction="urn:getAllPaths" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-        <wsdl:operation name="getTextContent">
-            <soap12:operation soapAction="urn:getTextContent" style="document" />
-            <wsdl:input>
-                <soap12:body use="literal" />
-            </wsdl:input>
-            <wsdl:output>
-                <soap12:body use="literal" />
-            </wsdl:output>
-            <wsdl:fault name="ThemeMgtServiceException">
-                <soap12:fault use="literal" name="ThemeMgtServiceException" />
-            </wsdl:fault>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:binding name="ThemeMgtServiceHttpBinding" type="ns:ThemeMgtServicePortType">
-        <http:binding verb="POST" />
-        <wsdl:operation name="delete">
-            <http:operation location="delete" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="getContentBean">
-            <http:operation location="getContentBean" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="getContentDownloadBean">
-            <http:operation location="getContentDownloadBean" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="getResourceData">
-            <http:operation location="getResourceData" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="getResourceTreeEntry">
-            <http:operation location="getResourceTreeEntry" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="importResource">
-            <http:operation location="importResource" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="addTextResource">
-            <http:operation location="addTextResource" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="updateTextContent">
-            <http:operation location="updateTextContent" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="getMetadata">
-            <http:operation location="getMetadata" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="getSessionResourcePath">
-            <http:operation location="getSessionResourcePath" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="addCollection">
-            <http:operation location="addCollection" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="addResource">
-            <http:operation location="addResource" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="renameResource">
-            <http:operation location="renameResource" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="applyTheme">
-            <http:operation location="applyTheme" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="getCollectionContent">
-            <http:operation location="getCollectionContent" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="getAllThemes">
-            <http:operation location="getAllThemes" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="getAllPaths">
-            <http:operation location="getAllPaths" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-        <wsdl:operation name="getTextContent">
-            <http:operation location="getTextContent" />
-            <wsdl:input>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:input>
-            <wsdl:output>
-                <mime:content type="text/xml" part="parameters" />
-            </wsdl:output>
-        </wsdl:operation>
-    </wsdl:binding>
-    <wsdl:service name="ThemeMgtService">
-        <wsdl:port name="ThemeMgtServiceHttpsSoap11Endpoint" binding="ns:ThemeMgtServiceSoap11Binding">
-            <soap:address location="https://192.168.1.100:9443/services/ThemeMgtService.ThemeMgtServiceHttpsSoap11Endpoint/" />
-        </wsdl:port>
-        <wsdl:port name="ThemeMgtServiceHttpsSoap12Endpoint" binding="ns:ThemeMgtServiceSoap12Binding">
-            <soap12:address location="https://192.168.1.100:9443/services/ThemeMgtService.ThemeMgtServiceHttpsSoap12Endpoint/" />
-        </wsdl:port>
-        <wsdl:port name="ThemeMgtServiceHttpsEndpoint" binding="ns:ThemeMgtServiceHttpBinding">
-            <http:address location="https://192.168.1.100:9443/services/ThemeMgtService.ThemeMgtServiceHttpsEndpoint/" />
-        </wsdl:port>
-    </wsdl:service>
-</wsdl:definitions>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/service-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/service-stubs/pom.xml b/service-stubs/pom.xml
index faacd02..22d8360 100644
--- a/service-stubs/pom.xml
+++ b/service-stubs/pom.xml
@@ -29,7 +29,7 @@
 
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.stratos</groupId>
-    <artifactId>stratos-service-stubs</artifactId>
+    <artifactId>stratos-service-stubs-parent</artifactId>
     <packaging>pom</packaging>
     <name>Apache Stratos - Service Stubs - Aggregator Module</name>
     <url>http://apache.org</url>


[09/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_full.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_full.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_full.js
deleted file mode 100644
index db136a8..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_full.js
+++ /dev/null
@@ -1,38 +0,0 @@
- function EAL(){var t=this;t.version="0.8.1.1";date=new Date();t.start_time=date.getTime();t.win="loading";t.error=false;t.baseURL="";t.template="";t.lang={};t.load_syntax={};t.syntax={};t.loadedFiles=[];t.waiting_loading={};t.scripts_to_load=[];t.sub_scripts_to_load=[];t.resize=[];t.hidden={};t.default_settings={debug:false,smooth_selection:true,font_size:"10",font_family:"monospace",start_highlight:false,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,word_wrap,|,help",begin_toolbar:"",end_toolbar:"",is_multi_files:false,allow_resize:"both",show_line_colors:false,min_width:400,min_height:125,replace_tab_by_spaces:false,allow_toggle:true,language:"en",syntax:"",syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml",display:"onload",max_undo:30,browsers:"known",plugins:"",gecko_spellcheck:false,fullscreen:false,is_editable:true,cursor_position:"b
 egin",word_wrap:false,autocompletion:false,load_callback:"",save_callback:"",change_callback:"",submit_callback:"",EA_init_callback:"",EA_delete_callback:"",EA_load_callback:"",EA_unload_callback:"",EA_toggle_on_callback:"",EA_toggle_off_callback:"",EA_file_switch_on_callback:"",EA_file_switch_off_callback:"",EA_file_close_callback:""};t.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['word_wrap','word_wrap.gif','toggle_word_wrap',true]
 ,['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];t.set_browser_infos(t);if(t.isIE>=6||t.isGecko||(t.isWebKit&&!t.isSafari<3)||t.isOpera>=9||t.isCamino)t.isValidBrowser=true;
-else t.isValidBrowser=false;t.set_base_url();for(var i=0;i<t.scripts_to_load.length;i++){setTimeout("eAL.load_script('"+t.baseURL+t.scripts_to_load[i]+".js');",1);t.waiting_loading[t.scripts_to_load[i]+".js"]=false;}t.add_event(window,"load",EAL.prototype.window_loaded);};EAL.prototype={has_error:function(){this.error=true;for(var i in EAL.prototype){EAL.prototype[i]=function(){};}},set_browser_infos:function(o){ua=navigator.userAgent;o.isWebKit=/WebKit/.test(ua);o.isGecko=!o.isWebKit&&/Gecko/.test(ua);o.isMac=/Mac/.test(ua);o.isIE=(navigator.appName=="Microsoft Internet Explorer");if(o.isIE){o.isIE=ua.replace(/^.*?MSIE\s+([0-9\.]+).*$/,"$1");if(o.isIE<6)o.has_error();}if(o.isOpera=(ua.indexOf('Opera')!=-1)){o.isOpera=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(o.isOpera<9)o.has_error();o.isIE=false;}if(o.isFirefox=(ua.indexOf('Firefox')!=-1))o.isFirefox=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('Iceweasel')!=-1)o.isFirefox=ua.replace(/^.*?Iceweasel.*?([0-9\
 .]+).*$/i,"$1");if(ua.indexOf('GranParadiso')!=-1)o.isFirefox=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('BonEcho')!=-1)o.isFirefox=ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('SeaMonkey')!=-1)o.isFirefox=(ua.replace(/^.*?SeaMonkey.*?([0-9\.]+).*$/i,"$1"))+1;if(o.isCamino=(ua.indexOf('Camino')!=-1))o.isCamino=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(o.isSafari=(ua.indexOf('Safari')!=-1))o.isSafari=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(o.isChrome=(ua.indexOf('Chrome')!=-1)){o.isChrome=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");o.isSafari=false;}},window_loaded:function(){eAL.win="loaded";if(document.forms){for(var i=0;i<document.forms.length;i++){var form=document.forms[i];form.edit_area_replaced_submit=null;try{form.edit_area_replaced_submit=form.onsubmit;form.onsubmit="";}catch(e){}eAL.add_event(form,"submit",EAL.prototype.submit);eAL.add_event(form,"reset",EAL.prototype.reset);}}eAL.add_event(window,"unload",
 function(){for(var i in eAs){eAL.delete_instance(i);}});},init_ie_textarea:function(id){var a=document.getElementById(id);try{if(a&&typeof(a.focused)=="undefined"){a.focus();a.focused=true;a.selectionStart=a.selectionEnd=0;get_IE_selection(a);eAL.add_event(a,"focus",IE_textarea_focus);eAL.add_event(a,"blur",IE_textarea_blur);}}catch(ex){}},init:function(settings){var t=this,s=settings,i;if(!s["id"])t.has_error();if(t.error)return;if(eAs[s["id"]])t.delete_instance(s["id"]);for(i in t.default_settings){if(typeof(s[i])=="undefined")s[i]=t.default_settings[i];}if(s["browsers"]=="known"&&t.isValidBrowser==false){return;}if(s["begin_toolbar"].length>0)s["toolbar"]=s["begin_toolbar"]+","+s["toolbar"];if(s["end_toolbar"].length>0)s["toolbar"]=s["toolbar"]+","+s["end_toolbar"];s["tab_toolbar"]=s["toolbar"].replace(/ /g,"").split(",");s["plugins"]=s["plugins"].replace(/ /g,"").split(",");for(i=0;i<s["plugins"].length;i++){if(s["plugins"][i].length==0)s["plugins"].splice(i,1);}t.get_template()
 ;t.load_script(t.baseURL+"langs/"+s["language"]+".js");if(s["syntax"].length>0){s["syntax"]=s["syntax"].toLowerCase();t.load_script(t.baseURL+"reg_syntax/"+s["syntax"]+".js");}eAs[s["id"]]={"settings":s};eAs[s["id"]]["displayed"]=false;eAs[s["id"]]["hidden"]=false;t.start(s["id"]);},delete_instance:function(id){var d=document,fs=window.frames,span,iframe;eAL.execCommand(id,"EA_delete");if(fs["frame_"+id]&&fs["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");fs["frame_"+id].editArea.execCommand("EA_unload");}span=d.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);iframe=d.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete fs["frame_"+id];}catch(e){}}delete eAs[id];},start:function(id){var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;if(t.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(i in t.waiting_loading){if(t.waiting_loading[i]!="l
 oaded"&&typeof(t.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!t.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!t.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)t.init_syntax_regexp();if(!d.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){span=d.createElement("span");span.id="EditAreaArroundInfos_"+id;if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked='checked'":"";html+="<div id='edit_area_toggle_"+i+"'>";html+="<input id='edit_area_toggle_checkbox_"+id+"' class='toggle_"+id+"' type='checkbox' onclick='eAL.toggle(\""+id+"\");' accesskey='e' "+checked+" />";html+="<label for='edit_area_toggle_checkbox_"+id+"'>{$toggle}</label></div>";}if(eAs[id]["settings"]["debug"])html+="<textarea id='edit_area_debug_"+id+"' spellc
 heck='off' style='z-index:20;width:100%;height:120px;overflow:auto;border:solid black 1px;'></textarea><br />";html=t.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;father=d.getElementById(id).parentNode;next=d.getElementById(id).nextSibling;if(next==null)father.appendChild(span);
-else father.insertBefore(span,next);}if(!eAs[id]["initialized"]){t.execCommand(id,"EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(t.isIE){t.init_ie_textarea(id);}area=eAs[id];for(i=0;i<area["settings"]["tab_toolbar"].length;i++){html_toolbar_content+=t.get_control_html(area["settings"]["tab_toolbar"][i],area["settings"]["language"]);}html_toolbar_content=t.translate(html_toolbar_content,area["settings"]["language"],"template");if(!t.iframe_script){t.iframe_script="";for(i=0;i<t.sub_scripts_to_load.length;i++)t.iframe_script+='<script language="javascript" type="text/javascript" src="'+t.baseURL+t.sub_scripts_to_load[i]+'.js"></script>';}for(i=0;i<area["settings"]["plugins"].length;i++){if(!t.all_plugins_loaded)t.iframe_script+='<script language="javascript" type="text/javascript" src="'+t.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/'+area["settings"]["plugins"][i]+'.js"></script>';t.iframe_script+='<script language="javascript" 
 type="text/javascript" src="'+t.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/langs/'+area["settings"]["language"]+'.js"></script>';}if(!t.iframe_css){t.iframe_css="<link href='"+t.baseURL+"edit_area.css' rel='stylesheet' type='text/css' />";}template=t.template.replace(/\[__BASEURL__\]/g,t.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=t.translate(template,area["settings"]["language"],"template");template=template.replace("[__CSSRULES__]",t.iframe_css);template=template.replace("[__JSCODE__]",t.iframe_script);template=template.replace("[__EA_VERSION__]",t.version);area.textarea=d.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')delete window.frames["frame_"+area["settings"]["id"]];father=area.textarea.parentNode;content=d.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["i
 d"];content.style.borderWidth="0px";setAttribute(content,"frameBorder","0");content.style.overflow="hidden";content.style.display="none";next=area.textarea.nextSibling;if(next==null)father.appendChild(content);
-else father.insertBefore(content,next);f=window.frames["frame_"+area["settings"]["id"]];f.document.open();f.eAs=eAs;f.area_id=area["settings"]["id"];f.document.area_id=area["settings"]["id"];f.document.write(template);f.document.close();},toggle:function(id,toggle_to){if(!toggle_to)toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true&&toggle_to=="off"){this.toggle_off(id);}
-else if(eAs[id]["displayed"]==false&&toggle_to=="on"){this.toggle_on(id);}return false;},toggle_off:function(id){var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];if(f.editArea.fullscreen['isFull'])f.editArea.toggle_full_screen(false);eAs[id]["displayed"]=false;t.wrap="off";setAttribute(t,"wrap","off");parNod=t.parentNode;nxtSib=t.nextSibling;parNod.removeChild(t);parNod.insertBefore(t,nxtSib);t.value=f.editArea.textarea.value;selStart=f.editArea.last_selection["selectionStart"];selEnd=f.editArea.last_selection["selectionEnd"];scrollTop=f.document.getElementById("result").scrollTop;scrollLeft=f.document.getElementById("result").scrollLeft;document.getElementById("frame_"+id).style.display='none';t.style.display="inline";try{t.focus();}catch(e){};if(this.isIE){t.selectionStart=selStart;t.selectionEnd=selEnd;t.focused=true;set_IE_selection(t);}
-else{if(this.isOpera&&this.isOpera < 9.6){t.setSelectionRange(0,0);}try{t.setSelectionRange(selStart,selEnd);}catch(e){};}t.scrollTop=scrollTop;t.scrollLeft=scrollLeft;f.editArea.execCommand("toggle_off");}},toggle_on:function(id){var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];area=f.editArea;area.textarea.value=t.value;curPos=eAs[id]["settings"]["cursor_position"];if(t.use_last==true){selStart=t.last_selectionStart;selEnd=t.last_selectionEnd;scrollTop=t.last_scrollTop;scrollLeft=t.last_scrollLeft;t.use_last=false;}
-else if(curPos=="auto"){try{selStart=t.selectionStart;selEnd=t.selectionEnd;scrollTop=t.scrollTop;scrollLeft=t.scrollLeft;}catch(ex){}}this.set_editarea_size_from_textarea(id,document.getElementById("frame_"+id));t.style.display="none";document.getElementById("frame_"+id).style.display="inline";area.execCommand("focus");eAs[id]["displayed"]=true;area.execCommand("update_size");f.document.getElementById("result").scrollTop=scrollTop;f.document.getElementById("result").scrollLeft=scrollLeft;area.area_select(selStart,selEnd-selStart);area.execCommand("toggle_on");}
-else{elem=document.getElementById(id);elem.last_selectionStart=elem.selectionStart;elem.last_selectionEnd=elem.selectionEnd;elem.last_scrollTop=elem.scrollTop;elem.last_scrollLeft=elem.scrollLeft;elem.use_last=true;eAL.start(id);}},set_editarea_size_from_textarea:function(id,frame){var elem,width,height;elem=document.getElementById(id);width=Math.max(eAs[id]["settings"]["min_width"],elem.offsetWidth)+"px";height=Math.max(eAs[id]["settings"]["min_height"],elem.offsetHeight)+"px";if(elem.style.width.indexOf("%")!=-1)width=elem.style.width;if(elem.style.height.indexOf("%")!=-1)height=elem.style.height;frame.style.width=width;frame.style.height=height;},set_base_url:function(){var t=this,elems,i,docBasePath;if(!this.baseURL){elems=document.getElementsByTagName('script');for(i=0;i<elems.length;i++){if(elems[i].src&&elems[i].src.match(/edit_area_[^\\\/]*$/i)){var src=elems[i].src;src=src.substring(0,src.lastIndexOf('/'));this.baseURL=src;this.file_name=elems[i].src.substr(elems[i].src.las
 tIndexOf("/")+1);break;}}}docBasePath=document.location.href;if(docBasePath.indexOf('?')!=-1)docBasePath=docBasePath.substring(0,docBasePath.indexOf('?'));docBasePath=docBasePath.substring(0,docBasePath.lastIndexOf('/'));if(t.baseURL.indexOf('://')==-1&&t.baseURL.charAt(0)!='/'){t.baseURL=docBasePath+"/"+t.baseURL;}t.baseURL+="/";},get_button_html:function(id,img,exec,isFileSpecific,baseURL){var cmd,html;if(!baseURL)baseURL=this.baseURL;cmd='editArea.execCommand(\''+exec+'\')';html='<a id="a_'+id+'" href="javascript:'+cmd+'" onclick="'+cmd+';return false;" onmousedown="return false;" target="_self" fileSpecific="'+(isFileSpecific?'yes':'no')+'">';html+='<img id="'+id+'" src="'+baseURL+'images/'+img+'" title="{$'+id+'}" width="20" height="20" class="editAreaButtonNormal" onmouseover="editArea.switchClass(this,\'editAreaButtonOver\');" onmouseout="editArea.restoreClass(this);" onmousedown="editArea.restoreAndSwitchClass(this,\'editAreaButtonDown\');" /></a>';return html;},get_control_
 html:function(button_name,lang){var t=this,i,but,html,si;for(i=0;i<t.advanced_buttons.length;i++){but=t.advanced_buttons[i];if(but[0]==button_name){return t.get_button_html(but[0],but[1],but[2],but[3]);}}switch(button_name){case "*":case "return":return "<br />";case "|":case "separator":return '<img src="'+t.baseURL+'images/spacer.gif" width="1" height="15" class="editAreaSeparatorLine">';case "select_font":html="<select id='area_font_size' onchange='javascript:editArea.execCommand(\"change_font_size\")' fileSpecific='yes'>";html+="<option value='-1'>{$font_size}</option>";si=[8,9,10,11,12,14];for(i=0;i<si.length;i++){html+="<option value='"+si[i]+"'>"+si[i]+" pt</option>";}html+="</select>";return html;case "syntax_selection":html="<select id='syntax_selection' onchange='javascript:editArea.execCommand(\"change_syntax\",this.value)' fileSpecific='yes'>";html+="<option value='-1'>{$syntax_selection}</option>";html+="</select>";return html;}return "<span id='tmp_tool_"+button_name+"
 '>["+button_name+"]</span>";},get_template:function(){if(this.template==""){var xhr_object=null;if(window.XMLHttpRequest)xhr_object=new XMLHttpRequest();
-else if(window.ActiveXObject)xhr_object=new ActiveXObject("Microsoft.XMLHTTP");
-else{alert("XMLHTTPRequest not supported. EditArea not loaded");return;}xhr_object.open("GET",this.baseURL+"template.html",false);xhr_object.send(null);if(xhr_object.readyState==4)this.template=xhr_object.responseText;
-else this.has_error();}},translate:function(text,lang,mode){if(mode=="word")text=eAL.get_word_translation(text,lang);
-else if(mode="template"){eAL.current_language=lang;text=text.replace(/\{\$([^\}]+)\}/gm,eAL.translate_template);}return text;},translate_template:function(){return eAL.get_word_translation(EAL.prototype.translate_template.arguments[1],eAL.current_language);},get_word_translation:function(val,lang){var i;for(i in eAL.lang[lang]){if(i==val)return eAL.lang[lang][i];}return "_"+val;},load_script:function(url){var t=this,d=document,script,head;if(t.loadedFiles[url])return;try{script=d.createElement("script");script.type="text/javascript";script.src=url;script.charset="UTF-8";d.getElementsByTagName("head")[0].appendChild(script);}catch(e){d.write('<sc'+'ript language="javascript" type="text/javascript" src="'+url+'" charset="UTF-8"></sc'+'ript>');}t.loadedFiles[url]=true;},add_event:function(obj,name,handler){try{if(obj.attachEvent){obj.attachEvent("on"+name,handler);}
-else{obj.addEventListener(name,handler,false);}}catch(e){}},remove_event:function(obj,name,handler){try{if(obj.detachEvent)obj.detachEvent("on"+name,handler);
-else obj.removeEventListener(name,handler,false);}catch(e){}},reset:function(e){var formObj,is_child,i,x;formObj=eAL.isIE ? window.event.srcElement:e.target;if(formObj.tagName!='FORM')formObj=formObj.form;for(i in eAs){is_child=false;for(x=0;x<formObj.elements.length;x++){if(formObj.elements[x].id==i)is_child=true;}if(window.frames["frame_"+i]&&is_child&&eAs[i]["displayed"]==true){var exec='window.frames["frame_'+i+'"].editArea.textarea.value=document.getElementById("'+i+'").value;';exec+='window.frames["frame_'+i+'"].editArea.execCommand("focus");';exec+='window.frames["frame_'+i+'"].editArea.check_line_selection();';exec+='window.frames["frame_'+i+'"].editArea.execCommand("reset");';window.setTimeout(exec,10);}}return;},submit:function(e){var formObj,is_child,fs=window.frames,i,x;formObj=eAL.isIE ? window.event.srcElement:e.target;if(formObj.tagName!='FORM')formObj=formObj.form;for(i in eAs){is_child=false;for(x=0;x<formObj.elements.length;x++){if(formObj.elements[x].id==i)is_chil
 d=true;}if(is_child){if(fs["frame_"+i]&&eAs[i]["displayed"]==true)document.getElementById(i).value=fs["frame_"+i].editArea.textarea.value;eAL.execCommand(i,"EA_submit");}}if(typeof(formObj.edit_area_replaced_submit)=="function"){res=formObj.edit_area_replaced_submit();if(res==false){if(eAL.isIE)return false;
-else e.preventDefault();}}return;},getValue:function(id){if(window.frames["frame_"+id]&&eAs[id]["displayed"]==true){return window.frames["frame_"+id].editArea.textarea.value;}
-else if(elem=document.getElementById(id)){return elem.value;}return false;},setValue:function(id,new_val){var fs=window.frames;if((f=fs["frame_"+id])&&eAs[id]["displayed"]==true){f.editArea.textarea.value=new_val;f.editArea.execCommand("focus");f.editArea.check_line_selection(false);f.editArea.execCommand("onchange");}
-else if(elem=document.getElementById(id)){elem.value=new_val;}},getSelectionRange:function(id){var sel,eA,fs=window.frames;sel={"start":0,"end":0};if(fs["frame_"+id]&&eAs[id]["displayed"]==true){eA=fs["frame_"+id].editArea;sel["start"]=eA.textarea.selectionStart;sel["end"]=eA.textarea.selectionEnd;}
-else if(elem=document.getElementById(id)){sel=getSelectionRange(elem);}return sel;},setSelectionRange:function(id,new_start,new_end){var fs=window.frames;if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].editArea.area_select(new_start,new_end-new_start);if(!this.isIE){fs["frame_"+id].editArea.check_line_selection(false);fs["frame_"+id].editArea.scroll_to_view();}}
-else if(elem=document.getElementById(id)){setSelectionRange(elem,new_start,new_end);}},getSelectedText:function(id){var sel=this.getSelectionRange(id);return this.getValue(id).substring(sel["start"],sel["end"]);},setSelectedText:function(id,new_val){var fs=window.frames,d=document,sel,text,scrollTop,scrollLeft,new_sel_end;new_val=new_val.replace(/\r/g,"");sel=this.getSelectionRange(id);text=this.getValue(id);if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;}
-else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}text=text.substring(0,sel["start"])+new_val+text.substring(sel["end"]);this.setValue(id,text);new_sel_end=sel["start"]+new_val.length;this.setSelectionRange(id,sel["start"],new_sel_end);if(new_val !=this.getSelectedText(id).replace(/\r/g,"")){this.setSelectionRange(id,sel["start"],new_sel_end+new_val.split("\n").length-1);}if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;fs["frame_"+id].editArea.execCommand("onchange");}
-else{d.getElementById(id).scrollTop=scrollTop;d.getElementById(id).scrollLeft=scrollLeft;}},insertTags:function(id,open_tag,close_tag){var old_sel,new_sel;old_sel=this.getSelectionRange(id);text=open_tag+this.getSelectedText(id)+close_tag;eAL.setSelectedText(id,text);new_sel=this.getSelectionRange(id);if(old_sel["end"] > old_sel["start"])this.setSelectionRange(id,new_sel["end"],new_sel["end"]);
-else this.setSelectionRange(id,old_sel["start"]+open_tag.length,old_sel["start"]+open_tag.length);},hide:function(id){var fs=window.frames,d=document,t=this,scrollTop,scrollLeft,span;if(d.getElementById(id)&&!t.hidden[id]){t.hidden[id]={};t.hidden[id]["selectionRange"]=t.getSelectionRange(id);if(d.getElementById(id).style.display!="none"){t.hidden[id]["scrollTop"]=d.getElementById(id).scrollTop;t.hidden[id]["scrollLeft"]=d.getElementById(id).scrollLeft;}if(fs["frame_"+id]){t.hidden[id]["toggle"]=eAs[id]["displayed"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;}
-else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}t.hidden[id]["scrollTop"]=scrollTop;t.hidden[id]["scrollLeft"]=scrollLeft;if(eAs[id]["displayed"]==true)eAL.toggle_off(id);}span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='none';}d.getElementById(id).style.display="none";}},show:function(id){var fs=window.frames,d=document,t=this,span;if((elem=d.getElementById(id))&&t.hidden[id]){elem.style.display="inline";elem.scrollTop=t.hidden[id]["scrollTop"];elem.scrollLeft=t.hidden[id]["scrollLeft"];span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='inline';}if(fs["frame_"+id]){elem.style.display="inline";if(t.hidden[id]["toggle"]==true)eAL.toggle_on(id);scrollTop=t.hidden[id]["scrollTop"];scrollLeft=t.hidden[id]["scrollLeft"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scro
 llLeft=scrollLeft;}
-else{elem.scrollTop=scrollTop;elem.scrollLeft=scrollLeft;}}sel=t.hidden[id]["selectionRange"];t.setSelectionRange(id,sel["start"],sel["end"]);delete t.hidden[id];}},getCurrentFile:function(id){return this.execCommand(id,'get_file',this.execCommand(id,'curr_file'));},getFile:function(id,file_id){return this.execCommand(id,'get_file',file_id);},getAllFiles:function(id){return this.execCommand(id,'get_all_files()');},openFile:function(id,file_infos){return this.execCommand(id,'open_file',file_infos);},closeFile:function(id,file_id){return this.execCommand(id,'close_file',file_id);},setFileEditedMode:function(id,file_id,to){var reg1,reg2;reg1=new RegExp('\\\\','g');reg2=new RegExp('"','g');return this.execCommand(id,'set_file_edited_mode("'+file_id.replace(reg1,'\\\\').replace(reg2,'\\"')+'",'+to+')');},execCommand:function(id,cmd,fct_param){switch(cmd){case "EA_init":if(eAs[id]['settings']["EA_init_callback"].length>0)eval(eAs[id]['settings']["EA_init_callback"]+"('"+id+"');");break;ca
 se "EA_delete":if(eAs[id]['settings']["EA_delete_callback"].length>0)eval(eAs[id]['settings']["EA_delete_callback"]+"('"+id+"');");break;case "EA_submit":if(eAs[id]['settings']["submit_callback"].length>0)eval(eAs[id]['settings']["submit_callback"]+"('"+id+"');");break;}if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(fct_param!=undefined)return eval('window.frames["frame_'+id+'"].editArea.'+cmd+'(fct_param);');
-else return eval('window.frames["frame_'+id+'"].editArea.'+cmd+';');}return false;}};var eAL=new EAL();var eAs={}; function getAttribute(elm,aName){var aValue,taName,i;try{aValue=elm.getAttribute(aName);}catch(exept){}if(! aValue){for(i=0;i < elm.attributes.length;i++){taName=elm.attributes[i] .name.toLowerCase();if(taName==aName){aValue=elm.attributes[i] .value;return aValue;}}}return aValue;};function setAttribute(elm,attr,val){if(attr=="class"){elm.setAttribute("className",val);elm.setAttribute("class",val);}
-else{elm.setAttribute(attr,val);}};function getChildren(elem,elem_type,elem_attribute,elem_attribute_match,option,depth){if(!option)var option="single";if(!depth)var depth=-1;if(elem){var children=elem.childNodes;var result=null;var results=[];for(var x=0;x<children.length;x++){strTagName=new String(children[x].tagName);children_class="?";if(strTagName!="undefined"){child_attribute=getAttribute(children[x],elem_attribute);if((strTagName.toLowerCase()==elem_type.toLowerCase()||elem_type=="")&&(elem_attribute==""||child_attribute==elem_attribute_match)){if(option=="all"){results.push(children[x]);}
-else{return children[x];}}if(depth!=0){result=getChildren(children[x],elem_type,elem_attribute,elem_attribute_match,option,depth-1);if(option=="all"){if(result.length>0){results=results.concat(result);}}
-else if(result!=null){return result;}}}}if(option=="all")return results;}return null;};function isChildOf(elem,parent){if(elem){if(elem==parent)return true;while(elem.parentNode !='undefined'){return isChildOf(elem.parentNode,parent);}}return false;};function getMouseX(e){if(e!=null&&typeof(e.pageX)!="undefined"){return e.pageX;}
-else{return(e!=null?e.x:event.x)+document.documentElement.scrollLeft;}};function getMouseY(e){if(e!=null&&typeof(e.pageY)!="undefined"){return e.pageY;}
-else{return(e!=null?e.y:event.y)+document.documentElement.scrollTop;}};function calculeOffsetLeft(r){return calculeOffset(r,"offsetLeft")};function calculeOffsetTop(r){return calculeOffset(r,"offsetTop")};function calculeOffset(element,attr){var offset=0;while(element){offset+=element[attr];element=element.offsetParent}return offset;};function get_css_property(elem,prop){if(document.defaultView){return document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop);}
-else if(elem.currentStyle){var prop=prop.replace(/-\D/gi,function(sMatch){return sMatch.charAt(sMatch.length-1).toUpperCase();});return elem.currentStyle[prop];}
-else return null;}var _mCE;function start_move_element(e,id,frame){var elem_id=(e.target||e.srcElement).id;if(id)elem_id=id;if(!frame)frame=window;if(frame.event)e=frame.event;_mCE=frame.document.getElementById(elem_id);_mCE.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);_mCE.start_pos_x=mouse_x-(_mCE.style.left.replace("px","")||calculeOffsetLeft(_mCE));_mCE.start_pos_y=mouse_y-(_mCE.style.top.replace("px","")||calculeOffsetTop(_mCE));return false;};function end_move_element(e){_mCE.frame.document.onmousemove="";_mCE.frame.document.onmouseup="";_mCE=null;};function move_element(e){var newTop,newLeft,maxLeft;if(_mCE.frame&&_mCE.frame.event)e=_mCE.frame.event;newTop=getMouseY(e)-_mCE.start_pos_y;newLeft=getMouseX(e)-_mCE.start_pos_x;maxLeft=_mCE.frame.document.body.offsetWidth-_mCE.offsetWidth;max_top=_mCE.frame.document.body.offsetHeight-_mCE.offsetHeight;newTop=Math.min(Math.max(0,newTop),max_t
 op);newLeft=Math.min(Math.max(0,newLeft),maxLeft);_mCE.style.top=newTop+"px";_mCE.style.left=newLeft+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return{"start":textarea.selectionStart,"end":textarea.selectionEnd};};function setSelectionRange(t,start,end){t.focus();start=Math.max(0,Math.min(t.value.length,start));end=Math.max(start,Math.min(t.value.length,end));if(this.isOpera&&this.isOpera < 9.6){t.selectionEnd=1;t.selectionStart=0;t.selectionEnd=1;t.selectionStart=0;}t.selectionStart=start;t.selectionEnd=end;if(isIE)set_IE_selection(t);};function get_IE_selection(t){var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;if(t&&t.focused){if(!t.ea_line_height){div=d.createElement("div");div.style.fontFamily=get_css_property(t,"font-family");div.style.fontSize=get_css_property(t,"font-size");div.style.visibility="hidden";div.innerHTML="0";d.body.appendChild(div);t.ea_line_height=div.offsetHeight;d.bod
 y.removeChild(div);}range=d.selection.createRange();try{stored_range=range.duplicate();stored_range.moveToElementText(t);stored_range.setEndPoint('EndToEnd',range);if(stored_range.parentElement()==t){elem=t;scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}relative_top=range.offsetTop-calculeOffsetTop(t)+scrollTop;line_start=Math.round((relative_top / t.ea_line_height)+1);line_nb=Math.round(range.boundingHeight / t.ea_line_height);range_start=stored_range.text.length-range.text.length;tab=t.value.substr(0,range_start).split("\n");range_start+=(line_start-tab.length)*2;t.selectionStart=range_start;range_end=t.selectionStart+range.text.length;tab=t.value.substr(0,range_start+range.text.length).split("\n");range_end+=(line_start+line_nb-1-tab.length)*2;t.selectionEnd=range_end;}}catch(e){}}setTimeout("get_IE_selection(document.getElementById('"+t.id+"'));",50);};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){even
 t.srcElement.focused=false;}function set_IE_selection(t){var nbLineStart,nbLineStart,nbLineEnd,range;if(!window.closed){nbLineStart=t.value.substr(0,t.selectionStart).split("\n").length-1;nbLineEnd=t.value.substr(0,t.selectionEnd).split("\n").length-1;try{range=document.selection.createRange();range.moveToElementText(t);range.setEndPoint('EndToStart',range);range.moveStart('character',t.selectionStart-nbLineStart);range.moveEnd('character',t.selectionEnd-nbLineEnd-(t.selectionStart-nbLineStart));range.select();}catch(e){}}};eAL.waiting_loading["elements_functions.js"]="loaded";
- EAL.prototype.start_resize_area=function(){var d=document,a,div,width,height,father;d.onmouseup=eAL.end_resize_area;d.onmousemove=eAL.resize_area;eAL.toggle(eAL.resize["id"]);a=eAs[eAL.resize["id"]]["textarea"];div=d.getElementById("edit_area_resize");if(!div){div=d.createElement("div");div.id="edit_area_resize";div.style.border="dashed #888888 1px";}width=a.offsetWidth-2;height=a.offsetHeight-2;div.style.display="block";div.style.width=width+"px";div.style.height=height+"px";father=a.parentNode;father.insertBefore(div,a);a.style.display="none";eAL.resize["start_top"]=calculeOffsetTop(div);eAL.resize["start_left"]=calculeOffsetLeft(div);};EAL.prototype.end_resize_area=function(e){var d=document,div,a,width,height;d.onmouseup="";d.onmousemove="";div=d.getElementById("edit_area_resize");a=eAs[eAL.resize["id"]]["textarea"];width=Math.max(eAs[eAL.resize["id"]]["settings"]["min_width"],div.offsetWidth-4);height=Math.max(eAs[eAL.resize["id"]]["settings"]["min_height"],div.offsetHeight-4)
 ;if(eAL.isIE==6){width-=2;height-=2;}a.style.width=width+"px";a.style.height=height+"px";div.style.display="none";a.style.display="inline";a.selectionStart=eAL.resize["selectionStart"];a.selectionEnd=eAL.resize["selectionEnd"];eAL.toggle(eAL.resize["id"]);return false;};EAL.prototype.resize_area=function(e){var allow,newHeight,newWidth;allow=eAs[eAL.resize["id"]]["settings"]["allow_resize"];if(allow=="both"||allow=="y"){newHeight=Math.max(20,getMouseY(e)-eAL.resize["start_top"]);document.getElementById("edit_area_resize").style.height=newHeight+"px";}if(allow=="both"||allow=="x"){newWidth=Math.max(20,getMouseX(e)-eAL.resize["start_left"]);document.getElementById("edit_area_resize").style.width=newWidth+"px";}return false;};eAL.waiting_loading["resize_area.js"]="loaded";
-	EAL.prototype.get_regexp=function(text_array){res="(\\b)(";for(i=0;i<text_array.length;i++){if(i>0)res+="|";res+=this.get_escaped_regexp(text_array[i]);}res+=")(\\b)";reg=new RegExp(res);return res;};EAL.prototype.get_escaped_regexp=function(str){return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g,"\\$1");};EAL.prototype.init_syntax_regexp=function(){var lang_style={};for(var lang in this.load_syntax){if(!this.syntax[lang]){this.syntax[lang]={};this.syntax[lang]["keywords_reg_exp"]={};this.keywords_reg_exp_nb=0;if(this.load_syntax[lang]['KEYWORDS']){param="g";if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)param+="i";for(var i in this.load_syntax[lang]['KEYWORDS']){if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function")continue;this.syntax[lang]["keywords_reg_exp"][i]=new RegExp(this.get_regexp(this.load_syntax[lang]['KEYWORDS'][i]),param);this.keywords_reg_exp_nb++;}}if(this.load_syntax[lang]['OPERATORS']){var str="";var nb=0;for(var i in
  this.load_syntax[lang]['OPERATORS']){if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);nb++;}if(str.length>0)this.syntax[lang]["operators_reg_exp"]=new RegExp("("+str+")","g");}if(this.load_syntax[lang]['DELIMITERS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['DELIMITERS']){if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);nb++;}if(str.length>0)this.syntax[lang]["delimiters_reg_exp"]=new RegExp("("+str+")","g");}var syntax_trace=[];this.syntax[lang]["quotes"]={};var quote_tab=[];if(this.load_syntax[lang]['QUOTEMARKS']){for(var i in this.load_syntax[lang]['QUOTEMARKS']){if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);this.syntax[lang]["quotes"][x]=x;quote_tab[quot
 e_tab.length]="("+x+"(\\\\.|[^"+x+"])*(?:"+x+"|$))";syntax_trace.push(x);}}this.syntax[lang]["comments"]={};if(this.load_syntax[lang]['COMMENT_SINGLE']){for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";syntax_trace.push(x);this.syntax[lang]["comments"][x]="\n";}}if(this.load_syntax[lang]['COMMENT_MULTI']){for(var i in this.load_syntax[lang]['COMMENT_MULTI']){if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function")continue;var start=this.get_escaped_regexp(i);var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";syntax_trace.push(start);syntax_trace.push(end);this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];}}if(quote_tab.length>0)this.syntax[lang]["c
 omment_or_quote_reg_exp"]=new RegExp("("+quote_tab.join("|")+")","gi");if(syntax_trace.length>0)this.syntax[lang]["syntax_trace_regexp"]=new RegExp("((.|\n)*?)(\\\\*("+syntax_trace.join("|")+"|$))","gmi");if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){this.syntax[lang]["script_delimiters"]={};for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function")continue;this.syntax[lang]["script_delimiters"][i]=this.load_syntax[lang]['SCRIPT_DELIMITERS'];}}this.syntax[lang]["custom_regexp"]={};if(this.load_syntax[lang]['REGEXPS']){for(var i in this.load_syntax[lang]['REGEXPS']){if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function")continue;var val=this.load_syntax[lang]['REGEXPS'][i];if(!this.syntax[lang]["custom_regexp"][val['execute']])this.syntax[lang]["custom_regexp"][val['execute']]={};this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp':new RegExp(val['search'],val['modifiers']),'class':val['class']};}
 }if(this.load_syntax[lang]['STYLES']){lang_style[lang]={};for(var i in this.load_syntax[lang]['STYLES']){if(typeof(this.load_syntax[lang]['STYLES'][i])=="function")continue;if(typeof(this.load_syntax[lang]['STYLES'][i])!="string"){for(var j in this.load_syntax[lang]['STYLES'][i]){lang_style[lang][j]=this.load_syntax[lang]['STYLES'][i][j];}}
-else{lang_style[lang][i]=this.load_syntax[lang]['STYLES'][i];}}}var style="";for(var i in lang_style[lang]){if(lang_style[lang][i].length>0){style+="."+lang+" ."+i.toLowerCase()+" span{"+lang_style[lang][i]+"}\n";style+="."+lang+" ."+i.toLowerCase()+"{"+lang_style[lang][i]+"}\n";}}this.syntax[lang]["styles"]=style;}}};eAL.waiting_loading["reg_syntax.js"]="loaded";
-var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "<script type='text/javascript'> Ã EA(){var t=Á;t.error=Ì;t.inlinePopup=[{popup_id:\"area_search_replace\",icon_id:\"search\"},{popup_id:\"edit_area_help\",icon_id:\"help\"}];t.plugins={};t.line_number=0;È.eAL.set_browser_infos(t);if(t.isIE >=8)t.isIE=7;t.É={};t.last_text_to_highlight=\"\";t.last_hightlighted_text=\"\";t.syntax_list=[];t.allready_used_syntax={};t.check_line_selection_timer=50;t.ÂFocused=Ì;t.highlight_selection_line=null;t.previous=[];t.next=[];t.last_undo=\"\";t.files={};t.filesIdAssoc={};t.curr_file='';t.assocBracket={};t.revertAssocBracket={};t.assocBracket[\"(\"]=\")\";t.assocBracket[\"{\"]=\"}\";t.assocBracket[\"[\"]=\"]\";for(var index in t.assocBracket){t.revertAssocBracket[t.assocBracket[index]]=index;}t.is_editable=Ë;t.lineHeight=16;t.tab_nb_char=8;if(t.isOpera)t.tab_nb_char=6;t.is_tabbing=Ì;t.fullscreen={'isFull':Ì};t.isResizing=Ì;t.id=area_id;t.Å=eAs[t.id
 ][\"Å\"];if((\"\"+t.Å['replace_tab_by_spaces']).match(/^[0-9]+$/)){t.tab_nb_char=t.Å['replace_tab_by_spaces'];t.tabulation=\"\";for(var i=0;i<t.tab_nb_char;i++)t.tabulation+=\" \";}\nelse{t.tabulation=\"\t\";}if(t.Å[\"syntax_selection_allow\"]&&t.Å[\"syntax_selection_allow\"].Æ>0)t.syntax_list=t.Å[\"syntax_selection_allow\"].replace(/ /g,\"\").split(\",\");if(t.Å['syntax'])t.allready_used_syntax[t.Å['syntax']]=Ë;};EA.Ä.init=Ã(){var t=Á,a,s=t.Å;t.Â=_$(\"Â\");t.container=_$(\"container\");t.result=_$(\"result\");t.content_highlight=_$(\"content_highlight\");t.selection_field=_$(\"selection_field\");t.selection_field_text=_$(\"selection_field_text\");t.processing_screen=_$(\"processing\");t.editor_area=_$(\"editor\");t.tab_browsing_area=_$(\"tab_browsing_area\");t.test_font_size=_$(\"test_font_size\");a=t.Â;if(!s['is_editable'])t.set_editable(Ì);t.set_show_line_colors(s['show_line_colors']);if(syntax_selec=_$(\"syntax_selection\")){for(var i=0;i<t.syntax_list.Æ;i++){
 var syntax=t.syntax_list[i];var option=document.createElement(\"option\");option.Ê=syntax;if(syntax==s['syntax'])option.selected=\"selected\";option.innerHTML=t.get_translation(\"syntax_\"+syntax,\"word\");syntax_selec.appendChild(option);}}spans=È.getChildren(_$(\"toolbar_1\"),\"span\",\"\",\"\",\"all\",-1);for(var i=0;i<spans.Æ;i++){id=spans[i].id.replace(/tmp_tool_(.*)/,\"$1\");if(id!=spans[i].id){for(var j in t.plugins){if(typeof(t.plugins[j].get_control_html)==\"Ã\"){html=t.plugins[j].get_control_html(id);if(html!=Ì){html=t.get_translation(html,\"template\");var new_span=document.createElement(\"span\");new_span.innerHTML=html;var father=spans[i].ÈNode;spans[i].ÈNode.replaceChild(new_span,spans[i]);break;}}}}}if(s[\"debug\"]){t.debug=È.document.getElementById(\"edit_area_debug_\"+t.id);}if(_$(\"redo\")!=null)t.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);if(typeof(È.eAL.syntax[s[\"syntax\"]])!=\"undefined\"){for(var i in È.eAL.syntax){if(typeof(È.eAL.s
 yntax[i][\"Çs\"])!=\"undefined\"){t.add_Ç(È.eAL.syntax[i][\"Çs\"]);}}}if(t.isOpera)_$(\"editor\").onkeypress=keyDown;\nelse _$(\"editor\").onkeydown=keyDown;for(var i=0;i<t.inlinePopup.Æ;i++){if(t.isOpera)_$(t.inlinePopup[i][\"popup_id\"]).onkeypress=keyDown;\nelse _$(t.inlinePopup[i][\"popup_id\"]).onkeydown=keyDown;}if(s[\"allow_resize\"]==\"both\"||s[\"allow_resize\"]==\"x\"||s[\"allow_resize\"]==\"y\")t.allow_resize(Ë);È.eAL.toggle(t.id,\"on\");t.change_smooth_selection_mode(eA.smooth_selection);t.execCommand(\"change_highlight\",s[\"start_highlight\"]);t.set_font(eA.Å[\"font_family\"],eA.Å[\"font_size\"]);children=È.getChildren(document.body,\"\",\"selec\",\"none\",\"all\",-1);for(var i=0;i<children.Æ;i++){if(t.isIE)children[i].unselectable=Ë;\nelse children[i].onmousedown=Ã(){return Ì};}a.spellcheck=s[\"gecko_spellcheck\"];if(t.isFirefox >='3'){t.content_highlight.Ç.paddingLeft=\"1px\";t.selection_field.Ç.paddingLeft=\"1px\";t.selection_field_text.Ç.paddingLef
 t=\"1px\";}if(t.isIE&&t.isIE < 8){a.Ç.marginTop=\"-1px\";}if(t.isSafari){t.editor_area.Ç.position=\"absolute\";a.Ç.marginLeft=\"-3px\";if(t.isSafari < 3.2)a.Ç.marginTop=\"1px\";}È.eAL.add_event(t.result,\"click\",Ã(e){if((e.target||e.srcElement)==eA.result){eA.area_select(eA.Â.Ê.Æ,0);}});if(s['is_multi_files']!=Ì)t.open_file({'id':t.curr_file,'text':''});t.set_word_wrap(s['word_wrap']);setTimeout(\"eA.focus();eA.manage_size();eA.execCommand('EA_load');\",10);t.check_undo();t.check_line_selection(Ë);t.scroll_to_view();for(var i in t.plugins){if(typeof(t.plugins[i].onload)==\"Ã\")t.plugins[i].onload();}if(s['fullscreen']==Ë)t.toggle_full_screen(Ë);È.eAL.add_event(window,\"resize\",eA.update_size);È.eAL.add_event(È.window,\"resize\",eA.update_size);È.eAL.add_event(top.window,\"resize\",eA.update_size);È.eAL.add_event(window,\"unload\",Ã(){if(È.eAL){È.eAL.remove_event(È.window,\"resize\",eA.update_size);È.eAL.remove_event(top.window,\"resize\",eA.update_size);}if
 (eAs[eA.id]&&eAs[eA.id][\"displayed\"]){eA.execCommand(\"EA_unload\");}});};EA.Ä.update_size=Ã(){var d=document,pd=È.document,height,width,popup,maxLeft,maxTop;if(typeof eAs !='undefined'&&eAs[eA.id]&&eAs[eA.id][\"displayed\"]==Ë){if(eA.fullscreen['isFull']){pd.getElementById(\"frame_\"+eA.id).Ç.width=pd.getElementsByTagName(\"html\")[0].clientWidth+\"px\";pd.getElementById(\"frame_\"+eA.id).Ç.height=pd.getElementsByTagName(\"html\")[0].clientHeight+\"px\";}if(eA.tab_browsing_area.Ç.display=='block'&&(!eA.isIE||eA.isIE >=8)){eA.tab_browsing_area.Ç.height=\"0px\";eA.tab_browsing_area.Ç.height=(eA.result.offsetTop-eA.tab_browsing_area.offsetTop-1)+\"px\";}height=d.body.offsetHeight-eA.get_all_toolbar_height()-4;eA.result.Ç.height=height+\"px\";width=d.body.offsetWidth-2;eA.result.Ç.width=width+\"px\";for(i=0;i < eA.inlinePopup.Æ;i++){popup=_$(eA.inlinePopup[i][\"popup_id\"]);maxLeft=d.body.offsetWidth-popup.offsetWidth;maxTop=d.body.offsetHeight-popup.offsetHeight;if(popup
 .offsetTop > maxTop)popup.Ç.top=maxTop+\"px\";if(popup.offsetLeft > maxLeft)popup.Ç.left=maxLeft+\"px\";}eA.manage_size(Ë);eA.fixLinesHeight(eA.Â.Ê,0,-1);}};EA.Ä.manage_size=Ã(onlyOneTime){if(!eAs[Á.id])return Ì;if(eAs[Á.id][\"displayed\"]==Ë&&Á.ÂFocused){var area_height,resized=Ì;if(!Á.Å['word_wrap']){var area_width=Á.Â.scrollWidth;area_height=Á.Â.scrollHeight;if(Á.isOpera&&Á.isOpera < 9.6){area_width=10000;}if(Á.Â.previous_scrollWidth!=area_width){Á.container.Ç.width=area_width+\"px\";Á.Â.Ç.width=area_width+\"px\";Á.content_highlight.Ç.width=area_width+\"px\";Á.Â.previous_scrollWidth=area_width;resized=Ë;}}if(Á.Å['word_wrap']){newW=Á.Â.offsetWidth;if(Á.isFirefox||Á.isIE)newW-=2;if(Á.isSafari)newW-=6;Á.content_highlight.Ç.width=Á.selection_field_text.Ç.width=Á.selection_field.Ç.width=Á.test_font_size.Ç.width=newW+\"px\";}if(Á.isOpera||Á.isFirefox||Á.isSafari){area_height=Á.getLinePosTop(Á.É[\"nb_line\"]+1);}\nelse{area_height=�
 �.Â.scrollHeight;}if(Á.Â.previous_scrollHeight!=area_height){Á.container.Ç.height=(area_height+2)+\"px\";Á.Â.Ç.height=area_height+\"px\";Á.content_highlight.Ç.height=area_height+\"px\";Á.Â.previous_scrollHeight=area_height;resized=Ë;}if(Á.É[\"nb_line\"] >=Á.line_number){var newLines='',destDiv=_$(\"line_number\"),start=Á.line_number,end=Á.É[\"nb_line\"]+100;for(i=start+1;i < end;i++){newLines+='<div id=\"line_'+i+'\">'+i+\"</div>\";Á.line_number++;}destDiv.innerHTML=destDiv.innerHTML+newLines;Á.fixLinesHeight(Á.Â.Ê,start,-1);}Á.Â.scrollTop=\"0px\";Á.Â.scrollLeft=\"0px\";if(resized==Ë){Á.scroll_to_view();}}if(!onlyOneTime)setTimeout(\"eA.manage_size();\",100);};EA.Ä.execCommand=Ã(cmd,param){for(var i in Á.plugins){if(typeof(Á.plugins[i].execCommand)==\"Ã\"){if(!Á.plugins[i].execCommand(cmd,param))return;}}switch(cmd){case \"save\":if(Á.Å[\"save_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"save_callback\"]+\"('\"+Á.id+\"',eA.Â.Ê);\");break;case \"load
 \":if(Á.Å[\"load_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"load_callback\"]+\"('\"+Á.id+\"');\");break;case \"onchange\":if(Á.Å[\"change_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"change_callback\"]+\"('\"+Á.id+\"');\");break;case \"EA_load\":if(Á.Å[\"EA_load_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_load_callback\"]+\"('\"+Á.id+\"');\");break;case \"EA_unload\":if(Á.Å[\"EA_unload_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_unload_callback\"]+\"('\"+Á.id+\"');\");break;case \"toggle_on\":if(Á.Å[\"EA_toggle_on_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_toggle_on_callback\"]+\"('\"+Á.id+\"');\");break;case \"toggle_off\":if(Á.Å[\"EA_toggle_off_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_toggle_off_callback\"]+\"('\"+Á.id+\"');\");break;case \"re_sync\":if(!Á.do_highlight)break;case \"file_switch_on\":if(Á.Å[\"EA_file_switch_on_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_file_switch_on_callback\"]+\"(param);\");break;case \"file_switch_off\":if(Á.Å[\"EA_file_switch_off_callback\"].Æ
 >0)eval(\"È.\"+Á.Å[\"EA_file_switch_off_callback\"]+\"(param);\");break;case \"file_close\":if(Á.Å[\"EA_file_close_callback\"].Æ>0)return eval(\"È.\"+Á.Å[\"EA_file_close_callback\"]+\"(param);\");break;default:if(typeof(eval(\"eA.\"+cmd))==\"Ã\"){if(Á.Å[\"debug\"])eval(\"eA.\"+cmd+\"(param);\");\nelse try{eval(\"eA.\"+cmd+\"(param);\");}catch(e){};}}};EA.Ä.get_translation=Ã(word,mode){if(mode==\"template\")return È.eAL.translate(word,Á.Å[\"language\"],mode);\nelse return È.eAL.get_word_translation(word,Á.Å[\"language\"]);};EA.Ä.add_plugin=Ã(plug_name,plug_obj){for(var i=0;i<Á.Å[\"plugins\"].Æ;i++){if(Á.Å[\"plugins\"][i]==plug_name){Á.plugins[plug_name]=plug_obj;plug_obj.baseURL=È.eAL.baseURL+\"plugins/\"+plug_name+\"/\";if(typeof(plug_obj.init)==\"Ã\")plug_obj.init();}}};EA.Ä.load_css=Ã(url){try{link=document.createElement(\"link\");link.type=\"text/css\";link.rel=\"Çsheet\";link.media=\"all\";link.href=url;head=document.getElementsByTagName(\"head\"
 );head[0].appendChild(link);}catch(e){document.write(\"<link href='\"+url+\"' rel='Çsheet' type='text/css' />\");}};EA.Ä.load_script=Ã(url){try{script=document.createElement(\"script\");script.type=\"text/javascript\";script.src=url;script.charset=\"UTF-8\";head=document.getElementsByTagName(\"head\");head[0].appendChild(script);}catch(e){document.write(\"<script type='text/javascript' src='\"+url+\"' charset=\\\"UTF-8\\\"><\"+\"/script>\");}};EA.Ä.add_lang=Ã(language,Ês){if(!È.eAL.lang[language])È.eAL.lang[language]={};for(var i in Ês)È.eAL.lang[language][i]=Ês[i];};Ã _$(id){return document.getElementById(id);};var eA=new EA();È.eAL.add_event(window,\"load\",init);Ã init(){setTimeout(\"eA.init();\",10);};	EA.Ä.focus=Ã(){Á.Â.focus();Á.ÂFocused=Ë;};EA.Ä.check_line_selection=Ã(timer_checkup){var changes,infos,new_top,new_width,i;var t1=t2=t2_1=t3=tLines=tend=new Date().getTime();if(!eAs[Á.id])return Ì;if(!Á.smooth_selection&&!Á.do_highlight){}\nelse if(Á.Â
 Focused&&eAs[Á.id][\"displayed\"]==Ë&&Á.isResizing==Ì){infos=Á.get_selection_infos();changes=Á.checkTextEvolution(typeof(Á.É['full_text'])=='undefined' ? '':Á.É['full_text'],infos['full_text']);t2=new Date().getTime();if(Á.É[\"line_start\"] !=infos[\"line_start\"]||Á.É[\"line_nb\"] !=infos[\"line_nb\"]||infos[\"full_text\"] !=Á.É[\"full_text\"]||Á.reload_highlight||Á.É[\"selectionStart\"] !=infos[\"selectionStart\"]||Á.É[\"selectionEnd\"] !=infos[\"selectionEnd\"]||!timer_checkup){new_top=Á.getLinePosTop(infos[\"line_start\"]);new_width=Math.max(Á.Â.scrollWidth,Á.container.clientWidth-50);Á.selection_field.Ç.top=Á.selection_field_text.Ç.top=new_top+\"px\";if(!Á.Å['word_wrap']){Á.selection_field.Ç.width=Á.selection_field_text.Ç.width=Á.test_font_size.Ç.width=new_width+\"px\";}if(Á.do_highlight==Ë){var curr_text=infos[\"full_text\"].split(\"\\n\");var content=\"\";var start=Math.max(0,infos[\"line_start\"]-1);var end=Math.min(curr_text.Æ,infos[\
 "line_start\"]+infos[\"line_nb\"]-1);for(i=start;i< end;i++){content+=curr_text[i]+\"\\n\";}selLength=infos['selectionEnd']-infos['selectionStart'];content=content.substr(0,infos[\"curr_pos\"]-1)+\"\\r\\r\"+content.substr(infos[\"curr_pos\"]-1,selLength)+\"\\r\\r\"+content.substr(infos[\"curr_pos\"]-1+selLength);content='<span>'+content.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(\"\\r\\r\",'</span><strong>').replace(\"\\r\\r\",'</strong><span>')+'</span>';if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){Á.selection_field.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{Á.selection_field.innerHTML=content;}Á.selection_field_text.innerHTML=Á.selection_field.innerHTML;t2_1=new Date().getTime();if(Á.reload_highlight||(infos[\"full_text\"] !=Á.last_text_to_highlight&&(Á.É[\"line_start\"]!=infos[\"line_start\"]||Á.show_line_colors||Á.Å['word_wrap']||Á.É[\"line_nb\"]!=infos[\"line_nb\"]||Á.É[\"nb_line\"]!=infos[\"nb_li
 ne\"]))){Á.maj_highlight(infos);}}}t3=new Date().getTime();if(Á.Å['word_wrap']&&infos[\"full_text\"] !=Á.É[\"full_text\"]){if(changes.newText.split(\"\\n\").Æ==1&&Á.É['nb_line']&&infos['nb_line']==Á.É['nb_line']){Á.fixLinesHeight(infos['full_text'],changes.lineStart,changes.lineStart);}\nelse{Á.fixLinesHeight(infos['full_text'],changes.lineStart,-1);}}tLines=new Date().getTime();if(infos[\"line_start\"] !=Á.É[\"line_start\"]||infos[\"curr_pos\"] !=Á.É[\"curr_pos\"]||infos[\"full_text\"].Æ!=Á.É[\"full_text\"].Æ||Á.reload_highlight||!timer_checkup){var selec_char=infos[\"curr_line\"].charAt(infos[\"curr_pos\"]-1);var no_real_move=Ë;if(infos[\"line_nb\"]==1&&(Á.assocBracket[selec_char]||Á.revertAssocBracket[selec_char])){no_real_move=Ì;if(Á.findEndBracket(infos,selec_char)===Ë){_$(\"end_bracket\").Ç.visibility=\"visible\";_$(\"cursor_pos\").Ç.visibility=\"visible\";_$(\"cursor_pos\").innerHTML=selec_char;_$(\"end_bracket\").innerHTML=(Á.assocBracket[selec_
 char]||Á.revertAssocBracket[selec_char]);}\nelse{_$(\"end_bracket\").Ç.visibility=\"hidden\";_$(\"cursor_pos\").Ç.visibility=\"hidden\";}}\nelse{_$(\"cursor_pos\").Ç.visibility=\"hidden\";_$(\"end_bracket\").Ç.visibility=\"hidden\";}Á.displayToCursorPosition(\"cursor_pos\",infos[\"line_start\"],infos[\"curr_pos\"]-1,infos[\"curr_line\"],no_real_move);if(infos[\"line_nb\"]==1&&infos[\"line_start\"]!=Á.É[\"line_start\"])Á.scroll_to_view();}Á.É=infos;}tend=new Date().getTime();if(timer_checkup){setTimeout(\"eA.check_line_selection(Ë)\",Á.check_line_selection_timer);}};EA.Ä.get_selection_infos=Ã(){var sel={},start,end,len,str;Á.getIESelection();start=Á.Â.selectionStart;end=Á.Â.selectionEnd;if(Á.É[\"selectionStart\"]==start&&Á.É[\"selectionEnd\"]==end&&Á.É[\"full_text\"]==Á.Â.Ê){return Á.É;}if(Á.tabulation!=\"\t\"&&Á.Â.Ê.indexOf(\"\t\")!=-1){len=Á.Â.Ê.Æ;Á.Â.Ê=Á.replace_tab(Á.Â.Ê);start=end=start+(Á.Â.Ê.Æ-len);Á.area_select(start,0);}sel[
 \"selectionStart\"]=start;sel[\"selectionEnd\"]=end;sel[\"full_text\"]=Á.Â.Ê;sel[\"line_start\"]=1;sel[\"line_nb\"]=1;sel[\"curr_pos\"]=0;sel[\"curr_line\"]=\"\";sel[\"indexOfCursor\"]=0;sel[\"selec_direction\"]=Á.É[\"selec_direction\"];var splitTab=sel[\"full_text\"].split(\"\\n\");var nbLine=Math.max(0,splitTab.Æ);var nbChar=Math.max(0,sel[\"full_text\"].Æ-(nbLine-1));if(sel[\"full_text\"].indexOf(\"\\r\")!=-1)nbChar=nbChar-(nbLine-1);sel[\"nb_line\"]=nbLine;sel[\"nb_char\"]=nbChar;if(start>0){str=sel[\"full_text\"].substr(0,start);sel[\"curr_pos\"]=start-str.lastIndexOf(\"\\n\");sel[\"line_start\"]=Math.max(1,str.split(\"\\n\").Æ);}\nelse{sel[\"curr_pos\"]=1;}if(end>start){sel[\"line_nb\"]=sel[\"full_text\"].substring(start,end).split(\"\\n\").Æ;}sel[\"indexOfCursor\"]=start;sel[\"curr_line\"]=splitTab[Math.max(0,sel[\"line_start\"]-1)];if(sel[\"selectionStart\"]==Á.É[\"selectionStart\"]){if(sel[\"selectionEnd\"]>Á.É[\"selectionEnd\"])sel[\"selec_direction\"]=\"down\
 ";\nelse if(sel[\"selectionEnd\"]==Á.É[\"selectionStart\"])sel[\"selec_direction\"]=Á.É[\"selec_direction\"];}\nelse if(sel[\"selectionStart\"]==Á.É[\"selectionEnd\"]&&sel[\"selectionEnd\"]>Á.É[\"selectionEnd\"]){sel[\"selec_direction\"]=\"down\";}\nelse{sel[\"selec_direction\"]=\"up\";}_$(\"nbLine\").innerHTML=nbLine;_$(\"nbChar\").innerHTML=nbChar;_$(\"linePos\").innerHTML=sel[\"line_start\"];_$(\"currPos\").innerHTML=sel[\"curr_pos\"];return sel;};EA.Ä.getIESelection=Ã(){var selectionStart,selectionEnd,range,stored_range;if(!Á.isIE)return Ì;if(Á.Å['word_wrap'])Á.Â.wrap='off';try{range=document.selection.createRange();stored_range=range.duplicate();stored_range.moveToElementText(Á.Â);stored_range.setEndPoint('EndToEnd',range);if(stored_range.ÈElement()!=Á.Â)throw \"invalid focus\";var scrollTop=Á.result.scrollTop+document.body.scrollTop;var relative_top=range.offsetTop-È.calculeOffsetTop(Á.Â)+scrollTop;var line_start=Math.round((relative_top / Á.lineHeigh
 t)+1);var line_nb=Math.round(range.boundingHeight / Á.lineHeight);selectionStart=stored_range.text.Æ-range.text.Æ;selectionStart+=(line_start-Á.Â.Ê.substr(0,selectionStart).split(\"\\n\").Æ)*2;selectionStart-=(line_start-Á.Â.Ê.substr(0,selectionStart).split(\"\\n\").Æ)* 2;selectionEnd=selectionStart+range.text.Æ;selectionEnd+=(line_start+line_nb-1-Á.Â.Ê.substr(0,selectionEnd).split(\"\\n\").Æ)*2;Á.Â.selectionStart=selectionStart;Á.Â.selectionEnd=selectionEnd;}catch(e){}if(Á.Å['word_wrap'])Á.Â.wrap='soft';};EA.Ä.setIESelection=Ã(){var a=Á.Â,nbLineStart,nbLineEnd,range;if(!Á.isIE)return Ì;nbLineStart=a.Ê.substr(0,a.selectionStart).split(\"\\n\").Æ-1;nbLineEnd=a.Ê.substr(0,a.selectionEnd).split(\"\\n\").Æ-1;range=document.selection.createRange();range.moveToElementText(a);range.setEndPoint('EndToStart',range);range.moveStart('character',a.selectionStart-nbLineStart);range.moveEnd('character',a.selectionEnd-nbLineEnd-(a.selectionStart-nbLineStart));rang
 e.select();};EA.Ä.checkTextEvolution=Ã(lastText,newText){var ch={},baseStep=200,cpt=0,end,step,tStart=new Date().getTime();end=Math.min(newText.Æ,lastText.Æ);step=baseStep;while(cpt<end&&step>=1){if(lastText.substr(cpt,step)==newText.substr(cpt,step)){cpt+=step;}\nelse{step=Math.floor(step/2);}}ch.posStart=cpt;ch.lineStart=newText.substr(0,ch.posStart).split(\"\\n\").Æ-1;cpt_last=lastText.Æ;cpt=newText.Æ;step=baseStep;while(cpt>=0&&cpt_last>=0&&step>=1){if(lastText.substr(cpt_last-step,step)==newText.substr(cpt-step,step)){cpt-=step;cpt_last-=step;}\nelse{step=Math.floor(step/2);}}ch.posNewEnd=cpt;ch.posLastEnd=cpt_last;if(ch.posNewEnd<=ch.posStart){if(lastText.Æ < newText.Æ){ch.posNewEnd=ch.posStart+newText.Æ-lastText.Æ;ch.posLastEnd=ch.posStart;}\nelse{ch.posLastEnd=ch.posStart+lastText.Æ-newText.Æ;ch.posNewEnd=ch.posStart;}}ch.newText=newText.substring(ch.posStart,ch.posNewEnd);ch.lastText=lastText.substring(ch.posStart,ch.posLastEnd);ch.lineNewEnd=newText.substr(0,c
 h.posNewEnd).split(\"\\n\").Æ-1;ch.lineLastEnd=lastText.substr(0,ch.posLastEnd).split(\"\\n\").Æ-1;ch.newTextLine=newText.split(\"\\n\").slice(ch.lineStart,ch.lineNewEnd+1).join(\"\\n\");ch.lastTextLine=lastText.split(\"\\n\").slice(ch.lineStart,ch.lineLastEnd+1).join(\"\\n\");return ch;};EA.Ä.tab_selection=Ã(){if(Á.is_tabbing)return;Á.is_tabbing=Ë;Á.getIESelection();var start=Á.Â.selectionStart;var end=Á.Â.selectionEnd;var insText=Á.Â.Ê.substring(start,end);var pos_start=start;var pos_end=end;if(insText.Æ==0){Á.Â.Ê=Á.Â.Ê.substr(0,start)+Á.tabulation+Á.Â.Ê.substr(end);pos_start=start+Á.tabulation.Æ;pos_end=pos_start;}\nelse{start=Math.max(0,Á.Â.Ê.substr(0,start).lastIndexOf(\"\\n\")+1);endText=Á.Â.Ê.substr(end);startText=Á.Â.Ê.substr(0,start);tmp=Á.Â.Ê.substring(start,end).split(\"\\n\");insText=Á.tabulation+tmp.join(\"\\n\"+Á.tabulation);Á.Â.Ê=startText+insText+endText;pos_start=start;pos_end=Á.Â.Ê.indexOf(\"\\n\",startText.Æ+insText
 .Æ);if(pos_end==-1)pos_end=Á.Â.Ê.Æ;}Á.Â.selectionStart=pos_start;Á.Â.selectionEnd=pos_end;if(Á.isIE){Á.setIESelection();setTimeout(\"eA.is_tabbing=Ì;\",100);}\nelse{Á.is_tabbing=Ì;}};EA.Ä.invert_tab_selection=Ã(){var t=Á,a=Á.Â;if(t.is_tabbing)return;t.is_tabbing=Ë;t.getIESelection();var start=a.selectionStart;var end=a.selectionEnd;var insText=a.Ê.substring(start,end);var pos_start=start;var pos_end=end;if(insText.Æ==0){if(a.Ê.substring(start-t.tabulation.Æ,start)==t.tabulation){a.Ê=a.Ê.substr(0,start-t.tabulation.Æ)+a.Ê.substr(end);pos_start=Math.max(0,start-t.tabulation.Æ);pos_end=pos_start;}}\nelse{start=a.Ê.substr(0,start).lastIndexOf(\"\\n\")+1;endText=a.Ê.substr(end);startText=a.Ê.substr(0,start);tmp=a.Ê.substring(start,end).split(\"\\n\");insText=\"\";for(i=0;i<tmp.Æ;i++){for(j=0;j<t.tab_nb_char;j++){if(tmp[i].charAt(0)==\"\t\"){tmp[i]=tmp[i].substr(1);j=t.tab_nb_char;}\nelse if(tmp[i].charAt(0)==\" \")tmp[i]=tmp[i].substr(1);}insText+=tmp[i]
 ;if(i<tmp.Æ-1)insText+=\"\\n\";}a.Ê=startText+insText+endText;pos_start=start;pos_end=a.Ê.indexOf(\"\\n\",startText.Æ+insText.Æ);if(pos_end==-1)pos_end=a.Ê.Æ;}a.selectionStart=pos_start;a.selectionEnd=pos_end;if(t.isIE){t.setIESelection();setTimeout(\"eA.is_tabbing=Ì;\",100);}\nelse t.is_tabbing=Ì;};EA.Ä.press_enter=Ã(){if(!Á.smooth_selection)return Ì;Á.getIESelection();var scrollTop=Á.result.scrollTop;var scrollLeft=Á.result.scrollLeft;var start=Á.Â.selectionStart;var end=Á.Â.selectionEnd;var start_last_line=Math.max(0,Á.Â.Ê.substring(0,start).lastIndexOf(\"\\n\")+1);var begin_line=Á.Â.Ê.substring(start_last_line,start).replace(/^([ \t]*).*/gm,\"$1\");var lineStart=Á.Â.Ê.substring(0,start).split(\"\\n\").Æ;if(begin_line==\"\\n\"||begin_line==\"\\r\"||begin_line.Æ==0){return Ì;}if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){begin_line=\"\\r\\n\"+begin_line;}\nelse{begin_line=\"\\n\"+begin_line;}Á.Â.Ê=Á.Â.Ê.substring(0,start)+begin_line+Á.Â.Ê.sub
 string(end);Á.area_select(start+begin_line.Æ,0);if(Á.isIE){Á.result.scrollTop=scrollTop;Á.result.scrollLeft=scrollLeft;}return Ë;};EA.Ä.findEndBracket=Ã(infos,bracket){var start=infos[\"indexOfCursor\"];var normal_order=Ë;if(Á.assocBracket[bracket])endBracket=Á.assocBracket[bracket];\nelse if(Á.revertAssocBracket[bracket]){endBracket=Á.revertAssocBracket[bracket];normal_order=Ì;}var end=-1;var nbBracketOpen=0;for(var i=start;i<infos[\"full_text\"].Æ&&i>=0;){if(infos[\"full_text\"].charAt(i)==endBracket){nbBracketOpen--;if(nbBracketOpen<=0){end=i;break;}}\nelse if(infos[\"full_text\"].charAt(i)==bracket)nbBracketOpen++;if(normal_order)i++;\nelse i--;}if(end==-1)return Ì;var endLastLine=infos[\"full_text\"].substr(0,end).lastIndexOf(\"\\n\");if(endLastLine==-1)line=1;\nelse line=infos[\"full_text\"].substr(0,endLastLine).split(\"\\n\").Æ+1;var curPos=end-endLastLine-1;var endLineLength=infos[\"full_text\"].substring(end).split(\"\\n\")[0].Æ;Á.displayToCursorPosition
 (\"end_bracket\",line,curPos,infos[\"full_text\"].substring(endLastLine+1,end+endLineLength));return Ë;};EA.Ä.displayToCursorPosition=Ã(id,start_line,cur_pos,lineContent,no_real_move){var elem,dest,content,posLeft=0,posTop,fixPadding,topOffset,endElem;elem=Á.test_font_size;dest=_$(id);content=\"<span id='test_font_size_inner'>\"+lineContent.substr(0,cur_pos).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\")+\"</span><span id='endTestFont'>\"+lineContent.substr(cur_pos).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\")+\"</span>\";if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){elem.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{elem.innerHTML=content;}endElem=_$('endTestFont');topOffset=endElem.offsetTop;fixPadding=parseInt(Á.content_highlight.Ç.paddingLeft.replace(\"px\",\"\"));posLeft=45+endElem.offsetLeft+(!isNaN(fixPadding)&&topOffset > 0 ? fixPadding:0);posTop=Á.getLinePosTop(start_line)+topOffset;if(Á.isIE&&cur_pos > 0&&endElem.offsetLeft==0){posTop+
 =Á.lineHeight;}if(no_real_move!=Ë){dest.Ç.top=posTop+\"px\";dest.Ç.left=posLeft+\"px\";}dest.cursor_top=posTop;dest.cursor_left=posLeft;};EA.Ä.getLinePosTop=Ã(start_line){var elem=_$('line_'+start_line),posTop=0;if(elem)posTop=elem.offsetTop;\nelse posTop=Á.lineHeight *(start_line-1);return posTop;};EA.Ä.getTextHeight=Ã(text){var t=Á,elem,height;elem=t.test_font_size;content=text.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\");if(t.isIE||(Á.isOpera&&Á.isOpera < 9.6)){elem.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{elem.innerHTML=content;}height=elem.offsetHeight;height=Math.max(1,Math.floor(elem.offsetHeight / Á.lineHeight))* Á.lineHeight;return height;};EA.Ä.fixLinesHeight=Ã(textValue,lineStart,lineEnd){var aText=textValue.split(\"\\n\");if(lineEnd==-1)lineEnd=aText.Æ-1;for(var i=Math.max(0,lineStart);i <=lineEnd;i++){if(elem=_$('line_'+(i+1))){elem.Ç.height=typeof(aText[i])!=\"undefined\" ? Á.getTextHeight(aText[i])+\"px\":Á.line
 Height;}}};EA.Ä.area_select=Ã(start,Æ){Á.Â.focus();start=Math.max(0,Math.min(Á.Â.Ê.Æ,start));end=Math.max(start,Math.min(Á.Â.Ê.Æ,start+Æ));if(Á.isIE){Á.Â.selectionStart=start;Á.Â.selectionEnd=end;Á.setIESelection();}\nelse{if(Á.isOpera&&Á.isOpera < 9.6){Á.Â.setSelectionRange(0,0);}Á.Â.setSelectionRange(start,end);}Á.check_line_selection();};EA.Ä.area_get_selection=Ã(){var text=\"\";if(document.selection){var range=document.selection.createRange();text=range.text;}\nelse{text=Á.Â.Ê.substring(Á.Â.selectionStart,Á.Â.selectionEnd);}return text;}; EA.Ä.replace_tab=Ã(text){return text.replace(/((\\n?)([^\t\\n]*)\t)/gi,eA.smartTab);};EA.Ä.smartTab=Ã(){val=\"                   \";return EA.Ä.smartTab.arguments[2]+EA.Ä.smartTab.arguments[3]+val.substr(0,eA.tab_nb_char-(EA.Ä.smartTab.arguments[3].Æ)%eA.tab_nb_char);};EA.Ä.show_waiting_screen=Ã(){width=Á.editor_area.offsetWidth;height=Á.editor_area.offsetHeight;if(!(Á.isIE&&Á.isIE<6)){width-=2;
 height-=2;}Á.processing_screen.Ç.display=\"block\";Á.processing_screen.Ç.width=width+\"px\";Á.processing_screen.Ç.height=height+\"px\";Á.waiting_screen_displayed=Ë;};EA.Ä.hide_waiting_screen=Ã(){Á.processing_screen.Ç.display=\"none\";Á.waiting_screen_displayed=Ì;};EA.Ä.add_Ç=Ã(Çs){if(Çs.Æ>0){newcss=document.createElement(\"Ç\");newcss.type=\"text/css\";newcss.media=\"all\";if(newcss.ÇSheet){newcss.ÇSheet.cssText=Çs;}\nelse{newcss.appendChild(document.createTextNode(Çs));}document.getElementsByTagName(\"head\")[0].appendChild(newcss);}};EA.Ä.set_font=Ã(family,size){var t=Á,a=Á.Â,s=Á.Å,elem_font,i,elem;var elems=[\"Â\",\"content_highlight\",\"cursor_pos\",\"end_bracket\",\"selection_field\",\"selection_field_text\",\"line_number\"];if(family&&family!=\"\")s[\"font_family\"]=family;if(size&&size>0)s[\"font_size\"]=size;if(t.isOpera&&t.isOpera < 9.6)s['font_family']=\"monospace\";if(elem_font=_$(\"area_font_size\")){for(i=0;i < elem_font.Æ;i++){if(elem_
 font.options[i].Ê&&elem_font.options[i].Ê==s[\"font_size\"])elem_font.options[i].selected=Ë;}}if(t.isFirefox){var nbTry=3;do{var div1=document.createElement('div'),text1=document.createElement('Â');var Çs={width:'40px',overflow:'scroll',zIndex:50,visibility:'hidden',fontFamily:s[\"font_family\"],fontSize:s[\"font_size\"]+\"pt\",lineHeight:t.lineHeight+\"px\",padding:'0',margin:'0',border:'none',whiteSpace:'nowrap'};var diff,changed=Ì;for(i in Çs){div1.Ç[ i ]=Çs[i];text1.Ç[ i ]=Çs[i];}text1.wrap='off';text1.setAttribute('wrap','off');t.container.appendChild(div1);t.container.appendChild(text1);div1.innerHTML=text1.Ê='azertyuiopqsdfghjklm';div1.innerHTML=text1.Ê=text1.Ê+'wxcvbn^p*ù$!:;,,';diff=text1.scrollWidth-div1.scrollWidth;if(Math.abs(diff)>=2){s[\"font_size\"]++;changed=Ë;}t.container.removeChild(div1);t.container.removeChild(text1);nbTry--;}while(changed&&nbTry > 0);}elem=t.test_font_size;elem.Ç.fontFamily=\"\"+s[\"font_family\"];elem.Ç.fontSize=s[\"font_size\
 "]+\"pt\";elem.innerHTML=\"0\";t.lineHeight=elem.offsetHeight;for(i=0;i<elems.Æ;i++){elem=_$(elems[i]);elem.Ç.fontFamily=s[\"font_family\"];elem.Ç.fontSize=s[\"font_size\"]+\"pt\";elem.Ç.lineHeight=t.lineHeight+\"px\";}t.add_Ç(\"pre{font-family:\"+s[\"font_family\"]+\"}\");if((t.isOpera&&t.isOpera < 9.6)||t.isIE >=8){var parNod=a.ÈNode,nxtSib=a.nextSibling,start=a.selectionStart,end=a.selectionEnd;parNod.removeChild(a);parNod.insertBefore(a,nxtSib);t.area_select(start,end-start);}Á.focus();Á.update_size();Á.check_line_selection();};EA.Ä.change_font_size=Ã(){var size=_$(\"area_font_size\").Ê;if(size>0)Á.set_font(\"\",size);};EA.Ä.open_inline_popup=Ã(popup_id){Á.close_all_inline_popup();var popup=_$(popup_id);var editor=_$(\"editor\");for(var i=0;i<Á.inlinePopup.Æ;i++){if(Á.inlinePopup[i][\"popup_id\"]==popup_id){var icon=_$(Á.inlinePopup[i][\"icon_id\"]);if(icon){Á.switchClassSticky(icon,'editAreaButtonSelected',Ë);break;}}}popup.Ç.height=\"auto\";popup.Ç.over
 flow=\"visible\";if(document.body.offsetHeight< popup.offsetHeight){popup.Ç.height=(document.body.offsetHeight-10)+\"px\";popup.Ç.overflow=\"auto\";}if(!popup.positionned){var new_left=editor.offsetWidth /2-popup.offsetWidth /2;var new_top=editor.offsetHeight /2-popup.offsetHeight /2;popup.Ç.left=new_left+\"px\";popup.Ç.top=new_top+\"px\";popup.positionned=Ë;}popup.Ç.visibility=\"visible\";};EA.Ä.close_inline_popup=Ã(popup_id){var popup=_$(popup_id);for(var i=0;i<Á.inlinePopup.Æ;i++){if(Á.inlinePopup[i][\"popup_id\"]==popup_id){var icon=_$(Á.inlinePopup[i][\"icon_id\"]);if(icon){Á.switchClassSticky(icon,'editAreaButtonNormal',Ì);break;}}}popup.Ç.visibility=\"hidden\";};EA.Ä.close_all_inline_popup=Ã(e){for(var i=0;i<Á.inlinePopup.Æ;i++){Á.close_inline_popup(Á.inlinePopup[i][\"popup_id\"]);}Á.Â.focus();};EA.Ä.show_help=Ã(){Á.open_inline_popup(\"edit_area_help\");};EA.Ä.new_document=Ã(){Á.Â.Ê=\"\";Á.area_select(0,0);};EA.Ä.get_all_toolbar_height=Ã(){va
 r area=_$(\"editor\");var results=È.getChildren(area,\"div\",\"class\",\"area_toolbar\",\"all\",\"0\");var height=0;for(var i=0;i<results.Æ;i++){height+=results[i].offsetHeight;}return height;};EA.Ä.go_to_line=Ã(line){if(!line){var icon=_$(\"go_to_line\");if(icon !=null){Á.restoreClass(icon);Á.switchClassSticky(icon,'editAreaButtonSelected',Ë);}line=prompt(Á.get_translation(\"go_to_line_prompt\"));if(icon !=null)Á.switchClassSticky(icon,'editAreaButtonNormal',Ì);}if(line&&line!=null&&line.search(/^[0-9]+$/)!=-1){var start=0;var lines=Á.Â.Ê.split(\"\\n\");if(line > lines.Æ)start=Á.Â.Ê.Æ;\nelse{for(var i=0;i<Math.min(line-1,lines.Æ);i++)start+=lines[i].Æ+1;}Á.area_select(start,0);}};EA.Ä.change_smooth_selection_mode=Ã(setTo){if(Á.do_highlight)return;if(setTo !=null){if(setTo===Ì)Á.smooth_selection=Ë;\nelse Á.smooth_selection=Ì;}var icon=_$(\"change_smooth_selection\");Á.Â.focus();if(Á.smooth_selection===Ë){Á.switchClassSticky(icon,'editAreaButtonNorma
 l',Ì);Á.smooth_selection=Ì;Á.selection_field.Ç.display=\"none\";_$(\"cursor_pos\").Ç.display=\"none\";_$(\"end_bracket\").Ç.display=\"none\";}\nelse{Á.switchClassSticky(icon,'editAreaButtonSelected',Ì);Á.smooth_selection=Ë;Á.selection_field.Ç.display=\"block\";_$(\"cursor_pos\").Ç.display=\"block\";_$(\"end_bracket\").Ç.display=\"block\";}};EA.Ä.scroll_to_view=Ã(show){var zone,lineElem;if(!Á.smooth_selection)return;zone=_$(\"result\");var cursor_pos_top=_$(\"cursor_pos\").cursor_top;if(show==\"bottom\"){cursor_pos_top+=Á.getLinePosTop(Á.É['line_start']+Á.É['line_nb']-1);}var max_height_visible=zone.clientHeight+zone.scrollTop;var miss_top=cursor_pos_top+Á.lineHeight-max_height_visible;if(miss_top>0){zone.scrollTop=zone.scrollTop+miss_top;}\nelse if(zone.scrollTop > cursor_pos_top){zone.scrollTop=cursor_pos_top;}var cursor_pos_left=_$(\"cursor_pos\").cursor_left;var max_width_visible=zone.clientWidth+zone.scrollLeft;var miss_left=cursor_pos_left+10-max_width_v
 isible;if(miss_left>0){zone.scrollLeft=zone.scrollLeft+miss_left+50;}\nelse if(zone.scrollLeft > cursor_pos_left){zone.scrollLeft=cursor_pos_left;}\nelse if(zone.scrollLeft==45){zone.scrollLeft=0;}};EA.Ä.check_undo=Ã(only_once){if(!eAs[Á.id])return Ì;if(Á.ÂFocused&&eAs[Á.id][\"displayed\"]==Ë){var text=Á.Â.Ê;if(Á.previous.Æ<=1)Á.switchClassSticky(_$(\"undo\"),'editAreaButtonDisabled',Ë);if(!Á.previous[Á.previous.Æ-1]||Á.previous[Á.previous.Æ-1][\"text\"] !=text){Á.previous.push({\"text\":text,\"selStart\":Á.Â.selectionStart,\"selEnd\":Á.Â.selectionEnd});if(Á.previous.Æ > Á.Å[\"max_undo\"]+1)Á.previous.shift();}if(Á.previous.Æ >=2)Á.switchClassSticky(_$(\"undo\"),'editAreaButtonNormal',Ì);}if(!only_once)setTimeout(\"eA.check_undo()\",3000);};EA.Ä.undo=Ã(){if(Á.previous.Æ > 0){Á.getIESelection();Á.next.push({\"text\":Á.Â.Ê,\"selStart\":Á.Â.selectionStart,\"selEnd\":Á.Â.selectionEnd});var prev=Á.previous.pop();if(prev[\"text\"]==Á.Â.Ê
 &&Á.previous.Æ > 0)prev=Á.previous.pop();Á.Â.Ê=prev[\"text\"];Á.last_undo=prev[\"text\"];Á.area_select(prev[\"selStart\"],prev[\"selEnd\"]-prev[\"selStart\"]);Á.switchClassSticky(_$(\"redo\"),'editAreaButtonNormal',Ì);Á.resync_highlight(Ë);Á.check_file_changes();}};EA.Ä.redo=Ã(){if(Á.next.Æ > 0){var next=Á.next.pop();Á.previous.push(next);Á.Â.Ê=next[\"text\"];Á.last_undo=next[\"text\"];Á.area_select(next[\"selStart\"],next[\"selEnd\"]-next[\"selStart\"]);Á.switchClassSticky(_$(\"undo\"),'editAreaButtonNormal',Ì);Á.resync_highlight(Ë);Á.check_file_changes();}if(Á.next.Æ==0)Á.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);};EA.Ä.check_redo=Ã(){if(eA.next.Æ==0||eA.Â.Ê!=eA.last_undo){eA.next=[];eA.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);}\nelse{Á.switchClassSticky(_$(\"redo\"),'editAreaButtonNormal',Ì);}};EA.Ä.switchClass=Ã(element,class_name,lock_state){var lockChanged=Ì;if(typeof(lock_state)!=\"undefined\"&&ele
 ment !=null){element.classLock=lock_state;lockChanged=Ë;}if(element !=null&&(lockChanged||!element.classLock)){element.oldClassName=element.className;element.className=class_name;}};EA.Ä.restoreAndSwitchClass=Ã(element,class_name){if(element !=null&&!element.classLock){Á.restoreClass(element);Á.switchClass(element,class_name);}};EA.Ä.restoreClass=Ã(element){if(element !=null&&element.oldClassName&&!element.classLock){element.className=element.oldClassName;element.oldClassName=null;}};EA.Ä.setClassLock=Ã(element,lock_state){if(element !=null)element.classLock=lock_state;};EA.Ä.switchClassSticky=Ã(element,class_name,lock_state){var lockChanged=Ì;if(typeof(lock_state)!=\"undefined\"&&element !=null){element.classLock=lock_state;lockChanged=Ë;}if(element !=null&&(lockChanged||!element.classLock)){element.className=class_name;element.oldClassName=class_name;}};EA.Ä.scroll_page=Ã(params){var dir=params[\"dir\"],shift_pressed=params[\"shift\"];var lines=Á.Â.Ê.split(\"\\n\
 ");var new_pos=0,Æ=0,char_left=0,line_nb=0,curLine=0;var toScrollAmount=_$(\"result\").clientHeight-30;var nbLineToScroll=0,diff=0;if(dir==\"up\"){nbLineToScroll=Math.ceil(toScrollAmount / Á.lineHeight);for(i=Á.É[\"line_start\"];i-diff > Á.É[\"line_start\"]-nbLineToScroll;i--){if(elem=_$('line_'+i)){diff+=Math.floor((elem.offsetHeight-1)/ Á.lineHeight);}}nbLineToScroll-=diff;if(Á.É[\"selec_direction\"]==\"up\"){for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]-nbLineToScroll,lines.Æ);line_nb++){new_pos+=lines[line_nb].Æ+1;}char_left=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]-1);if(shift_pressed)Æ=Á.É[\"selectionEnd\"]-new_pos-char_left;Á.area_select(new_pos+char_left,Æ);view=\"top\";}\nelse{view=\"bottom\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+Á.É[\"line_nb\"]-1-nbLineToScroll,lines.Æ);line_nb++){new_pos+=lines[line_nb].Æ+1;}char_left=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]-1);if(shift_press
 ed){start=Math.min(Á.É[\"selectionStart\"],new_pos+char_left);Æ=Math.max(new_pos+char_left,Á.É[\"selectionStart\"])-start;if(new_pos+char_left < Á.É[\"selectionStart\"])view=\"top\";}\nelse start=new_pos+char_left;Á.area_select(start,Æ);}}\nelse{var nbLineToScroll=Math.floor(toScrollAmount / Á.lineHeight);for(i=Á.É[\"line_start\"];i+diff < Á.É[\"line_start\"]+nbLineToScroll;i++){if(elem=_$('line_'+i)){diff+=Math.floor((elem.offsetHeight-1)/ Á.lineHeight);}}nbLineToScroll-=diff;if(Á.É[\"selec_direction\"]==\"down\"){view=\"bottom\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+Á.É[\"line_nb\"]-2+nbLineToScroll,lines.Æ);line_nb++){if(line_nb==Á.É[\"line_start\"]-1)char_left=Á.É[\"selectionStart\"]-new_pos;new_pos+=lines[line_nb].Æ+1;}if(shift_pressed){Æ=Math.abs(Á.É[\"selectionStart\"]-new_pos);Æ+=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]);Á.area_select(Math.min(Á.É[\"selectionStart\"],new_pos),Æ);}\nelse{Á.area_selec
 t(new_pos+char_left,0);}}\nelse{view=\"top\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+nbLineToScroll-1,lines.Æ,lines.Æ);line_nb++){if(line_nb==Á.É[\"line_start\"]-1)char_left=Á.É[\"selectionStart\"]-new_pos;new_pos+=lines[line_nb].Æ+1;}if(shift_pressed){Æ=Math.abs(Á.É[\"selectionEnd\"]-new_pos-char_left);Æ+=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"])-char_left-1;Á.area_select(Math.min(Á.É[\"selectionEnd\"],new_pos+char_left),Æ);if(new_pos+char_left > Á.É[\"selectionEnd\"])view=\"bottom\";}\nelse{Á.area_select(new_pos+char_left,0);}}}Á.check_line_selection();Á.scroll_to_view(view);};EA.Ä.start_resize=Ã(e){È.eAL.resize[\"id\"]=eA.id;È.eAL.resize[\"start_x\"]=(e)? e.pageX:event.x+document.body.scrollLeft;È.eAL.resize[\"start_y\"]=(e)? e.pageY:event.y+document.body.scrollTop;if(eA.isIE){eA.Â.focus();eA.getIESelection();}È.eAL.resize[\"selectionStart\"]=eA.Â.selectionStart;È.eAL.resize[\"selectionEnd\"]=eA.Â.selectionEnd
 ;È.eAL.start_resize_area();};EA.Ä.toggle_full_screen=Ã(to){var t=Á,p=È,a=t.Â,html,frame,selStart,selEnd,old,icon;if(typeof(to)==\"undefined\")to=!t.fullscreen['isFull'];old=t.fullscreen['isFull'];t.fullscreen['isFull']=to;icon=_$(\"fullscreen\");selStart=t.Â.selectionStart;selEnd=t.Â.selectionEnd;html=p.document.getElementsByTagName(\"html\")[0];frame=p.document.getElementById(\"frame_\"+t.id);if(to&&to!=old){t.fullscreen['old_overflow']=p.get_css_property(html,\"overflow\");t.fullscreen['old_height']=p.get_css_property(html,\"height\");t.fullscreen['old_width']=p.get_css_property(html,\"width\");t.fullscreen['old_scrollTop']=html.scrollTop;t.fullscreen['old_scrollLeft']=html.scrollLeft;t.fullscreen['old_zIndex']=p.get_css_property(frame,\"z-index\");if(t.isOpera){html.Ç.height=\"100%\";html.Ç.width=\"100%\";}html.Ç.overflow=\"hidden\";html.scrollTop=0;html.scrollLeft=0;frame.Ç.position=\"absolute\";frame.Ç.width=html.clientWidth+\"px\";frame.Ç.height=html.clientHeight
 +\"px\";frame.Ç.display=\"block\";frame.Ç.zIndex=\"999999\";frame.Ç.top=\"0px\";frame.Ç.left=\"0px\";frame.Ç.top=\"-\"+p.calculeOffsetTop(frame)+\"px\";frame.Ç.left=\"-\"+p.calculeOffsetLeft(frame)+\"px\";t.switchClassSticky(icon,'editAreaButtonSelected',Ì);t.fullscreen['allow_resize']=t.resize_allowed;t.allow_resize(Ì);if(t.isFirefox){p.eAL.execCommand(t.id,\"update_size();\");t.area_select(selStart,selEnd-selStart);t.scroll_to_view();t.focus();}\nelse{setTimeout(\"p.eAL.execCommand('\"+t.id+\"','update_size();');eA.focus();\",10);}}\nelse if(to!=old){frame.Ç.position=\"static\";frame.Ç.zIndex=t.fullscreen['old_zIndex'];if(t.isOpera){html.Ç.height=\"auto\";html.Ç.width=\"auto\";html.Ç.overflow=\"auto\";}\nelse if(t.isIE&&p!=top){html.Ç.overflow=\"auto\";}\nelse{html.Ç.overflow=t.fullscreen['old_overflow'];}html.scrollTop=t.fullscreen['old_scrollTop'];html.scrollLeft=t.fullscreen['old_scrollLeft'];p.eAL.hide(t.id);p.eAL.show(t.id);t.switchClassSticky(icon,'editAreaBut
 tonNormal',Ì);if(t.fullscreen['allow_resize'])t.allow_resize(t.fullscreen['allow_resize']);if(t.isFirefox){t.area_select(selStart,selEnd-selStart);setTimeout(\"eA.scroll_to_view();\",10);}}};EA.Ä.allow_resize=Ã(allow){var resize=_$(\"resize_area\");if(allow){resize.Ç.visibility=\"visible\";È.eAL.add_event(resize,\"mouseup\",eA.start_resize);}\nelse{resize.Ç.visibility=\"hidden\";È.eAL.remove_event(resize,\"mouseup\",eA.start_resize);}Á.resize_allowed=allow;};EA.Ä.change_syntax=Ã(new_syntax,is_waiting){if(new_syntax==Á.Å['syntax'])return Ë;var founded=Ì;for(var i=0;i<Á.syntax_list.Æ;i++){if(Á.syntax_list[i]==new_syntax)founded=Ë;}if(founded==Ë){if(!È.eAL.load_syntax[new_syntax]){if(!is_waiting)È.eAL.load_script(È.eAL.baseURL+\"reg_syntax/\"+new_syntax+\".js\");setTimeout(\"eA.change_syntax('\"+new_syntax+\"',Ë);\",100);Á.show_waiting_screen();}\nelse{if(!Á.allready_used_syntax[new_syntax]){È.eAL.init_syntax_regexp();Á.add_Ç(È.eAL.syntax[new_syntax][\"Çs\
 "]);Á.allready_used_syntax[new_syntax]=Ë;}var sel=_$(\"syntax_selection\");if(sel&&sel.Ê!=new_syntax){for(var i=0;i<sel.Æ;i++){if(sel.options[i].Ê&&sel.options[i].Ê==new_syntax)sel.options[i].selected=Ë;}}Á.Å['syntax']=new_syntax;Á.resync_highlight(Ë);Á.hide_waiting_screen();return Ë;}}return Ì;};EA.Ä.set_editable=Ã(is_editable){if(is_editable){document.body.className=\"\";Á.Â.readOnly=Ì;Á.is_editable=Ë;}\nelse{document.body.className=\"non_editable\";Á.Â.readOnly=Ë;Á.is_editable=Ì;}if(eAs[Á.id][\"displayed\"]==Ë)Á.update_size();};EA.Ä.toggle_word_wrap=Ã(){Á.set_word_wrap(!Á.Å['word_wrap']);};EA.Ä.set_word_wrap=Ã(to){var t=Á,a=t.Â;if(t.isOpera){Á.Å['word_wrap']=Ì;t.switchClassSticky(_$(\"word_wrap\"),'editAreaButtonDisabled',Ë);return Ì;}if(to){wrap_mode='soft';Á.container.className+=' word_wrap';Á.container.Ç.width=\"\";Á.content_highlight.Ç.width=\"\";a.Ç.width=\"100%\";if(t.isIE&&t.isIE < 7){a.Ç.width=(a.offsetWidth-5)+\"px\";}t.s
 witchClassSticky(_$(\"word_wrap\"),'editAreaButtonSelected',Ì);}\nelse{wrap_mode='off';Á.container.className=Á.container.className.replace(/word_wrap/g,'');t.switchClassSticky(_$(\"word_wrap\"),'editAreaButtonNormal',Ë);}Á.Â.previous_scrollWidth='';Á.Â.previous_scrollHeight='';a.wrap=wrap_mode;a.setAttribute('wrap',wrap_mode);if(!Á.isIE){var start=a.selectionStart,end=a.selectionEnd;var parNod=a.ÈNode,nxtSib=a.nextSibling;parNod.removeChild(a);parNod.insertBefore(a,nxtSib);Á.area_select(start,end-start);}Á.Å['word_wrap']=to;Á.focus();Á.update_size();Á.check_line_selection();};EA.Ä.open_file=Ã(Å){if(Å['id']!=\"undefined\"){var id=Å['id'];var new_file={};new_file['id']=id;new_file['title']=id;new_file['text']=\"\";new_file['É']=\"\";new_file['last_text_to_highlight']=\"\";new_file['last_hightlighted_text']=\"\";new_file['previous']=[];new_file['next']=[];new_file['last_undo']=\"\";new_file['smooth_selection']=Á.Å['smooth_selection'];new_file['do_highlight']=Á.
 Å['start_highlight'];new_file['syntax']=Á.Å['syntax'];new_file['scroll_top']=0;new_file['scroll_left']=0;new_file['selection_start']=0;new_file['selection_end']=0;new_file['edited']=Ì;new_file['font_size']=Á.Å[\"font_size\"];new_file['font_family']=Á.Å[\"font_family\"];new_file['word_wrap']=Á.Å[\"word_wrap\"];new_file['toolbar']={'links':{},'selects':{}};new_file['compare_edited_text']=new_file['text'];Á.files[id]=new_file;Á.update_file(id,Å);Á.files[id]['compare_edited_text']=Á.files[id]['text'];var html_id='tab_file_'+encodeURIComponent(id);Á.filesIdAssoc[html_id]=id;Á.files[id]['html_id']=html_id;if(!_$(Á.files[id]['html_id'])&&id!=\"\"){Á.tab_browsing_area.Ç.display=\"block\";var elem=document.createElement('li');elem.id=Á.files[id]['html_id'];var close=\"<img src=\\\"\"+È.eAL.baseURL+\"images/close.gif\\\" title=\\\"\"+Á.get_translation('close_tab','word')+\"\\\" onclick=\\\"eA.execCommand('close_file',eA.filesIdAssoc['\"+html_id+\"']);return Ì;\\\" clas
 s=\\\"hidden\\\" onmouseover=\\\"Á.className=''\\\" onmouseout=\\\"Á.className='hidden'\\\" />\";elem.innerHTML=\"<a onclick=\\\"javascript:eA.execCommand('switch_to_file',eA.filesIdAssoc['\"+html_id+\"']);\\\" selec=\\\"none\\\"><b><span><strong class=\\\"edited\\\">*</strong>\"+Á.files[id]['title']+close+\"</span></b></a>\";_$('tab_browsing_list').appendChild(elem);var elem=document.createElement('text');Á.update_size();}if(id!=\"\")Á.execCommand('file_open',Á.files[id]);Á.switch_to_file(id,Ë);return Ë;}\nelse return Ì;};EA.Ä.close_file=Ã(id){if(Á.files[id]){Á.save_file(id);if(Á.execCommand('file_close',Á.files[id])!==Ì){var li=_$(Á.files[id]['html_id']);li.ÈNode.removeChild(li);if(id==Á.curr_file){var next_file=\"\";var is_next=Ì;for(var i in Á.files){if(is_next){next_file=i;break;}\nelse if(i==id)is_next=Ë;\nelse next_file=i;}Á.switch_to_file(next_file);}delete(Á.files[id]);Á.update_size();}}};EA.Ä.save_file=Ã(id){var t=Á,save,a_links,a_selects,save_
 butt,img,i;if(t.files[id]){var save=t.files[id];save['É']=t.É;save['last_text_to_highlight']=t.last_text_to_highlight;save['last_hightlighted_text']=t.last_hightlighted_text;save['previous']=t.previous;save['next']=t.next;save['last_undo']=t.last_undo;save['smooth_selection']=t.smooth_selection;save['do_highlight']=t.do_highlight;save['syntax']=t.Å['syntax'];save['text']=t.Â.Ê;save['scroll_top']=t.result.scrollTop;save['scroll_left']=t.result.scrollLeft;save['selection_start']=t.É[\"selectionStart\"];save['selection_end']=t.É[\"selectionEnd\"];save['font_size']=t.Å[\"font_size\"];save['font_family']=t.Å[\"font_family\"];save['word_wrap']=t.Å[\"word_wrap\"];save['toolbar']={'links':{},'selects':{}};a_links=_$(\"toolbar_1\").getElementsByTagName(\"a\");for(i=0;i<a_links.Æ;i++){if(a_links[i].getAttribute('fileSpecific')=='yes'){save_butt={};img=a_links[i].getElementsByTagName('img')[0];save_butt['classLock']=img.classLock;save_butt['className']=img.className;save_butt['oldCl
 assName']=img.oldClassName;save['toolbar']['links'][a_links[i].id]=save_butt;}}a_selects=_$(\"toolbar_1\").getElementsByTagName(\"select\");for(i=0;i<a_selects.Æ;i++){if(a_selects[i].getAttribute('fileSpecific')=='yes'){save['toolbar']['selects'][a_selects[i].id]=a_selects[i].Ê;}}t.files[id]=save;return save;}return Ì;};EA.Ä.update_file=Ã(id,new_Ês){for(var i in new_Ês){Á.files[id][i]=new_Ês[i];}};EA.Ä.display_file=Ã(id){var t=Á,a=t.Â,new_file,a_lis,a_selects,a_links,a_options,i,j;if(id==''){a.readOnly=Ë;t.tab_browsing_area.Ç.display=\"none\";_$(\"no_file_selected\").Ç.display=\"block\";t.result.className=\"empty\";if(!t.files['']){t.open_file({id:''});}}\nelse if(typeof(t.files[id])=='undefined'){return Ì;}\nelse{t.result.className=\"\";a.readOnly=!t.is_editable;_$(\"no_file_selected\").Ç.display=\"none\";t.tab_browsing_area.Ç.display=\"block\";}t.check_redo(Ë);t.check_undo(Ë);t.curr_file=id;a_lis=t.tab_browsing_area.getElementsByTagName('li');for(i=0;i<a_lis.�
 �;i++){if(a_lis[i].id==t.files[id]['html_id'])a_lis[i].className='selected';\nelse a_lis[i].className='';}new_file=t.files[id];a.Ê=new_file['text'];t.set_font(new_file['font_family'],new_file['font_size']);t.area_select(new_file['É']['selection_start'],new_file['É']['selection_end']-new_file['É']['selection_start']);t.manage_size(Ë);t.result.scrollTop=new_file['scroll_top'];t.result.scrollLeft=new_file['scroll_left'];t.previous=new_file['previous'];t.next=new_file['next'];t.last_undo=new_file['last_undo'];t.check_redo(Ë);t.check_undo(Ë);t.execCommand(\"change_highlight\",new_file['do_highlight']);t.execCommand(\"change_syntax\",new_file['syntax']);t.execCommand(\"change_smooth_selection_mode\",new_file['smooth_selection']);t.execCommand(\"set_word_wrap\",new_file['word_wrap']);a_links=new_file['toolbar']['links'];for(i in a_links){if(img=_$(i).getElementsByTagName('img')[0]){img.classLock=a_links[i]['classLock'];img.className=a_links[i]['className'];img.oldClassName=a_links[i
 ]['oldClassName'];}}a_selects=new_file['toolbar']['selects'];for(i in a_selects){a_options=_$(i).options;for(j=0;j<a_options.Æ;j++){if(a_options[j].Ê==a_selects[i])_$(i).options[j].selected=Ë;}}};EA.Ä.switch_to_file=Ã(file_to_show,force_refresh){if(file_to_show!=Á.curr_file||force_refresh){Á.save_file(Á.curr_file);if(Á.curr_file!='')Á.execCommand('file_switch_off',Á.files[Á.curr_file]);Á.display_file(file_to_show);if(file_to_show!='')Á.execCommand('file_switch_on',Á.files[file_to_show]);}};EA.Ä.get_file=Ã(id){if(id==Á.curr_file)Á.save_file(id);return Á.files[id];};EA.Ä.get_all_files=Ã(){tmp_files=Á.files;Á.save_file(Á.curr_file);if(tmp_files[''])delete(Á.files['']);return tmp_files;};EA.Ä.check_file_changes=Ã(){var id=Á.curr_file;if(Á.files[id]&&Á.files[id]['compare_edited_text']!=undefined){if(Á.files[id]['compare_edited_text'].Æ==Á.Â.Ê.Æ&&Á.files[id]['compare_edited_text']==Á.Â.Ê){if(Á.files[id]['edited']!=Ì)Á.set_file_edited_mode(id,Ì)
 ;}\nelse{if(Á.files[id]['edited']!=Ë)Á.set_file_edited_mode(id,Ë);}}};EA.Ä.set_file_edited_mode=Ã(id,to){if(Á.files[id]&&_$(Á.files[id]['html_id'])){var link=_$(Á.files[id]['html_id']).getElementsByTagName('a')[0];if(to==Ë){link.className='edited';}\nelse{link.className='';if(id==Á.curr_file)text=Á.Â.Ê;\nelse text=Á.files[id]['text'];Á.files[id]['compare_edited_text']=text;}Á.files[id]['edited']=to;}};EA.Ä.set_show_line_colors=Ã(new_Ê){Á.show_line_colors=new_Ê;if(new_Ê)Á.selection_field.className+=' show_colors';\nelse Á.selection_field.className=Á.selection_field.className.replace(/ show_colors/g,'');};var EA_keys={8:\"Retour arriere\",9:\"Tabulation\",12:\"Milieu(pave numerique)\",13:\"Entrer\",16:\"Shift\",17:\"Ctrl\",18:\"Alt\",19:\"Pause\",20:\"Verr Maj\",27:\"Esc\",32:\"Space\",33:\"Page up\",34:\"Page down\",35:\"End\",36:\"Begin\",37:\"Left\",38:\"Up\",39:\"Right\",40:\"Down\",44:\"Impr ecran\",45:\"Inser\",46:\"Suppr\",91:\"Menu Demarrer Windows / 
 touche pomme Mac\",92:\"Menu Demarrer Windows\",93:\"Menu contextuel Windows\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"Verr Num\",145:\"Arret defil\"};Ã keyDown(e){if(!e){e=event;}for(var i in eA.plugins){if(typeof(eA.plugins[i].onkeydown)==\"Ã\"){if(eA.plugins[i].onkeydown(e)===Ì){if(eA.isIE)e.keyCode=0;return Ì;}}}var target_id=(e.target||e.srcElement).id;var use=Ì;if(EA_keys[e.keyCode])letter=EA_keys[e.keyCode];\nelse letter=String.fromCharCode(e.keyCode);var low_letter=letter.toLowerCase();if(letter==\"Page up\"&&!eA.isOpera){eA.execCommand(\"scroll_page\",{\"dir\":\"up\",\"shift\":ShiftPressed(e)});use=Ë;}\nelse if(letter==\"Page down\"&&!eA.isOpera){eA.execCommand(\"scroll_page\",{\"dir\":\"down\",\"shift\":ShiftPressed(e)});use=Ë;}\nelse if(eA.is_editable==Ì){return Ë;}\nelse if(letter==\"Tabulation\"&&target_id==\"Â\"&&!CtrlPressed(e)&&!AltPressed(e)){if(ShiftPresse
 d(e))eA.execCommand(\"invert_tab_selection\");\nelse eA.execCommand(\"tab_selection\");use=Ë;if(eA.isOpera||(eA.isFirefox&&eA.isMac))setTimeout(\"eA.execCommand('focus');\",1);}\nelse if(letter==\"Entrer\"&&target_id==\"Â\"){if(eA.press_enter())use=Ë;}\nelse if(letter==\"Entrer\"&&target_id==\"area_search\"){eA.execCommand(\"area_search\");use=Ë;}\nelse  if(letter==\"Esc\"){eA.execCommand(\"close_all_inline_popup\",e);use=Ë;}\nelse if(CtrlPressed(e)&&!AltPressed(e)&&!ShiftPressed(e)){switch(low_letter){case \"f\":eA.execCommand(\"area_search\");use=Ë;break;case \"r\":eA.execCommand(\"area_replace\");use=Ë;break;case \"q\":eA.execCommand(\"close_all_inline_popup\",e);use=Ë;break;case \"h\":eA.execCommand(\"change_highlight\");use=Ë;break;case \"g\":setTimeout(\"eA.execCommand('go_to_line');\",5);use=Ë;break;case \"e\":eA.execCommand(\"show_help\");use=Ë;break;case \"z\":use=Ë;eA.execCommand(\"undo\");break;case \"y\":use=Ë;eA.execCommand(\"redo\");break;default:break;}}i
 f(eA.next.Æ > 0){setTimeout(\"eA.check_redo();\",10);}setTimeout(\"eA.check_file_changes();\",10);if(use){if(eA.isIE)e.keyCode=0;return Ì;}return Ë;};Ã AltPressed(e){if(window.event){return(window.event.altKey);}\nelse{if(e.modifiers)return(e.altKey||(e.modifiers % 2));\nelse return e.altKey;}};Ã CtrlPressed(e){if(window.event){return(window.event.ctrlKey);}\nelse{return(e.ctrlKey||(e.modifiers==2)||(e.modifiers==3)||(e.modifiers>5));}};Ã ShiftPressed(e){if(window.event){return(window.event.shiftKey);}\nelse{return(e.shiftKey||(e.modifiers>3));}};	EA.Ä.show_search=Ã(){if(_$(\"area_search_replace\").Ç.visibility==\"visible\"){Á.hidden_search();}\nelse{Á.open_inline_popup(\"area_search_replace\");var text=Á.area_get_selection();var search=text.split(\"\\n\")[0];_$(\"area_search\").Ê=search;_$(\"area_search\").focus();}};EA.Ä.hidden_search=Ã(){Á.close_inline_popup(\"area_search_replace\");};EA.Ä.area_search=Ã(mode){if(!mode)mode=\"search\";_$(\"area_search_msg\").inne
 rHTML=\"\";var search=_$(\"area_search\").Ê;Á.Â.focus();Á.Â.ÂFocused=Ë;var infos=Á.get_selection_infos();var start=infos[\"selectionStart\"];var pos=-1;var pos_begin=-1;var Æ=search.Æ;if(_$(\"area_search_replace\").Ç.visibility!=\"visible\"){Á.show_search();return;}if(search.Æ==0){_$(\"area_search_msg\").innerHTML=Á.get_translation(\"search_field_empty\");return;}if(mode!=\"replace\"){if(_$(\"area_search_reg_exp\").checked)start++;\nelse start+=search.Æ;}if(_$(\"area_search_reg_exp\").checked){var opt=\"m\";if(!_$(\"area_search_match_case\").checked)opt+=\"i\";var reg=new RegExp(search,opt);pos=infos[\"full_text\"].substr(start).search(reg);pos_begin=infos[\"full_te

<TRUNCATED>

[22/22] git commit: refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/f6330834
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/f6330834
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/f6330834

Branch: refs/heads/master
Commit: f6330834284d8a0aebb811239c0916582abf37a7
Parents: fcb90b1
Author: Lahiru Sandaruwan <la...@wso2.com>
Authored: Thu Jul 11 17:30:26 2013 +0530
Committer: Lahiru Sandaruwan <la...@wso2.com>
Committed: Thu Jul 11 17:30:26 2013 +0530

----------------------------------------------------------------------
 .../org.apache.stratos.theme.mgt.ui/pom.xml     |  153 +++
 .../mgt/ui/clients/ThemeMgtServiceClient.java   |  424 ++++++
 .../processors/AddThemeResourceProcessor.java   |  239 ++++
 .../mgt/ui/servlets/ThemeResourceSevelet.java   |  124 ++
 .../stratos/theme/mgt/ui/utils/ThemeUtil.java   |   67 +
 .../mgt/ui/clients/ThemeMgtServiceClient.java   |  424 ++++++
 .../processors/AddThemeResourceProcessor.java   |  240 ++++
 .../mgt/ui/servlets/ThemeResourceSevelet.java   |  124 ++
 .../carbon/theme/mgt/ui/utils/ThemeUtil.java    |   67 +
 .../src/main/resources/META-INF/component.xml   |   68 +
 .../theme/mgt/ui/i18n/JSResources.properties    |    2 +
 .../theme/mgt/ui/i18n/Resources.properties      |   51 +
 .../theme/mgt/ui/i18n/JSResources.properties    |    2 +
 .../theme/mgt/ui/i18n/Resources.properties      |   51 +
 .../add_collection_ajaxprocessor.jsp            |   50 +
 .../add_text_resource_ajaxprocessor.jsp         |   59 +
 .../web/tenant-theme/content_ajaxprocessor.jsp  |  242 ++++
 .../resources/web/tenant-theme/css-editor.jsp   |   59 +
 .../web/tenant-theme/css/loginpage.css          |  110 ++
 .../resources/web/tenant-theme/css/tenant.css   |   74 ++
 .../web/tenant-theme/css/tenent-theme.css       |   32 +
 .../web/tenant-theme/css/theme-mgt.css          |   16 +
 .../web/tenant-theme/delete_ajaxprocessor.jsp   |   48 +
 .../display_text_content_ajaxprocessor.jsp      |   48 +
 .../tenant-theme/docs/images/change-logo.png    |  Bin 0 -> 14821 bytes
 .../web/tenant-theme/docs/images/edit-theme.png |  Bin 0 -> 83056 bytes
 .../tenant-theme/docs/images/select-theme.png   |  Bin 0 -> 61602 bytes
 .../web/tenant-theme/docs/userguide.html        |   78 ++
 .../edit_text_content_ajaxprocessor.jsp         |   97 ++
 .../web/tenant-theme/images/ajax-loader.gif     |  Bin 0 -> 673 bytes
 .../web/tenant-theme/images/button-back.gif     |  Bin 0 -> 819 bytes
 .../tenant-theme/images/content-back-left.jpg   |  Bin 0 -> 2240 bytes
 .../web/tenant-theme/images/content-back.jpg    |  Bin 0 -> 852 bytes
 .../tenant-theme/images/create-org-button.gif   |  Bin 0 -> 2576 bytes
 .../web/tenant-theme/images/footer.jpg          |  Bin 0 -> 836 bytes
 .../resources/web/tenant-theme/images/forum.gif |  Bin 0 -> 1977 bytes
 .../web/tenant-theme/images/header.jpg          |  Bin 0 -> 5837 bytes
 .../resources/web/tenant-theme/images/help.gif  |  Bin 0 -> 1229 bytes
 .../web/tenant-theme/images/images.gif          |  Bin 0 -> 1067 bytes
 .../web/tenant-theme/images/issue-tracker.gif   |  Bin 0 -> 1821 bytes
 .../resources/web/tenant-theme/images/logo.jpg  |  Bin 0 -> 7171 bytes
 .../web/tenant-theme/images/logomgt.gif         |  Bin 0 -> 596 bytes
 .../web/tenant-theme/images/mailing-list.gif    |  Bin 0 -> 2064 bytes
 .../web/tenant-theme/images/page-back.jpg       |  Bin 0 -> 871 bytes
 .../web/tenant-theme/images/people.gif          |  Bin 0 -> 22151 bytes
 .../web/tenant-theme/images/sel-02.jpg          |  Bin 0 -> 809 bytes
 .../web/tenant-theme/images/services.gif        |  Bin 0 -> 604 bytes
 .../web/tenant-theme/images/thememgt.gif        |  Bin 0 -> 1030 bytes
 .../web/tenant-theme/images/user-guide.gif      |  Bin 0 -> 2161 bytes
 .../import_resource_ajaxprocessor.jsp           |  101 ++
 .../web/tenant-theme/js/editarea/change_log.txt |  281 ++++
 .../js/editarea/edit_area/autocompletion.js     |  491 +++++++
 .../js/editarea/edit_area/edit_area.css         |  530 ++++++++
 .../js/editarea/edit_area/edit_area.js          |  525 ++++++++
 .../js/editarea/edit_area/edit_area_full.js     |   38 +
 .../editarea/edit_area/edit_area_functions.js   | 1203 ++++++++++++++++++
 .../js/editarea/edit_area/edit_area_loader.js   | 1080 ++++++++++++++++
 .../js/editarea/edit_area/elements_functions.js |  333 +++++
 .../js/editarea/edit_area/highlight.js          |  391 ++++++
 .../edit_area/images/autocompletion.gif         |  Bin 0 -> 359 bytes
 .../js/editarea/edit_area/images/close.gif      |  Bin 0 -> 102 bytes
 .../js/editarea/edit_area/images/fullscreen.gif |  Bin 0 -> 198 bytes
 .../js/editarea/edit_area/images/go_to_line.gif |  Bin 0 -> 1053 bytes
 .../js/editarea/edit_area/images/help.gif       |  Bin 0 -> 295 bytes
 .../js/editarea/edit_area/images/highlight.gif  |  Bin 0 -> 256 bytes
 .../js/editarea/edit_area/images/load.gif       |  Bin 0 -> 1041 bytes
 .../js/editarea/edit_area/images/move.gif       |  Bin 0 -> 257 bytes
 .../editarea/edit_area/images/newdocument.gif   |  Bin 0 -> 170 bytes
 .../js/editarea/edit_area/images/opacity.png    |  Bin 0 -> 147 bytes
 .../js/editarea/edit_area/images/processing.gif |  Bin 0 -> 825 bytes
 .../js/editarea/edit_area/images/redo.gif       |  Bin 0 -> 169 bytes
 .../edit_area/images/reset_highlight.gif        |  Bin 0 -> 168 bytes
 .../js/editarea/edit_area/images/save.gif       |  Bin 0 -> 285 bytes
 .../js/editarea/edit_area/images/search.gif     |  Bin 0 -> 191 bytes
 .../edit_area/images/smooth_selection.gif       |  Bin 0 -> 174 bytes
 .../js/editarea/edit_area/images/spacer.gif     |  Bin 0 -> 43 bytes
 .../edit_area/images/statusbar_resize.gif       |  Bin 0 -> 79 bytes
 .../js/editarea/edit_area/images/undo.gif       |  Bin 0 -> 175 bytes
 .../js/editarea/edit_area/images/word_wrap.gif  |  Bin 0 -> 951 bytes
 .../js/editarea/edit_area/keyboard.js           |  145 +++
 .../js/editarea/edit_area/langs/en.js           |   67 +
 .../js/editarea/edit_area/license_apache.txt    |    7 +
 .../js/editarea/edit_area/license_bsd.txt       |   10 +
 .../js/editarea/edit_area/license_lgpl.txt      |  458 +++++++
 .../js/editarea/edit_area/manage_area.js        |  623 +++++++++
 .../js/editarea/edit_area/reg_syntax.js         |  166 +++
 .../js/editarea/edit_area/reg_syntax/basic.js   |   69 +
 .../editarea/edit_area/reg_syntax/brainfuck.js  |   44 +
 .../js/editarea/edit_area/reg_syntax/c.js       |   62 +
 .../editarea/edit_area/reg_syntax/coldfusion.js |  119 ++
 .../js/editarea/edit_area/reg_syntax/cpp.js     |   65 +
 .../js/editarea/edit_area/reg_syntax/css.js     |   84 ++
 .../js/editarea/edit_area/reg_syntax/html.js    |   50 +
 .../js/editarea/edit_area/reg_syntax/java.js    |   56 +
 .../js/editarea/edit_area/reg_syntax/js.js      |   93 ++
 .../js/editarea/edit_area/reg_syntax/pas.js     |   82 ++
 .../js/editarea/edit_area/reg_syntax/perl.js    |   88 ++
 .../js/editarea/edit_area/reg_syntax/php.js     |  156 +++
 .../js/editarea/edit_area/reg_syntax/python.js  |  144 +++
 .../editarea/edit_area/reg_syntax/robotstxt.js  |   24 +
 .../js/editarea/edit_area/reg_syntax/ruby.js    |   67 +
 .../js/editarea/edit_area/reg_syntax/sql.js     |   55 +
 .../js/editarea/edit_area/reg_syntax/tsql.js    |   87 ++
 .../js/editarea/edit_area/reg_syntax/vb.js      |   52 +
 .../js/editarea/edit_area/reg_syntax/xml.js     |   56 +
 .../js/editarea/edit_area/regexp.js             |  139 ++
 .../js/editarea/edit_area/resize_area.js        |   73 ++
 .../js/editarea/edit_area/search_replace.js     |  174 +++
 .../js/editarea/edit_area/template.html         |  117 ++
 .../tenant-theme/js/editarea/license_apache.txt |    7 +
 .../tenant-theme/js/editarea/license_bsd.txt    |   10 +
 .../tenant-theme/js/editarea/license_lgpl.txt   |  458 +++++++
 .../web/tenant-theme/js/editarea/todo.txt       |   71 ++
 .../web/tenant-theme/js/theme_resource_util.js  |  828 ++++++++++++
 .../resources/web/tenant-theme/logo_mgt.jsp     |  221 ++++
 .../web/tenant-theme/metadata_resourcepath.jsp  |  107 ++
 .../web/tenant-theme/raw-collection-content.jsp |  756 +++++++++++
 .../rename_resource_ajaxprocessor.jsp           |   42 +
 .../web/tenant-theme/theme_advanced.jsp         |  140 ++
 .../resources/web/tenant-theme/theme_mgt.jsp    |  240 ++++
 .../tenant-theme/theme_mgt_ajaxprocessor.jsp    |   49 +
 .../web/tenant-theme/update_text_content.jsp    |   52 +
 components/org.apache.stratos.theme.mgt/pom.xml |  106 ++
 .../TenantThemeMgtServiceComponent.java         |   99 ++
 .../theme/mgt/services/ThemeMgtService.java     |  195 +++
 .../theme/mgt/util/ThemeLoadingListener.java    |   73 ++
 .../stratos/theme/mgt/util/ThemeUtil.java       |  302 +++++
 .../TenantThemeMgtServiceComponent.java         |   99 ++
 .../theme/mgt/services/ThemeMgtService.java     |  195 +++
 .../theme/mgt/util/ThemeLoadingListener.java    |   73 ++
 .../wso2/carbon/theme/mgt/util/ThemeUtil.java   |  302 +++++
 .../src/main/resources/META-INF/component.xml   |   29 +
 .../src/main/resources/META-INF/services.xml    |  103 ++
 .../org.wso2.carbon.theme.mgt.ui/2.1.0/pom.xml  |  148 ---
 .../mgt/ui/clients/ThemeMgtServiceClient.java   |  424 ------
 .../processors/AddThemeResourceProcessor.java   |  240 ----
 .../mgt/ui/servlets/ThemeResourceSevelet.java   |  124 --
 .../carbon/theme/mgt/ui/utils/ThemeUtil.java    |   67 -
 .../src/main/resources/META-INF/component.xml   |   68 -
 .../theme/mgt/ui/i18n/JSResources.properties    |    2 -
 .../theme/mgt/ui/i18n/Resources.properties      |   51 -
 .../add_collection_ajaxprocessor.jsp            |   49 -
 .../add_text_resource_ajaxprocessor.jsp         |   57 -
 .../web/tenant-theme/content_ajaxprocessor.jsp  |  241 ----
 .../resources/web/tenant-theme/css-editor.jsp   |   58 -
 .../web/tenant-theme/css/loginpage.css          |  110 --
 .../resources/web/tenant-theme/css/tenant.css   |   74 --
 .../web/tenant-theme/css/tenent-theme.css       |   32 -
 .../web/tenant-theme/css/theme-mgt.css          |   16 -
 .../web/tenant-theme/delete_ajaxprocessor.jsp   |   47 -
 .../display_text_content_ajaxprocessor.jsp      |   47 -
 .../tenant-theme/docs/images/change-logo.png    |  Bin 14821 -> 0 bytes
 .../web/tenant-theme/docs/images/edit-theme.png |  Bin 83056 -> 0 bytes
 .../tenant-theme/docs/images/select-theme.png   |  Bin 61602 -> 0 bytes
 .../web/tenant-theme/docs/userguide.html        |   77 --
 .../edit_text_content_ajaxprocessor.jsp         |   96 --
 .../web/tenant-theme/images/ajax-loader.gif     |  Bin 673 -> 0 bytes
 .../web/tenant-theme/images/button-back.gif     |  Bin 819 -> 0 bytes
 .../tenant-theme/images/content-back-left.jpg   |  Bin 2240 -> 0 bytes
 .../web/tenant-theme/images/content-back.jpg    |  Bin 852 -> 0 bytes
 .../tenant-theme/images/create-org-button.gif   |  Bin 2576 -> 0 bytes
 .../web/tenant-theme/images/footer.jpg          |  Bin 836 -> 0 bytes
 .../resources/web/tenant-theme/images/forum.gif |  Bin 1977 -> 0 bytes
 .../web/tenant-theme/images/header.jpg          |  Bin 5837 -> 0 bytes
 .../resources/web/tenant-theme/images/help.gif  |  Bin 1229 -> 0 bytes
 .../web/tenant-theme/images/images.gif          |  Bin 1067 -> 0 bytes
 .../web/tenant-theme/images/issue-tracker.gif   |  Bin 1821 -> 0 bytes
 .../resources/web/tenant-theme/images/logo.jpg  |  Bin 7171 -> 0 bytes
 .../web/tenant-theme/images/logomgt.gif         |  Bin 596 -> 0 bytes
 .../web/tenant-theme/images/mailing-list.gif    |  Bin 2064 -> 0 bytes
 .../web/tenant-theme/images/page-back.jpg       |  Bin 871 -> 0 bytes
 .../web/tenant-theme/images/people.gif          |  Bin 22151 -> 0 bytes
 .../web/tenant-theme/images/sel-02.jpg          |  Bin 809 -> 0 bytes
 .../web/tenant-theme/images/services.gif        |  Bin 604 -> 0 bytes
 .../web/tenant-theme/images/thememgt.gif        |  Bin 1030 -> 0 bytes
 .../web/tenant-theme/images/user-guide.gif      |  Bin 2161 -> 0 bytes
 .../import_resource_ajaxprocessor.jsp           |  100 --
 .../web/tenant-theme/js/editarea/change_log.txt |  281 ----
 .../js/editarea/edit_area/autocompletion.js     |  491 -------
 .../js/editarea/edit_area/edit_area.css         |  530 --------
 .../js/editarea/edit_area/edit_area.js          |  525 --------
 .../js/editarea/edit_area/edit_area_full.js     |   38 -
 .../editarea/edit_area/edit_area_functions.js   | 1203 ------------------
 .../js/editarea/edit_area/edit_area_loader.js   | 1080 ----------------
 .../js/editarea/edit_area/elements_functions.js |  333 -----
 .../js/editarea/edit_area/highlight.js          |  391 ------
 .../edit_area/images/autocompletion.gif         |  Bin 359 -> 0 bytes
 .../js/editarea/edit_area/images/close.gif      |  Bin 102 -> 0 bytes
 .../js/editarea/edit_area/images/fullscreen.gif |  Bin 198 -> 0 bytes
 .../js/editarea/edit_area/images/go_to_line.gif |  Bin 1053 -> 0 bytes
 .../js/editarea/edit_area/images/help.gif       |  Bin 295 -> 0 bytes
 .../js/editarea/edit_area/images/highlight.gif  |  Bin 256 -> 0 bytes
 .../js/editarea/edit_area/images/load.gif       |  Bin 1041 -> 0 bytes
 .../js/editarea/edit_area/images/move.gif       |  Bin 257 -> 0 bytes
 .../editarea/edit_area/images/newdocument.gif   |  Bin 170 -> 0 bytes
 .../js/editarea/edit_area/images/opacity.png    |  Bin 147 -> 0 bytes
 .../js/editarea/edit_area/images/processing.gif |  Bin 825 -> 0 bytes
 .../js/editarea/edit_area/images/redo.gif       |  Bin 169 -> 0 bytes
 .../edit_area/images/reset_highlight.gif        |  Bin 168 -> 0 bytes
 .../js/editarea/edit_area/images/save.gif       |  Bin 285 -> 0 bytes
 .../js/editarea/edit_area/images/search.gif     |  Bin 191 -> 0 bytes
 .../edit_area/images/smooth_selection.gif       |  Bin 174 -> 0 bytes
 .../js/editarea/edit_area/images/spacer.gif     |  Bin 43 -> 0 bytes
 .../edit_area/images/statusbar_resize.gif       |  Bin 79 -> 0 bytes
 .../js/editarea/edit_area/images/undo.gif       |  Bin 175 -> 0 bytes
 .../js/editarea/edit_area/images/word_wrap.gif  |  Bin 951 -> 0 bytes
 .../js/editarea/edit_area/keyboard.js           |  145 ---
 .../js/editarea/edit_area/langs/en.js           |   67 -
 .../js/editarea/edit_area/license_apache.txt    |    7 -
 .../js/editarea/edit_area/license_bsd.txt       |   10 -
 .../js/editarea/edit_area/license_lgpl.txt      |  458 -------
 .../js/editarea/edit_area/manage_area.js        |  623 ---------
 .../js/editarea/edit_area/reg_syntax.js         |  166 ---
 .../js/editarea/edit_area/reg_syntax/basic.js   |   69 -
 .../editarea/edit_area/reg_syntax/brainfuck.js  |   44 -
 .../js/editarea/edit_area/reg_syntax/c.js       |   62 -
 .../editarea/edit_area/reg_syntax/coldfusion.js |  119 --
 .../js/editarea/edit_area/reg_syntax/cpp.js     |   65 -
 .../js/editarea/edit_area/reg_syntax/css.js     |   84 --
 .../js/editarea/edit_area/reg_syntax/html.js    |   50 -
 .../js/editarea/edit_area/reg_syntax/java.js    |   56 -
 .../js/editarea/edit_area/reg_syntax/js.js      |   93 --
 .../js/editarea/edit_area/reg_syntax/pas.js     |   82 --
 .../js/editarea/edit_area/reg_syntax/perl.js    |   88 --
 .../js/editarea/edit_area/reg_syntax/php.js     |  156 ---
 .../js/editarea/edit_area/reg_syntax/python.js  |  144 ---
 .../editarea/edit_area/reg_syntax/robotstxt.js  |   24 -
 .../js/editarea/edit_area/reg_syntax/ruby.js    |   67 -
 .../js/editarea/edit_area/reg_syntax/sql.js     |   55 -
 .../js/editarea/edit_area/reg_syntax/tsql.js    |   87 --
 .../js/editarea/edit_area/reg_syntax/vb.js      |   52 -
 .../js/editarea/edit_area/reg_syntax/xml.js     |   56 -
 .../js/editarea/edit_area/regexp.js             |  139 --
 .../js/editarea/edit_area/resize_area.js        |   73 --
 .../js/editarea/edit_area/search_replace.js     |  174 ---
 .../js/editarea/edit_area/template.html         |  117 --
 .../tenant-theme/js/editarea/license_apache.txt |    7 -
 .../tenant-theme/js/editarea/license_bsd.txt    |   10 -
 .../tenant-theme/js/editarea/license_lgpl.txt   |  458 -------
 .../web/tenant-theme/js/editarea/todo.txt       |   71 --
 .../web/tenant-theme/js/theme_resource_util.js  |  828 ------------
 .../resources/web/tenant-theme/logo_mgt.jsp     |  220 ----
 .../web/tenant-theme/metadata_resourcepath.jsp  |  106 --
 .../web/tenant-theme/raw-collection-content.jsp |  755 -----------
 .../rename_resource_ajaxprocessor.jsp           |   41 -
 .../web/tenant-theme/theme_advanced.jsp         |  139 --
 .../resources/web/tenant-theme/theme_mgt.jsp    |  239 ----
 .../tenant-theme/theme_mgt_ajaxprocessor.jsp    |   48 -
 .../web/tenant-theme/update_text_content.jsp    |   51 -
 .../org.wso2.carbon.theme.mgt/2.1.0/pom.xml     |  102 --
 .../TenantThemeMgtServiceComponent.java         |   99 --
 .../theme/mgt/services/ThemeMgtService.java     |  195 ---
 .../theme/mgt/util/ThemeLoadingListener.java    |   73 --
 .../wso2/carbon/theme/mgt/util/ThemeUtil.java   |  302 -----
 .../src/main/resources/META-INF/component.xml   |   29 -
 .../src/main/resources/META-INF/services.xml    |  103 --
 components/stratos/theme-mgt/pom.xml            |   41 -
 .../org.apache.stratos.theme.mgt.stub/pom.xml   |  125 ++
 .../src/main/resources/ThemeMgtService.wsdl     | 1146 +++++++++++++++++
 .../4.1.0/pom.xml                               |  121 --
 .../src/main/resources/ThemeMgtService.wsdl     | 1157 -----------------
 service-stubs/pom.xml                           |    2 +-
 262 files changed, 17183 insertions(+), 15628 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/pom.xml b/components/org.apache.stratos.theme.mgt.ui/pom.xml
new file mode 100644
index 0000000..cf7f546
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/pom.xml
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     ~  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.
+     ~
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-components-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+	    <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.apache.stratos.theme.mgt.ui</artifactId>
+    <version>3.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Apache Stratos - Theme Configuration User Interface</name>
+
+    <build>
+
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Bundle-Name>${project.artifactId}</Bundle-Name>
+                        <Export-Package>
+                            org.apache.stratos.theme.mgt.ui.*,
+                            org.apache.stratos.theme.mgt.ui.processors.*,
+                        </Export-Package>
+                        <Import-Package>
+                            org.wso2.carbon.registry.resource.ui.*,
+                            org.apache.stratos.theme.mgt.ui.servlets.*,
+                            javax.servlet;version="${imp.pkg.version.javax.servlet}",
+                            javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
+                            org.apache.lucene.*,
+                            org.apache.batik.*,
+                            org.apache.stratos.theme.mgt.stub.*; version="${carbon.platform.package.import.version.range}",
+                            *;resolution:=optional
+                        </Import-Package>
+                        <Carbon-Component>UIBundle</Carbon-Component>
+                    </instructions>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.apache.stratos.theme.mgt.stub</artifactId>
+            <version>3.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.common.ui</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.resource.ui</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.core</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.equinox</groupId>
+            <artifactId>javax.servlet</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom.wso2</groupId>
+            <artifactId>axiom</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.ui</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.core</artifactId>
+            <version>${carbon.platform.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.batik.wso2</groupId>
+            <artifactId>batik</artifactId>
+        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>org.wso2.carbon</groupId>-->
+            <!--<artifactId>org.wso2.carbon.registry.profiles.ui</artifactId>-->
+            <!--<version>${registry-component.version}</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+            <!--<groupId>org.wso2.carbon</groupId>-->
+            <!--<artifactId>org.wso2.carbon.governance.wsdltool.ui</artifactId>-->
+            <!--<version>${registry-component.version}</version>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+            <!--<groupId>org.wso2.carbon</groupId>-->
+            <!--<artifactId>org.wso2.carbon.registry.resource.ui</artifactId>-->
+            <!--<version>${registry-component.version}</version>-->
+        <!--</dependency>-->
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/clients/ThemeMgtServiceClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/clients/ThemeMgtServiceClient.java b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/clients/ThemeMgtServiceClient.java
new file mode 100644
index 0000000..0365d37
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/clients/ThemeMgtServiceClient.java
@@ -0,0 +1,424 @@
+/*
+ *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. 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.
+ *
+ */
+package org.apache.stratos.theme.mgt.ui.clients;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.registry.common.utils.RegistryUtil;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException;
+import org.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.CollectionContentBean;
+import org.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentBean;
+import org.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentDownloadBean;
+import org.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.MetadataBean;
+import org.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.ResourceTreeEntryBean;
+import org.apache.stratos.theme.mgt.stub.registry.resource.stub.common.xsd.ResourceData;
+import org.apache.stratos.theme.mgt.stub.ThemeMgtServiceStub;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.activation.DataHandler;
+import javax.servlet.ServletConfig;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+public class ThemeMgtServiceClient {
+
+    private static final Log log = LogFactory.getLog(ThemeMgtServiceClient.class);
+
+    private ThemeMgtServiceStub stub;
+    private String epr;
+
+    public ThemeMgtServiceClient (
+            String cookie, String backendServerURL, ConfigurationContext configContext)
+            throws RegistryException {
+
+        epr = backendServerURL + "ThemeMgtService";
+
+        try {
+            stub = new ThemeMgtServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+
+    public ThemeMgtServiceClient(String cookie, ServletConfig config, HttpSession session)
+            throws RegistryException {
+
+        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
+        ConfigurationContext configContext = (ConfigurationContext) config.
+                getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+        epr = backendServerURL + "ThemeMgtService";
+
+        try {
+            stub = new ThemeMgtServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public ThemeMgtServiceClient(ServletConfig config, HttpSession session)
+            throws RegistryException {
+
+        String cookie = (String)session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
+        ConfigurationContext configContext = (ConfigurationContext) config.
+                getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+        epr = backendServerURL + "ThemeMgtService";
+
+        try {
+            stub = new ThemeMgtServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public ResourceTreeEntryBean getResourceTreeEntry(String resourcePath)
+            throws Exception {
+
+        ResourceTreeEntryBean entryBean = null;
+        try {
+            Options options = stub._getServiceClient().getOptions();
+            options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
+            entryBean = stub.getResourceTreeEntry(resourcePath);
+        } catch (Exception e) {
+            String msg = "Failed to get resource tree entry for resource " +
+                    resourcePath + ". " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+        if (entryBean == null) {
+            throw new ResourceNotFoundException("The resource does not exist");
+        }
+        return entryBean;
+    }
+
+     public ContentBean getContent(HttpServletRequest request) throws Exception {
+
+        String path = RegistryUtil.getPath(request);
+        ContentBean bean = null;
+        try {
+            bean = stub.getContentBean(path);
+        } catch (Exception e) {
+            String msg = "Failed to get content from the resource service. " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+
+        return bean;
+    }
+
+
+    public CollectionContentBean getCollectionContent(HttpServletRequest request) throws Exception {
+
+        String path = RegistryUtil.getPath(request);
+        CollectionContentBean bean = null;
+        try {
+            bean = stub.getCollectionContent(path);
+
+        } catch (Exception e) {
+            String msg = "Failed to get collection content from the resource service. " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+
+        return bean;
+    }
+
+
+    public ResourceData[] getResourceData(String[] paths) throws Exception {
+
+        ResourceData[] resourceData;
+        try {
+            resourceData = stub.getResourceData(paths);
+        } catch (Exception e) {
+            String msg = "Failed to get resource data from the resource service. " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+
+        return resourceData;
+    }
+
+    public String addCollection(
+            String parentPath, String collectionName, String mediaType, String description) throws Exception  {
+        try {
+            return stub.addCollection(parentPath, collectionName, mediaType, description);
+        } catch (Exception e) {
+            String msg = "Failed to add collection " + collectionName + " for parent path: " + parentPath + ". " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public void addResource(String path, String mediaType, String description, DataHandler content,
+                            String symlinkLocation, String tenantPass)
+            throws Exception {
+
+        try {
+            Options options = stub._getServiceClient().getOptions();
+            options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
+            options.setTimeOutInMilliSeconds(300000);
+            stub.addResource(path, mediaType, description, content, symlinkLocation, tenantPass);
+
+        } catch (Exception e) {
+
+            String msg = "Failed to add resource " + path + ". " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public void importResource(
+            String parentPath,
+            String resourceName,
+            String mediaType,
+            String description,
+            String fetchURL,
+            String symlinkLocation,
+            boolean isAsync,
+            String tenantPass) throws Exception {
+
+        try {
+            // This is used by the add wsdl UI. WSDL validation takes long when there are wsdl
+            // imports to prevent this we make a async call.
+            if (isAsync) {
+                stub._getServiceClient().getOptions().setProperty(
+                        MessageContext.CLIENT_API_NON_BLOCKING,Boolean.TRUE);
+            }
+            stub.importResource(parentPath, resourceName, mediaType, description, fetchURL, symlinkLocation, tenantPass);
+        } catch (Exception e) {
+            String msg = "Failed to import resource with name " + resourceName +
+                    " to the parent collection " + parentPath + ". " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+
+    public void addTextResource(
+            String parentPath,
+            String fileName,
+            String mediaType,
+            String description,
+            String content) throws Exception {
+
+        try {
+            stub.addTextResource(parentPath, fileName, mediaType, description, content);
+        } catch (Exception e) {
+            String msg = "Failed to add new text resource with name " + fileName +
+                    " to the parent collection " + parentPath + ". " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+    public MetadataBean getMetadata(HttpServletRequest request) throws Exception {
+
+        String path = RegistryUtil.getPath(request);
+        if (path == null) {
+            path = getSessionResourcePath();
+            if (path == null) {
+                path = RegistryConstants.ROOT_PATH;
+            }
+
+            request.setAttribute("path", path);
+        }
+
+        MetadataBean bean = null;
+        try {
+            bean = stub.getMetadata(path);
+        } catch (Exception e) {
+            String msg = "Failed to get resource metadata from the resource service. " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+
+        return bean;
+    }
+
+    public MetadataBean getMetadata(HttpServletRequest request,String root) throws Exception {
+
+        String path = RegistryConstants.ROOT_PATH;
+        request.setAttribute("path", path);
+        if (path == null) {
+            path = getSessionResourcePath();
+            if (path == null) {
+                path = RegistryConstants.ROOT_PATH;
+            }
+        }
+
+        MetadataBean bean = null;
+        try {
+            bean = stub.getMetadata(path);
+        } catch (Exception e) {
+            String msg = "Failed to get resource metadata from the resource service. " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+
+        return bean;
+    }
+
+    public String getSessionResourcePath() throws Exception {
+
+        String sessionResourcePath;
+        try {
+            sessionResourcePath = stub.getSessionResourcePath();
+        } catch (Exception e) {
+
+            String msg = "Failed to get the session resource path. " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+        return sessionResourcePath;
+    }
+
+
+    public String getTextContent(HttpServletRequest request) throws Exception {
+
+        String path = RegistryUtil.getPath(request);
+
+        String textContent = null;
+        try {
+            textContent = stub.getTextContent(path);
+        } catch (Exception e) {
+
+            String msg = "Failed get text content of the resource " +
+                    path + ". " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+        return textContent;
+    }
+
+     public void updateTextContent(String resourcePath, String contentText) throws Exception {
+
+        try {
+            stub.updateTextContent(resourcePath, contentText);
+        } catch (Exception e) {
+
+            String msg = "Failed to update text content of the resource " +
+                    resourcePath + ". " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public ContentDownloadBean getContentDownloadBean(String path) throws Exception {
+
+        ContentDownloadBean bean = stub.getContentDownloadBean(path);
+        return bean;
+    }
+
+    public void renameResource(
+            String parentPath, String oldResourcePath, String newResourceName)
+            throws Exception {
+
+        try {
+            stub.renameResource(parentPath, oldResourcePath, newResourceName);
+        } catch (Exception e) {
+            String msg = "Failed to rename resource with name " + oldResourcePath +
+                    " to the new name " + newResourceName + ". " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+    public void delete(String pathToDelete) throws Exception {
+
+        try {
+            stub.delete(pathToDelete);
+        } catch (Exception e) {
+            String msg = "Failed to delete " + pathToDelete + ". " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public String[] getAllPaths() throws Exception {
+
+        try {
+            return  stub.getAllPaths();
+        } catch (Exception e) {
+            String msg = "Failed to getAllPaths. " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public String[] getAllThemes(String tenantPass) throws Exception {
+        try {
+            return stub.getAllThemes(tenantPass);
+        } catch (Exception e) {
+            String msg = "Failed to get All Themes.";
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public void applyTheme(String themeName, String tenantPass) throws Exception {
+        try {
+            stub.applyTheme(themeName, tenantPass);
+        } catch (Exception e) {
+            String msg = "Failed to apply the theme: " + themeName;
+            log.error(msg, e);
+            throw e;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/processors/AddThemeResourceProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/processors/AddThemeResourceProcessor.java b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/processors/AddThemeResourceProcessor.java
new file mode 100644
index 0000000..c8ac3cb
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/processors/AddThemeResourceProcessor.java
@@ -0,0 +1,239 @@
+/*
+ *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. 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.
+ *
+ */
+package org.apache.stratos.theme.mgt.ui.processors;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.CarbonException;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient;
+import org.wso2.carbon.ui.CarbonUIMessage;
+import org.wso2.carbon.ui.transports.fileupload.AbstractFileUploadExecutor;
+import org.wso2.carbon.utils.FileItemData;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.imageio.ImageIO;
+import javax.mail.util.ByteArrayDataSource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Map;
+
+
+/*
+* Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+* Licensed 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.
+*/
+
+
+public class AddThemeResourceProcessor extends AbstractFileUploadExecutor {
+
+    private static final Log log = LogFactory.getLog(AddThemeResourceProcessor.class);
+
+    public boolean execute(HttpServletRequest request, HttpServletResponse response)
+            throws CarbonException, IOException {
+
+        String webContext = (String) request.getAttribute(CarbonConstants.WEB_CONTEXT);
+        String serverURL = (String) request.getAttribute(CarbonConstants.SERVER_URL);
+        String cookie = (String) request.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+        // HttpSession session = request.getSession();
+
+        Map<String, ArrayList<FileItemData>> fileItemsMap = getFileItemsMap();
+        if (fileItemsMap == null || fileItemsMap.isEmpty()) {
+            String msg = "File uploading failed. Content is not set properly.";
+            log.error(msg);
+
+            CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.ERROR, request);
+            response.sendRedirect(
+                    "../" + webContext + "/admin/error.jsp");
+
+            return false;
+        }
+
+        try {
+            ThemeMgtServiceClient client =
+                    new ThemeMgtServiceClient(cookie, serverURL, configurationContext);
+
+            String parentPath = null;
+            Map<String, ArrayList<java.lang.String>> formFieldsMap = getFormFieldsMap();
+            if (formFieldsMap.get("path") != null) {
+                parentPath = formFieldsMap.get("path").get(0);
+            }
+            String resourceName = null;
+            if (formFieldsMap.get("filename") != null) {
+                resourceName = formFieldsMap.get("filename").get(0);
+            }
+            String mediaType = null;
+            if (formFieldsMap.get("mediaType") != null) {
+                mediaType = formFieldsMap.get("mediaType").get(0);
+            }
+            String description = null;
+            if (formFieldsMap.get("description") != null) {
+                description = formFieldsMap.get("description").get(0);
+            }
+            String symlinkLocation = null;
+            if (formFieldsMap.get("symlinkLocation") != null) {
+                symlinkLocation = formFieldsMap.get("symlinkLocation").get(0);
+            }
+            String redirectWith = null;
+            if (formFieldsMap.get("redirectWith") != null) {
+                redirectWith = formFieldsMap.get("redirectWith").get(0);
+            }
+            /*
+            // currently chroot will not work with multitenancy
+            IServerAdmin adminClient =
+                    (IServerAdmin) CarbonUIUtil.
+                            getServerProxy(new ServerAdminClient(configurationContext,
+                                    serverURL, cookie, session), IServerAdmin.class, session);
+            ServerData data = adminClient.getServerData();
+            String chroot = "";
+            if (data.getRegistryType().equals("remote") && data.getRemoteRegistryChroot() != null &&
+                    !data.getRemoteRegistryChroot().equals(RegistryConstants.PATH_SEPARATOR)) {
+                chroot = data.getRemoteRegistryChroot();
+                if (!chroot.startsWith(RegistryConstants.PATH_SEPARATOR)) {
+                    chroot = RegistryConstants.PATH_SEPARATOR + chroot;
+                }
+                if (chroot.endsWith(RegistryConstants.PATH_SEPARATOR)) {
+                    chroot = chroot.substring(0, chroot.length() - RegistryConstants.PATH_SEPARATOR.length());
+                }
+            }
+            if (symlinkLocation != null) {
+                symlinkLocation = chroot + symlinkLocation;
+            }
+            */
+
+            FileItemData fileItemData = fileItemsMap.get("upload").get(0);
+
+            if ((fileItemData == null) || (fileItemData.getFileItem().getSize() == 0)) {
+                String msg = "Failed add resource. Resource content is empty.";
+                log.error(msg);
+
+                CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.ERROR, request);
+                response.sendRedirect(
+                        "../" + webContext + "/admin/error.jsp");
+
+                return false;
+            }
+            DataHandler dataHandler = scaleImage(fileItemData.getDataHandler(), 48, 119);
+
+            client.addResource(
+                    calculatePath(parentPath, resourceName), mediaType, description, dataHandler,
+                    symlinkLocation, redirectWith);
+
+            response.setContentType("text/html; charset=utf-8");
+            String msg = "The logo has been successfully updated.";
+            CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.INFO, request);
+
+            String redirectTo = request.getParameter("redirectto");
+            if ("theme_mgt".equals(redirectTo)) {
+                response.setHeader("Cache-Control", "no-cache, must-revalidate");
+                response.sendRedirect("../" + webContext +
+                        "/tenant-theme/theme_mgt.jsp?logoChanged=true&redirectWith=" + redirectWith);
+            }else if ("logo_mgt".equals(redirectTo)) {
+                response.setHeader("Cache-Control", "no-cache, must-revalidate");
+                response.sendRedirect("../" + webContext +
+                        "/tenant-theme/logo_mgt.jsp?logoChanged=true&redirectWith=" + redirectWith);
+            }
+            else {
+                response.sendRedirect("../" + webContext + "/tenant-theme/theme_advanced.jsp?path=" + parentPath);
+            }
+            return true;
+
+        } catch (Exception e) {
+            String msg = "File upload failed. Please confirm that the chosen image is not corrupted " +
+                    "and retry uploading, or upload a valid image.";
+            log.error(msg + " " + e.getMessage());
+
+            CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.ERROR, request);
+            response.sendRedirect(
+                    "../" + webContext + "/admin/error.jsp");
+
+            return false;
+        }
+    }
+
+    private static DataHandler scaleImage(DataHandler dataHandler, int height, int width) throws IOException {
+
+        Image image = ImageIO.read(new BufferedInputStream(dataHandler.getInputStream()));
+        // Check if the image has transparent pixels
+        boolean hasAlpha = ((BufferedImage)image).getColorModel().hasAlpha();
+
+        // Maintain Aspect ratio
+        int thumbHeight = height;
+        int thumbWidth = width;
+        double thumbRatio = (double)width / (double)height;
+        double imageRatio = (double)image.getWidth(null) / (double)image.getHeight(null);
+        if (thumbRatio < imageRatio) {
+            thumbHeight = (int)(thumbWidth / imageRatio);
+        } else {
+            thumbWidth = (int)(thumbHeight * imageRatio);
+        }
+
+        BufferedImage thumb;
+        // Check if transparent pixels are available and set the color mode accordingly 
+        if (hasAlpha) {
+            thumb = new BufferedImage(thumbWidth, thumbHeight, BufferedImage.TYPE_INT_ARGB);
+        } else {
+            thumb = new BufferedImage(thumbWidth, thumbHeight, BufferedImage.TYPE_INT_RGB);
+        }
+        Graphics2D graphics2D = thumb.createGraphics();
+        graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
+                                    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+        graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);
+
+        // Save the image as PNG so that transparent images are rendered as intended
+        ByteArrayOutputStream output = new ByteArrayOutputStream();
+        ImageIO.write(thumb, "PNG", output);
+
+        DataSource dataSource= new ByteArrayDataSource(output.toByteArray(), "application/octet-stream");
+        return new DataHandler(dataSource);
+    }
+
+    private static String calculatePath(String parentPath, String resourceName) {
+        String resourcePath;
+        if (!parentPath.startsWith(RegistryConstants.PATH_SEPARATOR)) {
+            parentPath = RegistryConstants.PATH_SEPARATOR + parentPath;
+        }
+        if (parentPath.endsWith(RegistryConstants.PATH_SEPARATOR)) {
+            resourcePath = parentPath + resourceName;
+        } else {
+            resourcePath = parentPath + RegistryConstants.PATH_SEPARATOR + resourceName;
+        }
+        return resourcePath;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/servlets/ThemeResourceSevelet.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/servlets/ThemeResourceSevelet.java b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/servlets/ThemeResourceSevelet.java
new file mode 100644
index 0000000..a79324e
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/servlets/ThemeResourceSevelet.java
@@ -0,0 +1,124 @@
+/*
+ *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. 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.
+ *
+ */
+package org.apache.stratos.theme.mgt.ui.servlets;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentDownloadBean;
+import org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+
+public class ThemeResourceSevelet extends HttpServlet {
+
+    private static final Log log = LogFactory.getLog(ThemeResourceSevelet.class);
+
+    private ServletConfig servletConfig;
+
+    public void init(ServletConfig servletConfig) throws ServletException {
+        super.init(servletConfig);
+        this.servletConfig = servletConfig;
+    }
+
+    protected void doGet(HttpServletRequest request, HttpServletResponse response)
+            throws ServletException, IOException {
+
+        try {
+            ThemeMgtServiceClient client = new ThemeMgtServiceClient(servletConfig, request.getSession());
+            String path = request.getParameter("path");
+            String viewImage = request.getParameter("viewImage");
+            if (path == null) {
+                String msg = "Could not get the resource content. Path is not specified.";
+                log.error(msg);
+                response.setStatus(400);
+                return;
+            }
+
+            ContentDownloadBean bean = client.getContentDownloadBean(path);
+
+            InputStream contentStream = null;
+            if (bean.getContent() != null) {
+                contentStream = bean.getContent().getInputStream();
+            } else {
+                String msg = "The resource content was empty.";
+                log.error(msg);
+                response.setStatus(204);
+                return;
+            }
+
+            response.setDateHeader("Last-Modified", bean.getLastUpdatedTime().getTime().getTime());
+            String ext = "jpg";
+            if (path.lastIndexOf(".") < path.length() -1 && path.lastIndexOf(".") > 0) {
+                ext = path.substring(path.lastIndexOf(".") + 1);
+            }
+
+            if (viewImage != null && viewImage.equals("1")) {
+                response.setContentType("img/" + ext);
+            }
+            else {
+                if (bean.getMediatype() != null && bean.getMediatype().length() > 0) {
+                    response.setContentType(bean.getMediatype());
+                } else {
+                    response.setContentType("application/download");
+                }
+
+                if (bean.getResourceName() != null) {
+                    response.setHeader(
+                            "Content-Disposition", "attachment; filename=\"" + bean.getResourceName() + "\"");
+                }
+            }
+
+            if (contentStream != null) {
+
+                ServletOutputStream servletOutputStream = null;
+                try {
+                    servletOutputStream = response.getOutputStream();
+
+                    byte[] contentChunk = new byte[1024];
+                    int byteCount;
+                    while ((byteCount = contentStream.read(contentChunk)) != -1) {
+                        servletOutputStream.write(contentChunk, 0, byteCount);
+                    }
+
+                    response.flushBuffer();
+                    servletOutputStream.flush();
+
+                } finally {
+                    contentStream.close();
+
+                    if (servletOutputStream != null) {
+                        servletOutputStream.close();
+                    }
+                }
+            }
+        } catch (Exception e) {
+
+            String msg = "Failed to get resource content. " + e.getMessage();
+            log.error(msg, e);
+            response.setStatus(500);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/utils/ThemeUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/utils/ThemeUtil.java b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/utils/ThemeUtil.java
new file mode 100644
index 0000000..c01114f
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/apache/stratos/theme/mgt/ui/utils/ThemeUtil.java
@@ -0,0 +1,67 @@
+/*
+ *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. 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.
+ *
+ */
+package org.apache.stratos.theme.mgt.ui.utils;
+
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.registry.core.utils.UUIDGenerator;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.servlet.ServletConfig;
+
+public class ThemeUtil {
+	public static String getThemeResourceDownloadURL(String path) {
+		return "../../registry/themeResourceContent?path=" + path;
+	}
+
+	public static String getThemeResourceViewAsImageURL(String path) {
+		return "../../registry/themeResourceContent?path=" + path
+		        + "&viewImage=1";
+	}
+
+	public static String getThumbUrl(HttpServletRequest request, String themeName) {
+		String serverURL = CarbonUIUtil.getAdminConsoleURL(request);
+		String serverRoot = serverURL.substring(0, serverURL.length()
+		        - "carbon/".length());
+		return serverRoot + "registry/resource"
+		        + RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH
+		        + "/repository/components/org.wso2.carbon.all-themes/"
+		        + themeName + "/thumb.png";
+	}
+
+	public static String getLogoURL(ServletConfig config, HttpSession session) {
+		// this is to avoid the caching problem
+		String randomUUID = UUIDGenerator.generateUUID();
+		String serverURL = CarbonUIUtil.getServerURL(
+		        config.getServletContext(), session);
+		String serverRoot = serverURL.substring(0, serverURL.length() - "services/".length());
+		String tenantDomain = (String) session
+		        .getAttribute(MultitenantConstants.TENANT_DOMAIN);
+		if (tenantDomain == null) {
+			return "";
+		}
+
+        // Using relative path instead of the back-end server url.
+        return  "../../../../t/" + tenantDomain + "/registry/resource"
+		        + RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH
+		        + "/repository/theme/admin/logo.gif?thatsrnd=" + randomUUID;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/clients/ThemeMgtServiceClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/clients/ThemeMgtServiceClient.java b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/clients/ThemeMgtServiceClient.java
new file mode 100644
index 0000000..3630e3a
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/clients/ThemeMgtServiceClient.java
@@ -0,0 +1,424 @@
+/*
+ *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. 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.
+ *
+ */
+package org.wso2.carbon.theme.mgt.ui.clients;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.registry.common.utils.RegistryUtil;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException;
+import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.CollectionContentBean;
+import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentBean;
+import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentDownloadBean;
+import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.MetadataBean;
+import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.ResourceTreeEntryBean;
+import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.common.xsd.ResourceData;
+import org.wso2.carbon.theme.mgt.stub.ThemeMgtServiceStub;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.activation.DataHandler;
+import javax.servlet.ServletConfig;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+public class ThemeMgtServiceClient {
+
+    private static final Log log = LogFactory.getLog(ThemeMgtServiceClient.class);
+
+    private ThemeMgtServiceStub stub;
+    private String epr;
+
+    public ThemeMgtServiceClient (
+            String cookie, String backendServerURL, ConfigurationContext configContext)
+            throws RegistryException {
+
+        epr = backendServerURL + "ThemeMgtService";
+
+        try {
+            stub = new ThemeMgtServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+
+    public ThemeMgtServiceClient(String cookie, ServletConfig config, HttpSession session)
+            throws RegistryException {
+
+        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
+        ConfigurationContext configContext = (ConfigurationContext) config.
+                getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+        epr = backendServerURL + "ThemeMgtService";
+
+        try {
+            stub = new ThemeMgtServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public ThemeMgtServiceClient(ServletConfig config, HttpSession session)
+            throws RegistryException {
+
+        String cookie = (String)session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
+        ConfigurationContext configContext = (ConfigurationContext) config.
+                getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+        epr = backendServerURL + "ThemeMgtService";
+
+        try {
+            stub = new ThemeMgtServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public ResourceTreeEntryBean getResourceTreeEntry(String resourcePath)
+            throws Exception {
+
+        ResourceTreeEntryBean entryBean = null;
+        try {
+            Options options = stub._getServiceClient().getOptions();
+            options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
+            entryBean = stub.getResourceTreeEntry(resourcePath);
+        } catch (Exception e) {
+            String msg = "Failed to get resource tree entry for resource " +
+                    resourcePath + ". " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+        if (entryBean == null) {
+            throw new ResourceNotFoundException("The resource does not exist");
+        }
+        return entryBean;
+    }
+
+     public ContentBean getContent(HttpServletRequest request) throws Exception {
+
+        String path = RegistryUtil.getPath(request);
+        ContentBean bean = null;
+        try {
+            bean = stub.getContentBean(path);
+        } catch (Exception e) {
+            String msg = "Failed to get content from the resource service. " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+
+        return bean;
+    }
+
+
+    public CollectionContentBean getCollectionContent(HttpServletRequest request) throws Exception {
+
+        String path = RegistryUtil.getPath(request);
+        CollectionContentBean bean = null;
+        try {
+            bean = stub.getCollectionContent(path);
+
+        } catch (Exception e) {
+            String msg = "Failed to get collection content from the resource service. " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+
+        return bean;
+    }
+
+
+    public ResourceData[] getResourceData(String[] paths) throws Exception {
+
+        ResourceData[] resourceData;
+        try {
+            resourceData = stub.getResourceData(paths);
+        } catch (Exception e) {
+            String msg = "Failed to get resource data from the resource service. " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+
+        return resourceData;
+    }
+
+    public String addCollection(
+            String parentPath, String collectionName, String mediaType, String description) throws Exception  {
+        try {
+            return stub.addCollection(parentPath, collectionName, mediaType, description);
+        } catch (Exception e) {
+            String msg = "Failed to add collection " + collectionName + " for parent path: " + parentPath + ". " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public void addResource(String path, String mediaType, String description, DataHandler content,
+                            String symlinkLocation, String tenantPass)
+            throws Exception {
+
+        try {
+            Options options = stub._getServiceClient().getOptions();
+            options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
+            options.setTimeOutInMilliSeconds(300000);
+            stub.addResource(path, mediaType, description, content, symlinkLocation, tenantPass);
+
+        } catch (Exception e) {
+
+            String msg = "Failed to add resource " + path + ". " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public void importResource(
+            String parentPath,
+            String resourceName,
+            String mediaType,
+            String description,
+            String fetchURL,
+            String symlinkLocation,
+            boolean isAsync,
+            String tenantPass) throws Exception {
+
+        try {
+            // This is used by the add wsdl UI. WSDL validation takes long when there are wsdl
+            // imports to prevent this we make a async call.
+            if (isAsync) {
+                stub._getServiceClient().getOptions().setProperty(
+                        MessageContext.CLIENT_API_NON_BLOCKING,Boolean.TRUE);
+            }
+            stub.importResource(parentPath, resourceName, mediaType, description, fetchURL, symlinkLocation, tenantPass);
+        } catch (Exception e) {
+            String msg = "Failed to import resource with name " + resourceName +
+                    " to the parent collection " + parentPath + ". " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+
+    public void addTextResource(
+            String parentPath,
+            String fileName,
+            String mediaType,
+            String description,
+            String content) throws Exception {
+
+        try {
+            stub.addTextResource(parentPath, fileName, mediaType, description, content);
+        } catch (Exception e) {
+            String msg = "Failed to add new text resource with name " + fileName +
+                    " to the parent collection " + parentPath + ". " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+    public MetadataBean getMetadata(HttpServletRequest request) throws Exception {
+
+        String path = RegistryUtil.getPath(request);
+        if (path == null) {
+            path = getSessionResourcePath();
+            if (path == null) {
+                path = RegistryConstants.ROOT_PATH;
+            }
+
+            request.setAttribute("path", path);
+        }
+
+        MetadataBean bean = null;
+        try {
+            bean = stub.getMetadata(path);
+        } catch (Exception e) {
+            String msg = "Failed to get resource metadata from the resource service. " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+
+        return bean;
+    }
+
+    public MetadataBean getMetadata(HttpServletRequest request,String root) throws Exception {
+
+        String path = RegistryConstants.ROOT_PATH;
+        request.setAttribute("path", path);
+        if (path == null) {
+            path = getSessionResourcePath();
+            if (path == null) {
+                path = RegistryConstants.ROOT_PATH;
+            }
+        }
+
+        MetadataBean bean = null;
+        try {
+            bean = stub.getMetadata(path);
+        } catch (Exception e) {
+            String msg = "Failed to get resource metadata from the resource service. " +
+                    e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+
+        return bean;
+    }
+
+    public String getSessionResourcePath() throws Exception {
+
+        String sessionResourcePath;
+        try {
+            sessionResourcePath = stub.getSessionResourcePath();
+        } catch (Exception e) {
+
+            String msg = "Failed to get the session resource path. " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+        return sessionResourcePath;
+    }
+
+
+    public String getTextContent(HttpServletRequest request) throws Exception {
+
+        String path = RegistryUtil.getPath(request);
+
+        String textContent = null;
+        try {
+            textContent = stub.getTextContent(path);
+        } catch (Exception e) {
+
+            String msg = "Failed get text content of the resource " +
+                    path + ". " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+        return textContent;
+    }
+
+     public void updateTextContent(String resourcePath, String contentText) throws Exception {
+
+        try {
+            stub.updateTextContent(resourcePath, contentText);
+        } catch (Exception e) {
+
+            String msg = "Failed to update text content of the resource " +
+                    resourcePath + ". " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public ContentDownloadBean getContentDownloadBean(String path) throws Exception {
+
+        ContentDownloadBean bean = stub.getContentDownloadBean(path);
+        return bean;
+    }
+
+    public void renameResource(
+            String parentPath, String oldResourcePath, String newResourceName)
+            throws Exception {
+
+        try {
+            stub.renameResource(parentPath, oldResourcePath, newResourceName);
+        } catch (Exception e) {
+            String msg = "Failed to rename resource with name " + oldResourcePath +
+                    " to the new name " + newResourceName + ". " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+    public void delete(String pathToDelete) throws Exception {
+
+        try {
+            stub.delete(pathToDelete);
+        } catch (Exception e) {
+            String msg = "Failed to delete " + pathToDelete + ". " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public String[] getAllPaths() throws Exception {
+
+        try {
+            return  stub.getAllPaths();
+        } catch (Exception e) {
+            String msg = "Failed to getAllPaths. " + e.getMessage();
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public String[] getAllThemes(String tenantPass) throws Exception {
+        try {
+            return stub.getAllThemes(tenantPass);
+        } catch (Exception e) {
+            String msg = "Failed to get All Themes.";
+            log.error(msg, e);
+            throw e;
+        }
+    }
+
+    public void applyTheme(String themeName, String tenantPass) throws Exception {
+        try {
+            stub.applyTheme(themeName, tenantPass);
+        } catch (Exception e) {
+            String msg = "Failed to apply the theme: " + themeName;
+            log.error(msg, e);
+            throw e;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/processors/AddThemeResourceProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/processors/AddThemeResourceProcessor.java b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/processors/AddThemeResourceProcessor.java
new file mode 100644
index 0000000..11b0bd6
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/processors/AddThemeResourceProcessor.java
@@ -0,0 +1,240 @@
+/*
+ *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. 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.
+ *
+ */
+package org.wso2.carbon.theme.mgt.ui.processors;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.CarbonException;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient;
+import org.wso2.carbon.ui.CarbonUIMessage;
+import org.wso2.carbon.ui.transports.fileupload.AbstractFileUploadExecutor;
+import org.wso2.carbon.utils.FileItemData;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.imageio.ImageIO;
+import javax.mail.util.ByteArrayDataSource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Map;
+
+
+/*
+* Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+* Licensed 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.
+*/
+
+
+public class AddThemeResourceProcessor extends AbstractFileUploadExecutor {
+
+    private static final Log log = LogFactory.getLog(AddThemeResourceProcessor.class);
+
+    public boolean execute(HttpServletRequest request, HttpServletResponse response)
+            throws CarbonException, IOException {
+
+        String webContext = (String) request.getAttribute(CarbonConstants.WEB_CONTEXT);
+        String serverURL = (String) request.getAttribute(CarbonConstants.SERVER_URL);
+        String cookie = (String) request.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+        // HttpSession session = request.getSession();
+
+        Map<String, ArrayList<FileItemData>> fileItemsMap = getFileItemsMap();
+        if (fileItemsMap == null || fileItemsMap.isEmpty()) {
+            String msg = "File uploading failed. Content is not set properly.";
+            log.error(msg);
+
+            CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.ERROR, request);
+            response.sendRedirect(
+                    "../" + webContext + "/admin/error.jsp");
+
+            return false;
+        }
+
+        try {
+            ThemeMgtServiceClient client =
+                    new ThemeMgtServiceClient(cookie, serverURL, configurationContext);
+
+            String parentPath = null;
+            Map<String, ArrayList<java.lang.String>> formFieldsMap = getFormFieldsMap();
+            if (formFieldsMap.get("path") != null) {
+                parentPath = formFieldsMap.get("path").get(0);
+            }
+            String resourceName = null;
+            if (formFieldsMap.get("filename") != null) {
+                resourceName = formFieldsMap.get("filename").get(0);
+            }
+            String mediaType = null;
+            if (formFieldsMap.get("mediaType") != null) {
+                mediaType = formFieldsMap.get("mediaType").get(0);
+            }
+            String description = null;
+            if (formFieldsMap.get("description") != null) {
+                description = formFieldsMap.get("description").get(0);
+            }
+            String symlinkLocation = null;
+            if (formFieldsMap.get("symlinkLocation") != null) {
+                symlinkLocation = formFieldsMap.get("symlinkLocation").get(0);
+            }
+            String redirectWith = null;
+            if (formFieldsMap.get("redirectWith") != null) {
+                redirectWith = formFieldsMap.get("redirectWith").get(0);
+            }
+            /*
+            // currently chroot will not work with multitenancy
+            IServerAdmin adminClient =
+                    (IServerAdmin) CarbonUIUtil.
+                            getServerProxy(new ServerAdminClient(configurationContext,
+                                    serverURL, cookie, session), IServerAdmin.class, session);
+            ServerData data = adminClient.getServerData();
+            String chroot = "";
+            if (data.getRegistryType().equals("remote") && data.getRemoteRegistryChroot() != null &&
+                    !data.getRemoteRegistryChroot().equals(RegistryConstants.PATH_SEPARATOR)) {
+                chroot = data.getRemoteRegistryChroot();
+                if (!chroot.startsWith(RegistryConstants.PATH_SEPARATOR)) {
+                    chroot = RegistryConstants.PATH_SEPARATOR + chroot;
+                }
+                if (chroot.endsWith(RegistryConstants.PATH_SEPARATOR)) {
+                    chroot = chroot.substring(0, chroot.length() - RegistryConstants.PATH_SEPARATOR.length());
+                }
+            }
+            if (symlinkLocation != null) {
+                symlinkLocation = chroot + symlinkLocation;
+            }
+            */
+
+            FileItemData fileItemData = fileItemsMap.get("upload").get(0);
+
+            if ((fileItemData == null) || (fileItemData.getFileItem().getSize() == 0)) {
+                String msg = "Failed add resource. Resource content is empty.";
+                log.error(msg);
+
+                CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.ERROR, request);
+                response.sendRedirect(
+                        "../" + webContext + "/admin/error.jsp");
+
+                return false;
+            }
+            DataHandler dataHandler = scaleImage(fileItemData.getDataHandler(), 48, 119);
+
+            client.addResource(
+                    calculatePath(parentPath, resourceName), mediaType, description, dataHandler,
+                    symlinkLocation, redirectWith);
+
+            response.setContentType("text/html; charset=utf-8");
+            String msg = "The logo has been successfully updated.";
+            CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.INFO, request);
+
+            String redirectTo = request.getParameter("redirectto");
+            if ("theme_mgt".equals(redirectTo)) {
+                response.setHeader("Cache-Control", "no-cache, must-revalidate");
+                response.sendRedirect("../" + webContext +
+                        "/tenant-theme/theme_mgt.jsp?logoChanged=true&redirectWith=" + redirectWith);
+            }else if ("logo_mgt".equals(redirectTo)) {
+                response.setHeader("Cache-Control", "no-cache, must-revalidate");
+                response.sendRedirect("../" + webContext +
+                        "/tenant-theme/logo_mgt.jsp?logoChanged=true&redirectWith=" + redirectWith);
+            }
+            else {
+                response.sendRedirect("../" + webContext + "/tenant-theme/theme_advanced.jsp?path=" + parentPath);
+            }
+            return true;
+
+        } catch (Exception e) {
+            String msg = "File upload failed. Please confirm that the chosen image is not corrupted " +
+                    "and retry uploading, or upload a valid image.";
+            log.error(msg + " " + e.getMessage());
+
+            CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.ERROR, request);
+            response.sendRedirect(
+                    "../" + webContext + "/admin/error.jsp");
+
+            return false;
+        }
+    }
+
+    private static DataHandler scaleImage(DataHandler dataHandler, int height, int width) throws IOException {
+
+        Image image = ImageIO.read(new BufferedInputStream(dataHandler.getInputStream()));
+        // Check if the image has transparent pixels
+        boolean hasAlpha = ((BufferedImage)image).getColorModel().hasAlpha();
+
+        // Maintain Aspect ratio
+        int thumbHeight = height;
+        int thumbWidth = width;
+        double thumbRatio = (double)width / (double)height;
+        double imageRatio = (double)image.getWidth(null) / (double)image.getHeight(null);
+        if (thumbRatio < imageRatio) {
+            thumbHeight = (int)(thumbWidth / imageRatio);
+        } else {
+            thumbWidth = (int)(thumbHeight * imageRatio);
+        }
+
+        BufferedImage thumb;
+        // Check if transparent pixels are available and set the color mode accordingly 
+        if (hasAlpha) {
+            thumb = new BufferedImage(thumbWidth, thumbHeight, BufferedImage.TYPE_INT_ARGB);
+        } else {
+            thumb = new BufferedImage(thumbWidth, thumbHeight, BufferedImage.TYPE_INT_RGB);
+        }
+        Graphics2D graphics2D = thumb.createGraphics();
+        graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
+                                    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+        graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);
+
+        // Save the image as PNG so that transparent images are rendered as intended
+        ByteArrayOutputStream output = new ByteArrayOutputStream();
+        ImageIO.write(thumb, "PNG", output);
+
+        DataSource dataSource= new ByteArrayDataSource(output.toByteArray(), "application/octet-stream");
+        return new DataHandler(dataSource);
+    }
+
+    private static String calculatePath(String parentPath, String resourceName) {
+        String resourcePath;
+        if (!parentPath.startsWith(RegistryConstants.PATH_SEPARATOR)) {
+            parentPath = RegistryConstants.PATH_SEPARATOR + parentPath;
+        }
+        if (parentPath.endsWith(RegistryConstants.PATH_SEPARATOR)) {
+            resourcePath = parentPath + resourceName;
+        } else {
+            resourcePath = parentPath + RegistryConstants.PATH_SEPARATOR + resourceName;
+        }
+        return resourcePath;
+    }
+}


[17/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/elements_functions.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/elements_functions.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/elements_functions.js
new file mode 100644
index 0000000..3426fd1
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/elements_functions.js
@@ -0,0 +1,333 @@
+/****
+ * This page contains some general usefull functions for javascript
+ *
+ ****/  
+	
+	
+	// need to redefine this functiondue to IE problem
+	function getAttribute( elm, aName ) {
+		var aValue,taName,i;
+		try{
+			aValue = elm.getAttribute( aName );
+		}catch(exept){}
+		
+		if( ! aValue ){
+			for( i = 0; i < elm.attributes.length; i ++ ) {
+				taName = elm.attributes[i] .name.toLowerCase();
+				if( taName == aName ) {
+					aValue = elm.attributes[i] .value;
+					return aValue;
+				}
+			}
+		}
+		return aValue;
+	};
+	
+	// need to redefine this function due to IE problem
+	function setAttribute( elm, attr, val ) {
+		if(attr=="class"){
+			elm.setAttribute("className", val);
+			elm.setAttribute("class", val);
+		}else{
+			elm.setAttribute(attr, val);
+		}
+	};
+	
+	/* return a child element
+		elem: element we are searching in
+		elem_type: type of the eleemnt we are searching (DIV, A, etc...)
+		elem_attribute: attribute of the searched element that must match
+		elem_attribute_match: value that elem_attribute must match
+		option: "all" if must return an array of all children, otherwise return the first match element
+		depth: depth of search (-1 or no set => unlimited)
+	*/
+	function getChildren(elem, elem_type, elem_attribute, elem_attribute_match, option, depth)
+	{           
+		if(!option)
+			var option="single";
+		if(!depth)
+			var depth=-1;
+		if(elem){
+			var children= elem.childNodes;
+			var result=null;
+			var results= [];
+			for (var x=0;x<children.length;x++) {
+				strTagName = new String(children[x].tagName);
+				children_class="?";
+				if(strTagName!= "undefined"){
+					child_attribute= getAttribute(children[x],elem_attribute);
+					if((strTagName.toLowerCase()==elem_type.toLowerCase() || elem_type=="") && (elem_attribute=="" || child_attribute==elem_attribute_match)){
+						if(option=="all"){
+							results.push(children[x]);
+						}else{
+							return children[x];
+						}
+					}
+					if(depth!=0){
+						result=getChildren(children[x], elem_type, elem_attribute, elem_attribute_match, option, depth-1);
+						if(option=="all"){
+							if(result.length>0){
+								results= results.concat(result);
+							}
+						}else if(result!=null){                                                                          
+							return result;
+						}
+					}
+				}
+			}
+			if(option=="all")
+			   return results;
+		}
+		return null;
+	};       
+	
+	function isChildOf(elem, parent){
+		if(elem){
+			if(elem==parent)
+				return true;
+			while(elem.parentNode != 'undefined'){
+				return isChildOf(elem.parentNode, parent);
+			}
+		}
+		return false;
+	};
+	
+	function getMouseX(e){
+
+		if(e!=null && typeof(e.pageX)!="undefined"){
+			return e.pageX;
+		}else{
+			return (e!=null?e.x:event.x)+ document.documentElement.scrollLeft;
+		}
+	};
+	
+	function getMouseY(e){
+		if(e!=null && typeof(e.pageY)!="undefined"){
+			return e.pageY;
+		}else{
+			return (e!=null?e.y:event.y)+ document.documentElement.scrollTop;
+		}
+	};
+	
+	function calculeOffsetLeft(r){
+		return calculeOffset(r,"offsetLeft")
+	};
+	
+	function calculeOffsetTop(r){
+		return calculeOffset(r,"offsetTop")
+	};
+	
+	function calculeOffset(element,attr){
+		var offset=0;
+		while(element){
+			offset+=element[attr];
+			element=element.offsetParent
+		}
+		return offset;
+	};
+	
+	/** return the computed style
+	 *	@param: elem: the reference to the element
+	 *	@param: prop: the name of the css property	 
+	 */
+	function get_css_property(elem, prop)
+	{
+		if(document.defaultView)
+		{
+			return document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop);
+		}
+		else if(elem.currentStyle)
+		{
+			var prop = prop.replace(/-\D/gi, function(sMatch)
+			{
+				return sMatch.charAt(sMatch.length - 1).toUpperCase();
+			});
+			return elem.currentStyle[prop];
+		}
+		else return null;
+	}
+	
+/****
+ * Moving an element 
+ ***/  
+	
+	var _mCE;	// currently moving element
+	
+	/* allow to move an element in a window
+		e: the event
+		id: the id of the element
+		frame: the frame of the element 
+		ex of use:
+			in html:	<img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["this_frame_id"]);' .../>  
+		or
+			in javascript: document.getElementById("my_div").onmousedown= start_move_element
+	*/
+	function start_move_element(e, id, frame){
+		var elem_id=(e.target || e.srcElement).id;
+		if(id)
+			elem_id=id;		
+		if(!frame)
+			frame=window;
+		if(frame.event)
+			e=frame.event;
+			
+		_mCE= frame.document.getElementById(elem_id);
+		_mCE.frame=frame;
+		frame.document.onmousemove= move_element;
+		frame.document.onmouseup= end_move_element;
+		/*_mCE.onmousemove= move_element;
+		_mCE.onmouseup= end_move_element;*/
+		
+		//alert(_mCE.frame.document.body.offsetHeight);
+		
+		mouse_x= getMouseX(e);
+		mouse_y= getMouseY(e);
+		//window.status=frame+ " elem: "+elem_id+" elem: "+ _mCE + " mouse_x: "+mouse_x;
+		_mCE.start_pos_x = mouse_x - (_mCE.style.left.replace("px","") || calculeOffsetLeft(_mCE));
+		_mCE.start_pos_y = mouse_y - (_mCE.style.top.replace("px","") || calculeOffsetTop(_mCE));
+		return false;
+	};
+	
+	function end_move_element(e){
+		_mCE.frame.document.onmousemove= "";
+		_mCE.frame.document.onmouseup= "";		
+		_mCE=null;
+	};
+	
+	function move_element(e){
+		var newTop,newLeft,maxLeft;
+
+		if( _mCE.frame && _mCE.frame.event )
+			e=_mCE.frame.event;
+		newTop	= getMouseY(e) - _mCE.start_pos_y;
+		newLeft	= getMouseX(e) - _mCE.start_pos_x;
+		
+		maxLeft	= _mCE.frame.document.body.offsetWidth- _mCE.offsetWidth;
+		max_top	= _mCE.frame.document.body.offsetHeight- _mCE.offsetHeight;
+		newTop	= Math.min(Math.max(0, newTop), max_top);
+		newLeft	= Math.min(Math.max(0, newLeft), maxLeft);
+		
+		_mCE.style.top	= newTop+"px";
+		_mCE.style.left	= newLeft+"px";		
+		return false;
+	};
+	
+/***
+ * Managing a textarea (this part need the navigator infos from editAreaLoader
+ ***/ 
+	
+	var nav= editAreaLoader.nav;
+	
+	// allow to get infos on the selection: array(start, end)
+	function getSelectionRange(textarea){
+		return {"start": textarea.selectionStart, "end": textarea.selectionEnd};
+	};
+	
+	// allow to set the selection
+	function setSelectionRange(t, start, end){
+		t.focus();
+		
+		start	= Math.max(0, Math.min(t.value.length, start));
+		end		= Math.max(start, Math.min(t.value.length, end));
+	
+		if( this.isOpera && this.isOpera < 9.6 ){	// Opera bug when moving selection start and selection end
+			t.selectionEnd = 1;	
+			t.selectionStart = 0;			
+			t.selectionEnd = 1;	
+			t.selectionStart = 0;		
+		}
+		t.selectionStart	= start;
+		t.selectionEnd		= end;		
+		//textarea.setSelectionRange(start, end);
+		
+		if(isIE)
+			set_IE_selection(t);
+	};
+
+	
+	// set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd). should work as a repeated task
+	function get_IE_selection(t){
+		var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;
+		if(t && t.focused)
+		{	
+			if(!t.ea_line_height)
+			{	// calculate the lineHeight
+				div= d.createElement("div");
+				div.style.fontFamily= get_css_property(t, "font-family");
+				div.style.fontSize= get_css_property(t, "font-size");
+				div.style.visibility= "hidden";			
+				div.innerHTML="0";
+				d.body.appendChild(div);
+				t.ea_line_height= div.offsetHeight;
+				d.body.removeChild(div);
+			}
+			//t.focus();
+			range = d.selection.createRange();
+			try
+			{
+				stored_range = range.duplicate();
+				stored_range.moveToElementText( t );
+				stored_range.setEndPoint( 'EndToEnd', range );
+				if(stored_range.parentElement() == t){
+					// the range don't take care of empty lines in the end of the selection
+					elem		= t;
+					scrollTop	= 0;
+					while(elem.parentNode){
+						scrollTop+= elem.scrollTop;
+						elem	= elem.parentNode;
+					}
+				
+				//	var scrollTop= t.scrollTop + document.body.scrollTop;
+					
+				//	var relative_top= range.offsetTop - calculeOffsetTop(t) + scrollTop;
+					relative_top= range.offsetTop - calculeOffsetTop(t)+ scrollTop;
+				//	alert("rangeoffset: "+ range.offsetTop +"\ncalcoffsetTop: "+ calculeOffsetTop(t) +"\nrelativeTop: "+ relative_top);
+					line_start	= Math.round((relative_top / t.ea_line_height) +1);
+					
+					line_nb		= Math.round(range.boundingHeight / t.ea_line_height);
+					
+					range_start	= stored_range.text.length - range.text.length;
+					tab	= t.value.substr(0, range_start).split("\n");			
+					range_start	+= (line_start - tab.length)*2;		// add missing empty lines to the selection
+					t.selectionStart = range_start;
+					
+					range_end	= t.selectionStart + range.text.length;
+					tab	= t.value.substr(0, range_start + range.text.length).split("\n");			
+					range_end	+= (line_start + line_nb - 1 - tab.length)*2;
+					t.selectionEnd = range_end;
+				}
+			}
+			catch(e){}
+		}
+		setTimeout("get_IE_selection(document.getElementById('"+ t.id +"'));", 50);
+	};
+	
+	function IE_textarea_focus(){
+		event.srcElement.focused= true;
+	}
+	
+	function IE_textarea_blur(){
+		event.srcElement.focused= false;
+	}
+	
+	// select the text for IE (take into account the \r difference)
+	function set_IE_selection( t ){
+		var nbLineStart,nbLineStart,nbLineEnd,range;
+		if(!window.closed){ 
+			nbLineStart=t.value.substr(0, t.selectionStart).split("\n").length - 1;
+			nbLineEnd=t.value.substr(0, t.selectionEnd).split("\n").length - 1;
+			try
+			{
+				range = document.selection.createRange();
+				range.moveToElementText( t );
+				range.setEndPoint( 'EndToStart', range );
+				range.moveStart('character', t.selectionStart - nbLineStart);
+				range.moveEnd('character', t.selectionEnd - nbLineEnd - (t.selectionStart - nbLineStart)  );
+				range.select();
+			}
+			catch(e){}
+		}
+	};
+	
+	
+	editAreaLoader.waiting_loading["elements_functions.js"]= "loaded";

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/highlight.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/highlight.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/highlight.js
new file mode 100644
index 0000000..fbfbc00
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/highlight.js
@@ -0,0 +1,391 @@
+	// change_to: "on" or "off"
+	EditArea.prototype.change_highlight= function(change_to){
+		if(this.settings["syntax"].length==0 && change_to==false){
+			this.switchClassSticky(_$("highlight"), 'editAreaButtonDisabled', true);
+			this.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
+			return false;
+		}
+		
+		if(this.do_highlight==change_to)
+			return false;
+	
+			
+		this.getIESelection();
+		var pos_start= this.textarea.selectionStart;
+		var pos_end= this.textarea.selectionEnd;
+		
+		if(this.do_highlight===true || change_to==false)
+			this.disable_highlight();
+		else
+			this.enable_highlight();
+		this.textarea.focus();
+		this.textarea.selectionStart = pos_start;
+		this.textarea.selectionEnd = pos_end;
+		this.setIESelection();
+				
+	};
+	
+	EditArea.prototype.disable_highlight= function(displayOnly){
+		var t= this, a=t.textarea, new_Obj, old_class, new_class;
+			
+		t.selection_field.innerHTML="";
+		t.selection_field_text.innerHTML="";
+		t.content_highlight.style.visibility="hidden";
+		// replacing the node is far more faster than deleting it's content in firefox
+		new_Obj= t.content_highlight.cloneNode(false);
+		new_Obj.innerHTML= "";			
+		t.content_highlight.parentNode.insertBefore(new_Obj, t.content_highlight);
+		t.content_highlight.parentNode.removeChild(t.content_highlight);	
+		t.content_highlight= new_Obj;
+		old_class= parent.getAttribute( a,"class" );
+		if(old_class){
+			new_class= old_class.replace( "hidden","" );
+			parent.setAttribute( a, "class", new_class );
+		}
+	
+		a.style.backgroundColor="transparent";	// needed in order to see the bracket finders
+		
+		//var icon= document.getElementById("highlight");
+		//setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );
+		//t.restoreClass(icon);
+		//t.switchClass(icon,'editAreaButtonNormal');
+		t.switchClassSticky(_$("highlight"), 'editAreaButtonNormal', true);
+		t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
+	
+		t.do_highlight=false;
+	
+		t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonSelected', true);
+		if(typeof(t.smooth_selection_before_highlight)!="undefined" && t.smooth_selection_before_highlight===false){
+			t.change_smooth_selection_mode(false);
+		}
+		
+	//	this.textarea.style.backgroundColor="#FFFFFF";
+	};
+
+	EditArea.prototype.enable_highlight= function(){
+		var t=this, a=t.textarea, new_class;
+		t.show_waiting_screen();
+			
+		t.content_highlight.style.visibility="visible";
+		new_class	=parent.getAttribute(a,"class")+" hidden";
+		parent.setAttribute( a, "class", new_class );
+		
+		// IE can't manage mouse click outside text range without this
+		if( t.isIE )
+			a.style.backgroundColor="#FFFFFF";	
+
+		t.switchClassSticky(_$("highlight"), 'editAreaButtonSelected', false);
+		t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonNormal', false);
+		
+		t.smooth_selection_before_highlight=t.smooth_selection;
+		if(!t.smooth_selection)
+			t.change_smooth_selection_mode(true);
+		t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonDisabled', true);
+		
+		
+		t.do_highlight=true;
+		t.resync_highlight();
+					
+		t.hide_waiting_screen();	
+	};
+	
+	/**
+	 * Ask to update highlighted text
+	 * @param Array infos - Array of datas returned by EditArea.get_selection_infos()
+	 */
+	EditArea.prototype.maj_highlight= function(infos){
+		// for speed mesure
+		var debug_opti="",tps_start= new Date().getTime(), tps_middle_opti=new Date().getTime();
+		var t=this, hightlighted_text, updated_highlight;	
+		var textToHighlight=infos["full_text"], doSyntaxOpti = false, doHtmlOpti = false, stay_begin="", stay_end="", trace_new , trace_last;
+		
+		if(t.last_text_to_highlight==infos["full_text"] && t.resync_highlight!==true)
+			return;
+					
+		//  OPTIMISATION: will search to update only changed lines
+		if(t.reload_highlight===true){
+			t.reload_highlight=false;
+		}else if(textToHighlight.length==0){
+			textToHighlight="\n ";
+		}else{
+			// get text change datas
+			changes = t.checkTextEvolution(t.last_text_to_highlight,textToHighlight);
+			
+			// check if it can only reparse the changed text
+			trace_new		= t.get_syntax_trace(changes.newTextLine).replace(/\r/g, '');
+			trace_last		= t.get_syntax_trace(changes.lastTextLine).replace(/\r/g, '');
+			doSyntaxOpti	= ( trace_new == trace_last );
+			
+			// check if the difference comes only from a new line created 
+			// => we have to remember that the editor can automaticaly add tabulation or space after the new line) 
+			if( !doSyntaxOpti && trace_new == "\n"+trace_last && /^[ \t\s]*\n[ \t\s]*$/.test( changes.newText.replace(/\r/g, '') ) && changes.lastText =="" )
+			{
+				doSyntaxOpti	= true;
+			}
+			
+			// we do the syntax optimisation
+			if( doSyntaxOpti ){
+						
+				tps_middle_opti=new Date().getTime();	
+			
+				stay_begin= t.last_hightlighted_text.split("\n").slice(0, changes.lineStart).join("\n");
+				if(changes.lineStart>0)
+					stay_begin+= "\n";
+				stay_end= t.last_hightlighted_text.split("\n").slice(changes.lineLastEnd+1).join("\n");
+				if(stay_end.length>0)
+					stay_end= "\n"+stay_end;
+					
+				// Final check to see that we're not in the middle of span tags
+				if( stay_begin.split('<span').length != stay_begin.split('</span').length 
+					|| stay_end.split('<span').length != stay_end.split('</span').length )
+				{
+					doSyntaxOpti	= false;
+					stay_end		= '';
+					stay_begin		= '';
+				}
+				else
+				{
+					if(stay_begin.length==0 && changes.posLastEnd==-1)
+						changes.newTextLine+="\n";
+					textToHighlight=changes.newTextLine;
+				}
+			}
+			if(t.settings["debug"]){
+				var ch =changes;
+				debug_opti= ( doSyntaxOpti?"Optimisation": "No optimisation" )
+					+" start: "+ch.posStart +"("+ch.lineStart+")"
+					+" end_new: "+ ch.posNewEnd+"("+ch.lineNewEnd+")"
+					+" end_last: "+ ch.posLastEnd+"("+ch.lineLastEnd+")"
+					+"\nchanged_text: "+ch.newText+" => trace: "+trace_new
+					+"\nchanged_last_text: "+ch.lastText+" => trace: "+trace_last
+					//debug_opti+= "\nchanged: "+ infos["full_text"].substring(ch.posStart, ch.posNewEnd);
+					+ "\nchanged_line: "+ch.newTextLine
+					+ "\nlast_changed_line: "+ch.lastTextLine
+					+"\nstay_begin: "+ stay_begin.slice(-100)
+					+"\nstay_end: "+ stay_end.substr( 0, 100 );
+					//debug_opti="start: "+stay_begin_len+ "("+nb_line_start_unchanged+") end: "+ (stay_end_len)+ "("+(splited.length-nb_line_end_unchanged)+") ";
+					//debug_opti+="changed: "+ textToHighlight.substring(stay_begin_len, textToHighlight.length-stay_end_len)+" \n";
+					
+					//debug_opti+="changed: "+ stay_begin.substr(stay_begin.length-200)+ "----------"+ textToHighlight+"------------------"+ stay_end.substr(0,200) +"\n";
+					+"\n";
+			}
+	
+			
+			// END OPTIMISATION
+		}
+
+		tps_end_opti	= new Date().getTime();	
+				
+		// apply highlight
+		updated_highlight	= t.colorize_text(textToHighlight);
+		tpsAfterReg			= new Date().getTime();
+		
+		/***
+		 * see if we can optimize for updating only the required part of the HTML code
+		 * 
+		 * The goal here will be to find the text node concerned by the modification and to update it
+		 */
+		//-------------------------------------------
+		// 
+		if( doSyntaxOpti )
+		{
+			try
+			{
+				var replacedBloc, i, nbStart = '', nbEnd = '', newHtml, lengthOld, lengthNew;
+				replacedBloc		= t.last_hightlighted_text.substring( stay_begin.length, t.last_hightlighted_text.length - stay_end.length );
+				
+				lengthOld	= replacedBloc.length;
+				lengthNew	= updated_highlight.length;
+				
+				// find the identical caracters at the beginning
+				for( i=0; i < lengthOld && i < lengthNew && replacedBloc.charAt(i) == updated_highlight.charAt(i) ; i++ )
+				{
+				}
+				nbStart = i;
+				// find the identical caracters at the end
+				for( i=0; i + nbStart < lengthOld && i + nbStart < lengthNew && replacedBloc.charAt(lengthOld-i-1) == updated_highlight.charAt(lengthNew-i-1) ; i++ )
+				{
+				}
+				nbEnd	= i;
+				
+				// get the changes
+				lastHtml	= replacedBloc.substring( nbStart, lengthOld - nbEnd );
+				newHtml		= updated_highlight.substring( nbStart, lengthNew - nbEnd );
+				
+				
+				// We can do the optimisation only if we havn't touch to span elements
+				if( newHtml.indexOf('<span') == -1 && newHtml.indexOf('</span') == -1 
+					&& lastHtml.indexOf('<span') == -1 && lastHtml.indexOf('</span') == -1 )
+				{
+					var beginStr, nbOpendedSpan, nbClosedSpan, nbUnchangedChars, span, textNode;
+					doHtmlOpti		= true;
+					beginStr		= t.last_hightlighted_text.substr( 0, stay_begin.length + nbStart );
+			
+					nbOpendedSpan	= beginStr.split('<span').length - 1;
+					nbClosedSpan	= beginStr.split('</span').length - 1;
+					// retrieve the previously opened span (Add 1 for the first level span?)
+					span 			= t.content_highlight.getElementsByTagName('span')[ nbOpendedSpan ];
+					
+					//--------[
+					// get the textNode to update
+					
+					// if we're inside a span, we'll take the one that is opened (can be a parent of the current span)
+					parentSpan		= span;
+					maxStartOffset	= maxEndOffset = 0;
+					
+					// it will be in the child of the root node 
+					if( nbOpendedSpan == nbClosedSpan )
+					{
+						while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' )
+						{
+							parentSpan	= parentSpan.parentNode;
+						}
+					}
+					// get the last opened span
+					else
+					{
+						maxStartOffset	= maxEndOffset = beginStr.length + 1;
+						// move to parent node for each closed span found after the lastest open span
+						nbClosed = beginStr.substr( Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ).split('</span').length - 1;
+						while( nbClosed > 0 )
+						{
+							nbClosed--;
+							parentSpan = parentSpan.parentNode;
+						}
+						
+						// find the position of the last opended tag
+						while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' && ( tmpMaxStartOffset = Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ) < ( tmpMaxEndOffset = Math.max( 0, beginStr.lastIndexOf( '</span', maxEndOffset - 1 ) ) ) )
+						{
+							maxStartOffset	= tmpMaxStartOffset;
+							maxEndOffset	= tmpMaxEndOffset;
+						}
+					}
+					// Note: maxEndOffset is no more used but maxStartOffset will be used
+					
+					if( parentSpan.parentNode == t.content_highlight || parentSpan.parentNode.tagName == 'PRE' )
+					{
+						maxStartOffset	= Math.max( 0, beginStr.indexOf( '<span' ) );
+					}
+					
+					// find the matching text node (this will be one that will be at the end of the beginStr
+					if( maxStartOffset == beginStr.length )
+					{
+						nbSubSpanBefore	= 0;
+					}
+					else
+					{
+						lastEndPos 				= Math.max( 0, beginStr.lastIndexOf( '>', maxStartOffset ) );
+		
+						// count the number of sub spans
+						nbSubSpanBefore			= beginStr.substr( lastEndPos ).split('<span').length-1;
+					}
+					
+					// there is no sub-span before
+					if( nbSubSpanBefore == 0 )
+					{
+						textNode	= parentSpan.firstChild;
+					}
+					// we need to find where is the text node modified
+					else
+					{
+						// take the last direct child (no sub-child)
+						lastSubSpan	= parentSpan.getElementsByTagName('span')[ nbSubSpanBefore - 1 ];
+						while( lastSubSpan.parentNode != parentSpan )
+						{
+							lastSubSpan	= lastSubSpan.parentNode;
+						}
+
+						// associate to next text node following the last sub span
+						if( lastSubSpan.nextSibling == null || lastSubSpan.nextSibling.nodeType != 3 )
+						{
+							textNode	= document.createTextNode('');
+							lastSubSpan.parentNode.insertBefore( textNode, lastSubSpan.nextSibling );
+						}
+						else
+						{
+							textNode	= lastSubSpan.nextSibling;
+						}
+					}
+					//--------]
+					
+					
+					//--------[
+					// update the textNode content
+					
+					// number of caracters after the last opened of closed span
+					nbUnchangedChars = beginStr.length - Math.max( 0, beginStr.lastIndexOf( '>' ) + 1 );
+					
+					//	console.log( span, textNode, nbOpendedSpan,nbClosedSpan,  span.nextSibling, textNode.length, nbUnchangedChars, lastHtml, lastHtml.length, newHtml, newHtml.length );
+					//	alert( textNode.parentNode.className +'-'+ textNode.parentNode.tagName+"\n"+ textNode.data +"\n"+ nbUnchangedChars +"\n"+ lastHtml.length +"\n"+ newHtml +"\n"+ newHtml.length  );
+					
+					// IE only manage \r for cariage return in textNode and not \n or \r\n
+					if( t.isIE )
+					{
+						nbUnchangedChars	-= ( beginStr.substr( beginStr.length - nbUnchangedChars ).split("\n").length - 1 );
+						//alert( textNode.data.replace(/\r/g, '_r').replace(/\n/g, '_n')); 
+						textNode.replaceData( nbUnchangedChars, lastHtml.replace(/\n/g, '').length, newHtml.replace(/\n/g, '') );
+					}
+					else
+					{
+						textNode.replaceData( nbUnchangedChars, lastHtml.length, newHtml );
+					}
+					//--------]
+				}
+			}
+			// an exception shouldn't occured but if replaceData failed at least it won't break everything
+			catch( e )
+			{
+		//		throw e;
+		//		console.log( e );
+				doHtmlOpti	= false;
+			}
+			
+		}
+		/*** END HTML update's optimisation ***/
+		// end test
+		
+	//			console.log(  (TPS6-TPS5), (TPS5-TPS4), (TPS4-TPS3), (TPS3-TPS2), (TPS2-TPS1), _CPT );
+		// get the new highlight content
+		tpsAfterOpti2		= new Date().getTime();
+		hightlighted_text	= stay_begin + updated_highlight + stay_end;
+		if( !doHtmlOpti )
+		{
+			// update the content of the highlight div by first updating a clone node (as there is no display in the same time for t node it's quite faster (5*))
+			var new_Obj= t.content_highlight.cloneNode(false);
+			if( ( t.isIE && t.isIE < 8 ) || ( t.isOpera && t.isOpera < 9.6 ) )
+				new_Obj.innerHTML= "<pre><span class='"+ t.settings["syntax"] +"'>" + hightlighted_text + "</span></pre>";	
+			else
+				new_Obj.innerHTML= "<span class='"+ t.settings["syntax"] +"'>"+ hightlighted_text +"</span>";
+	
+			t.content_highlight.parentNode.replaceChild(new_Obj, t.content_highlight);
+		
+			t.content_highlight= new_Obj;
+		}
+		
+		t.last_text_to_highlight= infos["full_text"];
+		t.last_hightlighted_text= hightlighted_text;
+		
+		tps3=new Date().getTime();
+	
+		if(t.settings["debug"]){
+			//lineNumber=tab_text.length;
+			//t.debug.value+=" \nNB char: "+_$("src").value.length+" Nb line: "+ lineNumber;
+		
+			t.debug.value= "Tps optimisation "+(tps_end_opti-tps_start)
+				+" | tps reg exp: "+ (tpsAfterReg-tps_end_opti)
+				+" | tps opti HTML : "+ (tpsAfterOpti2-tpsAfterReg) + ' '+ ( doHtmlOpti ? 'yes' : 'no' )
+				+" | tps update highlight content: "+ (tps3-tpsAfterOpti2)
+				+" | tpsTotal: "+ (tps3-tps_start)
+				+ "("+tps3+")\n"+ debug_opti;
+		//	t.debug.value+= "highlight\n"+hightlighted_text;*/
+		}
+		
+	};
+	
+	EditArea.prototype.resync_highlight= function(reload_now){
+		this.reload_highlight=true;
+		this.last_text_to_highlight="";
+		this.focus();		
+		if(reload_now)
+			this.check_line_selection(false); 
+	};	

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/autocompletion.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/autocompletion.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/autocompletion.gif
new file mode 100644
index 0000000..f3dfc2e
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/autocompletion.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/close.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/close.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/close.gif
new file mode 100644
index 0000000..679ca2a
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/close.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/fullscreen.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/fullscreen.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/fullscreen.gif
new file mode 100644
index 0000000..66fa6d9
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/fullscreen.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/go_to_line.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/go_to_line.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/go_to_line.gif
new file mode 100644
index 0000000..06042ec
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/go_to_line.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/help.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/help.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/help.gif
new file mode 100644
index 0000000..51a1ee4
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/help.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/highlight.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/highlight.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/highlight.gif
new file mode 100644
index 0000000..16491f6
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/highlight.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/load.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/load.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/load.gif
new file mode 100644
index 0000000..461698f
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/load.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/move.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/move.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/move.gif
new file mode 100644
index 0000000..d15f9f5
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/move.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/newdocument.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/newdocument.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/newdocument.gif
new file mode 100644
index 0000000..a9d2938
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/newdocument.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/opacity.png
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/opacity.png b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/opacity.png
new file mode 100644
index 0000000..b4217cb
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/opacity.png differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/processing.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/processing.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/processing.gif
new file mode 100644
index 0000000..cce32f2
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/processing.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/redo.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/redo.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/redo.gif
new file mode 100644
index 0000000..3af9069
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/redo.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/reset_highlight.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/reset_highlight.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/reset_highlight.gif
new file mode 100644
index 0000000..0fa3cb7
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/reset_highlight.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/save.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/save.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/save.gif
new file mode 100644
index 0000000..2777beb
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/save.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/search.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/search.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/search.gif
new file mode 100644
index 0000000..cfe76b5
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/search.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/smooth_selection.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/smooth_selection.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/smooth_selection.gif
new file mode 100644
index 0000000..8a532e5
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/smooth_selection.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/spacer.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/spacer.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/spacer.gif
new file mode 100644
index 0000000..3884865
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/spacer.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/statusbar_resize.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/statusbar_resize.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/statusbar_resize.gif
new file mode 100644
index 0000000..af89d80
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/statusbar_resize.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/undo.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/undo.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/undo.gif
new file mode 100644
index 0000000..520796d
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/undo.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/word_wrap.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/word_wrap.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/word_wrap.gif
new file mode 100644
index 0000000..8f256cc
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/word_wrap.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/keyboard.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/keyboard.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/keyboard.js
new file mode 100644
index 0000000..71b3a7c
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/keyboard.js
@@ -0,0 +1,145 @@
+var EA_keys = {8:"Retour arriere",9:"Tabulation",12:"Milieu (pave numerique)",13:"Entrer",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"Verr Maj",27:"Esc",32:"Space",33:"Page up",34:"Page down",35:"End",36:"Begin",37:"Left",38:"Up",39:"Right",40:"Down",44:"Impr ecran",45:"Inser",46:"Suppr",91:"Menu Demarrer Windows / touche pomme Mac",92:"Menu Demarrer Windows",93:"Menu contextuel Windows",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Verr Num",145:"Arret defil"};
+
+
+
+function keyDown(e){
+	if(!e){	// if IE
+		e=event;
+	}
+	
+	// send the event to the plugins
+	for(var i in editArea.plugins){
+		if(typeof(editArea.plugins[i].onkeydown)=="function"){
+			if(editArea.plugins[i].onkeydown(e)===false){ // stop propaging
+				if(editArea.isIE)
+					e.keyCode=0;
+				return false;
+			}
+		}
+	}
+
+	var target_id=(e.target || e.srcElement).id;
+	var use=false;
+	if (EA_keys[e.keyCode])
+		letter=EA_keys[e.keyCode];
+	else
+		letter=String.fromCharCode(e.keyCode);
+	
+	var low_letter= letter.toLowerCase();
+			
+	if(letter=="Page up" && !editArea.isOpera){
+		editArea.execCommand("scroll_page", {"dir": "up", "shift": ShiftPressed(e)});
+		use=true;
+	}else if(letter=="Page down" && !editArea.isOpera){
+		editArea.execCommand("scroll_page", {"dir": "down", "shift": ShiftPressed(e)});
+		use=true;
+	}else if(editArea.is_editable==false){
+		// do nothing but also do nothing else (allow to navigate with page up and page down)
+		return true;
+	}else if(letter=="Tabulation" && target_id=="textarea" && !CtrlPressed(e) && !AltPressed(e)){	
+		if(ShiftPressed(e))
+			editArea.execCommand("invert_tab_selection");
+		else
+			editArea.execCommand("tab_selection");
+		
+		use=true;
+		if(editArea.isOpera || (editArea.isFirefox && editArea.isMac) )	// opera && firefox mac can't cancel tabulation events...
+			setTimeout("editArea.execCommand('focus');", 1);
+	}else if(letter=="Entrer" && target_id=="textarea"){
+		if(editArea.press_enter())
+			use=true;
+	}else if(letter=="Entrer" && target_id=="area_search"){
+		editArea.execCommand("area_search");
+		use=true;
+	}else  if(letter=="Esc"){
+		editArea.execCommand("close_all_inline_popup", e);
+		use=true;
+	}else if(CtrlPressed(e) && !AltPressed(e) && !ShiftPressed(e)){
+		switch(low_letter){
+			case "f":				
+				editArea.execCommand("area_search");
+				use=true;
+				break;
+			case "r":
+				editArea.execCommand("area_replace");
+				use=true;
+				break;
+			case "q":
+				editArea.execCommand("close_all_inline_popup", e);
+				use=true;
+				break;
+			case "h":
+				editArea.execCommand("change_highlight");			
+				use=true;
+				break;
+			case "g":
+				setTimeout("editArea.execCommand('go_to_line');", 5);	// the prompt stop the return false otherwise
+				use=true;
+				break;
+			case "e":
+				editArea.execCommand("show_help");
+				use=true;
+				break;
+			case "z":
+				use=true;
+				editArea.execCommand("undo");
+				break;
+			case "y":
+				use=true;
+				editArea.execCommand("redo");
+				break;
+			default:
+				break;			
+		}		
+	}		
+	
+	// check to disable the redo possibility if the textarea content change
+	if(editArea.next.length > 0){
+		setTimeout("editArea.check_redo();", 10);
+	}
+	
+	setTimeout("editArea.check_file_changes();", 10);
+	
+	
+	if(use){
+		// in case of a control that sould'nt be used by IE but that is used => THROW a javascript error that will stop key action
+		if(editArea.isIE)
+			e.keyCode=0;
+		return false;
+	}
+	//alert("Test: "+ letter + " ("+e.keyCode+") ALT: "+ AltPressed(e) + " CTRL "+ CtrlPressed(e) + " SHIFT "+ ShiftPressed(e));
+	
+	return true;
+	
+};
+
+
+// return true if Alt key is pressed
+function AltPressed(e) {
+	if (window.event) {
+		return (window.event.altKey);
+	} else {
+		if(e.modifiers)
+			return (e.altKey || (e.modifiers % 2));
+		else
+			return e.altKey;
+	}
+};
+
+// return true if Ctrl key is pressed
+function CtrlPressed(e) {
+	if (window.event) {
+		return (window.event.ctrlKey);
+	} else {
+		return (e.ctrlKey || (e.modifiers==2) || (e.modifiers==3) || (e.modifiers>5));
+	}
+};
+
+// return true if Shift key is pressed
+function ShiftPressed(e) {
+	if (window.event) {
+		return (window.event.shiftKey);
+	} else {
+		return (e.shiftKey || (e.modifiers>3));
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/langs/en.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/langs/en.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/langs/en.js
new file mode 100644
index 0000000..1ec2561
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/langs/en.js
@@ -0,0 +1,67 @@
+editAreaLoader.lang["en"]={
+new_document: "new empty document",
+search_button: "search and replace",
+search_command: "search next / open search area",
+search: "search",
+replace: "replace",
+replace_command: "replace / open search area",
+find_next: "find next",
+replace_all: "replace all",
+reg_exp: "regular expressions",
+match_case: "match case",
+not_found: "not found.",
+occurrence_replaced: "occurences replaced.",
+search_field_empty: "Search field empty",
+restart_search_at_begin: "End of area reached. Restart at begin.",
+move_popup: "move search popup",
+font_size: "--Font size--",
+go_to_line: "go to line",
+go_to_line_prompt: "go to line number:",
+undo: "undo",
+redo: "redo",
+change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
+highlight: "toggle syntax highlight on/off",
+reset_highlight: "reset highlight (if desyncronized from text)",
+word_wrap: "toggle word wrapping mode",
+help: "about",
+save: "save",
+load: "load",
+line_abbr: "Ln",
+char_abbr: "Ch",
+position: "Position",
+total: "Total",
+close_popup: "close popup",
+shortcuts: "Shortcuts",
+add_tab: "add tabulation to text",
+remove_tab: "remove tabulation to text",
+about_notice: "Notice: syntax highlight function is only for small text",
+toggle: "Toggle editor",
+accesskey: "Accesskey",
+tab: "Tab",
+shift: "Shift",
+ctrl: "Ctrl",
+esc: "Esc",
+processing: "Processing...",
+fullscreen: "fullscreen",
+syntax_selection: "--Syntax--",
+syntax_css: "CSS",
+syntax_html: "HTML",
+syntax_js: "Javascript",
+syntax_php: "Php",
+syntax_python: "Python",
+syntax_vb: "Visual Basic",
+syntax_xml: "Xml",
+syntax_c: "C",
+syntax_cpp: "CPP",
+syntax_basic: "Basic",
+syntax_pas: "Pascal",
+syntax_brainfuck: "Brainfuck",
+syntax_sql: "SQL",
+syntax_ruby: "Ruby",
+syntax_robotstxt: "Robots txt",
+syntax_tsql: "T-SQL",
+syntax_perl: "Perl",
+syntax_coldfusion: "Coldfusion",
+syntax_java: "Java",
+close_tab: "Close file"
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_apache.txt
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_apache.txt b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_apache.txt
new file mode 100644
index 0000000..c7ef5e6
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_apache.txt
@@ -0,0 +1,7 @@
+Copyright 2008 Christophe Dolivet
+
+Licensed 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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_bsd.txt
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_bsd.txt b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_bsd.txt
new file mode 100644
index 0000000..f36bbe4
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_bsd.txt
@@ -0,0 +1,10 @@
+Copyright (c) 2008, Christophe Dolivet
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    * Neither the name of EditArea nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_lgpl.txt
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_lgpl.txt b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_lgpl.txt
new file mode 100644
index 0000000..8c177f8
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_lgpl.txt
@@ -0,0 +1,458 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS


[06/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/manage_area.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/manage_area.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/manage_area.js
deleted file mode 100644
index e10c5e9..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/manage_area.js
+++ /dev/null
@@ -1,623 +0,0 @@
-	EditArea.prototype.focus = function() {
-		this.textarea.focus();
-		this.textareaFocused=true;
-	};
-
-
-	EditArea.prototype.check_line_selection= function(timer_checkup){
-		var changes, infos, new_top, new_width,i;
-		
-		var t1=t2=t2_1=t3=tLines=tend= new Date().getTime();
-		// l'editeur n'existe plus => on quitte
-		if(!editAreas[this.id])
-			return false;
-		
-		if(!this.smooth_selection && !this.do_highlight)
-		{
-			//do nothing
-		}
-		else if(this.textareaFocused && editAreas[this.id]["displayed"]==true && this.isResizing==false)
-		{
-			infos	= this.get_selection_infos();
-			changes	= this.checkTextEvolution( typeof( this.last_selection['full_text'] ) == 'undefined' ? '' : this.last_selection['full_text'], infos['full_text'] );
-		
-			t2= new Date().getTime();
-			
-			// if selection change
-			if(this.last_selection["line_start"] != infos["line_start"] || this.last_selection["line_nb"] != infos["line_nb"] || infos["full_text"] != this.last_selection["full_text"] || this.reload_highlight || this.last_selection["selectionStart"] != infos["selectionStart"] || this.last_selection["selectionEnd"] != infos["selectionEnd"] || !timer_checkup )
-			{
-				// move and adjust text selection elements
-				new_top		= this.getLinePosTop( infos["line_start"] );
-				new_width	= Math.max(this.textarea.scrollWidth, this.container.clientWidth -50);
-				this.selection_field.style.top=this.selection_field_text.style.top=new_top+"px";
-				if(!this.settings['word_wrap']){	
-					this.selection_field.style.width=this.selection_field_text.style.width=this.test_font_size.style.width=new_width+"px";
-				}
-				
-				// usefull? => _$("cursor_pos").style.top=new_top+"px";	
-		
-				if(this.do_highlight==true)
-				{
-					// fill selection elements
-					var curr_text	= infos["full_text"].split("\n");
-					var content		= "";
-					//alert("length: "+curr_text.length+ " i: "+ Math.max(0,infos["line_start"]-1)+ " end: "+Math.min(curr_text.length, infos["line_start"]+infos["line_nb"]-1)+ " line: "+infos["line_start"]+" [0]: "+curr_text[0]+" [1]: "+curr_text[1]);
-					var start		= Math.max(0,infos["line_start"]-1);
-					var end			= Math.min(curr_text.length, infos["line_start"]+infos["line_nb"]-1);
-					
-					//curr_text[start]= curr_text[start].substr(0,infos["curr_pos"]-1) +"¤_overline_¤"+ curr_text[start].substr(infos["curr_pos"]-1);
-					for(i=start; i< end; i++){
-						content+= curr_text[i]+"\n";	
-					}
-					
-					// add special chars arround selected characters
-					selLength	= infos['selectionEnd'] - infos['selectionStart'];
-					content		= content.substr( 0, infos["curr_pos"] - 1 ) + "\r\r" + content.substr( infos["curr_pos"] - 1, selLength ) + "\r\r" + content.substr( infos["curr_pos"] - 1 + selLength );
-					content		= '<span>'+ content.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace("\r\r", '</span><strong>').replace("\r\r", '</strong><span>') +'</span>';
-					
-					if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
-						this.selection_field.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
-					} else {
-						this.selection_field.innerHTML= content;
-					}
-					this.selection_field_text.innerHTML = this.selection_field.innerHTML;
-					t2_1 = new Date().getTime();
-					// check if we need to update the highlighted background 
-					if(this.reload_highlight || (infos["full_text"] != this.last_text_to_highlight && (this.last_selection["line_start"]!=infos["line_start"] || this.show_line_colors || this.settings['word_wrap'] || this.last_selection["line_nb"]!=infos["line_nb"] || this.last_selection["nb_line"]!=infos["nb_line"]) ) )
-					{
-						this.maj_highlight(infos);
-					}
-				}		
-			}
-			t3= new Date().getTime();
-			
-			// manage line heights
-			if( this.settings['word_wrap'] && infos["full_text"] != this.last_selection["full_text"])
-			{
-				// refresh only 1 line if text change concern only one line and that the total line number has not changed
-				if( changes.newText.split("\n").length == 1 && this.last_selection['nb_line'] && infos['nb_line'] == this.last_selection['nb_line'] )
-				{
-					this.fixLinesHeight( infos['full_text'], changes.lineStart, changes.lineStart );
-				}
-				else
-				{
-					this.fixLinesHeight( infos['full_text'], changes.lineStart, -1 );
-				}
-			}
-		
-			tLines= new Date().getTime();
-			// manage bracket finding
-			if( infos["line_start"] != this.last_selection["line_start"] || infos["curr_pos"] != this.last_selection["curr_pos"] || infos["full_text"].length!=this.last_selection["full_text"].length || this.reload_highlight || !timer_checkup )
-			{
-				// move _cursor_pos
-				var selec_char= infos["curr_line"].charAt(infos["curr_pos"]-1);
-				var no_real_move=true;
-				if(infos["line_nb"]==1 && (this.assocBracket[selec_char] || this.revertAssocBracket[selec_char]) ){
-					
-					no_real_move=false;					
-					//findEndBracket(infos["line_start"], infos["curr_pos"], selec_char);
-					if(this.findEndBracket(infos, selec_char) === true){
-						_$("end_bracket").style.visibility	="visible";
-						_$("cursor_pos").style.visibility	="visible";
-						_$("cursor_pos").innerHTML			= selec_char;
-						_$("end_bracket").innerHTML			= (this.assocBracket[selec_char] || this.revertAssocBracket[selec_char]);
-					}else{
-						_$("end_bracket").style.visibility	="hidden";
-						_$("cursor_pos").style.visibility	="hidden";
-					}
-				}else{
-					_$("cursor_pos").style.visibility	="hidden";
-					_$("end_bracket").style.visibility	="hidden";
-				}
-				//alert("move cursor");
-				this.displayToCursorPosition("cursor_pos", infos["line_start"], infos["curr_pos"]-1, infos["curr_line"], no_real_move);
-				if(infos["line_nb"]==1 && infos["line_start"]!=this.last_selection["line_start"])
-					this.scroll_to_view();
-			}
-			this.last_selection=infos;
-		}
-		
-		tend= new Date().getTime();
-		//if( (tend-t1) > 7 )
-		//	console.log( "tps total: "+ (tend-t1) + " tps get_infos: "+ (t2-t1)+ " tps selec: "+ (t2_1-t2)+ " tps highlight: "+ (t3-t2_1) +" tps lines: "+ (tLines-t3) +" tps cursor+lines: "+ (tend-tLines)+" \n" );
-		
-		
-		if(timer_checkup){
-			setTimeout("editArea.check_line_selection(true)", this.check_line_selection_timer);
-		}
-	};
-
-
-	EditArea.prototype.get_selection_infos= function(){
-		var sel={}, start, end, len, str;
-	
-		this.getIESelection();
-		start	= this.textarea.selectionStart;
-		end		= this.textarea.selectionEnd;		
-		
-		if( this.last_selection["selectionStart"] == start && this.last_selection["selectionEnd"] == end && this.last_selection["full_text"] == this.textarea.value )
-		{	
-			return this.last_selection;
-		}
-			
-		if(this.tabulation!="\t" && this.textarea.value.indexOf("\t")!=-1) 
-		{	// can append only after copy/paste 
-			len		= this.textarea.value.length;
-			this.textarea.value	= this.replace_tab(this.textarea.value);
-			start	= end	= start+(this.textarea.value.length-len);
-			this.area_select( start, 0 );
-		}
-		
-		sel["selectionStart"]	= start;
-		sel["selectionEnd"]		= end;		
-		sel["full_text"]		= this.textarea.value;
-		sel["line_start"]		= 1;
-		sel["line_nb"]			= 1;
-		sel["curr_pos"]			= 0;
-		sel["curr_line"]		= "";
-		sel["indexOfCursor"]	= 0;
-		sel["selec_direction"]	= this.last_selection["selec_direction"];
-
-		//return sel;	
-		var splitTab= sel["full_text"].split("\n");
-		var nbLine	= Math.max(0, splitTab.length);		
-		var nbChar	= Math.max(0, sel["full_text"].length - (nbLine - 1));	// (remove \n caracters from the count)
-		if( sel["full_text"].indexOf("\r") != -1 )
-			nbChar	= nbChar - ( nbLine - 1 );		// (remove \r caracters from the count)
-		sel["nb_line"]	= nbLine;		
-		sel["nb_char"]	= nbChar;
-	
-		if(start>0){
-			str					= sel["full_text"].substr(0,start);
-			sel["curr_pos"]		= start - str.lastIndexOf("\n");
-			sel["line_start"]	= Math.max(1, str.split("\n").length);
-		}else{
-			sel["curr_pos"]=1;
-		}
-		if(end>start){
-			sel["line_nb"]=sel["full_text"].substring(start,end).split("\n").length;
-		}
-		sel["indexOfCursor"]=start;		
-		sel["curr_line"]=splitTab[Math.max(0,sel["line_start"]-1)];
-	
-		// determine in which direction the selection grow
-		if(sel["selectionStart"] == this.last_selection["selectionStart"]){
-			if(sel["selectionEnd"]>this.last_selection["selectionEnd"])
-				sel["selec_direction"]= "down";
-			else if(sel["selectionEnd"] == this.last_selection["selectionStart"])
-				sel["selec_direction"]= this.last_selection["selec_direction"];
-		}else if(sel["selectionStart"] == this.last_selection["selectionEnd"] && sel["selectionEnd"]>this.last_selection["selectionEnd"]){
-			sel["selec_direction"]= "down";
-		}else{
-			sel["selec_direction"]= "up";
-		}
-		
-		_$("nbLine").innerHTML	= nbLine;		
-		_$("nbChar").innerHTML	= nbChar;		
-		_$("linePos").innerHTML	= sel["line_start"];
-		_$("currPos").innerHTML	= sel["curr_pos"];
-
-		return sel;		
-	};
-	
-	// set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd)
-	EditArea.prototype.getIESelection= function(){
-		var selectionStart, selectionEnd, range, stored_range;
-		
-		if( !this.isIE )
-			return false;
-			
-		// make it work as nowrap mode (easier for range manipulation with lineHeight)
-		if( this.settings['word_wrap'] )
-			this.textarea.wrap='off';
-			
-		try{
-			range			= document.selection.createRange();
-			stored_range	= range.duplicate();
-			stored_range.moveToElementText( this.textarea );
-			stored_range.setEndPoint( 'EndToEnd', range );
-			if( stored_range.parentElement() != this.textarea )
-				throw "invalid focus";
-				
-			// the range don't take care of empty lines in the end of the selection
-			var scrollTop	= this.result.scrollTop + document.body.scrollTop;
-			var relative_top= range.offsetTop - parent.calculeOffsetTop(this.textarea) + scrollTop;
-			var line_start	= Math.round((relative_top / this.lineHeight) +1);
-			var line_nb		= Math.round( range.boundingHeight / this.lineHeight );
-						
-			selectionStart	= stored_range.text.length - range.text.length;		
-			selectionStart	+= ( line_start - this.textarea.value.substr(0, selectionStart).split("\n").length)*2;		// count missing empty \r to the selection
-			selectionStart	-= ( line_start - this.textarea.value.substr(0, selectionStart).split("\n").length ) * 2;
-			
-			selectionEnd	= selectionStart + range.text.length;		
-			selectionEnd	+= (line_start + line_nb - 1 - this.textarea.value.substr(0, selectionEnd ).split("\n").length)*2;			
-		
-			this.textarea.selectionStart	= selectionStart;
-			this.textarea.selectionEnd		= selectionEnd;
-		}
-		catch(e){}
-		
-		// restore wrap mode
-		if( this.settings['word_wrap'] )
-			this.textarea.wrap='soft';
-	};
-	
-	// select the text for IE (and take care of \r caracters)
-	EditArea.prototype.setIESelection= function(){
-		var a = this.textarea, nbLineStart, nbLineEnd, range;
-		
-		if( !this.isIE )
-			return false;
-		
-		nbLineStart	= a.value.substr(0, a.selectionStart).split("\n").length - 1;
-		nbLineEnd 	= a.value.substr(0, a.selectionEnd).split("\n").length - 1;
-		range		= document.selection.createRange();
-		range.moveToElementText( a );
-		range.setEndPoint( 'EndToStart', range );
-		
-		range.moveStart('character', a.selectionStart - nbLineStart);
-		range.moveEnd('character', a.selectionEnd - nbLineEnd - (a.selectionStart - nbLineStart)  );
-		range.select();
-	};
-	
-	
-	
-	EditArea.prototype.checkTextEvolution=function(lastText,newText){
-		// ch will contain changes datas
-		var ch={},baseStep=200, cpt=0, end, step,tStart=new Date().getTime();
-	
-		end		= Math.min(newText.length, lastText.length);
-        step	= baseStep;
-        // find how many chars are similar at the begin of the text						
-		while( cpt<end && step>=1 ){
-            if(lastText.substr(cpt, step) == newText.substr(cpt, step)){
-                cpt+= step;
-            }else{
-                step= Math.floor(step/2);
-            }
-		}
-		
-		ch.posStart	= cpt;
-		ch.lineStart= newText.substr(0, ch.posStart).split("\n").length -1;						
-		
-		cpt_last	= lastText.length;
-        cpt			= newText.length;
-        step		= baseStep;			
-        // find how many chars are similar at the end of the text						
-		while( cpt>=0 && cpt_last>=0 && step>=1 ){
-            if(lastText.substr(cpt_last-step, step) == newText.substr(cpt-step, step)){
-                cpt-= step;
-                cpt_last-= step;
-            }else{
-                step= Math.floor(step/2);
-            }
-		}
-		
-		ch.posNewEnd	= cpt;
-		ch.posLastEnd	= cpt_last;
-		if(ch.posNewEnd<=ch.posStart){
-			if(lastText.length < newText.length){
-				ch.posNewEnd= ch.posStart + newText.length - lastText.length;
-				ch.posLastEnd= ch.posStart;
-			}else{
-				ch.posLastEnd= ch.posStart + lastText.length - newText.length;
-				ch.posNewEnd= ch.posStart;
-			}
-		} 
-		ch.newText		= newText.substring(ch.posStart, ch.posNewEnd);
-		ch.lastText		= lastText.substring(ch.posStart, ch.posLastEnd);			            
-		
-		ch.lineNewEnd	= newText.substr(0, ch.posNewEnd).split("\n").length -1;
-		ch.lineLastEnd	= lastText.substr(0, ch.posLastEnd).split("\n").length -1;
-		
-		ch.newTextLine	= newText.split("\n").slice(ch.lineStart, ch.lineNewEnd+1).join("\n");
-		ch.lastTextLine	= lastText.split("\n").slice(ch.lineStart, ch.lineLastEnd+1).join("\n");
-		//console.log( ch );
-		return ch;	
-	};
-	
-	EditArea.prototype.tab_selection= function(){
-		if(this.is_tabbing)
-			return;
-		this.is_tabbing=true;
-		//infos=getSelectionInfos();
-		//if( document.selection ){
-		this.getIESelection();
-		/* Insertion du code de formatage */
-		var start = this.textarea.selectionStart;
-		var end = this.textarea.selectionEnd;
-		var insText = this.textarea.value.substring(start, end);
-		
-		/* Insert tabulation and ajust cursor position */
-		var pos_start=start;
-		var pos_end=end;
-		if (insText.length == 0) {
-			// if only one line selected
-			this.textarea.value = this.textarea.value.substr(0, start) + this.tabulation + this.textarea.value.substr(end);
-			pos_start = start + this.tabulation.length;
-			pos_end=pos_start;
-		} else {
-			start= Math.max(0, this.textarea.value.substr(0, start).lastIndexOf("\n")+1);
-			endText=this.textarea.value.substr(end);
-			startText=this.textarea.value.substr(0, start);
-			tmp= this.textarea.value.substring(start, end).split("\n");
-			insText= this.tabulation+tmp.join("\n"+this.tabulation);
-			this.textarea.value = startText + insText + endText;
-			pos_start = start;
-			pos_end= this.textarea.value.indexOf("\n", startText.length + insText.length);
-			if(pos_end==-1)
-				pos_end=this.textarea.value.length;
-			//pos = start + repdeb.length + insText.length + ;
-		}
-		this.textarea.selectionStart = pos_start;
-		this.textarea.selectionEnd = pos_end;
-		
-		//if( document.selection ){
-		if(this.isIE)
-		{
-			this.setIESelection();
-			setTimeout("editArea.is_tabbing=false;", 100);	// IE can't accept to make 2 tabulation without a little break between both
-		}
-		else
-		{ 
-			this.is_tabbing=false;
-		}	
-		
-  	};
-	
-	EditArea.prototype.invert_tab_selection= function(){
-		var t=this, a=this.textarea;
-		if(t.is_tabbing)
-			return;
-		t.is_tabbing=true;
-		//infos=getSelectionInfos();
-		//if( document.selection ){
-		t.getIESelection();
-		
-		var start	= a.selectionStart;
-		var end		= a.selectionEnd;
-		var insText	= a.value.substring(start, end);
-		
-		/* Tab remove and cursor seleciton adjust */
-		var pos_start=start;
-		var pos_end=end;
-		if (insText.length == 0) {
-			if(a.value.substring(start-t.tabulation.length, start)==t.tabulation)
-			{
-				a.value		= a.value.substr(0, start-t.tabulation.length) + a.value.substr(end);
-				pos_start	= Math.max(0, start-t.tabulation.length);
-				pos_end		= pos_start;
-			}	
-			/*
-			a.value = a.value.substr(0, start) + t.tabulation + insText + a.value.substr(end);
-			pos_start = start + t.tabulation.length;
-			pos_end=pos_start;*/
-		} else {
-			start		= a.value.substr(0, start).lastIndexOf("\n")+1;
-			endText		= a.value.substr(end);
-			startText	= a.value.substr(0, start);
-			tmp			= a.value.substring(start, end).split("\n");
-			insText		= "";
-			for(i=0; i<tmp.length; i++){				
-				for(j=0; j<t.tab_nb_char; j++){
-					if(tmp[i].charAt(0)=="\t"){
-						tmp[i]=tmp[i].substr(1);
-						j=t.tab_nb_char;
-					}else if(tmp[i].charAt(0)==" ")
-						tmp[i]=tmp[i].substr(1);
-				}		
-				insText+=tmp[i];
-				if(i<tmp.length-1)
-					insText+="\n";
-			}
-			//insText+="_";
-			a.value		= startText + insText + endText;
-			pos_start	= start;
-			pos_end		= a.value.indexOf("\n", startText.length + insText.length);
-			if(pos_end==-1)
-				pos_end=a.value.length;
-			//pos = start + repdeb.length + insText.length + ;
-		}
-		a.selectionStart = pos_start;
-		a.selectionEnd = pos_end;
-		
-		//if( document.selection ){
-		if(t.isIE){
-			// select the text for IE
-			t.setIESelection();
-			setTimeout("editArea.is_tabbing=false;", 100);	// IE can accept to make 2 tabulation without a little break between both
-		}else
-			t.is_tabbing=false;
-  	};
-	
-	EditArea.prototype.press_enter= function(){		
-		if(!this.smooth_selection)
-			return false;
-		this.getIESelection();
-		var scrollTop= this.result.scrollTop;
-		var scrollLeft= this.result.scrollLeft;
-		var start=this.textarea.selectionStart;
-		var end= this.textarea.selectionEnd;
-		var start_last_line= Math.max(0 , this.textarea.value.substring(0, start).lastIndexOf("\n") + 1 );
-		var begin_line= this.textarea.value.substring(start_last_line, start).replace(/^([ \t]*).*/gm, "$1");
-		var lineStart = this.textarea.value.substring(0, start).split("\n").length;
-		if(begin_line=="\n" || begin_line=="\r" || begin_line.length==0)
-		{
-			return false;
-		}
-			
-		if(this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ){
-			begin_line="\r\n"+ begin_line;
-		}else{
-			begin_line="\n"+ begin_line;
-		}	
-		//alert(start_last_line+" strat: "+start +"\n"+this.textarea.value.substring(start_last_line, start)+"\n_"+begin_line+"_")
-		this.textarea.value= this.textarea.value.substring(0, start) + begin_line + this.textarea.value.substring(end);
-		
-		this.area_select(start+ begin_line.length ,0);
-		// during this process IE scroll back to the top of the textarea
-		if(this.isIE){
-			this.result.scrollTop	= scrollTop;
-			this.result.scrollLeft	= scrollLeft;
-		}
-		return true;
-		
-	};
-	
-	EditArea.prototype.findEndBracket= function(infos, bracket){
-			
-		var start=infos["indexOfCursor"];
-		var normal_order=true;
-		//curr_text=infos["full_text"].split("\n");
-		if(this.assocBracket[bracket])
-			endBracket=this.assocBracket[bracket];
-		else if(this.revertAssocBracket[bracket]){
-			endBracket=this.revertAssocBracket[bracket];
-			normal_order=false;
-		}	
-		var end=-1;
-		var nbBracketOpen=0;
-		
-		for(var i=start; i<infos["full_text"].length && i>=0; ){
-			if(infos["full_text"].charAt(i)==endBracket){				
-				nbBracketOpen--;
-				if(nbBracketOpen<=0){
-					//i=infos["full_text"].length;
-					end=i;
-					break;
-				}
-			}else if(infos["full_text"].charAt(i)==bracket)
-				nbBracketOpen++;
-			if(normal_order)
-				i++;
-			else
-				i--;
-		}
-		
-		//end=infos["full_text"].indexOf("}", start);
-		if(end==-1)
-			return false;	
-		var endLastLine=infos["full_text"].substr(0, end).lastIndexOf("\n");			
-		if(endLastLine==-1)
-			line=1;
-		else
-			line= infos["full_text"].substr(0, endLastLine).split("\n").length + 1;
-					
-		var curPos= end - endLastLine - 1;
-		var endLineLength	= infos["full_text"].substring(end).split("\n")[0].length;
-		this.displayToCursorPosition("end_bracket", line, curPos, infos["full_text"].substring(endLastLine +1, end + endLineLength));
-		return true;
-	};
-	
-	EditArea.prototype.displayToCursorPosition= function(id, start_line, cur_pos, lineContent, no_real_move){
-		var elem,dest,content,posLeft=0,posTop,fixPadding,topOffset,endElem;	
-
-		elem		= this.test_font_size;
-		dest		= _$(id);
-		content		= "<span id='test_font_size_inner'>"+lineContent.substr(0, cur_pos).replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</span><span id='endTestFont'>"+lineContent.substr(cur_pos).replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</span>";
-		if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
-			elem.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
-		} else {
-			elem.innerHTML= content;
-		}
-		
-
-		endElem		= _$('endTestFont');
-		topOffset	= endElem.offsetTop;
-		fixPadding	= parseInt( this.content_highlight.style.paddingLeft.replace("px", "") );
-		posLeft 	= 45 + endElem.offsetLeft + ( !isNaN( fixPadding ) && topOffset > 0 ? fixPadding : 0 );
-		posTop		= this.getLinePosTop( start_line ) + topOffset;// + Math.floor( ( endElem.offsetHeight - 1 ) / this.lineHeight ) * this.lineHeight;
-	
-		// detect the case where the span start on a line but has no display on it
-		if( this.isIE && cur_pos > 0 && endElem.offsetLeft == 0 )
-		{
-			posTop	+=	this.lineHeight;
-		}
-		if(no_real_move!=true){	// when the cursor is hidden no need to move him
-			dest.style.top=posTop+"px";
-			dest.style.left=posLeft+"px";	
-		}
-		// usefull for smarter scroll
-		dest.cursor_top=posTop;
-		dest.cursor_left=posLeft;	
-	//	_$(id).style.marginLeft=posLeft+"px";
-	};
-	
-	EditArea.prototype.getLinePosTop= function(start_line){
-		var elem= _$('line_'+ start_line), posTop=0;
-		if( elem )
-			posTop	= elem.offsetTop;
-		else
-			posTop	= this.lineHeight * (start_line-1);
-		return posTop;
-	};
-	
-	
-	// return the dislpayed height of a text (take word-wrap into account)
-	EditArea.prototype.getTextHeight= function(text){
-		var t=this,elem,height;
-		elem		= t.test_font_size;
-		content		= text.replace(/&/g,"&amp;").replace(/</g,"&lt;");
-		if( t.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
-			elem.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
-		} else {
-			elem.innerHTML= content;
-		}
-		height	= elem.offsetHeight;
-		height	= Math.max( 1, Math.floor( elem.offsetHeight / this.lineHeight ) ) * this.lineHeight;
-		return height;
-	};
-
-	/**
-	 * Fix line height for the given lines
-	 * @param Integer linestart
-	 * @param Integer lineEnd End line or -1 to cover all lines
-	 */
-	EditArea.prototype.fixLinesHeight= function( textValue, lineStart,lineEnd ){
-		var aText = textValue.split("\n");
-		if( lineEnd == -1 )
-			lineEnd	= aText.length-1;
-		for( var i = Math.max(0, lineStart); i <= lineEnd; i++ )
-		{
-			if( elem = _$('line_'+ ( i+1 ) ) )
-			{
-				elem.style.height= typeof( aText[i] ) != "undefined" ? this.getTextHeight( aText[i] )+"px" : this.lineHeight;
-			}
-		}
-	};
-	
-	EditArea.prototype.area_select= function(start, length){
-		this.textarea.focus();
-		
-		start	= Math.max(0, Math.min(this.textarea.value.length, start));
-		end		= Math.max(start, Math.min(this.textarea.value.length, start+length));
-
-		if(this.isIE)
-		{
-			this.textarea.selectionStart	= start;
-			this.textarea.selectionEnd		= end;		
-			this.setIESelection();
-		}
-		else
-		{
-			// Opera bug when moving selection start and selection end
-			if(this.isOpera && this.isOpera < 9.6 )
-			{	
-				this.textarea.setSelectionRange(0, 0);
-			}
-			this.textarea.setSelectionRange(start, end);
-		}
-		this.check_line_selection();
-	};
-	
-	
-	EditArea.prototype.area_get_selection= function(){
-		var text="";
-		if( document.selection ){
-			var range = document.selection.createRange();
-			text=range.text;
-		}else{
-			text= this.textarea.value.substring(this.textarea.selectionStart, this.textarea.selectionEnd);
-		}
-		return text;			
-	};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax.js
deleted file mode 100644
index 11518cc..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax.js
+++ /dev/null
@@ -1,166 +0,0 @@
-	EditAreaLoader.prototype.get_regexp= function(text_array){
-		//res="( |=|\\n|\\r|\\[|\\(|µ|)(";
-		res="(\\b)(";
-		for(i=0; i<text_array.length; i++){
-			if(i>0)
-				res+="|";
-			//res+="("+ tab_text[i] +")";
-			//res+=tab_text[i].replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\{|\})/g, "\\$1");
-			res+=this.get_escaped_regexp(text_array[i]);
-		}
-		//res+=")( |\\.|:|\\{|\\(|\\)|\\[|\\]|\'|\"|\\r|\\n|\\t|$)";
-		res+=")(\\b)";
-		reg= new RegExp(res);
-		
-		return res;
-	};
-	
-	
-	EditAreaLoader.prototype.get_escaped_regexp= function(str){
-		return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1");
-	};
-	
-	EditAreaLoader.prototype.init_syntax_regexp= function(){
-		var lang_style= {};	
-		for(var lang in this.load_syntax){
-			if(!this.syntax[lang])	// init the regexp if not already initialized
-			{
-				this.syntax[lang]= {};
-				this.syntax[lang]["keywords_reg_exp"]= {};
-				this.keywords_reg_exp_nb=0;
-			
-				if(this.load_syntax[lang]['KEYWORDS']){
-					param="g";
-					if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)
-						param+="i";
-					for(var i in this.load_syntax[lang]['KEYWORDS']){
-						if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function") continue;
-						this.syntax[lang]["keywords_reg_exp"][i]= new RegExp(this.get_regexp( this.load_syntax[lang]['KEYWORDS'][i] ), param);
-						this.keywords_reg_exp_nb++;
-					}
-				}
-				
-				if(this.load_syntax[lang]['OPERATORS']){
-					var str="";
-					var nb=0;
-					for(var i in this.load_syntax[lang]['OPERATORS']){
-						if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function") continue;
-						if(nb>0)
-							str+="|";				
-						str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);
-						nb++;
-					}
-					if(str.length>0)
-						this.syntax[lang]["operators_reg_exp"]= new RegExp("("+str+")","g");
-				}
-				
-				if(this.load_syntax[lang]['DELIMITERS']){
-					var str="";
-					var nb=0;
-					for(var i in this.load_syntax[lang]['DELIMITERS']){
-						if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function") continue;
-						if(nb>0)
-							str+="|";
-						str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);
-						nb++;
-					}
-					if(str.length>0)
-						this.syntax[lang]["delimiters_reg_exp"]= new RegExp("("+str+")","g");
-				}
-				
-				
-		//		/(("(\\"|[^"])*"?)|('(\\'|[^'])*'?)|(//(.|\r|\t)*\n)|(/\*(.|\n|\r|\t)*\*/)|(<!--(.|\n|\r|\t)*-->))/gi
-				var syntax_trace=[];
-				
-		//		/("(?:[^"\\]*(\\\\)*(\\"?)?)*("|$))/g
-				
-				this.syntax[lang]["quotes"]={};
-				var quote_tab= [];
-				if(this.load_syntax[lang]['QUOTEMARKS']){
-					for(var i in this.load_syntax[lang]['QUOTEMARKS']){	
-						if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function") continue;			
-						var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);
-						this.syntax[lang]["quotes"][x]=x;
-						//quote_tab[quote_tab.length]="("+x+"(?:\\\\"+x+"|[^"+x+"])*("+x+"|$))";
-						//previous working : quote_tab[quote_tab.length]="("+x+"(?:[^"+x+"\\\\]*(\\\\\\\\)*(\\\\"+x+"?)?)*("+x+"|$))";
-						quote_tab[quote_tab.length]="("+ x +"(\\\\.|[^"+ x +"])*(?:"+ x +"|$))";
-						
-						syntax_trace.push(x);			
-					}			
-				}
-						
-				this.syntax[lang]["comments"]={};
-				if(this.load_syntax[lang]['COMMENT_SINGLE']){
-					for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){	
-						if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function") continue;						
-						var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);
-						quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";
-						syntax_trace.push(x);
-						this.syntax[lang]["comments"][x]="\n";
-					}			
-				}		
-				// (/\*(.|[\r\n])*?\*/)
-				if(this.load_syntax[lang]['COMMENT_MULTI']){
-					for(var i in this.load_syntax[lang]['COMMENT_MULTI']){
-						if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function") continue;							
-						var start=this.get_escaped_regexp(i);
-						var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);
-						quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";
-						syntax_trace.push(start);
-						syntax_trace.push(end);
-						this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];
-					}			
-				}		
-				if(quote_tab.length>0)
-					this.syntax[lang]["comment_or_quote_reg_exp"]= new RegExp("("+quote_tab.join("|")+")","gi");
-				
-				if(syntax_trace.length>0) //   /((.|\n)*?)(\\*("|'|\/\*|\*\/|\/\/|$))/g
-					this.syntax[lang]["syntax_trace_regexp"]= new RegExp("((.|\n)*?)(\\\\*("+ syntax_trace.join("|") +"|$))", "gmi");
-				
-				if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){
-					this.syntax[lang]["script_delimiters"]= {};
-					for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){
-						if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function") continue;							
-						this.syntax[lang]["script_delimiters"][i]= this.load_syntax[lang]['SCRIPT_DELIMITERS'];
-					}			
-				}
-				
-				this.syntax[lang]["custom_regexp"]= {};
-				if(this.load_syntax[lang]['REGEXPS']){
-					for(var i in this.load_syntax[lang]['REGEXPS']){
-						if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function") continue;
-						var val= this.load_syntax[lang]['REGEXPS'][i];
-						if(!this.syntax[lang]["custom_regexp"][val['execute']])
-							this.syntax[lang]["custom_regexp"][val['execute']]= {};
-						this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp' : new RegExp(val['search'], val['modifiers'])
-																			, 'class' : val['class']};
-					}
-				}
-				
-				if(this.load_syntax[lang]['STYLES']){							
-					lang_style[lang]= {};
-					for(var i in this.load_syntax[lang]['STYLES']){
-						if(typeof(this.load_syntax[lang]['STYLES'][i])=="function") continue;
-						if(typeof(this.load_syntax[lang]['STYLES'][i]) != "string"){
-							for(var j in this.load_syntax[lang]['STYLES'][i]){							
-								lang_style[lang][j]= this.load_syntax[lang]['STYLES'][i][j];
-							}
-						}else{
-							lang_style[lang][i]= this.load_syntax[lang]['STYLES'][i];
-						}
-					}
-				}
-				// build style string
-				var style="";		
-				for(var i in lang_style[lang]){
-					if(lang_style[lang][i].length>0){
-						style+= "."+ lang +" ."+ i.toLowerCase() +" span{"+lang_style[lang][i]+"}\n";
-						style+= "."+ lang +" ."+ i.toLowerCase() +"{"+lang_style[lang][i]+"}\n";				
-					}
-				}
-				this.syntax[lang]["styles"]=style;
-			}
-		}				
-	};
-	
-	editAreaLoader.waiting_loading["reg_syntax.js"]= "loaded";

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/basic.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/basic.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/basic.js
deleted file mode 100644
index 93b578d..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/basic.js
+++ /dev/null
@@ -1,69 +0,0 @@
-editAreaLoader.load_syntax["basic"] = {
-	'COMMENT_SINGLE' : {1 : "'", 2 : 'rem'}
-	,'COMMENT_MULTI' : { }
-	,'QUOTEMARKS' : {1: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : false
-	,'KEYWORDS' : {
-		'statements' : [
-			'if','then','for','wend','while',
-			'else','elseif','select','case','end select',
-			'until','next','step','to','end if', 'call'
-		]
-		,'keywords' : [
-			'sub', 'end sub', 'function', 'end function', 'exit',
-			'exit function', 'dim', 'redim', 'shared', 'const',
-			'is', 'absolute', 'access', 'any', 'append', 'as',
-			'base', 'beep', 'binary', 'bload', 'bsave', 'chain',
-			'chdir', 'circle', 'clear', 'close', 'cls', 'color',
-			'com', 'common', 'data', 'date', 'declare', 'def',
-			'defdbl', 'defint', 'deflng', 'defsng', 'defstr',
-			'double', 'draw', 'environ', 'erase', 'error', 'field',
-			'files', 'fn', 'get', 'gosub', 'goto', 'integer', 'key',
-			'kill', 'let', 'line', 'list', 'locate', 'lock', 'long',
-			'lprint', 'lset', 'mkdir', 'name', 'off', 'on', 'open',
-			'option', 'out', 'output', 'paint', 'palette', 'pcopy',
-			'poke', 'preset', 'print', 'pset', 'put', 'random',
-			'randomize', 'read', 'reset', 'restore', 'resume',
-			'return', 'rmdir', 'rset', 'run', 'screen', 'seg',
-			'shell', 'single', 'sleep', 'sound', 'static', 'stop',
-			'strig', 'string', 'swap', 'system', 'time', 'timer',
-			'troff', 'tron', 'type', 'unlock', 'using', 'view',
-			'wait', 'width', 'window', 'write'
-	        ]
-		,'functions' : [
-			'abs', 'asc', 'atn', 'cdbl', 'chr', 'cint', 'clng',
-			'cos', 'csng', 'csrlin', 'cvd', 'cvdmbf', 'cvi', 'cvl',
-			'cvs', 'cvsmbf', 'eof', 'erdev', 'erl', 'err', 'exp',
-			'fileattr', 'fix', 'fre', 'freefile', 'hex', 'inkey',
-			'inp', 'input', 'instr', 'int', 'ioctl', 'lbound',
-			'lcase', 'left', 'len', 'loc', 'lof', 'log', 'lpos',
-			'ltrim', 'mid', 'mkd', 'mkdmbf', 'mki', 'mkl', 'mks',
-			'mksmbf', 'oct', 'peek', 'pen', 'play', 'pmap', 'point',
-			'pos', 'right', 'rnd', 'rtrim', 'seek', 'sgn', 'sin',
-			'space', 'spc', 'sqr', 'stick', 'str', 'tab', 'tan',
-			'ubound', 'ucase', 'val', 'varptr', 'varseg'
-		]
-		,'operators' : [
-			'and', 'eqv', 'imp', 'mod', 'not', 'or', 'xor'
-		]
-	}
-	,'OPERATORS' :[
-		'+', '-', '/', '*', '=', '<', '>', '!', '&'
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'STYLES' : {
-		'COMMENTS': 'color: #99CC00;'
-		,'QUOTESMARKS': 'color: #333399;'
-		,'KEYWORDS' : {
-			'keywords' : 'color: #3366FF;'
-			,'functions' : 'color: #0000FF;'
-			,'statements' : 'color: #3366FF;'
-			,'operators' : 'color: #FF0000;'
-			}
-		,'OPERATORS' : 'color: #FF0000;'
-		,'DELIMITERS' : 'color: #0000FF;'
-
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/brainfuck.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/brainfuck.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/brainfuck.js
deleted file mode 100644
index 810c3d6..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/brainfuck.js
+++ /dev/null
@@ -1,44 +0,0 @@
-editAreaLoader.load_syntax["brainfuck"] = {
-	'COMMENT_SINGLE' : {}
-	,'COMMENT_MULTI' : {}
-	,'QUOTEMARKS' : {}
-	,'KEYWORD_CASE_SENSITIVE' : true
-	,'OPERATORS' :[
-		'+', '-'
-	]
-	,'DELIMITERS' :[
-		'[', ']'
-	]
-	,'REGEXPS' : {
-		'bfispis' : {
-			'search' : '()(\\.)()'
-			,'class' : 'bfispis'
-			,'modifiers' : 'g'
-			,'execute' : 'before'
-		}
-		,'bfupis' : {
-			'search' : '()(\\,)()'
-			,'class' : 'bfupis'
-			,'modifiers' : 'g'
-			,'execute' : 'before'
-		}
-		,'bfmemory' : {
-			'search' : '()([<>])()'
-			,'class' : 'bfmemory'
-			,'modifiers' : 'g'
-			,'execute' : 'before'
-		}
-	}
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #6381F8;'
-		,'OPERATORS' : 'color: #88AA00;'
-		,'DELIMITERS' : 'color: #00C138;'
-		,'REGEXPS' : {
-			'bfispis' : 'color: #EE0000;'
-			,'bfupis' : 'color: #4455ee;'
-			,'bfmemory' : 'color: #DD00DD;'
-		}
-	}
-};
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/c.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/c.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/c.js
deleted file mode 100644
index 31667a0..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/c.js
+++ /dev/null
@@ -1,62 +0,0 @@
-editAreaLoader.load_syntax["c"] = {
-	'COMMENT_SINGLE' : {1 : '//'}
-	,'COMMENT_MULTI' : {'/*' : '*/'}
-	,'QUOTEMARKS' : {1: "'", 2: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : true
-	,'KEYWORDS' : {
-		'constants' : [
-			'NULL', 'false', 'stdin', 'stdout', 'stderr', 'true'
-		]
-		,'types' : [
-			'FILE', 'auto', 'char', 'const', 'double',
-			'extern', 'float', 'inline', 'int', 'long', 'register',
-			'short', 'signed', 'size_t', 'static', 'struct',
-			'time_t', 'typedef', 'union', 'unsigned', 'void',
-			'volatile'
-		]
-		,'statements' : [
-			'do', 'else', 'enum', 'for', 'goto', 'if', 'sizeof',
-			'switch', 'while'
-		]
- 		,'keywords' : [
-			'break', 'case', 'continue', 'default', 'delete',
-			'return'
-		]
-	}
-	,'OPERATORS' :[
-		'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'REGEXPS' : {
-		'precompiler' : {
-			'search' : '()(#[^\r\n]*)()'
-			,'class' : 'precompiler'
-			,'modifiers' : 'g'
-			,'execute' : 'before'
-		}
-/*		,'precompilerstring' : {
-			'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
-			,'class' : 'precompilerstring'
-			,'modifiers' : 'g'
-			,'execute' : 'before'
-		}*/
-	}
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #6381F8;'
-		,'KEYWORDS' : {
-			'constants' : 'color: #EE0000;'
-			,'types' : 'color: #0000EE;'
-			,'statements' : 'color: #60CA00;'
-			,'keywords' : 'color: #48BDDF;'
-		}
-		,'OPERATORS' : 'color: #FF00FF;'
-		,'DELIMITERS' : 'color: #0038E1;'
-		,'REGEXPS' : {
-			'precompiler' : 'color: #009900;'
-			,'precompilerstring' : 'color: #994400;'
-		}
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/coldfusion.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/coldfusion.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/coldfusion.js
deleted file mode 100644
index 673e874..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/coldfusion.js
+++ /dev/null
@@ -1,119 +0,0 @@
-editAreaLoader.load_syntax["coldfusion"] = {
-	'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
-	,'COMMENT_MULTI' : {'<!--' : '-->'}
-	,'COMMENT_MULTI2' : {'<!---' : '--->'}
-	,'QUOTEMARKS' : {1: "'", 2: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : false
-		,'KEYWORDS' : {
-		'statements' : [
-			'include', 'require', 'include_once', 'require_once',
-			'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
-            'endif', 'switch', 'case', 'endswitch',
-			'return', 'break', 'continue'
-		]
-		,'reserved' : [
-			'AND', 'break', 'case', 'CONTAIN', 'CONTAINS', 'continue', 'default', 'do', 
-			'DOES', 'else', 'EQ', 'EQUAL', 'EQUALTO', 'EQV', 'FALSE', 'for', 'GE', 
-			'GREATER', 'GT', 'GTE', 'if', 'IMP', 'in', 'IS', 'LE', 'LESS', 'LT', 'LTE', 
-			'MOD', 'NEQ', 'NOT', 'OR', 'return', 'switch', 'THAN', 'TO', 'TRUE', 'var', 
-			'while', 'XOR'
-		]
-		,'functions' : [
-			'Abs', 'ACos', 'ArrayAppend', 'ArrayAvg', 'ArrayClear', 'ArrayDeleteAt', 'ArrayInsertAt', 
-			'ArrayIsEmpty', 'ArrayLen', 'ArrayMax', 'ArrayMin', 'ArrayNew', 'ArrayPrepend', 'ArrayResize', 
-			'ArraySet', 'ArraySort', 'ArraySum', 'ArraySwap', 'ArrayToList', 'Asc', 'ASin', 'Atn', 'AuthenticatedContext', 
-			'AuthenticatedUser', 'BitAnd', 'BitMaskClear', 'BitMaskRead', 'BitMaskSet', 'BitNot', 'BitOr', 
-			'BitSHLN', 'BitSHRN', 'BitXor', 'Ceiling', 'Chr', 'CJustify', 'Compare', 'CompareNoCase', 'Cos', 
-			'CreateDate', 'CreateDateTime', 'CreateODBCDate', 'CreateODBCDateTime', 'CreateODBCTime', 
-			'CreateTime', 'CreateTimeSpan', 'DateAdd', 'DateCompare', 'DateConvert', 'DateDiff', 
-			'DateFormat', 'DatePart', 'Day', 'DayOfWeek', 'DayOfWeekAsString', 'DayOfYear', 'DaysInMonth', 
-			'DaysInYear', 'DE', 'DecimalFormat', 'DecrementValue', 'Decrypt', 'DeleteClientVariable', 
-			'DirectoryExists', 'DollarFormat', 'Duplicate', 'Encrypt', 'Evaluate', 'Exp', 'ExpandPath', 
-			'FileExists', 'Find', 'FindNoCase', 'FindOneOf', 'FirstDayOfMonth', 'Fix', 'FormatBaseN', 
-			'GetBaseTagData', 'GetBaseTagList', 'GetBaseTemplatePath', 'GetClientVariablesList', 
-			'GetCurrentTemplatePath', 'GetDirectoryFromPath', 'GetException', 'GetFileFromPath', 
-			'GetFunctionList', 'GetHttpTimeString', 'GetHttpRequestData', 'GetLocale', 'GetMetricData', 
-			'GetProfileString', 'GetTempDirectory', 'GetTempFile', 'GetTemplatePath', 'GetTickCount', 
-			'GetTimeZoneInfo', 'GetToken', 'Hash', 'Hour', 'HTMLCodeFormat', 'HTMLEditFormat', 'IIf', 
-			'IncrementValue', 'InputBaseN', 'Insert', 'Int', 'IsArray', 'IsAuthenticated', 'IsAuthorized', 
-			'IsBoolean', 'IsBinary', 'IsCustomFunction', 'IsDate', 'IsDebugMode', 'IsDefined', 'IsLeapYear', 
-			'IsNumeric', 'IsNumericDate', 'IsProtected', 'IsQuery', 'IsSimpleValue', 'IsStruct', 'IsWDDX', 
-			'JavaCast', 'JSStringFormat', 'LCase', 'Left', 'Len', 'ListAppend', 'ListChangeDelims', 
-			'ListContains', 'ListContainsNoCase', 'ListDeleteAt', 'ListFind', 'ListFindNoCase', 'ListFirst', 
-			'ListGetAt', 'ListInsertAt', 'ListLast', 'ListLen', 'ListPrepend', 'ListQualify', 'ListRest', 
-			'ListSetAt', 'ListSort', 'ListToArray', 'ListValueCount', 'ListValueCountNoCase', 'LJustify', 
-			'Log', 'Log10', 'LSCurrencyFormat', 'LSDateFormat', 'LSEuroCurrencyFormat', 'LSIsCurrency', 
-			'LSIsDate', 'LSIsNumeric', 'LSNumberFormat', 'LSParseCurrency', 'LSParseDateTime', 'LSParseNumber', 
-			'LSTimeFormat', 'LTrim', 'Max', 'Mid', 'Min', 'Minute', 'Month', 'MonthAsString', 'Now', 'NumberFormat', 
-			'ParagraphFormat', 'ParameterExists', 'ParseDateTime', 'Pi', 'PreserveSingleQuotes', 'Quarter', 
-			'QueryAddRow', 'QueryNew', 'QuerySetCell', 'QuotedValueList', 'Rand', 'Randomize', 'RandRange', 
-			'REFind', 'REFindNoCase', 'RemoveChars', 'RepeatString', 'Replace', 'ReplaceList', 'ReplaceNoCase', 
-			'REReplace', 'REReplaceNoCase', 'Reverse', 'Right', 'RJustify', 'Round', 'RTrim', 'Second', 'SetLocale', 
-			'SetProfileString', 'SetVariable', 'Sgn', 'Sin', 'SpanExcluding', 'SpanIncluding', 'Sqr', 'StripCR', 
-			'StructAppend', 'StructClear', 'StructCopy', 'StructCount', 'StructDelete', 'StructFind', 'StructFindKey', 
-			'StructFindValue', 'StructGet', 'StructInsert', 'StructIsEmpty', 'StructKeyArray', 'StructKeyExists', 
-			'StructKeyList', 'StructNew', 'StructSort', 'StructUpdate', 'Tan', 'TimeFormat', 'ToBase64', 'ToBinary', 
-			'ToString', 'Trim', 'UCase', 'URLDecode', 'URLEncodedFormat', 'Val', 'ValueList', 'Week', 'WriteOutput', 
-			'XMLFormat', 'Year', 'YesNoFormat'
-		]
-	}
-	,'OPERATORS' :[
-		'+', '-', '/', '*', '%', '!', '&&', '||'
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'REGEXPS' : {
-		'doctype' : {
-			'search' : '()(<!DOCTYPE[^>]*>)()'
-			,'class' : 'doctype'
-			,'modifiers' : ''
-			,'execute' : 'before' // before or after
-		}
-		,'cftags' : {
-			'search' : '(<)(/cf[a-z][^ \r\n\t>]*)([^>]*>)'
-			,'class' : 'cftags'
-			,'modifiers' : 'gi'
-			,'execute' : 'before' // before or after
-		}
-		,'cftags2' : {
-			'search' : '(<)(cf[a-z][^ \r\n\t>]*)([^>]*>)'
-			,'class' : 'cftags2'
-			,'modifiers' : 'gi'
-			,'execute' : 'before' // before or after
-		}
-		,'tags' : {
-			'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
-			,'class' : 'tags'
-			,'modifiers' : 'gi'
-			,'execute' : 'before' // before or after
-		}
-		,'attributes' : {
-			'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
-			,'class' : 'attributes'
-			,'modifiers' : 'g'
-			,'execute' : 'before' // before or after
-		}
-	}
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #6381F8;'
-		,'KEYWORDS' : {
-			'reserved' : 'color: #48BDDF;'
-			,'functions' : 'color: #0000FF;'
-			,'statements' : 'color: #60CA00;'
-			}
-		,'OPERATORS' : 'color: #E775F0;'
-		,'DELIMITERS' : ''
-		,'REGEXPS' : {
-			'attributes': 'color: #990033;'
-			,'cftags': 'color: #990033;'
-			,'cftags2': 'color: #990033;'
-			,'tags': 'color: #000099;'
-			,'doctype': 'color: #8DCFB5;'
-			,'test': 'color: #00FF00;'
-		}	
-	}		
-};
-
- 	  	 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/cpp.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/cpp.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/cpp.js
deleted file mode 100644
index 74826d3..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/cpp.js
+++ /dev/null
@@ -1,65 +0,0 @@
-editAreaLoader.load_syntax["cpp"] = {
-	'COMMENT_SINGLE' : {1 : '//'}
-	,'COMMENT_MULTI' : {'/*' : '*/'}
-	,'QUOTEMARKS' : {1: "'", 2: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : true
-	,'KEYWORDS' : {
-		'constants' : [
-			'NULL', 'false', 'std', 'stdin', 'stdout', 'stderr',
-			'true'
-		]
-		,'types' : [
-			'FILE', 'auto', 'char', 'class', 'const', 'double',
-			'extern', 'float', 'friend', 'inline', 'int',
-			'iterator', 'long', 'map', 'operator', 'queue',
-			'register', 'short', 'signed', 'size_t', 'stack',
-			'static', 'string', 'struct', 'time_t', 'typedef',
-			'union', 'unsigned', 'vector', 'void', 'volatile'
-		]
-		,'statements' : [
-			'catch', 'do', 'else', 'enum', 'for', 'goto', 'if',
-			'sizeof', 'switch', 'this', 'throw', 'try', 'while'
-		]
- 		,'keywords' : [
-			'break', 'case', 'continue', 'default', 'delete',
-			'namespace', 'new', 'private', 'protected', 'public',
-			'return', 'using'
-		]
-	}
-	,'OPERATORS' :[
-		'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'REGEXPS' : {
-		'precompiler' : {
-			'search' : '()(#[^\r\n]*)()'
-			,'class' : 'precompiler'
-			,'modifiers' : 'g'
-			,'execute' : 'before'
-		}
-/*		,'precompilerstring' : {
-			'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
-			,'class' : 'precompilerstring'
-			,'modifiers' : 'g'
-			,'execute' : 'before'
-		}*/
-	}
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #6381F8;'
-		,'KEYWORDS' : {
-			'constants' : 'color: #EE0000;'
-			,'types' : 'color: #0000EE;'
-			,'statements' : 'color: #60CA00;'
-			,'keywords' : 'color: #48BDDF;'
-		}
-		,'OPERATORS' : 'color: #FF00FF;'
-		,'DELIMITERS' : 'color: #0038E1;'
-		,'REGEXPS' : {
-			'precompiler' : 'color: #009900;'
-			,'precompilerstring' : 'color: #994400;'
-		}
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/css.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/css.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/css.js
deleted file mode 100644
index 8dded1b..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/css.js
+++ /dev/null
@@ -1,84 +0,0 @@
-editAreaLoader.load_syntax["css"] = {
-	'COMMENT_SINGLE' : {1 : '@'}
-	,'COMMENT_MULTI' : {'/*' : '*/'}
-	,'QUOTEMARKS' : ['"', "'"]
-	,'KEYWORD_CASE_SENSITIVE' : false
-	,'KEYWORDS' : {
-		'attributes' : [
-			'aqua', 'azimuth', 'background-attachment', 'background-color',
-			'background-image', 'background-position', 'background-repeat',
-			'background', 'border-bottom-color', 'border-bottom-style',
-			'border-bottom-width', 'border-left-color', 'border-left-style',
-			'border-left-width', 'border-right', 'border-right-color',
-			'border-right-style', 'border-right-width', 'border-top-color',
-			'border-top-style', 'border-top-width','border-bottom', 'border-collapse',
-			'border-left', 'border-width', 'border-color', 'border-spacing',
-			'border-style', 'border-top', 'border',  'caption-side',
-			'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
-			'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
-			'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
-			'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
-			'font-weight', 'font', 'height', 'letter-spacing', 'line-height',
-			'list-style', 'list-style-image', 'list-style-position', 'list-style-type',
-			'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin',
-			'marker-offset', 'marks', 'max-height', 'max-width', 'min-height',
-			'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style',
-			'outline-width', 'overflow', 'padding-bottom', 'padding-left',
-			'padding-right', 'padding-top', 'padding', 'page', 'page-break-after',
-			'page-break-before', 'page-break-inside', 'pause-after', 'pause-before',
-			'pause', 'pitch', 'pitch-range',  'play-during', 'position', 'quotes',
-			'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation',
-			'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration',
-			'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
-			'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows',
-			'width', 'word-spacing', 'z-index', 'bottom', 'left'
-		]
-		,'values' : [
-			'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid',
-			'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both',
-			'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic', 
-            'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive',
-			'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
-			'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded',
-			'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia',
-			'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher',
-			'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline',
-			'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana',
-			'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low',
-			'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace',
-			'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize',
-			'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline',
-			'pointer', 'portrait', 'purple', 'px',
-			'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards',
-			's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square',
-			'static', 'status-bar', 'super', 'sw-resize',
-			'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent',
-			'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
-			'visible',
-			'w-resize', 'wait', 'white', 'wider',
-			'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small',
-			'yellow', 'yes'
-		]
-		,'specials' : [
-			'important'
-		]
-	}
-	,'OPERATORS' :[
-		':', ';', '!', '.', '#'
-	]
-	,'DELIMITERS' :[
-		'{', '}'
-	]
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #6381F8;'
-		,'KEYWORDS' : {
-			'attributes' : 'color: #48BDDF;'
-			,'values' : 'color: #2B60FF;'
-			,'specials' : 'color: #FF0000;'
-			}
-		,'OPERATORS' : 'color: #FF00FF;'
-		,'DELIMITERS' : 'color: #60CA00;'
-				
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/html.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/html.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/html.js
deleted file mode 100644
index d508364..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/html.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-* last update: 2006-08-24
-*/
-
-editAreaLoader.load_syntax["html"] = {
-	'COMMENT_SINGLE' : {}
-	,'COMMENT_MULTI' : {'<!--' : '-->'}
-	,'QUOTEMARKS' : {1: "'", 2: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : false
-	,'KEYWORDS' : {
-	}
-	,'OPERATORS' :[
-	]
-	,'DELIMITERS' :[
-	]
-	,'REGEXPS' : {
-		'doctype' : {
-			'search' : '()(<!DOCTYPE[^>]*>)()'
-			,'class' : 'doctype'
-			,'modifiers' : ''
-			,'execute' : 'before' // before or after
-		}
-		,'tags' : {
-			'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
-			,'class' : 'tags'
-			,'modifiers' : 'gi'
-			,'execute' : 'before' // before or after
-		}
-		,'attributes' : {
-			'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
-			,'class' : 'attributes'
-			,'modifiers' : 'g'
-			,'execute' : 'before' // before or after
-		}
-	}
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #6381F8;'
-		,'KEYWORDS' : {
-			}
-		,'OPERATORS' : 'color: #E775F0;'
-		,'DELIMITERS' : ''
-		,'REGEXPS' : {
-			'attributes': 'color: #B1AC41;'
-			,'tags': 'color: #E62253;'
-			,'doctype': 'color: #8DCFB5;'
-			,'test': 'color: #00FF00;'
-		}	
-	}		
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/java.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/java.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/java.js
deleted file mode 100644
index bf48b53..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/java.js
+++ /dev/null
@@ -1,56 +0,0 @@
-editAreaLoader.load_syntax["java"] = {
-'COMMENT_SINGLE': { 1: '//', 2: '@' }
-	, 'COMMENT_MULTI': { '/*': '*/' }
-	, 'QUOTEMARKS': { 1: "'", 2: '"' }
-	, 'KEYWORD_CASE_SENSITIVE': true
-	, 'KEYWORDS': {
-	    'constants': [
-			'null', 'false', 'true'
-		]
-		, 'types': [
-			'String', 'int', 'short', 'long', 'char', 'double', 'byte',
-			'float', 'static', 'void', 'private', 'boolean', 'protected',
-			'public', 'const', 'class', 'final', 'abstract', 'volatile',
-			'enum', 'transient', 'interface'
-		]
-		, 'statements': [
-            'this', 'extends', 'if', 'do', 'while', 'try', 'catch', 'finally',
-            'throw', 'throws', 'else', 'for', 'switch', 'continue', 'implements',
-            'break', 'case', 'default', 'goto'
-		]
- 		, 'keywords': [
-           'new', 'return', 'import', 'native', 'super', 'package', 'assert', 'synchronized',
-           'instanceof', 'strictfp'
-		]
-	}
-	, 'OPERATORS': [
-		'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
-	]
-	, 'DELIMITERS': [
-		'(', ')', '[', ']', '{', '}'
-	]
-	, 'REGEXPS': {
-	    'precompiler': {
-	        'search': '()(#[^\r\n]*)()'
-			, 'class': 'precompiler'
-			, 'modifiers': 'g'
-			, 'execute': 'before'
-	    }
-	}
-	, 'STYLES': {
-	    'COMMENTS': 'color: #AAAAAA;'
-		, 'QUOTESMARKS': 'color: #6381F8;'
-		, 'KEYWORDS': {
-		    'constants': 'color: #EE0000;'
-			, 'types': 'color: #0000EE;'
-			, 'statements': 'color: #60CA00;'
-			, 'keywords': 'color: #48BDDF;'
-		}
-		, 'OPERATORS': 'color: #FF00FF;'
-		, 'DELIMITERS': 'color: #0038E1;'
-		, 'REGEXPS': {
-		    'precompiler': 'color: #009900;'
-			, 'precompilerstring': 'color: #994400;'
-		}
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/js.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/js.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/js.js
deleted file mode 100644
index 2799b70..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/js.js
+++ /dev/null
@@ -1,93 +0,0 @@
-editAreaLoader.load_syntax["js"] = {
-	'COMMENT_SINGLE' : {1 : '//'}
-	,'COMMENT_MULTI' : {'/*' : '*/'}
-	,'QUOTEMARKS' : {1: "'", 2: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : false
-	,'KEYWORDS' : {
-		'statements' : [
-			'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
-			'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
-			'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
-			'while', 'write', 'with'
-		]
- 		,'keywords' : [
-			'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
-			'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
-			'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',		
-			// the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
-			'Link ', 'outerHeight ', 'Anchor', 'FileUpload', 
-			'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self', 
-			'arguments', 'locationbar', 'pageXoffset', 'Form', 
-			'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status', 
-			'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy', 
-			'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden', 
-			'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents', 
-			'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text', 
-			'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity', 
-			'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed', 
-			'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents', 
-			'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus', 
-			'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document', 
-			'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window', 
-			'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'			
-		]
-    	,'functions' : [
-			// common functions for Window object
-			'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
-			'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
-			'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
-			'stop' 
-		]
-	}
-	,'OPERATORS' :[
-		'+', '-', '/', '*', '=', '<', '>', '%', '!'
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #6381F8;'
-		,'KEYWORDS' : {
-			'statements' : 'color: #60CA00;'
-			,'keywords' : 'color: #48BDDF;'
-			,'functions' : 'color: #2B60FF;'
-		}
-		,'OPERATORS' : 'color: #FF00FF;'
-		,'DELIMITERS' : 'color: #0038E1;'
-				
-	}
-	,'AUTO_COMPLETION' :  {
-		"default": {	// the name of this definition group. It's posisble to have different rules inside the same definition file
-			"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^"	// \\s|\\.|
-						,"possible_words_letters": "[a-zA-Z0-9_]+"
-						,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
-						,"prefix_separator": "\\."
-					}
-			,"CASE_SENSITIVE": true
-			,"MAX_TEXT_LENGTH": 100		// the maximum length of the text being analyzed before the cursor position
-			,"KEYWORDS": {
-				'': [	// the prefix of thoses items
-						/**
-						 * 0 : the keyword the user is typing
-						 * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
-						 * 		If empty the keyword will be displayed
-						 * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
-						 */
-						 ['Array', '§()', '']
-			    		,['alert', '§({@})', 'alert(String message)']
-			    		,['document']
-			    		,['window']
-			    	]
-		    	,'window' : [
-			    		 ['location']
-			    		,['document']
-			    		,['scrollTo', 'scrollTo({@})', 'scrollTo(Int x,Int y)']
-					]
-		    	,'location' : [
-			    		 ['href']
-					]
-			}
-		}
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/pas.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/pas.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/pas.js
deleted file mode 100644
index 7c1bc3c..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/pas.js
+++ /dev/null
@@ -1,82 +0,0 @@
-editAreaLoader.load_syntax["pas"] = {
-	'COMMENT_SINGLE' : {}
-	,'COMMENT_MULTI' : {'{' : '}', '(*':'*)'}
-	,'QUOTEMARKS' : {1: '"', 2: "'"}
-	,'KEYWORD_CASE_SENSITIVE' : false
-	,'KEYWORDS' : {
-		'constants' : [
-			'Blink', 'Black', 'Blue', 'Green', 'Cyan', 'Red',
-			'Magenta', 'Brown', 'LightGray', 'DarkGray',
-			'LightBlue', 'LightGreen', 'LightCyan', 'LightRed',
-			'LightMagenta', 'Yellow', 'White', 'MaxSIntValue',
-			'MaxUIntValue', 'maxint', 'maxLongint', 'maxSmallint',
-			'erroraddr', 'errorcode', 'LineEnding'
-		]
-		,'keywords' : [
-			'in', 'or', 'div', 'mod', 'and', 'shl', 'shr', 'xor',
-			'pow', 'is', 'not','Absolute', 'And_then', 'Array',
-			'Begin', 'Bindable', 'Case', 'Const', 'Do', 'Downto',
-			'Else', 'End', 'Export', 'File', 'For', 'Function',
-			'Goto', 'If', 'Import', 'Implementation', 'Inherited',
-			'Inline', 'Interface', 'Label', 'Module', 'Nil',
-			'Object', 'Of', 'Only', 'Operator', 'Or_else',
-			'Otherwise', 'Packed', 'Procedure', 'Program',
-			'Protected', 'Qualified', 'Record', 'Repeat',
-			'Restricted', 'Set', 'Then', 'To', 'Type', 'Unit',
-			'Until', 'Uses', 'Value', 'Var', 'Virtual', 'While',
-			'With'
-		]
-		,'functions' : [
-			'Abs', 'Addr', 'Append', 'Arctan', 'Assert', 'Assign',
-			'Assigned', 'BinStr', 'Blockread', 'Blockwrite',
-			'Break', 'Chdir', 'Chr', 'Close', 'CompareByte',
-			'CompareChar', 'CompareDWord', 'CompareWord', 'Concat',
-			'Continue', 'Copy', 'Cos', 'CSeg', 'Dec', 'Delete',
-			'Dispose', 'DSeg', 'Eof', 'Eoln', 'Erase', 'Exclude',
-			'Exit', 'Exp', 'Filepos', 'Filesize', 'FillByte',
-			'Fillchar', 'FillDWord', 'Fillword', 'Flush', 'Frac',
-			'Freemem', 'Getdir', 'Getmem', 'GetMemoryManager',
-			'Halt', 'HexStr', 'Hi', 'High', 'Inc', 'Include',
-			'IndexByte', 'IndexChar', 'IndexDWord', 'IndexWord',
-			'Insert', 'IsMemoryManagerSet', 'Int', 'IOresult',
-			'Length', 'Ln', 'Lo', 'LongJmp', 'Low', 'Lowercase',
-			'Mark', 'Maxavail', 'Memavail', 'Mkdir', 'Move',
-			'MoveChar0', 'New', 'Odd', 'OctStr', 'Ofs', 'Ord',
-			'Paramcount', 'Paramstr', 'Pi', 'Pos', 'Power', 'Pred',
-			'Ptr', 'Random', 'Randomize', 'Read', 'Readln',
-			'Real2Double', 'Release', 'Rename', 'Reset', 'Rewrite',
-			'Rmdir', 'Round', 'Runerror', 'Seek', 'SeekEof',
-			'SeekEoln', 'Seg', 'SetMemoryManager', 'SetJmp',
-			'SetLength', 'SetString', 'SetTextBuf', 'Sin', 'SizeOf',
-			'Sptr', 'Sqr', 'Sqrt', 'SSeg', 'Str', 'StringOfChar',
-			'Succ', 'Swap', 'Trunc', 'Truncate', 'Upcase', 'Val',
-			'Write', 'WriteLn'
-		]
-		,'types' : [
-			'Integer', 'Shortint', 'SmallInt', 'Longint',
-			'Longword', 'Int64', 'Byte', 'Word', 'Cardinal',
-			'QWord', 'Boolean', 'ByteBool', 'LongBool', 'Char',
-			'Real', 'Single', 'Double', 'Extended', 'Comp',
-			'String', 'ShortString', 'AnsiString', 'PChar'
-		]
-	}
-	,'OPERATORS' :[
-		'@', '*', '+', '-', '/', '^', ':=', '<', '=', '>'
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']'
-	]
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #6381F8;'
-		,'KEYWORDS' : {
-			'specials' : 'color: #EE0000;'
-			,'constants' : 'color: #654321;'
-			,'keywords' : 'color: #48BDDF;'
-			,'functions' : 'color: #449922;'
-			,'types' : 'color: #2B60FF;'
-			}
-		,'OPERATORS' : 'color: #FF00FF;'
-		,'DELIMITERS' : 'color: #60CA00;'
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/perl.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/perl.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/perl.js
deleted file mode 100644
index b63e951..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/perl.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************
- * (c) 2008 - file created by Christoph Pinkel, MTC Infomedia OHG.
- *
- * You may choose any license of the current release or any future release
- * of editarea to use, modify and/or redistribute this file.
- *
- * This language specification file supports for syntax checking on
- * a large subset of Perl 5.x.
- * The basic common syntax of Perl is fully supported, but as for
- * the highlighting of built-in operations, it's mainly designed
- * to support for hightlighting Perl code in a Safe environment (compartment)
- * as used by CoMaNet for evaluation of administrative scripts. This Safe
- * compartment basically allows for all of Opcode's :default operations,
- * but little others. See http://perldoc.perl.org/Opcode.html to learn
- * more.
- ***************************************************************************/
-
-editAreaLoader.load_syntax["perl"] = {
-
-	'COMMENT_SINGLE' : {1 : '#'},
-	'QUOTEMARKS' : {1: "'", 2: '"'},
-	'KEYWORD_CASE_SENSITIVE' : true,
-	'KEYWORDS' :
-	{
-		'core' :
-			[ "if", "else", "elsif", "while", "for", "each", "foreach",
-				"next", "last", "goto", "exists", "delete", "undef",
-				"my", "our", "local", "use", "require", "package", "keys", "values",
-				"sub", "bless", "ref", "return" ],
-		'functions' :
-			[
-				//from :base_core
-				"int", "hex", "oct", "abs", "substr", "vec", "study", "pos",
-				"length", "index", "rindex", "ord", "chr", "ucfirst", "lcfirst",
-				"uc", "lc", "quotemeta", "chop", "chomp", "split", "list", "splice",
-				"push", "pop", "shift", "unshift", "reverse", "and", "or", "dor",
-				"xor", "warn", "die", "prototype",
-				//from :base_mem
-				"concat", "repeat", "join", "range",
-				//none from :base_loop, as we'll see them as basic statements...
-				//from :base_orig
-				"sprintf", "crypt", "tie", "untie", "select", "localtime", "gmtime",
-				//others
-				"print", "open", "close"
-			]
-	},
-	'OPERATORS' :
-		[ '+', '-', '/', '*', '=', '<', '>', '!', '||', '.', '&&',
-			' eq ', ' ne ', '=~' ],
-	'DELIMITERS' :
-		[ '(', ')', '[', ']', '{', '}' ],
-	'REGEXPS' :
-	{
-		'packagedecl' : { 'search': '(package )([^ \r\n\t#;]*)()',
-			'class' : 'scopingnames',
-			'modifiers' : 'g', 'execute' : 'before' },
-		'subdecl' : { 'search': '(sub )([^ \r\n\t#]*)()',
-			'class' : 'scopingnames',
-			'modifiers' : 'g', 'execute' : 'before' },
-		'scalars' : { 'search': '()(\\\$[a-zA-Z0-9_:]*)()',
-			'class' : 'vars',
-			'modifiers' : 'g', 'execute' : 'after' },
-		'arrays' : { 'search': '()(@[a-zA-Z0-9_:]*)()',
-			'class' : 'vars',
-			'modifiers' : 'g', 'execute' : 'after' },
-		'hashs' : { 'search': '()(%[a-zA-Z0-9_:]*)()',
-			'class' : 'vars',
-			'modifiers' : 'g', 'execute' : 'after' },
-	},
-
-	'STYLES' :
-	{
-		'COMMENTS': 'color: #AAAAAA;',
-		'QUOTESMARKS': 'color: #DC0000;',
-		'KEYWORDS' :
-		{
-			'core' : 'color: #8aca00;',
-			'functions' : 'color: #2B60FF;'
-		},
-		'OPERATORS' : 'color: #8aca00;',
-		'DELIMITERS' : 'color: #0038E1;',
-		'REGEXPS':
-		{
-			'scopingnames' : 'color: #ff0000;',
-			'vars' : 'color: #00aaaa;',
-		}
-	} //'STYLES'
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/php.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/php.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/php.js
deleted file mode 100644
index 5a5cff9..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/php.js
+++ /dev/null
@@ -1,156 +0,0 @@
-editAreaLoader.load_syntax["php"] = {
-	'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
-	,'COMMENT_MULTI' : {'/*' : '*/'}
-	,'QUOTEMARKS' : {1: "'", 2: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : false
-	,'KEYWORDS' : {
-		'statements' : [
-			'include', 'require', 'include_once', 'require_once',
-			'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
-            'endif', 'switch', 'case', 'endswitch',
-			'return', 'break', 'continue'
-		]
-		,'reserved' : [
-			'_GET', '_POST', '_SESSION', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
-			'null', '__LINE__', '__FILE__',
-			'false', '&lt;?php', '?&gt;', '&lt;?',
-			'&lt;script language', '&lt;/script&gt;',
-			'true', 'var', 'default',
-			'function', 'class', 'new', '&amp;new', 'this',
-			'__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
-			'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
-			'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
-			'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
-			'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
-			'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
-			'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
-			
-		]
-		,'functions' : [
-			'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
-			'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
-			'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
-			'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv',
-			'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime',
-			'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar',
-			'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewi
 nddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown',
-			'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists
 ', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate',
-			'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
-			'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_i
 nsert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat',
-			'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_fi
 eld_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from',
-			'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport',
-			'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
-
-		]
-	}
-	,'OPERATORS' :[
-		'+', '-', '/', '*', '=', '<', '>', '%', '!', '&&', '||'
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'REGEXPS' : {
-		// highlight all variables ($...)
-		'variables' : {
-			'search' : '()(\\$\\w+)()'
-			,'class' : 'variables'
-			,'modifiers' : 'g'
-			,'execute' : 'before' // before or after
-		}
-	}
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #879EFA;'
-		,'KEYWORDS' : {
-			'reserved' : 'color: #48BDDF;'
-			,'functions' : 'color: #0040FD;'
-			,'statements' : 'color: #60CA00;'
-			}
-		,'OPERATORS' : 'color: #FF00FF;'
-		,'DELIMITERS' : 'color: #2B60FF;'
-		,'REGEXPS' : {
-			'variables' : 'color: #E0BD54;'
-		}		
-	}
-	,'AUTO_COMPLETION' :  {
-		"default": {	// the name of this definition group. It's posisble to have different rules inside the same definition file
-			"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^"	// \\s|\\.|
-						,"possible_words_letters": "[a-zA-Z0-9_\$]+"
-						,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
-						,"prefix_separator": "\\-\\>|\\:\\:"
-					}
-			,"CASE_SENSITIVE": true
-			,"MAX_TEXT_LENGTH": 100		// the maximum length of the text being analyzed before the cursor position
-			,"KEYWORDS": {
-					'': [	// the prefix of thoses items
-						/**
-						 * 0 : the keyword the user is typing
-						 * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
-						 * 		If empty the keyword will be displayed
-						 * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
-						 */
-						 ['$_POST']
-			    		,['$_GET']
-			    		,['$_SESSION']
-			    		,['$_SERVER']
-			    		,['$_FILES']
-			    		,['$_ENV']
-			    		,['$_COOKIE']
-			    		,['$_REQUEST']
-			    		// magic methods
-			    		,['__construct', '§( {@} )']
-			    		,['__destruct', '§( {@} )']
-			    		,['__sleep', '§( {@} )']
-			    		,['__wakeup', '§( {@} )']
-			    		,['__toString', '§( {@} )']
-			    		// include
-			    		,['include', '§ "{@}";']
-			    		,['include_once', '§ "{@}";']
-			    		,['require', '§ "{@}";']
-			    		,['require_once', '§ "{@}";']
-			    		// statements
-			    		,['for', '§( {@} )']
-			    		,['foreach', '§( {@} )']
-			    		,['if', '§( {@} )']
-			    		,['elseif', '§( {@} )']
-			    		,['while', '§( {@} )']
-			    		,['switch', '§( {@} )']
-			    		,['break']
-			    		,['case']
-			    		,['continue']
-			    		,['do']
-			    		,['else']
-			    		,['endif']
-			    		,['endswitch']
-			    		,['endwhile']
-			    		,['return']
-			    		// function
-			    		,['unset', '§( {@} )']
-					]
-				}
-			}
-		,"live": {	
-			
-			// class NAME: /class\W+([a-z]+)\W+/gi
-			// method: /^(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
-			// static: /^(public|private|protected)?\s+static\s+(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi 
-			// attributes: /(\$this\-\>|(?:var|public|protected|private)\W+\$)([a-z0-9\_]+)(?!\()\b/gi 
-			// 		v1 : /(\$this\-\>|var\W+|public\W+|protected\W+|private\W+)([a-z0-9\_]+)\W*(=|;)/gi 
-			// var type: /(\$(this\-\>)?[a-z0-9\_]+)\s*\=\s*new\s+([a-z0-9\_])+/gi 
-			
-			
-			"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^"	// \\s|\\.|
-						,"possible_words_letters": "[a-zA-Z0-9_\$]+"
-						,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
-						,"prefix_separator": "\\-\\>"
-					}
-			,"CASE_SENSITIVE": true
-			,"MAX_TEXT_LENGTH": 100		// the maximum length of the text being analyzed before the cursor position
-			,"KEYWORDS": {
-					'$this': [	// the prefix of thoses items
-						['test']
-					]
-				}
-			}
-	}
-};


[13/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_mgt.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_mgt.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_mgt.jsp
new file mode 100644
index 0000000..8a06de5
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_mgt.jsp
@@ -0,0 +1,240 @@
+<!--
+  ~ 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 import="org.apache.stratos.theme.mgt.ui.utils.ThemeUtil" %>
+<%@ 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">
+function setChecked(value,id){
+	var itemLength = document.forms['ThemeMgtForm'].elements['theme'].length; 
+	setCheckedValue(document.forms['ThemeMgtForm'].elements['theme'], value);
+	for(var i=0;i<=itemLength;i++){
+		YAHOO.util.Dom.removeClass('themeObj'+i,'sel-box');
+		YAHOO.util.Dom.addClass('themeObj'+i,'nor-box');
+	}	
+	YAHOO.util.Dom.removeClass('themeObj'+id,'nor-box');
+	YAHOO.util.Dom.addClass('themeObj'+id,'sel-box');
+	
+}
+function setCheckedValue(radioObj, newValue) {
+	if(!radioObj)
+		return;
+	var radioLength = radioObj.length;
+	if(radioLength == undefined) {
+		radioObj.checked = (radioObj.value == newValue.toString());
+		return;
+	}
+	for(var i = 0; i < radioLength; i++) {
+		radioObj[i].checked = false;
+		if(radioObj[i].value == newValue.toString()) {
+			radioObj[i].checked = true;
+		}
+	}
+}
+
+</script>
+<%--Syntax hylighter include--%>
+<script language="javascript" type="text/javascript" src="../tenant-theme/js/editarea/edit_area/edit_area_full.js"></script>
+
+<%
+    // the redirectWithStr will be used in the following operations
+    String redirectWithStr = request.getParameter("redirectWith");
+    if (redirectWithStr == null) {
+        redirectWithStr = "";
+    }
+%>
+
+<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="theme_mgt.jsp?redirectWith=<%=redirectWithStr%>";
+    </script>
+<%
+    }
+
+
+    ThemeMgtServiceClient client;
+    String[] allThemes;
+    try {
+        client = new ThemeMgtServiceClient(config, session);
+
+        allThemes = client.getAllThemes(redirectWithStr);
+    } catch (Exception e) {
+%>
+<jsp:forward page="../admin/error.jsp?<%=e.getMessage()%>"/>
+<%
+        return;
+    }
+    String parentPathToUpload = "/";
+    String logoFilename = "logo.gif";
+    
+    if (allThemes.length < 2) {
+        return;
+    }
+
+    // to derive the thumbnail url
+    //Customization of UI theming per tenant
+
+
+%>
+
+
+<carbon:breadcrumb label="resources"
+                       resourceBundle="org.wso2.carbon.registry.resource.ui.i18n.Resources"
+                       topPage="true" request="<%=request%>"/>
+<div id="middle">
+
+<h2> Theme Management </h2>
+
+<div id="workArea">
+    
+<div class="subtopic">Select a Theme</div>
+<div class="subcontent">
+<form id="ThemeMgtForm" name="ThemeMgtForm" action="theme_mgt_ajaxprocessor.jsp?redirectWith=<%=redirectWithStr%>" method="post">
+
+<%
+String selectedTheme = allThemes[0];
+
+for (int i = 1; i < allThemes.length; i ++) {
+    String theme = allThemes[i];
+    String checkedStr = "";
+    String thumbUrl = ThemeUtil.getThumbUrl(request, theme);
+    if (theme.equals(selectedTheme)) {
+        checkedStr = "checked";
+    }
+%>
+<a onclick="setChecked('<%=theme%>','<%=i%>')">
+<div <%if (theme.equals(selectedTheme)) {%>class="sel-box"<% } else { %>class="nor-box"<%}%> id="themeObj<%=i%>">
+	<span><%=theme%></span>
+	<div>
+		<input style="display:none" type="radio"  name="theme" checked="<%=checkedStr%>" value="<%=theme%>"/>
+		<div><img src="<%=thumbUrl%>"/></div>
+	</div>
+</div>
+</a>
+<%
+}
+%>
+<div style="clear:both;"></div>
+<p>
+<%
+    if (redirectWithStr.equals("")) {
+        // mean the user is logged in
+%>
+<input type="submit" value="Update"/>
+<%
+    } else {
+%>
+<input type="submit" value="Apply theme"/>
+<input type="button" value="Skip" onclick="javascript:location.href='../admin/login.jsp'"/>
+<%
+    }
+%>
+</p>
+</form>
+</div>
+
+<%
+    if (redirectWithStr.equals("")) {
+        // mean the user is logged in
+%>
+    
+<div class="subtopic">Customize the theme</div>
+<div class="subcontent">
+<a href="theme_advanced.jsp">Click here</a>  to customize the current theme
+</div>
+</div>
+
+<%
+    }
+%>
+    
+</div>
+
+</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_mgt_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_mgt_ajaxprocessor.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_mgt_ajaxprocessor.jsp
new file mode 100644
index 0000000..5dc7cd2
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_mgt_ajaxprocessor.jsp
@@ -0,0 +1,49 @@
+<!--
+  ~ 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.CarbonConstants" %>
+<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
+<%@ page import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
+<%@ page import="java.util.UUID" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
+<carbon:jsi18n
+		resourceBundle="org.apache.stratos.theme.mgt.ui.i18n.JSResources"
+		request="<%=request%>" />
+<%
+
+    String redirectWithStr = request.getParameter("redirectWith");
+    if (redirectWithStr == null) {
+        redirectWithStr = "";
+    }
+    try {
+        ThemeMgtServiceClient client = new ThemeMgtServiceClient(config, session);
+        String themeName = request.getParameter("theme");
+        request.getSession().setAttribute(
+                CarbonConstants.THEME_URL_RANDOM_SUFFIX_SESSION_KEY, UUID.randomUUID().toString());        
+        client.applyTheme(themeName, redirectWithStr);
+        if (redirectWithStr.equals("")) {
+            response.sendRedirect("../tenant-theme/theme_mgt.jsp?updateTheme=Success&redirectWith=" + redirectWithStr);
+        } else {
+            response.sendRedirect("../admin/login.jsp");
+        }
+    } catch (UIException e) {
+        response.sendRedirect("../tenant-theme/theme_mgt.jsp?updateTheme=Failed&redirectWith=" + redirectWithStr);
+    }
+%>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/update_text_content.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/update_text_content.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/update_text_content.jsp
new file mode 100644
index 0000000..3fe0adb
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/update_text_content.jsp
@@ -0,0 +1,52 @@
+<!--
+  ~ 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.UIException" %>
+<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
+<%@ page import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<fmt:bundle basename="org.wso2.carbon.registry.resource.ui.i18n.Resources">
+
+    <%
+        try {
+            String resourcePath = request.getParameter("resourcePath");
+            String contentText = request.getParameter("contentText");
+
+             String cookie = (String) request.
+                    getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+
+            try {
+                ThemeMgtServiceClient client =
+                        new ThemeMgtServiceClient(cookie, config, request.getSession());
+                client.updateTextContent(resourcePath, contentText);
+
+            } catch (Exception e) {
+                String msg = "Failed to update text content of the resource " +
+                        resourcePath + ". " + e.getMessage();
+                throw new UIException(msg, e);
+            }
+        } catch (UIException e) {
+            response.setStatus(500);
+            %><fmt:message key="error.updating.text.message"/>.<br/><%=e.getMessage()%><%
+            return;
+        }
+%>
+
+</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/pom.xml b/components/org.apache.stratos.theme.mgt/pom.xml
new file mode 100644
index 0000000..71d44b2
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/pom.xml
@@ -0,0 +1,106 @@
+<!--
+     ~  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.
+     ~
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-components-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+	<relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+	<artifactId>org.apache.stratos.theme.mgt</artifactId>
+	<version>3.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>Apache Stratos - Tenant Theme Configurations</name>
+
+    <build>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Bundle-Name>${project.artifactId}</Bundle-Name>
+                        <Axis2Module>${project.artifactId}-${project.version}</Axis2Module>
+                        <Private-Package>
+                            org.apache.stratos.theme.mgt.internal.*,
+                            org.apache.stratos.theme.mgt.services.*,
+                        </Private-Package>
+                        <Export-Package>
+                            org.apache.stratos.theme.mgt.util.*,
+                            org.apache.stratos.theme.mgt.module.*,
+                            org.apache.stratos.theme.mgt.handler.*,
+                        </Export-Package>
+                        <Import-Package>
+                            org.wso2.carbon.registry.core.*;version=1.0.1,
+                            org.wso2.carbon.registry.resource.*,
+                            !javax.xml.namespace,
+                            javax.xml.namespace; version=0.0.0,
+                            javax.servlet;version="${imp.pkg.version.javax.servlet}",
+                            javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
+                            org.apache.axiom.*; version="${axiom.osgi.version.range}",
+                            *;resolution:=optional
+                        </Import-Package>
+                         <DynamicImport-Package>*</DynamicImport-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.resource</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.stratos.common</artifactId>
+        </dependency>
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/internal/TenantThemeMgtServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/internal/TenantThemeMgtServiceComponent.java b/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/internal/TenantThemeMgtServiceComponent.java
new file mode 100644
index 0000000..ac3a785
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/internal/TenantThemeMgtServiceComponent.java
@@ -0,0 +1,99 @@
+/*
+*  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+*  WSO2 Inc. 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.
+*/
+package org.apache.stratos.theme.mgt.internal;
+
+import org.wso2.carbon.stratos.common.listeners.TenantMgtListener;
+import org.apache.stratos.theme.mgt.util.ThemeLoadingListener;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.framework.BundleContext;
+import org.wso2.carbon.registry.core.service.RegistryService;
+import org.apache.stratos.theme.mgt.util.ThemeUtil;
+import org.wso2.carbon.user.core.service.RealmService;
+import org.wso2.carbon.utils.ConfigurationContextService;
+
+import java.util.Hashtable;
+
+/**
+ * @scr.component name="org.wso2.carbon.governance.theme.tenant" immediate="true"
+ * @scr.reference name="registry.service"
+ * interface="org.wso2.carbon.registry.core.service.RegistryService" cardinality="1..1"
+ * policy="dynamic" bind="setRegistryService" unbind="unsetRegistryService"
+ * @scr.reference name="user.realmservice.default" interface="org.wso2.carbon.user.core.service.RealmService"
+ * cardinality="1..1" policy="dynamic" bind="setRealmService"
+ * unbind="unsetRealmService"
+ * @scr.reference name="config.context.service"
+ *                interface="org.wso2.carbon.utils.ConfigurationContextService" cardinality="1..1"
+ *                policy="dynamic" bind="setConfigurationContextService"
+ *                unbind="unsetConfigurationContextService"
+ *
+ */
+public class TenantThemeMgtServiceComponent {
+    private static Log log = LogFactory.getLog(TenantThemeMgtServiceComponent.class);
+    private static ConfigurationContextService configContextService = null;
+
+    protected void activate(ComponentContext context) {
+        try {
+            ThemeUtil.loadResourceThemes();
+
+            // registering the Theme Logding Listener
+            BundleContext bundleContext = context.getBundleContext();
+            bundleContext.registerService(TenantMgtListener.class.getName(),
+                new ThemeLoadingListener(), new Hashtable());
+            
+            log.debug("******* Multitenancy Theme Config bundle is activated ******* ");
+        } catch (Exception e) {
+            log.error("******* Multitenancy Theme Config bundle failed activating ****", e);
+        }
+    }
+
+    protected void deactivate(ComponentContext context) {
+        log.debug("******* Multitenancy Theme Config bundle is deactivated ******* ");
+    }
+
+    protected void setRegistryService(RegistryService registryService) {
+        ThemeUtil.setRegistryService(registryService);
+    }
+
+    protected void unsetRegistryService(RegistryService registryService) {
+        ThemeUtil.setRegistryService(null);
+    }
+
+    protected void setRealmService(RealmService realmService) {
+        ThemeUtil.setRealmService(realmService);
+    }
+
+    protected void unsetRealmService(RealmService realmService) {
+        ThemeUtil.setRealmService(null);
+    }
+
+    protected void setConfigurationContextService(ConfigurationContextService contextService) {
+        if (log.isDebugEnabled()) {
+            log.debug("Setting the ConfigurationContext");
+        }
+        configContextService = contextService;
+    }
+
+    protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
+        if (log.isDebugEnabled()) {
+            log.debug("Unsetting the ConfigurationContext");
+        }
+    }
+   
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/services/ThemeMgtService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/services/ThemeMgtService.java b/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/services/ThemeMgtService.java
new file mode 100644
index 0000000..fe49867
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/services/ThemeMgtService.java
@@ -0,0 +1,195 @@
+/*
+ *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. 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.
+ *
+ */
+package org.apache.stratos.theme.mgt.services;
+
+import org.wso2.carbon.core.AbstractAdmin;
+import org.wso2.carbon.registry.core.Registry;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.wso2.carbon.registry.core.Collection;
+import org.wso2.carbon.registry.core.Resource;
+import org.apache.stratos.theme.mgt.util.ThemeUtil;
+import org.wso2.carbon.registry.resource.beans.*;
+import org.wso2.carbon.registry.resource.services.utils.*;
+import org.wso2.carbon.registry.common.ResourceData;
+import org.wso2.carbon.registry.common.utils.RegistryUtil;
+
+import javax.activation.DataHandler;
+import java.util.ArrayList;
+import java.util.Stack;
+
+public class ThemeMgtService extends AbstractAdmin {
+    public ResourceTreeEntryBean getResourceTreeEntry(String resourcePath) throws Exception {
+        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return GetResourceTreeEntryUtil.getResourceTreeEntry(resourcePath, themeRegistry);
+    }
+
+    public ContentBean getContentBean(String path) throws Exception {
+        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return ContentUtil.getContent(path, themeRegistry);
+    }
+
+
+    public CollectionContentBean getCollectionContent(String path) throws Exception {
+        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return ContentUtil.getCollectionContent(path, themeRegistry);
+    }
+
+    public ResourceData[] getResourceData(String[] paths) throws Exception {
+        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return ContentUtil.getResourceData(paths, themeRegistry);
+    }
+    
+    public String addCollection(
+            String parentPath, String collectionName, String mediaType, String description)
+            throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return AddCollectionUtil.process(parentPath, collectionName, mediaType, description, registry);
+    }
+
+    public void addResource(String path, String mediaType, String description, DataHandler content,
+                            String symlinkLocation, String tenantPass)
+            throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        if (registry == null) {
+            registry = ThemeUtil.getThemeRegistryFromTenantPass(tenantPass);
+        }
+        AddResourceUtil.addResource(path, mediaType, description, content, symlinkLocation, registry,new String[0][0]);
+    }
+
+    public void importResource(
+            String parentPath,
+            String resourceName,
+            String mediaType,
+            String description,
+            String fetchURL,
+            String symlinkLocation,
+            String tenantPass) throws Exception {
+
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        if (registry == null) {
+            registry = ThemeUtil.getThemeRegistryFromTenantPass(tenantPass);
+        }
+        ImportResourceUtil.importResource(parentPath, resourceName, mediaType, description, fetchURL,
+                        symlinkLocation, registry,new String[0][0]);
+    }
+
+    public void addTextResource(
+            String parentPath,
+            String fileName,
+            String mediaType,
+            String description,
+            String content) throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        AddTextResourceUtil.addTextResource(parentPath, fileName, mediaType, description, content, registry);
+    }
+
+    public MetadataBean getMetadata(String path) throws Exception {
+        RegistryUtil.setSessionResourcePath(path);
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return MetadataPopulator.populate(path, registry);
+    }
+
+    public String getSessionResourcePath() throws Exception {
+        return RegistryUtil.getSessionResourcePath();
+    }
+
+    public String getTextContent(String path) throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return GetTextContentUtil.getTextContent(path, registry);
+    }
+
+    public void updateTextContent(String resourcePath, String contentText) throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        UpdateTextContentUtil.updateTextContent(resourcePath, contentText, registry);
+    }
+
+    public ContentDownloadBean getContentDownloadBean(String path) throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return GetDownloadContentUtil.getContentDownloadBean(path, registry);
+    }
+
+    public void renameResource(
+            String parentPath, String oldResourcePath, String newResourceName)
+            throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        RenameResourceUtil.renameResource(parentPath, oldResourcePath, newResourceName, registry);
+    }
+
+    public void delete(String pathToDelete) throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        DeleteUtil.process(pathToDelete, registry);
+    }
+
+    public String[] getAllPaths() throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        // will use a stack in place of calling recurssion
+
+        
+        ArrayList<String> paths = new ArrayList<String>();
+        Stack<Collection> parentCollections = new Stack<Collection>();
+        Collection rootCollection = (Collection)registry.get("/");
+        parentCollections.push(rootCollection);
+        while (!parentCollections.empty()) {
+            Collection parentCollection = parentCollections.pop();
+            String[] childs = parentCollection.getChildren();
+            for (String childPath: childs) {
+                String pathToAdd = childPath.substring(1);
+                paths.add(pathToAdd);
+                Resource resource = registry.get(childPath);
+                if (resource instanceof Collection) {
+                    Collection c = (Collection)resource;
+                    parentCollections.push(c);
+                }
+            }
+        }
+        return paths.toArray(new String[paths.size()]);
+    }
+
+    public String[] getAllThemes(String tenantPass) throws Exception {
+        String[] allThemes = ThemeUtil.getAvailableThemes();
+        //we are readding the selected theme as the first element
+        String currentTheme = ThemeUtil.getCurrentTheme(tenantPass, (UserRegistry) getGovernanceSystemRegistryIfLoggedIn());
+        String[] returnVal = new String[allThemes.length + 1];
+        returnVal[0] = currentTheme;
+        for (int i = 0; i < allThemes.length; i ++) {
+            returnVal[i + 1] = allThemes[i];
+        }
+        return returnVal;
+    }
+
+    public void applyTheme(String themeName, String tenantPass) throws Exception {
+        ThemeUtil.applyTheme(themeName, tenantPass, (UserRegistry) getGovernanceSystemRegistryIfLoggedIn());
+        ThemeUtil.removeTheUUID(tenantPass);
+    }
+
+    private Registry getGovernanceSystemRegistryIfLoggedIn() {
+        UserRegistry tempRegistry = (UserRegistry)getConfigUserRegistry();
+        if (tempRegistry != null) {
+            try {
+                return ThemeUtil.getRegistryService().getGovernanceSystemRegistry(
+                        tempRegistry.getTenantId());
+            } catch (Exception ignored) {
+                // The Registry service should not fail if the above if condition holds.
+                return null;
+            }
+        }
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/util/ThemeLoadingListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/util/ThemeLoadingListener.java b/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/util/ThemeLoadingListener.java
new file mode 100644
index 0000000..c1f3fcf
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/util/ThemeLoadingListener.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+package org.apache.stratos.theme.mgt.util;
+
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.stratos.common.beans.TenantInfoBean;
+import org.wso2.carbon.stratos.common.exception.StratosException;
+import org.wso2.carbon.stratos.common.listeners.TenantMgtListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class ThemeLoadingListener implements TenantMgtListener {
+    private static final Log log = LogFactory.getLog(ThemeLoadingListener.class);
+    private static final int EXEC_ORDER = 10;
+    public void onTenantCreate(TenantInfoBean tenantInfo) throws StratosException {
+        try {
+            ThemeUtil.loadTheme(tenantInfo.getTenantId());
+        } catch (RegistryException e) {
+            String msg = "Error in loading the theme for the tenant: " 
+                + tenantInfo.getTenantDomain() + ".";
+            log.error(msg, e);
+            throw new StratosException(msg, e);
+        }
+    }
+    
+    public void onTenantUpdate(TenantInfoBean tenantInfo) throws StratosException {
+        // doing nothing
+    }
+    
+    public void onTenantRename(int tenantId, String oldDomainName,
+                             String newDomainName) throws StratosException {
+        // doing nothing
+    }
+
+    public int getListenerOrder() {
+        return EXEC_ORDER;
+    }
+
+    public void onTenantInitialActivation(int tenantId) throws StratosException {
+        // doing nothing
+        
+    }
+
+    public void onTenantActivation(int tenantId) throws StratosException {
+        // doing nothing
+        
+    }
+
+    public void onTenantDeactivation(int tenantId) throws StratosException {
+        // doing nothing
+        
+    }
+
+    public void onSubscriptionPlanChange(int tenentId, String oldPlan, 
+                                         String newPlan) throws StratosException {
+        // doing nothing
+        
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/util/ThemeUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/util/ThemeUtil.java b/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/util/ThemeUtil.java
new file mode 100644
index 0000000..d69bcea
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/src/main/java/org/apache/stratos/theme/mgt/util/ThemeUtil.java
@@ -0,0 +1,302 @@
+/*
+ * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+package org.apache.stratos.theme.mgt.util;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.registry.core.Collection;
+import org.wso2.carbon.registry.core.Registry;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.service.RegistryService;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.wso2.carbon.registry.core.utils.RegistryUtils;
+import org.wso2.carbon.stratos.common.constants.StratosConstants;
+import org.wso2.carbon.stratos.common.util.CommonUtil;
+import org.wso2.carbon.user.core.service.RealmService;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.activation.MimetypesFileTypeMap;
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ThemeUtil {
+
+    private static final Log log = LogFactory.getLog(ThemeUtil.class);
+
+    private static RegistryService registryService;
+    private static RealmService realmService;
+    private static final String CURRENT_THEME_KEY = "current-theme";
+    private static final String THEME_PATH = "/repository/theme";
+    private static final String THEME_ADMIN_PATH = THEME_PATH + "/admin";
+
+    public static synchronized void setRegistryService(RegistryService service) {
+        if (registryService == null) {
+            registryService = service;
+        }
+    }
+    public static RegistryService getRegistryService() {
+        return registryService;
+    }
+
+    public static synchronized void setRealmService(RealmService service) {
+        if (realmService == null) {
+            realmService = service;
+        }
+    }
+
+    public static RealmService getRealmService() {
+        return realmService;
+    }
+
+    public static UserRegistry getThemeMgtSystemRegistry(String tenantPass) throws RegistryException {
+        if (tenantPass != null && !tenantPass.equals("")) {
+            // tenant 0th system registry
+            UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
+            Resource resource = systemRegistry.get(
+                    StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass);
+            String tenantIdStr = resource.getProperty("tenantId");
+            int tenantId = Integer.parseInt(tenantIdStr);
+
+            return registryService.getGovernanceSystemRegistry(tenantId);
+        }
+
+        return null;
+    }
+
+    public static void removeTheUUID(String tenantPass) throws RegistryException {
+        if (tenantPass != null && !tenantPass.equals("")) {
+            // tenant 0th system registry
+            UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
+            if(systemRegistry.resourceExists(
+                    StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass)) {
+                systemRegistry.delete(
+                        StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass);
+            }
+        }
+    }
+
+    public static void transferAllThemesToRegistry(File rootDirectory, Registry registry,
+                                                String registryPath)
+                                                throws RegistryException {
+        try {
+            // adding the common media types
+            Map<String, String> extensionToMediaTypeMap = new HashMap<String, String>();
+            extensionToMediaTypeMap.put("gif", "image/gif");
+            extensionToMediaTypeMap.put("jpg", "image/jpeg");
+            extensionToMediaTypeMap.put("jpe", "image/jpeg");
+            extensionToMediaTypeMap.put("jpeg", "image/jpeg");
+            extensionToMediaTypeMap.put("png", "image/png");
+            extensionToMediaTypeMap.put("css", "text/css");
+            
+            File[] filesAndDirs = rootDirectory.listFiles();
+            if (filesAndDirs == null) {
+                return;
+            }
+            List<File> filesDirs = Arrays.asList(filesAndDirs);
+
+            for (File file : filesDirs) {
+                String filename = file.getName();
+                String fileRegistryPath = registryPath + RegistryConstants.PATH_SEPARATOR + filename;
+                if (!file.isFile()) {
+                    // This is a Directory add a new collection
+                    // This path is used to store the file resource under registry
+                    Collection newCollection = registry.newCollection();
+                    registry.put(fileRegistryPath, newCollection);
+
+                    // recur
+                    transferAllThemesToRegistry(file, registry, fileRegistryPath);
+                } else {
+                    // Add the file to registry
+                    Resource newResource = registry.newResource();
+                    String mediaType = null;
+                    if (filename.contains(".")) {
+                        String fileExt = filename.substring(filename.lastIndexOf(".") + 1);
+                        mediaType = extensionToMediaTypeMap.get(fileExt.toLowerCase());
+                    }
+                    if (mediaType == null) {
+                        mediaType = new MimetypesFileTypeMap().getContentType(file);
+                    }
+                    newResource.setMediaType(mediaType);
+                    newResource.setContentStream(new FileInputStream(file));
+                    registry.put(fileRegistryPath, newResource);
+                }
+            }
+        } catch (Exception e) {
+            String msg = "Error loading theme to the sytem registry for registry path: " + registryPath;
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+
+    }
+
+    public static UserRegistry getThemeRegistryFromTenantPass(String tenantPass) throws RegistryException {
+        UserRegistry themeMgtSystemRegistry = getThemeMgtSystemRegistry(tenantPass);
+        if (themeMgtSystemRegistry != null) {
+            return themeMgtSystemRegistry.getChrootedRegistry(THEME_ADMIN_PATH);
+        } else {
+            return null;
+        }
+    }
+
+    public static UserRegistry getThemeRegistry(Registry registry) throws RegistryException {
+        if (registry == null) {
+            return null;
+        }
+        return ((UserRegistry)registry).getChrootedRegistry(THEME_ADMIN_PATH);
+    }
+
+    public static void loadResourceThemes() throws RegistryException {
+        // loads the tenant0's system registry
+        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
+        // we are not checking whether the theme resources already exists to make sure, the newly
+        // added themes can be loaded just at the activation of the component
+        String themeRootFileName = System.getProperty(ServerConstants.CARBON_HOME) + File
+                .separator + "resources" + File.separator + "allthemes";
+        // we are always making this accessible from anyware
+        File themeRootFile = new File(themeRootFileName);
+        ThemeUtil.transferAllThemesToRegistry(themeRootFile, systemRegistry, StratosConstants.ALL_THEMES_PATH);
+
+        CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + StratosConstants.ALL_THEMES_PATH,
+                systemRegistry.getUserRealm());
+    }
+
+    public static String[] getAvailableThemes() throws RegistryException {
+        Registry systemRegistry = registryService.getGovernanceSystemRegistry();
+        if (!systemRegistry.resourceExists(StratosConstants.ALL_THEMES_PATH)) {
+            log.info("The theme root path: " + StratosConstants.ALL_THEMES_PATH + " doesn't exist.");
+            return new String[0];
+        }
+        Collection c = (Collection)systemRegistry.get(StratosConstants.ALL_THEMES_PATH);
+        String[] childPaths = c.getChildren();
+        for (int i = 0; i < childPaths.length; i ++) {
+            childPaths[i] = RegistryUtils.getResourceName(childPaths[i]);
+        }
+        return childPaths;
+    }
+
+
+    public static void loadTheme(int tenantId) throws RegistryException {
+        // get the util functions from the theme
+        // this is always the 0th system reigstry
+        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry(tenantId);
+        String[] allThemes = getAvailableThemes();
+        if (allThemes.length == 0) {
+            log.info("No themes found.");
+            return;
+        }
+        int randomNumber = (int)(Math.random() * allThemes.length);
+        String ourLuckyTheme = allThemes[randomNumber];
+        // anway now we are hard coding the default theme to be loaded here,
+        ourLuckyTheme = "Default";
+        applyThemeForDomain(ourLuckyTheme, systemRegistry);
+    }
+
+    public static void applyTheme(String themeName, String tenantPass, UserRegistry systemTenantRegistry) throws Exception {
+        if (systemTenantRegistry == null) {
+            systemTenantRegistry = getThemeMgtSystemRegistry(tenantPass);
+        }
+        applyThemeForDomain(themeName, systemTenantRegistry);
+    }
+
+    public static void applyThemeForDomain(String themeName, UserRegistry systemTenantRegistry)
+                throws RegistryException {
+        String sourcePath = StratosConstants.ALL_THEMES_PATH + "/" + themeName; // tenant 0s path
+        String targetPath = THEME_PATH;
+
+        UserRegistry systemZeroRegistry = registryService.getGovernanceSystemRegistry();
+
+        // if the themes doesn't exist we would exclude applying it
+        if (!systemZeroRegistry.resourceExists(sourcePath)) {
+            log.info("The theme source path: " + sourcePath + " doesn't exist.");
+            return;
+        }
+
+        // first delete the old one, or we can backup it if required
+        // we are anyway getting a backup of the logo
+        Resource logoR = null;
+        String logoPath = targetPath + "/admin/" + "logo.gif";
+        if (systemTenantRegistry.resourceExists(targetPath)) {
+            if (systemTenantRegistry.resourceExists(logoPath)) {
+                logoR = systemTenantRegistry.get(logoPath);
+            }
+            if (logoR != null) {
+                logoR.getContent(); // we will load the content as well.
+            }
+            systemTenantRegistry.delete(targetPath);
+        }
+
+        // copy theme resources to tenant's registry 
+        addResourcesRecursively(sourcePath, targetPath, systemZeroRegistry, systemTenantRegistry);
+
+        // replace the logo
+        if (logoR != null) {
+            systemTenantRegistry.put(logoPath, logoR);
+        }
+
+        // remember the theme name
+        Resource tenantThemeCollection = systemTenantRegistry.get(targetPath);
+        tenantThemeCollection.setProperty(CURRENT_THEME_KEY, themeName);
+        systemTenantRegistry.put(targetPath, tenantThemeCollection);
+
+        try {
+            CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + targetPath,
+                    systemTenantRegistry.getUserRealm());
+            CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + 
+                    StratosConstants.ALL_THEMES_PATH,
+                    systemTenantRegistry.getUserRealm());
+        } catch (RegistryException e) {
+            String msg = "Error in giving authorizations of the " + targetPath +
+                    " to the anonymous user and everyone role.";
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+    private static void addResourcesRecursively(String sourcePath, String targetPath,
+                                                Registry superRegistry, Registry tenantRegistry)
+            throws RegistryException {
+        Resource resource = superRegistry.get(sourcePath);
+        tenantRegistry.put(targetPath, resource);
+
+        if (resource instanceof Collection) {
+            String[] children = ((Collection) resource).getChildren();
+            for (String child : children) {
+                String childName = child.substring(child.lastIndexOf("/"), child.length());
+                addResourcesRecursively(child, targetPath + childName, superRegistry, tenantRegistry);
+            }
+        }
+    }
+
+    public static String getCurrentTheme(String tenantPass, UserRegistry registry) throws Exception {
+        if (registry == null) {
+            registry = getThemeMgtSystemRegistry(tenantPass);
+        }
+        String targetPath = THEME_PATH;
+
+        // remember the theme name
+        Resource tenantThemeCollection = registry.get(targetPath);
+        if (tenantThemeCollection == null) {
+            return null;
+        }
+        return tenantThemeCollection.getProperty(CURRENT_THEME_KEY);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/internal/TenantThemeMgtServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/internal/TenantThemeMgtServiceComponent.java b/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/internal/TenantThemeMgtServiceComponent.java
new file mode 100644
index 0000000..4769b85
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/internal/TenantThemeMgtServiceComponent.java
@@ -0,0 +1,99 @@
+/*
+*  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+*  WSO2 Inc. 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.
+*/
+package org.wso2.carbon.theme.mgt.internal;
+
+import org.wso2.carbon.stratos.common.listeners.TenantMgtListener;
+import org.wso2.carbon.theme.mgt.util.ThemeLoadingListener;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.framework.BundleContext;
+import org.wso2.carbon.registry.core.service.RegistryService;
+import org.wso2.carbon.theme.mgt.util.ThemeUtil;
+import org.wso2.carbon.user.core.service.RealmService;
+import org.wso2.carbon.utils.ConfigurationContextService;
+
+import java.util.Hashtable;
+
+/**
+ * @scr.component name="org.wso2.carbon.governance.theme.tenant" immediate="true"
+ * @scr.reference name="registry.service"
+ * interface="org.wso2.carbon.registry.core.service.RegistryService" cardinality="1..1"
+ * policy="dynamic" bind="setRegistryService" unbind="unsetRegistryService"
+ * @scr.reference name="user.realmservice.default" interface="org.wso2.carbon.user.core.service.RealmService"
+ * cardinality="1..1" policy="dynamic" bind="setRealmService"
+ * unbind="unsetRealmService"
+ * @scr.reference name="config.context.service"
+ *                interface="org.wso2.carbon.utils.ConfigurationContextService" cardinality="1..1"
+ *                policy="dynamic" bind="setConfigurationContextService"
+ *                unbind="unsetConfigurationContextService"
+ *
+ */
+public class TenantThemeMgtServiceComponent {
+    private static Log log = LogFactory.getLog(TenantThemeMgtServiceComponent.class);
+    private static ConfigurationContextService configContextService = null;
+
+    protected void activate(ComponentContext context) {
+        try {
+            ThemeUtil.loadResourceThemes();
+
+            // registering the Theme Logding Listener
+            BundleContext bundleContext = context.getBundleContext();
+            bundleContext.registerService(TenantMgtListener.class.getName(),
+                new ThemeLoadingListener(), new Hashtable());
+            
+            log.debug("******* Multitenancy Theme Config bundle is activated ******* ");
+        } catch (Exception e) {
+            log.error("******* Multitenancy Theme Config bundle failed activating ****", e);
+        }
+    }
+
+    protected void deactivate(ComponentContext context) {
+        log.debug("******* Multitenancy Theme Config bundle is deactivated ******* ");
+    }
+
+    protected void setRegistryService(RegistryService registryService) {
+        ThemeUtil.setRegistryService(registryService);
+    }
+
+    protected void unsetRegistryService(RegistryService registryService) {
+        ThemeUtil.setRegistryService(null);
+    }
+
+    protected void setRealmService(RealmService realmService) {
+        ThemeUtil.setRealmService(realmService);
+    }
+
+    protected void unsetRealmService(RealmService realmService) {
+        ThemeUtil.setRealmService(null);
+    }
+
+    protected void setConfigurationContextService(ConfigurationContextService contextService) {
+        if (log.isDebugEnabled()) {
+            log.debug("Setting the ConfigurationContext");
+        }
+        configContextService = contextService;
+    }
+
+    protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
+        if (log.isDebugEnabled()) {
+            log.debug("Unsetting the ConfigurationContext");
+        }
+    }
+   
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/services/ThemeMgtService.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/services/ThemeMgtService.java b/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/services/ThemeMgtService.java
new file mode 100644
index 0000000..ea21565
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/services/ThemeMgtService.java
@@ -0,0 +1,195 @@
+/*
+ *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. 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.
+ *
+ */
+package org.wso2.carbon.theme.mgt.services;
+
+import org.wso2.carbon.core.AbstractAdmin;
+import org.wso2.carbon.registry.core.Registry;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.wso2.carbon.registry.core.Collection;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.theme.mgt.util.ThemeUtil;
+import org.wso2.carbon.registry.resource.beans.*;
+import org.wso2.carbon.registry.resource.services.utils.*;
+import org.wso2.carbon.registry.common.ResourceData;
+import org.wso2.carbon.registry.common.utils.RegistryUtil;
+
+import javax.activation.DataHandler;
+import java.util.ArrayList;
+import java.util.Stack;
+
+public class ThemeMgtService extends AbstractAdmin {
+    public ResourceTreeEntryBean getResourceTreeEntry(String resourcePath) throws Exception {
+        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return GetResourceTreeEntryUtil.getResourceTreeEntry(resourcePath, themeRegistry);
+    }
+
+    public ContentBean getContentBean(String path) throws Exception {
+        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return ContentUtil.getContent(path, themeRegistry);
+    }
+
+
+    public CollectionContentBean getCollectionContent(String path) throws Exception {
+        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return ContentUtil.getCollectionContent(path, themeRegistry);
+    }
+
+    public ResourceData[] getResourceData(String[] paths) throws Exception {
+        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return ContentUtil.getResourceData(paths, themeRegistry);
+    }
+    
+    public String addCollection(
+            String parentPath, String collectionName, String mediaType, String description)
+            throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return AddCollectionUtil.process(parentPath, collectionName, mediaType, description, registry);
+    }
+
+    public void addResource(String path, String mediaType, String description, DataHandler content,
+                            String symlinkLocation, String tenantPass)
+            throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        if (registry == null) {
+            registry = ThemeUtil.getThemeRegistryFromTenantPass(tenantPass);
+        }
+        AddResourceUtil.addResource(path, mediaType, description, content, symlinkLocation, registry,new String[0][0]);
+    }
+
+    public void importResource(
+            String parentPath,
+            String resourceName,
+            String mediaType,
+            String description,
+            String fetchURL,
+            String symlinkLocation,
+            String tenantPass) throws Exception {
+
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        if (registry == null) {
+            registry = ThemeUtil.getThemeRegistryFromTenantPass(tenantPass);
+        }
+        ImportResourceUtil.importResource(parentPath, resourceName, mediaType, description, fetchURL,
+                        symlinkLocation, registry,new String[0][0]);
+    }
+
+    public void addTextResource(
+            String parentPath,
+            String fileName,
+            String mediaType,
+            String description,
+            String content) throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        AddTextResourceUtil.addTextResource(parentPath, fileName, mediaType, description, content, registry);
+    }
+
+    public MetadataBean getMetadata(String path) throws Exception {
+        RegistryUtil.setSessionResourcePath(path);
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return MetadataPopulator.populate(path, registry);
+    }
+
+    public String getSessionResourcePath() throws Exception {
+        return RegistryUtil.getSessionResourcePath();
+    }
+
+    public String getTextContent(String path) throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return GetTextContentUtil.getTextContent(path, registry);
+    }
+
+    public void updateTextContent(String resourcePath, String contentText) throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        UpdateTextContentUtil.updateTextContent(resourcePath, contentText, registry);
+    }
+
+    public ContentDownloadBean getContentDownloadBean(String path) throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        return GetDownloadContentUtil.getContentDownloadBean(path, registry);
+    }
+
+    public void renameResource(
+            String parentPath, String oldResourcePath, String newResourceName)
+            throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        RenameResourceUtil.renameResource(parentPath, oldResourcePath, newResourceName, registry);
+    }
+
+    public void delete(String pathToDelete) throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        DeleteUtil.process(pathToDelete, registry);
+    }
+
+    public String[] getAllPaths() throws Exception {
+        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
+        // will use a stack in place of calling recurssion
+
+        
+        ArrayList<String> paths = new ArrayList<String>();
+        Stack<Collection> parentCollections = new Stack<Collection>();
+        Collection rootCollection = (Collection)registry.get("/");
+        parentCollections.push(rootCollection);
+        while (!parentCollections.empty()) {
+            Collection parentCollection = parentCollections.pop();
+            String[] childs = parentCollection.getChildren();
+            for (String childPath: childs) {
+                String pathToAdd = childPath.substring(1);
+                paths.add(pathToAdd);
+                Resource resource = registry.get(childPath);
+                if (resource instanceof Collection) {
+                    Collection c = (Collection)resource;
+                    parentCollections.push(c);
+                }
+            }
+        }
+        return paths.toArray(new String[paths.size()]);
+    }
+
+    public String[] getAllThemes(String tenantPass) throws Exception {
+        String[] allThemes = ThemeUtil.getAvailableThemes();
+        //we are readding the selected theme as the first element
+        String currentTheme = ThemeUtil.getCurrentTheme(tenantPass, (UserRegistry) getGovernanceSystemRegistryIfLoggedIn());
+        String[] returnVal = new String[allThemes.length + 1];
+        returnVal[0] = currentTheme;
+        for (int i = 0; i < allThemes.length; i ++) {
+            returnVal[i + 1] = allThemes[i];
+        }
+        return returnVal;
+    }
+
+    public void applyTheme(String themeName, String tenantPass) throws Exception {
+        ThemeUtil.applyTheme(themeName, tenantPass, (UserRegistry) getGovernanceSystemRegistryIfLoggedIn());
+        ThemeUtil.removeTheUUID(tenantPass);
+    }
+
+    private Registry getGovernanceSystemRegistryIfLoggedIn() {
+        UserRegistry tempRegistry = (UserRegistry)getConfigUserRegistry();
+        if (tempRegistry != null) {
+            try {
+                return ThemeUtil.getRegistryService().getGovernanceSystemRegistry(
+                        tempRegistry.getTenantId());
+            } catch (Exception ignored) {
+                // The Registry service should not fail if the above if condition holds.
+                return null;
+            }
+        }
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeLoadingListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeLoadingListener.java b/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeLoadingListener.java
new file mode 100644
index 0000000..d6f9151
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeLoadingListener.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+package org.wso2.carbon.theme.mgt.util;
+
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.stratos.common.beans.TenantInfoBean;
+import org.wso2.carbon.stratos.common.exception.StratosException;
+import org.wso2.carbon.stratos.common.listeners.TenantMgtListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class ThemeLoadingListener implements TenantMgtListener {
+    private static final Log log = LogFactory.getLog(ThemeLoadingListener.class);
+    private static final int EXEC_ORDER = 10;
+    public void onTenantCreate(TenantInfoBean tenantInfo) throws StratosException {
+        try {
+            ThemeUtil.loadTheme(tenantInfo.getTenantId());
+        } catch (RegistryException e) {
+            String msg = "Error in loading the theme for the tenant: " 
+                + tenantInfo.getTenantDomain() + ".";
+            log.error(msg, e);
+            throw new StratosException(msg, e);
+        }
+    }
+    
+    public void onTenantUpdate(TenantInfoBean tenantInfo) throws StratosException {
+        // doing nothing
+    }
+    
+    public void onTenantRename(int tenantId, String oldDomainName,
+                             String newDomainName) throws StratosException {
+        // doing nothing
+    }
+
+    public int getListenerOrder() {
+        return EXEC_ORDER;
+    }
+
+    public void onTenantInitialActivation(int tenantId) throws StratosException {
+        // doing nothing
+        
+    }
+
+    public void onTenantActivation(int tenantId) throws StratosException {
+        // doing nothing
+        
+    }
+
+    public void onTenantDeactivation(int tenantId) throws StratosException {
+        // doing nothing
+        
+    }
+
+    public void onSubscriptionPlanChange(int tenentId, String oldPlan, 
+                                         String newPlan) throws StratosException {
+        // doing nothing
+        
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeUtil.java b/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeUtil.java
new file mode 100644
index 0000000..7a29521
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeUtil.java
@@ -0,0 +1,302 @@
+/*
+ * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+package org.wso2.carbon.theme.mgt.util;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.registry.core.Collection;
+import org.wso2.carbon.registry.core.Registry;
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.registry.core.Resource;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.registry.core.service.RegistryService;
+import org.wso2.carbon.registry.core.session.UserRegistry;
+import org.wso2.carbon.registry.core.utils.RegistryUtils;
+import org.wso2.carbon.stratos.common.constants.StratosConstants;
+import org.wso2.carbon.stratos.common.util.CommonUtil;
+import org.wso2.carbon.user.core.service.RealmService;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.activation.MimetypesFileTypeMap;
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ThemeUtil {
+
+    private static final Log log = LogFactory.getLog(ThemeUtil.class);
+
+    private static RegistryService registryService;
+    private static RealmService realmService;
+    private static final String CURRENT_THEME_KEY = "current-theme";
+    private static final String THEME_PATH = "/repository/theme";
+    private static final String THEME_ADMIN_PATH = THEME_PATH + "/admin";
+
+    public static synchronized void setRegistryService(RegistryService service) {
+        if (registryService == null) {
+            registryService = service;
+        }
+    }
+    public static RegistryService getRegistryService() {
+        return registryService;
+    }
+
+    public static synchronized void setRealmService(RealmService service) {
+        if (realmService == null) {
+            realmService = service;
+        }
+    }
+
+    public static RealmService getRealmService() {
+        return realmService;
+    }
+
+    public static UserRegistry getThemeMgtSystemRegistry(String tenantPass) throws RegistryException {
+        if (tenantPass != null && !tenantPass.equals("")) {
+            // tenant 0th system registry
+            UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
+            Resource resource = systemRegistry.get(
+                    StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass);
+            String tenantIdStr = resource.getProperty("tenantId");
+            int tenantId = Integer.parseInt(tenantIdStr);
+
+            return registryService.getGovernanceSystemRegistry(tenantId);
+        }
+
+        return null;
+    }
+
+    public static void removeTheUUID(String tenantPass) throws RegistryException {
+        if (tenantPass != null && !tenantPass.equals("")) {
+            // tenant 0th system registry
+            UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
+            if(systemRegistry.resourceExists(
+                    StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass)) {
+                systemRegistry.delete(
+                        StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass);
+            }
+        }
+    }
+
+    public static void transferAllThemesToRegistry(File rootDirectory, Registry registry,
+                                                String registryPath)
+                                                throws RegistryException {
+        try {
+            // adding the common media types
+            Map<String, String> extensionToMediaTypeMap = new HashMap<String, String>();
+            extensionToMediaTypeMap.put("gif", "image/gif");
+            extensionToMediaTypeMap.put("jpg", "image/jpeg");
+            extensionToMediaTypeMap.put("jpe", "image/jpeg");
+            extensionToMediaTypeMap.put("jpeg", "image/jpeg");
+            extensionToMediaTypeMap.put("png", "image/png");
+            extensionToMediaTypeMap.put("css", "text/css");
+            
+            File[] filesAndDirs = rootDirectory.listFiles();
+            if (filesAndDirs == null) {
+                return;
+            }
+            List<File> filesDirs = Arrays.asList(filesAndDirs);
+
+            for (File file : filesDirs) {
+                String filename = file.getName();
+                String fileRegistryPath = registryPath + RegistryConstants.PATH_SEPARATOR + filename;
+                if (!file.isFile()) {
+                    // This is a Directory add a new collection
+                    // This path is used to store the file resource under registry
+                    Collection newCollection = registry.newCollection();
+                    registry.put(fileRegistryPath, newCollection);
+
+                    // recur
+                    transferAllThemesToRegistry(file, registry, fileRegistryPath);
+                } else {
+                    // Add the file to registry
+                    Resource newResource = registry.newResource();
+                    String mediaType = null;
+                    if (filename.contains(".")) {
+                        String fileExt = filename.substring(filename.lastIndexOf(".") + 1);
+                        mediaType = extensionToMediaTypeMap.get(fileExt.toLowerCase());
+                    }
+                    if (mediaType == null) {
+                        mediaType = new MimetypesFileTypeMap().getContentType(file);
+                    }
+                    newResource.setMediaType(mediaType);
+                    newResource.setContentStream(new FileInputStream(file));
+                    registry.put(fileRegistryPath, newResource);
+                }
+            }
+        } catch (Exception e) {
+            String msg = "Error loading theme to the sytem registry for registry path: " + registryPath;
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+
+    }
+
+    public static UserRegistry getThemeRegistryFromTenantPass(String tenantPass) throws RegistryException {
+        UserRegistry themeMgtSystemRegistry = getThemeMgtSystemRegistry(tenantPass);
+        if (themeMgtSystemRegistry != null) {
+            return themeMgtSystemRegistry.getChrootedRegistry(THEME_ADMIN_PATH);
+        } else {
+            return null;
+        }
+    }
+
+    public static UserRegistry getThemeRegistry(Registry registry) throws RegistryException {
+        if (registry == null) {
+            return null;
+        }
+        return ((UserRegistry)registry).getChrootedRegistry(THEME_ADMIN_PATH);
+    }
+
+    public static void loadResourceThemes() throws RegistryException {
+        // loads the tenant0's system registry
+        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
+        // we are not checking whether the theme resources already exists to make sure, the newly
+        // added themes can be loaded just at the activation of the component
+        String themeRootFileName = System.getProperty(ServerConstants.CARBON_HOME) + File
+                .separator + "resources" + File.separator + "allthemes";
+        // we are always making this accessible from anyware
+        File themeRootFile = new File(themeRootFileName);
+        ThemeUtil.transferAllThemesToRegistry(themeRootFile, systemRegistry, StratosConstants.ALL_THEMES_PATH);
+
+        CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + StratosConstants.ALL_THEMES_PATH,
+                systemRegistry.getUserRealm());
+    }
+
+    public static String[] getAvailableThemes() throws RegistryException {
+        Registry systemRegistry = registryService.getGovernanceSystemRegistry();
+        if (!systemRegistry.resourceExists(StratosConstants.ALL_THEMES_PATH)) {
+            log.info("The theme root path: " + StratosConstants.ALL_THEMES_PATH + " doesn't exist.");
+            return new String[0];
+        }
+        Collection c = (Collection)systemRegistry.get(StratosConstants.ALL_THEMES_PATH);
+        String[] childPaths = c.getChildren();
+        for (int i = 0; i < childPaths.length; i ++) {
+            childPaths[i] = RegistryUtils.getResourceName(childPaths[i]);
+        }
+        return childPaths;
+    }
+
+
+    public static void loadTheme(int tenantId) throws RegistryException {
+        // get the util functions from the theme
+        // this is always the 0th system reigstry
+        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry(tenantId);
+        String[] allThemes = getAvailableThemes();
+        if (allThemes.length == 0) {
+            log.info("No themes found.");
+            return;
+        }
+        int randomNumber = (int)(Math.random() * allThemes.length);
+        String ourLuckyTheme = allThemes[randomNumber];
+        // anway now we are hard coding the default theme to be loaded here,
+        ourLuckyTheme = "Default";
+        applyThemeForDomain(ourLuckyTheme, systemRegistry);
+    }
+
+    public static void applyTheme(String themeName, String tenantPass, UserRegistry systemTenantRegistry) throws Exception {
+        if (systemTenantRegistry == null) {
+            systemTenantRegistry = getThemeMgtSystemRegistry(tenantPass);
+        }
+        applyThemeForDomain(themeName, systemTenantRegistry);
+    }
+
+    public static void applyThemeForDomain(String themeName, UserRegistry systemTenantRegistry)
+                throws RegistryException {
+        String sourcePath = StratosConstants.ALL_THEMES_PATH + "/" + themeName; // tenant 0s path
+        String targetPath = THEME_PATH;
+
+        UserRegistry systemZeroRegistry = registryService.getGovernanceSystemRegistry();
+
+        // if the themes doesn't exist we would exclude applying it
+        if (!systemZeroRegistry.resourceExists(sourcePath)) {
+            log.info("The theme source path: " + sourcePath + " doesn't exist.");
+            return;
+        }
+
+        // first delete the old one, or we can backup it if required
+        // we are anyway getting a backup of the logo
+        Resource logoR = null;
+        String logoPath = targetPath + "/admin/" + "logo.gif";
+        if (systemTenantRegistry.resourceExists(targetPath)) {
+            if (systemTenantRegistry.resourceExists(logoPath)) {
+                logoR = systemTenantRegistry.get(logoPath);
+            }
+            if (logoR != null) {
+                logoR.getContent(); // we will load the content as well.
+            }
+            systemTenantRegistry.delete(targetPath);
+        }
+
+        // copy theme resources to tenant's registry 
+        addResourcesRecursively(sourcePath, targetPath, systemZeroRegistry, systemTenantRegistry);
+
+        // replace the logo
+        if (logoR != null) {
+            systemTenantRegistry.put(logoPath, logoR);
+        }
+
+        // remember the theme name
+        Resource tenantThemeCollection = systemTenantRegistry.get(targetPath);
+        tenantThemeCollection.setProperty(CURRENT_THEME_KEY, themeName);
+        systemTenantRegistry.put(targetPath, tenantThemeCollection);
+
+        try {
+            CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + targetPath,
+                    systemTenantRegistry.getUserRealm());
+            CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + 
+                    StratosConstants.ALL_THEMES_PATH,
+                    systemTenantRegistry.getUserRealm());
+        } catch (RegistryException e) {
+            String msg = "Error in giving authorizations of the " + targetPath +
+                    " to the anonymous user and everyone role.";
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+    private static void addResourcesRecursively(String sourcePath, String targetPath,
+                                                Registry superRegistry, Registry tenantRegistry)
+            throws RegistryException {
+        Resource resource = superRegistry.get(sourcePath);
+        tenantRegistry.put(targetPath, resource);
+
+        if (resource instanceof Collection) {
+            String[] children = ((Collection) resource).getChildren();
+            for (String child : children) {
+                String childName = child.substring(child.lastIndexOf("/"), child.length());
+                addResourcesRecursively(child, targetPath + childName, superRegistry, tenantRegistry);
+            }
+        }
+    }
+
+    public static String getCurrentTheme(String tenantPass, UserRegistry registry) throws Exception {
+        if (registry == null) {
+            registry = getThemeMgtSystemRegistry(tenantPass);
+        }
+        String targetPath = THEME_PATH;
+
+        // remember the theme name
+        Resource tenantThemeCollection = registry.get(targetPath);
+        if (tenantThemeCollection == null) {
+            return null;
+        }
+        return tenantThemeCollection.getProperty(CURRENT_THEME_KEY);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/src/main/resources/META-INF/component.xml b/components/org.apache.stratos.theme.mgt/src/main/resources/META-INF/component.xml
new file mode 100644
index 0000000..8d674c1
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/src/main/resources/META-INF/component.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+  ~
+  ~  Licensed 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.
+  -->
+
+<component xmlns="http://products.wso2.org/carbon">
+    <ManagementPermissions>
+        <ManagementPermission>
+            <DisplayName>Configure</DisplayName>
+            <ResourceId>/permission/admin/configure</ResourceId>
+        </ManagementPermission>
+        <ManagementPermission>
+            <DisplayName>Theme</DisplayName>
+            <ResourceId>/permission/admin/configure/theme</ResourceId>
+        </ManagementPermission>
+    </ManagementPermissions>
+</component>
\ No newline at end of file


[11/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/select-theme.png
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/select-theme.png b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/select-theme.png
deleted file mode 100644
index 0c10585..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/select-theme.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/userguide.html
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/userguide.html b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/userguide.html
deleted file mode 100644
index 2af509e..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/userguide.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.
- -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-  <title>Theme Management UI - User Guide</title>
-  <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" />
-</head>
-
-<body>
-<h1>Theme Management UI </h1>
-
-<p>
-You can configure the themes of the UI from this page. This theme will be common to all users under your organization. </p>
-
-<p>
-This provides several sections that allow you to configure
-the theme for your organization in several levels.
-</p>
-
-<h2>Change the Logo</h2>
-<p>
-    You can change the logo image of your theme (Mostly appear on the left top corner) to the logo of your organization. 
-</p>
-
-<img src="images/change-logo.png" alt="Changing the logo"/>
-<p>Figure1: The Change The Logo Section</p>
-
-<p>
-You can upload the logo image from either
-</p>
-<ul>
-    <li>
-        local file system - by selecting "Update the logo image from File"
-    </li>
-    <li>
-        Internet/network - by selecting "Upload the logo image from a URL"
-    </li>
-</ul>
-
-<h2>Select a Theme</h2>
-
-<p>
-This will show you a list of themes from where you can choose one for the theme of your organziation's account.    
-</p>
-
-<img src="images/select-theme.png" alt="Select a theme"/>
-<p>Figure2: The Select a Theme Section</p>
-
-
-<h2>Create your own themes </h2>
-<p>
-This section allows you to edit the theme. You can add/remove images + edit the main css file to change your theme.     
-</p>
-
-<em>Note: This section is visible only for users with theme-management permission. You need to login to that.</em>
-
-<img src="images/edit-theme.png" alt="Edit theme"/>
-<p>Figure3: Edit the theme</p>
-</body>
-
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/edit_text_content_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/edit_text_content_ajaxprocessor.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/edit_text_content_ajaxprocessor.jsp
deleted file mode 100644
index 48a7302..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/edit_text_content_ajaxprocessor.jsp
+++ /dev/null
@@ -1,96 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.utils.ServerConstants" %>
-<%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<fmt:bundle basename="org.wso2.carbon.registry.resource.ui.i18n.Resources">
-
-    <%
-        String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-
-        String path = request.getParameter("path");
-        String textContent;
-        try {
-            ThemeMgtServiceClient client = new ThemeMgtServiceClient(cookie, config, session);
-            textContent = client.getTextContent(request);
-        } catch (Exception e) {
-            response.setStatus(500);
-    %><%=e.getMessage()%><%
-        return;
-    }
-    Boolean displayCssEditor = false;
-    if(path.endsWith(".css")){
-           displayCssEditor = true;
-    }
-%>
-
-     <% if (displayCssEditor){ %>
-    <div class="csseditor-box">
-        <div class="csseditor-top-line"></div>
-        <table cellpadding="0" cellspacing="0" style="width:100%">
-            <tr>
-                <td>
-                    <div class="csseditor-leftbox">
-                        <div class="csseditor-leftbox-top">
-                            Css Editor
-                        </div>
-                        <textarea id="editTextContentID" name="content" style="width:100%;*width:98%;height:300px;"><%=textContent%></textarea>
-                    </div>
-                </td>
-                <td>
-                    <div class="csseditor-rightbox">
-                        <div class="csseditor-rightbox-title">Image Search</div>
-                        <div class="csseditor-searchbox"> Text: <input type="text" id="flickr_search"
-                                                                       onkeydown="filterImagePathPicker()"
-                                                                       style="margin-left:10px;">
-                            <p style="margin-top:10px;">Enter * to see all the available images.</p>
-                        </div>
-
-
-
-                        <div id="flickr_results" style="margin-top:10px;">
-                        </div>
-                        <div style="padding:5px;">
-
-                            Selected Image
-                            <div id="flickr_selected" class="flicker_selected"></div>
-                            <table>
-                                <tr>
-                                    <td><input class="button" type="button" value="Insert image path to css file" style="margin-right:5px;" onclick="insertImagePath()" /></td>
-                                    <td><input class="button" type="button" value="Preview Image" onclick="previewImagePath()" /></td>
-                                </tr>
-                            </table>
-                        </div>
-                    </div>
-                </td>
-            </tr>
-        </table>
-    </div>
-    <% }else { %>
-    <textarea id='editTextContentID' rows='15' cols='70'><%=textContent%></textarea>
-    <% }  %>
-    <br/>
-    <input type='button' class='button' id="saveContentButtonID" onclick='updateThemeTextContent("<%=path%>",<%=displayCssEditor%>)'
-           value='<fmt:message key="save.content"/>'/>
-    <input type='button' class='button' id="cancelContentButtonID" onclick='cancelTextContentEdit(<%=displayCssEditor%>)'
-           value='<fmt:message key="cancel"/>'/>
-    <br/>
-
-</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/ajax-loader.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/ajax-loader.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/ajax-loader.gif
deleted file mode 100644
index f2a1bc0..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/ajax-loader.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/button-back.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/button-back.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/button-back.gif
deleted file mode 100644
index 6a52e34..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/button-back.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/content-back-left.jpg
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/content-back-left.jpg b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/content-back-left.jpg
deleted file mode 100644
index ebfe8ed..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/content-back-left.jpg and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/content-back.jpg
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/content-back.jpg b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/content-back.jpg
deleted file mode 100644
index 62b8da1..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/content-back.jpg and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/create-org-button.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/create-org-button.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/create-org-button.gif
deleted file mode 100644
index b7e62a3..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/create-org-button.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/footer.jpg
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/footer.jpg b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/footer.jpg
deleted file mode 100644
index c617091..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/footer.jpg and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/forum.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/forum.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/forum.gif
deleted file mode 100644
index e92779a..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/forum.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/header.jpg
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/header.jpg b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/header.jpg
deleted file mode 100644
index 4438a06..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/header.jpg and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/help.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/help.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/help.gif
deleted file mode 100644
index 43242c2..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/help.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/images.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/images.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/images.gif
deleted file mode 100644
index 94b46dc..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/images.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/issue-tracker.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/issue-tracker.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/issue-tracker.gif
deleted file mode 100644
index 9029c12..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/issue-tracker.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/logo.jpg
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/logo.jpg b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/logo.jpg
deleted file mode 100644
index 202360d..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/logo.jpg and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/logomgt.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/logomgt.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/logomgt.gif
deleted file mode 100644
index 9534693..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/logomgt.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/mailing-list.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/mailing-list.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/mailing-list.gif
deleted file mode 100644
index 06d61e3..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/mailing-list.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/page-back.jpg
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/page-back.jpg b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/page-back.jpg
deleted file mode 100644
index 2e21b54..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/page-back.jpg and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/people.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/people.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/people.gif
deleted file mode 100644
index edfa49b..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/people.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/sel-02.jpg
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/sel-02.jpg b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/sel-02.jpg
deleted file mode 100644
index 2e7dccf..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/sel-02.jpg and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/services.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/services.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/services.gif
deleted file mode 100755
index 9883116..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/services.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/thememgt.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/thememgt.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/thememgt.gif
deleted file mode 100644
index e554e87..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/thememgt.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/user-guide.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/user-guide.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/user-guide.gif
deleted file mode 100644
index 9342adc..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/images/user-guide.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/import_resource_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/import_resource_ajaxprocessor.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/import_resource_ajaxprocessor.jsp
deleted file mode 100644
index 34dbaef..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/import_resource_ajaxprocessor.jsp
+++ /dev/null
@@ -1,100 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.axis2.util.JavaUtils" %>
-<%@ page import="org.wso2.carbon.CarbonConstants" %>
-<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
-<%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-    String errorMessage = null;
-    boolean displayPlainError = false;
-    try {
-        displayPlainError = (request.getParameter("printerror") != null);
-
-        String parentPath = request.getParameter("parentPath");
-        String resourceName = request.getParameter("resourceName");
-        String mediaType = request.getParameter("mediaType");
-        String description = request.getParameter("description");
-        String fetchURL = request.getParameter("fetchURL");
-        String isAsync = request.getParameter("isAsync");
-        String symlinkLocation = request.getParameter("symlinkLocation");
-        String redirectWith = request.getParameter("redirectWith");
-
-        String cookie = (String) request.
-                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-        String serverURL = (String) request.getAttribute(CarbonConstants.SERVER_URL);
-
-        try {
-            /*
-            // currently chroot will not work with multitenancy
-            ConfigurationContext configContext = (ConfigurationContext) config.
-                    getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
-            IServerAdmin adminClient =
-                    (IServerAdmin) CarbonUIUtil.
-                            getServerProxy(new ServerAdminClient(configContext,
-                                    serverURL, cookie, session), IServerAdmin.class, session);
-            ServerData data = adminClient.getServerData();
-            String chroot = "";
-            if (data.getRegistryType().equals("remote") && data.getRemoteRegistryChroot() != null &&
-                    !data.getRemoteRegistryChroot().equals(RegistryConstants.PATH_SEPARATOR)) {
-                chroot = data.getRemoteRegistryChroot();
-                if (!chroot.startsWith(RegistryConstants.PATH_SEPARATOR)) {
-                    chroot = RegistryConstants.PATH_SEPARATOR + chroot;
-                }
-                if (chroot.endsWith(RegistryConstants.PATH_SEPARATOR)) {
-                    chroot = chroot.substring(0, chroot.length() - RegistryConstants.PATH_SEPARATOR.length());
-                }
-            }
-            if (symlinkLocation != null) {
-                symlinkLocation = chroot + symlinkLocation;
-            }
-            */
-            ThemeMgtServiceClient client =
-                    new ThemeMgtServiceClient(cookie, config, request.getSession());
-            if (JavaUtils.isTrueExplicitly(isAsync)) {
-                client.importResource(parentPath, resourceName, mediaType, description, fetchURL,
-                        symlinkLocation, true, redirectWith);
-            } else {
-                client.importResource(parentPath, resourceName, mediaType, description, fetchURL,
-                        symlinkLocation, false, redirectWith);
-            }
-        } catch (Exception e) {
-            String msg = "Failed to import resource " + resourceName +
-                    " to the parent collection " + parentPath + ". " + e.getMessage();
-            throw new UIException(msg, e);
-        }
-
-    } catch (Exception e) {
-        response.setStatus(500);
-        if (displayPlainError) {
-            %><%=e.getMessage()%><%
-            return;
-        }
-
-        errorMessage = e.getMessage();
-    }
-%>
-
-<% if (errorMessage != null) { %>
-
-<script type="text/javascript">
-    location.href='../error.jsp?errorMsg=<%=errorMessage%>'
-</script>
-
-<% } %>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/change_log.txt
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/change_log.txt b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/change_log.txt
deleted file mode 100644
index 3d1425a..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/change_log.txt
+++ /dev/null
@@ -1,281 +0,0 @@
-**** v 0.8.1.1 ****
-- Fix bug of frequent syntax desynchronisation when the first character of the textarea was highlighted
-- In unload now check that parent.editareaLoader still exists before calling it
-- Now consider that gecko and webkit based browser are valid browsers (but I won't test them all)
-
-**** v 0.8.1 ****
-- Improved speed of text highlighting process for huge file. Now we try to only insert or delete the changed caracters inside DOM text node instead of refreshing the whole area. (3 time faster in firefox)
-- Greatly improved speed of line-height management in word-wrap context 
-- Add java syntax (thanks to Dawson Goodell)
-- Use faster regexp for matching quoted strings
-- Bug fix: if a highlighted quote or comment string contains cariage return, editing text on one of the lines was causin a highlight desynchronisation
-- Bug fix: text war blur on Safari 3.2 (thanks to spellcoder)
-- Bug fix: there had several mistake with non-monospace font (thanks to spellcoder)
-- Bug fix: if show_line_colors was disabled and word wrap enable, highlighted text wasn't refreshed if a new line appears
-- Bug fix: in multi file edition, closing the last tab was throwing an error in Firefox and let the content of the textarea displayed
-- Browser bug detection: when using non-monospace font Firefox will sometime have strange behavior on text-width (the highlighted text-width in the background may change fron textarea one and simply can change after beeing updated); look likes a browser rendering bug
-
-**** v 0.8 ****
-- Word-wrap is now supported (except for opera...). The new init() option is 'word_wrap' to set to 'true' (default is false). A new button appears in the default toolbar (button_code: 'word_wrap' )
-- We can now clearly see the selected text
-- Add Internet explorer 8 support (but sadly I must use IE7 emulate mode in iframe due to a bug with tabulation width not beeing resized in IE's textarea) 
-- Add Safari 4 support
-- Add Chrome 2 support
-- Better support of Opera 9.6
-- Add Simplified Chinese translation "zh" (thanks to Abentian)
-- Add Bulgarian translation "bg" (thanks to Valentin Hristov)
-- Rename internal function $() by _$()
-- Delete EditArea.add_event() method (duplicate af editAreaLoader.add_event() method)
-- Do some code cleanup-up
-- Bug fix: highlight optimisation process was not working under IE (don't known how long it remain broken but must be since a long time)
-- Bug fix: EditArea.update_size sometimes uses undefined variable (fix this possibility and cleanup events)
-- Bug fix: Template.html was not valid XHTML
-- Bug fix: The checked attribute of the toogle button was not defined in xhtml syntax
-- Bug fix: If the editArea was loaded on a page related to a domain which was itself an iframe comming from another domain a JS error was thrown on load
-- Bug fix: When EditArea is used to replace a textarea which has style="visibility:hidden;", switching off EditArea would throw an error under IE 
-
-**** v 0.7.3 ****
-- Add Finnish transaltion (thanks to Janne Mäntyharju)
-- Add 'cursor_position' init() option for defining where the cursor should be when the editor is show on the first time ('auto' or 'begin'). This was like 'auto' before now this is like 'begin' by default
-- better add_style method (faster than old one) thanks to Spellcoder
-- Bug fix: fix bug with mootools 1.2
-- Bug fix: if page had no stylesheets when editarea load, it would generate an error
-
-**** v 0.7.2.3 ****
-- it's now released under both LGPL, Apache, BSD license (you can use the one you prefer)
-- add support for bonEcho browser
-
-**** v 0.7.2.2 ****
-- Fix bug regression introduced in 0.7.2 that make IE7 not working 
-- add Esperento translation (thanks to Olivier)  
-- add Coldfusion syntax (thanks to Max Leynov) 
-
-**** v 0.7.2.1 ****
-- fix bug for firefox rendering of highlighted lines that doesn't begin with a tab
-- support for browser with grandParadisio agent instead of firefox
-
-**** v 0.7.2 ****
-- add Chrome support
-- add show_line_colors init() option for enabling syntax color display and update on the currently edited line (disable the blue bar) (default to false)
-- Add Perl syntax definition file (thanks to Christoph Pinkel)
-- Bug fix: there allways was an horizontal scrollbar even if the content fit in the area.
-
-**** v 0.7.1.3 ****
-- Fix a bug introduced in Firefox 3.0.1 => the browser is no more able to render properly "pre" element with left padding...
-- Add Robots.txt (thanks to Pavle Ggardijan) and T-SQL syntax definition files (thanks to Miladin Joksic)
-
-**** v 0.7.1.2 ****
-- Fix a  bug on the full screen mode (regression added on 0.7.1.1)
-
-**** v 0.7.1.1 ****
-- Firefox 3 RC1 compatibility
-- Code size reduction: 120Ko => 107Ko for edit_area_full.js
-
-**** v 0.7.1 ****
-- released under both LGPL and Apache license (you can use the one you prefer)
-- it's now possible to get a readonly mode: 
-	* new EditAreaLoader.init()'s option: "is_editable": true/false
-	* Possibility to switch edition mode by using the execCommand function: editAreaLoader.execCommand('editor_id', 'set_editable', !editAreaLoader.execCommand('editor_id', 'is_editable'));
-- Added Ruby syntax (thanks to Patrice De Saint Steban)
-- Fix a bug where the textarea lose the focus under firefox for Mac
-- Minor other bug fixes
-
-**** v 0.7.0.2 ****
-- Fixed a bug with translation files containing non-latin caracters. Translations files must be in UTF-8.
-- Added Czech, Macedionian and Russian translations
-
-
-**** v 0.7.0.1 ****
-- in multiple file mode, it's now possible to cancel the 'EA_file_close_callback' function. if the callback return false, the edited file won't be closed 
-- bug fix: if no syntax was defined in the main init() function in multifile mode, the first time the text was not highlighted
-
-
-**** v 0.7 ****
-- it's now possible to edit multiple files into one instance of EditArea. This (sponsored by Jupiter) feature comes with: 
-	* new EditAreaLoader.init()'s option: "is_multi_files": true
-	* new editAreaLoader's functions: editAreaLoader.getCurrentFile(editArea_id), editAreaLoader.getFile(editArea_id, file_id), editAreaLoader.getAllFiles(editArea_id), editAreaLoader.openFile(editArea_id, file_infos), editAreaLoader.closeFile(editArea_id, file_id), editAreaLoader.setFileEditedMode(editArea_id, file_id, edited_mode)
-	* new callabacks: EA_file_switch_on_callback, EA_file_switch_off_callback, EA_file_close_callback
-- look likes Safari 3 is working with EditArea
-- add spanish translation (thanks Garito)
-- add slovak translation (thanks Gabriel Schwardy)
-- add SQL syntax definition file (thanks to Philippe Lewicki)
-- the syntax selection plugin has been integrated to editarea core and load only needed files (the plugins was loading all the possible syntax files...). Toolbar button name: "syntax_selection", comma separated available syntax list: "syntax_selection_allow"
-- add a 'compression' option in edit_area_compressor.php that allow to set where the code should be compressed or just packed (simple packed mode usefull for debugging)
-- the yellow area that indicate the current edited line is now blue
-- bug fix: parenthesis matching was not working correctly if there where an "<" between parenthesis
-
-**** v 0.6.7 ****
-- add a new plugin that allow the user to change the syntax definition in use. It adds a select in the toolbar. - plugin name to add to the plugin list: "syntax_selection". - plugin name to add to the toolbar list: "syntax_selection". - possible parameter to add to EditAreaLoader.init(): 
-"syntax_selection_allow": (String) define a list separated by "," of possible language syntax to use (eg: "php,js,python,html")
-- add Croatian translation (HR) (thanks to Ivan Vucica and Davor Cihlar)
-- add BASIC, Brainf*ck, C, C++ and Pascal syntax definition files (thanks to Ivan Vucica and Davor Cihlar)
-- add Iceweasel as a known working navigator (its a clone of Firefox)
-- improved the php syntax by highlighting the variables ($...)
-- reactivate gzip compression for IE7 (was desactivate for IE as it sometimes failed). (Let me know if you see that the load fails under IE7)
-- pressing "enter" while being in the search box now perform a search.
-- add Camino as a supported browser
-- bug fix: when clicking between the bottom toolbar and the textarea (when there is only few lines of text), the textarea didn't get the focus
-- bug fix: under IE the delete_instance() method was throwing an error
-- bug fix: if the textarea to convert in an EditArea was in a frame (or iframe) getting back from fullscreen to normal display was not restoring the correct settings to the frame containing the textarea.
-- bug fix (at least I hope): in IE if the textarea to convert in an EditArea was in a frame, resizing the frame was not correctly resizing the editor if it was in fullscreen.
-- bug fix: in Opera the selectionned line was not rendered correctly if containing \t caracters (bug introduced in one of the latest version...)
-- bug fix: "altgr+f" was openning the searchbox and avoid to write "[" and "]" in croatian keyboards.
-- bug fix: in Firefox "ctrl+tab" was inserting a tabulation while switching active tab (window)
-
-Note: v 0.6.5 and v 0.6.6 have been private release (change log is regrouped in v 0.6.7)
-
-**** v 0.6.4 ****
-- add replace_tab_by_spaces init() option which allow to replace all tabulation caracters typped in the text by a given number of spaces
-- add min_width and min_height init() option for the minimum size in pixel for the editor
-- add dutch translation files (NL) (thanks to Bart Bosma)
-- pressing Shift+Tab when no text is selected now delete the tabulation before the cursor (if a tabulation is present directly behing the cursor)
-- improve Python syntax (thanks to Andre Roberge)
-- bug fix: the fullpage plugin was not working correctly when the Editor was placed inside several divs that have positioning of there own
-- bug fix: one regexp used in edit_area_compressor.php was not compatible with latest PCRE version
-
-- fix the my_load and my_save functions of the 'exemple_full.html' page
-
-**** v 0.6.3.1 ****
-- regression: restore monospace as default font
-- add little improvements to the PHP compressor: allow to win 7 Ko on edit_area_full.js
-- add the version number in the about popup
-- bug fix: fix a regexp that was not compliant with newer version of PCRE
-- bug fix: fix some bug with the fullscreen mode (still not perfect in Opera)
-- bug fix: the close button of the help popup was not correctly translated
-- bug fix: when deleting an instance of editArea toggle_off was called even if the editArea was not displayed
-
-
-**** v 0.6.3 ****
-- allow to use non monospace font using the font_family init option. Firefox get smaller tabulation with non monospace fonts. IE doesn't change the tabulation width and Opera doesn't take this option into account... new default font-familly: 'verdana,monospace'
-- add fullscreen option in the toolbar and as an init() option. 
-- if the based textarea has a width (or height) in '%', EditArea will get the same '%' width (or  height), allowing EditArea to be resized in the same time than the window.
-- add many callback possibility: submit_callback, EA_load_callback, EA_unload_callback, EA_init_callback, EA_toggle_on_callback, EA_toggle_off_callback, EA_delete_callback (see documentation for more information)
-- bug fix: when toggling from textarea to editarea, IE was almost of the time not keeping the selection
-- bug fix: the brackets where still highlighted in red when being deleted
-- bug fix: brackets where not placed correctly when the line contains html entitites (&amp; &quot; etc....)
-
-
-**** v 0.6.2 ****
-WARNING => POSSIBLE BREAK COMPATIBILITY:
-- the load_callback now receive the 'id' of the textarea and no more a reference to the textarea. Developpers should use editAreaLoder methods rather than modfying directly the textarea.
-- the save_callback now receive the 'id' of the textarea as first argument, and it's content in the second argument.
-
-- EditArea is now compatible with javascript libraries like "prototype" (1.5) and "mootools" (release 83)
-- add two function to EditAreaLoader: hide(id) and show(id), that will allow to completly hide/restore both EditArea and normal textarea (usefull when EditArea is included in tabs).
-- it's no more possible to move the search window out of the frame.
-- gecko_spellcheck option is now set to false by default.
-- add a onchange_callback option (cf doc)
-- bug fix: in IE when syntax highlight was on, clicking on the textarea outside the range of the text, the click wasn't taking into account.
-- bug fix: references to the orginal textarea could be lost while using EditArea.
-- bug fix: using insertTags, getSelectionRange when editArea was not focused, IE failed
-- bug fix: main script could fail to load additionnal files in certain specific cases
-
-**** v 0.6.1 ****
-- compatiblity with Firefox 2 checked (was already compatible before).
-- compatiblity with IE7 checked (was already compatible before).
-- added possibility to call the editAreaLoader.init() function at any moment (no more limited to window load). Allow to replace an EditArea instance by a new one with other options.
-- added new gecko_spellcheck option, this enables you to disable/enable the FF 2.0 spellchecker.
-- added editAreaLoader.delete_instance(id) to allow to delete an EditArea instance
-- Fix a bug where "Ctrl+G" wasn't openning anymore the go to line prompt box.
-
-
-**** v 0.6.0.1 ****
-- add italian translation (thanks to Luciano Vernaschi)
-- add polish translation (thanks to Piotr Furman)
-- improve deutsh translation (thanks to Felix Riesterer)
-- add a little style improvement for buttons in search popup. they can't be splited in two line anymore
-- change color for tags in html and xml syntax due to visibility problems
-
-
-**** v 0.6 ****
-- add plugins possibilies
-- add editAreaLoader.insertTags function to allow easy tags insertion.
-- improve undo & redo functionnality
-- improve php compression: "edit_area_full.js" is 9 Ko smaller
-- improve syntax highlight regexp for quotted string. \\" or \\' (or \\\\", etc...) will now effectively close quotted string
-- add scrollbars to the popups when the popup's height is smaller than the editor's height
-- add japanese translation file (thanks to ISHITOYA Kentaro)
-- add possibility to add line-break in toolbar ("*")
-- disable gzip compression for IE (see: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496)
-- bug fix: when submitting form while editarea toggled off, the post value was equals to the old content of editarea and not the visible textarea
-- bug fix: under IE the editor was scrolling when pressing enter
-- bug fix: when insterting text on first line there was an highlight desynchronization
-
-
-
-**** v 0.5.3 ****
-WARNING => POSSIBLE BREAK COMPATIBILITY:
-- correct a spelling error: "toogle" become "toggle" in the whole code. This can perturb the initialization with the "allow_toggle" init parameters
-
-- add a case sensitive option in syntax definition files
-- improve html syntax definition file
-- add xml syntax definition file
-- add vb syntax definition file (thanks to Martin Gottlieb)
-- add some function that will allow dynamic EditArea content management, taking into account if the editor is displayed or toggled off (editAreaLodaer.getValue(), editAreaLoader.setValue(), editAreaLoader.getSelectedText(), editAreaLoader.setSelectedText(), editAreaLoader.getSelectionRange and editAreaLoader.setSelectionRange()). See "javascript functions" documentation for more informations
-- add a generic function (editaAreaLoader.execCommand) to allow to access EditArea's functions and datas
-- add portuguese translation file (thanks to Leonardo Sapucaia)
-- add compatibility to IE7 RC1
-
-
-**** v 0.5.2 ****
-- Opera improvement: text indentation is now working, and "go to line" is now working as in other browsers
-- Bug fix: It was still possible to select text in search popup
-- Bug fix: the "go to line" popup wasn't displaying anymore
-- There was still some hard codded word in the search field => added them to translation files
-- Bug fix: when multiple languages were used in the same page, there could have translation exchange between the different editors
-
-
-**** v 0.5.1 ****
-- Bug fix: the highlighted bracket was displayed on line 1 when it should be in line 2
-- Bug fix: the highlighted bracket were bad displayed in IE
-- Bug fix: their was some error in the optimisation process of the highlight mode
-- Bug fix: their was a bug when moving the search popup on IE
-
-**** v 0.5 ****
-- Now released under LGPL
-- Rewrite nearly from scratch
-- Added Danish translation file (thanks to Peter Klein)
-- Add python syntax
-
-
-WARNING => BREAK COMPATIBILITY:
-- the whole loading process (javascript include and init function call) is changed (but it's similar to the old version)
-- the languages translation files are not stored in the same variable
-
-
-IMPROVEMENTS:
-- The whole code is more stable
-- Allow several instance on the same page
-- Faster to load
-- The highlight process is more stable and there is nearly no more to use the "re sync" button
-- Add support of Opera 9 (even if its still not perfect)
-- Add the possibility to load a new compressed script of only 20Ko for the whole core script even if PHP is not installed
-- The textarea can be toggled to an EditArea on window load or later
-- The EditArea is loaded in a iframe => there is no more interaction with user css
-- Support the reset action of a form
-- Add support for "page up" & "page down" button
-- There is now a waiting screen when toggling on the highlight syntax (but it can't be an animated one, even gif are not animated due to CPU load)
-- All supported browsers can now change font-size
-
-BUG FIXES: 
-- Sometimes while using the "toggle editor" button to turn of the editor, the standard textarea was expanded to the full size of the textarea content.
-- When resizing the area the selection was lost
-- Allow translation for some forgotten hard-coded word (the "move" button for search popup, and "font size", and keys word in help panel).
-- It was possible to "drag" the buttons from the Search/Replace popup into the content of the textarea.
-- On first display (when the files are not in cache) or with xhtml doctype there is a display bug (the content of the textarea exceed of 4px)
-- when the cursor was at the beginning of the 1st line of the textarea, the caracter position was set to 0 instead of 1
-
-
-
-***v 0.4****
-- Increases syntax highlight proccess speed by 5 => allow a better live editing mode with syntax highlight.
-- Now syntax highlight has a real language syntax. Text is parsing with rules depending of the language definition file. (limitation: there is only one language on the same time > doesn't allow to parse html and php on the same page).
-- Syntax highlight can be easily extended with new code languages (there is currently: php, css, js, html).
-- Add german language file (thanks to Olaf Brambrink).
-- Fix some little bugs.
-
-
-
-
-***v0.33***
-- First release.

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/autocompletion.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/autocompletion.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/autocompletion.js
deleted file mode 100644
index c5d646a..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/autocompletion.js
+++ /dev/null
@@ -1,491 +0,0 @@
-/**
- * Autocompletion class
- * 
- * An auto completion box appear while you're writing. It's possible to force it to appear with Ctrl+Space short cut
- * 
- * Loaded as a plugin inside editArea (everything made here could have been made in the plugin directory)
- * But is definitly linked to syntax selection (no need to do 2 different files for color and auto complete for each syntax language)
- * and add a too important feature that many people would miss if included as a plugin
- * 
- * - init param: autocompletion_start
- * - Button name: "autocompletion"
- */  
-
-var EditArea_autocompletion= {
-	
-	/**
-	 * Get called once this file is loaded (editArea still not initialized)
-	 *
-	 * @return nothing	 
-	 */	 	 	
-	init: function(){	
-		//	alert("test init: "+ this._someInternalFunction(2, 3));
-		
-		if(editArea.settings["autocompletion"])
-			this.enabled= true;
-		else
-			this.enabled= false;
-		this.current_word		= false;
-		this.shown				= false;
-		this.selectIndex		= -1;
-		this.forceDisplay		= false;
-		this.isInMiddleWord		= false;
-		this.autoSelectIfOneResult	= false;
-		this.delayBeforeDisplay	= 100;
-		this.checkDelayTimer	= false;
-		this.curr_syntax_str	= '';
-		
-		this.file_syntax_datas	= {};
-	}
-	/**
-	 * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
-	 * A control can be a button, select list or any other HTML item to present in the EditArea user interface.
-	 * Language variables such as {$lang_somekey} will also be replaced with contents from
-	 * the language packs.
-	 * 
-	 * @param {string} ctrl_name: the name of the control to add	  
-	 * @return HTML code for a specific control or false.
-	 * @type string	or boolean
-	 */	
-	/*,get_control_html: function(ctrl_name){
-		switch( ctrl_name ){
-			case 'autocompletion':
-				// Control id, button img, command
-				return parent.editAreaLoader.get_button_html('autocompletion_but', 'autocompletion.gif', 'toggle_autocompletion', false, this.baseURL);
-				break;
-		}
-		return false;
-	}*/
-	/**
-	 * Get called once EditArea is fully loaded and initialised
-	 *	 
-	 * @return nothing
-	 */	 	 	
-	,onload: function(){ 
-		if(this.enabled)
-		{
-			var icon= document.getElementById("autocompletion");
-			if(icon)
-				editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
-		}
-		
-		this.container	= document.createElement('div');
-		this.container.id	= "auto_completion_area";
-		editArea.container.insertBefore( this.container, editArea.container.firstChild );
-		
-		// add event detection for hiding suggestion box
-		parent.editAreaLoader.add_event( document, "click", function(){ editArea.plugins['autocompletion']._hide();} );
-		parent.editAreaLoader.add_event( editArea.textarea, "blur", function(){ editArea.plugins['autocompletion']._hide();} );
-		
-	}
-	
-	/**
-	 * Is called each time the user touch a keyboard key.
-	 *	 
-	 * @param (event) e: the keydown event
-	 * @return true - pass to next handler in chain, false - stop chain execution
-	 * @type boolean	 
-	 */
-	,onkeydown: function(e){
-		if(!this.enabled)
-			return true;
-			
-		if (EA_keys[e.keyCode])
-			letter=EA_keys[e.keyCode];
-		else
-			letter=String.fromCharCode(e.keyCode);	
-		// shown
-		if( this._isShown() )
-		{	
-			// if escape, hide the box
-			if(letter=="Esc")
-			{
-				this._hide();
-				return false;
-			}
-			// Enter
-			else if( letter=="Entrer")
-			{
-				var as	= this.container.getElementsByTagName('A');
-				// select a suggested entry
-				if( this.selectIndex >= 0 && this.selectIndex < as.length )
-				{
-					as[ this.selectIndex ].onmousedown();
-					return false
-				}
-				// simply add an enter in the code
-				else
-				{
-					this._hide();
-					return true;
-				}
-			}
-			else if( letter=="Tab" || letter=="Down")
-			{
-				this._selectNext();
-				return false;
-			}
-			else if( letter=="Up")
-			{
-				this._selectBefore();
-				return false;
-			}
-		}
-		// hidden
-		else
-		{
-			
-		}
-		
-		// show current suggestion list and do autoSelect if possible (no matter it's shown or hidden)
-		if( letter=="Space" && CtrlPressed(e) )
-		{
-			//parent.console.log('SHOW SUGGEST');
-			this.forceDisplay 			= true;
-			this.autoSelectIfOneResult	= true;
-			this._checkLetter();
-			return false;
-		}
-		
-		// wait a short period for check that the cursor isn't moving
-		setTimeout("editArea.plugins['autocompletion']._checkDelayAndCursorBeforeDisplay();", editArea.check_line_selection_timer +5 );
-		this.checkDelayTimer = false;
-		return true;
-	}	
-	/**
-	 * Executes a specific command, this function handles plugin commands.
-	 *
-	 * @param {string} cmd: the name of the command being executed
-	 * @param {unknown} param: the parameter of the command	 
-	 * @return true - pass to next handler in chain, false - stop chain execution
-	 * @type boolean	
-	 */
-	,execCommand: function(cmd, param){
-		switch( cmd ){
-			case 'toggle_autocompletion':
-				var icon= document.getElementById("autocompletion");
-				if(!this.enabled)
-				{
-					if(icon != null){
-						editArea.restoreClass(icon);
-						editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
-					}
-					this.enabled= true;
-				}
-				else
-				{
-					this.enabled= false;
-					if(icon != null)
-						editArea.switchClassSticky(icon, 'editAreaButtonNormal', false);
-				}
-				return true;
-		}
-		return true;
-	}
-	,_checkDelayAndCursorBeforeDisplay: function()
-	{
-		this.checkDelayTimer = setTimeout("if(editArea.textarea.selectionStart == "+ editArea.textarea.selectionStart +") EditArea_autocompletion._checkLetter();",  this.delayBeforeDisplay - editArea.check_line_selection_timer - 5 );
-	}
-	// hide the suggested box
-	,_hide: function(){
-		this.container.style.display="none";
-		this.selectIndex	= -1;
-		this.shown	= false;
-		this.forceDisplay	= false;
-		this.autoSelectIfOneResult = false;
-	}
-	// display the suggested box
-	,_show: function(){
-		if( !this._isShown() )
-		{
-			this.container.style.display="block";
-			this.selectIndex	= -1;
-			this.shown	= true;
-		}
-	}
-	// is the suggested box displayed?
-	,_isShown: function(){
-		return this.shown;
-	}
-	// setter and getter
-	,_isInMiddleWord: function( new_value ){
-		if( typeof( new_value ) == "undefined" )
-			return this.isInMiddleWord;
-		else
-			this.isInMiddleWord	= new_value;
-	}
-	// select the next element in the suggested box
-	,_selectNext: function()
-	{
-		var as	= this.container.getElementsByTagName('A');
-		
-		// clean existing elements
-		for( var i=0; i<as.length; i++ )
-		{
-			if( as[i].className )
-				as[i].className	= as[i].className.replace(/ focus/g, '');
-		}
-		
-		this.selectIndex++;	
-		this.selectIndex	= ( this.selectIndex >= as.length || this.selectIndex < 0 ) ? 0 : this.selectIndex;
-		as[ this.selectIndex ].className	+= " focus";
-	}
-	// select the previous element in the suggested box
-	,_selectBefore: function()
-	{
-		var as	= this.container.getElementsByTagName('A');
-		
-		// clean existing elements
-		for( var i=0; i<as.length; i++ )
-		{
-			if( as[i].className )
-				as[i].className	= as[ i ].className.replace(/ focus/g, '');
-		}
-		
-		this.selectIndex--;
-		
-		this.selectIndex	= ( this.selectIndex >= as.length || this.selectIndex < 0 ) ? as.length-1 : this.selectIndex;
-		as[ this.selectIndex ].className	+= " focus";
-	}
-	,_select: function( content )
-	{
-		cursor_forced_position	= content.indexOf( '{@}' );
-		content	= content.replace(/{@}/g, '' );
-		editArea.getIESelection();
-		
-		// retrive the number of matching characters
-		var start_index	= Math.max( 0, editArea.textarea.selectionEnd - content.length );
-		
-		line_string	= 	editArea.textarea.value.substring( start_index, editArea.textarea.selectionEnd + 1);
-		limit	= line_string.length -1;
-		nbMatch	= 0;
-		for( i =0; i<limit ; i++ )
-		{
-			if( line_string.substring( limit - i - 1, limit ) == content.substring( 0, i + 1 ) )
-				nbMatch = i + 1;
-		}
-		// if characters match, we should include them in the selection that will be replaced
-		if( nbMatch > 0 )
-			parent.editAreaLoader.setSelectionRange(editArea.id, editArea.textarea.selectionStart - nbMatch , editArea.textarea.selectionEnd);
-		
-		parent.editAreaLoader.setSelectedText(editArea.id, content );
-		range= parent.editAreaLoader.getSelectionRange(editArea.id);
-		
-		if( cursor_forced_position != -1 )
-			new_pos	= range["end"] - ( content.length-cursor_forced_position );
-		else
-			new_pos	= range["end"];	
-		parent.editAreaLoader.setSelectionRange(editArea.id, new_pos, new_pos);
-		this._hide();
-	}
-	
-	
-	/**
-	 * Parse the AUTO_COMPLETION part of syntax definition files
-	 */
-	,_parseSyntaxAutoCompletionDatas: function(){
-		//foreach syntax loaded
-		for(var lang in parent.editAreaLoader.load_syntax)
-		{
-			if(!parent.editAreaLoader.syntax[lang]['autocompletion'])	// init the regexp if not already initialized
-			{
-				parent.editAreaLoader.syntax[lang]['autocompletion']= {};
-				// the file has auto completion datas
-				if(parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'])
-				{
-					// parse them
-					for(var i in parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'])
-					{
-						datas	= parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'][i];
-						tmp	= {};
-						if(datas["CASE_SENSITIVE"]!="undefined" && datas["CASE_SENSITIVE"]==false)
-							tmp["modifiers"]="i";
-						else
-							tmp["modifiers"]="";
-						tmp["prefix_separator"]= datas["REGEXP"]["prefix_separator"];
-						tmp["match_prefix_separator"]= new RegExp( datas["REGEXP"]["prefix_separator"] +"$", tmp["modifiers"]);
-						tmp["match_word"]= new RegExp("(?:"+ datas["REGEXP"]["before_word"] +")("+ datas["REGEXP"]["possible_words_letters"] +")$", tmp["modifiers"]);
-						tmp["match_next_letter"]= new RegExp("^("+ datas["REGEXP"]["letter_after_word_must_match"] +")$", tmp["modifiers"]);
-						tmp["keywords"]= {};
-						//console.log( datas["KEYWORDS"] );
-						for( var prefix in datas["KEYWORDS"] )
-						{
-							tmp["keywords"][prefix]= {
-								prefix: prefix,
-								prefix_name: prefix,
-								prefix_reg: new RegExp("(?:"+ parent.editAreaLoader.get_escaped_regexp( prefix ) +")(?:"+ tmp["prefix_separator"] +")$", tmp["modifiers"] ),
-								datas: []
-							};
-							for( var j=0; j<datas["KEYWORDS"][prefix].length; j++ )
-							{
-								tmp["keywords"][prefix]['datas'][j]= {
-									is_typing: datas["KEYWORDS"][prefix][j][0],
-									// if replace with is empty, replace with the is_typing value
-									replace_with: datas["KEYWORDS"][prefix][j][1] ? datas["KEYWORDS"][prefix][j][1].replace('�', datas["KEYWORDS"][prefix][j][0] ) : '',
-									comment: datas["KEYWORDS"][prefix][j][2] ? datas["KEYWORDS"][prefix][j][2] : '' 
-								};
-								
-								// the replace with shouldn't be empty
-								if( tmp["keywords"][prefix]['datas'][j]['replace_with'].length == 0 )
-									tmp["keywords"][prefix]['datas'][j]['replace_with'] = tmp["keywords"][prefix]['datas'][j]['is_typing'];
-								
-								// if the comment is empty, display the replace_with value
-								if( tmp["keywords"][prefix]['datas'][j]['comment'].length == 0 )
-									 tmp["keywords"][prefix]['datas'][j]['comment'] = tmp["keywords"][prefix]['datas'][j]['replace_with'].replace(/{@}/g, '' );
-							}
-								
-						}
-						tmp["max_text_length"]= datas["MAX_TEXT_LENGTH"];
-						parent.editAreaLoader.syntax[lang]['autocompletion'][i]	= tmp;
-					}
-				}
-			}
-		}
-	}
-	
-	,_checkLetter: function(){
-		// check that syntax hasn't changed
-		if( this.curr_syntax_str != editArea.settings['syntax'] )
-		{
-			if( !parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'] )
-				this._parseSyntaxAutoCompletionDatas();
-			this.curr_syntax= parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'];
-			this.curr_syntax_str = editArea.settings['syntax'];
-			//console.log( this.curr_syntax );
-		}
-		
-		if( editArea.is_editable )
-		{
-			time=new Date;
-			t1= time.getTime();
-			editArea.getIESelection();
-			this.selectIndex	= -1;
-			start=editArea.textarea.selectionStart;
-			var str	= editArea.textarea.value;
-			var results= [];
-			
-			
-			for(var i in this.curr_syntax)
-			{
-				var last_chars	= str.substring(Math.max(0, start-this.curr_syntax[i]["max_text_length"]), start);
-				var matchNextletter	= str.substring(start, start+1).match( this.curr_syntax[i]["match_next_letter"]);
-				// if not writting in the middle of a word or if forcing display
-				if( matchNextletter || this.forceDisplay )
-				{
-					// check if the last chars match a separator
-					var match_prefix_separator = last_chars.match(this.curr_syntax[i]["match_prefix_separator"]);
-			
-					// check if it match a possible word
-					var match_word= last_chars.match(this.curr_syntax[i]["match_word"]);
-					
-					//console.log( match_word );
-					if( match_word )
-					{
-						var begin_word= match_word[1];
-						var match_curr_word= new RegExp("^"+ parent.editAreaLoader.get_escaped_regexp( begin_word ), this.curr_syntax[i]["modifiers"]);
-						//console.log( match_curr_word );
-						for(var prefix in this.curr_syntax[i]["keywords"])
-						{
-						//	parent.console.log( this.curr_syntax[i]["keywords"][prefix] );
-							for(var j=0; j<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
-							{
-						//		parent.console.log( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'] );
-								// the key word match or force display 
-								if( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'].match(match_curr_word) )
-								{
-							//		parent.console.log('match');
-									hasMatch = false;
-									var before = last_chars.substr( 0, last_chars.length - begin_word.length );
-									
-									// no prefix to match => it's valid
-									if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 )
-									{
-										if( ! before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
-											hasMatch = true;
-									}
-									// we still need to check the prefix if there is one
-									else if( this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 )
-									{
-										if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
-											hasMatch = true;
-									}
-									
-									if( hasMatch )
-										results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ];
-								}	
-							}
-						}
-					}
-					// it doesn't match any possible word but we want to display something
-					// we'll display to list of all available words
-					else if( this.forceDisplay || match_prefix_separator )
-					{
-						for(var prefix in this.curr_syntax[i]["keywords"])
-						{
-							for(var j=0; j<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
-							{
-								hasMatch = false;
-								// no prefix to match => it's valid
-								if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 )
-								{
-									hasMatch	= true;
-								}
-								// we still need to check the prefix if there is one
-								else if( match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 )
-								{
-									var before = last_chars; //.substr( 0, last_chars.length );
-									if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
-										hasMatch = true;
-								}	
-									
-								if( hasMatch )
-									results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ];	
-							}
-						}
-					}
-				}
-			}
-			
-			// there is only one result, and we can select it automatically
-			if( results.length == 1 && this.autoSelectIfOneResult )
-			{
-			//	console.log( results );
-				this._select( results[0][1]['replace_with'] );
-			}
-			else if( results.length == 0 )
-			{
-				this._hide();
-			}
-			else
-			{
-				// build the suggestion box content
-				var lines=[];
-				for(var i=0; i<results.length; i++)
-				{
-					var line= "<li><a href=\"#\" class=\"entry\" onmousedown=\"EditArea_autocompletion._select('"+ results[i][1]['replace_with'].replace(new RegExp('"', "g"), "&quot;") +"');return false;\">"+ results[i][1]['comment'];
-					if(results[i][0]['prefix_name'].length>0)
-						line+='<span class="prefix">'+ results[i][0]['prefix_name'] +'</span>';
-					line+='</a></li>';
-					lines[lines.length]=line;
-				}
-				// sort results
-				this.container.innerHTML		= '<ul>'+ lines.sort().join('') +'</ul>';
-				
-				var cursor	= _$("cursor_pos");
-				this.container.style.top		= ( cursor.cursor_top + editArea.lineHeight ) +"px";
-				this.container.style.left		= ( cursor.cursor_left + 8 ) +"px";
-				this._show();
-			}
-				
-			this.autoSelectIfOneResult = false;
-			time=new Date;
-			t2= time.getTime();
-		
-			//parent.console.log( begin_word +"\n"+ (t2-t1) +"\n"+ html );
-		}
-	}
-};
-
-// Load as a plugin
-editArea.settings['plugins'][ editArea.settings['plugins'].length ] = 'autocompletion';
-editArea.add_plugin('autocompletion', EditArea_autocompletion);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.css
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.css b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.css
deleted file mode 100644
index 172b366..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.css
+++ /dev/null
@@ -1,530 +0,0 @@
-body, html{
-	margin: 0; 
-	padding: 0;
-	height: 100%;
-	border: none;
-	overflow: hidden;
-	background-color: #FFF;
-}
-
-body, html, table, form, textarea{
-	font: 12px monospace, sans-serif;
-}
-
-#editor{
-	border: solid #888 1px;
-	overflow: hidden;
-}
-
-#result{
-	z-index: 4; 
-	overflow-x: auto;
-	overflow-y: scroll;
-	border-top: solid #888 1px;
-	border-bottom: solid #888 1px;
-	position: relative;
-	clear: both;
-}
-
-#result.empty{
-	overflow: hidden;
-}
-
-#container{
-	overflow: hidden;
-	border: solid blue 0;
-	position: relative; 
-	z-index: 10;
-	padding: 0 5px 0 45px;
-	/*padding-right: 5px;*/ 
-}
-
-#textarea{
-	position: relative; 
-	top: 0; 
-	left: 0;
-	margin: 0;
-	padding: 0;
-	width: 100%;
-	height: 100%; 
-	overflow: hidden;  
-	z-index: 7; 
-	border-width: 0;
-	background-color: transparent;
-	resize: none;
-}
-
-#textarea, #textarea:hover{
-	outline: none;	/* safari outline fix */
-}
-
-#content_highlight{
-	white-space: pre;
-	margin: 0;
-	padding: 0;
-	position : absolute; 
-	z-index: 4; 
-	overflow: visible;
-}
-
-
-#selection_field, #selection_field_text{
-	margin: 0; 
-	background-color: #E1F2F9; 
-/*	height: 1px; */  
-	position: absolute;
-	z-index: 5;
-	top: -100px;
-	padding: 0;
-	white-space: pre;
-	overflow: hidden;
-}
-
-#selection_field.show_colors {
-	z-index: 3;
-	background-color:#EDF9FC;
-	
-}
-
-#selection_field strong{
-	font-weight:normal;
-}
-
-#selection_field.show_colors *, #selection_field_text * {
-	visibility: hidden;
-}
-
-#selection_field_text{
-	background-color:transparent;
-}
-
-#selection_field_text strong{
-	font-weight:normal;
-	background-color:#3399FE;
-	color: #FFF;
-	visibility:visible;
-}
-
-#container.word_wrap #content_highlight,
-#container.word_wrap #selection_field,
-#container.word_wrap #selection_field_text,
-#container.word_wrap #test_font_size{
-	white-space: pre-wrap;       /* css-3 */
-	white-space: -moz-pre-wrap !important;  /* Mozilla, since 1999 */
-	white-space: -pre-wrap;      /* Opera 4-6 */
-	white-space: -o-pre-wrap;    /* Opera 7 */
-	word-wrap: break-word;       /* Internet Explorer 5.5+ */
-	width: 99%;
-}
-
-#line_number{
-	position: absolute;
-	overflow: hidden;
-	border-right: solid black 1px;
-	z-index:8;
-	width: 38px;
-	padding: 0 5px 0 0;
-	margin: 0 0 0 -45px;
-	text-align: right;
-	color: #AAAAAA;
-}
-
-#test_font_size{
-	padding: 0; 
-	margin: 0; 
-	visibility: hidden;
-	position: absolute;
-	white-space: pre;
-}
-
-pre{
-	margin: 0;
-	padding: 0;
-}
-
-.hidden{
-	opacity: 0.2; 
-	filter:alpha(opacity=20);
-}
-
-#result .edit_area_cursor{
-	position: absolute; 
-	z-index:6; 
-	background-color: #FF6633;
-	top: -100px;
-	margin: 0;
-}
-
-#result .edit_area_selection_field .overline{
-	background-color: #996600;
-}
-
-
-/* area popup */
-.editarea_popup{
-	border: solid 1px #888888;
-	background-color: #ECE9D8; 
-	width: 250px; 
-	padding: 4px; 
-	position: absolute;
-	visibility: hidden; 
-	z-index: 15;
-	top: -500px;
-}
-
-.editarea_popup, .editarea_popup table{
-	font-family: sans-serif;
-	font-size: 10pt;
-}
-
-.editarea_popup img{
-	border: 0;
-}
-
-.editarea_popup .close_popup{
-	float: right; 
-	line-height: 16px; 
-	border: 0; 
-	padding: 0;
-}
-
-.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{
-	margin: 0;
-	padding: 0;
-}
-
-.editarea_popup .copyright{
-	text-align: right;
-}	
-
-/* Area_search */
-div#area_search_replace{
-	/*width: 250px;*/
-}
-
-div#area_search_replace img{
-	border: 0;
-}
-
-div#area_search_replace div.button{
-	text-align: center;
-	line-height: 1.7em;
-}
-
-div#area_search_replace .button a{
-	cursor: pointer;
-	border: solid 1px #888888;
-	background-color: #DEDEDE;
-	text-decoration: none;
-	padding: 0 2px;
-	color: #000000;	
-	white-space: nowrap;
-}
-
-div#area_search_replace a:hover{	
-	/*border: solid 1px #888888;*/
-	background-color: #EDEDED;
-}
-
-div#area_search_replace  #move_area_search_replace{
-	cursor: move; 
-	border: solid 1px #888;
-}
-
-div#area_search_replace  #close_area_search_replace{
-	text-align: right; 
-	vertical-align: top; 
-	white-space: nowrap;
-}
-
-div#area_search_replace  #area_search_msg{
-	height: 18px; 
-	overflow: hidden; 
-	border-top: solid 1px #888; 
-	margin-top: 3px;
-}
-
-/* area help */
-#edit_area_help{
-	width: 350px;
-}
-
-#edit_area_help div.close_popup{
-	float: right;
-}
-
-/* area_toolbar */
-.area_toolbar{
-	/*font: 11px sans-serif;*/
-	width: 100%; 
-	/*height: 21px; */
-	margin: 0; 
-	padding: 0;
-	background-color: #ECE9D8;
-	text-align: center;
-}
-
-.area_toolbar, .area_toolbar table{
-	font: 11px sans-serif;
-}
-
-.area_toolbar img{
-	border: 0;
-	vertical-align: middle;
-}
-
-.area_toolbar input{
-	margin: 0;
-	padding: 0;
-}
-
-.area_toolbar select{
-    font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
-    font-size: 7pt;
-    font-weight: normal;
-    margin: 2px 0 0 0 ;
-    padding: 0;
-    vertical-align: top;
-    background-color: #F0F0EE;
-}
-
-table.statusbar{
-	width: 100%;
-}
-
-.area_toolbar td.infos{
-	text-align: center;
-	width: 130px;
-	border-right: solid 1px #888;
-	border-width: 0 1px 0 0;
-	padding: 0;
-}
-
-.area_toolbar td.total{
-	text-align: right;
-	width: 50px;
-	padding: 0;
-}
-
-.area_toolbar td.resize{
-	text-align: right;
-}
-/*
-.area_toolbar span{
-	line-height: 1px;
-	padding: 0;
-	margin: 0;
-}*/
-
-.area_toolbar span#resize_area{
-	cursor: nw-resize;
-	visibility: hidden;
-}
-
-/* toolbar buttons */
-.editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected {
-	border: 0; margin: 0; padding: 0; background: transparent;
-	margin-top: 0;
-	margin-left: 1px;
-	padding: 0;
-}
-
-.editAreaButtonNormal {
-	border: 1px solid #ECE9D8 !important;
-	cursor: pointer;
-}
-
-.editAreaButtonOver {
-	border: 1px solid #0A246A !important;
-	cursor: pointer;
-	background-color: #B6BDD2;
-}
-
-.editAreaButtonDown {
-	cursor: pointer;
-	border: 1px solid #0A246A !important;
-	background-color: #8592B5;
-}
-
-.editAreaButtonSelected {
-	border: 1px solid #C0C0BB !important;
-	cursor: pointer;
-	background-color: #F4F2E8;
-}
-
-.editAreaButtonDisabled {
-	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
-	-moz-opacity:0.3;
-	opacity: 0.3;
-	border: 1px solid #F0F0EE !important;
-	cursor: pointer;
-}
-
-.editAreaSeparatorLine {
-	margin: 1px 2px;
-	background-color: #C0C0BB;
-	width: 2px;
-	height: 18px;
-}
-
-/* waiting screen */
-#processing{
-	display: none; 
-	background-color:#ECE9D8; 
-	border: solid #888 1px;
-	position: absolute; 
-	top: 0; 
-	left: 0;
-	width: 100%; 
-	height: 100%; 
-	z-index: 100; 
-	text-align: center;
-}
-
-#processing_text{
-	position:absolute;
-	left: 50%;
-	top: 50%;
-	width: 200px;
-	height: 20px; 
-	margin-left: -100px;
-	margin-top: -10px;
-	text-align: center;
-}
-/* end */
-
-
-/**** tab browsing area ****/
-#tab_browsing_area{
-	display: none;
-	background-color: #CCC9A8;
-	border-top: 1px solid #888;
-	text-align: left;
-	margin: 0;
-}
-
-#tab_browsing_list {
-	padding: 0; 
-	margin: 0; 
-	list-style-type: none;
-	white-space: nowrap;
-}
-#tab_browsing_list li {
-	float: left;
-	margin: -1px;
-}
-#tab_browsing_list a {
-	position: relative;
-	display: block; 
-	text-decoration: none; 
-	float: left; 
-	cursor: pointer;
-	line-height:14px;
-}
-
-#tab_browsing_list a span {
-	display: block; 
-	color: #000; 
-	background: #ECE9D8; 
-	border:	1px solid #888; 
-	border-width: 1px 1px 0; 
-	text-align: center; 
-	padding: 2px 2px 1px 4px; 
-	position: relative;	/*IE 6 hack */
-}
-
-#tab_browsing_list a b {
-	display: block; 
-	border-bottom: 2px solid #617994;
-}
-
-#tab_browsing_list a .edited {
-	display: none;
-}
-
-#tab_browsing_list a.edited .edited {
-	display: inline;
-}
-
-#tab_browsing_list a img{
-	margin-left: 7px;
-}
-
-#tab_browsing_list a.edited img{
-	margin-left: 3px;
-}
-
-#tab_browsing_list a:hover span {
-	background: #F4F2E8;
-	border-color: #0A246A;
-}
-
-#tab_browsing_list .selected a span{
-	background: #046380;
-	color: #FFF;
-}
-
-
-#no_file_selected{
-	height: 100%;
-	width: 150%; /* Opera need more than 100% */
-	background: #CCC;
-	display: none;
-	z-index: 20;
-	position: absolute;
-}
-
-
-/*** Non-editable mode ***/
-.non_editable #editor
-{
-	border-width: 0 1px;
-}
-
-.non_editable .area_toolbar
-{
-	display: none;
-}
-
-/*** Auto completion ***/
-#auto_completion_area
-{
-	background:	#FFF;
-	border:		solid 1px #888;
-	position:	absolute;
-	z-index:	15;
-	width:	280px;
-	height:	180px;
-	overflow: auto;
-	display:none;
-}
-
-#auto_completion_area a, #auto_completion_area a:visited
-{
-	display:	block;
-	padding:	0 2px 1px;
-	color:		#000;
-	text-decoration:none;
-}
-
-#auto_completion_area a:hover, #auto_completion_area a:focus, #auto_completion_area a.focus
-{
-	background:	#D6E1FE;
-	text-decoration:none;
-}
-
-#auto_completion_area ul
-{
-	margin:	0;
-	padding: 0;
-	list-style: none inside;
-}
-#auto_completion_area li
-{
-	padding:	0;
-}
-#auto_completion_area .prefix
-{
-	font-style: italic;
-	padding: 0 3px;
-}
\ No newline at end of file


[04/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/theme_resource_util.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/theme_resource_util.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/theme_resource_util.js
deleted file mode 100644
index 2b21b02..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/theme_resource_util.js
+++ /dev/null
@@ -1,828 +0,0 @@
-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/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/logo_mgt.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/logo_mgt.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/logo_mgt.jsp
deleted file mode 100644
index 486f5a5..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/logo_mgt.jsp
+++ /dev/null
@@ -1,220 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.wso2.carbon.theme.mgt.ui.utils.ThemeUtil" %>
-<%@ page import="org.wso2.carbon.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.wso2.carbon.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.wso2.carbon.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.wso2.carbon.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/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/metadata_resourcepath.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/metadata_resourcepath.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/metadata_resourcepath.jsp
deleted file mode 100644
index 84de4e9..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/metadata_resourcepath.jsp
+++ /dev/null
@@ -1,106 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.MetadataBean" %>
-<%@ page import="org.wso2.carbon.theme.mgt.stub.registry.resource.stub.common.xsd.WebResourcePath" %>
-<%@ page import="org.wso2.carbon.registry.resource.ui.Utils" %>
-<%@ page import="org.wso2.carbon.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/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/raw-collection-content.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/raw-collection-content.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/raw-collection-content.jsp
deleted file mode 100644
index 29ce786..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/raw-collection-content.jsp
+++ /dev/null
@@ -1,755 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.CollectionContentBean" %>
-<%@ page import="org.wso2.carbon.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.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="org.wso2.carbon.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.wso2.carbon.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.wso2.carbon.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.wso2.carbon.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/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/rename_resource_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/rename_resource_ajaxprocessor.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/rename_resource_ajaxprocessor.jsp
deleted file mode 100644
index 156d659..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/rename_resource_ajaxprocessor.jsp
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.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/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_advanced.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_advanced.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_advanced.jsp
deleted file mode 100644
index af8f766..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_advanced.jsp
+++ /dev/null
@@ -1,139 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.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.wso2.carbon.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>


[05/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/python.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/python.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/python.js
deleted file mode 100644
index 4b0acf2..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/python.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * Python syntax v 1.1 
- * 
- * v1.1 by Andre Roberge (2006/12/27)
- *   
-**/
-editAreaLoader.load_syntax["python"] = {
-	'COMMENT_SINGLE' : {1 : '#'}
-	,'COMMENT_MULTI' : {}
-	,'QUOTEMARKS' : {1: "'", 2: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : true
-	,'KEYWORDS' : {
-		/*
-		** Set 1: reserved words
-		** http://python.org/doc/current/ref/keywords.html
-		** Note: 'as' and 'with' have been added starting with Python 2.5
-		*/
-		'reserved' : [
-			'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
-			'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 
-			'import', 'is', 'in', 'lambda', 'not', 'or', 'pass', 'print', 'raise',
-			'return', 'try', 'while', 'with', 'yield'
-			//the following are *almost* reserved; we'll treat them as such
-			, 'False', 'True', 'None'
-		]
-		/*
-		** Set 2: builtins
-		** http://python.org/doc/current/lib/built-in-funcs.html
-		*/	
-		,'builtins' : [
-			'__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp', 
-			'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', 
-			'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
-			'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
-			'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
-			'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
-			'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', 
-			'vars', 'xrange', 'zip',
-			// Built-in constants: http://www.python.org/doc/2.4.1/lib/node35.html
-			//'False', 'True', 'None' have been included in 'reserved'
-			'NotImplemented', 'Ellipsis',
-			// Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
-			'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
-			'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
-			'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
-			'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
-			'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
-			'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
-			'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
-			'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
-			'RuntimeWarning', 'FutureWarning',		
-			// we will include the string methods as well
-			// http://python.org/doc/current/lib/string-methods.html
-			'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
-			'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle',
-			'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
-			'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
-			'translate', 'upper', 'zfill'
-		]
-		/*
-		** Set 3: standard library
-		** http://python.org/doc/current/lib/modindex.html
-		*/
-		,'stdlib' : [
-			'__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
-			'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
-			'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
-			'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
-			'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler',
-			'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
-			'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
-			'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
-			'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
-			'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
-			'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
-			'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
-			'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
-			'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
-			'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
-			'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
-			'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
-			'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
-			'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
-			're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',
-			'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
-			'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
-			'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
-			'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
-			'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
-			'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
-			'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
-			'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
-			'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
-			'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib'
-
-		]
-		/*
-		** Set 4: special methods
-		** http://python.org/doc/current/ref/specialnames.html
-		*/
-		,'special' : [
-			// Basic customization: http://python.org/doc/current/ref/customization.html
-			'__new__', '__init__', '__del__', '__repr__', '__str__', 
-			'__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
-			'__hash__', '__nonzero__', '__unicode__', '__dict__',
-			// Attribute access: http://python.org/doc/current/ref/attribute-access.html
-			'__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
-			'__delete__', '__slots__',
-			// Class creation, callable objects
-			'__metaclass__', '__call__', 
-			// Container types: http://python.org/doc/current/ref/sequence-types.html
-			'__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
-			'__getslice__', '__setslice__', '__delslice__',
-			// Numeric types: http://python.org/doc/current/ref/numeric-types.html
-			'__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
-			'__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
-			'__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
-			'__long__','__lshift__',
-			'__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
-			'__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
-			'__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__',
-			'__sub__','__xor__'
-		]
-	}
-	,'OPERATORS' :[
-		'+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #660066;'
-		,'KEYWORDS' : {
-			'reserved' : 'color: #0000FF;'
-			,'builtins' : 'color: #009900;'
-			,'stdlib' : 'color: #009900;'
-			,'special': 'color: #006666;'
-			}
-		,'OPERATORS' : 'color: #993300;'
-		,'DELIMITERS' : 'color: #993300;'
-				
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/robotstxt.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/robotstxt.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/robotstxt.js
deleted file mode 100644
index d57395f..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/robotstxt.js
+++ /dev/null
@@ -1,24 +0,0 @@
-editAreaLoader.load_syntax["robotstxt"] = {
-	'COMMENT_SINGLE' : {1 : '#'},
-	'COMMENT_MULTI' : {},
-	'QUOTEMARKS' : [],
-	'KEYWORD_CASE_SENSITIVE' : false,
-	'KEYWORDS' : {
-		'attributes' : ['User-agent', 'Disallow', 'Allow', 'Crawl-delay'],
-		'values' : ['*'],
-		'specials' : ['*']
-	},
-	'OPERATORS' :[':'],
-	'DELIMITERS' :[],
-	'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;',
-		'QUOTESMARKS': 'color: #6381F8;',
-		'KEYWORDS' : {
-			'attributes' : 'color: #48BDDF;',
-			'values' : 'color: #2B60FF;',
-			'specials' : 'color: #FF0000;'
-			},
-	'OPERATORS' : 'color: #FF00FF;',
-	'DELIMITERS' : 'color: #60CA00;'			
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/ruby.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/ruby.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/ruby.js
deleted file mode 100644
index c6ee2f4..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/ruby.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Ruby syntax v 1.0 
- * 
- * v1.0 by Patrice De Saint Steban (2007/01/03)
- *   
-**/
-editAreaLoader.load_syntax["ruby"] = {
-	'COMMENT_SINGLE' : {1 : '#'}
-	,'COMMENT_MULTI' : {}
-	,'QUOTEMARKS' : {1: "'", 2: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : true
-	,'KEYWORDS' : {
-		'reserved' : [
-			'alias', 'and', 'BEGIN', 'begin', 'break', 'case', 'class', 'def', 'defined', 'do', 'else',
-			'elsif', 'END', 'end', 'ensure', 'false', 'for', 'if', 
-			'in', 'module', 'next', 'not', 'or', 'redo', 'rescue', 'retry',
-			'return', 'self', 'super', 'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield'
-		]
-	}
-	,'OPERATORS' :[
-		'+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'REGEXPS' : {
-		'constants' : {
-			'search' : '()([A-Z]\\w*)()'
-			,'class' : 'constants'
-			,'modifiers' : 'g'
-			,'execute' : 'before' 
-		}
-		,'variables' : {
-			'search' : '()([\$\@\%]+\\w+)()'
-			,'class' : 'variables'
-			,'modifiers' : 'g'
-			,'execute' : 'before' 
-		}
-		,'numbers' : {
-			'search' : '()(-?[0-9]+)()'
-			,'class' : 'numbers'
-			,'modifiers' : 'g'
-			,'execute' : 'before' 
-		}
-		,'symbols' : {
-			'search' : '()(:\\w+)()'
-			,'class' : 'symbols'
-			,'modifiers' : 'g'
-			,'execute' : 'before'
-		}
-	}
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #660066;'
-		,'KEYWORDS' : {
-			'reserved' : 'font-weight: bold; color: #0000FF;'
-			}
-		,'OPERATORS' : 'color: #993300;'
-		,'DELIMITERS' : 'color: #993300;'
-		,'REGEXPS' : {
-			'variables' : 'color: #E0BD54;'
-			,'numbers' : 'color: green;'
-			,'constants' : 'color: #00AA00;'
-			,'symbols' : 'color: #879EFA;'
-		}	
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/sql.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/sql.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/sql.js
deleted file mode 100644
index 8ef1b36..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/sql.js
+++ /dev/null
@@ -1,55 +0,0 @@
-editAreaLoader.load_syntax["sql"] = {
-	'COMMENT_SINGLE' : {1 : '--'}
-	,'COMMENT_MULTI' : {'/*' : '*/'}
-	,'QUOTEMARKS' : {1: "'", 2: '"', 3: '`'}
-	,'KEYWORD_CASE_SENSITIVE' : false
-	,'KEYWORDS' : {
-		'statements' : [
-			'select', 'SELECT', 'where', 'order', 'by',
-			'insert', 'from', 'update', 'grant', 'left join', 'right join', 
-            'union', 'group', 'having', 'limit', 'alter', 'LIKE','IN','CASE'
-		]
-		,'reserved' : [
-			'null', 'enum', 'int', 'boolean', 'add', 'varchar'
-			
-		]
-		,'functions' : [
-   'ABS','ACOS','ADDDATE','ADDTIME','AES_DECRYPT','AES_ENCRYPT','ASCII','ASIN','ATAN2 ATAN','ATAN','AVG','BENCHMARK','DISTINCT','BIN','BIT_AND','BIT_COUNT','BIT_LENGTH','BIT_OR','BIT_XOR','CAST','CEILING CEIL','CHAR_LENGTH','CHAR',
-'CHARACTER_LENGTH','CHARSET','COALESCE','COERCIBILITY','COLLATION','COMPRESS','CONCAT_WS','CONCAT','CONNECTION_ID','CONV','CONVERT_TZ','COS','COT','COUNT','CRC32','CURDATE','CURRENT_DATE','CURRENT_TIME','CURRENT_TIMESTAMP','CURRENT_USER','CURTIME','DATABASE','DATE_ADD','DATE_FORMAT','DATE_SUB','DATE','DATEDIFF','DAY','DAYNAME','DAYOFMONTH',
-'DAYOFWEEK','DAYOFYEAR','DECODE','DEFAULT','DEGREES','DES_DECRYPT','DES_ENCRYPT','ELT','ENCODE','ENCRYPT','EXP','EXPORT_SET','EXTRACT','FIELD','FIND_IN_SET','FLOOR','FORMAT','FOUND_ROWS','FROM_DAYS','FROM_UNIXTIME','GET_FORMAT','GET_LOCK','GREATEST','GROUP_CONCAT','HEX','HOUR','IF','IFNULL','INET_ATON','INET_NTOA',
-'INSERT','INSTR','INTERVAL','IS_FREE_LOCK','IS_USED_LOCK','ISNULL','LAST_DAY','LAST_INSERT_ID','LCASE','LEAST','LEFT','LENGTH','LN','LOAD_FILE','LOCALTIME','LOCALTIMESTAMP','LOCATE','LOG10','LOG2','LOG','LOWER','LPAD','LTRIM','MAKE_SET','MAKEDATE','MAKETIME','MASTER_POS_WAIT','MAX','MD5','MICROSECOND',
-'MID','MIN','MINUTE','MOD','MONTH','MONTHNAME','NOW','NULLIF','OCT','OCTET_LENGTH','OLD_PASSWORD','ORD','PASSWORD','PERIOD_ADD','PERIOD_DIFF','PI','POSITION','POW','POWER','PROCEDURE ANALYSE','QUARTER','QUOTE','RADIANS','RAND','RELEASE_LOCK','REPEAT','REPLACE','REVERSE','RIGHT','ROUND',
-'RPAD','RTRIM','SEC_TO_TIME','SECOND','SESSION_USER','SHA1','SHA','SIGN','SIN','SOUNDEX','SOUNDS LIKE','SPACE','SQRT','STD','STDDEV','STR_TO_DATE','STRCMP','SUBDATE','SUBSTRING_INDEX','SUBSTRING','SUBSTR','SUBTIME','SUM','SYSDATE','SYSTEM_USER','TAN','TIME_FORMAT','TIME_TO_SEC','TIME','TIMEDIFF',
-'TIMESTAMP','TO_DAYS','TRIM','TRUNCATE','UCASE','UNCOMPRESS','UNCOMPRESSED_LENGTH','UNHEX','UNIX_TIMESTAMP','UPPER','USER','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','UUID','VALUES','VARIANCE','WEEK','WEEKDAY','WEEKOFYEAR','YEAR','YEARWEEK'
-		]
-	}
-	,'OPERATORS' :[
-     'AND','&&','BETWEEN','BINARY','&','|','^','/','DIV','<=>','=','>=','>','<<','>>','IS','NULL','<=','<','-','%','!=','<>','!','||','OR','+','REGEXP','RLIKE','XOR','~','*'
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'REGEXPS' : {
-		// highlight all variables (@...)
-		'variables' : {
-			'search' : '()(\\@\\w+)()'
-			,'class' : 'variables'
-			,'modifiers' : 'g'
-			,'execute' : 'before' // before or after
-		}
-	}
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #879EFA;'
-		,'KEYWORDS' : {
-			'reserved' : 'color: #48BDDF;'
-			,'functions' : 'color: #0040FD;'
-			,'statements' : 'color: #60CA00;'
-			}
-		,'OPERATORS' : 'color: #FF00FF;'
-		,'DELIMITERS' : 'color: #2B60FF;'
-		,'REGEXPS' : {
-			'variables' : 'color: #E0BD54;'
-		}		
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/tsql.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/tsql.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/tsql.js
deleted file mode 100644
index 7e9057d..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/tsql.js
+++ /dev/null
@@ -1,87 +0,0 @@
-editAreaLoader.load_syntax["tsql"] = {
-	'COMMENT_SINGLE' : {1 : '--'}
-	,'COMMENT_MULTI' : {'/*' : '*/'}
-	,'QUOTEMARKS' : {1: "'" }
-	,'KEYWORD_CASE_SENSITIVE' : false
-	,'KEYWORDS' : {
-		'statements': [
-		    'ADD', 'EXCEPT', 'PERCENT', 'EXEC', 'PLAN', 'ALTER', 'EXECUTE', 'PRECISION',
-		    'PRIMARY', 'EXIT', 'PRINT', 'AS', 'FETCH', 'PROC', 'ASC',
-		    'FILE', 'PROCEDURE', 'AUTHORIZATION', 'FILLFACTOR', 'PUBLIC', 'BACKUP', 'FOR', 'RAISERROR',
-		    'BEGIN', 'FOREIGN', 'READ', 'FREETEXT', 'READTEXT', 'BREAK', 'FREETEXTTABLE',
-		    'RECONFIGURE', 'BROWSE', 'FROM', 'REFERENCES', 'BULK', 'FULL', 'REPLICATION', 'BY',
-		    'FUNCTION', 'RESTORE', 'CASCADE', 'GOTO', 'RESTRICT', 'CASE', 'GRANT', 'RETURN',
-		    'CHECK', 'GROUP', 'REVOKE', 'CHECKPOINT', 'HAVING', 'RIGHT', 'CLOSE', 'HOLDLOCK', 'ROLLBACK',
-		    'CLUSTERED', 'IDENTITY', 'ROWCOUNT', 'IDENTITY_INSERT', 'ROWGUIDCOL', 'COLLATE', 
-		    'IDENTITYCOL', 'RULE', 'COLUMN', 'IF', 'SAVE', 'COMMIT', 'SCHEMA', 'COMPUTE', 'INDEX',
-		    'SELECT', 'CONSTRAINT', 'CONTAINS', 'INSERT', 'SET',
-		    'CONTAINSTABLE', 'INTERSECT', 'SETUSER', 'CONTINUE', 'INTO', 'SHUTDOWN', 'SOME',
-		    'CREATE', 'STATISTICS', 'KEY', 'CURRENT', 'KILL', 'TABLE',
-		    'CURRENT_DATE', 'TEXTSIZE', 'CURRENT_TIME', 'THEN', 'LINENO',
-		    'TO', 'LOAD', 'TOP', 'CURSOR', 'NATIONAL', 'TRAN', 'DATABASE', 'NOCHECK', 
-		    'TRANSACTION', 'DBCC', 'NONCLUSTERED', 'TRIGGER', 'DEALLOCATE', 'TRUNCATE',
-		    'DECLARE', 'TSEQUAL', 'DEFAULT', 'UNION', 'DELETE', 'OF', 'UNIQUE',
-		    'DENY', 'OFF', 'UPDATE', 'DESC', 'OFFSETS', 'UPDATETEXT', 'DISK', 'ON', 'USE', 'DISTINCT', 'OPEN',
-		    'DISTRIBUTED', 'OPENDATASOURCE', 'VALUES', 'DOUBLE', 'OPENQUERY', 'VARYING', 'DROP', 
-		    'OPENROWSET', 'VIEW', 'DUMMY', 'OPENXML', 'WAITFOR', 'DUMP', 'OPTION', 'WHEN', 'ELSE', 'WHERE',
-		    'END', 'ORDER', 'WHILE', 'ERRLVL', 'WITH', 'ESCAPE', 'OVER', 'WRITETEXT'
-		],
-		'functions': [
-		    'COALESCE', 'SESSION_USER', 'CONVERT', 'SYSTEM_USER', 'CURRENT_TIMESTAMP', 'CURRENT_USER', 'NULLIF', 'USER',
-			'AVG', 'MIN', 'CHECKSUM', 'SUM', 'CHECKSUM_AGG', 'STDEV', 'COUNT', 'STDEVP', 'COUNT_BIG', 'VAR', 'GROUPING', 'VARP', 'MAX',
-			'@@DATEFIRST', '@@OPTIONS', '@@DBTS', '@@REMSERVER', '@@LANGID', '@@SERVERNAME', '@@LANGUAGE', '@@SERVICENAME', '@@LOCK_TIMEOUT',
-			'@@SPID', '@@MAX_CONNECTIONS', '@@TEXTSIZE', '@@MAX_PRECISION', '@@VERSION', '@@NESTLEVEL',
-			'@@CURSOR_ROWS', 'CURSOR_STATUS', '@@FETCH_STATUS',
-			'DATEADD', 'DATEDIFF', 'DATENAME', 'DATEPART', 'DAY', 'GETDATE', 'GETUTCDATE', 'MONTH', 'YEAR',
-			'ABS', 'DEGREES', 'RAND', 'ACOS', 'EXP', 'ROUND', 'ASIN', 'FLOOR', 'SIGN', 'ATAN', 'LOG', 'SIN', 'ATN2', 'LOG10', 'SQRT',
-			'CEILING', 'PI ', 'SQUARE', 'COS', 'POWER', 'TAN', 'COT', 'RADIANS',
-			'@@PROCID', 'COL_LENGTH', 'FULLTEXTCATALOGPROPERTY', 'COL_NAME', 'FULLTEXTSERVICEPROPERTY', 'COLUMNPROPERTY', 'INDEX_COL',
-			'DATABASEPROPERTY', 'INDEXKEY_PROPERTY', 'DATABASEPROPERTYEX', 'INDEXPROPERTY', 'DB_ID', 'OBJECT_ID', 'DB_NAME', 'OBJECT_NAME',
-			'FILE_ID', 'OBJECTPROPERTY', 'OBJECTPROPERTYEX', 'FILE_NAME', 'SQL_VARIANT_PROPERTY', 'FILEGROUP_ID', 'FILEGROUP_NAME',
-			'FILEGROUPPROPERTY', 'TYPEPROPERTY', 'FILEPROPERTY',
-			'CURRENT_USER', 'SUSER_ID', 'SUSER_SID', 'IS_MEMBER', 'SUSER_SNAME', 'IS_SRVROLEMEMBER', 'PERMISSIONS', 'SYSTEM_USER',
-			'SUSER_NAME', 'USER_ID', 'SESSION_USER', 'USER_NAME', 'ASCII', 'SOUNDEX', 'PATINDEX', 'SPACE', 'CHARINDEX', 'QUOTENAME',
-			'STR', 'DIFFERENCE', 'REPLACE', 'STUFF', 'REPLICATE', 'SUBSTRING', 'LEN', 'REVERSE', 'UNICODE', 'LOWER',
-			'UPPER', 'LTRIM', 'RTRIM', 'APP_NAME', 'CAST', 'CONVERT', 'COALESCE', 'COLLATIONPROPERTY', 'COLUMNS_UPDATED', 'CURRENT_TIMESTAMP',
-			'CURRENT_USER', 'DATALENGTH', '@@ERROR', 'FORMATMESSAGE', 'GETANSINULL', 'HOST_ID', 'HOST_NAME', 'IDENT_CURRENT', 'IDENT_INCR',
-			'IDENT_SEED', '@@IDENTITY', 'ISDATE', 'ISNULL', 'ISNUMERIC', 'NEWID', 'NULLIF', 'PARSENAME', '@@ROWCOUNT',
-			'SCOPE_IDENTITY', 'SERVERPROPERTY', 'SESSIONPROPERTY', 'SESSION_USER', 'STATS_DATE', 'SYSTEM_USER', '@@TRANCOUNT', 'USER_NAME',
-			'@@CONNECTIONS', '@@PACK_RECEIVED', '@@CPU_BUSY', '@@PACK_SENT', '@@TIMETICKS', '@@IDLE', '@@TOTAL_ERRORS', '@@IO_BUSY', '@@TOTAL_READ',
-			'@@PACKET_ERRORS', '@@TOTAL_WRITE', 'PATINDEX', 'TEXTVALID', 'TEXTPTR'
-		],
-		'reserved': [
-			'RIGHT', 'INNER', 'IS', 'JOIN', 'CROSS', 'LEFT', 'NULL', 'OUTER'
-		]
-	}
-	,'OPERATORS' :[
-		'+', '-', '*', '/', '%', '=', '&' ,'|', '^', '>', '<', '>=', '<=', '<>', '!=', '!<', '!>', 'ALL', 'AND', 'ANY', 'BETWEEN', 'EXISTS', 'IN', 'LIKE', 'NOT', 'OR', '~'
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'REGEXPS' : {
-		// highlight all variables (@...)
-		'variables' : {
-			'search' : '()(\\@\\w+)()'
-			,'class' : 'variables'
-			,'modifiers' : 'g'
-			,'execute' : 'before' // before or after
-		}
-	}
-	,'STYLES' : {
-		'COMMENTS': 'color: #008000;'
-		,'QUOTESMARKS': 'color: #FF0000;'
-		,'KEYWORDS' : {
-			'reserved' : 'color: #808080;'
-			,'functions' : 'color: #FF00FF;'
-			,'statements' : 'color: #0000FF;'
-			}
-		,'OPERATORS' : 'color: #808080;'
-		,'DELIMITERS' : 'color: #FF8000;'
-		,'REGEXPS' : {
-			'variables' : 'color: #E0BD54;'
-		}		
-	}
-};
-
- 	  	 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/vb.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/vb.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/vb.js
deleted file mode 100644
index 73d58fc..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/vb.js
+++ /dev/null
@@ -1,52 +0,0 @@
-editAreaLoader.load_syntax["vb"] = {
-	'COMMENT_SINGLE' : {1 : "'"}
-	,'COMMENT_MULTI' : { }
-	,'QUOTEMARKS' : {1: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : false
-	,'KEYWORDS' : {
-		'statements' : [
-	        'if','then','for','each','while','do','loop',
-            'else','elseif','select','case','end select',
-            'until','next','step','to','in','end if'
-		]
-		,'keywords' : [
-            'empty','isempty','nothing','null','isnull','true','false',
-            'set','call',
-            'sub','end sub','function','end function','exit','exit function',
-            'dim','Mod','In','private','public','shared','const'
-        ]
-
-		,'functions' : [
-			'CDate','Date','DateAdd','DateDiff','DatePart','DateSerial','DateValue','Day','FormatDateTime',
-            'Hour','IsDate','Minute','Month',
-            'MonthName','Now','Second','Time','Timer','TimeSerial','TimeValue','Weekday','WeekdayName ','Year',
-            'Asc','CBool','CByte','CCur','CDate','CDbl','Chr','CInt','CLng','CSng','CStr','Hex','Oct','FormatCurrency',
-            'FormatDateTime','FormatNumber','FormatPercent','Abs','Atn','Cos','Exp','Hex','Int','Fix','Log','Oct',
-            'Rnd','Sgn','Sin','Sqr','Tan',
-            'Array','Filter','IsArray','Join','LBound','Split','UBound',
-            'InStr','InStrRev','LCase','Left','Len','LTrim','RTrim','Trim','Mid','Replace','Right','Space','StrComp',
-            'String','StrReverse','UCase',
-            'CreateObject','Eval','GetLocale','GetObject','GetRef','InputBox','IsEmpty','IsNull','IsNumeric',
-            'IsObject','LoadPicture','MsgBox','RGB','Round','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion',
-            'ScriptEngineMinorVersion','SetLocale','TypeName','VarType'
-		]
-	}
-	,'OPERATORS' :[
-		'+', '-', '/', '*', '=', '<', '>', '!', '&'
-	]
-	,'DELIMITERS' :[
-		'(', ')', '[', ']', '{', '}'
-	]
-	,'STYLES' : {
-		'COMMENTS': 'color: #99CC00;'
-		,'QUOTESMARKS': 'color: #333399;'
-		,'KEYWORDS' : {
-			'keywords' : 'color: #3366FF;'
-			,'functions' : 'color: #0000FF;'
-			,'statements' : 'color: #3366FF;'
-			}
-		,'OPERATORS' : 'color: #FF0000;'
-		,'DELIMITERS' : 'color: #0000FF;'
-
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/xml.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/xml.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/xml.js
deleted file mode 100644
index f8618f2..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/xml.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-* last update: 2006-08-24
-*/
-
-editAreaLoader.load_syntax["xml"] = {
-	'COMMENT_SINGLE' : {}
-	,'COMMENT_MULTI' : {'<!--' : '-->'}
-	,'QUOTEMARKS' : {1: "'", 2: '"'}
-	,'KEYWORD_CASE_SENSITIVE' : false
-	,'KEYWORDS' : {
-	}
-	,'OPERATORS' :[
-	]
-	,'DELIMITERS' :[
-	]
-	,'REGEXPS' : {
-		'xml' : {
-			'search' : '()(<\\?[^>]*?\\?>)()'
-			,'class' : 'xml'
-			,'modifiers' : 'g'
-			,'execute' : 'before' // before or after
-		}
-		,'cdatas' : {
-			'search' : '()(<!\\[CDATA\\[.*?\\]\\]>)()'
-			,'class' : 'cdata'
-			,'modifiers' : 'g'
-			,'execute' : 'before' // before or after
-		}
-		,'tags' : {
-			'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
-			,'class' : 'tags'
-			,'modifiers' : 'gi'
-			,'execute' : 'before' // before or after
-		}
-		,'attributes' : {
-			'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
-			,'class' : 'attributes'
-			,'modifiers' : 'g'
-			,'execute' : 'before' // before or after
-		}
-	}
-	,'STYLES' : {
-		'COMMENTS': 'color: #AAAAAA;'
-		,'QUOTESMARKS': 'color: #6381F8;'
-		,'KEYWORDS' : {
-			}
-		,'OPERATORS' : 'color: #E775F0;'
-		,'DELIMITERS' : ''
-		,'REGEXPS' : {
-			'attributes': 'color: #B1AC41;'
-			,'tags': 'color: #E62253;'
-			,'xml': 'color: #8DCFB5;'
-			,'cdata': 'color: #50B020;'
-		}	
-	}		
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/regexp.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/regexp.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/regexp.js
deleted file mode 100644
index 907063a..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/regexp.js
+++ /dev/null
@@ -1,139 +0,0 @@
-	/*EditArea.prototype.comment_or_quotes= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
-		new_class="quotes";
-		if(v6 && v6 != undefined && v6!="")
-			new_class="comments";
-		return "µ__"+ new_class +"__µ"+v0+"µ_END_µ";
-
-	};*/
-	
-/*	EditArea.prototype.htmlTag= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
-		res="<span class=htmlTag>"+v2;
-		alert("v2: "+v2+" v3: "+v3);
-		tab=v3.split("=");
-		attributes="";
-		if(tab.length>1){
-			attributes="<span class=attribute>"+tab[0]+"</span>=";
-			for(i=1; i<tab.length-1; i++){
-				cut=tab[i].lastIndexOf("&nbsp;");				
-				attributes+="<span class=attributeVal>"+tab[i].substr(0,cut)+"</span>";
-				attributes+="<span class=attribute>"+tab[i].substr(cut)+"</span>=";
-			}
-			attributes+="<span class=attributeVal>"+tab[tab.length-1]+"</span>";
-		}		
-		res+=attributes+v5+"</span>";
-		return res;		
-	};*/
-	
-	// determine if the selected text if a comment or a quoted text
-	EditArea.prototype.comment_or_quote= function(){
-		var new_class="", close_tag="", sy, arg, i;
-		sy 		= parent.editAreaLoader.syntax[editArea.current_code_lang];
-		arg		= EditArea.prototype.comment_or_quote.arguments[0];
-		
-		for( i in sy["quotes"] ){
-			if(arg.indexOf(i)==0){
-				new_class="quotesmarks";
-				close_tag=sy["quotes"][i];
-			}
-		}
-		if(new_class.length==0)
-		{
-			for(var i in sy["comments"]){
-				if( arg.indexOf(i)==0 ){
-					new_class="comments";
-					close_tag=sy["comments"][i];
-				}
-			}
-		}
-		// for single line comment the \n must not be included in the span tags
-		if(close_tag=="\n"){
-			return "µ__"+ new_class +"__µ"+ arg.replace(/(\r?\n)?$/m, "µ_END_µ$1");
-		}else{
-			// the closing tag must be set only if the comment or quotes is closed 
-			reg= new RegExp(parent.editAreaLoader.get_escaped_regexp(close_tag)+"$", "m");
-			if( arg.search(reg)!=-1 )
-				return "µ__"+ new_class +"__µ"+ arg +"µ_END_µ";
-			else
-				return "µ__"+ new_class +"__µ"+ arg;
-		}
-	};
-	
-/*
-	// apply special tags arround text to highlight
-	EditArea.prototype.custom_highlight= function(){
-		res= EditArea.prototype.custom_highlight.arguments[1]+"µ__"+ editArea.reg_exp_span_tag +"__µ" + EditArea.prototype.custom_highlight.arguments[2]+"µ_END_µ";
-		if(EditArea.prototype.custom_highlight.arguments.length>5)
-			res+= EditArea.prototype.custom_highlight.arguments[ EditArea.prototype.custom_highlight.arguments.length-3 ];
-		return res;
-	};
-	*/
-	
-	// return identication that allow to know if revalidating only the text line won't make the syntax go mad
-	EditArea.prototype.get_syntax_trace= function(text){
-		if(this.settings["syntax"].length>0 && parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"])
-			return text.replace(parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"], "$3");
-	};
-	
-		
-	EditArea.prototype.colorize_text= function(text){
-		//text="<div id='result' class='area' style='position: relative; z-index: 4; height: 500px; overflow: scroll;border: solid black 1px;'> ";
-	  /*		
-		if(this.isOpera){	
-			// opera can't use pre element tabulation cause a tab=6 chars in the textarea and 8 chars in the pre 
-			text= this.replace_tab(text);
-		}*/
-		
-		text= " "+text; // for easier regExp
-		
-		/*if(this.do_html_tags)
-			text= text.replace(/(<[a-z]+ [^>]*>)/gi, '[__htmlTag__]$1[_END_]');*/
-		if(this.settings["syntax"].length>0)
-			text= this.apply_syntax(text, this.settings["syntax"]);
-
-		// remove the first space added
-		return text.substr(1).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/µ_END_µ/g,"</span>").replace(/µ__([a-zA-Z0-9]+)__µ/g,"<span class='$1'>");
-	};
-	
-	EditArea.prototype.apply_syntax= function(text, lang){
-		var sy;
-		this.current_code_lang=lang;
-	
-		if(!parent.editAreaLoader.syntax[lang])
-			return text;
-			
-		sy = parent.editAreaLoader.syntax[lang];
-		if(sy["custom_regexp"]['before']){
-			for( var i in sy["custom_regexp"]['before']){
-				var convert="$1µ__"+ sy["custom_regexp"]['before'][i]['class'] +"__µ$2µ_END_µ$3";
-				text= text.replace(sy["custom_regexp"]['before'][i]['regexp'], convert);
-			}
-		}
-		
-		if(sy["comment_or_quote_reg_exp"]){
-			//setTimeout("_$('debug_area').value=editArea.comment_or_quote_reg_exp;", 500);
-			text= text.replace(sy["comment_or_quote_reg_exp"], this.comment_or_quote);
-		}
-		
-		if(sy["keywords_reg_exp"]){
-			for(var i in sy["keywords_reg_exp"]){	
-				text= text.replace(sy["keywords_reg_exp"][i], 'µ__'+i+'__µ$2µ_END_µ');
-			}			
-		}
-		
-		if(sy["delimiters_reg_exp"]){
-			text= text.replace(sy["delimiters_reg_exp"], 'µ__delimiters__µ$1µ_END_µ');
-		}		
-		
-		if(sy["operators_reg_exp"]){
-			text= text.replace(sy["operators_reg_exp"], 'µ__operators__µ$1µ_END_µ');
-		}
-		
-		if(sy["custom_regexp"]['after']){
-			for( var i in sy["custom_regexp"]['after']){
-				var convert="$1µ__"+ sy["custom_regexp"]['after'][i]['class'] +"__µ$2µ_END_µ$3";
-				text= text.replace(sy["custom_regexp"]['after'][i]['regexp'], convert);			
-			}
-		}
-			
-		return text;
-	};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/resize_area.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/resize_area.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/resize_area.js
deleted file mode 100644
index 191e8ce..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/resize_area.js
+++ /dev/null
@@ -1,73 +0,0 @@
-	
-	EditAreaLoader.prototype.start_resize_area= function(){
-		var d=document,a,div,width,height,father;
-		
-		d.onmouseup= editAreaLoader.end_resize_area;
-		d.onmousemove= editAreaLoader.resize_area;
-		editAreaLoader.toggle(editAreaLoader.resize["id"]);		
-		
-		a	= editAreas[editAreaLoader.resize["id"]]["textarea"];
-		div	= d.getElementById("edit_area_resize");
-		if(!div){
-			div= d.createElement("div");
-			div.id="edit_area_resize";
-			div.style.border="dashed #888888 1px";
-		}
-		width	= a.offsetWidth -2;
-		height	= a.offsetHeight -2;
-		
-		div.style.display	= "block";
-		div.style.width		= width+"px";
-		div.style.height	= height+"px";
-		father= a.parentNode;
-		father.insertBefore(div, a);
-		
-		a.style.display="none";
-				
-		editAreaLoader.resize["start_top"]= calculeOffsetTop(div);
-		editAreaLoader.resize["start_left"]= calculeOffsetLeft(div);		
-	};
-	
-	EditAreaLoader.prototype.end_resize_area= function(e){
-		var d=document,div,a,width,height;
-		
-		d.onmouseup="";
-		d.onmousemove="";		
-		
-		div		= d.getElementById("edit_area_resize");		
-		a= editAreas[editAreaLoader.resize["id"]]["textarea"];
-		width	= Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_width"], div.offsetWidth-4);
-		height	= Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_height"], div.offsetHeight-4);
-		if(editAreaLoader.isIE==6){
-			width-=2;
-			height-=2;	
-		}
-		a.style.width		= width+"px";
-		a.style.height		= height+"px";
-		div.style.display	= "none";
-		a.style.display		= "inline";
-		a.selectionStart	= editAreaLoader.resize["selectionStart"];
-		a.selectionEnd		= editAreaLoader.resize["selectionEnd"];
-		editAreaLoader.toggle(editAreaLoader.resize["id"]);
-		
-		return false;
-	};
-	
-	EditAreaLoader.prototype.resize_area= function(e){		
-		var allow,newHeight,newWidth;
-		allow	= editAreas[editAreaLoader.resize["id"]]["settings"]["allow_resize"];
-		if(allow=="both" || allow=="y")
-		{
-			newHeight	= Math.max(20, getMouseY(e)- editAreaLoader.resize["start_top"]);
-			document.getElementById("edit_area_resize").style.height= newHeight+"px";
-		}
-		if(allow=="both" || allow=="x")
-		{
-			newWidth= Math.max(20, getMouseX(e)- editAreaLoader.resize["start_left"]);
-			document.getElementById("edit_area_resize").style.width= newWidth+"px";
-		}
-		
-		return false;
-	};
-	
-	editAreaLoader.waiting_loading["resize_area.js"]= "loaded";

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/search_replace.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/search_replace.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/search_replace.js
deleted file mode 100644
index bd266b3..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/search_replace.js
+++ /dev/null
@@ -1,174 +0,0 @@
-	EditArea.prototype.show_search = function(){
-		if(_$("area_search_replace").style.visibility=="visible"){
-			this.hidden_search();
-		}else{
-			this.open_inline_popup("area_search_replace");
-			var text= this.area_get_selection();
-			var search= text.split("\n")[0];
-			_$("area_search").value= search;
-			_$("area_search").focus();
-		}
-	};
-	
-	EditArea.prototype.hidden_search= function(){
-		/*_$("area_search_replace").style.visibility="hidden";
-		this.textarea.focus();
-		var icon= _$("search");
-		setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );*/
-		this.close_inline_popup("area_search_replace");
-	};
-	
-	EditArea.prototype.area_search= function(mode){
-		
-		if(!mode)
-			mode="search";
-		_$("area_search_msg").innerHTML="";		
-		var search=_$("area_search").value;		
-		
-		this.textarea.focus();		
-		this.textarea.textareaFocused=true;
-		
-		var infos= this.get_selection_infos();	
-		var start= infos["selectionStart"];
-		var pos=-1;
-		var pos_begin=-1;
-		var length=search.length;
-		
-		if(_$("area_search_replace").style.visibility!="visible"){
-			this.show_search();
-			return;
-		}
-		if(search.length==0){
-			_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
-			return;
-		}
-		// advance to the next occurence if no text selected
-		if(mode!="replace" ){
-			if(_$("area_search_reg_exp").checked)
-				start++;
-			else
-				start+= search.length;
-		}
-		
-		//search
-		if(_$("area_search_reg_exp").checked){
-			// regexp search
-			var opt="m";
-			if(!_$("area_search_match_case").checked)
-				opt+="i";
-			var reg= new RegExp(search, opt);
-			pos= infos["full_text"].substr(start).search(reg);
-			pos_begin= infos["full_text"].search(reg);
-			if(pos!=-1){
-				pos+=start;
-				length=infos["full_text"].substr(start).match(reg)[0].length;
-			}else if(pos_begin!=-1){
-				length=infos["full_text"].match(reg)[0].length;
-			}
-		}else{
-			if(_$("area_search_match_case").checked){
-				pos= infos["full_text"].indexOf(search, start); 
-				pos_begin= infos["full_text"].indexOf(search); 
-			}else{
-				pos= infos["full_text"].toLowerCase().indexOf(search.toLowerCase(), start); 
-				pos_begin= infos["full_text"].toLowerCase().indexOf(search.toLowerCase()); 
-			}		
-		}
-		
-		// interpret result
-		if(pos==-1 && pos_begin==-1){
-			_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
-			return;
-		}else if(pos==-1 && pos_begin != -1){
-			begin= pos_begin;
-			_$("area_search_msg").innerHTML=this.get_translation("restart_search_at_begin");
-		}else
-			begin= pos;
-		
-		//_$("area_search_msg").innerHTML+="<strong>"+search+"</strong> found at "+begin+" strat at "+start+" pos "+pos+" curs"+ infos["indexOfCursor"]+".";
-		if(mode=="replace" && pos==infos["indexOfCursor"]){
-			var replace= _$("area_replace").value;
-			var new_text="";			
-			if(_$("area_search_reg_exp").checked){
-				var opt="m";
-				if(!_$("area_search_match_case").checked)
-					opt+="i";
-				var reg= new RegExp(search, opt);
-				new_text= infos["full_text"].substr(0, begin) + infos["full_text"].substr(start).replace(reg, replace);
-			}else{
-				new_text= infos["full_text"].substr(0, begin) + replace + infos["full_text"].substr(begin + length);
-			}
-			this.textarea.value=new_text;
-			this.area_select(begin, length);
-			this.area_search();
-		}else
-			this.area_select(begin, length);
-	};
-	
-	
-	
-	
-	EditArea.prototype.area_replace= function(){		
-		this.area_search("replace");
-	};
-	
-	EditArea.prototype.area_replace_all= function(){
-	/*	this.area_select(0, 0);
-		_$("area_search_msg").innerHTML="";
-		while(_$("area_search_msg").innerHTML==""){
-			this.area_replace();
-		}*/
-	
-		var base_text= this.textarea.value;
-		var search= _$("area_search").value;		
-		var replace= _$("area_replace").value;
-		if(search.length==0){
-			_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
-			return ;
-		}
-		
-		var new_text="";
-		var nb_change=0;
-		if(_$("area_search_reg_exp").checked){
-			// regExp
-			var opt="mg";
-			if(!_$("area_search_match_case").checked)
-				opt+="i";
-			var reg= new RegExp(search, opt);
-			nb_change= infos["full_text"].match(reg).length;
-			new_text= infos["full_text"].replace(reg, replace);
-			
-		}else{
-			
-			if(_$("area_search_match_case").checked){
-				var tmp_tab=base_text.split(search);
-				nb_change= tmp_tab.length -1 ;
-				new_text= tmp_tab.join(replace);
-			}else{
-				// case insensitive
-				var lower_value=base_text.toLowerCase();
-				var lower_search=search.toLowerCase();
-				
-				var start=0;
-				var pos= lower_value.indexOf(lower_search);				
-				while(pos!=-1){
-					nb_change++;
-					new_text+= this.textarea.value.substring(start , pos)+replace;
-					start=pos+ search.length;
-					pos= lower_value.indexOf(lower_search, pos+1);
-				}
-				new_text+= this.textarea.value.substring(start);				
-			}
-		}			
-		if(new_text==base_text){
-			_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
-		}else{
-			this.textarea.value= new_text;
-			_$("area_search_msg").innerHTML="<strong>"+nb_change+"</strong> "+this.get_translation("occurrence_replaced");
-			// firefox and opera doesn't manage with the focus if it's done directly
-			//editArea.textarea.focus();editArea.textarea.textareaFocused=true;
-			setTimeout("editArea.textarea.focus();editArea.textarea.textareaFocused=true;", 100);
-		}
-		
-		
-	};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/template.html
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/template.html b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/template.html
deleted file mode 100644
index cf626d6..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/template.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.
- -->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
-<head>
-	<title>EditArea</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
-	[__CSSRULES__]
-	[__JSCODE__]
-</head>
-<body>
-	<div id='editor'>
-		<div class='area_toolbar' id='toolbar_1'>[__TOOLBAR__]</div>
-		<div class='area_toolbar' id='tab_browsing_area'><ul id='tab_browsing_list' class='menu'> <li> </li> </ul></div>
-		<div id='result'>
-			<div id='no_file_selected'></div>
-			<div id='container'>
-				<div id='cursor_pos' class='edit_area_cursor'>&nbsp;</div>
-				<div id='end_bracket' class='edit_area_cursor'>&nbsp;</div>
-				<div id='selection_field'></div>
-				<div id='line_number' selec='none'></div>
-				<div id='content_highlight'></div>
-				<div id='test_font_size'></div>
-				<div id='selection_field_text'></div>
-				<textarea id='textarea' wrap='off' onchange='editArea.execCommand("onchange");' onfocus='javascript:editArea.textareaFocused=true;' onblur='javascript:editArea.textareaFocused=false;'>
-				</textarea>
-				
-			</div>
-		</div>
-		<div class='area_toolbar' id='toolbar_2'>
-			<table class='statusbar' cellspacing='0' cellpadding='0'>
-				<tr>
-					<td class='total' selec='none'>{$position}:</td>
-					<td class='infos' selec='none'>
-						{$line_abbr} <span  id='linePos'>0</span>, {$char_abbr} <span id='currPos'>0</span>
-					</td>
-					<td class='total' selec='none'>{$total}:</td>
-					<td class='infos' selec='none'>
-						{$line_abbr} <span id='nbLine'>0</span>, {$char_abbr} <span id='nbChar'>0</span>
-					</td>
-					<td class='resize'>
-						<span id='resize_area'><img src='[__BASEURL__]images/statusbar_resize.gif' alt='resize' selec='none'></span>
-					</td>
-				</tr>
-			</table>
-		</div>
-	</div>
-	<div id='processing'>
-		<div id='processing_text'>
-			{$processing}
-		</div>
-	</div>
-
-	<div id='area_search_replace' class='editarea_popup'>
-		<table cellspacing='2' cellpadding='0' style='width: 100%'>
-			<tr>
-				<td selec='none'>{$search}</td>
-				<td><input type='text' id='area_search' /></td>
-				<td id='close_area_search_replace'>
-					<a onclick='Javascript:editArea.execCommand("hidden_search")'><img selec='none' src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a><br />
-			</tr><tr>
-				<td selec='none'>{$replace}</td>
-				<td><input type='text' id='area_replace' /></td>
-				<td><img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["frame_"+editArea.id]);'  src='[__BASEURL__]images/move.gif' alt='{$move_popup}' title='{$move_popup}' /></td>
-			</tr>
-		</table>
-		<div class='button'>
-			<input type='checkbox' id='area_search_match_case' /><label for='area_search_match_case' selec='none'>{$match_case}</label>
-			<input type='checkbox' id='area_search_reg_exp' /><label for='area_search_reg_exp' selec='none'>{$reg_exp}</label>
-			<br />
-			<a onclick='Javascript:editArea.execCommand("area_search")' selec='none'>{$find_next}</a>
-			<a onclick='Javascript:editArea.execCommand("area_replace")' selec='none'>{$replace}</a>
-			<a onclick='Javascript:editArea.execCommand("area_replace_all")' selec='none'>{$replace_all}</a><br />
-		</div>
-		<div id='area_search_msg' selec='none'></div>
-	</div>
-	<div id='edit_area_help' class='editarea_popup'>
-		<div class='close_popup'>
-			<a onclick='Javascript:editArea.execCommand("close_all_inline_popup")'><img src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a>
-		</div>
-		<div><h2>Editarea [__EA_VERSION__]</h2><br />
-			<h3>{$shortcuts}:</h3>
-				{$tab}: {$add_tab}<br />
-				{$shift}+{$tab}: {$remove_tab}<br />
-				{$ctrl}+f: {$search_command}<br />
-				{$ctrl}+r: {$replace_command}<br />
-				{$ctrl}+h: {$highlight}<br />
-				{$ctrl}+g: {$go_to_line}<br />
-				{$ctrl}+z: {$undo}<br />
-				{$ctrl}+y: {$redo}<br />
-				{$ctrl}+e: {$help}<br />
-				{$ctrl}+q, {$esc}: {$close_popup}<br />
-				{$accesskey} E: {$toggle}<br />
-			<br />
-			<em>{$about_notice}</em>
-			<br /><div class='copyright'>&copy; Christophe Dolivet 2007-2009</div>
-		</div>
-	</div>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_apache.txt
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_apache.txt b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_apache.txt
deleted file mode 100644
index c7ef5e6..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_apache.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Copyright 2008 Christophe Dolivet
-
-Licensed 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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_bsd.txt
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_bsd.txt b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_bsd.txt
deleted file mode 100644
index f36bbe4..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_bsd.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Copyright (c) 2008, Christophe Dolivet
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-    * Neither the name of EditArea nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_lgpl.txt
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_lgpl.txt b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_lgpl.txt
deleted file mode 100644
index 8c177f8..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/license_lgpl.txt
+++ /dev/null
@@ -1,458 +0,0 @@
-		  GNU LESSER GENERAL PUBLIC LICENSE
-		       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-		  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-  
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-			    NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-		     END OF TERMS AND CONDITIONS

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/todo.txt
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/todo.txt b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/todo.txt
deleted file mode 100644
index e583ef5..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/todo.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-FOR AUTOCOMPLETION:
-- work with tab editing (each one having it's context)
-- allow $ in prefix
-- allow to call user function for autocompletion
-- correctly display the box with window limits
-- enable "live" detection for new syntax keyword in the file
-- display a long description of the keyword (arround the box)
-
-DONE:
-- beeing able to prefix those word by key words (sort of namespace)
-- hide it on click
-- enable it for ctrl+space in the middle of a word
-
-/***** To do Needed *****/
- 
-- Internet explorer: adding a caracter one the longest line as for consequence to make a scrollLeft=0 (in non wrapped mode)
-- Do optimisation for trying to only update the changed line in content_highlight
-- add real IE8 support (fix the tabulation width bug in IE8 that has now always the same width no matter the font-size and font-family in textarea but not in <pre>...)
-- change_callback is called one time at the beginning event if the text has not changed
-- check later init call with safari 3
-- improve callback documentation.
-
-/***** To do Optionnal*****/
-
-- possibility to switch on/off line numbers (allow to get more space)
-- amelioration of the scroll_to_view function for when there is several lines selected (center a little more the selected text)
-- improve opera 9 compatibility (very hard, need help for workaround) cf "Browser remarks".
-- optimize scroll_to_view for Opera?
-- add word wrap option for opera (bug with rendering mode of pre-wrap
-- possibility to add larger font sizes as options?
-
-/*** Bugs ***/
-
-- firefox: when using verdana (or other non-monospace fonts) switching the font size after font load has as results to sometimes give different render in textarea and in content_highlight (espacially near 11 and 12pt)
-- opera: (bloc word-wrap on opera) bug with cursor_end ()[] for a wrapped line (has wrong offsetLeft if rendered as multiline)
-- opera: (bloc word-wrap on opera) bug if first wraped character follow a <span> (or similar) on wrapped lines
-- when pressing "reset highlight" in IE the textarea scroll to the top (don't know how to fix this...)
-- (still pending?) when pressing "shift+page down"  and then "shift+page up" the top of the selection move where as it should be to the bottom of the selection to move (to fix it: must know in which direction the selection grow in "get_selection_infos")
-
-
-/*** Problems ***/
-
-
-/*** Highlight bugs ***/
-
-/*** Highlight problems ***/
-- only one language at the same time (no html and php in the same textarea. This should be possible, but there would have no optimization and be very very slow)
-
-
-/*** Global remarks ***/
-- editarea must be always visible, to hide it use the hide() function
-
-
-/*** Browser remarks/bugs ***/
-
-OPERA:
-- opera bug: pressing the " key is equals to pressing the scrolldown key (with french keyboard at least) (still in opera 9.6?)
-- currently disabled: scrollDown/Up function (due to the " key error) (still in oera 9.6?)
-- opera is very very slow with syntax highlight (regexp) (still in oera 9.6?)
-- opera doesn't manage correctly the width 100% for the iframe
-- it's possible to make scroll the window in fullscreen
-
-IE:
-- IE is far slower than firefox in highlight mode due to opacity filter
-- It's seems impossible to get the selection range when wrap mode is "soft" (and it's still very diffcult when wrap mode is on)
-- The syntax highlight mode is broken when text length is too long (~100000, 150000 chars) don't know why...
-
-FIREFOX:
-- the scrollHeight value for the textarea never decresease when lines are deleted (don't remember anything about this)
-
-


[08/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_functions.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_functions.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_functions.js
deleted file mode 100644
index 984d4c6..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_functions.js
+++ /dev/null
@@ -1,1203 +0,0 @@
-	//replace tabulation by the good number of white spaces
-	EditArea.prototype.replace_tab= function(text){
-		return text.replace(/((\n?)([^\t\n]*)\t)/gi, editArea.smartTab);		// slower than simple replace...	
-	};
-	
-	// call by the replace_tab function
-	EditArea.prototype.smartTab= function(){
-		val="                   ";
-		return EditArea.prototype.smartTab.arguments[2] + EditArea.prototype.smartTab.arguments[3] + val.substr(0, editArea.tab_nb_char - (EditArea.prototype.smartTab.arguments[3].length)%editArea.tab_nb_char);
-	};
-	
-	EditArea.prototype.show_waiting_screen= function(){
-		width	= this.editor_area.offsetWidth;
-		height	= this.editor_area.offsetHeight;
-		if( !(this.isIE && this.isIE<6) )
-		{
-			width	-= 2;
-			height	-= 2;
-		}
-		this.processing_screen.style.display= "block";
-		this.processing_screen.style.width	= width+"px";
-		this.processing_screen.style.height	= height+"px";
-		this.waiting_screen_displayed		= true;
-	};
-	
-	EditArea.prototype.hide_waiting_screen= function(){
-		this.processing_screen.style.display="none";
-		this.waiting_screen_displayed= false;
-	};
-	
-	EditArea.prototype.add_style= function(styles){
-		if(styles.length>0){
-			newcss = document.createElement("style");
-			newcss.type="text/css";
-			newcss.media="all";
-			if(newcss.styleSheet){ // IE
-				newcss.styleSheet.cssText = styles;
-			} else { // W3C
-				newcss.appendChild(document.createTextNode(styles));
-			}
-			document.getElementsByTagName("head")[0].appendChild(newcss);
-		}
-	};
-	
-	EditArea.prototype.set_font= function(family, size){
-		var t=this, a=this.textarea, s=this.settings, elem_font, i, elem;
-		// list all elements concerned by font changes
-		var elems= ["textarea", "content_highlight", "cursor_pos", "end_bracket", "selection_field", "selection_field_text", "line_number"];
-		
-		if(family && family!="")
-			s["font_family"]= family;
-		if(size && size>0)
-			s["font_size"]	= size;
-		if( t.isOpera && t.isOpera < 9.6 )	// opera<9.6 can't manage non monospace font
-			s['font_family']="monospace";
-			
-		// update the select tag
-		if( elem_font = _$("area_font_size") )
-		{	
-			for( i = 0; i < elem_font.length; i++ )
-			{
-				if( elem_font.options[i].value && elem_font.options[i].value == s["font_size"] )
-					elem_font.options[i].selected=true;
-			}
-		}
-		
-		/*
-		 * somethimes firefox has rendering mistake with non-monospace font for text width in textarea vs in div for changing font size (eg: verdana change between 11pt to 12pt)
-		 * => looks like a browser internal random bug as text width can change while content_highlight is updated
-		 * we'll check if the font-size produce the same text width inside textarea and div and if not, we'll increment the font-size
-		 * 
-		 * This is an ugly fix 
-		 */ 
-		if( t.isFirefox )
-		{
-			var nbTry = 3;
-			do {
-				var div1 = document.createElement( 'div' ), text1 = document.createElement( 'textarea' );
-				var styles = {
-					width:		'40px',
-					overflow:	'scroll',
-					zIndex: 	50,
-					visibility:	'hidden',
-					fontFamily:	s["font_family"],
-					fontSize:	s["font_size"]+"pt",
-					lineHeight:	t.lineHeight+"px",
-					padding:	'0',
-					margin:		'0',
-					border:		'none',
-					whiteSpace:	'nowrap'
-				};
-				var diff, changed = false;
-				for( i in styles )
-				{
-					div1.style[ i ]		= styles[i];
-					text1.style[ i ]	= styles[i];
-				}
-				// no wrap for this text
-				text1.wrap = 'off';
-				text1.setAttribute('wrap', 'off');
-				t.container.appendChild( div1 );
-				t.container.appendChild( text1 );
-				// try to make FF to bug
-				div1.innerHTML 		= text1.value	= 'azertyuiopqsdfghjklm';
-				div1.innerHTML 		= text1.value	= text1.value+'wxcvbn^p*ù$!:;,,';
-				diff	=  text1.scrollWidth - div1.scrollWidth;
-				
-				// firefox return here a diff of 1 px between equals scrollWidth (can't explain)
-				if( Math.abs( diff ) >= 2 )
-				{
-					s["font_size"]++;
-					changed	= true;
-				}
-				t.container.removeChild( div1 );
-				t.container.removeChild( text1 );
-				nbTry--;
-			}while( changed && nbTry > 0 );
-		}
-		
-		
-		// calc line height
-		elem					= t.test_font_size;
-		elem.style.fontFamily	= ""+s["font_family"];
-		elem.style.fontSize		= s["font_size"]+"pt";				
-		elem.innerHTML			= "0";		
-		t.lineHeight			= elem.offsetHeight;
-
-		// update font for all concerned elements
-		for( i=0; i<elems.length; i++)
-		{
-			elem	= _$(elems[i]);	
-			elem.style.fontFamily	= s["font_family"];
-			elem.style.fontSize		= s["font_size"]+"pt";
-			elem.style.lineHeight	= t.lineHeight+"px";
-		}
-		// define a css for <pre> tags
-		t.add_style("pre{font-family:"+s["font_family"]+"}");
-		
-		// old opera and IE>=8 doesn't update font changes to the textarea
-		if( ( t.isOpera && t.isOpera < 9.6 ) || t.isIE >= 8 )
-		{
-			var parNod = a.parentNode, nxtSib = a.nextSibling, start= a.selectionStart, end= a.selectionEnd;
-			parNod.removeChild(a);
-			parNod.insertBefore(a, nxtSib);
-			t.area_select(start, end-start);
-		}
-		
-		// force update of selection field
-		this.focus();
-		this.update_size();
-		this.check_line_selection();
-	};
-	
-	EditArea.prototype.change_font_size= function(){
-		var size=_$("area_font_size").value;
-		if(size>0)
-			this.set_font("", size);			
-	};
-	
-	
-	EditArea.prototype.open_inline_popup= function(popup_id){
-		this.close_all_inline_popup();
-		var popup= _$(popup_id);		
-		var editor= _$("editor");
-		
-		// search matching icon
-		for(var i=0; i<this.inlinePopup.length; i++){
-			if(this.inlinePopup[i]["popup_id"]==popup_id){
-				var icon= _$(this.inlinePopup[i]["icon_id"]);
-				if(icon){
-					this.switchClassSticky(icon, 'editAreaButtonSelected', true);			
-					break;
-				}
-			}
-		}
-		// check size
-		popup.style.height="auto";
-		popup.style.overflow= "visible";
-			
-		if(document.body.offsetHeight< popup.offsetHeight){
-			popup.style.height= (document.body.offsetHeight-10)+"px";
-			popup.style.overflow= "auto";
-		}
-		
-		if(!popup.positionned){
-			var new_left= editor.offsetWidth /2 - popup.offsetWidth /2;
-			var new_top= editor.offsetHeight /2 - popup.offsetHeight /2;
-			//var new_top= area.offsetHeight /2 - popup.offsetHeight /2;
-			//var new_left= area.offsetWidth /2 - popup.offsetWidth /2;
-			//alert("new_top: ("+new_top+") = calculeOffsetTop(area) ("+calculeOffsetTop(area)+") + area.offsetHeight /2("+ area.offsetHeight /2+") - popup.offsetHeight /2("+popup.offsetHeight /2+") - scrollTop: "+document.body.scrollTop);
-			popup.style.left= new_left+"px";
-			popup.style.top= new_top+"px";
-			popup.positionned=true;
-		}
-		popup.style.visibility="visible";
-		
-		//popup.style.display="block";
-	};
-
-	EditArea.prototype.close_inline_popup= function(popup_id){
-		var popup= _$(popup_id);		
-		// search matching icon
-		for(var i=0; i<this.inlinePopup.length; i++){
-			if(this.inlinePopup[i]["popup_id"]==popup_id){
-				var icon= _$(this.inlinePopup[i]["icon_id"]);
-				if(icon){
-					this.switchClassSticky(icon, 'editAreaButtonNormal', false);			
-					break;
-				}
-			}
-		}
-		
-		popup.style.visibility="hidden";	
-	};
-	
-	EditArea.prototype.close_all_inline_popup= function(e){
-		for(var i=0; i<this.inlinePopup.length; i++){
-			this.close_inline_popup(this.inlinePopup[i]["popup_id"]);		
-		}
-		this.textarea.focus();
-	};
-	
-	EditArea.prototype.show_help= function(){
-		
-		this.open_inline_popup("edit_area_help");
-		
-	};
-			
-	EditArea.prototype.new_document= function(){
-		this.textarea.value="";
-		this.area_select(0,0);
-	};
-	
-	EditArea.prototype.get_all_toolbar_height= function(){
-		var area= _$("editor");
-		var results= parent.getChildren(area, "div", "class", "area_toolbar", "all", "0");	// search only direct children
-		//results= results.concat(getChildren(area, "table", "class", "area_toolbar", "all", "0"));
-		var height=0;
-		for(var i=0; i<results.length; i++){			
-			height+= results[i].offsetHeight;
-		}
-		//alert("toolbar height: "+height);
-		return height;
-	};
-	
-	EditArea.prototype.go_to_line= function(line){	
-		if(!line)
-		{	
-			var icon= _$("go_to_line");
-			if(icon != null){
-				this.restoreClass(icon);
-				this.switchClassSticky(icon, 'editAreaButtonSelected', true);
-			}
-			
-			line= prompt(this.get_translation("go_to_line_prompt"));
-			if(icon != null)
-				this.switchClassSticky(icon, 'editAreaButtonNormal', false);
-		}
-		if(line && line!=null && line.search(/^[0-9]+$/)!=-1){
-			var start=0;
-			var lines= this.textarea.value.split("\n");
-			if(line > lines.length)
-				start= this.textarea.value.length;
-			else{
-				for(var i=0; i<Math.min(line-1, lines.length); i++)
-					start+= lines[i].length + 1;
-			}
-			this.area_select(start, 0);
-		}
-		
-		
-	};
-	
-	
-	EditArea.prototype.change_smooth_selection_mode= function(setTo){
-		//alert("setTo: "+setTo);
-		if(this.do_highlight)
-			return;
-			
-		if(setTo != null){
-			if(setTo === false)
-				this.smooth_selection=true;
-			else
-				this.smooth_selection=false;
-		}
-		var icon= _$("change_smooth_selection");
-		this.textarea.focus();
-		if(this.smooth_selection===true){
-			//setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );
-			/*setAttribute(icon, "oldClassName", "editAreaButtonNormal" );
-			setAttribute(icon, "className", "editAreaButtonNormal" );*/
-			//this.restoreClass(icon);
-			//this.restoreAndSwitchClass(icon,'editAreaButtonNormal');
-			this.switchClassSticky(icon, 'editAreaButtonNormal', false);
-			
-			this.smooth_selection=false;
-			this.selection_field.style.display= "none";
-			_$("cursor_pos").style.display= "none";
-			_$("end_bracket").style.display= "none";
-		}else{
-			//setAttribute(icon, "class", getAttribute(icon, "class") + " selected");
-			//this.switchClass(icon,'editAreaButtonSelected');
-			this.switchClassSticky(icon, 'editAreaButtonSelected', false);
-			this.smooth_selection=true;
-			this.selection_field.style.display= "block";
-			_$("cursor_pos").style.display= "block";
-			_$("end_bracket").style.display= "block";
-		}	
-	};
-	
-	// the auto scroll of the textarea has some lacks when it have to show cursor in the visible area when the textarea size change
-	// show specifiy whereas it is the "top" or "bottom" of the selection that is showned
-	EditArea.prototype.scroll_to_view= function(show){
-		var zone, lineElem;
-		if(!this.smooth_selection)
-			return;
-		zone= _$("result");
-		
-		// manage height scroll
-		var cursor_pos_top= _$("cursor_pos").cursor_top;
-		if(show=="bottom")
-		{
-			//cursor_pos_top+=  (this.last_selection["line_nb"]-1)* this.lineHeight;
-			cursor_pos_top+= this.getLinePosTop( this.last_selection['line_start'] + this.last_selection['line_nb'] - 1 );
-		}
-			
-		var max_height_visible= zone.clientHeight + zone.scrollTop;
-		var miss_top	= cursor_pos_top + this.lineHeight - max_height_visible;
-		if(miss_top>0){
-			//alert(miss_top);
-			zone.scrollTop=  zone.scrollTop + miss_top;
-		}else if( zone.scrollTop > cursor_pos_top){
-			// when erase all the content -> does'nt scroll back to the top
-			//alert("else: "+cursor_pos_top);
-			zone.scrollTop= cursor_pos_top;	 
-		}
-		
-		// manage left scroll
-		//var cursor_pos_left= parseInt(_$("cursor_pos").style.left.replace("px",""));
-		var cursor_pos_left= _$("cursor_pos").cursor_left;
-		var max_width_visible= zone.clientWidth + zone.scrollLeft;
-		var miss_left= cursor_pos_left + 10 - max_width_visible;
-		if(miss_left>0){			
-			zone.scrollLeft= zone.scrollLeft + miss_left + 50;
-		}else if( zone.scrollLeft > cursor_pos_left){
-			zone.scrollLeft= cursor_pos_left ;
-		}else if( zone.scrollLeft == 45){
-			// show the line numbers if textarea align to it's left
-			zone.scrollLeft=0;
-		}
-	};
-	
-	EditArea.prototype.check_undo= function(only_once){
-		if(!editAreas[this.id])
-			return false;
-		if(this.textareaFocused && editAreas[this.id]["displayed"]==true){
-			var text=this.textarea.value;
-			if(this.previous.length<=1)
-				this.switchClassSticky(_$("undo"), 'editAreaButtonDisabled', true);
-		
-			if(!this.previous[this.previous.length-1] || this.previous[this.previous.length-1]["text"] != text){
-				this.previous.push({"text": text, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd});
-				if(this.previous.length > this.settings["max_undo"]+1)
-					this.previous.shift();
-				
-			}
-			if(this.previous.length >= 2)
-				this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false);		
-		}
-
-		if(!only_once)
-			setTimeout("editArea.check_undo()", 3000);
-	};
-	
-	EditArea.prototype.undo= function(){
-		//alert("undo"+this.previous.length);
-		if(this.previous.length > 0)
-		{
-			this.getIESelection();
-		//	var pos_cursor=this.textarea.selectionStart;
-			this.next.push( { "text": this.textarea.value, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd } );
-			var prev= this.previous.pop();
-			if( prev["text"] == this.textarea.value && this.previous.length > 0 )
-				prev	=this.previous.pop();						
-			this.textarea.value	= prev["text"];
-			this.last_undo		= prev["text"];
-			this.area_select(prev["selStart"], prev["selEnd"]-prev["selStart"]);
-			this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false);
-			this.resync_highlight(true);
-			//alert("undo"+this.previous.length);
-			this.check_file_changes();
-		}
-	};
-	
-	EditArea.prototype.redo= function(){
-		if(this.next.length > 0)
-		{
-			/*this.getIESelection();*/
-			//var pos_cursor=this.textarea.selectionStart;
-			var next= this.next.pop();
-			this.previous.push(next);
-			this.textarea.value= next["text"];
-			this.last_undo= next["text"];
-			this.area_select(next["selStart"], next["selEnd"]-next["selStart"]);
-			this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false);
-			this.resync_highlight(true);
-			this.check_file_changes();
-		}
-		if(	this.next.length == 0)
-			this.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
-	};
-	
-	EditArea.prototype.check_redo= function(){
-		if(editArea.next.length == 0 || editArea.textarea.value!=editArea.last_undo){
-			editArea.next= [];	// undo the ability to use "redo" button
-			editArea.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
-		}
-		else
-		{
-			this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false);
-		}
-	};
-	
-	
-	// functions that manage icons roll over, disabled, etc...
-	EditArea.prototype.switchClass = function(element, class_name, lock_state) {
-		var lockChanged = false;
-	
-		if (typeof(lock_state) != "undefined" && element != null) {
-			element.classLock = lock_state;
-			lockChanged = true;
-		}
-	
-		if (element != null && (lockChanged || !element.classLock)) {
-			element.oldClassName = element.className;
-			element.className = class_name;
-		}
-	};
-	
-	EditArea.prototype.restoreAndSwitchClass = function(element, class_name) {
-		if (element != null && !element.classLock) {
-			this.restoreClass(element);
-			this.switchClass(element, class_name);
-		}
-	};
-	
-	EditArea.prototype.restoreClass = function(element) {
-		if (element != null && element.oldClassName && !element.classLock) {
-			element.className = element.oldClassName;
-			element.oldClassName = null;
-		}
-	};
-	
-	EditArea.prototype.setClassLock = function(element, lock_state) {
-		if (element != null)
-			element.classLock = lock_state;
-	};
-	
-	EditArea.prototype.switchClassSticky = function(element, class_name, lock_state) {
-		var lockChanged = false;
-		if (typeof(lock_state) != "undefined" && element != null) {
-			element.classLock = lock_state;
-			lockChanged = true;
-		}
-	
-		if (element != null && (lockChanged || !element.classLock)) {
-			element.className = class_name;
-			element.oldClassName = class_name;
-		}
-	};
-	
-	//make the "page up" and "page down" buttons works correctly
-	EditArea.prototype.scroll_page= function(params){
-		var dir= params["dir"], shift_pressed= params["shift"];
-		var lines= this.textarea.value.split("\n");		
-		var new_pos=0, length=0, char_left=0, line_nb=0, curLine=0;
-		var toScrollAmount	= _$("result").clientHeight -30;
-		var nbLineToScroll	= 0, diff= 0;
-		
-		if(dir=="up"){
-			nbLineToScroll	= Math.ceil( toScrollAmount / this.lineHeight );
-			
-			// fix number of line to scroll
-			for( i = this.last_selection["line_start"]; i - diff > this.last_selection["line_start"] - nbLineToScroll ; i-- )
-			{
-				if( elem = _$('line_'+ i) )
-				{
-					diff +=  Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight );
-				}
-			}
-			nbLineToScroll	-= diff;
-			
-			if(this.last_selection["selec_direction"]=="up"){
-				for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]-nbLineToScroll, lines.length); line_nb++){
-					new_pos+= lines[line_nb].length + 1;
-				}
-				char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1);
-				if(shift_pressed)
-					length=this.last_selection["selectionEnd"]-new_pos-char_left;	
-				this.area_select(new_pos+char_left, length);
-				view="top";
-			}else{			
-				view="bottom";
-				for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-1-nbLineToScroll, lines.length); line_nb++){
-					new_pos+= lines[line_nb].length + 1;
-				}
-				char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1);
-				if(shift_pressed){
-					//length=this.last_selection["selectionEnd"]-new_pos-char_left;	
-					start= Math.min(this.last_selection["selectionStart"], new_pos+char_left);
-					length= Math.max(new_pos+char_left, this.last_selection["selectionStart"] )- start ;
-					if(new_pos+char_left < this.last_selection["selectionStart"])
-						view="top";
-				}else
-					start=new_pos+char_left;
-				this.area_select(start, length);
-				
-			}
-		}
-		else
-		{
-			var nbLineToScroll= Math.floor( toScrollAmount / this.lineHeight );
-			// fix number of line to scroll
-			for( i = this.last_selection["line_start"]; i + diff < this.last_selection["line_start"] + nbLineToScroll ; i++ )
-			{
-				if( elem = _$('line_'+ i) )
-				{
-					diff +=  Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight );
-				}
-			}
-			nbLineToScroll	-= diff;
-				
-			if(this.last_selection["selec_direction"]=="down"){
-				view="bottom";
-				for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-2+nbLineToScroll, lines.length); line_nb++){
-					if(line_nb==this.last_selection["line_start"]-1)
-						char_left= this.last_selection["selectionStart"] -new_pos;
-					new_pos+= lines[line_nb].length + 1;
-									
-				}
-				if(shift_pressed){
-					length=Math.abs(this.last_selection["selectionStart"]-new_pos);	
-					length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]);
-					//length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left);
-					this.area_select(Math.min(this.last_selection["selectionStart"], new_pos), length);
-				}else{
-					this.area_select(new_pos+char_left, 0);
-				}
-				
-			}else{
-				view="top";
-				for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+nbLineToScroll-1, lines.length, lines.length); line_nb++){
-					if(line_nb==this.last_selection["line_start"]-1)
-						char_left= this.last_selection["selectionStart"] -new_pos;
-					new_pos+= lines[line_nb].length + 1;									
-				}
-				if(shift_pressed){
-					length=Math.abs(this.last_selection["selectionEnd"]-new_pos-char_left);	
-					length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"])- char_left-1;
-					//length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left);
-					this.area_select(Math.min(this.last_selection["selectionEnd"], new_pos+char_left), length);
-					if(new_pos+char_left > this.last_selection["selectionEnd"])
-						view="bottom";
-				}else{
-					this.area_select(new_pos+char_left, 0);
-				}
-				
-			}
-		}
-		//console.log( new_pos, char_left, length, nbLineToScroll, toScrollAmount, _$("result").clientHeigh );
-		this.check_line_selection();
-		this.scroll_to_view(view);
-	};
-	
-	EditArea.prototype.start_resize= function(e){
-		parent.editAreaLoader.resize["id"]		= editArea.id;		
-		parent.editAreaLoader.resize["start_x"]	= (e)? e.pageX : event.x + document.body.scrollLeft;		
-		parent.editAreaLoader.resize["start_y"]	= (e)? e.pageY : event.y + document.body.scrollTop;
-		if(editArea.isIE)
-		{
-			editArea.textarea.focus();
-			editArea.getIESelection();
-		}
-		parent.editAreaLoader.resize["selectionStart"]	= editArea.textarea.selectionStart;
-		parent.editAreaLoader.resize["selectionEnd"]	= editArea.textarea.selectionEnd;
-		parent.editAreaLoader.start_resize_area();
-	};
-	
-	EditArea.prototype.toggle_full_screen= function(to){
-		var t=this, p=parent, a=t.textarea, html, frame, selStart, selEnd, old, icon;
-		if(typeof(to)=="undefined")
-			to= !t.fullscreen['isFull'];
-		old			= t.fullscreen['isFull'];
-		t.fullscreen['isFull']= to;
-		icon		= _$("fullscreen");
-		selStart	= t.textarea.selectionStart;
-		selEnd		= t.textarea.selectionEnd;
-		html		= p.document.getElementsByTagName("html")[0];
-		frame		= p.document.getElementById("frame_"+t.id);
-		
-		if(to && to!=old)
-		{	// toogle on fullscreen		
-			
-			t.fullscreen['old_overflow']	= p.get_css_property(html, "overflow");
-			t.fullscreen['old_height']		= p.get_css_property(html, "height");
-			t.fullscreen['old_width']		= p.get_css_property(html, "width");
-			t.fullscreen['old_scrollTop']	= html.scrollTop;
-			t.fullscreen['old_scrollLeft']	= html.scrollLeft;
-			t.fullscreen['old_zIndex']		= p.get_css_property(frame, "z-index");
-			if(t.isOpera){
-				html.style.height	= "100%";
-				html.style.width	= "100%";	
-			}
-			html.style.overflow	= "hidden";
-			html.scrollTop		= 0;
-			html.scrollLeft		= 0;
-			
-			frame.style.position	= "absolute";
-			frame.style.width		= html.clientWidth+"px";
-			frame.style.height		= html.clientHeight+"px";
-			frame.style.display		= "block";
-			frame.style.zIndex		= "999999";
-			frame.style.top			= "0px";
-			frame.style.left		= "0px";
-			
-			// if the iframe was in a div with position absolute, the top and left are the one of the div, 
-			// so I fix it by seeing at witch position the iframe start and correcting it
-			frame.style.top			= "-"+p.calculeOffsetTop(frame)+"px";
-			frame.style.left		= "-"+p.calculeOffsetLeft(frame)+"px";
-			
-		//	parent.editAreaLoader.execCommand(t.id, "update_size();");
-		//	var body=parent.document.getElementsByTagName("body")[0];
-		//	body.appendChild(frame);
-			
-			t.switchClassSticky(icon, 'editAreaButtonSelected', false);
-			t.fullscreen['allow_resize']= t.resize_allowed;
-			t.allow_resize(false);
-	
-			//t.area_select(selStart, selEnd-selStart);
-			
-		
-			// opera can't manage to do a direct size update
-			if(t.isFirefox){
-				p.editAreaLoader.execCommand(t.id, "update_size();");
-				t.area_select(selStart, selEnd-selStart);
-				t.scroll_to_view();
-				t.focus();
-			}else{
-				setTimeout("p.editAreaLoader.execCommand('"+ t.id +"', 'update_size();');editArea.focus();", 10);
-			}	
-			
-	
-		}
-		else if(to!=old)
-		{	// toogle off fullscreen
-			frame.style.position="static";
-			frame.style.zIndex= t.fullscreen['old_zIndex'];
-		
-			if(t.isOpera)
-			{
-				html.style.height	= "auto"; 
-				html.style.width	= "auto";
-				html.style.overflow	= "auto";
-			}
-			else if(t.isIE && p!=top)
-			{	// IE doesn't manage html overflow in frames like in normal page... 
-				html.style.overflow	= "auto";
-			}
-			else
-			{
-				html.style.overflow	= t.fullscreen['old_overflow'];
-			}
-			html.scrollTop	= t.fullscreen['old_scrollTop'];
-			html.scrollLeft	= t.fullscreen['old_scrollLeft'];
-		
-			p.editAreaLoader.hide(t.id);
-			p.editAreaLoader.show(t.id);
-			
-			t.switchClassSticky(icon, 'editAreaButtonNormal', false);
-			if(t.fullscreen['allow_resize'])
-				t.allow_resize(t.fullscreen['allow_resize']);
-			if(t.isFirefox){
-				t.area_select(selStart, selEnd-selStart);
-				setTimeout("editArea.scroll_to_view();", 10);
-			}			
-			
-			//p.editAreaLoader.remove_event(p.window, "resize", editArea.update_size);
-		}
-		
-	};
-	
-	EditArea.prototype.allow_resize= function(allow){
-		var resize= _$("resize_area");
-		if(allow){
-			
-			resize.style.visibility="visible";
-			parent.editAreaLoader.add_event(resize, "mouseup", editArea.start_resize);
-		}else{
-			resize.style.visibility="hidden";
-			parent.editAreaLoader.remove_event(resize, "mouseup", editArea.start_resize);
-		}
-		this.resize_allowed= allow;
-	};
-	
-	
-	EditArea.prototype.change_syntax= function(new_syntax, is_waiting){
-	//	alert("cahnge to "+new_syntax);
-		// the syntax is the same
-		if(new_syntax==this.settings['syntax'])
-			return true;
-		
-		// check that the syntax is one allowed
-		var founded= false;
-		for(var i=0; i<this.syntax_list.length; i++)
-		{
-			if(this.syntax_list[i]==new_syntax)
-				founded= true;
-		}
-		
-		if(founded==true)
-		{
-			// the reg syntax file is not loaded
-			if(!parent.editAreaLoader.load_syntax[new_syntax])
-			{
-				// load the syntax file and wait for file loading
-				if(!is_waiting)
-					parent.editAreaLoader.load_script(parent.editAreaLoader.baseURL + "reg_syntax/" + new_syntax + ".js");
-				setTimeout("editArea.change_syntax('"+ new_syntax +"', true);", 100);
-				this.show_waiting_screen();
-			}
-			else
-			{
-				if(!this.allready_used_syntax[new_syntax])
-				{	// the syntax has still not been used
-					// rebuild syntax definition for new languages
-					parent.editAreaLoader.init_syntax_regexp();
-					// add style to the new list
-					this.add_style(parent.editAreaLoader.syntax[new_syntax]["styles"]);
-					this.allready_used_syntax[new_syntax]=true;
-				}
-				// be sure that the select option is correctly updated
-				var sel= _$("syntax_selection");
-				if(sel && sel.value!=new_syntax)
-				{
-					for(var i=0; i<sel.length; i++){
-						if(sel.options[i].value && sel.options[i].value == new_syntax)
-							sel.options[i].selected=true;
-					}
-				}
-				
-			/*	if(this.settings['syntax'].length==0)
-				{
-					this.switchClassSticky(_$("highlight"), 'editAreaButtonNormal', false);
-					this.switchClassSticky(_$("reset_highlight"), 'editAreaButtonNormal', false);
-					this.change_highlight(true);
-				}
-				*/
-				this.settings['syntax']= new_syntax;
-				this.resync_highlight(true);
-				this.hide_waiting_screen();
-				return true;
-			}
-		}
-		return false;
-	};
-	
-	
-	// check if the file has changed
-	EditArea.prototype.set_editable= function(is_editable){
-		if(is_editable)
-		{
-			document.body.className= "";
-			this.textarea.readOnly= false;
-			this.is_editable= true;
-		}
-		else
-		{
-			document.body.className= "non_editable";
-			this.textarea.readOnly= true;
-			this.is_editable= false;
-		}
-		
-		if(editAreas[this.id]["displayed"]==true)
-			this.update_size();
-	};
-	
-	/***** Wrap mode *****/
-	
-	// toggling function for set_wrap_mode
-	EditArea.prototype.toggle_word_wrap= function(){
-		this.set_word_wrap( !this.settings['word_wrap'] );
-	};
-	
-	
-	// open a new tab for the given file
-	EditArea.prototype.set_word_wrap= function(to){
-		var t=this, a= t.textarea;
-		
-		if( t.isOpera )
-		{
-			this.settings['word_wrap']= false;
-			t.switchClassSticky( _$("word_wrap"), 'editAreaButtonDisabled', true );
-			return false;
-		}
-		
-		if( to )
-		{
-			wrap_mode = 'soft';
-			this.container.className+= ' word_wrap';
-			this.container.style.width="";
-			this.content_highlight.style.width="";
-			a.style.width="100%";
-			if( t.isIE && t.isIE < 7 )	// IE 6 count 50 px too much
-			{
-				a.style.width	= ( a.offsetWidth-5 )+"px";
-			}
-			
-			t.switchClassSticky( _$("word_wrap"), 'editAreaButtonSelected', false );
-		}
-		else
-		{
-			wrap_mode = 'off';
-			this.container.className	= this.container.className.replace(/word_wrap/g, '');
-			t.switchClassSticky( _$("word_wrap"), 'editAreaButtonNormal', true );
-		}
-		this.textarea.previous_scrollWidth = '';
-		this.textarea.previous_scrollHeight = '';
-		
-		a.wrap= wrap_mode;
-		a.setAttribute('wrap', wrap_mode);
-		// only IE can change wrap mode on the fly without element reloading
-		if(!this.isIE)
-		{
-			var start=a.selectionStart, end= a.selectionEnd;
-			var parNod = a.parentNode, nxtSib = a.nextSibling;
-			parNod.removeChild(a);
-			parNod.insertBefore(a, nxtSib);
-			this.area_select(start, end-start);
-		}
-		// reset some optimisation
-		this.settings['word_wrap']	= to;
-		this.focus();
-		this.update_size();
-		this.check_line_selection();
-	};	
-	/***** tabbed files managing functions *****/
-	
-	// open a new tab for the given file
-	EditArea.prototype.open_file= function(settings){
-		
-		if(settings['id']!="undefined")
-		{
-			var id= settings['id'];
-			// create a new file object with defautl values
-			var new_file= {};
-			new_file['id']			= id;
-			new_file['title']		= id;
-			new_file['text']		= "";
-			new_file['last_selection']	= "";		
-			new_file['last_text_to_highlight']	= "";
-			new_file['last_hightlighted_text']	= "";
-			new_file['previous']	= [];
-			new_file['next']		= [];
-			new_file['last_undo']	= "";
-			new_file['smooth_selection']	= this.settings['smooth_selection'];
-			new_file['do_highlight']= this.settings['start_highlight'];
-			new_file['syntax']		= this.settings['syntax'];
-			new_file['scroll_top']	= 0;
-			new_file['scroll_left']	= 0;
-			new_file['selection_start']= 0;
-			new_file['selection_end']= 0;
-			new_file['edited']		= false;
-			new_file['font_size']	= this.settings["font_size"];
-			new_file['font_family']	= this.settings["font_family"];
-			new_file['word_wrap']	= this.settings["word_wrap"];
-			new_file['toolbar']		= {'links':{}, 'selects': {}};
-			new_file['compare_edited_text']= new_file['text'];
-			
-			
-			this.files[id]= new_file;
-			this.update_file(id, settings);
-			this.files[id]['compare_edited_text']= this.files[id]['text'];
-			
-			
-			var html_id= 'tab_file_'+encodeURIComponent(id);
-			this.filesIdAssoc[html_id]= id;
-			this.files[id]['html_id']= html_id;
-		
-			if(!_$(this.files[id]['html_id']) && id!="")
-			{
-				// be sure the tab browsing area is displayed
-				this.tab_browsing_area.style.display= "block";
-				var elem= document.createElement('li');
-				elem.id= this.files[id]['html_id'];
-				var close= "<img src=\""+ parent.editAreaLoader.baseURL +"images/close.gif\" title=\""+ this.get_translation('close_tab', 'word') +"\" onclick=\"editArea.execCommand('close_file', editArea.filesIdAssoc['"+ html_id +"']);return false;\" class=\"hidden\" onmouseover=\"this.className=''\" onmouseout=\"this.className='hidden'\" />";
-				elem.innerHTML= "<a onclick=\"javascript:editArea.execCommand('switch_to_file', editArea.filesIdAssoc['"+ html_id +"']);\" selec=\"none\"><b><span><strong class=\"edited\">*</strong>"+ this.files[id]['title'] + close +"</span></b></a>";
-				_$('tab_browsing_list').appendChild(elem);
-				var elem= document.createElement('text');
-				this.update_size();
-			}
-			
-			// open file callback (for plugin)
-			if(id!="")
-				this.execCommand('file_open', this.files[id]);
-			
-			this.switch_to_file(id, true);
-			return true;
-		}
-		else
-			return false;
-	};
-	
-	// close the given file
-	EditArea.prototype.close_file= function(id){
-		if(this.files[id])
-		{
-			this.save_file(id);
-			
-			// close file callback
-			if(this.execCommand('file_close', this.files[id])!==false)
-			{
-				// remove the tab in the toolbar
-				var li= _$(this.files[id]['html_id']);
-				li.parentNode.removeChild(li);
-				// select a new file
-				if(id== this.curr_file)
-				{
-					var next_file= "";
-					var is_next= false;
-					for(var i in this.files)
-					{
-						if( is_next )
-						{
-							next_file	= i;
-							break;
-						}
-						else if( i == id )
-							is_next		= true;
-						else
-							next_file	= i;
-					}
-					// display the next file
-					this.switch_to_file(next_file);
-				}
-				// clear datas
-				delete (this.files[id]);
-				this.update_size();
-			}	
-		}
-	};
-	
-	// backup current file datas
-	EditArea.prototype.save_file= function(id){
-		var t= this, save, a_links, a_selects, save_butt, img, i;
-		if(t.files[id])
-		{
-			var save= t.files[id];
-			save['last_selection']			= t.last_selection;		
-			save['last_text_to_highlight']	= t.last_text_to_highlight;
-			save['last_hightlighted_text']	= t.last_hightlighted_text;
-			save['previous']				= t.previous;
-			save['next']					= t.next;
-			save['last_undo']				= t.last_undo;
-			save['smooth_selection']		= t.smooth_selection;
-			save['do_highlight']			= t.do_highlight;
-			save['syntax']					= t.settings['syntax'];
-			save['text']					= t.textarea.value;
-			save['scroll_top']				= t.result.scrollTop;
-			save['scroll_left']				= t.result.scrollLeft;
-			save['selection_start']			= t.last_selection["selectionStart"];
-			save['selection_end']			= t.last_selection["selectionEnd"];
-			save['font_size']				= t.settings["font_size"];
-			save['font_family']				= t.settings["font_family"];
-			save['word_wrap']				= t.settings["word_wrap"];
-			save['toolbar']					= {'links':{}, 'selects': {}};
-			
-			// save toolbar buttons state for fileSpecific buttons
-			a_links= _$("toolbar_1").getElementsByTagName("a");
-			for( i=0; i<a_links.length; i++ )
-			{
-				if( a_links[i].getAttribute('fileSpecific') == 'yes' )
-				{
-					save_butt	= {};
-					img			= a_links[i].getElementsByTagName('img')[0];
-					save_butt['classLock']		= img.classLock;
-					save_butt['className']		= img.className;
-					save_butt['oldClassName']	= img.oldClassName;
-					
-					save['toolbar']['links'][a_links[i].id]= save_butt;
-				}
-			}
-			
-			// save toolbar select state for fileSpecific buttons
-			a_selects= _$("toolbar_1").getElementsByTagName("select");
-			for( i=0; i<a_selects.length; i++)
-			{
-				if(a_selects[i].getAttribute('fileSpecific')=='yes')
-				{
-					save['toolbar']['selects'][a_selects[i].id]= a_selects[i].value;
-				}
-			}
-				
-			t.files[id]= save;
-			
-			return save;
-		}
-		
-		return false;
-	};
-	
-	// update file_datas
-	EditArea.prototype.update_file= function(id, new_values){
-		for(var i in new_values)
-		{
-			this.files[id][i]= new_values[i];
-		}
-	};
-	
-	// display file datas
-	EditArea.prototype.display_file= function(id){
-		var t = this, a= t.textarea, new_file, a_lis, a_selects, a_links, a_options, i, j;
-		
-		// we're showing the empty file
-		if(id=='')
-		{
-			a.readOnly= true;
-			t.tab_browsing_area.style.display= "none";
-			_$("no_file_selected").style.display= "block";
-			t.result.className= "empty";
-			// clear current datas
-			if(!t.files[''])
-			{
-				t.open_file({id: ''});
-			}
-		}
-		// we try to show a non existent file, so we left
-		else if( typeof( t.files[id] ) == 'undefined' )
-		{
-			return false;
-		}
-		// display a normal file
-		else
-		{
-			t.result.className= "";
-			a.readOnly= !t.is_editable;
-			_$("no_file_selected").style.display= "none";
-			t.tab_browsing_area.style.display= "block";
-		}
-		
-		// ensure to have last state for undo/redo actions
-		t.check_redo(true);
-		t.check_undo(true);
-		t.curr_file= id;
-		
-		// replace selected tab file
-		a_lis= t.tab_browsing_area.getElementsByTagName('li');
-		for( i=0; i<a_lis.length; i++)
-		{
-			if(a_lis[i].id == t.files[id]['html_id'])
-				a_lis[i].className='selected';
-			else
-				a_lis[i].className='';
-		}
-		
-		// replace next files datas
-		new_file= t.files[id];
-	
-		// restore text content
-		a.value= new_file['text'];
-		
-		// restore font-size
-		t.set_font(new_file['font_family'], new_file['font_size']);
-		
-		// restore selection and scroll
-		t.area_select(new_file['last_selection']['selection_start'], new_file['last_selection']['selection_end'] - new_file['last_selection']['selection_start']);
-		t.manage_size(true);
-		t.result.scrollTop= new_file['scroll_top'];
-		t.result.scrollLeft= new_file['scroll_left'];
-		
-		// restore undo, redo
-		t.previous=	new_file['previous'];
-		t.next=	new_file['next'];
-		t.last_undo=	new_file['last_undo'];
-		t.check_redo(true);
-		t.check_undo(true);
-		
-		// restore highlight
-		t.execCommand("change_highlight", new_file['do_highlight']);
-		t.execCommand("change_syntax", new_file['syntax']);
-		
-		// smooth mode
-		t.execCommand("change_smooth_selection_mode", new_file['smooth_selection']);
-		
-		// word_wrap
-		t.execCommand("set_word_wrap", new_file['word_wrap']);
-			
-		// restore links state in toolbar
-		a_links= new_file['toolbar']['links'];
-		for( i in a_links)
-		{
-			if( img =  _$(i).getElementsByTagName('img')[0] )
-			{
-				img.classLock	= a_links[i]['classLock'];
-				img.className	= a_links[i]['className'];
-				img.oldClassName= a_links[i]['oldClassName'];
-			}
-		}
-		
-		// restore select state in toolbar
-		a_selects = new_file['toolbar']['selects'];
-		for( i in a_selects)
-		{
-			a_options	= _$(i).options;
-			for( j=0; j<a_options.length; j++)
-			{
-				if( a_options[j].value == a_selects[i] )
-					_$(i).options[j].selected=true;
-			}
-		}
-	
-	};
-
-	// change tab for displaying a new one
-	EditArea.prototype.switch_to_file= function(file_to_show, force_refresh){
-		if(file_to_show!=this.curr_file || force_refresh)
-		{
-			this.save_file(this.curr_file);
-			if(this.curr_file!='')
-				this.execCommand('file_switch_off', this.files[this.curr_file]);
-			this.display_file(file_to_show);
-			if(file_to_show!='')
-				this.execCommand('file_switch_on', this.files[file_to_show]);
-		}
-	};
-
-	// get all infos for the given file
-	EditArea.prototype.get_file= function(id){
-		if(id==this.curr_file)
-			this.save_file(id);
-		return this.files[id];
-	};
-	
-	// get all available files infos
-	EditArea.prototype.get_all_files= function(){
-		tmp_files= this.files;
-		this.save_file(this.curr_file);
-		if(tmp_files[''])
-			delete(this.files['']);
-		return tmp_files;
-	};
-	
-	
-	// check if the file has changed
-	EditArea.prototype.check_file_changes= function(){
-	
-		var id= this.curr_file;
-		if(this.files[id] && this.files[id]['compare_edited_text']!=undefined)
-		{
-			if(this.files[id]['compare_edited_text'].length==this.textarea.value.length && this.files[id]['compare_edited_text']==this.textarea.value)
-			{
-				if(this.files[id]['edited']!= false)
-					this.set_file_edited_mode(id, false);
-			}
-			else
-			{
-				if(this.files[id]['edited']!= true)
-					this.set_file_edited_mode(id, true);
-			}
-		}
-	};
-	
-	// set if the file is edited or not
-	EditArea.prototype.set_file_edited_mode= function(id, to){
-		// change CSS for edited tab
-		if(this.files[id] && _$(this.files[id]['html_id']))
-		{
-			var link= _$(this.files[id]['html_id']).getElementsByTagName('a')[0];
-			if(to==true)
-			{
-				link.className= 'edited';
-			}
-			else
-			{
-				link.className= '';
-				if(id==this.curr_file)
-					text= this.textarea.value;
-				else
-					text= this.files[id]['text'];
-				this.files[id]['compare_edited_text']= text;
-			}
-				
-			this.files[id]['edited']= to;
-		}
-	};
-
-	EditArea.prototype.set_show_line_colors = function(new_value){
-		this.show_line_colors = new_value;
-		
-		if( new_value )
-			this.selection_field.className	+= ' show_colors';
-		else
-			this.selection_field.className	= this.selection_field.className.replace( / show_colors/g, '' );
-	};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_loader.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_loader.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_loader.js
deleted file mode 100644
index 34a17dd..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_loader.js
+++ /dev/null
@@ -1,1080 +0,0 @@
-/******
- *
- *	EditArea 
- * 	Developped by Christophe Dolivet
- *	Released under LGPL, Apache and BSD licenses (use the one you want)
- *
-******/
-
-function EditAreaLoader(){
-	var t=this;
-	t.version= "0.8.1.1";
-	date= new Date();
-	t.start_time=date.getTime();
-	t.win= "loading";	// window loading state
-	t.error= false;	// to know if load is interrrupt
-	t.baseURL="";
-	//t.suffix="";
-	t.template="";
-	t.lang= {};	// array of loaded speech language
-	t.load_syntax= {};	// array of loaded syntax language for highlight mode
-	t.syntax= {};	// array of initilized syntax language for highlight mode
-	t.loadedFiles= [];
-	t.waiting_loading= {}; 	// files that must be loaded in order to allow the script to really start
-	// scripts that must be loaded in the iframe
-	t.scripts_to_load= ["elements_functions", "resize_area", "reg_syntax"];
-	t.sub_scripts_to_load= ["edit_area", "manage_area" ,"edit_area_functions", "keyboard", "search_replace", "highlight", "regexp"];
-	
-	t.resize= []; // contain resizing datas
-	t.hidden= {};	// store datas of the hidden textareas
-	
-	t.default_settings= {
-		//id: "src"	// id of the textarea to transform
-		debug: false
-		,smooth_selection: true
-		,font_size: "10"		// not for IE
-		,font_family: "monospace"	// can be "verdana,monospace". Allow non monospace font but Firefox get smaller tabulation with non monospace fonts. IE doesn't change the tabulation width and Opera doesn't take this option into account... 
-		,start_highlight: false	// if start with highlight
-		,toolbar: "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
-		,begin_toolbar: ""		//  "new_document, save, load, |"
-		,end_toolbar: ""		// or end_toolbar
-		,is_multi_files: false		// enable the multi file mode (the textarea content is ignored)
-		,allow_resize: "both"	// possible values: "no", "both", "x", "y"
-		,show_line_colors: false	// if the highlight is disabled for the line currently beeing edited (if enabled => heavy CPU use)
-		,min_width: 400
-		,min_height: 125
-		,replace_tab_by_spaces: false
-		,allow_toggle: true		// true or false
-		,language: "en"
-		,syntax: ""
-		,syntax_selection_allow: "basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml"
-		,display: "onload" 		// onload or later
-		,max_undo: 30
-		,browsers: "known"	// all or known
-		,plugins: "" // comma separated plugin list
-		,gecko_spellcheck: false	// enable/disable by default the gecko_spellcheck
-		,fullscreen: false
-		,is_editable: true
-		,cursor_position: "begin"
-		,word_wrap: false		// define if the text is wrapped of not in the textarea
-		,autocompletion: false	// NOT IMPLEMENTED			
-		,load_callback: ""		// click on load button (function name)
-		,save_callback: ""		// click on save button (function name)
-		,change_callback: ""	// textarea onchange trigger (function name)
-		,submit_callback: ""	// form submited (function name)
-		,EA_init_callback: ""	// EditArea initiliazed (function name)
-		,EA_delete_callback: ""	// EditArea deleted (function name)
-		,EA_load_callback: ""	// EditArea fully loaded and displayed (function name)
-		,EA_unload_callback: ""	// EditArea delete while being displayed (function name)
-		,EA_toggle_on_callback: ""	// EditArea toggled on (function name)
-		,EA_toggle_off_callback: ""	// EditArea toggled off (function name)
-		,EA_file_switch_on_callback: ""	// a new tab is selected (called for the newly selected file)
-		,EA_file_switch_off_callback: ""	// a new tab is selected (called for the previously selected file)
-		,EA_file_close_callback: ""		// close a tab
-	};
-	
-	t.advanced_buttons = [
-			// id, button img, command (it will try to find the translation of "id"), is_file_specific
-			['new_document', 'newdocument.gif', 'new_document', false],
-			['search', 'search.gif', 'show_search', false],
-			['go_to_line', 'go_to_line.gif', 'go_to_line', false],
-			['undo', 'undo.gif', 'undo', true],
-			['redo', 'redo.gif', 'redo', true],
-			['change_smooth_selection', 'smooth_selection.gif', 'change_smooth_selection_mode', true],
-			['reset_highlight', 'reset_highlight.gif', 'resync_highlight', true],
-			['highlight', 'highlight.gif','change_highlight', true],
-			['help', 'help.gif', 'show_help', false],
-			['save', 'save.gif', 'save', false],
-			['load', 'load.gif', 'load', false],
-			['fullscreen', 'fullscreen.gif', 'toggle_full_screen', false],
-			['word_wrap', 'word_wrap.gif', 'toggle_word_wrap', true],
-			['autocompletion', 'autocompletion.gif', 'toggle_autocompletion', true]
-		];
-			
-	// navigator identification
-	t.set_browser_infos(t);
-
-	if(t.isIE>=6 || t.isGecko || ( t.isWebKit && !t.isSafari<3 ) || t.isOpera>=9  || t.isCamino )
-		t.isValidBrowser=true;
-	else
-		t.isValidBrowser=false;
-
-	t.set_base_url();		
-	
-	for(var i=0; i<t.scripts_to_load.length; i++){
-		setTimeout("editAreaLoader.load_script('"+t.baseURL + t.scripts_to_load[i]+ ".js');", 1);	// let the time to Object editAreaLoader to be created before loading additionnal scripts
-		t.waiting_loading[t.scripts_to_load[i]+ ".js"]= false;
-	}
-	t.add_event(window, "load", EditAreaLoader.prototype.window_loaded);
-};
-	
-EditAreaLoader.prototype ={
-	has_error : function(){
-		this.error= true;
-		// set to empty all EditAreaLoader functions
-		for(var i in EditAreaLoader.prototype){
-			EditAreaLoader.prototype[i]=function(){};		
-		}
-	},
-	
-	// add browser informations to the object passed in parameter
-	set_browser_infos : function(o){
-		ua= navigator.userAgent;
-		
-		// general detection
-		o.isWebKit	= /WebKit/.test(ua);
-		o.isGecko	= !o.isWebKit && /Gecko/.test(ua);
-		o.isMac		= /Mac/.test(ua);
-		
-		o.isIE	= (navigator.appName == "Microsoft Internet Explorer");
-		if(o.isIE){
-			o.isIE = ua.replace(/^.*?MSIE\s+([0-9\.]+).*$/, "$1");
-			if(o.isIE<6)
-				o.has_error();
-		}
-
-		if(o.isOpera = (ua.indexOf('Opera') != -1)){	
-			o.isOpera= ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i, "$1");
-			if(o.isOpera<9)
-				o.has_error();
-			o.isIE=false;			
-		}
-
-		if(o.isFirefox =(ua.indexOf('Firefox') != -1))
-			o.isFirefox = ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i, "$1");
-		// Firefox clones 	
-		if( ua.indexOf('Iceweasel') != -1 )
-			o.isFirefox	= ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i, "$1");
-		if( ua.indexOf('GranParadiso') != -1 )
-			o.isFirefox	= ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i, "$1");
-		if( ua.indexOf('BonEcho') != -1 )
-			o.isFirefox	= ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i, "$1");
-		if( ua.indexOf('SeaMonkey') != -1)
-			o.isFirefox = (ua.replace(/^.*?SeaMonkey.*?([0-9\.]+).*$/i, "$1") ) + 1;
-			
-		if(o.isCamino =(ua.indexOf('Camino') != -1))
-			o.isCamino = ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i, "$1");
-			
-		if(o.isSafari =(ua.indexOf('Safari') != -1))
-			o.isSafari= ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i, "$1");
-	
-		if(o.isChrome =(ua.indexOf('Chrome') != -1)) {
-			o.isChrome = ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i, "$1");
-			o.isSafari	= false;
-		}
-		
-	},
-	
-	window_loaded : function(){
-		editAreaLoader.win="loaded";
-		
-		// add events on forms
-		if (document.forms) {
-			for (var i=0; i<document.forms.length; i++) {
-				var form = document.forms[i];
-				form.edit_area_replaced_submit=null;
-				try {
-					
-					form.edit_area_replaced_submit = form.onsubmit;
-					form.onsubmit="";
-				} catch (e) {// Do nothing
-				}
-				editAreaLoader.add_event(form, "submit", EditAreaLoader.prototype.submit);
-				editAreaLoader.add_event(form, "reset", EditAreaLoader.prototype.reset);
-			}
-		}
-		editAreaLoader.add_event(window, "unload", function(){for(var i in editAreas){editAreaLoader.delete_instance(i);}});	// ini callback
-	},
-	
-	// init the checkup of the selection of the IE textarea
-	init_ie_textarea : function(id){
-		var a=document.getElementById(id);
-		try{
-			if(a && typeof(a.focused)=="undefined"){
-				a.focus();
-				a.focused=true;
-				a.selectionStart= a.selectionEnd= 0;			
-				get_IE_selection(a);
-				editAreaLoader.add_event(a, "focus", IE_textarea_focus);
-				editAreaLoader.add_event(a, "blur", IE_textarea_blur);
-				
-			}
-		}catch(ex){}
-	},
-		
-	init : function(settings){
-		var t=this,s=settings,i;
-		
-		if(!s["id"])
-			t.has_error();
-		if(t.error)
-			return;
-		// if an instance of the editor already exists for this textarea => delete the previous one
-		if(editAreas[s["id"]])
-			t.delete_instance(s["id"]);
-	
-		// init settings
-		for(i in t.default_settings){
-			if(typeof(s[i])=="undefined")
-				s[i]=t.default_settings[i];
-		}
-		
-		if(s["browsers"]=="known" && t.isValidBrowser==false){
-			return;
-		}
-		
-		if(s["begin_toolbar"].length>0)
-			s["toolbar"]= s["begin_toolbar"] +","+ s["toolbar"];
-		if(s["end_toolbar"].length>0)
-			s["toolbar"]= s["toolbar"] +","+ s["end_toolbar"];
-		s["tab_toolbar"]= s["toolbar"].replace(/ /g,"").split(",");
-		
-		s["plugins"]= s["plugins"].replace(/ /g,"").split(",");
-		for(i=0; i<s["plugins"].length; i++){
-			if(s["plugins"][i].length==0)
-				s["plugins"].splice(i,1);
-		}
-	//	alert(settings["plugins"].length+": "+ settings["plugins"].join(","));
-		t.get_template();
-		t.load_script(t.baseURL + "langs/"+ s["language"] + ".js");
-		
-		if(s["syntax"].length>0){
-			s["syntax"]=s["syntax"].toLowerCase();
-			t.load_script(t.baseURL + "reg_syntax/"+ s["syntax"] + ".js");
-		}
-		//alert(this.template);
-		
-		editAreas[s["id"]]= {"settings": s};
-		editAreas[s["id"]]["displayed"]=false;
-		editAreas[s["id"]]["hidden"]=false;
-		
-		//if(settings["display"]=="onload")
-		t.start(s["id"]);
-	},
-	
-	// delete an instance of an EditArea
-	delete_instance : function(id){
-		var d=document,fs=window.frames,span,iframe;
-		editAreaLoader.execCommand(id, "EA_delete");
-		if(fs["frame_"+id] && fs["frame_"+id].editArea)
-		{
-			if(editAreas[id]["displayed"])
-				editAreaLoader.toggle(id, "off");
-			fs["frame_"+id].editArea.execCommand("EA_unload");
-		}
-
-		// remove toggle infos and debug textarea
-		span= d.getElementById("EditAreaArroundInfos_"+id);
-		if(span)
-			span.parentNode.removeChild(span);
-
-		// remove the iframe
-		iframe= d.getElementById("frame_"+id);
-		if(iframe){
-			iframe.parentNode.removeChild(iframe);
-			//delete iframe;
-			try {
-				delete fs["frame_"+id];
-			} catch (e) {// Do nothing
-			}
-		}	
-
-		delete editAreas[id];
-	},
-
-	
-	start : function(id){
-		var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;
-		
-		// check that the window is loaded
-		if(t.win!="loaded"){
-			setTimeout("editAreaLoader.start('"+id+"');", 50);
-			return;
-		}
-		
-		// check that all needed scripts are loaded
-		for( i in t.waiting_loading){
-			if(t.waiting_loading[i]!="loaded" && typeof(t.waiting_loading[i])!="function"){
-				setTimeout("editAreaLoader.start('"+id+"');", 50);
-				return;
-			}
-		}
-		
-		// wait until language and syntax files are loaded
-		if(!t.lang[editAreas[id]["settings"]["language"]] || (editAreas[id]["settings"]["syntax"].length>0 && !t.load_syntax[editAreas[id]["settings"]["syntax"]]) ){
-			setTimeout("editAreaLoader.start('"+id+"');", 50);
-			return;
-		}
-		// init the regexp for syntax highlight
-		if(editAreas[id]["settings"]["syntax"].length>0)
-			t.init_syntax_regexp();
-		
-			
-		// display toggle option and debug area
-		if(!d.getElementById("EditAreaArroundInfos_"+id) && (editAreas[id]["settings"]["debug"] || editAreas[id]["settings"]["allow_toggle"]))
-		{
-			span= d.createElement("span");
-			span.id= "EditAreaArroundInfos_"+id;
-			if(editAreas[id]["settings"]["allow_toggle"]){
-				checked=(editAreas[id]["settings"]["display"]=="onload")?"checked='checked'":"";
-				html+="<div id='edit_area_toggle_"+i+"'>";
-				html+="<input id='edit_area_toggle_checkbox_"+ id +"' class='toggle_"+ id +"' type='checkbox' onclick='editAreaLoader.toggle(\""+ id +"\");' accesskey='e' "+checked+" />";
-				html+="<label for='edit_area_toggle_checkbox_"+ id +"'>{$toggle}</label></div>";	
-			}
-			if(editAreas[id]["settings"]["debug"])
-				html+="<textarea id='edit_area_debug_"+ id +"' spellcheck='off' style='z-index: 20; width: 100%; height: 120px;overflow: auto; border: solid black 1px;'></textarea><br />";				
-			html= t.translate(html, editAreas[id]["settings"]["language"]);				
-			span.innerHTML= html;				
-			father= d.getElementById(id).parentNode;
-			next= d.getElementById(id).nextSibling;
-			if(next==null)
-				father.appendChild(span);
-			else
-				father.insertBefore(span, next);
-		}
-		
-		if(!editAreas[id]["initialized"])
-		{
-			t.execCommand(id, "EA_init");	// ini callback
-			if(editAreas[id]["settings"]["display"]=="later"){
-				editAreas[id]["initialized"]= true;
-				return;
-			}
-		}
-		
-		if(t.isIE){	// launch IE selection checkup
-			t.init_ie_textarea(id);
-		}
-				
-		// get toolbar content
-		area=editAreas[id];
-		
-		for(i=0; i<area["settings"]["tab_toolbar"].length; i++){
-		//	alert(this.tab_toolbar[i]+"\n"+ this.get_control_html(this.tab_toolbar[i]));
-			html_toolbar_content+= t.get_control_html(area["settings"]["tab_toolbar"][i], area["settings"]["language"]);
-		}
-		// translate toolbar text here for chrome 2
-		html_toolbar_content = t.translate(html_toolbar_content, area["settings"]["language"], "template"); 
-		
-		
-		// create javascript import rules for the iframe if the javascript has not been already loaded by the compressor
-		if(!t.iframe_script){
-			t.iframe_script="";
-			for(i=0; i<t.sub_scripts_to_load.length; i++)
-				t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + t.sub_scripts_to_load[i] +'.js"></script>';
-		}
-		
-		// add plugins scripts if not already loaded by the compressor (but need to load language in all the case)
-		for(i=0; i<area["settings"]["plugins"].length; i++){
-			//if(typeof(area["settings"]["plugins"][i])=="function") continue;
-			if(!t.all_plugins_loaded)
-				t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + 'plugins/' + area["settings"]["plugins"][i] + '/' + area["settings"]["plugins"][i] +'.js"></script>';
-			t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + 'plugins/' + area["settings"]["plugins"][i] + '/langs/' + area["settings"]["language"] +'.js"></script>';
-		}
-	
-		
-		// create css link for the iframe if the whole css text has not been already loaded by the compressor
-		if(!t.iframe_css){
-			t.iframe_css="<link href='"+ t.baseURL +"edit_area.css' rel='stylesheet' type='text/css' />";
-		}
-		
-		
-		// create template
-		template= t.template.replace(/\[__BASEURL__\]/g, t.baseURL);
-		template= template.replace("[__TOOLBAR__]",html_toolbar_content);
-			
-		
-		// fill template with good language sentences
-		template= t.translate(template, area["settings"]["language"], "template");
-		
-		// add css_code
-		template= template.replace("[__CSSRULES__]", t.iframe_css);				
-		// add js_code
-		template= template.replace("[__JSCODE__]", t.iframe_script);
-		
-		// add version_code
-		template= template.replace("[__EA_VERSION__]", t.version);
-		//template=template.replace(/\{\$([^\}]+)\}/gm, this.traduc_template);
-		
-		//editAreas[area["settings"]["id"]]["template"]= template;
-		
-		area.textarea=d.getElementById(area["settings"]["id"]);
-		editAreas[area["settings"]["id"]]["textarea"]=area.textarea;
-	
-		// if removing previous instances from DOM before (fix from Marcin)
-		if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined') 
-			delete window.frames["frame_"+area["settings"]["id"]];
-		
-		// insert template in the document after the textarea
-		father= area.textarea.parentNode;
-	/*	var container= document.createElement("div");
-		container.id= "EditArea_frame_container_"+area["settings"]["id"];
-	*/	
-		content= d.createElement("iframe");
-		content.name= "frame_"+area["settings"]["id"];
-		content.id= "frame_"+area["settings"]["id"];
-		content.style.borderWidth= "0px";
-		setAttribute(content, "frameBorder", "0"); // IE
-		content.style.overflow="hidden";
-		content.style.display="none";
-
-		
-		next= area.textarea.nextSibling;
-		if(next==null)
-			father.appendChild(content);
-		else
-			father.insertBefore(content, next) ;		
-		f=window.frames["frame_"+area["settings"]["id"]];
-		f.document.open();
-		f.editAreas=editAreas;
-		f.area_id= area["settings"]["id"];	
-		f.document.area_id= area["settings"]["id"];	
-		f.document.write(template);
-		f.document.close();
-
-	//	frame.editAreaLoader=this;
-		//editAreas[area["settings"]["id"]]["displayed"]=true;
-		
-	},
-	
-	toggle : function(id, toggle_to){
-
-	/*	if((editAreas[id]["displayed"]==true  && toggle_to!="on") || toggle_to=="off"){
-			this.toggle_off(id);
-		}else if((editAreas[id]["displayed"]==false  && toggle_to!="off") || toggle_to=="on"){
-			this.toggle_on(id);
-		}*/
-		if(!toggle_to)
-			toggle_to= (editAreas[id]["displayed"]==true)?"off":"on";
-		if(editAreas[id]["displayed"]==true  && toggle_to=="off"){
-			this.toggle_off(id);
-		}else if(editAreas[id]["displayed"]==false  && toggle_to=="on"){
-			this.toggle_on(id);
-		}
-	
-		return false;
-	},
-	
-	// static function
-	toggle_off : function(id){
-		var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;
-		if(fs["frame_"+id])
-		{	
-			f	= fs["frame_"+id];
-			t	= editAreas[id]["textarea"];
-			if(f.editArea.fullscreen['isFull'])
-				f.editArea.toggle_full_screen(false);
-			editAreas[id]["displayed"]=false;
-			
-			// set wrap to off to keep same display mode (some browser get problem with this, so it need more complex operation		
-			t.wrap = "off";	// for IE
-			setAttribute(t, "wrap", "off");	// for Firefox	
-			parNod = t.parentNode;
-			nxtSib = t.nextSibling;
-			parNod.removeChild(t); 
-			parNod.insertBefore(t, nxtSib);
-			
-			// restore values
-			t.value= f.editArea.textarea.value;
-			selStart	= f.editArea.last_selection["selectionStart"];
-			selEnd		= f.editArea.last_selection["selectionEnd"];
-			scrollTop	= f.document.getElementById("result").scrollTop;
-			scrollLeft	= f.document.getElementById("result").scrollLeft;
-			
-			
-			document.getElementById("frame_"+id).style.display='none';
-		
-			t.style.display="inline";
-
-			try{	// IE will give an error when trying to focus an invisible or disabled textarea
-				t.focus();
-			} catch(e){};
-			if(this.isIE){
-				t.selectionStart= selStart;
-				t.selectionEnd	= selEnd;
-				t.focused		= true;
-				set_IE_selection(t);
-			}else{
-				if(this.isOpera && this.isOpera < 9.6 ){	// Opera bug when moving selection start and selection end
-					t.setSelectionRange(0, 0);
-				}
-				try{
-					t.setSelectionRange(selStart, selEnd);
-				} catch(e) {};
-			}
-			t.scrollTop= scrollTop;
-			t.scrollLeft= scrollLeft;
-			f.editArea.execCommand("toggle_off");
-
-		}
-	},	
-	
-	// static function
-	toggle_on : function(id){
-		var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;
-			
-		if(fs["frame_"+id])
-		{
-			f	= fs["frame_"+id];
-			t	= editAreas[id]["textarea"];
-			area= f.editArea;
-			area.textarea.value= t.value;
-			
-			// store display values;
-			curPos	= editAreas[id]["settings"]["cursor_position"];
-
-			if(t.use_last==true)
-			{
-				selStart	= t.last_selectionStart;
-				selEnd		= t.last_selectionEnd;
-				scrollTop	= t.last_scrollTop;
-				scrollLeft	= t.last_scrollLeft;
-				t.use_last=false;
-			}
-			else if( curPos == "auto" )
-			{
-				try{
-					selStart	= t.selectionStart;
-					selEnd		= t.selectionEnd;
-					scrollTop	= t.scrollTop;
-					scrollLeft	= t.scrollLeft;
-					//alert(scrollTop);
-				}catch(ex){}
-			}
-			
-			// set to good size
-			this.set_editarea_size_from_textarea(id, document.getElementById("frame_"+id));
-			t.style.display="none";			
-			document.getElementById("frame_"+id).style.display="inline";
-			area.execCommand("focus"); // without this focus opera doesn't manage well the iframe body height
-			
-			
-			// restore display values
-			editAreas[id]["displayed"]=true;
-			area.execCommand("update_size");
-			
-			f.document.getElementById("result").scrollTop= scrollTop;
-			f.document.getElementById("result").scrollLeft= scrollLeft;
-			area.area_select(selStart, selEnd-selStart);
-			area.execCommand("toggle_on");
-
-			
-		}
-		else
-		{
-		/*	if(this.isIE)
-				get_IE_selection(document.getElementById(id));	*/	
-			elem= document.getElementById(id);	
-			elem.last_selectionStart= elem.selectionStart;
-			elem.last_selectionEnd= elem.selectionEnd;
-			elem.last_scrollTop= elem.scrollTop;
-			elem.last_scrollLeft= elem.scrollLeft;
-			elem.use_last=true;
-			editAreaLoader.start(id);
-		}
-	},	
-	
-	set_editarea_size_from_textarea : function(id, frame){	
-		var elem,width,height;
-		elem	= document.getElementById(id);
-		
-		width	= Math.max(editAreas[id]["settings"]["min_width"], elem.offsetWidth)+"px";
-		height	= Math.max(editAreas[id]["settings"]["min_height"], elem.offsetHeight)+"px";
-		if(elem.style.width.indexOf("%")!=-1)
-			width	= elem.style.width;
-		if(elem.style.height.indexOf("%")!=-1)
-			height	= elem.style.height;
-		//alert("h: "+height+" w: "+width);
-	
-		frame.style.width= width;
-		frame.style.height= height;
-	},
-		
-	set_base_url : function(){
-		var t=this,elems,i,docBasePath;
-
-		if( !this.baseURL ){
-			elems = document.getElementsByTagName('script');
-	
-			for( i=0; i<elems.length; i++ ){
-				if (elems[i].src && elems[i].src.match(/edit_area_[^\\\/]*$/i) ) {
-					var src = elems[i].src;
-					src = src.substring(0, src.lastIndexOf('/'));
-					this.baseURL = src;
-					this.file_name= elems[i].src.substr(elems[i].src.lastIndexOf("/")+1);
-					break;
-				}
-			}
-		}
-		
-		docBasePath	= document.location.href;
-		if (docBasePath.indexOf('?') != -1)
-			docBasePath	= docBasePath.substring(0, docBasePath.indexOf('?'));
-		docBasePath	= docBasePath.substring(0, docBasePath.lastIndexOf('/'));
-	
-		// If not HTTP absolute
-		if (t.baseURL.indexOf('://') == -1 && t.baseURL.charAt(0) != '/') {
-			// If site absolute
-			t.baseURL = docBasePath + "/" + t.baseURL;
-		}
-		t.baseURL	+="/";	
-	},
-	
-	get_button_html : function(id, img, exec, isFileSpecific, baseURL) {
-		var cmd,html;
-		if(!baseURL)
-			baseURL= this.baseURL;
-		cmd	= 'editArea.execCommand(\'' + exec + '\')';
-		html	= '<a id="a_'+ id +'" href="javascript:' + cmd + '" onclick="' + cmd + ';return false;" onmousedown="return false;" target="_self" fileSpecific="'+ (isFileSpecific?'yes':'no') +'">';
-		html	+= '<img id="' + id + '" src="'+ baseURL +'images/' + img + '" title="{$' + id + '}" width="20" height="20" class="editAreaButtonNormal" onmouseover="editArea.switchClass(this,\'editAreaButtonOver\');" onmouseout="editArea.restoreClass(this);" onmousedown="editArea.restoreAndSwitchClass(this,\'editAreaButtonDown\');" /></a>';
-		return html;
-	},
-
-	get_control_html : function(button_name, lang) {		
-		var t=this,i,but,html,si;
-		for (i=0; i<t.advanced_buttons.length; i++)
-		{
-			but = t.advanced_buttons[i];			
-			if (but[0] == button_name)
-			{
-				return t.get_button_html(but[0], but[1], but[2], but[3]);
-			}	
-		}		
-				
-		switch (button_name){
-			case "*":
-			case "return":
-				return "<br />";
-			case "|":
-		  	case "separator":
-				return '<img src="'+ t.baseURL +'images/spacer.gif" width="1" height="15" class="editAreaSeparatorLine">';
-			case "select_font":
-				html= "<select id='area_font_size' onchange='javascript:editArea.execCommand(\"change_font_size\")' fileSpecific='yes'>";
-				html+="<option value='-1'>{$font_size}</option>";
-				si=[8,9,10,11,12,14];
-				for( i=0;i<si.length;i++){
-					html+="<option value='"+si[i]+"'>"+si[i]+" pt</option>";
-				}
-				html+="</select>";
-				return html;
-			case "syntax_selection":
-				html= "<select id='syntax_selection' onchange='javascript:editArea.execCommand(\"change_syntax\", this.value)' fileSpecific='yes'>";
-				html+="<option value='-1'>{$syntax_selection}</option>";
-				html+="</select>";
-				return html;
-		}
-		
-		return "<span id='tmp_tool_"+button_name+"'>["+button_name+"]</span>";		
-	},
-	
-	
-	get_template : function(){
-		if(this.template=="")
-		{
-			var xhr_object = null; 
-			if(window.XMLHttpRequest) // Firefox 
-				xhr_object = new XMLHttpRequest(); 
-			else if(window.ActiveXObject) // Internet Explorer 
-				xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
-			else { // XMLHttpRequest not supported
-				alert("XMLHTTPRequest not supported. EditArea not loaded"); 
-				return; 
-			} 
-			 
-			xhr_object.open("GET", this.baseURL+"template.html", false); 
-			xhr_object.send(null); 
-			if(xhr_object.readyState == 4) 
-				this.template=xhr_object.responseText;
-			else
-				this.has_error();
-		}
-	},
-	
-	// translate text
-	translate : function(text, lang, mode){
-		if(mode=="word")
-			text=editAreaLoader.get_word_translation(text, lang);
-		else if(mode="template"){
-			editAreaLoader.current_language= lang;
-			text=text.replace(/\{\$([^\}]+)\}/gm, editAreaLoader.translate_template);
-		}
-		return text;
-	},
-	
-	translate_template : function(){
-		return editAreaLoader.get_word_translation(EditAreaLoader.prototype.translate_template.arguments[1], editAreaLoader.current_language);
-	},
-	
-	get_word_translation : function(val, lang){
-		var i;
-		
-		for( i in editAreaLoader.lang[lang]){
-			if(i == val)
-				return editAreaLoader.lang[lang][i];
-		}
-		return "_"+val;
-	},
-	
-	load_script : function(url){
-		var t=this,d=document,script,head;
-		
-		if( t.loadedFiles[url] )
-			return;	
-		//alert("load: "+url);
-		try{
-			script= d.createElement("script");
-			script.type= "text/javascript";
-			script.src= url;
-			script.charset= "UTF-8";
-			d.getElementsByTagName("head")[0].appendChild(script);
-		}catch(e){
-			d.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '" charset="UTF-8"></sc'+'ript>');
-		}
-		
-		t.loadedFiles[url] = true;
-	},
-	
-	add_event : function(obj, name, handler) {
-		try{
-			if (obj.attachEvent) {
-				obj.attachEvent("on" + name, handler);
-			} else{
-				obj.addEventListener(name, handler, false);
-			}
-		}catch(e){}
-	},
-	
-	remove_event : function(obj, name, handler){
-		try{
-			if (obj.detachEvent)
-				obj.detachEvent("on" + name, handler);
-			else
-				obj.removeEventListener(name, handler, false);
-		}catch(e){}
-	},
-
-
-	// reset all the editareas in the form that have been reseted
-	reset : function(e){
-		var formObj,is_child,i,x;
-		
-		formObj = editAreaLoader.isIE ? window.event.srcElement : e.target;
-		if(formObj.tagName!='FORM')
-			formObj= formObj.form;
-		
-		for( i in editAreas ){			
-			is_child= false;
-			for( x=0;x<formObj.elements.length;x++ ) {
-				if(formObj.elements[x].id == i)
-					is_child=true;
-			}
-			
-			if(window.frames["frame_"+i] && is_child && editAreas[i]["displayed"]==true){
-			
-				var exec= 'window.frames["frame_'+ i +'"].editArea.textarea.value= document.getElementById("'+ i +'").value;';
-				exec+= 'window.frames["frame_'+ i +'"].editArea.execCommand("focus");';
-				exec+= 'window.frames["frame_'+ i +'"].editArea.check_line_selection();';
-				exec+= 'window.frames["frame_'+ i +'"].editArea.execCommand("reset");';
-				window.setTimeout(exec, 10);
-			}
-		}		
-		return;
-	},
-	
-	
-	// prepare all the textarea replaced by an editarea to be submited
-	submit : function(e){		
-		var formObj,is_child,fs=window.frames,i,x;
-		formObj = editAreaLoader.isIE ? window.event.srcElement : e.target;
-		if(formObj.tagName!='FORM')
-			formObj= formObj.form;
-		
-		for( i in editAreas){
-			is_child= false;
-			for( x=0;x<formObj.elements.length;x++ ) {
-				if(formObj.elements[x].id == i)
-					is_child=true;
-			}
-		
-			if(is_child)
-			{
-				if(fs["frame_"+i] && editAreas[i]["displayed"]==true)
-					document.getElementById(i).value= fs["frame_"+ i].editArea.textarea.value;
-				editAreaLoader.execCommand(i,"EA_submit");
-			}
-		}				
-		if( typeof(formObj.edit_area_replaced_submit) == "function" ){
-			res= formObj.edit_area_replaced_submit();
-			if(res==false){
-				if(editAreaLoader.isIE)
-					return false;
-				else
-					e.preventDefault();
-			}
-		}
-		return;
-	},
-	
-	// allow to get the value of the editarea
-	getValue : function(id){
-        if(window.frames["frame_"+id] && editAreas[id]["displayed"]==true){
-            return window.frames["frame_"+ id].editArea.textarea.value;       
-        }else if(elem=document.getElementById(id)){
-        	return elem.value;
-        }
-        return false;
-    },
-    
-    // allow to set the value of the editarea
-    setValue : function(id, new_val){
-    	var fs=window.frames;
-    	
-        if( ( f=fs["frame_"+id] ) && editAreas[id]["displayed"]==true){
-			f.editArea.textarea.value= new_val;     
-			f.editArea.execCommand("focus"); 
-			f.editArea.check_line_selection(false);  
-			f.editArea.execCommand("onchange");
-        }else if(elem=document.getElementById(id)){
-        	elem.value= new_val;
-        }
-    },
-	    
-    // allow to get infos on the selection: array(start, end)
-    getSelectionRange : function(id){
-    	var sel,eA,fs=window.frames;
-    	
-    	sel= {"start": 0, "end": 0};
-        if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
-        	eA= fs["frame_"+ id].editArea;
-
-			sel["start"]	= eA.textarea.selectionStart;
-			sel["end"]		= eA.textarea.selectionEnd;
-		
-        }else if( elem=document.getElementById(id) ){
-        	sel= getSelectionRange(elem);
-        }
-        return sel;
-    },
-    
-    // allow to set the selection with the given start and end positions
-    setSelectionRange : function(id, new_start, new_end){
-    	var fs=window.frames;
-    	
-        if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
-            fs["frame_"+ id].editArea.area_select(new_start, new_end-new_start);  
-			// make an auto-scroll to the selection
-			if(!this.isIE){
-				fs["frame_"+ id].editArea.check_line_selection(false); 
-				fs["frame_"+ id].editArea.scroll_to_view();
-			}   
-        }else if(elem=document.getElementById(id)){
-        	setSelectionRange(elem, new_start, new_end);
-        }
-    },
-    
-    getSelectedText : function(id){
-    	var sel= this.getSelectionRange(id);
-    	
-        return this.getValue(id).substring(sel["start"], sel["end"]);
-    },
-	
-	setSelectedText : function(id, new_val){
-		var fs=window.frames,d=document,sel,text,scrollTop,scrollLeft,new_sel_end;
-		
-		new_val	= new_val.replace(/\r/g, ""); 
-		sel		= this.getSelectionRange(id);
-		text	= this.getValue(id);
-		if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
-			scrollTop	= fs["frame_"+ id].document.getElementById("result").scrollTop;
-			scrollLeft	= fs["frame_"+ id].document.getElementById("result").scrollLeft;
-		}else{
-			scrollTop	= d.getElementById(id).scrollTop;
-			scrollLeft	= d.getElementById(id).scrollLeft;
-		}
-		
-		text	= text.substring(0, sel["start"])+ new_val +text.substring(sel["end"]);
-		this.setValue(id, text);
-		new_sel_end	= sel["start"]+ new_val.length;
-		this.setSelectionRange(id, sel["start"], new_sel_end);
-		
-		
-		// fix \r problem for selection length count on IE & Opera
-		if(new_val != this.getSelectedText(id).replace(/\r/g, "")){
-			this.setSelectionRange(id, sel["start"], new_sel_end+ new_val.split("\n").length -1);
-		}
-		// restore scrolling position
-		if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
-			fs["frame_"+ id].document.getElementById("result").scrollTop= scrollTop;
-			fs["frame_"+ id].document.getElementById("result").scrollLeft= scrollLeft;
-			fs["frame_"+ id].editArea.execCommand("onchange");
-		}else{
-			d.getElementById(id).scrollTop= scrollTop;
-			d.getElementById(id).scrollLeft= scrollLeft;
-		}
-    },
-    
-    insertTags : function(id, open_tag, close_tag){
-    	var old_sel,new_sel;
-    	
-    	old_sel	= this.getSelectionRange(id);
-    	text	= open_tag + this.getSelectedText(id) + close_tag;
-    	 
-		editAreaLoader.setSelectedText(id, text);
-		
-    	new_sel	= this.getSelectionRange(id);
-    	if(old_sel["end"] > old_sel["start"])	// if text was selected, cursor at the end
-    		this.setSelectionRange(id, new_sel["end"], new_sel["end"]);
-    	else // cursor in the middle
-    		this.setSelectionRange(id, old_sel["start"]+open_tag.length, old_sel["start"]+open_tag.length);
-    },
-    
-    // hide both EditArea and normal textarea
-	hide : function(id){
-		var fs= window.frames,d=document,t=this,scrollTop,scrollLeft,span;
-		if(d.getElementById(id) && !t.hidden[id])
-		{
-			t.hidden[id]= {};
-			t.hidden[id]["selectionRange"]= t.getSelectionRange(id);
-			if(d.getElementById(id).style.display!="none")
-			{
-				t.hidden[id]["scrollTop"]= d.getElementById(id).scrollTop;
-				t.hidden[id]["scrollLeft"]= d.getElementById(id).scrollLeft;
-			}
-					
-			if(fs["frame_"+id])
-			{
-				t.hidden[id]["toggle"]= editAreas[id]["displayed"];
-				
-				if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
-					scrollTop	= fs["frame_"+ id].document.getElementById("result").scrollTop;
-					scrollLeft	= fs["frame_"+ id].document.getElementById("result").scrollLeft;
-				}else{
-					scrollTop	= d.getElementById(id).scrollTop;
-					scrollLeft	= d.getElementById(id).scrollLeft;
-				}
-				t.hidden[id]["scrollTop"]= scrollTop;
-				t.hidden[id]["scrollLeft"]= scrollLeft;
-				
-				if(editAreas[id]["displayed"]==true)
-					editAreaLoader.toggle_off(id);
-			}
-			
-			// hide toggle button and debug box
-			span= d.getElementById("EditAreaArroundInfos_"+id);
-			if(span){
-				span.style.display='none';
-			}
-			
-			// hide textarea
-			d.getElementById(id).style.display= "none";
-		}
-	},
-	
-	// restore hidden EditArea and normal textarea
-	show : function(id){
-		var fs= window.frames,d=document,t=this,span;
-		if((elem=d.getElementById(id)) && t.hidden[id])
-		{
-			elem.style.display= "inline";
-			elem.scrollTop= t.hidden[id]["scrollTop"];
-			elem.scrollLeft= t.hidden[id]["scrollLeft"];
-			span= d.getElementById("EditAreaArroundInfos_"+id);
-			if(span){
-				span.style.display='inline';
-			}
-			
-			if(fs["frame_"+id])
-			{
-								
-				// restore toggle button and debug box
-			
-				
-				// restore textarea
-				elem.style.display= "inline";
-				
-				// restore EditArea
-				if(t.hidden[id]["toggle"]==true)
-					editAreaLoader.toggle_on(id);
-				
-				scrollTop	= t.hidden[id]["scrollTop"];
-				scrollLeft	= t.hidden[id]["scrollLeft"];
-				
-				if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
-					fs["frame_"+ id].document.getElementById("result").scrollTop	= scrollTop;
-					fs["frame_"+ id].document.getElementById("result").scrollLeft	= scrollLeft;
-				}else{
-					elem.scrollTop	= scrollTop;
-					elem.scrollLeft	= scrollLeft;
-				}
-			
-			}
-			// restore selection
-			sel	= t.hidden[id]["selectionRange"];
-			t.setSelectionRange(id, sel["start"], sel["end"]);
-			delete t.hidden[id];	
-		}
-	},
-	
-	// get the current file datas (for multi file editing mode)
-	getCurrentFile : function(id){
-		return this.execCommand(id, 'get_file', this.execCommand(id, 'curr_file'));
-	},
-	
-	// get the given file datas (for multi file editing mode)
-	getFile : function(id, file_id){
-		return this.execCommand(id, 'get_file', file_id);
-	},
-	
-	// get all the openned files datas (for multi file editing mode)
-	getAllFiles : function(id){
-		return this.execCommand(id, 'get_all_files()');
-	},
-	
-	// open a file (for multi file editing mode)
-	openFile : function(id, file_infos){
-		return this.execCommand(id, 'open_file', file_infos);
-	},
-	
-	// close the given file (for multi file editing mode)
-	closeFile : function(id, file_id){
-		return this.execCommand(id, 'close_file', file_id);
-	},
-	
-	// close the given file (for multi file editing mode)
-	setFileEditedMode : function(id, file_id, to){
-		var reg1,reg2;
-		reg1	= new RegExp('\\\\', 'g');
-		reg2	= new RegExp('"', 'g');
-		return this.execCommand(id, 'set_file_edited_mode("'+ file_id.replace(reg1, '\\\\').replace(reg2, '\\"') +'", '+ to +')');
-	},
-	
-	
-	// allow to access to editarea functions and datas (for advanced users only)
-	execCommand : function(id, cmd, fct_param){
-		switch(cmd){
-			case "EA_init":
-				if(editAreas[id]['settings']["EA_init_callback"].length>0)
-					eval(editAreas[id]['settings']["EA_init_callback"]+"('"+ id +"');");
-				break;
-			case "EA_delete":
-				if(editAreas[id]['settings']["EA_delete_callback"].length>0)
-					eval(editAreas[id]['settings']["EA_delete_callback"]+"('"+ id +"');");
-				break;
-			case "EA_submit":
-				if(editAreas[id]['settings']["submit_callback"].length>0)
-					eval(editAreas[id]['settings']["submit_callback"]+"('"+ id +"');");
-				break;
-		}
-        if(window.frames["frame_"+id] && window.frames["frame_"+ id].editArea){
-			if(fct_param!=undefined)
-				return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +'(fct_param);');
-			else
-				return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +';');       
-        }
-        return false;
-    }
-};
-	
-	var editAreaLoader= new EditAreaLoader();
-	var editAreas= {};
-


[15/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/python.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/python.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/python.js
new file mode 100644
index 0000000..4b0acf2
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/python.js
@@ -0,0 +1,144 @@
+/**
+ * Python syntax v 1.1 
+ * 
+ * v1.1 by Andre Roberge (2006/12/27)
+ *   
+**/
+editAreaLoader.load_syntax["python"] = {
+	'COMMENT_SINGLE' : {1 : '#'}
+	,'COMMENT_MULTI' : {}
+	,'QUOTEMARKS' : {1: "'", 2: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : true
+	,'KEYWORDS' : {
+		/*
+		** Set 1: reserved words
+		** http://python.org/doc/current/ref/keywords.html
+		** Note: 'as' and 'with' have been added starting with Python 2.5
+		*/
+		'reserved' : [
+			'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
+			'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 
+			'import', 'is', 'in', 'lambda', 'not', 'or', 'pass', 'print', 'raise',
+			'return', 'try', 'while', 'with', 'yield'
+			//the following are *almost* reserved; we'll treat them as such
+			, 'False', 'True', 'None'
+		]
+		/*
+		** Set 2: builtins
+		** http://python.org/doc/current/lib/built-in-funcs.html
+		*/	
+		,'builtins' : [
+			'__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp', 
+			'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile', 
+			'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
+			'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
+			'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
+			'raw_input', 'reduce', 'reload', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
+			'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode', 
+			'vars', 'xrange', 'zip',
+			// Built-in constants: http://www.python.org/doc/2.4.1/lib/node35.html
+			//'False', 'True', 'None' have been included in 'reserved'
+			'NotImplemented', 'Ellipsis',
+			// Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
+			'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
+			'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
+			'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
+			'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
+			'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
+			'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
+			'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
+			'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
+			'RuntimeWarning', 'FutureWarning',		
+			// we will include the string methods as well
+			// http://python.org/doc/current/lib/string-methods.html
+			'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
+			'find', 'index', 'isalnum', 'isaplpha', 'isdigit', 'islower', 'isspace', 'istitle',
+			'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
+			'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
+			'translate', 'upper', 'zfill'
+		]
+		/*
+		** Set 3: standard library
+		** http://python.org/doc/current/lib/modindex.html
+		*/
+		,'stdlib' : [
+			'__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
+			'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
+			'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
+			'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
+			'collections', 'colorsys', 'commands', 'compileall', 'compiler', 'compiler',
+			'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
+			'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
+			'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
+			'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
+			'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
+			'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
+			'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
+			'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
+			'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
+			'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
+			'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
+			'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
+			'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
+			'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
+			're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',
+			'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
+			'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
+			'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
+			'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
+			'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
+			'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
+			'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
+			'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
+			'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
+			'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib'
+
+		]
+		/*
+		** Set 4: special methods
+		** http://python.org/doc/current/ref/specialnames.html
+		*/
+		,'special' : [
+			// Basic customization: http://python.org/doc/current/ref/customization.html
+			'__new__', '__init__', '__del__', '__repr__', '__str__', 
+			'__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
+			'__hash__', '__nonzero__', '__unicode__', '__dict__',
+			// Attribute access: http://python.org/doc/current/ref/attribute-access.html
+			'__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
+			'__delete__', '__slots__',
+			// Class creation, callable objects
+			'__metaclass__', '__call__', 
+			// Container types: http://python.org/doc/current/ref/sequence-types.html
+			'__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
+			'__getslice__', '__setslice__', '__delslice__',
+			// Numeric types: http://python.org/doc/current/ref/numeric-types.html
+			'__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
+			'__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
+			'__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
+			'__long__','__lshift__',
+			'__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
+			'__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
+			'__rshift__','__rsub__','__rmul__','__repr__','__rand__','__rxor__','__ror__',
+			'__sub__','__xor__'
+		]
+	}
+	,'OPERATORS' :[
+		'+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #660066;'
+		,'KEYWORDS' : {
+			'reserved' : 'color: #0000FF;'
+			,'builtins' : 'color: #009900;'
+			,'stdlib' : 'color: #009900;'
+			,'special': 'color: #006666;'
+			}
+		,'OPERATORS' : 'color: #993300;'
+		,'DELIMITERS' : 'color: #993300;'
+				
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/robotstxt.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/robotstxt.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/robotstxt.js
new file mode 100644
index 0000000..d57395f
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/robotstxt.js
@@ -0,0 +1,24 @@
+editAreaLoader.load_syntax["robotstxt"] = {
+	'COMMENT_SINGLE' : {1 : '#'},
+	'COMMENT_MULTI' : {},
+	'QUOTEMARKS' : [],
+	'KEYWORD_CASE_SENSITIVE' : false,
+	'KEYWORDS' : {
+		'attributes' : ['User-agent', 'Disallow', 'Allow', 'Crawl-delay'],
+		'values' : ['*'],
+		'specials' : ['*']
+	},
+	'OPERATORS' :[':'],
+	'DELIMITERS' :[],
+	'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;',
+		'QUOTESMARKS': 'color: #6381F8;',
+		'KEYWORDS' : {
+			'attributes' : 'color: #48BDDF;',
+			'values' : 'color: #2B60FF;',
+			'specials' : 'color: #FF0000;'
+			},
+	'OPERATORS' : 'color: #FF00FF;',
+	'DELIMITERS' : 'color: #60CA00;'			
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/ruby.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/ruby.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/ruby.js
new file mode 100644
index 0000000..c6ee2f4
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/ruby.js
@@ -0,0 +1,67 @@
+/**
+ * Ruby syntax v 1.0 
+ * 
+ * v1.0 by Patrice De Saint Steban (2007/01/03)
+ *   
+**/
+editAreaLoader.load_syntax["ruby"] = {
+	'COMMENT_SINGLE' : {1 : '#'}
+	,'COMMENT_MULTI' : {}
+	,'QUOTEMARKS' : {1: "'", 2: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : true
+	,'KEYWORDS' : {
+		'reserved' : [
+			'alias', 'and', 'BEGIN', 'begin', 'break', 'case', 'class', 'def', 'defined', 'do', 'else',
+			'elsif', 'END', 'end', 'ensure', 'false', 'for', 'if', 
+			'in', 'module', 'next', 'not', 'or', 'redo', 'rescue', 'retry',
+			'return', 'self', 'super', 'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield'
+		]
+	}
+	,'OPERATORS' :[
+		'+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'REGEXPS' : {
+		'constants' : {
+			'search' : '()([A-Z]\\w*)()'
+			,'class' : 'constants'
+			,'modifiers' : 'g'
+			,'execute' : 'before' 
+		}
+		,'variables' : {
+			'search' : '()([\$\@\%]+\\w+)()'
+			,'class' : 'variables'
+			,'modifiers' : 'g'
+			,'execute' : 'before' 
+		}
+		,'numbers' : {
+			'search' : '()(-?[0-9]+)()'
+			,'class' : 'numbers'
+			,'modifiers' : 'g'
+			,'execute' : 'before' 
+		}
+		,'symbols' : {
+			'search' : '()(:\\w+)()'
+			,'class' : 'symbols'
+			,'modifiers' : 'g'
+			,'execute' : 'before'
+		}
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #660066;'
+		,'KEYWORDS' : {
+			'reserved' : 'font-weight: bold; color: #0000FF;'
+			}
+		,'OPERATORS' : 'color: #993300;'
+		,'DELIMITERS' : 'color: #993300;'
+		,'REGEXPS' : {
+			'variables' : 'color: #E0BD54;'
+			,'numbers' : 'color: green;'
+			,'constants' : 'color: #00AA00;'
+			,'symbols' : 'color: #879EFA;'
+		}	
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/sql.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/sql.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/sql.js
new file mode 100644
index 0000000..8ef1b36
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/sql.js
@@ -0,0 +1,55 @@
+editAreaLoader.load_syntax["sql"] = {
+	'COMMENT_SINGLE' : {1 : '--'}
+	,'COMMENT_MULTI' : {'/*' : '*/'}
+	,'QUOTEMARKS' : {1: "'", 2: '"', 3: '`'}
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+		'statements' : [
+			'select', 'SELECT', 'where', 'order', 'by',
+			'insert', 'from', 'update', 'grant', 'left join', 'right join', 
+            'union', 'group', 'having', 'limit', 'alter', 'LIKE','IN','CASE'
+		]
+		,'reserved' : [
+			'null', 'enum', 'int', 'boolean', 'add', 'varchar'
+			
+		]
+		,'functions' : [
+   'ABS','ACOS','ADDDATE','ADDTIME','AES_DECRYPT','AES_ENCRYPT','ASCII','ASIN','ATAN2 ATAN','ATAN','AVG','BENCHMARK','DISTINCT','BIN','BIT_AND','BIT_COUNT','BIT_LENGTH','BIT_OR','BIT_XOR','CAST','CEILING CEIL','CHAR_LENGTH','CHAR',
+'CHARACTER_LENGTH','CHARSET','COALESCE','COERCIBILITY','COLLATION','COMPRESS','CONCAT_WS','CONCAT','CONNECTION_ID','CONV','CONVERT_TZ','COS','COT','COUNT','CRC32','CURDATE','CURRENT_DATE','CURRENT_TIME','CURRENT_TIMESTAMP','CURRENT_USER','CURTIME','DATABASE','DATE_ADD','DATE_FORMAT','DATE_SUB','DATE','DATEDIFF','DAY','DAYNAME','DAYOFMONTH',
+'DAYOFWEEK','DAYOFYEAR','DECODE','DEFAULT','DEGREES','DES_DECRYPT','DES_ENCRYPT','ELT','ENCODE','ENCRYPT','EXP','EXPORT_SET','EXTRACT','FIELD','FIND_IN_SET','FLOOR','FORMAT','FOUND_ROWS','FROM_DAYS','FROM_UNIXTIME','GET_FORMAT','GET_LOCK','GREATEST','GROUP_CONCAT','HEX','HOUR','IF','IFNULL','INET_ATON','INET_NTOA',
+'INSERT','INSTR','INTERVAL','IS_FREE_LOCK','IS_USED_LOCK','ISNULL','LAST_DAY','LAST_INSERT_ID','LCASE','LEAST','LEFT','LENGTH','LN','LOAD_FILE','LOCALTIME','LOCALTIMESTAMP','LOCATE','LOG10','LOG2','LOG','LOWER','LPAD','LTRIM','MAKE_SET','MAKEDATE','MAKETIME','MASTER_POS_WAIT','MAX','MD5','MICROSECOND',
+'MID','MIN','MINUTE','MOD','MONTH','MONTHNAME','NOW','NULLIF','OCT','OCTET_LENGTH','OLD_PASSWORD','ORD','PASSWORD','PERIOD_ADD','PERIOD_DIFF','PI','POSITION','POW','POWER','PROCEDURE ANALYSE','QUARTER','QUOTE','RADIANS','RAND','RELEASE_LOCK','REPEAT','REPLACE','REVERSE','RIGHT','ROUND',
+'RPAD','RTRIM','SEC_TO_TIME','SECOND','SESSION_USER','SHA1','SHA','SIGN','SIN','SOUNDEX','SOUNDS LIKE','SPACE','SQRT','STD','STDDEV','STR_TO_DATE','STRCMP','SUBDATE','SUBSTRING_INDEX','SUBSTRING','SUBSTR','SUBTIME','SUM','SYSDATE','SYSTEM_USER','TAN','TIME_FORMAT','TIME_TO_SEC','TIME','TIMEDIFF',
+'TIMESTAMP','TO_DAYS','TRIM','TRUNCATE','UCASE','UNCOMPRESS','UNCOMPRESSED_LENGTH','UNHEX','UNIX_TIMESTAMP','UPPER','USER','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','UUID','VALUES','VARIANCE','WEEK','WEEKDAY','WEEKOFYEAR','YEAR','YEARWEEK'
+		]
+	}
+	,'OPERATORS' :[
+     'AND','&&','BETWEEN','BINARY','&','|','^','/','DIV','<=>','=','>=','>','<<','>>','IS','NULL','<=','<','-','%','!=','<>','!','||','OR','+','REGEXP','RLIKE','XOR','~','*'
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'REGEXPS' : {
+		// highlight all variables (@...)
+		'variables' : {
+			'search' : '()(\\@\\w+)()'
+			,'class' : 'variables'
+			,'modifiers' : 'g'
+			,'execute' : 'before' // before or after
+		}
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #879EFA;'
+		,'KEYWORDS' : {
+			'reserved' : 'color: #48BDDF;'
+			,'functions' : 'color: #0040FD;'
+			,'statements' : 'color: #60CA00;'
+			}
+		,'OPERATORS' : 'color: #FF00FF;'
+		,'DELIMITERS' : 'color: #2B60FF;'
+		,'REGEXPS' : {
+			'variables' : 'color: #E0BD54;'
+		}		
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/tsql.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/tsql.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/tsql.js
new file mode 100644
index 0000000..7e9057d
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/tsql.js
@@ -0,0 +1,87 @@
+editAreaLoader.load_syntax["tsql"] = {
+	'COMMENT_SINGLE' : {1 : '--'}
+	,'COMMENT_MULTI' : {'/*' : '*/'}
+	,'QUOTEMARKS' : {1: "'" }
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+		'statements': [
+		    'ADD', 'EXCEPT', 'PERCENT', 'EXEC', 'PLAN', 'ALTER', 'EXECUTE', 'PRECISION',
+		    'PRIMARY', 'EXIT', 'PRINT', 'AS', 'FETCH', 'PROC', 'ASC',
+		    'FILE', 'PROCEDURE', 'AUTHORIZATION', 'FILLFACTOR', 'PUBLIC', 'BACKUP', 'FOR', 'RAISERROR',
+		    'BEGIN', 'FOREIGN', 'READ', 'FREETEXT', 'READTEXT', 'BREAK', 'FREETEXTTABLE',
+		    'RECONFIGURE', 'BROWSE', 'FROM', 'REFERENCES', 'BULK', 'FULL', 'REPLICATION', 'BY',
+		    'FUNCTION', 'RESTORE', 'CASCADE', 'GOTO', 'RESTRICT', 'CASE', 'GRANT', 'RETURN',
+		    'CHECK', 'GROUP', 'REVOKE', 'CHECKPOINT', 'HAVING', 'RIGHT', 'CLOSE', 'HOLDLOCK', 'ROLLBACK',
+		    'CLUSTERED', 'IDENTITY', 'ROWCOUNT', 'IDENTITY_INSERT', 'ROWGUIDCOL', 'COLLATE', 
+		    'IDENTITYCOL', 'RULE', 'COLUMN', 'IF', 'SAVE', 'COMMIT', 'SCHEMA', 'COMPUTE', 'INDEX',
+		    'SELECT', 'CONSTRAINT', 'CONTAINS', 'INSERT', 'SET',
+		    'CONTAINSTABLE', 'INTERSECT', 'SETUSER', 'CONTINUE', 'INTO', 'SHUTDOWN', 'SOME',
+		    'CREATE', 'STATISTICS', 'KEY', 'CURRENT', 'KILL', 'TABLE',
+		    'CURRENT_DATE', 'TEXTSIZE', 'CURRENT_TIME', 'THEN', 'LINENO',
+		    'TO', 'LOAD', 'TOP', 'CURSOR', 'NATIONAL', 'TRAN', 'DATABASE', 'NOCHECK', 
+		    'TRANSACTION', 'DBCC', 'NONCLUSTERED', 'TRIGGER', 'DEALLOCATE', 'TRUNCATE',
+		    'DECLARE', 'TSEQUAL', 'DEFAULT', 'UNION', 'DELETE', 'OF', 'UNIQUE',
+		    'DENY', 'OFF', 'UPDATE', 'DESC', 'OFFSETS', 'UPDATETEXT', 'DISK', 'ON', 'USE', 'DISTINCT', 'OPEN',
+		    'DISTRIBUTED', 'OPENDATASOURCE', 'VALUES', 'DOUBLE', 'OPENQUERY', 'VARYING', 'DROP', 
+		    'OPENROWSET', 'VIEW', 'DUMMY', 'OPENXML', 'WAITFOR', 'DUMP', 'OPTION', 'WHEN', 'ELSE', 'WHERE',
+		    'END', 'ORDER', 'WHILE', 'ERRLVL', 'WITH', 'ESCAPE', 'OVER', 'WRITETEXT'
+		],
+		'functions': [
+		    'COALESCE', 'SESSION_USER', 'CONVERT', 'SYSTEM_USER', 'CURRENT_TIMESTAMP', 'CURRENT_USER', 'NULLIF', 'USER',
+			'AVG', 'MIN', 'CHECKSUM', 'SUM', 'CHECKSUM_AGG', 'STDEV', 'COUNT', 'STDEVP', 'COUNT_BIG', 'VAR', 'GROUPING', 'VARP', 'MAX',
+			'@@DATEFIRST', '@@OPTIONS', '@@DBTS', '@@REMSERVER', '@@LANGID', '@@SERVERNAME', '@@LANGUAGE', '@@SERVICENAME', '@@LOCK_TIMEOUT',
+			'@@SPID', '@@MAX_CONNECTIONS', '@@TEXTSIZE', '@@MAX_PRECISION', '@@VERSION', '@@NESTLEVEL',
+			'@@CURSOR_ROWS', 'CURSOR_STATUS', '@@FETCH_STATUS',
+			'DATEADD', 'DATEDIFF', 'DATENAME', 'DATEPART', 'DAY', 'GETDATE', 'GETUTCDATE', 'MONTH', 'YEAR',
+			'ABS', 'DEGREES', 'RAND', 'ACOS', 'EXP', 'ROUND', 'ASIN', 'FLOOR', 'SIGN', 'ATAN', 'LOG', 'SIN', 'ATN2', 'LOG10', 'SQRT',
+			'CEILING', 'PI ', 'SQUARE', 'COS', 'POWER', 'TAN', 'COT', 'RADIANS',
+			'@@PROCID', 'COL_LENGTH', 'FULLTEXTCATALOGPROPERTY', 'COL_NAME', 'FULLTEXTSERVICEPROPERTY', 'COLUMNPROPERTY', 'INDEX_COL',
+			'DATABASEPROPERTY', 'INDEXKEY_PROPERTY', 'DATABASEPROPERTYEX', 'INDEXPROPERTY', 'DB_ID', 'OBJECT_ID', 'DB_NAME', 'OBJECT_NAME',
+			'FILE_ID', 'OBJECTPROPERTY', 'OBJECTPROPERTYEX', 'FILE_NAME', 'SQL_VARIANT_PROPERTY', 'FILEGROUP_ID', 'FILEGROUP_NAME',
+			'FILEGROUPPROPERTY', 'TYPEPROPERTY', 'FILEPROPERTY',
+			'CURRENT_USER', 'SUSER_ID', 'SUSER_SID', 'IS_MEMBER', 'SUSER_SNAME', 'IS_SRVROLEMEMBER', 'PERMISSIONS', 'SYSTEM_USER',
+			'SUSER_NAME', 'USER_ID', 'SESSION_USER', 'USER_NAME', 'ASCII', 'SOUNDEX', 'PATINDEX', 'SPACE', 'CHARINDEX', 'QUOTENAME',
+			'STR', 'DIFFERENCE', 'REPLACE', 'STUFF', 'REPLICATE', 'SUBSTRING', 'LEN', 'REVERSE', 'UNICODE', 'LOWER',
+			'UPPER', 'LTRIM', 'RTRIM', 'APP_NAME', 'CAST', 'CONVERT', 'COALESCE', 'COLLATIONPROPERTY', 'COLUMNS_UPDATED', 'CURRENT_TIMESTAMP',
+			'CURRENT_USER', 'DATALENGTH', '@@ERROR', 'FORMATMESSAGE', 'GETANSINULL', 'HOST_ID', 'HOST_NAME', 'IDENT_CURRENT', 'IDENT_INCR',
+			'IDENT_SEED', '@@IDENTITY', 'ISDATE', 'ISNULL', 'ISNUMERIC', 'NEWID', 'NULLIF', 'PARSENAME', '@@ROWCOUNT',
+			'SCOPE_IDENTITY', 'SERVERPROPERTY', 'SESSIONPROPERTY', 'SESSION_USER', 'STATS_DATE', 'SYSTEM_USER', '@@TRANCOUNT', 'USER_NAME',
+			'@@CONNECTIONS', '@@PACK_RECEIVED', '@@CPU_BUSY', '@@PACK_SENT', '@@TIMETICKS', '@@IDLE', '@@TOTAL_ERRORS', '@@IO_BUSY', '@@TOTAL_READ',
+			'@@PACKET_ERRORS', '@@TOTAL_WRITE', 'PATINDEX', 'TEXTVALID', 'TEXTPTR'
+		],
+		'reserved': [
+			'RIGHT', 'INNER', 'IS', 'JOIN', 'CROSS', 'LEFT', 'NULL', 'OUTER'
+		]
+	}
+	,'OPERATORS' :[
+		'+', '-', '*', '/', '%', '=', '&' ,'|', '^', '>', '<', '>=', '<=', '<>', '!=', '!<', '!>', 'ALL', 'AND', 'ANY', 'BETWEEN', 'EXISTS', 'IN', 'LIKE', 'NOT', 'OR', '~'
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'REGEXPS' : {
+		// highlight all variables (@...)
+		'variables' : {
+			'search' : '()(\\@\\w+)()'
+			,'class' : 'variables'
+			,'modifiers' : 'g'
+			,'execute' : 'before' // before or after
+		}
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #008000;'
+		,'QUOTESMARKS': 'color: #FF0000;'
+		,'KEYWORDS' : {
+			'reserved' : 'color: #808080;'
+			,'functions' : 'color: #FF00FF;'
+			,'statements' : 'color: #0000FF;'
+			}
+		,'OPERATORS' : 'color: #808080;'
+		,'DELIMITERS' : 'color: #FF8000;'
+		,'REGEXPS' : {
+			'variables' : 'color: #E0BD54;'
+		}		
+	}
+};
+
+ 	  	 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/vb.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/vb.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/vb.js
new file mode 100644
index 0000000..73d58fc
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/vb.js
@@ -0,0 +1,52 @@
+editAreaLoader.load_syntax["vb"] = {
+	'COMMENT_SINGLE' : {1 : "'"}
+	,'COMMENT_MULTI' : { }
+	,'QUOTEMARKS' : {1: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+		'statements' : [
+	        'if','then','for','each','while','do','loop',
+            'else','elseif','select','case','end select',
+            'until','next','step','to','in','end if'
+		]
+		,'keywords' : [
+            'empty','isempty','nothing','null','isnull','true','false',
+            'set','call',
+            'sub','end sub','function','end function','exit','exit function',
+            'dim','Mod','In','private','public','shared','const'
+        ]
+
+		,'functions' : [
+			'CDate','Date','DateAdd','DateDiff','DatePart','DateSerial','DateValue','Day','FormatDateTime',
+            'Hour','IsDate','Minute','Month',
+            'MonthName','Now','Second','Time','Timer','TimeSerial','TimeValue','Weekday','WeekdayName ','Year',
+            'Asc','CBool','CByte','CCur','CDate','CDbl','Chr','CInt','CLng','CSng','CStr','Hex','Oct','FormatCurrency',
+            'FormatDateTime','FormatNumber','FormatPercent','Abs','Atn','Cos','Exp','Hex','Int','Fix','Log','Oct',
+            'Rnd','Sgn','Sin','Sqr','Tan',
+            'Array','Filter','IsArray','Join','LBound','Split','UBound',
+            'InStr','InStrRev','LCase','Left','Len','LTrim','RTrim','Trim','Mid','Replace','Right','Space','StrComp',
+            'String','StrReverse','UCase',
+            'CreateObject','Eval','GetLocale','GetObject','GetRef','InputBox','IsEmpty','IsNull','IsNumeric',
+            'IsObject','LoadPicture','MsgBox','RGB','Round','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion',
+            'ScriptEngineMinorVersion','SetLocale','TypeName','VarType'
+		]
+	}
+	,'OPERATORS' :[
+		'+', '-', '/', '*', '=', '<', '>', '!', '&'
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'STYLES' : {
+		'COMMENTS': 'color: #99CC00;'
+		,'QUOTESMARKS': 'color: #333399;'
+		,'KEYWORDS' : {
+			'keywords' : 'color: #3366FF;'
+			,'functions' : 'color: #0000FF;'
+			,'statements' : 'color: #3366FF;'
+			}
+		,'OPERATORS' : 'color: #FF0000;'
+		,'DELIMITERS' : 'color: #0000FF;'
+
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/xml.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/xml.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/xml.js
new file mode 100644
index 0000000..f8618f2
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/xml.js
@@ -0,0 +1,56 @@
+/*
+* last update: 2006-08-24
+*/
+
+editAreaLoader.load_syntax["xml"] = {
+	'COMMENT_SINGLE' : {}
+	,'COMMENT_MULTI' : {'<!--' : '-->'}
+	,'QUOTEMARKS' : {1: "'", 2: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+	}
+	,'OPERATORS' :[
+	]
+	,'DELIMITERS' :[
+	]
+	,'REGEXPS' : {
+		'xml' : {
+			'search' : '()(<\\?[^>]*?\\?>)()'
+			,'class' : 'xml'
+			,'modifiers' : 'g'
+			,'execute' : 'before' // before or after
+		}
+		,'cdatas' : {
+			'search' : '()(<!\\[CDATA\\[.*?\\]\\]>)()'
+			,'class' : 'cdata'
+			,'modifiers' : 'g'
+			,'execute' : 'before' // before or after
+		}
+		,'tags' : {
+			'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
+			,'class' : 'tags'
+			,'modifiers' : 'gi'
+			,'execute' : 'before' // before or after
+		}
+		,'attributes' : {
+			'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
+			,'class' : 'attributes'
+			,'modifiers' : 'g'
+			,'execute' : 'before' // before or after
+		}
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'KEYWORDS' : {
+			}
+		,'OPERATORS' : 'color: #E775F0;'
+		,'DELIMITERS' : ''
+		,'REGEXPS' : {
+			'attributes': 'color: #B1AC41;'
+			,'tags': 'color: #E62253;'
+			,'xml': 'color: #8DCFB5;'
+			,'cdata': 'color: #50B020;'
+		}	
+	}		
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/regexp.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/regexp.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/regexp.js
new file mode 100644
index 0000000..907063a
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/regexp.js
@@ -0,0 +1,139 @@
+	/*EditArea.prototype.comment_or_quotes= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
+		new_class="quotes";
+		if(v6 && v6 != undefined && v6!="")
+			new_class="comments";
+		return "µ__"+ new_class +"__µ"+v0+"µ_END_µ";
+
+	};*/
+	
+/*	EditArea.prototype.htmlTag= function(v0, v1, v2, v3, v4,v5,v6,v7,v8,v9, v10){
+		res="<span class=htmlTag>"+v2;
+		alert("v2: "+v2+" v3: "+v3);
+		tab=v3.split("=");
+		attributes="";
+		if(tab.length>1){
+			attributes="<span class=attribute>"+tab[0]+"</span>=";
+			for(i=1; i<tab.length-1; i++){
+				cut=tab[i].lastIndexOf("&nbsp;");				
+				attributes+="<span class=attributeVal>"+tab[i].substr(0,cut)+"</span>";
+				attributes+="<span class=attribute>"+tab[i].substr(cut)+"</span>=";
+			}
+			attributes+="<span class=attributeVal>"+tab[tab.length-1]+"</span>";
+		}		
+		res+=attributes+v5+"</span>";
+		return res;		
+	};*/
+	
+	// determine if the selected text if a comment or a quoted text
+	EditArea.prototype.comment_or_quote= function(){
+		var new_class="", close_tag="", sy, arg, i;
+		sy 		= parent.editAreaLoader.syntax[editArea.current_code_lang];
+		arg		= EditArea.prototype.comment_or_quote.arguments[0];
+		
+		for( i in sy["quotes"] ){
+			if(arg.indexOf(i)==0){
+				new_class="quotesmarks";
+				close_tag=sy["quotes"][i];
+			}
+		}
+		if(new_class.length==0)
+		{
+			for(var i in sy["comments"]){
+				if( arg.indexOf(i)==0 ){
+					new_class="comments";
+					close_tag=sy["comments"][i];
+				}
+			}
+		}
+		// for single line comment the \n must not be included in the span tags
+		if(close_tag=="\n"){
+			return "µ__"+ new_class +"__µ"+ arg.replace(/(\r?\n)?$/m, "µ_END_µ$1");
+		}else{
+			// the closing tag must be set only if the comment or quotes is closed 
+			reg= new RegExp(parent.editAreaLoader.get_escaped_regexp(close_tag)+"$", "m");
+			if( arg.search(reg)!=-1 )
+				return "µ__"+ new_class +"__µ"+ arg +"µ_END_µ";
+			else
+				return "µ__"+ new_class +"__µ"+ arg;
+		}
+	};
+	
+/*
+	// apply special tags arround text to highlight
+	EditArea.prototype.custom_highlight= function(){
+		res= EditArea.prototype.custom_highlight.arguments[1]+"µ__"+ editArea.reg_exp_span_tag +"__µ" + EditArea.prototype.custom_highlight.arguments[2]+"µ_END_µ";
+		if(EditArea.prototype.custom_highlight.arguments.length>5)
+			res+= EditArea.prototype.custom_highlight.arguments[ EditArea.prototype.custom_highlight.arguments.length-3 ];
+		return res;
+	};
+	*/
+	
+	// return identication that allow to know if revalidating only the text line won't make the syntax go mad
+	EditArea.prototype.get_syntax_trace= function(text){
+		if(this.settings["syntax"].length>0 && parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"])
+			return text.replace(parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"], "$3");
+	};
+	
+		
+	EditArea.prototype.colorize_text= function(text){
+		//text="<div id='result' class='area' style='position: relative; z-index: 4; height: 500px; overflow: scroll;border: solid black 1px;'> ";
+	  /*		
+		if(this.isOpera){	
+			// opera can't use pre element tabulation cause a tab=6 chars in the textarea and 8 chars in the pre 
+			text= this.replace_tab(text);
+		}*/
+		
+		text= " "+text; // for easier regExp
+		
+		/*if(this.do_html_tags)
+			text= text.replace(/(<[a-z]+ [^>]*>)/gi, '[__htmlTag__]$1[_END_]');*/
+		if(this.settings["syntax"].length>0)
+			text= this.apply_syntax(text, this.settings["syntax"]);
+
+		// remove the first space added
+		return text.substr(1).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/µ_END_µ/g,"</span>").replace(/µ__([a-zA-Z0-9]+)__µ/g,"<span class='$1'>");
+	};
+	
+	EditArea.prototype.apply_syntax= function(text, lang){
+		var sy;
+		this.current_code_lang=lang;
+	
+		if(!parent.editAreaLoader.syntax[lang])
+			return text;
+			
+		sy = parent.editAreaLoader.syntax[lang];
+		if(sy["custom_regexp"]['before']){
+			for( var i in sy["custom_regexp"]['before']){
+				var convert="$1µ__"+ sy["custom_regexp"]['before'][i]['class'] +"__µ$2µ_END_µ$3";
+				text= text.replace(sy["custom_regexp"]['before'][i]['regexp'], convert);
+			}
+		}
+		
+		if(sy["comment_or_quote_reg_exp"]){
+			//setTimeout("_$('debug_area').value=editArea.comment_or_quote_reg_exp;", 500);
+			text= text.replace(sy["comment_or_quote_reg_exp"], this.comment_or_quote);
+		}
+		
+		if(sy["keywords_reg_exp"]){
+			for(var i in sy["keywords_reg_exp"]){	
+				text= text.replace(sy["keywords_reg_exp"][i], 'µ__'+i+'__µ$2µ_END_µ');
+			}			
+		}
+		
+		if(sy["delimiters_reg_exp"]){
+			text= text.replace(sy["delimiters_reg_exp"], 'µ__delimiters__µ$1µ_END_µ');
+		}		
+		
+		if(sy["operators_reg_exp"]){
+			text= text.replace(sy["operators_reg_exp"], 'µ__operators__µ$1µ_END_µ');
+		}
+		
+		if(sy["custom_regexp"]['after']){
+			for( var i in sy["custom_regexp"]['after']){
+				var convert="$1µ__"+ sy["custom_regexp"]['after'][i]['class'] +"__µ$2µ_END_µ$3";
+				text= text.replace(sy["custom_regexp"]['after'][i]['regexp'], convert);			
+			}
+		}
+			
+		return text;
+	};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/resize_area.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/resize_area.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/resize_area.js
new file mode 100644
index 0000000..191e8ce
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/resize_area.js
@@ -0,0 +1,73 @@
+	
+	EditAreaLoader.prototype.start_resize_area= function(){
+		var d=document,a,div,width,height,father;
+		
+		d.onmouseup= editAreaLoader.end_resize_area;
+		d.onmousemove= editAreaLoader.resize_area;
+		editAreaLoader.toggle(editAreaLoader.resize["id"]);		
+		
+		a	= editAreas[editAreaLoader.resize["id"]]["textarea"];
+		div	= d.getElementById("edit_area_resize");
+		if(!div){
+			div= d.createElement("div");
+			div.id="edit_area_resize";
+			div.style.border="dashed #888888 1px";
+		}
+		width	= a.offsetWidth -2;
+		height	= a.offsetHeight -2;
+		
+		div.style.display	= "block";
+		div.style.width		= width+"px";
+		div.style.height	= height+"px";
+		father= a.parentNode;
+		father.insertBefore(div, a);
+		
+		a.style.display="none";
+				
+		editAreaLoader.resize["start_top"]= calculeOffsetTop(div);
+		editAreaLoader.resize["start_left"]= calculeOffsetLeft(div);		
+	};
+	
+	EditAreaLoader.prototype.end_resize_area= function(e){
+		var d=document,div,a,width,height;
+		
+		d.onmouseup="";
+		d.onmousemove="";		
+		
+		div		= d.getElementById("edit_area_resize");		
+		a= editAreas[editAreaLoader.resize["id"]]["textarea"];
+		width	= Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_width"], div.offsetWidth-4);
+		height	= Math.max(editAreas[editAreaLoader.resize["id"]]["settings"]["min_height"], div.offsetHeight-4);
+		if(editAreaLoader.isIE==6){
+			width-=2;
+			height-=2;	
+		}
+		a.style.width		= width+"px";
+		a.style.height		= height+"px";
+		div.style.display	= "none";
+		a.style.display		= "inline";
+		a.selectionStart	= editAreaLoader.resize["selectionStart"];
+		a.selectionEnd		= editAreaLoader.resize["selectionEnd"];
+		editAreaLoader.toggle(editAreaLoader.resize["id"]);
+		
+		return false;
+	};
+	
+	EditAreaLoader.prototype.resize_area= function(e){		
+		var allow,newHeight,newWidth;
+		allow	= editAreas[editAreaLoader.resize["id"]]["settings"]["allow_resize"];
+		if(allow=="both" || allow=="y")
+		{
+			newHeight	= Math.max(20, getMouseY(e)- editAreaLoader.resize["start_top"]);
+			document.getElementById("edit_area_resize").style.height= newHeight+"px";
+		}
+		if(allow=="both" || allow=="x")
+		{
+			newWidth= Math.max(20, getMouseX(e)- editAreaLoader.resize["start_left"]);
+			document.getElementById("edit_area_resize").style.width= newWidth+"px";
+		}
+		
+		return false;
+	};
+	
+	editAreaLoader.waiting_loading["resize_area.js"]= "loaded";

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/search_replace.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/search_replace.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/search_replace.js
new file mode 100644
index 0000000..bd266b3
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/search_replace.js
@@ -0,0 +1,174 @@
+	EditArea.prototype.show_search = function(){
+		if(_$("area_search_replace").style.visibility=="visible"){
+			this.hidden_search();
+		}else{
+			this.open_inline_popup("area_search_replace");
+			var text= this.area_get_selection();
+			var search= text.split("\n")[0];
+			_$("area_search").value= search;
+			_$("area_search").focus();
+		}
+	};
+	
+	EditArea.prototype.hidden_search= function(){
+		/*_$("area_search_replace").style.visibility="hidden";
+		this.textarea.focus();
+		var icon= _$("search");
+		setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );*/
+		this.close_inline_popup("area_search_replace");
+	};
+	
+	EditArea.prototype.area_search= function(mode){
+		
+		if(!mode)
+			mode="search";
+		_$("area_search_msg").innerHTML="";		
+		var search=_$("area_search").value;		
+		
+		this.textarea.focus();		
+		this.textarea.textareaFocused=true;
+		
+		var infos= this.get_selection_infos();	
+		var start= infos["selectionStart"];
+		var pos=-1;
+		var pos_begin=-1;
+		var length=search.length;
+		
+		if(_$("area_search_replace").style.visibility!="visible"){
+			this.show_search();
+			return;
+		}
+		if(search.length==0){
+			_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
+			return;
+		}
+		// advance to the next occurence if no text selected
+		if(mode!="replace" ){
+			if(_$("area_search_reg_exp").checked)
+				start++;
+			else
+				start+= search.length;
+		}
+		
+		//search
+		if(_$("area_search_reg_exp").checked){
+			// regexp search
+			var opt="m";
+			if(!_$("area_search_match_case").checked)
+				opt+="i";
+			var reg= new RegExp(search, opt);
+			pos= infos["full_text"].substr(start).search(reg);
+			pos_begin= infos["full_text"].search(reg);
+			if(pos!=-1){
+				pos+=start;
+				length=infos["full_text"].substr(start).match(reg)[0].length;
+			}else if(pos_begin!=-1){
+				length=infos["full_text"].match(reg)[0].length;
+			}
+		}else{
+			if(_$("area_search_match_case").checked){
+				pos= infos["full_text"].indexOf(search, start); 
+				pos_begin= infos["full_text"].indexOf(search); 
+			}else{
+				pos= infos["full_text"].toLowerCase().indexOf(search.toLowerCase(), start); 
+				pos_begin= infos["full_text"].toLowerCase().indexOf(search.toLowerCase()); 
+			}		
+		}
+		
+		// interpret result
+		if(pos==-1 && pos_begin==-1){
+			_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
+			return;
+		}else if(pos==-1 && pos_begin != -1){
+			begin= pos_begin;
+			_$("area_search_msg").innerHTML=this.get_translation("restart_search_at_begin");
+		}else
+			begin= pos;
+		
+		//_$("area_search_msg").innerHTML+="<strong>"+search+"</strong> found at "+begin+" strat at "+start+" pos "+pos+" curs"+ infos["indexOfCursor"]+".";
+		if(mode=="replace" && pos==infos["indexOfCursor"]){
+			var replace= _$("area_replace").value;
+			var new_text="";			
+			if(_$("area_search_reg_exp").checked){
+				var opt="m";
+				if(!_$("area_search_match_case").checked)
+					opt+="i";
+				var reg= new RegExp(search, opt);
+				new_text= infos["full_text"].substr(0, begin) + infos["full_text"].substr(start).replace(reg, replace);
+			}else{
+				new_text= infos["full_text"].substr(0, begin) + replace + infos["full_text"].substr(begin + length);
+			}
+			this.textarea.value=new_text;
+			this.area_select(begin, length);
+			this.area_search();
+		}else
+			this.area_select(begin, length);
+	};
+	
+	
+	
+	
+	EditArea.prototype.area_replace= function(){		
+		this.area_search("replace");
+	};
+	
+	EditArea.prototype.area_replace_all= function(){
+	/*	this.area_select(0, 0);
+		_$("area_search_msg").innerHTML="";
+		while(_$("area_search_msg").innerHTML==""){
+			this.area_replace();
+		}*/
+	
+		var base_text= this.textarea.value;
+		var search= _$("area_search").value;		
+		var replace= _$("area_replace").value;
+		if(search.length==0){
+			_$("area_search_msg").innerHTML=this.get_translation("search_field_empty");
+			return ;
+		}
+		
+		var new_text="";
+		var nb_change=0;
+		if(_$("area_search_reg_exp").checked){
+			// regExp
+			var opt="mg";
+			if(!_$("area_search_match_case").checked)
+				opt+="i";
+			var reg= new RegExp(search, opt);
+			nb_change= infos["full_text"].match(reg).length;
+			new_text= infos["full_text"].replace(reg, replace);
+			
+		}else{
+			
+			if(_$("area_search_match_case").checked){
+				var tmp_tab=base_text.split(search);
+				nb_change= tmp_tab.length -1 ;
+				new_text= tmp_tab.join(replace);
+			}else{
+				// case insensitive
+				var lower_value=base_text.toLowerCase();
+				var lower_search=search.toLowerCase();
+				
+				var start=0;
+				var pos= lower_value.indexOf(lower_search);				
+				while(pos!=-1){
+					nb_change++;
+					new_text+= this.textarea.value.substring(start , pos)+replace;
+					start=pos+ search.length;
+					pos= lower_value.indexOf(lower_search, pos+1);
+				}
+				new_text+= this.textarea.value.substring(start);				
+			}
+		}			
+		if(new_text==base_text){
+			_$("area_search_msg").innerHTML="<strong>"+search+"</strong> "+this.get_translation("not_found");
+		}else{
+			this.textarea.value= new_text;
+			_$("area_search_msg").innerHTML="<strong>"+nb_change+"</strong> "+this.get_translation("occurrence_replaced");
+			// firefox and opera doesn't manage with the focus if it's done directly
+			//editArea.textarea.focus();editArea.textarea.textareaFocused=true;
+			setTimeout("editArea.textarea.focus();editArea.textarea.textareaFocused=true;", 100);
+		}
+		
+		
+	};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/template.html
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/template.html b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/template.html
new file mode 100644
index 0000000..cf626d6
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/template.html
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. 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.
+ -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
+<head>
+	<title>EditArea</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
+	[__CSSRULES__]
+	[__JSCODE__]
+</head>
+<body>
+	<div id='editor'>
+		<div class='area_toolbar' id='toolbar_1'>[__TOOLBAR__]</div>
+		<div class='area_toolbar' id='tab_browsing_area'><ul id='tab_browsing_list' class='menu'> <li> </li> </ul></div>
+		<div id='result'>
+			<div id='no_file_selected'></div>
+			<div id='container'>
+				<div id='cursor_pos' class='edit_area_cursor'>&nbsp;</div>
+				<div id='end_bracket' class='edit_area_cursor'>&nbsp;</div>
+				<div id='selection_field'></div>
+				<div id='line_number' selec='none'></div>
+				<div id='content_highlight'></div>
+				<div id='test_font_size'></div>
+				<div id='selection_field_text'></div>
+				<textarea id='textarea' wrap='off' onchange='editArea.execCommand("onchange");' onfocus='javascript:editArea.textareaFocused=true;' onblur='javascript:editArea.textareaFocused=false;'>
+				</textarea>
+				
+			</div>
+		</div>
+		<div class='area_toolbar' id='toolbar_2'>
+			<table class='statusbar' cellspacing='0' cellpadding='0'>
+				<tr>
+					<td class='total' selec='none'>{$position}:</td>
+					<td class='infos' selec='none'>
+						{$line_abbr} <span  id='linePos'>0</span>, {$char_abbr} <span id='currPos'>0</span>
+					</td>
+					<td class='total' selec='none'>{$total}:</td>
+					<td class='infos' selec='none'>
+						{$line_abbr} <span id='nbLine'>0</span>, {$char_abbr} <span id='nbChar'>0</span>
+					</td>
+					<td class='resize'>
+						<span id='resize_area'><img src='[__BASEURL__]images/statusbar_resize.gif' alt='resize' selec='none'></span>
+					</td>
+				</tr>
+			</table>
+		</div>
+	</div>
+	<div id='processing'>
+		<div id='processing_text'>
+			{$processing}
+		</div>
+	</div>
+
+	<div id='area_search_replace' class='editarea_popup'>
+		<table cellspacing='2' cellpadding='0' style='width: 100%'>
+			<tr>
+				<td selec='none'>{$search}</td>
+				<td><input type='text' id='area_search' /></td>
+				<td id='close_area_search_replace'>
+					<a onclick='Javascript:editArea.execCommand("hidden_search")'><img selec='none' src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a><br />
+			</tr><tr>
+				<td selec='none'>{$replace}</td>
+				<td><input type='text' id='area_replace' /></td>
+				<td><img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["frame_"+editArea.id]);'  src='[__BASEURL__]images/move.gif' alt='{$move_popup}' title='{$move_popup}' /></td>
+			</tr>
+		</table>
+		<div class='button'>
+			<input type='checkbox' id='area_search_match_case' /><label for='area_search_match_case' selec='none'>{$match_case}</label>
+			<input type='checkbox' id='area_search_reg_exp' /><label for='area_search_reg_exp' selec='none'>{$reg_exp}</label>
+			<br />
+			<a onclick='Javascript:editArea.execCommand("area_search")' selec='none'>{$find_next}</a>
+			<a onclick='Javascript:editArea.execCommand("area_replace")' selec='none'>{$replace}</a>
+			<a onclick='Javascript:editArea.execCommand("area_replace_all")' selec='none'>{$replace_all}</a><br />
+		</div>
+		<div id='area_search_msg' selec='none'></div>
+	</div>
+	<div id='edit_area_help' class='editarea_popup'>
+		<div class='close_popup'>
+			<a onclick='Javascript:editArea.execCommand("close_all_inline_popup")'><img src='[__BASEURL__]images/close.gif' alt='{$close_popup}' title='{$close_popup}' /></a>
+		</div>
+		<div><h2>Editarea [__EA_VERSION__]</h2><br />
+			<h3>{$shortcuts}:</h3>
+				{$tab}: {$add_tab}<br />
+				{$shift}+{$tab}: {$remove_tab}<br />
+				{$ctrl}+f: {$search_command}<br />
+				{$ctrl}+r: {$replace_command}<br />
+				{$ctrl}+h: {$highlight}<br />
+				{$ctrl}+g: {$go_to_line}<br />
+				{$ctrl}+z: {$undo}<br />
+				{$ctrl}+y: {$redo}<br />
+				{$ctrl}+e: {$help}<br />
+				{$ctrl}+q, {$esc}: {$close_popup}<br />
+				{$accesskey} E: {$toggle}<br />
+			<br />
+			<em>{$about_notice}</em>
+			<br /><div class='copyright'>&copy; Christophe Dolivet 2007-2009</div>
+		</div>
+	</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_apache.txt
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_apache.txt b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_apache.txt
new file mode 100644
index 0000000..c7ef5e6
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_apache.txt
@@ -0,0 +1,7 @@
+Copyright 2008 Christophe Dolivet
+
+Licensed 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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_bsd.txt
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_bsd.txt b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_bsd.txt
new file mode 100644
index 0000000..f36bbe4
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_bsd.txt
@@ -0,0 +1,10 @@
+Copyright (c) 2008, Christophe Dolivet
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    * Neither the name of EditArea nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_lgpl.txt
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_lgpl.txt b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_lgpl.txt
new file mode 100644
index 0000000..8c177f8
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_lgpl.txt
@@ -0,0 +1,458 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/todo.txt
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/todo.txt b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/todo.txt
new file mode 100644
index 0000000..e583ef5
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/todo.txt
@@ -0,0 +1,71 @@
+FOR AUTOCOMPLETION:
+- work with tab editing (each one having it's context)
+- allow $ in prefix
+- allow to call user function for autocompletion
+- correctly display the box with window limits
+- enable "live" detection for new syntax keyword in the file
+- display a long description of the keyword (arround the box)
+
+DONE:
+- beeing able to prefix those word by key words (sort of namespace)
+- hide it on click
+- enable it for ctrl+space in the middle of a word
+
+/***** To do Needed *****/
+ 
+- Internet explorer: adding a caracter one the longest line as for consequence to make a scrollLeft=0 (in non wrapped mode)
+- Do optimisation for trying to only update the changed line in content_highlight
+- add real IE8 support (fix the tabulation width bug in IE8 that has now always the same width no matter the font-size and font-family in textarea but not in <pre>...)
+- change_callback is called one time at the beginning event if the text has not changed
+- check later init call with safari 3
+- improve callback documentation.
+
+/***** To do Optionnal*****/
+
+- possibility to switch on/off line numbers (allow to get more space)
+- amelioration of the scroll_to_view function for when there is several lines selected (center a little more the selected text)
+- improve opera 9 compatibility (very hard, need help for workaround) cf "Browser remarks".
+- optimize scroll_to_view for Opera?
+- add word wrap option for opera (bug with rendering mode of pre-wrap
+- possibility to add larger font sizes as options?
+
+/*** Bugs ***/
+
+- firefox: when using verdana (or other non-monospace fonts) switching the font size after font load has as results to sometimes give different render in textarea and in content_highlight (espacially near 11 and 12pt)
+- opera: (bloc word-wrap on opera) bug with cursor_end ()[] for a wrapped line (has wrong offsetLeft if rendered as multiline)
+- opera: (bloc word-wrap on opera) bug if first wraped character follow a <span> (or similar) on wrapped lines
+- when pressing "reset highlight" in IE the textarea scroll to the top (don't know how to fix this...)
+- (still pending?) when pressing "shift+page down"  and then "shift+page up" the top of the selection move where as it should be to the bottom of the selection to move (to fix it: must know in which direction the selection grow in "get_selection_infos")
+
+
+/*** Problems ***/
+
+
+/*** Highlight bugs ***/
+
+/*** Highlight problems ***/
+- only one language at the same time (no html and php in the same textarea. This should be possible, but there would have no optimization and be very very slow)
+
+
+/*** Global remarks ***/
+- editarea must be always visible, to hide it use the hide() function
+
+
+/*** Browser remarks/bugs ***/
+
+OPERA:
+- opera bug: pressing the " key is equals to pressing the scrolldown key (with french keyboard at least) (still in opera 9.6?)
+- currently disabled: scrollDown/Up function (due to the " key error) (still in oera 9.6?)
+- opera is very very slow with syntax highlight (regexp) (still in oera 9.6?)
+- opera doesn't manage correctly the width 100% for the iframe
+- it's possible to make scroll the window in fullscreen
+
+IE:
+- IE is far slower than firefox in highlight mode due to opacity filter
+- It's seems impossible to get the selection range when wrap mode is "soft" (and it's still very diffcult when wrap mode is on)
+- The syntax highlight mode is broken when text length is too long (~100000, 150000 chars) don't know why...
+
+FIREFOX:
+- the scrollHeight value for the textarea never decresease when lines are deleted (don't remember anything about this)
+
+


[20/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/change_log.txt
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/change_log.txt b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/change_log.txt
new file mode 100644
index 0000000..3d1425a
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/change_log.txt
@@ -0,0 +1,281 @@
+**** v 0.8.1.1 ****
+- Fix bug of frequent syntax desynchronisation when the first character of the textarea was highlighted
+- In unload now check that parent.editareaLoader still exists before calling it
+- Now consider that gecko and webkit based browser are valid browsers (but I won't test them all)
+
+**** v 0.8.1 ****
+- Improved speed of text highlighting process for huge file. Now we try to only insert or delete the changed caracters inside DOM text node instead of refreshing the whole area. (3 time faster in firefox)
+- Greatly improved speed of line-height management in word-wrap context 
+- Add java syntax (thanks to Dawson Goodell)
+- Use faster regexp for matching quoted strings
+- Bug fix: if a highlighted quote or comment string contains cariage return, editing text on one of the lines was causin a highlight desynchronisation
+- Bug fix: text war blur on Safari 3.2 (thanks to spellcoder)
+- Bug fix: there had several mistake with non-monospace font (thanks to spellcoder)
+- Bug fix: if show_line_colors was disabled and word wrap enable, highlighted text wasn't refreshed if a new line appears
+- Bug fix: in multi file edition, closing the last tab was throwing an error in Firefox and let the content of the textarea displayed
+- Browser bug detection: when using non-monospace font Firefox will sometime have strange behavior on text-width (the highlighted text-width in the background may change fron textarea one and simply can change after beeing updated); look likes a browser rendering bug
+
+**** v 0.8 ****
+- Word-wrap is now supported (except for opera...). The new init() option is 'word_wrap' to set to 'true' (default is false). A new button appears in the default toolbar (button_code: 'word_wrap' )
+- We can now clearly see the selected text
+- Add Internet explorer 8 support (but sadly I must use IE7 emulate mode in iframe due to a bug with tabulation width not beeing resized in IE's textarea) 
+- Add Safari 4 support
+- Add Chrome 2 support
+- Better support of Opera 9.6
+- Add Simplified Chinese translation "zh" (thanks to Abentian)
+- Add Bulgarian translation "bg" (thanks to Valentin Hristov)
+- Rename internal function $() by _$()
+- Delete EditArea.add_event() method (duplicate af editAreaLoader.add_event() method)
+- Do some code cleanup-up
+- Bug fix: highlight optimisation process was not working under IE (don't known how long it remain broken but must be since a long time)
+- Bug fix: EditArea.update_size sometimes uses undefined variable (fix this possibility and cleanup events)
+- Bug fix: Template.html was not valid XHTML
+- Bug fix: The checked attribute of the toogle button was not defined in xhtml syntax
+- Bug fix: If the editArea was loaded on a page related to a domain which was itself an iframe comming from another domain a JS error was thrown on load
+- Bug fix: When EditArea is used to replace a textarea which has style="visibility:hidden;", switching off EditArea would throw an error under IE 
+
+**** v 0.7.3 ****
+- Add Finnish transaltion (thanks to Janne Mäntyharju)
+- Add 'cursor_position' init() option for defining where the cursor should be when the editor is show on the first time ('auto' or 'begin'). This was like 'auto' before now this is like 'begin' by default
+- better add_style method (faster than old one) thanks to Spellcoder
+- Bug fix: fix bug with mootools 1.2
+- Bug fix: if page had no stylesheets when editarea load, it would generate an error
+
+**** v 0.7.2.3 ****
+- it's now released under both LGPL, Apache, BSD license (you can use the one you prefer)
+- add support for bonEcho browser
+
+**** v 0.7.2.2 ****
+- Fix bug regression introduced in 0.7.2 that make IE7 not working 
+- add Esperento translation (thanks to Olivier)  
+- add Coldfusion syntax (thanks to Max Leynov) 
+
+**** v 0.7.2.1 ****
+- fix bug for firefox rendering of highlighted lines that doesn't begin with a tab
+- support for browser with grandParadisio agent instead of firefox
+
+**** v 0.7.2 ****
+- add Chrome support
+- add show_line_colors init() option for enabling syntax color display and update on the currently edited line (disable the blue bar) (default to false)
+- Add Perl syntax definition file (thanks to Christoph Pinkel)
+- Bug fix: there allways was an horizontal scrollbar even if the content fit in the area.
+
+**** v 0.7.1.3 ****
+- Fix a bug introduced in Firefox 3.0.1 => the browser is no more able to render properly "pre" element with left padding...
+- Add Robots.txt (thanks to Pavle Ggardijan) and T-SQL syntax definition files (thanks to Miladin Joksic)
+
+**** v 0.7.1.2 ****
+- Fix a  bug on the full screen mode (regression added on 0.7.1.1)
+
+**** v 0.7.1.1 ****
+- Firefox 3 RC1 compatibility
+- Code size reduction: 120Ko => 107Ko for edit_area_full.js
+
+**** v 0.7.1 ****
+- released under both LGPL and Apache license (you can use the one you prefer)
+- it's now possible to get a readonly mode: 
+	* new EditAreaLoader.init()'s option: "is_editable": true/false
+	* Possibility to switch edition mode by using the execCommand function: editAreaLoader.execCommand('editor_id', 'set_editable', !editAreaLoader.execCommand('editor_id', 'is_editable'));
+- Added Ruby syntax (thanks to Patrice De Saint Steban)
+- Fix a bug where the textarea lose the focus under firefox for Mac
+- Minor other bug fixes
+
+**** v 0.7.0.2 ****
+- Fixed a bug with translation files containing non-latin caracters. Translations files must be in UTF-8.
+- Added Czech, Macedionian and Russian translations
+
+
+**** v 0.7.0.1 ****
+- in multiple file mode, it's now possible to cancel the 'EA_file_close_callback' function. if the callback return false, the edited file won't be closed 
+- bug fix: if no syntax was defined in the main init() function in multifile mode, the first time the text was not highlighted
+
+
+**** v 0.7 ****
+- it's now possible to edit multiple files into one instance of EditArea. This (sponsored by Jupiter) feature comes with: 
+	* new EditAreaLoader.init()'s option: "is_multi_files": true
+	* new editAreaLoader's functions: editAreaLoader.getCurrentFile(editArea_id), editAreaLoader.getFile(editArea_id, file_id), editAreaLoader.getAllFiles(editArea_id), editAreaLoader.openFile(editArea_id, file_infos), editAreaLoader.closeFile(editArea_id, file_id), editAreaLoader.setFileEditedMode(editArea_id, file_id, edited_mode)
+	* new callabacks: EA_file_switch_on_callback, EA_file_switch_off_callback, EA_file_close_callback
+- look likes Safari 3 is working with EditArea
+- add spanish translation (thanks Garito)
+- add slovak translation (thanks Gabriel Schwardy)
+- add SQL syntax definition file (thanks to Philippe Lewicki)
+- the syntax selection plugin has been integrated to editarea core and load only needed files (the plugins was loading all the possible syntax files...). Toolbar button name: "syntax_selection", comma separated available syntax list: "syntax_selection_allow"
+- add a 'compression' option in edit_area_compressor.php that allow to set where the code should be compressed or just packed (simple packed mode usefull for debugging)
+- the yellow area that indicate the current edited line is now blue
+- bug fix: parenthesis matching was not working correctly if there where an "<" between parenthesis
+
+**** v 0.6.7 ****
+- add a new plugin that allow the user to change the syntax definition in use. It adds a select in the toolbar. - plugin name to add to the plugin list: "syntax_selection". - plugin name to add to the toolbar list: "syntax_selection". - possible parameter to add to EditAreaLoader.init(): 
+"syntax_selection_allow": (String) define a list separated by "," of possible language syntax to use (eg: "php,js,python,html")
+- add Croatian translation (HR) (thanks to Ivan Vucica and Davor Cihlar)
+- add BASIC, Brainf*ck, C, C++ and Pascal syntax definition files (thanks to Ivan Vucica and Davor Cihlar)
+- add Iceweasel as a known working navigator (its a clone of Firefox)
+- improved the php syntax by highlighting the variables ($...)
+- reactivate gzip compression for IE7 (was desactivate for IE as it sometimes failed). (Let me know if you see that the load fails under IE7)
+- pressing "enter" while being in the search box now perform a search.
+- add Camino as a supported browser
+- bug fix: when clicking between the bottom toolbar and the textarea (when there is only few lines of text), the textarea didn't get the focus
+- bug fix: under IE the delete_instance() method was throwing an error
+- bug fix: if the textarea to convert in an EditArea was in a frame (or iframe) getting back from fullscreen to normal display was not restoring the correct settings to the frame containing the textarea.
+- bug fix (at least I hope): in IE if the textarea to convert in an EditArea was in a frame, resizing the frame was not correctly resizing the editor if it was in fullscreen.
+- bug fix: in Opera the selectionned line was not rendered correctly if containing \t caracters (bug introduced in one of the latest version...)
+- bug fix: "altgr+f" was openning the searchbox and avoid to write "[" and "]" in croatian keyboards.
+- bug fix: in Firefox "ctrl+tab" was inserting a tabulation while switching active tab (window)
+
+Note: v 0.6.5 and v 0.6.6 have been private release (change log is regrouped in v 0.6.7)
+
+**** v 0.6.4 ****
+- add replace_tab_by_spaces init() option which allow to replace all tabulation caracters typped in the text by a given number of spaces
+- add min_width and min_height init() option for the minimum size in pixel for the editor
+- add dutch translation files (NL) (thanks to Bart Bosma)
+- pressing Shift+Tab when no text is selected now delete the tabulation before the cursor (if a tabulation is present directly behing the cursor)
+- improve Python syntax (thanks to Andre Roberge)
+- bug fix: the fullpage plugin was not working correctly when the Editor was placed inside several divs that have positioning of there own
+- bug fix: one regexp used in edit_area_compressor.php was not compatible with latest PCRE version
+
+- fix the my_load and my_save functions of the 'exemple_full.html' page
+
+**** v 0.6.3.1 ****
+- regression: restore monospace as default font
+- add little improvements to the PHP compressor: allow to win 7 Ko on edit_area_full.js
+- add the version number in the about popup
+- bug fix: fix a regexp that was not compliant with newer version of PCRE
+- bug fix: fix some bug with the fullscreen mode (still not perfect in Opera)
+- bug fix: the close button of the help popup was not correctly translated
+- bug fix: when deleting an instance of editArea toggle_off was called even if the editArea was not displayed
+
+
+**** v 0.6.3 ****
+- allow to use non monospace font using the font_family init option. Firefox get smaller tabulation with non monospace fonts. IE doesn't change the tabulation width and Opera doesn't take this option into account... new default font-familly: 'verdana,monospace'
+- add fullscreen option in the toolbar and as an init() option. 
+- if the based textarea has a width (or height) in '%', EditArea will get the same '%' width (or  height), allowing EditArea to be resized in the same time than the window.
+- add many callback possibility: submit_callback, EA_load_callback, EA_unload_callback, EA_init_callback, EA_toggle_on_callback, EA_toggle_off_callback, EA_delete_callback (see documentation for more information)
+- bug fix: when toggling from textarea to editarea, IE was almost of the time not keeping the selection
+- bug fix: the brackets where still highlighted in red when being deleted
+- bug fix: brackets where not placed correctly when the line contains html entitites (&amp; &quot; etc....)
+
+
+**** v 0.6.2 ****
+WARNING => POSSIBLE BREAK COMPATIBILITY:
+- the load_callback now receive the 'id' of the textarea and no more a reference to the textarea. Developpers should use editAreaLoder methods rather than modfying directly the textarea.
+- the save_callback now receive the 'id' of the textarea as first argument, and it's content in the second argument.
+
+- EditArea is now compatible with javascript libraries like "prototype" (1.5) and "mootools" (release 83)
+- add two function to EditAreaLoader: hide(id) and show(id), that will allow to completly hide/restore both EditArea and normal textarea (usefull when EditArea is included in tabs).
+- it's no more possible to move the search window out of the frame.
+- gecko_spellcheck option is now set to false by default.
+- add a onchange_callback option (cf doc)
+- bug fix: in IE when syntax highlight was on, clicking on the textarea outside the range of the text, the click wasn't taking into account.
+- bug fix: references to the orginal textarea could be lost while using EditArea.
+- bug fix: using insertTags, getSelectionRange when editArea was not focused, IE failed
+- bug fix: main script could fail to load additionnal files in certain specific cases
+
+**** v 0.6.1 ****
+- compatiblity with Firefox 2 checked (was already compatible before).
+- compatiblity with IE7 checked (was already compatible before).
+- added possibility to call the editAreaLoader.init() function at any moment (no more limited to window load). Allow to replace an EditArea instance by a new one with other options.
+- added new gecko_spellcheck option, this enables you to disable/enable the FF 2.0 spellchecker.
+- added editAreaLoader.delete_instance(id) to allow to delete an EditArea instance
+- Fix a bug where "Ctrl+G" wasn't openning anymore the go to line prompt box.
+
+
+**** v 0.6.0.1 ****
+- add italian translation (thanks to Luciano Vernaschi)
+- add polish translation (thanks to Piotr Furman)
+- improve deutsh translation (thanks to Felix Riesterer)
+- add a little style improvement for buttons in search popup. they can't be splited in two line anymore
+- change color for tags in html and xml syntax due to visibility problems
+
+
+**** v 0.6 ****
+- add plugins possibilies
+- add editAreaLoader.insertTags function to allow easy tags insertion.
+- improve undo & redo functionnality
+- improve php compression: "edit_area_full.js" is 9 Ko smaller
+- improve syntax highlight regexp for quotted string. \\" or \\' (or \\\\", etc...) will now effectively close quotted string
+- add scrollbars to the popups when the popup's height is smaller than the editor's height
+- add japanese translation file (thanks to ISHITOYA Kentaro)
+- add possibility to add line-break in toolbar ("*")
+- disable gzip compression for IE (see: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496)
+- bug fix: when submitting form while editarea toggled off, the post value was equals to the old content of editarea and not the visible textarea
+- bug fix: under IE the editor was scrolling when pressing enter
+- bug fix: when insterting text on first line there was an highlight desynchronization
+
+
+
+**** v 0.5.3 ****
+WARNING => POSSIBLE BREAK COMPATIBILITY:
+- correct a spelling error: "toogle" become "toggle" in the whole code. This can perturb the initialization with the "allow_toggle" init parameters
+
+- add a case sensitive option in syntax definition files
+- improve html syntax definition file
+- add xml syntax definition file
+- add vb syntax definition file (thanks to Martin Gottlieb)
+- add some function that will allow dynamic EditArea content management, taking into account if the editor is displayed or toggled off (editAreaLodaer.getValue(), editAreaLoader.setValue(), editAreaLoader.getSelectedText(), editAreaLoader.setSelectedText(), editAreaLoader.getSelectionRange and editAreaLoader.setSelectionRange()). See "javascript functions" documentation for more informations
+- add a generic function (editaAreaLoader.execCommand) to allow to access EditArea's functions and datas
+- add portuguese translation file (thanks to Leonardo Sapucaia)
+- add compatibility to IE7 RC1
+
+
+**** v 0.5.2 ****
+- Opera improvement: text indentation is now working, and "go to line" is now working as in other browsers
+- Bug fix: It was still possible to select text in search popup
+- Bug fix: the "go to line" popup wasn't displaying anymore
+- There was still some hard codded word in the search field => added them to translation files
+- Bug fix: when multiple languages were used in the same page, there could have translation exchange between the different editors
+
+
+**** v 0.5.1 ****
+- Bug fix: the highlighted bracket was displayed on line 1 when it should be in line 2
+- Bug fix: the highlighted bracket were bad displayed in IE
+- Bug fix: their was some error in the optimisation process of the highlight mode
+- Bug fix: their was a bug when moving the search popup on IE
+
+**** v 0.5 ****
+- Now released under LGPL
+- Rewrite nearly from scratch
+- Added Danish translation file (thanks to Peter Klein)
+- Add python syntax
+
+
+WARNING => BREAK COMPATIBILITY:
+- the whole loading process (javascript include and init function call) is changed (but it's similar to the old version)
+- the languages translation files are not stored in the same variable
+
+
+IMPROVEMENTS:
+- The whole code is more stable
+- Allow several instance on the same page
+- Faster to load
+- The highlight process is more stable and there is nearly no more to use the "re sync" button
+- Add support of Opera 9 (even if its still not perfect)
+- Add the possibility to load a new compressed script of only 20Ko for the whole core script even if PHP is not installed
+- The textarea can be toggled to an EditArea on window load or later
+- The EditArea is loaded in a iframe => there is no more interaction with user css
+- Support the reset action of a form
+- Add support for "page up" & "page down" button
+- There is now a waiting screen when toggling on the highlight syntax (but it can't be an animated one, even gif are not animated due to CPU load)
+- All supported browsers can now change font-size
+
+BUG FIXES: 
+- Sometimes while using the "toggle editor" button to turn of the editor, the standard textarea was expanded to the full size of the textarea content.
+- When resizing the area the selection was lost
+- Allow translation for some forgotten hard-coded word (the "move" button for search popup, and "font size", and keys word in help panel).
+- It was possible to "drag" the buttons from the Search/Replace popup into the content of the textarea.
+- On first display (when the files are not in cache) or with xhtml doctype there is a display bug (the content of the textarea exceed of 4px)
+- when the cursor was at the beginning of the 1st line of the textarea, the caracter position was set to 0 instead of 1
+
+
+
+***v 0.4****
+- Increases syntax highlight proccess speed by 5 => allow a better live editing mode with syntax highlight.
+- Now syntax highlight has a real language syntax. Text is parsing with rules depending of the language definition file. (limitation: there is only one language on the same time > doesn't allow to parse html and php on the same page).
+- Syntax highlight can be easily extended with new code languages (there is currently: php, css, js, html).
+- Add german language file (thanks to Olaf Brambrink).
+- Fix some little bugs.
+
+
+
+
+***v0.33***
+- First release.

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/autocompletion.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/autocompletion.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/autocompletion.js
new file mode 100644
index 0000000..c5d646a
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/autocompletion.js
@@ -0,0 +1,491 @@
+/**
+ * Autocompletion class
+ * 
+ * An auto completion box appear while you're writing. It's possible to force it to appear with Ctrl+Space short cut
+ * 
+ * Loaded as a plugin inside editArea (everything made here could have been made in the plugin directory)
+ * But is definitly linked to syntax selection (no need to do 2 different files for color and auto complete for each syntax language)
+ * and add a too important feature that many people would miss if included as a plugin
+ * 
+ * - init param: autocompletion_start
+ * - Button name: "autocompletion"
+ */  
+
+var EditArea_autocompletion= {
+	
+	/**
+	 * Get called once this file is loaded (editArea still not initialized)
+	 *
+	 * @return nothing	 
+	 */	 	 	
+	init: function(){	
+		//	alert("test init: "+ this._someInternalFunction(2, 3));
+		
+		if(editArea.settings["autocompletion"])
+			this.enabled= true;
+		else
+			this.enabled= false;
+		this.current_word		= false;
+		this.shown				= false;
+		this.selectIndex		= -1;
+		this.forceDisplay		= false;
+		this.isInMiddleWord		= false;
+		this.autoSelectIfOneResult	= false;
+		this.delayBeforeDisplay	= 100;
+		this.checkDelayTimer	= false;
+		this.curr_syntax_str	= '';
+		
+		this.file_syntax_datas	= {};
+	}
+	/**
+	 * Returns the HTML code for a specific control string or false if this plugin doesn't have that control.
+	 * A control can be a button, select list or any other HTML item to present in the EditArea user interface.
+	 * Language variables such as {$lang_somekey} will also be replaced with contents from
+	 * the language packs.
+	 * 
+	 * @param {string} ctrl_name: the name of the control to add	  
+	 * @return HTML code for a specific control or false.
+	 * @type string	or boolean
+	 */	
+	/*,get_control_html: function(ctrl_name){
+		switch( ctrl_name ){
+			case 'autocompletion':
+				// Control id, button img, command
+				return parent.editAreaLoader.get_button_html('autocompletion_but', 'autocompletion.gif', 'toggle_autocompletion', false, this.baseURL);
+				break;
+		}
+		return false;
+	}*/
+	/**
+	 * Get called once EditArea is fully loaded and initialised
+	 *	 
+	 * @return nothing
+	 */	 	 	
+	,onload: function(){ 
+		if(this.enabled)
+		{
+			var icon= document.getElementById("autocompletion");
+			if(icon)
+				editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
+		}
+		
+		this.container	= document.createElement('div');
+		this.container.id	= "auto_completion_area";
+		editArea.container.insertBefore( this.container, editArea.container.firstChild );
+		
+		// add event detection for hiding suggestion box
+		parent.editAreaLoader.add_event( document, "click", function(){ editArea.plugins['autocompletion']._hide();} );
+		parent.editAreaLoader.add_event( editArea.textarea, "blur", function(){ editArea.plugins['autocompletion']._hide();} );
+		
+	}
+	
+	/**
+	 * Is called each time the user touch a keyboard key.
+	 *	 
+	 * @param (event) e: the keydown event
+	 * @return true - pass to next handler in chain, false - stop chain execution
+	 * @type boolean	 
+	 */
+	,onkeydown: function(e){
+		if(!this.enabled)
+			return true;
+			
+		if (EA_keys[e.keyCode])
+			letter=EA_keys[e.keyCode];
+		else
+			letter=String.fromCharCode(e.keyCode);	
+		// shown
+		if( this._isShown() )
+		{	
+			// if escape, hide the box
+			if(letter=="Esc")
+			{
+				this._hide();
+				return false;
+			}
+			// Enter
+			else if( letter=="Entrer")
+			{
+				var as	= this.container.getElementsByTagName('A');
+				// select a suggested entry
+				if( this.selectIndex >= 0 && this.selectIndex < as.length )
+				{
+					as[ this.selectIndex ].onmousedown();
+					return false
+				}
+				// simply add an enter in the code
+				else
+				{
+					this._hide();
+					return true;
+				}
+			}
+			else if( letter=="Tab" || letter=="Down")
+			{
+				this._selectNext();
+				return false;
+			}
+			else if( letter=="Up")
+			{
+				this._selectBefore();
+				return false;
+			}
+		}
+		// hidden
+		else
+		{
+			
+		}
+		
+		// show current suggestion list and do autoSelect if possible (no matter it's shown or hidden)
+		if( letter=="Space" && CtrlPressed(e) )
+		{
+			//parent.console.log('SHOW SUGGEST');
+			this.forceDisplay 			= true;
+			this.autoSelectIfOneResult	= true;
+			this._checkLetter();
+			return false;
+		}
+		
+		// wait a short period for check that the cursor isn't moving
+		setTimeout("editArea.plugins['autocompletion']._checkDelayAndCursorBeforeDisplay();", editArea.check_line_selection_timer +5 );
+		this.checkDelayTimer = false;
+		return true;
+	}	
+	/**
+	 * Executes a specific command, this function handles plugin commands.
+	 *
+	 * @param {string} cmd: the name of the command being executed
+	 * @param {unknown} param: the parameter of the command	 
+	 * @return true - pass to next handler in chain, false - stop chain execution
+	 * @type boolean	
+	 */
+	,execCommand: function(cmd, param){
+		switch( cmd ){
+			case 'toggle_autocompletion':
+				var icon= document.getElementById("autocompletion");
+				if(!this.enabled)
+				{
+					if(icon != null){
+						editArea.restoreClass(icon);
+						editArea.switchClassSticky(icon, 'editAreaButtonSelected', true);
+					}
+					this.enabled= true;
+				}
+				else
+				{
+					this.enabled= false;
+					if(icon != null)
+						editArea.switchClassSticky(icon, 'editAreaButtonNormal', false);
+				}
+				return true;
+		}
+		return true;
+	}
+	,_checkDelayAndCursorBeforeDisplay: function()
+	{
+		this.checkDelayTimer = setTimeout("if(editArea.textarea.selectionStart == "+ editArea.textarea.selectionStart +") EditArea_autocompletion._checkLetter();",  this.delayBeforeDisplay - editArea.check_line_selection_timer - 5 );
+	}
+	// hide the suggested box
+	,_hide: function(){
+		this.container.style.display="none";
+		this.selectIndex	= -1;
+		this.shown	= false;
+		this.forceDisplay	= false;
+		this.autoSelectIfOneResult = false;
+	}
+	// display the suggested box
+	,_show: function(){
+		if( !this._isShown() )
+		{
+			this.container.style.display="block";
+			this.selectIndex	= -1;
+			this.shown	= true;
+		}
+	}
+	// is the suggested box displayed?
+	,_isShown: function(){
+		return this.shown;
+	}
+	// setter and getter
+	,_isInMiddleWord: function( new_value ){
+		if( typeof( new_value ) == "undefined" )
+			return this.isInMiddleWord;
+		else
+			this.isInMiddleWord	= new_value;
+	}
+	// select the next element in the suggested box
+	,_selectNext: function()
+	{
+		var as	= this.container.getElementsByTagName('A');
+		
+		// clean existing elements
+		for( var i=0; i<as.length; i++ )
+		{
+			if( as[i].className )
+				as[i].className	= as[i].className.replace(/ focus/g, '');
+		}
+		
+		this.selectIndex++;	
+		this.selectIndex	= ( this.selectIndex >= as.length || this.selectIndex < 0 ) ? 0 : this.selectIndex;
+		as[ this.selectIndex ].className	+= " focus";
+	}
+	// select the previous element in the suggested box
+	,_selectBefore: function()
+	{
+		var as	= this.container.getElementsByTagName('A');
+		
+		// clean existing elements
+		for( var i=0; i<as.length; i++ )
+		{
+			if( as[i].className )
+				as[i].className	= as[ i ].className.replace(/ focus/g, '');
+		}
+		
+		this.selectIndex--;
+		
+		this.selectIndex	= ( this.selectIndex >= as.length || this.selectIndex < 0 ) ? as.length-1 : this.selectIndex;
+		as[ this.selectIndex ].className	+= " focus";
+	}
+	,_select: function( content )
+	{
+		cursor_forced_position	= content.indexOf( '{@}' );
+		content	= content.replace(/{@}/g, '' );
+		editArea.getIESelection();
+		
+		// retrive the number of matching characters
+		var start_index	= Math.max( 0, editArea.textarea.selectionEnd - content.length );
+		
+		line_string	= 	editArea.textarea.value.substring( start_index, editArea.textarea.selectionEnd + 1);
+		limit	= line_string.length -1;
+		nbMatch	= 0;
+		for( i =0; i<limit ; i++ )
+		{
+			if( line_string.substring( limit - i - 1, limit ) == content.substring( 0, i + 1 ) )
+				nbMatch = i + 1;
+		}
+		// if characters match, we should include them in the selection that will be replaced
+		if( nbMatch > 0 )
+			parent.editAreaLoader.setSelectionRange(editArea.id, editArea.textarea.selectionStart - nbMatch , editArea.textarea.selectionEnd);
+		
+		parent.editAreaLoader.setSelectedText(editArea.id, content );
+		range= parent.editAreaLoader.getSelectionRange(editArea.id);
+		
+		if( cursor_forced_position != -1 )
+			new_pos	= range["end"] - ( content.length-cursor_forced_position );
+		else
+			new_pos	= range["end"];	
+		parent.editAreaLoader.setSelectionRange(editArea.id, new_pos, new_pos);
+		this._hide();
+	}
+	
+	
+	/**
+	 * Parse the AUTO_COMPLETION part of syntax definition files
+	 */
+	,_parseSyntaxAutoCompletionDatas: function(){
+		//foreach syntax loaded
+		for(var lang in parent.editAreaLoader.load_syntax)
+		{
+			if(!parent.editAreaLoader.syntax[lang]['autocompletion'])	// init the regexp if not already initialized
+			{
+				parent.editAreaLoader.syntax[lang]['autocompletion']= {};
+				// the file has auto completion datas
+				if(parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'])
+				{
+					// parse them
+					for(var i in parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'])
+					{
+						datas	= parent.editAreaLoader.load_syntax[lang]['AUTO_COMPLETION'][i];
+						tmp	= {};
+						if(datas["CASE_SENSITIVE"]!="undefined" && datas["CASE_SENSITIVE"]==false)
+							tmp["modifiers"]="i";
+						else
+							tmp["modifiers"]="";
+						tmp["prefix_separator"]= datas["REGEXP"]["prefix_separator"];
+						tmp["match_prefix_separator"]= new RegExp( datas["REGEXP"]["prefix_separator"] +"$", tmp["modifiers"]);
+						tmp["match_word"]= new RegExp("(?:"+ datas["REGEXP"]["before_word"] +")("+ datas["REGEXP"]["possible_words_letters"] +")$", tmp["modifiers"]);
+						tmp["match_next_letter"]= new RegExp("^("+ datas["REGEXP"]["letter_after_word_must_match"] +")$", tmp["modifiers"]);
+						tmp["keywords"]= {};
+						//console.log( datas["KEYWORDS"] );
+						for( var prefix in datas["KEYWORDS"] )
+						{
+							tmp["keywords"][prefix]= {
+								prefix: prefix,
+								prefix_name: prefix,
+								prefix_reg: new RegExp("(?:"+ parent.editAreaLoader.get_escaped_regexp( prefix ) +")(?:"+ tmp["prefix_separator"] +")$", tmp["modifiers"] ),
+								datas: []
+							};
+							for( var j=0; j<datas["KEYWORDS"][prefix].length; j++ )
+							{
+								tmp["keywords"][prefix]['datas'][j]= {
+									is_typing: datas["KEYWORDS"][prefix][j][0],
+									// if replace with is empty, replace with the is_typing value
+									replace_with: datas["KEYWORDS"][prefix][j][1] ? datas["KEYWORDS"][prefix][j][1].replace('�', datas["KEYWORDS"][prefix][j][0] ) : '',
+									comment: datas["KEYWORDS"][prefix][j][2] ? datas["KEYWORDS"][prefix][j][2] : '' 
+								};
+								
+								// the replace with shouldn't be empty
+								if( tmp["keywords"][prefix]['datas'][j]['replace_with'].length == 0 )
+									tmp["keywords"][prefix]['datas'][j]['replace_with'] = tmp["keywords"][prefix]['datas'][j]['is_typing'];
+								
+								// if the comment is empty, display the replace_with value
+								if( tmp["keywords"][prefix]['datas'][j]['comment'].length == 0 )
+									 tmp["keywords"][prefix]['datas'][j]['comment'] = tmp["keywords"][prefix]['datas'][j]['replace_with'].replace(/{@}/g, '' );
+							}
+								
+						}
+						tmp["max_text_length"]= datas["MAX_TEXT_LENGTH"];
+						parent.editAreaLoader.syntax[lang]['autocompletion'][i]	= tmp;
+					}
+				}
+			}
+		}
+	}
+	
+	,_checkLetter: function(){
+		// check that syntax hasn't changed
+		if( this.curr_syntax_str != editArea.settings['syntax'] )
+		{
+			if( !parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'] )
+				this._parseSyntaxAutoCompletionDatas();
+			this.curr_syntax= parent.editAreaLoader.syntax[editArea.settings['syntax']]['autocompletion'];
+			this.curr_syntax_str = editArea.settings['syntax'];
+			//console.log( this.curr_syntax );
+		}
+		
+		if( editArea.is_editable )
+		{
+			time=new Date;
+			t1= time.getTime();
+			editArea.getIESelection();
+			this.selectIndex	= -1;
+			start=editArea.textarea.selectionStart;
+			var str	= editArea.textarea.value;
+			var results= [];
+			
+			
+			for(var i in this.curr_syntax)
+			{
+				var last_chars	= str.substring(Math.max(0, start-this.curr_syntax[i]["max_text_length"]), start);
+				var matchNextletter	= str.substring(start, start+1).match( this.curr_syntax[i]["match_next_letter"]);
+				// if not writting in the middle of a word or if forcing display
+				if( matchNextletter || this.forceDisplay )
+				{
+					// check if the last chars match a separator
+					var match_prefix_separator = last_chars.match(this.curr_syntax[i]["match_prefix_separator"]);
+			
+					// check if it match a possible word
+					var match_word= last_chars.match(this.curr_syntax[i]["match_word"]);
+					
+					//console.log( match_word );
+					if( match_word )
+					{
+						var begin_word= match_word[1];
+						var match_curr_word= new RegExp("^"+ parent.editAreaLoader.get_escaped_regexp( begin_word ), this.curr_syntax[i]["modifiers"]);
+						//console.log( match_curr_word );
+						for(var prefix in this.curr_syntax[i]["keywords"])
+						{
+						//	parent.console.log( this.curr_syntax[i]["keywords"][prefix] );
+							for(var j=0; j<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
+							{
+						//		parent.console.log( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'] );
+								// the key word match or force display 
+								if( this.curr_syntax[i]["keywords"][prefix]['datas'][j]['is_typing'].match(match_curr_word) )
+								{
+							//		parent.console.log('match');
+									hasMatch = false;
+									var before = last_chars.substr( 0, last_chars.length - begin_word.length );
+									
+									// no prefix to match => it's valid
+									if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 )
+									{
+										if( ! before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
+											hasMatch = true;
+									}
+									// we still need to check the prefix if there is one
+									else if( this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 )
+									{
+										if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
+											hasMatch = true;
+									}
+									
+									if( hasMatch )
+										results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ];
+								}	
+							}
+						}
+					}
+					// it doesn't match any possible word but we want to display something
+					// we'll display to list of all available words
+					else if( this.forceDisplay || match_prefix_separator )
+					{
+						for(var prefix in this.curr_syntax[i]["keywords"])
+						{
+							for(var j=0; j<this.curr_syntax[i]["keywords"][prefix]['datas'].length; j++)
+							{
+								hasMatch = false;
+								// no prefix to match => it's valid
+								if( !match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length == 0 )
+								{
+									hasMatch	= true;
+								}
+								// we still need to check the prefix if there is one
+								else if( match_prefix_separator && this.curr_syntax[i]["keywords"][prefix]['prefix'].length > 0 )
+								{
+									var before = last_chars; //.substr( 0, last_chars.length );
+									if( before.match( this.curr_syntax[i]["keywords"][prefix]['prefix_reg'] ) )
+										hasMatch = true;
+								}	
+									
+								if( hasMatch )
+									results[results.length]= [ this.curr_syntax[i]["keywords"][prefix], this.curr_syntax[i]["keywords"][prefix]['datas'][j] ];	
+							}
+						}
+					}
+				}
+			}
+			
+			// there is only one result, and we can select it automatically
+			if( results.length == 1 && this.autoSelectIfOneResult )
+			{
+			//	console.log( results );
+				this._select( results[0][1]['replace_with'] );
+			}
+			else if( results.length == 0 )
+			{
+				this._hide();
+			}
+			else
+			{
+				// build the suggestion box content
+				var lines=[];
+				for(var i=0; i<results.length; i++)
+				{
+					var line= "<li><a href=\"#\" class=\"entry\" onmousedown=\"EditArea_autocompletion._select('"+ results[i][1]['replace_with'].replace(new RegExp('"', "g"), "&quot;") +"');return false;\">"+ results[i][1]['comment'];
+					if(results[i][0]['prefix_name'].length>0)
+						line+='<span class="prefix">'+ results[i][0]['prefix_name'] +'</span>';
+					line+='</a></li>';
+					lines[lines.length]=line;
+				}
+				// sort results
+				this.container.innerHTML		= '<ul>'+ lines.sort().join('') +'</ul>';
+				
+				var cursor	= _$("cursor_pos");
+				this.container.style.top		= ( cursor.cursor_top + editArea.lineHeight ) +"px";
+				this.container.style.left		= ( cursor.cursor_left + 8 ) +"px";
+				this._show();
+			}
+				
+			this.autoSelectIfOneResult = false;
+			time=new Date;
+			t2= time.getTime();
+		
+			//parent.console.log( begin_word +"\n"+ (t2-t1) +"\n"+ html );
+		}
+	}
+};
+
+// Load as a plugin
+editArea.settings['plugins'][ editArea.settings['plugins'].length ] = 'autocompletion';
+editArea.add_plugin('autocompletion', EditArea_autocompletion);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.css b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.css
new file mode 100644
index 0000000..172b366
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.css
@@ -0,0 +1,530 @@
+body, html{
+	margin: 0; 
+	padding: 0;
+	height: 100%;
+	border: none;
+	overflow: hidden;
+	background-color: #FFF;
+}
+
+body, html, table, form, textarea{
+	font: 12px monospace, sans-serif;
+}
+
+#editor{
+	border: solid #888 1px;
+	overflow: hidden;
+}
+
+#result{
+	z-index: 4; 
+	overflow-x: auto;
+	overflow-y: scroll;
+	border-top: solid #888 1px;
+	border-bottom: solid #888 1px;
+	position: relative;
+	clear: both;
+}
+
+#result.empty{
+	overflow: hidden;
+}
+
+#container{
+	overflow: hidden;
+	border: solid blue 0;
+	position: relative; 
+	z-index: 10;
+	padding: 0 5px 0 45px;
+	/*padding-right: 5px;*/ 
+}
+
+#textarea{
+	position: relative; 
+	top: 0; 
+	left: 0;
+	margin: 0;
+	padding: 0;
+	width: 100%;
+	height: 100%; 
+	overflow: hidden;  
+	z-index: 7; 
+	border-width: 0;
+	background-color: transparent;
+	resize: none;
+}
+
+#textarea, #textarea:hover{
+	outline: none;	/* safari outline fix */
+}
+
+#content_highlight{
+	white-space: pre;
+	margin: 0;
+	padding: 0;
+	position : absolute; 
+	z-index: 4; 
+	overflow: visible;
+}
+
+
+#selection_field, #selection_field_text{
+	margin: 0; 
+	background-color: #E1F2F9; 
+/*	height: 1px; */  
+	position: absolute;
+	z-index: 5;
+	top: -100px;
+	padding: 0;
+	white-space: pre;
+	overflow: hidden;
+}
+
+#selection_field.show_colors {
+	z-index: 3;
+	background-color:#EDF9FC;
+	
+}
+
+#selection_field strong{
+	font-weight:normal;
+}
+
+#selection_field.show_colors *, #selection_field_text * {
+	visibility: hidden;
+}
+
+#selection_field_text{
+	background-color:transparent;
+}
+
+#selection_field_text strong{
+	font-weight:normal;
+	background-color:#3399FE;
+	color: #FFF;
+	visibility:visible;
+}
+
+#container.word_wrap #content_highlight,
+#container.word_wrap #selection_field,
+#container.word_wrap #selection_field_text,
+#container.word_wrap #test_font_size{
+	white-space: pre-wrap;       /* css-3 */
+	white-space: -moz-pre-wrap !important;  /* Mozilla, since 1999 */
+	white-space: -pre-wrap;      /* Opera 4-6 */
+	white-space: -o-pre-wrap;    /* Opera 7 */
+	word-wrap: break-word;       /* Internet Explorer 5.5+ */
+	width: 99%;
+}
+
+#line_number{
+	position: absolute;
+	overflow: hidden;
+	border-right: solid black 1px;
+	z-index:8;
+	width: 38px;
+	padding: 0 5px 0 0;
+	margin: 0 0 0 -45px;
+	text-align: right;
+	color: #AAAAAA;
+}
+
+#test_font_size{
+	padding: 0; 
+	margin: 0; 
+	visibility: hidden;
+	position: absolute;
+	white-space: pre;
+}
+
+pre{
+	margin: 0;
+	padding: 0;
+}
+
+.hidden{
+	opacity: 0.2; 
+	filter:alpha(opacity=20);
+}
+
+#result .edit_area_cursor{
+	position: absolute; 
+	z-index:6; 
+	background-color: #FF6633;
+	top: -100px;
+	margin: 0;
+}
+
+#result .edit_area_selection_field .overline{
+	background-color: #996600;
+}
+
+
+/* area popup */
+.editarea_popup{
+	border: solid 1px #888888;
+	background-color: #ECE9D8; 
+	width: 250px; 
+	padding: 4px; 
+	position: absolute;
+	visibility: hidden; 
+	z-index: 15;
+	top: -500px;
+}
+
+.editarea_popup, .editarea_popup table{
+	font-family: sans-serif;
+	font-size: 10pt;
+}
+
+.editarea_popup img{
+	border: 0;
+}
+
+.editarea_popup .close_popup{
+	float: right; 
+	line-height: 16px; 
+	border: 0; 
+	padding: 0;
+}
+
+.editarea_popup h1,.editarea_popup h2,.editarea_popup h3,.editarea_popup h4,.editarea_popup h5,.editarea_popup h6{
+	margin: 0;
+	padding: 0;
+}
+
+.editarea_popup .copyright{
+	text-align: right;
+}	
+
+/* Area_search */
+div#area_search_replace{
+	/*width: 250px;*/
+}
+
+div#area_search_replace img{
+	border: 0;
+}
+
+div#area_search_replace div.button{
+	text-align: center;
+	line-height: 1.7em;
+}
+
+div#area_search_replace .button a{
+	cursor: pointer;
+	border: solid 1px #888888;
+	background-color: #DEDEDE;
+	text-decoration: none;
+	padding: 0 2px;
+	color: #000000;	
+	white-space: nowrap;
+}
+
+div#area_search_replace a:hover{	
+	/*border: solid 1px #888888;*/
+	background-color: #EDEDED;
+}
+
+div#area_search_replace  #move_area_search_replace{
+	cursor: move; 
+	border: solid 1px #888;
+}
+
+div#area_search_replace  #close_area_search_replace{
+	text-align: right; 
+	vertical-align: top; 
+	white-space: nowrap;
+}
+
+div#area_search_replace  #area_search_msg{
+	height: 18px; 
+	overflow: hidden; 
+	border-top: solid 1px #888; 
+	margin-top: 3px;
+}
+
+/* area help */
+#edit_area_help{
+	width: 350px;
+}
+
+#edit_area_help div.close_popup{
+	float: right;
+}
+
+/* area_toolbar */
+.area_toolbar{
+	/*font: 11px sans-serif;*/
+	width: 100%; 
+	/*height: 21px; */
+	margin: 0; 
+	padding: 0;
+	background-color: #ECE9D8;
+	text-align: center;
+}
+
+.area_toolbar, .area_toolbar table{
+	font: 11px sans-serif;
+}
+
+.area_toolbar img{
+	border: 0;
+	vertical-align: middle;
+}
+
+.area_toolbar input{
+	margin: 0;
+	padding: 0;
+}
+
+.area_toolbar select{
+    font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
+    font-size: 7pt;
+    font-weight: normal;
+    margin: 2px 0 0 0 ;
+    padding: 0;
+    vertical-align: top;
+    background-color: #F0F0EE;
+}
+
+table.statusbar{
+	width: 100%;
+}
+
+.area_toolbar td.infos{
+	text-align: center;
+	width: 130px;
+	border-right: solid 1px #888;
+	border-width: 0 1px 0 0;
+	padding: 0;
+}
+
+.area_toolbar td.total{
+	text-align: right;
+	width: 50px;
+	padding: 0;
+}
+
+.area_toolbar td.resize{
+	text-align: right;
+}
+/*
+.area_toolbar span{
+	line-height: 1px;
+	padding: 0;
+	margin: 0;
+}*/
+
+.area_toolbar span#resize_area{
+	cursor: nw-resize;
+	visibility: hidden;
+}
+
+/* toolbar buttons */
+.editAreaButtonNormal, .editAreaButtonOver, .editAreaButtonDown, .editAreaSeparator, .editAreaSeparatorLine, .editAreaButtonDisabled, .editAreaButtonSelected {
+	border: 0; margin: 0; padding: 0; background: transparent;
+	margin-top: 0;
+	margin-left: 1px;
+	padding: 0;
+}
+
+.editAreaButtonNormal {
+	border: 1px solid #ECE9D8 !important;
+	cursor: pointer;
+}
+
+.editAreaButtonOver {
+	border: 1px solid #0A246A !important;
+	cursor: pointer;
+	background-color: #B6BDD2;
+}
+
+.editAreaButtonDown {
+	cursor: pointer;
+	border: 1px solid #0A246A !important;
+	background-color: #8592B5;
+}
+
+.editAreaButtonSelected {
+	border: 1px solid #C0C0BB !important;
+	cursor: pointer;
+	background-color: #F4F2E8;
+}
+
+.editAreaButtonDisabled {
+	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+	-moz-opacity:0.3;
+	opacity: 0.3;
+	border: 1px solid #F0F0EE !important;
+	cursor: pointer;
+}
+
+.editAreaSeparatorLine {
+	margin: 1px 2px;
+	background-color: #C0C0BB;
+	width: 2px;
+	height: 18px;
+}
+
+/* waiting screen */
+#processing{
+	display: none; 
+	background-color:#ECE9D8; 
+	border: solid #888 1px;
+	position: absolute; 
+	top: 0; 
+	left: 0;
+	width: 100%; 
+	height: 100%; 
+	z-index: 100; 
+	text-align: center;
+}
+
+#processing_text{
+	position:absolute;
+	left: 50%;
+	top: 50%;
+	width: 200px;
+	height: 20px; 
+	margin-left: -100px;
+	margin-top: -10px;
+	text-align: center;
+}
+/* end */
+
+
+/**** tab browsing area ****/
+#tab_browsing_area{
+	display: none;
+	background-color: #CCC9A8;
+	border-top: 1px solid #888;
+	text-align: left;
+	margin: 0;
+}
+
+#tab_browsing_list {
+	padding: 0; 
+	margin: 0; 
+	list-style-type: none;
+	white-space: nowrap;
+}
+#tab_browsing_list li {
+	float: left;
+	margin: -1px;
+}
+#tab_browsing_list a {
+	position: relative;
+	display: block; 
+	text-decoration: none; 
+	float: left; 
+	cursor: pointer;
+	line-height:14px;
+}
+
+#tab_browsing_list a span {
+	display: block; 
+	color: #000; 
+	background: #ECE9D8; 
+	border:	1px solid #888; 
+	border-width: 1px 1px 0; 
+	text-align: center; 
+	padding: 2px 2px 1px 4px; 
+	position: relative;	/*IE 6 hack */
+}
+
+#tab_browsing_list a b {
+	display: block; 
+	border-bottom: 2px solid #617994;
+}
+
+#tab_browsing_list a .edited {
+	display: none;
+}
+
+#tab_browsing_list a.edited .edited {
+	display: inline;
+}
+
+#tab_browsing_list a img{
+	margin-left: 7px;
+}
+
+#tab_browsing_list a.edited img{
+	margin-left: 3px;
+}
+
+#tab_browsing_list a:hover span {
+	background: #F4F2E8;
+	border-color: #0A246A;
+}
+
+#tab_browsing_list .selected a span{
+	background: #046380;
+	color: #FFF;
+}
+
+
+#no_file_selected{
+	height: 100%;
+	width: 150%; /* Opera need more than 100% */
+	background: #CCC;
+	display: none;
+	z-index: 20;
+	position: absolute;
+}
+
+
+/*** Non-editable mode ***/
+.non_editable #editor
+{
+	border-width: 0 1px;
+}
+
+.non_editable .area_toolbar
+{
+	display: none;
+}
+
+/*** Auto completion ***/
+#auto_completion_area
+{
+	background:	#FFF;
+	border:		solid 1px #888;
+	position:	absolute;
+	z-index:	15;
+	width:	280px;
+	height:	180px;
+	overflow: auto;
+	display:none;
+}
+
+#auto_completion_area a, #auto_completion_area a:visited
+{
+	display:	block;
+	padding:	0 2px 1px;
+	color:		#000;
+	text-decoration:none;
+}
+
+#auto_completion_area a:hover, #auto_completion_area a:focus, #auto_completion_area a.focus
+{
+	background:	#D6E1FE;
+	text-decoration:none;
+}
+
+#auto_completion_area ul
+{
+	margin:	0;
+	padding: 0;
+	list-style: none inside;
+}
+#auto_completion_area li
+{
+	padding:	0;
+}
+#auto_completion_area .prefix
+{
+	font-style: italic;
+	padding: 0 3px;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.js
new file mode 100644
index 0000000..27674f6
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.js
@@ -0,0 +1,525 @@
+/******
+ *
+ *	EditArea 
+ * 	Developped by Christophe Dolivet
+ *	Released under LGPL, Apache and BSD licenses (use the one you want)
+ *
+******/
+
+	function EditArea(){
+		var t=this;
+		t.error= false;	// to know if load is interrrupt
+		
+		t.inlinePopup= [{popup_id: "area_search_replace", icon_id: "search"},
+									{popup_id: "edit_area_help", icon_id: "help"}];
+		t.plugins= {};
+	
+		t.line_number=0;
+		
+		parent.editAreaLoader.set_browser_infos(t); 	// navigator identification
+		// fix IE8 detection as we run in IE7 emulate mode through X-UA <meta> tag
+		if( t.isIE >= 8 )
+			t.isIE	= 7;
+		
+		t.last_selection={};		
+		t.last_text_to_highlight="";
+		t.last_hightlighted_text= "";
+		t.syntax_list= [];
+		t.allready_used_syntax= {};
+		t.check_line_selection_timer= 50;	// the timer delay for modification and/or selection change detection
+		
+		t.textareaFocused= false;
+		t.highlight_selection_line= null;
+		t.previous= [];
+		t.next= [];
+		t.last_undo="";
+		t.files= {};
+		t.filesIdAssoc= {};
+		t.curr_file= '';
+		//t.loaded= false;
+		t.assocBracket={};
+		t.revertAssocBracket= {};		
+		// bracket selection init 
+		t.assocBracket["("]=")";
+		t.assocBracket["{"]="}";
+		t.assocBracket["["]="]";		
+		for(var index in t.assocBracket){
+			t.revertAssocBracket[t.assocBracket[index]]=index;
+		}
+		t.is_editable= true;
+		
+		
+		/*t.textarea="";	
+		
+		t.state="declare";
+		t.code = []; // store highlight syntax for languagues*/
+		// font datas
+		t.lineHeight= 16;
+		/*t.default_font_family= "monospace";
+		t.default_font_size= 10;*/
+		t.tab_nb_char= 8;	//nb of white spaces corresponding to a tabulation
+		if(t.isOpera)
+			t.tab_nb_char= 6;
+
+		t.is_tabbing= false;
+		
+		t.fullscreen= {'isFull': false};
+		
+		t.isResizing=false;	// resize var
+		
+		// init with settings and ID (area_id is a global var defined by editAreaLoader on iframe creation
+		t.id= area_id;
+		t.settings= editAreas[t.id]["settings"];
+		
+		if((""+t.settings['replace_tab_by_spaces']).match(/^[0-9]+$/))
+		{
+			t.tab_nb_char= t.settings['replace_tab_by_spaces'];
+			t.tabulation="";
+			for(var i=0; i<t.tab_nb_char; i++)
+				t.tabulation+=" ";
+		}else{
+			t.tabulation="\t";
+		}
+			
+		// retrieve the init parameter for syntax
+		if(t.settings["syntax_selection_allow"] && t.settings["syntax_selection_allow"].length>0)
+			t.syntax_list= t.settings["syntax_selection_allow"].replace(/ /g,"").split(",");
+		
+		if(t.settings['syntax'])
+			t.allready_used_syntax[t.settings['syntax']]=true;
+		
+		
+	};
+	EditArea.prototype.init= function(){
+		var t=this, a, s=t.settings;
+		t.textarea			= _$("textarea");
+		t.container			= _$("container");
+		t.result			= _$("result");
+		t.content_highlight	= _$("content_highlight");
+		t.selection_field	= _$("selection_field");
+		t.selection_field_text= _$("selection_field_text");
+		t.processing_screen	= _$("processing");
+		t.editor_area		= _$("editor");
+		t.tab_browsing_area	= _$("tab_browsing_area");
+		t.test_font_size	= _$("test_font_size");
+		a = t.textarea;
+		
+		if(!s['is_editable'])
+			t.set_editable(false);
+		
+		t.set_show_line_colors( s['show_line_colors'] );
+		
+		if(syntax_selec= _$("syntax_selection"))
+		{
+			// set up syntax selection lsit in the toolbar
+			for(var i=0; i<t.syntax_list.length; i++) {
+				var syntax= t.syntax_list[i];
+				var option= document.createElement("option");
+				option.value= syntax;
+				if(syntax==s['syntax'])
+					option.selected= "selected";
+				option.innerHTML= t.get_translation("syntax_" + syntax, "word");
+				syntax_selec.appendChild(option);
+			}
+		}
+		
+		// add plugins buttons in the toolbar
+		spans= parent.getChildren(_$("toolbar_1"), "span", "", "", "all", -1);
+		
+		for(var i=0; i<spans.length; i++){
+		
+			id=spans[i].id.replace(/tmp_tool_(.*)/, "$1");
+			if(id!= spans[i].id){
+				for(var j in t.plugins){
+					if(typeof(t.plugins[j].get_control_html)=="function" ){
+						html=t.plugins[j].get_control_html(id);
+						if(html!=false){
+							html= t.get_translation(html, "template");
+							var new_span= document.createElement("span");
+							new_span.innerHTML= html;				
+							var father= spans[i].parentNode;
+							spans[i].parentNode.replaceChild(new_span, spans[i]);	
+							break; // exit the for loop					
+						}
+					}
+				}
+			}
+		}
+		
+		// init datas
+		//a.value	= 'a';//editAreas[t.id]["textarea"].value;
+	
+		if(s["debug"])
+		{
+			t.debug=parent.document.getElementById("edit_area_debug_"+t.id);
+		}
+		// init size		
+		//this.update_size();
+		
+		if(_$("redo") != null)
+			t.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
+		
+		// insert css rules for highlight mode		
+		if(typeof(parent.editAreaLoader.syntax[s["syntax"]])!="undefined"){
+			for(var i in parent.editAreaLoader.syntax){
+				if (typeof(parent.editAreaLoader.syntax[i]["styles"]) != "undefined"){
+					t.add_style(parent.editAreaLoader.syntax[i]["styles"]);
+				}
+			}
+		}
+	
+		// init key events
+		if(t.isOpera)
+			_$("editor").onkeypress	= keyDown;
+		else
+			_$("editor").onkeydown	= keyDown;
+
+		for(var i=0; i<t.inlinePopup.length; i++){
+			if(t.isOpera)
+				_$(t.inlinePopup[i]["popup_id"]).onkeypress	= keyDown;
+			else
+				_$(t.inlinePopup[i]["popup_id"]).onkeydown	= keyDown;
+		}
+		
+		if(s["allow_resize"]=="both" || s["allow_resize"]=="x" || s["allow_resize"]=="y")
+			t.allow_resize(true);
+		
+		parent.editAreaLoader.toggle(t.id, "on");
+		//a.focus();
+		// line selection init
+		t.change_smooth_selection_mode(editArea.smooth_selection);
+		// highlight
+		t.execCommand("change_highlight", s["start_highlight"]);
+	
+		// get font size datas		
+		t.set_font(editArea.settings["font_family"], editArea.settings["font_size"]);
+		
+		// set unselectable text
+		children= parent.getChildren(document.body, "", "selec", "none", "all", -1);
+		for(var i=0; i<children.length; i++){
+			if(t.isIE)
+				children[i].unselectable = true; // IE
+			else
+				children[i].onmousedown= function(){return false};
+		/*	children[i].style.MozUserSelect = "none"; // Moz
+			children[i].style.KhtmlUserSelect = "none";  // Konqueror/Safari*/
+		}
+		
+		a.spellcheck= s["gecko_spellcheck"];
+	
+		/** Browser specific style fixes **/
+		
+		// fix rendering bug for highlighted lines beginning with no tabs
+		if( t.isFirefox >= '3' ) {
+			t.content_highlight.style.paddingLeft= "1px";
+			t.selection_field.style.paddingLeft= "1px";
+			t.selection_field_text.style.paddingLeft= "1px";
+		}
+		
+		if(t.isIE && t.isIE < 8 ){
+			a.style.marginTop= "-1px";
+		}
+		/*
+		if(t.isOpera){
+			t.editor_area.style.position= "absolute";
+		}*/
+		
+		if( t.isSafari ){
+			t.editor_area.style.position	= "absolute";
+			a.style.marginLeft		="-3px";
+			if( t.isSafari < 3.2 ) // Safari 3.0 (3.1?)
+				a.style.marginTop	="1px";
+		}
+		
+		// si le textarea n'est pas grand, un click sous le textarea doit provoquer un focus sur le textarea
+		parent.editAreaLoader.add_event(t.result, "click", function(e){ if((e.target || e.srcElement)==editArea.result) { editArea.area_select(editArea.textarea.value.length, 0);}  });
+		
+		if(s['is_multi_files']!=false)
+			t.open_file({'id': t.curr_file, 'text': ''});
+	
+		t.set_word_wrap( s['word_wrap'] );
+		
+		setTimeout("editArea.focus();editArea.manage_size();editArea.execCommand('EA_load');", 10);		
+		//start checkup routine
+		t.check_undo();
+		t.check_line_selection(true);
+		t.scroll_to_view();
+		
+		for(var i in t.plugins){
+			if(typeof(t.plugins[i].onload)=="function")
+				t.plugins[i].onload();
+		}
+		if(s['fullscreen']==true)
+			t.toggle_full_screen(true);
+	
+		parent.editAreaLoader.add_event(window, "resize", editArea.update_size);
+		parent.editAreaLoader.add_event(parent.window, "resize", editArea.update_size);
+		parent.editAreaLoader.add_event(top.window, "resize", editArea.update_size);
+		parent.editAreaLoader.add_event(window, "unload", function(){
+			// in case where editAreaLoader have been already cleaned
+			if( parent.editAreaLoader )
+			{
+				parent.editAreaLoader.remove_event(parent.window, "resize", editArea.update_size);
+		  		parent.editAreaLoader.remove_event(top.window, "resize", editArea.update_size);
+			}
+			if(editAreas[editArea.id] && editAreas[editArea.id]["displayed"]){
+				editArea.execCommand("EA_unload");
+			}
+		});
+		
+		
+		/*date= new Date();
+		alert(date.getTime()- parent.editAreaLoader.start_time);*/
+	};
+	
+	
+	
+	//called by the toggle_on
+	EditArea.prototype.update_size= function(){
+		var d=document,pd=parent.document,height,width,popup,maxLeft,maxTop;
+		
+		if( typeof editAreas != 'undefined' && editAreas[editArea.id] && editAreas[editArea.id]["displayed"]==true){
+			if(editArea.fullscreen['isFull']){	
+				pd.getElementById("frame_"+editArea.id).style.width		= pd.getElementsByTagName("html")[0].clientWidth + "px";
+				pd.getElementById("frame_"+editArea.id).style.height	= pd.getElementsByTagName("html")[0].clientHeight + "px";
+			}
+			
+			if(editArea.tab_browsing_area.style.display=='block' && ( !editArea.isIE || editArea.isIE >= 8 ) )
+			{
+				editArea.tab_browsing_area.style.height	= "0px";
+				editArea.tab_browsing_area.style.height	= (editArea.result.offsetTop - editArea.tab_browsing_area.offsetTop -1)+"px";
+			}
+			
+			height	= d.body.offsetHeight - editArea.get_all_toolbar_height() - 4;
+			editArea.result.style.height	= height +"px";
+			
+			width	= d.body.offsetWidth -2;
+			editArea.result.style.width		= width+"px";
+			//alert("result h: "+ height+" w: "+width+"\ntoolbar h: "+this.get_all_toolbar_height()+"\nbody_h: "+document.body.offsetHeight);
+			
+			// check that the popups don't get out of the screen
+			for( i=0; i < editArea.inlinePopup.length; i++ )
+			{
+				popup	= _$(editArea.inlinePopup[i]["popup_id"]);
+				maxLeft	= d.body.offsetWidth - popup.offsetWidth;
+				maxTop	= d.body.offsetHeight - popup.offsetHeight;
+				if( popup.offsetTop > maxTop )
+					popup.style.top		= maxTop+"px";
+				if( popup.offsetLeft > maxLeft )
+					popup.style.left	= maxLeft+"px";
+			}
+			
+			editArea.manage_size( true );
+			editArea.fixLinesHeight( editArea.textarea.value, 0,-1);
+		}		
+	};
+	
+	
+	EditArea.prototype.manage_size= function(onlyOneTime){
+		if(!editAreas[this.id])
+			return false;
+			
+		if(editAreas[this.id]["displayed"]==true && this.textareaFocused)
+		{
+			var area_height,resized= false;
+			
+			//1) Manage display width
+			//1.1) Calc the new width to use for display
+			if( !this.settings['word_wrap'] )
+			{
+				var area_width= this.textarea.scrollWidth;
+				area_height= this.textarea.scrollHeight;
+				// bug on old opera versions
+				if(this.isOpera && this.isOpera < 9.6 ){
+					area_width=10000; 								
+				}
+				//1.2) the width is not the same, we must resize elements
+				if(this.textarea.previous_scrollWidth!=area_width)
+				{	
+					this.container.style.width= area_width+"px";
+					this.textarea.style.width= area_width+"px";
+					this.content_highlight.style.width= area_width+"px";	
+					this.textarea.previous_scrollWidth=area_width;
+					resized=true;
+				}
+			}
+			// manage wrap width
+			if( this.settings['word_wrap'] )
+			{
+				newW=this.textarea.offsetWidth;
+				if( this.isFirefox || this.isIE )
+					newW-=2;
+				if( this.isSafari )
+					newW-=6;
+				this.content_highlight.style.width=this.selection_field_text.style.width=this.selection_field.style.width=this.test_font_size.style.width=newW+"px";
+			}
+			
+			//2) Manage display height
+			//2.1) Calc the new height to use for display
+			if( this.isOpera || this.isFirefox || this.isSafari ) { 
+				area_height= this.getLinePosTop( this.last_selection["nb_line"] + 1 );
+			} else {
+				area_height = this.textarea.scrollHeight;
+			}	
+			//2.2) the width is not the same, we must resize elements 
+			if(this.textarea.previous_scrollHeight!=area_height)	
+			{	
+				this.container.style.height= (area_height+2)+"px";
+				this.textarea.style.height= area_height+"px";
+				this.content_highlight.style.height= area_height+"px";	
+				this.textarea.previous_scrollHeight= area_height;
+				resized=true;
+			}
+		
+			//3) if there is new lines, we add new line numbers in the line numeration area
+			if(this.last_selection["nb_line"] >= this.line_number)
+			{
+				var newLines= '', destDiv=_$("line_number"), start=this.line_number, end=this.last_selection["nb_line"]+100;
+				for( i = start+1; i < end; i++ )
+				{
+					newLines+='<div id="line_'+ i +'">'+i+"</div>";
+					this.line_number++;
+				}
+				destDiv.innerHTML= destDiv.innerHTML + newLines;
+				
+				this.fixLinesHeight( this.textarea.value, start, -1 );
+			}
+		
+			//4) be sure the text is well displayed
+			this.textarea.scrollTop="0px";
+			this.textarea.scrollLeft="0px";
+			if(resized==true){
+				this.scroll_to_view();
+			}
+		}
+		
+		if(!onlyOneTime)
+			setTimeout("editArea.manage_size();", 100);
+	};
+	
+	EditArea.prototype.execCommand= function(cmd, param){
+		
+		for(var i in this.plugins){
+			if(typeof(this.plugins[i].execCommand)=="function"){
+				if(!this.plugins[i].execCommand(cmd, param))
+					return;
+			}
+		}
+		switch(cmd){
+			case "save":
+				if(this.settings["save_callback"].length>0)
+					eval("parent."+this.settings["save_callback"]+"('"+ this.id +"', editArea.textarea.value);");
+				break;
+			case "load":
+				if(this.settings["load_callback"].length>0)
+					eval("parent."+this.settings["load_callback"]+"('"+ this.id +"');");
+				break;
+			case "onchange":
+				if(this.settings["change_callback"].length>0)
+					eval("parent."+this.settings["change_callback"]+"('"+ this.id +"');");
+				break;		
+			case "EA_load":
+				if(this.settings["EA_load_callback"].length>0)
+					eval("parent."+this.settings["EA_load_callback"]+"('"+ this.id +"');");
+				break;
+			case "EA_unload":
+				if(this.settings["EA_unload_callback"].length>0)
+					eval("parent."+this.settings["EA_unload_callback"]+"('"+ this.id +"');");
+				break;
+			case "toggle_on":
+				if(this.settings["EA_toggle_on_callback"].length>0)
+					eval("parent."+this.settings["EA_toggle_on_callback"]+"('"+ this.id +"');");
+				break;
+			case "toggle_off":
+				if(this.settings["EA_toggle_off_callback"].length>0)
+					eval("parent."+this.settings["EA_toggle_off_callback"]+"('"+ this.id +"');");
+				break;
+			case "re_sync":
+				if(!this.do_highlight)
+					break;
+			case "file_switch_on":
+				if(this.settings["EA_file_switch_on_callback"].length>0)
+					eval("parent."+this.settings["EA_file_switch_on_callback"]+"(param);");
+				break;
+			case "file_switch_off":
+				if(this.settings["EA_file_switch_off_callback"].length>0)
+					eval("parent."+this.settings["EA_file_switch_off_callback"]+"(param);");
+				break;
+			case "file_close":
+				if(this.settings["EA_file_close_callback"].length>0)
+					return eval("parent."+this.settings["EA_file_close_callback"]+"(param);");
+				break;
+			
+			default:
+				if(typeof(eval("editArea."+cmd))=="function")
+				{
+					if(this.settings["debug"])
+						eval("editArea."+ cmd +"(param);");
+					else
+						try{eval("editArea."+ cmd +"(param);");}catch(e){};
+				}
+		}
+	};
+	
+	EditArea.prototype.get_translation= function(word, mode){
+		if(mode=="template")
+			return parent.editAreaLoader.translate(word, this.settings["language"], mode);
+		else
+			return parent.editAreaLoader.get_word_translation(word, this.settings["language"]);
+	};
+	
+	EditArea.prototype.add_plugin= function(plug_name, plug_obj){
+		for(var i=0; i<this.settings["plugins"].length; i++){
+			if(this.settings["plugins"][i]==plug_name){
+				this.plugins[plug_name]=plug_obj;
+				plug_obj.baseURL=parent.editAreaLoader.baseURL + "plugins/" + plug_name + "/";
+				if( typeof(plug_obj.init)=="function" )
+					plug_obj.init();
+			}
+		}
+	};
+	
+	EditArea.prototype.load_css= function(url){
+		try{
+			link = document.createElement("link");
+			link.type = "text/css";
+			link.rel= "stylesheet";
+			link.media="all";
+			link.href = url;
+			head = document.getElementsByTagName("head");
+			head[0].appendChild(link);
+		}catch(e){
+			document.write("<link href='"+ url +"' rel='stylesheet' type='text/css' />");
+		}
+	};
+	
+	EditArea.prototype.load_script= function(url){
+		try{
+			script = document.createElement("script");
+			script.type = "text/javascript";
+			script.src  = url;
+			script.charset= "UTF-8";
+			head = document.getElementsByTagName("head");
+			head[0].appendChild(script);
+		}catch(e){
+			document.write("<script type='text/javascript' src='" + url + "' charset=\"UTF-8\"><"+"/script>");
+		}
+	};
+	
+	// add plugin translation to language translation array
+	EditArea.prototype.add_lang= function(language, values){
+		if(!parent.editAreaLoader.lang[language])
+			parent.editAreaLoader.lang[language]={};
+		for(var i in values)
+			parent.editAreaLoader.lang[language][i]= values[i];
+	};
+	
+	// short cut for document.getElementById()
+	function _$(id){return document.getElementById( id );};
+
+	var editArea = new EditArea();	
+	parent.editAreaLoader.add_event(window, "load", init);
+	
+	function init(){		
+		setTimeout("editArea.init();  ", 10);
+	};


[10/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.js
deleted file mode 100644
index 27674f6..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area.js
+++ /dev/null
@@ -1,525 +0,0 @@
-/******
- *
- *	EditArea 
- * 	Developped by Christophe Dolivet
- *	Released under LGPL, Apache and BSD licenses (use the one you want)
- *
-******/
-
-	function EditArea(){
-		var t=this;
-		t.error= false;	// to know if load is interrrupt
-		
-		t.inlinePopup= [{popup_id: "area_search_replace", icon_id: "search"},
-									{popup_id: "edit_area_help", icon_id: "help"}];
-		t.plugins= {};
-	
-		t.line_number=0;
-		
-		parent.editAreaLoader.set_browser_infos(t); 	// navigator identification
-		// fix IE8 detection as we run in IE7 emulate mode through X-UA <meta> tag
-		if( t.isIE >= 8 )
-			t.isIE	= 7;
-		
-		t.last_selection={};		
-		t.last_text_to_highlight="";
-		t.last_hightlighted_text= "";
-		t.syntax_list= [];
-		t.allready_used_syntax= {};
-		t.check_line_selection_timer= 50;	// the timer delay for modification and/or selection change detection
-		
-		t.textareaFocused= false;
-		t.highlight_selection_line= null;
-		t.previous= [];
-		t.next= [];
-		t.last_undo="";
-		t.files= {};
-		t.filesIdAssoc= {};
-		t.curr_file= '';
-		//t.loaded= false;
-		t.assocBracket={};
-		t.revertAssocBracket= {};		
-		// bracket selection init 
-		t.assocBracket["("]=")";
-		t.assocBracket["{"]="}";
-		t.assocBracket["["]="]";		
-		for(var index in t.assocBracket){
-			t.revertAssocBracket[t.assocBracket[index]]=index;
-		}
-		t.is_editable= true;
-		
-		
-		/*t.textarea="";	
-		
-		t.state="declare";
-		t.code = []; // store highlight syntax for languagues*/
-		// font datas
-		t.lineHeight= 16;
-		/*t.default_font_family= "monospace";
-		t.default_font_size= 10;*/
-		t.tab_nb_char= 8;	//nb of white spaces corresponding to a tabulation
-		if(t.isOpera)
-			t.tab_nb_char= 6;
-
-		t.is_tabbing= false;
-		
-		t.fullscreen= {'isFull': false};
-		
-		t.isResizing=false;	// resize var
-		
-		// init with settings and ID (area_id is a global var defined by editAreaLoader on iframe creation
-		t.id= area_id;
-		t.settings= editAreas[t.id]["settings"];
-		
-		if((""+t.settings['replace_tab_by_spaces']).match(/^[0-9]+$/))
-		{
-			t.tab_nb_char= t.settings['replace_tab_by_spaces'];
-			t.tabulation="";
-			for(var i=0; i<t.tab_nb_char; i++)
-				t.tabulation+=" ";
-		}else{
-			t.tabulation="\t";
-		}
-			
-		// retrieve the init parameter for syntax
-		if(t.settings["syntax_selection_allow"] && t.settings["syntax_selection_allow"].length>0)
-			t.syntax_list= t.settings["syntax_selection_allow"].replace(/ /g,"").split(",");
-		
-		if(t.settings['syntax'])
-			t.allready_used_syntax[t.settings['syntax']]=true;
-		
-		
-	};
-	EditArea.prototype.init= function(){
-		var t=this, a, s=t.settings;
-		t.textarea			= _$("textarea");
-		t.container			= _$("container");
-		t.result			= _$("result");
-		t.content_highlight	= _$("content_highlight");
-		t.selection_field	= _$("selection_field");
-		t.selection_field_text= _$("selection_field_text");
-		t.processing_screen	= _$("processing");
-		t.editor_area		= _$("editor");
-		t.tab_browsing_area	= _$("tab_browsing_area");
-		t.test_font_size	= _$("test_font_size");
-		a = t.textarea;
-		
-		if(!s['is_editable'])
-			t.set_editable(false);
-		
-		t.set_show_line_colors( s['show_line_colors'] );
-		
-		if(syntax_selec= _$("syntax_selection"))
-		{
-			// set up syntax selection lsit in the toolbar
-			for(var i=0; i<t.syntax_list.length; i++) {
-				var syntax= t.syntax_list[i];
-				var option= document.createElement("option");
-				option.value= syntax;
-				if(syntax==s['syntax'])
-					option.selected= "selected";
-				option.innerHTML= t.get_translation("syntax_" + syntax, "word");
-				syntax_selec.appendChild(option);
-			}
-		}
-		
-		// add plugins buttons in the toolbar
-		spans= parent.getChildren(_$("toolbar_1"), "span", "", "", "all", -1);
-		
-		for(var i=0; i<spans.length; i++){
-		
-			id=spans[i].id.replace(/tmp_tool_(.*)/, "$1");
-			if(id!= spans[i].id){
-				for(var j in t.plugins){
-					if(typeof(t.plugins[j].get_control_html)=="function" ){
-						html=t.plugins[j].get_control_html(id);
-						if(html!=false){
-							html= t.get_translation(html, "template");
-							var new_span= document.createElement("span");
-							new_span.innerHTML= html;				
-							var father= spans[i].parentNode;
-							spans[i].parentNode.replaceChild(new_span, spans[i]);	
-							break; // exit the for loop					
-						}
-					}
-				}
-			}
-		}
-		
-		// init datas
-		//a.value	= 'a';//editAreas[t.id]["textarea"].value;
-	
-		if(s["debug"])
-		{
-			t.debug=parent.document.getElementById("edit_area_debug_"+t.id);
-		}
-		// init size		
-		//this.update_size();
-		
-		if(_$("redo") != null)
-			t.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
-		
-		// insert css rules for highlight mode		
-		if(typeof(parent.editAreaLoader.syntax[s["syntax"]])!="undefined"){
-			for(var i in parent.editAreaLoader.syntax){
-				if (typeof(parent.editAreaLoader.syntax[i]["styles"]) != "undefined"){
-					t.add_style(parent.editAreaLoader.syntax[i]["styles"]);
-				}
-			}
-		}
-	
-		// init key events
-		if(t.isOpera)
-			_$("editor").onkeypress	= keyDown;
-		else
-			_$("editor").onkeydown	= keyDown;
-
-		for(var i=0; i<t.inlinePopup.length; i++){
-			if(t.isOpera)
-				_$(t.inlinePopup[i]["popup_id"]).onkeypress	= keyDown;
-			else
-				_$(t.inlinePopup[i]["popup_id"]).onkeydown	= keyDown;
-		}
-		
-		if(s["allow_resize"]=="both" || s["allow_resize"]=="x" || s["allow_resize"]=="y")
-			t.allow_resize(true);
-		
-		parent.editAreaLoader.toggle(t.id, "on");
-		//a.focus();
-		// line selection init
-		t.change_smooth_selection_mode(editArea.smooth_selection);
-		// highlight
-		t.execCommand("change_highlight", s["start_highlight"]);
-	
-		// get font size datas		
-		t.set_font(editArea.settings["font_family"], editArea.settings["font_size"]);
-		
-		// set unselectable text
-		children= parent.getChildren(document.body, "", "selec", "none", "all", -1);
-		for(var i=0; i<children.length; i++){
-			if(t.isIE)
-				children[i].unselectable = true; // IE
-			else
-				children[i].onmousedown= function(){return false};
-		/*	children[i].style.MozUserSelect = "none"; // Moz
-			children[i].style.KhtmlUserSelect = "none";  // Konqueror/Safari*/
-		}
-		
-		a.spellcheck= s["gecko_spellcheck"];
-	
-		/** Browser specific style fixes **/
-		
-		// fix rendering bug for highlighted lines beginning with no tabs
-		if( t.isFirefox >= '3' ) {
-			t.content_highlight.style.paddingLeft= "1px";
-			t.selection_field.style.paddingLeft= "1px";
-			t.selection_field_text.style.paddingLeft= "1px";
-		}
-		
-		if(t.isIE && t.isIE < 8 ){
-			a.style.marginTop= "-1px";
-		}
-		/*
-		if(t.isOpera){
-			t.editor_area.style.position= "absolute";
-		}*/
-		
-		if( t.isSafari ){
-			t.editor_area.style.position	= "absolute";
-			a.style.marginLeft		="-3px";
-			if( t.isSafari < 3.2 ) // Safari 3.0 (3.1?)
-				a.style.marginTop	="1px";
-		}
-		
-		// si le textarea n'est pas grand, un click sous le textarea doit provoquer un focus sur le textarea
-		parent.editAreaLoader.add_event(t.result, "click", function(e){ if((e.target || e.srcElement)==editArea.result) { editArea.area_select(editArea.textarea.value.length, 0);}  });
-		
-		if(s['is_multi_files']!=false)
-			t.open_file({'id': t.curr_file, 'text': ''});
-	
-		t.set_word_wrap( s['word_wrap'] );
-		
-		setTimeout("editArea.focus();editArea.manage_size();editArea.execCommand('EA_load');", 10);		
-		//start checkup routine
-		t.check_undo();
-		t.check_line_selection(true);
-		t.scroll_to_view();
-		
-		for(var i in t.plugins){
-			if(typeof(t.plugins[i].onload)=="function")
-				t.plugins[i].onload();
-		}
-		if(s['fullscreen']==true)
-			t.toggle_full_screen(true);
-	
-		parent.editAreaLoader.add_event(window, "resize", editArea.update_size);
-		parent.editAreaLoader.add_event(parent.window, "resize", editArea.update_size);
-		parent.editAreaLoader.add_event(top.window, "resize", editArea.update_size);
-		parent.editAreaLoader.add_event(window, "unload", function(){
-			// in case where editAreaLoader have been already cleaned
-			if( parent.editAreaLoader )
-			{
-				parent.editAreaLoader.remove_event(parent.window, "resize", editArea.update_size);
-		  		parent.editAreaLoader.remove_event(top.window, "resize", editArea.update_size);
-			}
-			if(editAreas[editArea.id] && editAreas[editArea.id]["displayed"]){
-				editArea.execCommand("EA_unload");
-			}
-		});
-		
-		
-		/*date= new Date();
-		alert(date.getTime()- parent.editAreaLoader.start_time);*/
-	};
-	
-	
-	
-	//called by the toggle_on
-	EditArea.prototype.update_size= function(){
-		var d=document,pd=parent.document,height,width,popup,maxLeft,maxTop;
-		
-		if( typeof editAreas != 'undefined' && editAreas[editArea.id] && editAreas[editArea.id]["displayed"]==true){
-			if(editArea.fullscreen['isFull']){	
-				pd.getElementById("frame_"+editArea.id).style.width		= pd.getElementsByTagName("html")[0].clientWidth + "px";
-				pd.getElementById("frame_"+editArea.id).style.height	= pd.getElementsByTagName("html")[0].clientHeight + "px";
-			}
-			
-			if(editArea.tab_browsing_area.style.display=='block' && ( !editArea.isIE || editArea.isIE >= 8 ) )
-			{
-				editArea.tab_browsing_area.style.height	= "0px";
-				editArea.tab_browsing_area.style.height	= (editArea.result.offsetTop - editArea.tab_browsing_area.offsetTop -1)+"px";
-			}
-			
-			height	= d.body.offsetHeight - editArea.get_all_toolbar_height() - 4;
-			editArea.result.style.height	= height +"px";
-			
-			width	= d.body.offsetWidth -2;
-			editArea.result.style.width		= width+"px";
-			//alert("result h: "+ height+" w: "+width+"\ntoolbar h: "+this.get_all_toolbar_height()+"\nbody_h: "+document.body.offsetHeight);
-			
-			// check that the popups don't get out of the screen
-			for( i=0; i < editArea.inlinePopup.length; i++ )
-			{
-				popup	= _$(editArea.inlinePopup[i]["popup_id"]);
-				maxLeft	= d.body.offsetWidth - popup.offsetWidth;
-				maxTop	= d.body.offsetHeight - popup.offsetHeight;
-				if( popup.offsetTop > maxTop )
-					popup.style.top		= maxTop+"px";
-				if( popup.offsetLeft > maxLeft )
-					popup.style.left	= maxLeft+"px";
-			}
-			
-			editArea.manage_size( true );
-			editArea.fixLinesHeight( editArea.textarea.value, 0,-1);
-		}		
-	};
-	
-	
-	EditArea.prototype.manage_size= function(onlyOneTime){
-		if(!editAreas[this.id])
-			return false;
-			
-		if(editAreas[this.id]["displayed"]==true && this.textareaFocused)
-		{
-			var area_height,resized= false;
-			
-			//1) Manage display width
-			//1.1) Calc the new width to use for display
-			if( !this.settings['word_wrap'] )
-			{
-				var area_width= this.textarea.scrollWidth;
-				area_height= this.textarea.scrollHeight;
-				// bug on old opera versions
-				if(this.isOpera && this.isOpera < 9.6 ){
-					area_width=10000; 								
-				}
-				//1.2) the width is not the same, we must resize elements
-				if(this.textarea.previous_scrollWidth!=area_width)
-				{	
-					this.container.style.width= area_width+"px";
-					this.textarea.style.width= area_width+"px";
-					this.content_highlight.style.width= area_width+"px";	
-					this.textarea.previous_scrollWidth=area_width;
-					resized=true;
-				}
-			}
-			// manage wrap width
-			if( this.settings['word_wrap'] )
-			{
-				newW=this.textarea.offsetWidth;
-				if( this.isFirefox || this.isIE )
-					newW-=2;
-				if( this.isSafari )
-					newW-=6;
-				this.content_highlight.style.width=this.selection_field_text.style.width=this.selection_field.style.width=this.test_font_size.style.width=newW+"px";
-			}
-			
-			//2) Manage display height
-			//2.1) Calc the new height to use for display
-			if( this.isOpera || this.isFirefox || this.isSafari ) { 
-				area_height= this.getLinePosTop( this.last_selection["nb_line"] + 1 );
-			} else {
-				area_height = this.textarea.scrollHeight;
-			}	
-			//2.2) the width is not the same, we must resize elements 
-			if(this.textarea.previous_scrollHeight!=area_height)	
-			{	
-				this.container.style.height= (area_height+2)+"px";
-				this.textarea.style.height= area_height+"px";
-				this.content_highlight.style.height= area_height+"px";	
-				this.textarea.previous_scrollHeight= area_height;
-				resized=true;
-			}
-		
-			//3) if there is new lines, we add new line numbers in the line numeration area
-			if(this.last_selection["nb_line"] >= this.line_number)
-			{
-				var newLines= '', destDiv=_$("line_number"), start=this.line_number, end=this.last_selection["nb_line"]+100;
-				for( i = start+1; i < end; i++ )
-				{
-					newLines+='<div id="line_'+ i +'">'+i+"</div>";
-					this.line_number++;
-				}
-				destDiv.innerHTML= destDiv.innerHTML + newLines;
-				
-				this.fixLinesHeight( this.textarea.value, start, -1 );
-			}
-		
-			//4) be sure the text is well displayed
-			this.textarea.scrollTop="0px";
-			this.textarea.scrollLeft="0px";
-			if(resized==true){
-				this.scroll_to_view();
-			}
-		}
-		
-		if(!onlyOneTime)
-			setTimeout("editArea.manage_size();", 100);
-	};
-	
-	EditArea.prototype.execCommand= function(cmd, param){
-		
-		for(var i in this.plugins){
-			if(typeof(this.plugins[i].execCommand)=="function"){
-				if(!this.plugins[i].execCommand(cmd, param))
-					return;
-			}
-		}
-		switch(cmd){
-			case "save":
-				if(this.settings["save_callback"].length>0)
-					eval("parent."+this.settings["save_callback"]+"('"+ this.id +"', editArea.textarea.value);");
-				break;
-			case "load":
-				if(this.settings["load_callback"].length>0)
-					eval("parent."+this.settings["load_callback"]+"('"+ this.id +"');");
-				break;
-			case "onchange":
-				if(this.settings["change_callback"].length>0)
-					eval("parent."+this.settings["change_callback"]+"('"+ this.id +"');");
-				break;		
-			case "EA_load":
-				if(this.settings["EA_load_callback"].length>0)
-					eval("parent."+this.settings["EA_load_callback"]+"('"+ this.id +"');");
-				break;
-			case "EA_unload":
-				if(this.settings["EA_unload_callback"].length>0)
-					eval("parent."+this.settings["EA_unload_callback"]+"('"+ this.id +"');");
-				break;
-			case "toggle_on":
-				if(this.settings["EA_toggle_on_callback"].length>0)
-					eval("parent."+this.settings["EA_toggle_on_callback"]+"('"+ this.id +"');");
-				break;
-			case "toggle_off":
-				if(this.settings["EA_toggle_off_callback"].length>0)
-					eval("parent."+this.settings["EA_toggle_off_callback"]+"('"+ this.id +"');");
-				break;
-			case "re_sync":
-				if(!this.do_highlight)
-					break;
-			case "file_switch_on":
-				if(this.settings["EA_file_switch_on_callback"].length>0)
-					eval("parent."+this.settings["EA_file_switch_on_callback"]+"(param);");
-				break;
-			case "file_switch_off":
-				if(this.settings["EA_file_switch_off_callback"].length>0)
-					eval("parent."+this.settings["EA_file_switch_off_callback"]+"(param);");
-				break;
-			case "file_close":
-				if(this.settings["EA_file_close_callback"].length>0)
-					return eval("parent."+this.settings["EA_file_close_callback"]+"(param);");
-				break;
-			
-			default:
-				if(typeof(eval("editArea."+cmd))=="function")
-				{
-					if(this.settings["debug"])
-						eval("editArea."+ cmd +"(param);");
-					else
-						try{eval("editArea."+ cmd +"(param);");}catch(e){};
-				}
-		}
-	};
-	
-	EditArea.prototype.get_translation= function(word, mode){
-		if(mode=="template")
-			return parent.editAreaLoader.translate(word, this.settings["language"], mode);
-		else
-			return parent.editAreaLoader.get_word_translation(word, this.settings["language"]);
-	};
-	
-	EditArea.prototype.add_plugin= function(plug_name, plug_obj){
-		for(var i=0; i<this.settings["plugins"].length; i++){
-			if(this.settings["plugins"][i]==plug_name){
-				this.plugins[plug_name]=plug_obj;
-				plug_obj.baseURL=parent.editAreaLoader.baseURL + "plugins/" + plug_name + "/";
-				if( typeof(plug_obj.init)=="function" )
-					plug_obj.init();
-			}
-		}
-	};
-	
-	EditArea.prototype.load_css= function(url){
-		try{
-			link = document.createElement("link");
-			link.type = "text/css";
-			link.rel= "stylesheet";
-			link.media="all";
-			link.href = url;
-			head = document.getElementsByTagName("head");
-			head[0].appendChild(link);
-		}catch(e){
-			document.write("<link href='"+ url +"' rel='stylesheet' type='text/css' />");
-		}
-	};
-	
-	EditArea.prototype.load_script= function(url){
-		try{
-			script = document.createElement("script");
-			script.type = "text/javascript";
-			script.src  = url;
-			script.charset= "UTF-8";
-			head = document.getElementsByTagName("head");
-			head[0].appendChild(script);
-		}catch(e){
-			document.write("<script type='text/javascript' src='" + url + "' charset=\"UTF-8\"><"+"/script>");
-		}
-	};
-	
-	// add plugin translation to language translation array
-	EditArea.prototype.add_lang= function(language, values){
-		if(!parent.editAreaLoader.lang[language])
-			parent.editAreaLoader.lang[language]={};
-		for(var i in values)
-			parent.editAreaLoader.lang[language][i]= values[i];
-	};
-	
-	// short cut for document.getElementById()
-	function _$(id){return document.getElementById( id );};
-
-	var editArea = new EditArea();	
-	parent.editAreaLoader.add_event(window, "load", init);
-	
-	function init(){		
-		setTimeout("editArea.init();  ", 10);
-	};


[18/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_functions.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_functions.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_functions.js
new file mode 100644
index 0000000..984d4c6
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_functions.js
@@ -0,0 +1,1203 @@
+	//replace tabulation by the good number of white spaces
+	EditArea.prototype.replace_tab= function(text){
+		return text.replace(/((\n?)([^\t\n]*)\t)/gi, editArea.smartTab);		// slower than simple replace...	
+	};
+	
+	// call by the replace_tab function
+	EditArea.prototype.smartTab= function(){
+		val="                   ";
+		return EditArea.prototype.smartTab.arguments[2] + EditArea.prototype.smartTab.arguments[3] + val.substr(0, editArea.tab_nb_char - (EditArea.prototype.smartTab.arguments[3].length)%editArea.tab_nb_char);
+	};
+	
+	EditArea.prototype.show_waiting_screen= function(){
+		width	= this.editor_area.offsetWidth;
+		height	= this.editor_area.offsetHeight;
+		if( !(this.isIE && this.isIE<6) )
+		{
+			width	-= 2;
+			height	-= 2;
+		}
+		this.processing_screen.style.display= "block";
+		this.processing_screen.style.width	= width+"px";
+		this.processing_screen.style.height	= height+"px";
+		this.waiting_screen_displayed		= true;
+	};
+	
+	EditArea.prototype.hide_waiting_screen= function(){
+		this.processing_screen.style.display="none";
+		this.waiting_screen_displayed= false;
+	};
+	
+	EditArea.prototype.add_style= function(styles){
+		if(styles.length>0){
+			newcss = document.createElement("style");
+			newcss.type="text/css";
+			newcss.media="all";
+			if(newcss.styleSheet){ // IE
+				newcss.styleSheet.cssText = styles;
+			} else { // W3C
+				newcss.appendChild(document.createTextNode(styles));
+			}
+			document.getElementsByTagName("head")[0].appendChild(newcss);
+		}
+	};
+	
+	EditArea.prototype.set_font= function(family, size){
+		var t=this, a=this.textarea, s=this.settings, elem_font, i, elem;
+		// list all elements concerned by font changes
+		var elems= ["textarea", "content_highlight", "cursor_pos", "end_bracket", "selection_field", "selection_field_text", "line_number"];
+		
+		if(family && family!="")
+			s["font_family"]= family;
+		if(size && size>0)
+			s["font_size"]	= size;
+		if( t.isOpera && t.isOpera < 9.6 )	// opera<9.6 can't manage non monospace font
+			s['font_family']="monospace";
+			
+		// update the select tag
+		if( elem_font = _$("area_font_size") )
+		{	
+			for( i = 0; i < elem_font.length; i++ )
+			{
+				if( elem_font.options[i].value && elem_font.options[i].value == s["font_size"] )
+					elem_font.options[i].selected=true;
+			}
+		}
+		
+		/*
+		 * somethimes firefox has rendering mistake with non-monospace font for text width in textarea vs in div for changing font size (eg: verdana change between 11pt to 12pt)
+		 * => looks like a browser internal random bug as text width can change while content_highlight is updated
+		 * we'll check if the font-size produce the same text width inside textarea and div and if not, we'll increment the font-size
+		 * 
+		 * This is an ugly fix 
+		 */ 
+		if( t.isFirefox )
+		{
+			var nbTry = 3;
+			do {
+				var div1 = document.createElement( 'div' ), text1 = document.createElement( 'textarea' );
+				var styles = {
+					width:		'40px',
+					overflow:	'scroll',
+					zIndex: 	50,
+					visibility:	'hidden',
+					fontFamily:	s["font_family"],
+					fontSize:	s["font_size"]+"pt",
+					lineHeight:	t.lineHeight+"px",
+					padding:	'0',
+					margin:		'0',
+					border:		'none',
+					whiteSpace:	'nowrap'
+				};
+				var diff, changed = false;
+				for( i in styles )
+				{
+					div1.style[ i ]		= styles[i];
+					text1.style[ i ]	= styles[i];
+				}
+				// no wrap for this text
+				text1.wrap = 'off';
+				text1.setAttribute('wrap', 'off');
+				t.container.appendChild( div1 );
+				t.container.appendChild( text1 );
+				// try to make FF to bug
+				div1.innerHTML 		= text1.value	= 'azertyuiopqsdfghjklm';
+				div1.innerHTML 		= text1.value	= text1.value+'wxcvbn^p*ù$!:;,,';
+				diff	=  text1.scrollWidth - div1.scrollWidth;
+				
+				// firefox return here a diff of 1 px between equals scrollWidth (can't explain)
+				if( Math.abs( diff ) >= 2 )
+				{
+					s["font_size"]++;
+					changed	= true;
+				}
+				t.container.removeChild( div1 );
+				t.container.removeChild( text1 );
+				nbTry--;
+			}while( changed && nbTry > 0 );
+		}
+		
+		
+		// calc line height
+		elem					= t.test_font_size;
+		elem.style.fontFamily	= ""+s["font_family"];
+		elem.style.fontSize		= s["font_size"]+"pt";				
+		elem.innerHTML			= "0";		
+		t.lineHeight			= elem.offsetHeight;
+
+		// update font for all concerned elements
+		for( i=0; i<elems.length; i++)
+		{
+			elem	= _$(elems[i]);	
+			elem.style.fontFamily	= s["font_family"];
+			elem.style.fontSize		= s["font_size"]+"pt";
+			elem.style.lineHeight	= t.lineHeight+"px";
+		}
+		// define a css for <pre> tags
+		t.add_style("pre{font-family:"+s["font_family"]+"}");
+		
+		// old opera and IE>=8 doesn't update font changes to the textarea
+		if( ( t.isOpera && t.isOpera < 9.6 ) || t.isIE >= 8 )
+		{
+			var parNod = a.parentNode, nxtSib = a.nextSibling, start= a.selectionStart, end= a.selectionEnd;
+			parNod.removeChild(a);
+			parNod.insertBefore(a, nxtSib);
+			t.area_select(start, end-start);
+		}
+		
+		// force update of selection field
+		this.focus();
+		this.update_size();
+		this.check_line_selection();
+	};
+	
+	EditArea.prototype.change_font_size= function(){
+		var size=_$("area_font_size").value;
+		if(size>0)
+			this.set_font("", size);			
+	};
+	
+	
+	EditArea.prototype.open_inline_popup= function(popup_id){
+		this.close_all_inline_popup();
+		var popup= _$(popup_id);		
+		var editor= _$("editor");
+		
+		// search matching icon
+		for(var i=0; i<this.inlinePopup.length; i++){
+			if(this.inlinePopup[i]["popup_id"]==popup_id){
+				var icon= _$(this.inlinePopup[i]["icon_id"]);
+				if(icon){
+					this.switchClassSticky(icon, 'editAreaButtonSelected', true);			
+					break;
+				}
+			}
+		}
+		// check size
+		popup.style.height="auto";
+		popup.style.overflow= "visible";
+			
+		if(document.body.offsetHeight< popup.offsetHeight){
+			popup.style.height= (document.body.offsetHeight-10)+"px";
+			popup.style.overflow= "auto";
+		}
+		
+		if(!popup.positionned){
+			var new_left= editor.offsetWidth /2 - popup.offsetWidth /2;
+			var new_top= editor.offsetHeight /2 - popup.offsetHeight /2;
+			//var new_top= area.offsetHeight /2 - popup.offsetHeight /2;
+			//var new_left= area.offsetWidth /2 - popup.offsetWidth /2;
+			//alert("new_top: ("+new_top+") = calculeOffsetTop(area) ("+calculeOffsetTop(area)+") + area.offsetHeight /2("+ area.offsetHeight /2+") - popup.offsetHeight /2("+popup.offsetHeight /2+") - scrollTop: "+document.body.scrollTop);
+			popup.style.left= new_left+"px";
+			popup.style.top= new_top+"px";
+			popup.positionned=true;
+		}
+		popup.style.visibility="visible";
+		
+		//popup.style.display="block";
+	};
+
+	EditArea.prototype.close_inline_popup= function(popup_id){
+		var popup= _$(popup_id);		
+		// search matching icon
+		for(var i=0; i<this.inlinePopup.length; i++){
+			if(this.inlinePopup[i]["popup_id"]==popup_id){
+				var icon= _$(this.inlinePopup[i]["icon_id"]);
+				if(icon){
+					this.switchClassSticky(icon, 'editAreaButtonNormal', false);			
+					break;
+				}
+			}
+		}
+		
+		popup.style.visibility="hidden";	
+	};
+	
+	EditArea.prototype.close_all_inline_popup= function(e){
+		for(var i=0; i<this.inlinePopup.length; i++){
+			this.close_inline_popup(this.inlinePopup[i]["popup_id"]);		
+		}
+		this.textarea.focus();
+	};
+	
+	EditArea.prototype.show_help= function(){
+		
+		this.open_inline_popup("edit_area_help");
+		
+	};
+			
+	EditArea.prototype.new_document= function(){
+		this.textarea.value="";
+		this.area_select(0,0);
+	};
+	
+	EditArea.prototype.get_all_toolbar_height= function(){
+		var area= _$("editor");
+		var results= parent.getChildren(area, "div", "class", "area_toolbar", "all", "0");	// search only direct children
+		//results= results.concat(getChildren(area, "table", "class", "area_toolbar", "all", "0"));
+		var height=0;
+		for(var i=0; i<results.length; i++){			
+			height+= results[i].offsetHeight;
+		}
+		//alert("toolbar height: "+height);
+		return height;
+	};
+	
+	EditArea.prototype.go_to_line= function(line){	
+		if(!line)
+		{	
+			var icon= _$("go_to_line");
+			if(icon != null){
+				this.restoreClass(icon);
+				this.switchClassSticky(icon, 'editAreaButtonSelected', true);
+			}
+			
+			line= prompt(this.get_translation("go_to_line_prompt"));
+			if(icon != null)
+				this.switchClassSticky(icon, 'editAreaButtonNormal', false);
+		}
+		if(line && line!=null && line.search(/^[0-9]+$/)!=-1){
+			var start=0;
+			var lines= this.textarea.value.split("\n");
+			if(line > lines.length)
+				start= this.textarea.value.length;
+			else{
+				for(var i=0; i<Math.min(line-1, lines.length); i++)
+					start+= lines[i].length + 1;
+			}
+			this.area_select(start, 0);
+		}
+		
+		
+	};
+	
+	
+	EditArea.prototype.change_smooth_selection_mode= function(setTo){
+		//alert("setTo: "+setTo);
+		if(this.do_highlight)
+			return;
+			
+		if(setTo != null){
+			if(setTo === false)
+				this.smooth_selection=true;
+			else
+				this.smooth_selection=false;
+		}
+		var icon= _$("change_smooth_selection");
+		this.textarea.focus();
+		if(this.smooth_selection===true){
+			//setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );
+			/*setAttribute(icon, "oldClassName", "editAreaButtonNormal" );
+			setAttribute(icon, "className", "editAreaButtonNormal" );*/
+			//this.restoreClass(icon);
+			//this.restoreAndSwitchClass(icon,'editAreaButtonNormal');
+			this.switchClassSticky(icon, 'editAreaButtonNormal', false);
+			
+			this.smooth_selection=false;
+			this.selection_field.style.display= "none";
+			_$("cursor_pos").style.display= "none";
+			_$("end_bracket").style.display= "none";
+		}else{
+			//setAttribute(icon, "class", getAttribute(icon, "class") + " selected");
+			//this.switchClass(icon,'editAreaButtonSelected');
+			this.switchClassSticky(icon, 'editAreaButtonSelected', false);
+			this.smooth_selection=true;
+			this.selection_field.style.display= "block";
+			_$("cursor_pos").style.display= "block";
+			_$("end_bracket").style.display= "block";
+		}	
+	};
+	
+	// the auto scroll of the textarea has some lacks when it have to show cursor in the visible area when the textarea size change
+	// show specifiy whereas it is the "top" or "bottom" of the selection that is showned
+	EditArea.prototype.scroll_to_view= function(show){
+		var zone, lineElem;
+		if(!this.smooth_selection)
+			return;
+		zone= _$("result");
+		
+		// manage height scroll
+		var cursor_pos_top= _$("cursor_pos").cursor_top;
+		if(show=="bottom")
+		{
+			//cursor_pos_top+=  (this.last_selection["line_nb"]-1)* this.lineHeight;
+			cursor_pos_top+= this.getLinePosTop( this.last_selection['line_start'] + this.last_selection['line_nb'] - 1 );
+		}
+			
+		var max_height_visible= zone.clientHeight + zone.scrollTop;
+		var miss_top	= cursor_pos_top + this.lineHeight - max_height_visible;
+		if(miss_top>0){
+			//alert(miss_top);
+			zone.scrollTop=  zone.scrollTop + miss_top;
+		}else if( zone.scrollTop > cursor_pos_top){
+			// when erase all the content -> does'nt scroll back to the top
+			//alert("else: "+cursor_pos_top);
+			zone.scrollTop= cursor_pos_top;	 
+		}
+		
+		// manage left scroll
+		//var cursor_pos_left= parseInt(_$("cursor_pos").style.left.replace("px",""));
+		var cursor_pos_left= _$("cursor_pos").cursor_left;
+		var max_width_visible= zone.clientWidth + zone.scrollLeft;
+		var miss_left= cursor_pos_left + 10 - max_width_visible;
+		if(miss_left>0){			
+			zone.scrollLeft= zone.scrollLeft + miss_left + 50;
+		}else if( zone.scrollLeft > cursor_pos_left){
+			zone.scrollLeft= cursor_pos_left ;
+		}else if( zone.scrollLeft == 45){
+			// show the line numbers if textarea align to it's left
+			zone.scrollLeft=0;
+		}
+	};
+	
+	EditArea.prototype.check_undo= function(only_once){
+		if(!editAreas[this.id])
+			return false;
+		if(this.textareaFocused && editAreas[this.id]["displayed"]==true){
+			var text=this.textarea.value;
+			if(this.previous.length<=1)
+				this.switchClassSticky(_$("undo"), 'editAreaButtonDisabled', true);
+		
+			if(!this.previous[this.previous.length-1] || this.previous[this.previous.length-1]["text"] != text){
+				this.previous.push({"text": text, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd});
+				if(this.previous.length > this.settings["max_undo"]+1)
+					this.previous.shift();
+				
+			}
+			if(this.previous.length >= 2)
+				this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false);		
+		}
+
+		if(!only_once)
+			setTimeout("editArea.check_undo()", 3000);
+	};
+	
+	EditArea.prototype.undo= function(){
+		//alert("undo"+this.previous.length);
+		if(this.previous.length > 0)
+		{
+			this.getIESelection();
+		//	var pos_cursor=this.textarea.selectionStart;
+			this.next.push( { "text": this.textarea.value, "selStart": this.textarea.selectionStart, "selEnd": this.textarea.selectionEnd } );
+			var prev= this.previous.pop();
+			if( prev["text"] == this.textarea.value && this.previous.length > 0 )
+				prev	=this.previous.pop();						
+			this.textarea.value	= prev["text"];
+			this.last_undo		= prev["text"];
+			this.area_select(prev["selStart"], prev["selEnd"]-prev["selStart"]);
+			this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false);
+			this.resync_highlight(true);
+			//alert("undo"+this.previous.length);
+			this.check_file_changes();
+		}
+	};
+	
+	EditArea.prototype.redo= function(){
+		if(this.next.length > 0)
+		{
+			/*this.getIESelection();*/
+			//var pos_cursor=this.textarea.selectionStart;
+			var next= this.next.pop();
+			this.previous.push(next);
+			this.textarea.value= next["text"];
+			this.last_undo= next["text"];
+			this.area_select(next["selStart"], next["selEnd"]-next["selStart"]);
+			this.switchClassSticky(_$("undo"), 'editAreaButtonNormal', false);
+			this.resync_highlight(true);
+			this.check_file_changes();
+		}
+		if(	this.next.length == 0)
+			this.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
+	};
+	
+	EditArea.prototype.check_redo= function(){
+		if(editArea.next.length == 0 || editArea.textarea.value!=editArea.last_undo){
+			editArea.next= [];	// undo the ability to use "redo" button
+			editArea.switchClassSticky(_$("redo"), 'editAreaButtonDisabled', true);
+		}
+		else
+		{
+			this.switchClassSticky(_$("redo"), 'editAreaButtonNormal', false);
+		}
+	};
+	
+	
+	// functions that manage icons roll over, disabled, etc...
+	EditArea.prototype.switchClass = function(element, class_name, lock_state) {
+		var lockChanged = false;
+	
+		if (typeof(lock_state) != "undefined" && element != null) {
+			element.classLock = lock_state;
+			lockChanged = true;
+		}
+	
+		if (element != null && (lockChanged || !element.classLock)) {
+			element.oldClassName = element.className;
+			element.className = class_name;
+		}
+	};
+	
+	EditArea.prototype.restoreAndSwitchClass = function(element, class_name) {
+		if (element != null && !element.classLock) {
+			this.restoreClass(element);
+			this.switchClass(element, class_name);
+		}
+	};
+	
+	EditArea.prototype.restoreClass = function(element) {
+		if (element != null && element.oldClassName && !element.classLock) {
+			element.className = element.oldClassName;
+			element.oldClassName = null;
+		}
+	};
+	
+	EditArea.prototype.setClassLock = function(element, lock_state) {
+		if (element != null)
+			element.classLock = lock_state;
+	};
+	
+	EditArea.prototype.switchClassSticky = function(element, class_name, lock_state) {
+		var lockChanged = false;
+		if (typeof(lock_state) != "undefined" && element != null) {
+			element.classLock = lock_state;
+			lockChanged = true;
+		}
+	
+		if (element != null && (lockChanged || !element.classLock)) {
+			element.className = class_name;
+			element.oldClassName = class_name;
+		}
+	};
+	
+	//make the "page up" and "page down" buttons works correctly
+	EditArea.prototype.scroll_page= function(params){
+		var dir= params["dir"], shift_pressed= params["shift"];
+		var lines= this.textarea.value.split("\n");		
+		var new_pos=0, length=0, char_left=0, line_nb=0, curLine=0;
+		var toScrollAmount	= _$("result").clientHeight -30;
+		var nbLineToScroll	= 0, diff= 0;
+		
+		if(dir=="up"){
+			nbLineToScroll	= Math.ceil( toScrollAmount / this.lineHeight );
+			
+			// fix number of line to scroll
+			for( i = this.last_selection["line_start"]; i - diff > this.last_selection["line_start"] - nbLineToScroll ; i-- )
+			{
+				if( elem = _$('line_'+ i) )
+				{
+					diff +=  Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight );
+				}
+			}
+			nbLineToScroll	-= diff;
+			
+			if(this.last_selection["selec_direction"]=="up"){
+				for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]-nbLineToScroll, lines.length); line_nb++){
+					new_pos+= lines[line_nb].length + 1;
+				}
+				char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1);
+				if(shift_pressed)
+					length=this.last_selection["selectionEnd"]-new_pos-char_left;	
+				this.area_select(new_pos+char_left, length);
+				view="top";
+			}else{			
+				view="bottom";
+				for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-1-nbLineToScroll, lines.length); line_nb++){
+					new_pos+= lines[line_nb].length + 1;
+				}
+				char_left=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]-1);
+				if(shift_pressed){
+					//length=this.last_selection["selectionEnd"]-new_pos-char_left;	
+					start= Math.min(this.last_selection["selectionStart"], new_pos+char_left);
+					length= Math.max(new_pos+char_left, this.last_selection["selectionStart"] )- start ;
+					if(new_pos+char_left < this.last_selection["selectionStart"])
+						view="top";
+				}else
+					start=new_pos+char_left;
+				this.area_select(start, length);
+				
+			}
+		}
+		else
+		{
+			var nbLineToScroll= Math.floor( toScrollAmount / this.lineHeight );
+			// fix number of line to scroll
+			for( i = this.last_selection["line_start"]; i + diff < this.last_selection["line_start"] + nbLineToScroll ; i++ )
+			{
+				if( elem = _$('line_'+ i) )
+				{
+					diff +=  Math.floor( ( elem.offsetHeight - 1 ) / this.lineHeight );
+				}
+			}
+			nbLineToScroll	-= diff;
+				
+			if(this.last_selection["selec_direction"]=="down"){
+				view="bottom";
+				for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+this.last_selection["line_nb"]-2+nbLineToScroll, lines.length); line_nb++){
+					if(line_nb==this.last_selection["line_start"]-1)
+						char_left= this.last_selection["selectionStart"] -new_pos;
+					new_pos+= lines[line_nb].length + 1;
+									
+				}
+				if(shift_pressed){
+					length=Math.abs(this.last_selection["selectionStart"]-new_pos);	
+					length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"]);
+					//length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left);
+					this.area_select(Math.min(this.last_selection["selectionStart"], new_pos), length);
+				}else{
+					this.area_select(new_pos+char_left, 0);
+				}
+				
+			}else{
+				view="top";
+				for(line_nb=0; line_nb< Math.min(this.last_selection["line_start"]+nbLineToScroll-1, lines.length, lines.length); line_nb++){
+					if(line_nb==this.last_selection["line_start"]-1)
+						char_left= this.last_selection["selectionStart"] -new_pos;
+					new_pos+= lines[line_nb].length + 1;									
+				}
+				if(shift_pressed){
+					length=Math.abs(this.last_selection["selectionEnd"]-new_pos-char_left);	
+					length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, this.last_selection["curr_pos"])- char_left-1;
+					//length+=Math.min(lines[Math.min(lines.length-1, line_nb)].length, char_left);
+					this.area_select(Math.min(this.last_selection["selectionEnd"], new_pos+char_left), length);
+					if(new_pos+char_left > this.last_selection["selectionEnd"])
+						view="bottom";
+				}else{
+					this.area_select(new_pos+char_left, 0);
+				}
+				
+			}
+		}
+		//console.log( new_pos, char_left, length, nbLineToScroll, toScrollAmount, _$("result").clientHeigh );
+		this.check_line_selection();
+		this.scroll_to_view(view);
+	};
+	
+	EditArea.prototype.start_resize= function(e){
+		parent.editAreaLoader.resize["id"]		= editArea.id;		
+		parent.editAreaLoader.resize["start_x"]	= (e)? e.pageX : event.x + document.body.scrollLeft;		
+		parent.editAreaLoader.resize["start_y"]	= (e)? e.pageY : event.y + document.body.scrollTop;
+		if(editArea.isIE)
+		{
+			editArea.textarea.focus();
+			editArea.getIESelection();
+		}
+		parent.editAreaLoader.resize["selectionStart"]	= editArea.textarea.selectionStart;
+		parent.editAreaLoader.resize["selectionEnd"]	= editArea.textarea.selectionEnd;
+		parent.editAreaLoader.start_resize_area();
+	};
+	
+	EditArea.prototype.toggle_full_screen= function(to){
+		var t=this, p=parent, a=t.textarea, html, frame, selStart, selEnd, old, icon;
+		if(typeof(to)=="undefined")
+			to= !t.fullscreen['isFull'];
+		old			= t.fullscreen['isFull'];
+		t.fullscreen['isFull']= to;
+		icon		= _$("fullscreen");
+		selStart	= t.textarea.selectionStart;
+		selEnd		= t.textarea.selectionEnd;
+		html		= p.document.getElementsByTagName("html")[0];
+		frame		= p.document.getElementById("frame_"+t.id);
+		
+		if(to && to!=old)
+		{	// toogle on fullscreen		
+			
+			t.fullscreen['old_overflow']	= p.get_css_property(html, "overflow");
+			t.fullscreen['old_height']		= p.get_css_property(html, "height");
+			t.fullscreen['old_width']		= p.get_css_property(html, "width");
+			t.fullscreen['old_scrollTop']	= html.scrollTop;
+			t.fullscreen['old_scrollLeft']	= html.scrollLeft;
+			t.fullscreen['old_zIndex']		= p.get_css_property(frame, "z-index");
+			if(t.isOpera){
+				html.style.height	= "100%";
+				html.style.width	= "100%";	
+			}
+			html.style.overflow	= "hidden";
+			html.scrollTop		= 0;
+			html.scrollLeft		= 0;
+			
+			frame.style.position	= "absolute";
+			frame.style.width		= html.clientWidth+"px";
+			frame.style.height		= html.clientHeight+"px";
+			frame.style.display		= "block";
+			frame.style.zIndex		= "999999";
+			frame.style.top			= "0px";
+			frame.style.left		= "0px";
+			
+			// if the iframe was in a div with position absolute, the top and left are the one of the div, 
+			// so I fix it by seeing at witch position the iframe start and correcting it
+			frame.style.top			= "-"+p.calculeOffsetTop(frame)+"px";
+			frame.style.left		= "-"+p.calculeOffsetLeft(frame)+"px";
+			
+		//	parent.editAreaLoader.execCommand(t.id, "update_size();");
+		//	var body=parent.document.getElementsByTagName("body")[0];
+		//	body.appendChild(frame);
+			
+			t.switchClassSticky(icon, 'editAreaButtonSelected', false);
+			t.fullscreen['allow_resize']= t.resize_allowed;
+			t.allow_resize(false);
+	
+			//t.area_select(selStart, selEnd-selStart);
+			
+		
+			// opera can't manage to do a direct size update
+			if(t.isFirefox){
+				p.editAreaLoader.execCommand(t.id, "update_size();");
+				t.area_select(selStart, selEnd-selStart);
+				t.scroll_to_view();
+				t.focus();
+			}else{
+				setTimeout("p.editAreaLoader.execCommand('"+ t.id +"', 'update_size();');editArea.focus();", 10);
+			}	
+			
+	
+		}
+		else if(to!=old)
+		{	// toogle off fullscreen
+			frame.style.position="static";
+			frame.style.zIndex= t.fullscreen['old_zIndex'];
+		
+			if(t.isOpera)
+			{
+				html.style.height	= "auto"; 
+				html.style.width	= "auto";
+				html.style.overflow	= "auto";
+			}
+			else if(t.isIE && p!=top)
+			{	// IE doesn't manage html overflow in frames like in normal page... 
+				html.style.overflow	= "auto";
+			}
+			else
+			{
+				html.style.overflow	= t.fullscreen['old_overflow'];
+			}
+			html.scrollTop	= t.fullscreen['old_scrollTop'];
+			html.scrollLeft	= t.fullscreen['old_scrollLeft'];
+		
+			p.editAreaLoader.hide(t.id);
+			p.editAreaLoader.show(t.id);
+			
+			t.switchClassSticky(icon, 'editAreaButtonNormal', false);
+			if(t.fullscreen['allow_resize'])
+				t.allow_resize(t.fullscreen['allow_resize']);
+			if(t.isFirefox){
+				t.area_select(selStart, selEnd-selStart);
+				setTimeout("editArea.scroll_to_view();", 10);
+			}			
+			
+			//p.editAreaLoader.remove_event(p.window, "resize", editArea.update_size);
+		}
+		
+	};
+	
+	EditArea.prototype.allow_resize= function(allow){
+		var resize= _$("resize_area");
+		if(allow){
+			
+			resize.style.visibility="visible";
+			parent.editAreaLoader.add_event(resize, "mouseup", editArea.start_resize);
+		}else{
+			resize.style.visibility="hidden";
+			parent.editAreaLoader.remove_event(resize, "mouseup", editArea.start_resize);
+		}
+		this.resize_allowed= allow;
+	};
+	
+	
+	EditArea.prototype.change_syntax= function(new_syntax, is_waiting){
+	//	alert("cahnge to "+new_syntax);
+		// the syntax is the same
+		if(new_syntax==this.settings['syntax'])
+			return true;
+		
+		// check that the syntax is one allowed
+		var founded= false;
+		for(var i=0; i<this.syntax_list.length; i++)
+		{
+			if(this.syntax_list[i]==new_syntax)
+				founded= true;
+		}
+		
+		if(founded==true)
+		{
+			// the reg syntax file is not loaded
+			if(!parent.editAreaLoader.load_syntax[new_syntax])
+			{
+				// load the syntax file and wait for file loading
+				if(!is_waiting)
+					parent.editAreaLoader.load_script(parent.editAreaLoader.baseURL + "reg_syntax/" + new_syntax + ".js");
+				setTimeout("editArea.change_syntax('"+ new_syntax +"', true);", 100);
+				this.show_waiting_screen();
+			}
+			else
+			{
+				if(!this.allready_used_syntax[new_syntax])
+				{	// the syntax has still not been used
+					// rebuild syntax definition for new languages
+					parent.editAreaLoader.init_syntax_regexp();
+					// add style to the new list
+					this.add_style(parent.editAreaLoader.syntax[new_syntax]["styles"]);
+					this.allready_used_syntax[new_syntax]=true;
+				}
+				// be sure that the select option is correctly updated
+				var sel= _$("syntax_selection");
+				if(sel && sel.value!=new_syntax)
+				{
+					for(var i=0; i<sel.length; i++){
+						if(sel.options[i].value && sel.options[i].value == new_syntax)
+							sel.options[i].selected=true;
+					}
+				}
+				
+			/*	if(this.settings['syntax'].length==0)
+				{
+					this.switchClassSticky(_$("highlight"), 'editAreaButtonNormal', false);
+					this.switchClassSticky(_$("reset_highlight"), 'editAreaButtonNormal', false);
+					this.change_highlight(true);
+				}
+				*/
+				this.settings['syntax']= new_syntax;
+				this.resync_highlight(true);
+				this.hide_waiting_screen();
+				return true;
+			}
+		}
+		return false;
+	};
+	
+	
+	// check if the file has changed
+	EditArea.prototype.set_editable= function(is_editable){
+		if(is_editable)
+		{
+			document.body.className= "";
+			this.textarea.readOnly= false;
+			this.is_editable= true;
+		}
+		else
+		{
+			document.body.className= "non_editable";
+			this.textarea.readOnly= true;
+			this.is_editable= false;
+		}
+		
+		if(editAreas[this.id]["displayed"]==true)
+			this.update_size();
+	};
+	
+	/***** Wrap mode *****/
+	
+	// toggling function for set_wrap_mode
+	EditArea.prototype.toggle_word_wrap= function(){
+		this.set_word_wrap( !this.settings['word_wrap'] );
+	};
+	
+	
+	// open a new tab for the given file
+	EditArea.prototype.set_word_wrap= function(to){
+		var t=this, a= t.textarea;
+		
+		if( t.isOpera )
+		{
+			this.settings['word_wrap']= false;
+			t.switchClassSticky( _$("word_wrap"), 'editAreaButtonDisabled', true );
+			return false;
+		}
+		
+		if( to )
+		{
+			wrap_mode = 'soft';
+			this.container.className+= ' word_wrap';
+			this.container.style.width="";
+			this.content_highlight.style.width="";
+			a.style.width="100%";
+			if( t.isIE && t.isIE < 7 )	// IE 6 count 50 px too much
+			{
+				a.style.width	= ( a.offsetWidth-5 )+"px";
+			}
+			
+			t.switchClassSticky( _$("word_wrap"), 'editAreaButtonSelected', false );
+		}
+		else
+		{
+			wrap_mode = 'off';
+			this.container.className	= this.container.className.replace(/word_wrap/g, '');
+			t.switchClassSticky( _$("word_wrap"), 'editAreaButtonNormal', true );
+		}
+		this.textarea.previous_scrollWidth = '';
+		this.textarea.previous_scrollHeight = '';
+		
+		a.wrap= wrap_mode;
+		a.setAttribute('wrap', wrap_mode);
+		// only IE can change wrap mode on the fly without element reloading
+		if(!this.isIE)
+		{
+			var start=a.selectionStart, end= a.selectionEnd;
+			var parNod = a.parentNode, nxtSib = a.nextSibling;
+			parNod.removeChild(a);
+			parNod.insertBefore(a, nxtSib);
+			this.area_select(start, end-start);
+		}
+		// reset some optimisation
+		this.settings['word_wrap']	= to;
+		this.focus();
+		this.update_size();
+		this.check_line_selection();
+	};	
+	/***** tabbed files managing functions *****/
+	
+	// open a new tab for the given file
+	EditArea.prototype.open_file= function(settings){
+		
+		if(settings['id']!="undefined")
+		{
+			var id= settings['id'];
+			// create a new file object with defautl values
+			var new_file= {};
+			new_file['id']			= id;
+			new_file['title']		= id;
+			new_file['text']		= "";
+			new_file['last_selection']	= "";		
+			new_file['last_text_to_highlight']	= "";
+			new_file['last_hightlighted_text']	= "";
+			new_file['previous']	= [];
+			new_file['next']		= [];
+			new_file['last_undo']	= "";
+			new_file['smooth_selection']	= this.settings['smooth_selection'];
+			new_file['do_highlight']= this.settings['start_highlight'];
+			new_file['syntax']		= this.settings['syntax'];
+			new_file['scroll_top']	= 0;
+			new_file['scroll_left']	= 0;
+			new_file['selection_start']= 0;
+			new_file['selection_end']= 0;
+			new_file['edited']		= false;
+			new_file['font_size']	= this.settings["font_size"];
+			new_file['font_family']	= this.settings["font_family"];
+			new_file['word_wrap']	= this.settings["word_wrap"];
+			new_file['toolbar']		= {'links':{}, 'selects': {}};
+			new_file['compare_edited_text']= new_file['text'];
+			
+			
+			this.files[id]= new_file;
+			this.update_file(id, settings);
+			this.files[id]['compare_edited_text']= this.files[id]['text'];
+			
+			
+			var html_id= 'tab_file_'+encodeURIComponent(id);
+			this.filesIdAssoc[html_id]= id;
+			this.files[id]['html_id']= html_id;
+		
+			if(!_$(this.files[id]['html_id']) && id!="")
+			{
+				// be sure the tab browsing area is displayed
+				this.tab_browsing_area.style.display= "block";
+				var elem= document.createElement('li');
+				elem.id= this.files[id]['html_id'];
+				var close= "<img src=\""+ parent.editAreaLoader.baseURL +"images/close.gif\" title=\""+ this.get_translation('close_tab', 'word') +"\" onclick=\"editArea.execCommand('close_file', editArea.filesIdAssoc['"+ html_id +"']);return false;\" class=\"hidden\" onmouseover=\"this.className=''\" onmouseout=\"this.className='hidden'\" />";
+				elem.innerHTML= "<a onclick=\"javascript:editArea.execCommand('switch_to_file', editArea.filesIdAssoc['"+ html_id +"']);\" selec=\"none\"><b><span><strong class=\"edited\">*</strong>"+ this.files[id]['title'] + close +"</span></b></a>";
+				_$('tab_browsing_list').appendChild(elem);
+				var elem= document.createElement('text');
+				this.update_size();
+			}
+			
+			// open file callback (for plugin)
+			if(id!="")
+				this.execCommand('file_open', this.files[id]);
+			
+			this.switch_to_file(id, true);
+			return true;
+		}
+		else
+			return false;
+	};
+	
+	// close the given file
+	EditArea.prototype.close_file= function(id){
+		if(this.files[id])
+		{
+			this.save_file(id);
+			
+			// close file callback
+			if(this.execCommand('file_close', this.files[id])!==false)
+			{
+				// remove the tab in the toolbar
+				var li= _$(this.files[id]['html_id']);
+				li.parentNode.removeChild(li);
+				// select a new file
+				if(id== this.curr_file)
+				{
+					var next_file= "";
+					var is_next= false;
+					for(var i in this.files)
+					{
+						if( is_next )
+						{
+							next_file	= i;
+							break;
+						}
+						else if( i == id )
+							is_next		= true;
+						else
+							next_file	= i;
+					}
+					// display the next file
+					this.switch_to_file(next_file);
+				}
+				// clear datas
+				delete (this.files[id]);
+				this.update_size();
+			}	
+		}
+	};
+	
+	// backup current file datas
+	EditArea.prototype.save_file= function(id){
+		var t= this, save, a_links, a_selects, save_butt, img, i;
+		if(t.files[id])
+		{
+			var save= t.files[id];
+			save['last_selection']			= t.last_selection;		
+			save['last_text_to_highlight']	= t.last_text_to_highlight;
+			save['last_hightlighted_text']	= t.last_hightlighted_text;
+			save['previous']				= t.previous;
+			save['next']					= t.next;
+			save['last_undo']				= t.last_undo;
+			save['smooth_selection']		= t.smooth_selection;
+			save['do_highlight']			= t.do_highlight;
+			save['syntax']					= t.settings['syntax'];
+			save['text']					= t.textarea.value;
+			save['scroll_top']				= t.result.scrollTop;
+			save['scroll_left']				= t.result.scrollLeft;
+			save['selection_start']			= t.last_selection["selectionStart"];
+			save['selection_end']			= t.last_selection["selectionEnd"];
+			save['font_size']				= t.settings["font_size"];
+			save['font_family']				= t.settings["font_family"];
+			save['word_wrap']				= t.settings["word_wrap"];
+			save['toolbar']					= {'links':{}, 'selects': {}};
+			
+			// save toolbar buttons state for fileSpecific buttons
+			a_links= _$("toolbar_1").getElementsByTagName("a");
+			for( i=0; i<a_links.length; i++ )
+			{
+				if( a_links[i].getAttribute('fileSpecific') == 'yes' )
+				{
+					save_butt	= {};
+					img			= a_links[i].getElementsByTagName('img')[0];
+					save_butt['classLock']		= img.classLock;
+					save_butt['className']		= img.className;
+					save_butt['oldClassName']	= img.oldClassName;
+					
+					save['toolbar']['links'][a_links[i].id]= save_butt;
+				}
+			}
+			
+			// save toolbar select state for fileSpecific buttons
+			a_selects= _$("toolbar_1").getElementsByTagName("select");
+			for( i=0; i<a_selects.length; i++)
+			{
+				if(a_selects[i].getAttribute('fileSpecific')=='yes')
+				{
+					save['toolbar']['selects'][a_selects[i].id]= a_selects[i].value;
+				}
+			}
+				
+			t.files[id]= save;
+			
+			return save;
+		}
+		
+		return false;
+	};
+	
+	// update file_datas
+	EditArea.prototype.update_file= function(id, new_values){
+		for(var i in new_values)
+		{
+			this.files[id][i]= new_values[i];
+		}
+	};
+	
+	// display file datas
+	EditArea.prototype.display_file= function(id){
+		var t = this, a= t.textarea, new_file, a_lis, a_selects, a_links, a_options, i, j;
+		
+		// we're showing the empty file
+		if(id=='')
+		{
+			a.readOnly= true;
+			t.tab_browsing_area.style.display= "none";
+			_$("no_file_selected").style.display= "block";
+			t.result.className= "empty";
+			// clear current datas
+			if(!t.files[''])
+			{
+				t.open_file({id: ''});
+			}
+		}
+		// we try to show a non existent file, so we left
+		else if( typeof( t.files[id] ) == 'undefined' )
+		{
+			return false;
+		}
+		// display a normal file
+		else
+		{
+			t.result.className= "";
+			a.readOnly= !t.is_editable;
+			_$("no_file_selected").style.display= "none";
+			t.tab_browsing_area.style.display= "block";
+		}
+		
+		// ensure to have last state for undo/redo actions
+		t.check_redo(true);
+		t.check_undo(true);
+		t.curr_file= id;
+		
+		// replace selected tab file
+		a_lis= t.tab_browsing_area.getElementsByTagName('li');
+		for( i=0; i<a_lis.length; i++)
+		{
+			if(a_lis[i].id == t.files[id]['html_id'])
+				a_lis[i].className='selected';
+			else
+				a_lis[i].className='';
+		}
+		
+		// replace next files datas
+		new_file= t.files[id];
+	
+		// restore text content
+		a.value= new_file['text'];
+		
+		// restore font-size
+		t.set_font(new_file['font_family'], new_file['font_size']);
+		
+		// restore selection and scroll
+		t.area_select(new_file['last_selection']['selection_start'], new_file['last_selection']['selection_end'] - new_file['last_selection']['selection_start']);
+		t.manage_size(true);
+		t.result.scrollTop= new_file['scroll_top'];
+		t.result.scrollLeft= new_file['scroll_left'];
+		
+		// restore undo, redo
+		t.previous=	new_file['previous'];
+		t.next=	new_file['next'];
+		t.last_undo=	new_file['last_undo'];
+		t.check_redo(true);
+		t.check_undo(true);
+		
+		// restore highlight
+		t.execCommand("change_highlight", new_file['do_highlight']);
+		t.execCommand("change_syntax", new_file['syntax']);
+		
+		// smooth mode
+		t.execCommand("change_smooth_selection_mode", new_file['smooth_selection']);
+		
+		// word_wrap
+		t.execCommand("set_word_wrap", new_file['word_wrap']);
+			
+		// restore links state in toolbar
+		a_links= new_file['toolbar']['links'];
+		for( i in a_links)
+		{
+			if( img =  _$(i).getElementsByTagName('img')[0] )
+			{
+				img.classLock	= a_links[i]['classLock'];
+				img.className	= a_links[i]['className'];
+				img.oldClassName= a_links[i]['oldClassName'];
+			}
+		}
+		
+		// restore select state in toolbar
+		a_selects = new_file['toolbar']['selects'];
+		for( i in a_selects)
+		{
+			a_options	= _$(i).options;
+			for( j=0; j<a_options.length; j++)
+			{
+				if( a_options[j].value == a_selects[i] )
+					_$(i).options[j].selected=true;
+			}
+		}
+	
+	};
+
+	// change tab for displaying a new one
+	EditArea.prototype.switch_to_file= function(file_to_show, force_refresh){
+		if(file_to_show!=this.curr_file || force_refresh)
+		{
+			this.save_file(this.curr_file);
+			if(this.curr_file!='')
+				this.execCommand('file_switch_off', this.files[this.curr_file]);
+			this.display_file(file_to_show);
+			if(file_to_show!='')
+				this.execCommand('file_switch_on', this.files[file_to_show]);
+		}
+	};
+
+	// get all infos for the given file
+	EditArea.prototype.get_file= function(id){
+		if(id==this.curr_file)
+			this.save_file(id);
+		return this.files[id];
+	};
+	
+	// get all available files infos
+	EditArea.prototype.get_all_files= function(){
+		tmp_files= this.files;
+		this.save_file(this.curr_file);
+		if(tmp_files[''])
+			delete(this.files['']);
+		return tmp_files;
+	};
+	
+	
+	// check if the file has changed
+	EditArea.prototype.check_file_changes= function(){
+	
+		var id= this.curr_file;
+		if(this.files[id] && this.files[id]['compare_edited_text']!=undefined)
+		{
+			if(this.files[id]['compare_edited_text'].length==this.textarea.value.length && this.files[id]['compare_edited_text']==this.textarea.value)
+			{
+				if(this.files[id]['edited']!= false)
+					this.set_file_edited_mode(id, false);
+			}
+			else
+			{
+				if(this.files[id]['edited']!= true)
+					this.set_file_edited_mode(id, true);
+			}
+		}
+	};
+	
+	// set if the file is edited or not
+	EditArea.prototype.set_file_edited_mode= function(id, to){
+		// change CSS for edited tab
+		if(this.files[id] && _$(this.files[id]['html_id']))
+		{
+			var link= _$(this.files[id]['html_id']).getElementsByTagName('a')[0];
+			if(to==true)
+			{
+				link.className= 'edited';
+			}
+			else
+			{
+				link.className= '';
+				if(id==this.curr_file)
+					text= this.textarea.value;
+				else
+					text= this.files[id]['text'];
+				this.files[id]['compare_edited_text']= text;
+			}
+				
+			this.files[id]['edited']= to;
+		}
+	};
+
+	EditArea.prototype.set_show_line_colors = function(new_value){
+		this.show_line_colors = new_value;
+		
+		if( new_value )
+			this.selection_field.className	+= ' show_colors';
+		else
+			this.selection_field.className	= this.selection_field.className.replace( / show_colors/g, '' );
+	};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_loader.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_loader.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_loader.js
new file mode 100644
index 0000000..34a17dd
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_loader.js
@@ -0,0 +1,1080 @@
+/******
+ *
+ *	EditArea 
+ * 	Developped by Christophe Dolivet
+ *	Released under LGPL, Apache and BSD licenses (use the one you want)
+ *
+******/
+
+function EditAreaLoader(){
+	var t=this;
+	t.version= "0.8.1.1";
+	date= new Date();
+	t.start_time=date.getTime();
+	t.win= "loading";	// window loading state
+	t.error= false;	// to know if load is interrrupt
+	t.baseURL="";
+	//t.suffix="";
+	t.template="";
+	t.lang= {};	// array of loaded speech language
+	t.load_syntax= {};	// array of loaded syntax language for highlight mode
+	t.syntax= {};	// array of initilized syntax language for highlight mode
+	t.loadedFiles= [];
+	t.waiting_loading= {}; 	// files that must be loaded in order to allow the script to really start
+	// scripts that must be loaded in the iframe
+	t.scripts_to_load= ["elements_functions", "resize_area", "reg_syntax"];
+	t.sub_scripts_to_load= ["edit_area", "manage_area" ,"edit_area_functions", "keyboard", "search_replace", "highlight", "regexp"];
+	
+	t.resize= []; // contain resizing datas
+	t.hidden= {};	// store datas of the hidden textareas
+	
+	t.default_settings= {
+		//id: "src"	// id of the textarea to transform
+		debug: false
+		,smooth_selection: true
+		,font_size: "10"		// not for IE
+		,font_family: "monospace"	// can be "verdana,monospace". Allow non monospace font but Firefox get smaller tabulation with non monospace fonts. IE doesn't change the tabulation width and Opera doesn't take this option into account... 
+		,start_highlight: false	// if start with highlight
+		,toolbar: "search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, change_smooth_selection, highlight, reset_highlight, word_wrap, |, help"
+		,begin_toolbar: ""		//  "new_document, save, load, |"
+		,end_toolbar: ""		// or end_toolbar
+		,is_multi_files: false		// enable the multi file mode (the textarea content is ignored)
+		,allow_resize: "both"	// possible values: "no", "both", "x", "y"
+		,show_line_colors: false	// if the highlight is disabled for the line currently beeing edited (if enabled => heavy CPU use)
+		,min_width: 400
+		,min_height: 125
+		,replace_tab_by_spaces: false
+		,allow_toggle: true		// true or false
+		,language: "en"
+		,syntax: ""
+		,syntax_selection_allow: "basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml"
+		,display: "onload" 		// onload or later
+		,max_undo: 30
+		,browsers: "known"	// all or known
+		,plugins: "" // comma separated plugin list
+		,gecko_spellcheck: false	// enable/disable by default the gecko_spellcheck
+		,fullscreen: false
+		,is_editable: true
+		,cursor_position: "begin"
+		,word_wrap: false		// define if the text is wrapped of not in the textarea
+		,autocompletion: false	// NOT IMPLEMENTED			
+		,load_callback: ""		// click on load button (function name)
+		,save_callback: ""		// click on save button (function name)
+		,change_callback: ""	// textarea onchange trigger (function name)
+		,submit_callback: ""	// form submited (function name)
+		,EA_init_callback: ""	// EditArea initiliazed (function name)
+		,EA_delete_callback: ""	// EditArea deleted (function name)
+		,EA_load_callback: ""	// EditArea fully loaded and displayed (function name)
+		,EA_unload_callback: ""	// EditArea delete while being displayed (function name)
+		,EA_toggle_on_callback: ""	// EditArea toggled on (function name)
+		,EA_toggle_off_callback: ""	// EditArea toggled off (function name)
+		,EA_file_switch_on_callback: ""	// a new tab is selected (called for the newly selected file)
+		,EA_file_switch_off_callback: ""	// a new tab is selected (called for the previously selected file)
+		,EA_file_close_callback: ""		// close a tab
+	};
+	
+	t.advanced_buttons = [
+			// id, button img, command (it will try to find the translation of "id"), is_file_specific
+			['new_document', 'newdocument.gif', 'new_document', false],
+			['search', 'search.gif', 'show_search', false],
+			['go_to_line', 'go_to_line.gif', 'go_to_line', false],
+			['undo', 'undo.gif', 'undo', true],
+			['redo', 'redo.gif', 'redo', true],
+			['change_smooth_selection', 'smooth_selection.gif', 'change_smooth_selection_mode', true],
+			['reset_highlight', 'reset_highlight.gif', 'resync_highlight', true],
+			['highlight', 'highlight.gif','change_highlight', true],
+			['help', 'help.gif', 'show_help', false],
+			['save', 'save.gif', 'save', false],
+			['load', 'load.gif', 'load', false],
+			['fullscreen', 'fullscreen.gif', 'toggle_full_screen', false],
+			['word_wrap', 'word_wrap.gif', 'toggle_word_wrap', true],
+			['autocompletion', 'autocompletion.gif', 'toggle_autocompletion', true]
+		];
+			
+	// navigator identification
+	t.set_browser_infos(t);
+
+	if(t.isIE>=6 || t.isGecko || ( t.isWebKit && !t.isSafari<3 ) || t.isOpera>=9  || t.isCamino )
+		t.isValidBrowser=true;
+	else
+		t.isValidBrowser=false;
+
+	t.set_base_url();		
+	
+	for(var i=0; i<t.scripts_to_load.length; i++){
+		setTimeout("editAreaLoader.load_script('"+t.baseURL + t.scripts_to_load[i]+ ".js');", 1);	// let the time to Object editAreaLoader to be created before loading additionnal scripts
+		t.waiting_loading[t.scripts_to_load[i]+ ".js"]= false;
+	}
+	t.add_event(window, "load", EditAreaLoader.prototype.window_loaded);
+};
+	
+EditAreaLoader.prototype ={
+	has_error : function(){
+		this.error= true;
+		// set to empty all EditAreaLoader functions
+		for(var i in EditAreaLoader.prototype){
+			EditAreaLoader.prototype[i]=function(){};		
+		}
+	},
+	
+	// add browser informations to the object passed in parameter
+	set_browser_infos : function(o){
+		ua= navigator.userAgent;
+		
+		// general detection
+		o.isWebKit	= /WebKit/.test(ua);
+		o.isGecko	= !o.isWebKit && /Gecko/.test(ua);
+		o.isMac		= /Mac/.test(ua);
+		
+		o.isIE	= (navigator.appName == "Microsoft Internet Explorer");
+		if(o.isIE){
+			o.isIE = ua.replace(/^.*?MSIE\s+([0-9\.]+).*$/, "$1");
+			if(o.isIE<6)
+				o.has_error();
+		}
+
+		if(o.isOpera = (ua.indexOf('Opera') != -1)){	
+			o.isOpera= ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i, "$1");
+			if(o.isOpera<9)
+				o.has_error();
+			o.isIE=false;			
+		}
+
+		if(o.isFirefox =(ua.indexOf('Firefox') != -1))
+			o.isFirefox = ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i, "$1");
+		// Firefox clones 	
+		if( ua.indexOf('Iceweasel') != -1 )
+			o.isFirefox	= ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i, "$1");
+		if( ua.indexOf('GranParadiso') != -1 )
+			o.isFirefox	= ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i, "$1");
+		if( ua.indexOf('BonEcho') != -1 )
+			o.isFirefox	= ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i, "$1");
+		if( ua.indexOf('SeaMonkey') != -1)
+			o.isFirefox = (ua.replace(/^.*?SeaMonkey.*?([0-9\.]+).*$/i, "$1") ) + 1;
+			
+		if(o.isCamino =(ua.indexOf('Camino') != -1))
+			o.isCamino = ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i, "$1");
+			
+		if(o.isSafari =(ua.indexOf('Safari') != -1))
+			o.isSafari= ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i, "$1");
+	
+		if(o.isChrome =(ua.indexOf('Chrome') != -1)) {
+			o.isChrome = ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i, "$1");
+			o.isSafari	= false;
+		}
+		
+	},
+	
+	window_loaded : function(){
+		editAreaLoader.win="loaded";
+		
+		// add events on forms
+		if (document.forms) {
+			for (var i=0; i<document.forms.length; i++) {
+				var form = document.forms[i];
+				form.edit_area_replaced_submit=null;
+				try {
+					
+					form.edit_area_replaced_submit = form.onsubmit;
+					form.onsubmit="";
+				} catch (e) {// Do nothing
+				}
+				editAreaLoader.add_event(form, "submit", EditAreaLoader.prototype.submit);
+				editAreaLoader.add_event(form, "reset", EditAreaLoader.prototype.reset);
+			}
+		}
+		editAreaLoader.add_event(window, "unload", function(){for(var i in editAreas){editAreaLoader.delete_instance(i);}});	// ini callback
+	},
+	
+	// init the checkup of the selection of the IE textarea
+	init_ie_textarea : function(id){
+		var a=document.getElementById(id);
+		try{
+			if(a && typeof(a.focused)=="undefined"){
+				a.focus();
+				a.focused=true;
+				a.selectionStart= a.selectionEnd= 0;			
+				get_IE_selection(a);
+				editAreaLoader.add_event(a, "focus", IE_textarea_focus);
+				editAreaLoader.add_event(a, "blur", IE_textarea_blur);
+				
+			}
+		}catch(ex){}
+	},
+		
+	init : function(settings){
+		var t=this,s=settings,i;
+		
+		if(!s["id"])
+			t.has_error();
+		if(t.error)
+			return;
+		// if an instance of the editor already exists for this textarea => delete the previous one
+		if(editAreas[s["id"]])
+			t.delete_instance(s["id"]);
+	
+		// init settings
+		for(i in t.default_settings){
+			if(typeof(s[i])=="undefined")
+				s[i]=t.default_settings[i];
+		}
+		
+		if(s["browsers"]=="known" && t.isValidBrowser==false){
+			return;
+		}
+		
+		if(s["begin_toolbar"].length>0)
+			s["toolbar"]= s["begin_toolbar"] +","+ s["toolbar"];
+		if(s["end_toolbar"].length>0)
+			s["toolbar"]= s["toolbar"] +","+ s["end_toolbar"];
+		s["tab_toolbar"]= s["toolbar"].replace(/ /g,"").split(",");
+		
+		s["plugins"]= s["plugins"].replace(/ /g,"").split(",");
+		for(i=0; i<s["plugins"].length; i++){
+			if(s["plugins"][i].length==0)
+				s["plugins"].splice(i,1);
+		}
+	//	alert(settings["plugins"].length+": "+ settings["plugins"].join(","));
+		t.get_template();
+		t.load_script(t.baseURL + "langs/"+ s["language"] + ".js");
+		
+		if(s["syntax"].length>0){
+			s["syntax"]=s["syntax"].toLowerCase();
+			t.load_script(t.baseURL + "reg_syntax/"+ s["syntax"] + ".js");
+		}
+		//alert(this.template);
+		
+		editAreas[s["id"]]= {"settings": s};
+		editAreas[s["id"]]["displayed"]=false;
+		editAreas[s["id"]]["hidden"]=false;
+		
+		//if(settings["display"]=="onload")
+		t.start(s["id"]);
+	},
+	
+	// delete an instance of an EditArea
+	delete_instance : function(id){
+		var d=document,fs=window.frames,span,iframe;
+		editAreaLoader.execCommand(id, "EA_delete");
+		if(fs["frame_"+id] && fs["frame_"+id].editArea)
+		{
+			if(editAreas[id]["displayed"])
+				editAreaLoader.toggle(id, "off");
+			fs["frame_"+id].editArea.execCommand("EA_unload");
+		}
+
+		// remove toggle infos and debug textarea
+		span= d.getElementById("EditAreaArroundInfos_"+id);
+		if(span)
+			span.parentNode.removeChild(span);
+
+		// remove the iframe
+		iframe= d.getElementById("frame_"+id);
+		if(iframe){
+			iframe.parentNode.removeChild(iframe);
+			//delete iframe;
+			try {
+				delete fs["frame_"+id];
+			} catch (e) {// Do nothing
+			}
+		}	
+
+		delete editAreas[id];
+	},
+
+	
+	start : function(id){
+		var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;
+		
+		// check that the window is loaded
+		if(t.win!="loaded"){
+			setTimeout("editAreaLoader.start('"+id+"');", 50);
+			return;
+		}
+		
+		// check that all needed scripts are loaded
+		for( i in t.waiting_loading){
+			if(t.waiting_loading[i]!="loaded" && typeof(t.waiting_loading[i])!="function"){
+				setTimeout("editAreaLoader.start('"+id+"');", 50);
+				return;
+			}
+		}
+		
+		// wait until language and syntax files are loaded
+		if(!t.lang[editAreas[id]["settings"]["language"]] || (editAreas[id]["settings"]["syntax"].length>0 && !t.load_syntax[editAreas[id]["settings"]["syntax"]]) ){
+			setTimeout("editAreaLoader.start('"+id+"');", 50);
+			return;
+		}
+		// init the regexp for syntax highlight
+		if(editAreas[id]["settings"]["syntax"].length>0)
+			t.init_syntax_regexp();
+		
+			
+		// display toggle option and debug area
+		if(!d.getElementById("EditAreaArroundInfos_"+id) && (editAreas[id]["settings"]["debug"] || editAreas[id]["settings"]["allow_toggle"]))
+		{
+			span= d.createElement("span");
+			span.id= "EditAreaArroundInfos_"+id;
+			if(editAreas[id]["settings"]["allow_toggle"]){
+				checked=(editAreas[id]["settings"]["display"]=="onload")?"checked='checked'":"";
+				html+="<div id='edit_area_toggle_"+i+"'>";
+				html+="<input id='edit_area_toggle_checkbox_"+ id +"' class='toggle_"+ id +"' type='checkbox' onclick='editAreaLoader.toggle(\""+ id +"\");' accesskey='e' "+checked+" />";
+				html+="<label for='edit_area_toggle_checkbox_"+ id +"'>{$toggle}</label></div>";	
+			}
+			if(editAreas[id]["settings"]["debug"])
+				html+="<textarea id='edit_area_debug_"+ id +"' spellcheck='off' style='z-index: 20; width: 100%; height: 120px;overflow: auto; border: solid black 1px;'></textarea><br />";				
+			html= t.translate(html, editAreas[id]["settings"]["language"]);				
+			span.innerHTML= html;				
+			father= d.getElementById(id).parentNode;
+			next= d.getElementById(id).nextSibling;
+			if(next==null)
+				father.appendChild(span);
+			else
+				father.insertBefore(span, next);
+		}
+		
+		if(!editAreas[id]["initialized"])
+		{
+			t.execCommand(id, "EA_init");	// ini callback
+			if(editAreas[id]["settings"]["display"]=="later"){
+				editAreas[id]["initialized"]= true;
+				return;
+			}
+		}
+		
+		if(t.isIE){	// launch IE selection checkup
+			t.init_ie_textarea(id);
+		}
+				
+		// get toolbar content
+		area=editAreas[id];
+		
+		for(i=0; i<area["settings"]["tab_toolbar"].length; i++){
+		//	alert(this.tab_toolbar[i]+"\n"+ this.get_control_html(this.tab_toolbar[i]));
+			html_toolbar_content+= t.get_control_html(area["settings"]["tab_toolbar"][i], area["settings"]["language"]);
+		}
+		// translate toolbar text here for chrome 2
+		html_toolbar_content = t.translate(html_toolbar_content, area["settings"]["language"], "template"); 
+		
+		
+		// create javascript import rules for the iframe if the javascript has not been already loaded by the compressor
+		if(!t.iframe_script){
+			t.iframe_script="";
+			for(i=0; i<t.sub_scripts_to_load.length; i++)
+				t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + t.sub_scripts_to_load[i] +'.js"></script>';
+		}
+		
+		// add plugins scripts if not already loaded by the compressor (but need to load language in all the case)
+		for(i=0; i<area["settings"]["plugins"].length; i++){
+			//if(typeof(area["settings"]["plugins"][i])=="function") continue;
+			if(!t.all_plugins_loaded)
+				t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + 'plugins/' + area["settings"]["plugins"][i] + '/' + area["settings"]["plugins"][i] +'.js"></script>';
+			t.iframe_script+='<script language="javascript" type="text/javascript" src="'+ t.baseURL + 'plugins/' + area["settings"]["plugins"][i] + '/langs/' + area["settings"]["language"] +'.js"></script>';
+		}
+	
+		
+		// create css link for the iframe if the whole css text has not been already loaded by the compressor
+		if(!t.iframe_css){
+			t.iframe_css="<link href='"+ t.baseURL +"edit_area.css' rel='stylesheet' type='text/css' />";
+		}
+		
+		
+		// create template
+		template= t.template.replace(/\[__BASEURL__\]/g, t.baseURL);
+		template= template.replace("[__TOOLBAR__]",html_toolbar_content);
+			
+		
+		// fill template with good language sentences
+		template= t.translate(template, area["settings"]["language"], "template");
+		
+		// add css_code
+		template= template.replace("[__CSSRULES__]", t.iframe_css);				
+		// add js_code
+		template= template.replace("[__JSCODE__]", t.iframe_script);
+		
+		// add version_code
+		template= template.replace("[__EA_VERSION__]", t.version);
+		//template=template.replace(/\{\$([^\}]+)\}/gm, this.traduc_template);
+		
+		//editAreas[area["settings"]["id"]]["template"]= template;
+		
+		area.textarea=d.getElementById(area["settings"]["id"]);
+		editAreas[area["settings"]["id"]]["textarea"]=area.textarea;
+	
+		// if removing previous instances from DOM before (fix from Marcin)
+		if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined') 
+			delete window.frames["frame_"+area["settings"]["id"]];
+		
+		// insert template in the document after the textarea
+		father= area.textarea.parentNode;
+	/*	var container= document.createElement("div");
+		container.id= "EditArea_frame_container_"+area["settings"]["id"];
+	*/	
+		content= d.createElement("iframe");
+		content.name= "frame_"+area["settings"]["id"];
+		content.id= "frame_"+area["settings"]["id"];
+		content.style.borderWidth= "0px";
+		setAttribute(content, "frameBorder", "0"); // IE
+		content.style.overflow="hidden";
+		content.style.display="none";
+
+		
+		next= area.textarea.nextSibling;
+		if(next==null)
+			father.appendChild(content);
+		else
+			father.insertBefore(content, next) ;		
+		f=window.frames["frame_"+area["settings"]["id"]];
+		f.document.open();
+		f.editAreas=editAreas;
+		f.area_id= area["settings"]["id"];	
+		f.document.area_id= area["settings"]["id"];	
+		f.document.write(template);
+		f.document.close();
+
+	//	frame.editAreaLoader=this;
+		//editAreas[area["settings"]["id"]]["displayed"]=true;
+		
+	},
+	
+	toggle : function(id, toggle_to){
+
+	/*	if((editAreas[id]["displayed"]==true  && toggle_to!="on") || toggle_to=="off"){
+			this.toggle_off(id);
+		}else if((editAreas[id]["displayed"]==false  && toggle_to!="off") || toggle_to=="on"){
+			this.toggle_on(id);
+		}*/
+		if(!toggle_to)
+			toggle_to= (editAreas[id]["displayed"]==true)?"off":"on";
+		if(editAreas[id]["displayed"]==true  && toggle_to=="off"){
+			this.toggle_off(id);
+		}else if(editAreas[id]["displayed"]==false  && toggle_to=="on"){
+			this.toggle_on(id);
+		}
+	
+		return false;
+	},
+	
+	// static function
+	toggle_off : function(id){
+		var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;
+		if(fs["frame_"+id])
+		{	
+			f	= fs["frame_"+id];
+			t	= editAreas[id]["textarea"];
+			if(f.editArea.fullscreen['isFull'])
+				f.editArea.toggle_full_screen(false);
+			editAreas[id]["displayed"]=false;
+			
+			// set wrap to off to keep same display mode (some browser get problem with this, so it need more complex operation		
+			t.wrap = "off";	// for IE
+			setAttribute(t, "wrap", "off");	// for Firefox	
+			parNod = t.parentNode;
+			nxtSib = t.nextSibling;
+			parNod.removeChild(t); 
+			parNod.insertBefore(t, nxtSib);
+			
+			// restore values
+			t.value= f.editArea.textarea.value;
+			selStart	= f.editArea.last_selection["selectionStart"];
+			selEnd		= f.editArea.last_selection["selectionEnd"];
+			scrollTop	= f.document.getElementById("result").scrollTop;
+			scrollLeft	= f.document.getElementById("result").scrollLeft;
+			
+			
+			document.getElementById("frame_"+id).style.display='none';
+		
+			t.style.display="inline";
+
+			try{	// IE will give an error when trying to focus an invisible or disabled textarea
+				t.focus();
+			} catch(e){};
+			if(this.isIE){
+				t.selectionStart= selStart;
+				t.selectionEnd	= selEnd;
+				t.focused		= true;
+				set_IE_selection(t);
+			}else{
+				if(this.isOpera && this.isOpera < 9.6 ){	// Opera bug when moving selection start and selection end
+					t.setSelectionRange(0, 0);
+				}
+				try{
+					t.setSelectionRange(selStart, selEnd);
+				} catch(e) {};
+			}
+			t.scrollTop= scrollTop;
+			t.scrollLeft= scrollLeft;
+			f.editArea.execCommand("toggle_off");
+
+		}
+	},	
+	
+	// static function
+	toggle_on : function(id){
+		var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;
+			
+		if(fs["frame_"+id])
+		{
+			f	= fs["frame_"+id];
+			t	= editAreas[id]["textarea"];
+			area= f.editArea;
+			area.textarea.value= t.value;
+			
+			// store display values;
+			curPos	= editAreas[id]["settings"]["cursor_position"];
+
+			if(t.use_last==true)
+			{
+				selStart	= t.last_selectionStart;
+				selEnd		= t.last_selectionEnd;
+				scrollTop	= t.last_scrollTop;
+				scrollLeft	= t.last_scrollLeft;
+				t.use_last=false;
+			}
+			else if( curPos == "auto" )
+			{
+				try{
+					selStart	= t.selectionStart;
+					selEnd		= t.selectionEnd;
+					scrollTop	= t.scrollTop;
+					scrollLeft	= t.scrollLeft;
+					//alert(scrollTop);
+				}catch(ex){}
+			}
+			
+			// set to good size
+			this.set_editarea_size_from_textarea(id, document.getElementById("frame_"+id));
+			t.style.display="none";			
+			document.getElementById("frame_"+id).style.display="inline";
+			area.execCommand("focus"); // without this focus opera doesn't manage well the iframe body height
+			
+			
+			// restore display values
+			editAreas[id]["displayed"]=true;
+			area.execCommand("update_size");
+			
+			f.document.getElementById("result").scrollTop= scrollTop;
+			f.document.getElementById("result").scrollLeft= scrollLeft;
+			area.area_select(selStart, selEnd-selStart);
+			area.execCommand("toggle_on");
+
+			
+		}
+		else
+		{
+		/*	if(this.isIE)
+				get_IE_selection(document.getElementById(id));	*/	
+			elem= document.getElementById(id);	
+			elem.last_selectionStart= elem.selectionStart;
+			elem.last_selectionEnd= elem.selectionEnd;
+			elem.last_scrollTop= elem.scrollTop;
+			elem.last_scrollLeft= elem.scrollLeft;
+			elem.use_last=true;
+			editAreaLoader.start(id);
+		}
+	},	
+	
+	set_editarea_size_from_textarea : function(id, frame){	
+		var elem,width,height;
+		elem	= document.getElementById(id);
+		
+		width	= Math.max(editAreas[id]["settings"]["min_width"], elem.offsetWidth)+"px";
+		height	= Math.max(editAreas[id]["settings"]["min_height"], elem.offsetHeight)+"px";
+		if(elem.style.width.indexOf("%")!=-1)
+			width	= elem.style.width;
+		if(elem.style.height.indexOf("%")!=-1)
+			height	= elem.style.height;
+		//alert("h: "+height+" w: "+width);
+	
+		frame.style.width= width;
+		frame.style.height= height;
+	},
+		
+	set_base_url : function(){
+		var t=this,elems,i,docBasePath;
+
+		if( !this.baseURL ){
+			elems = document.getElementsByTagName('script');
+	
+			for( i=0; i<elems.length; i++ ){
+				if (elems[i].src && elems[i].src.match(/edit_area_[^\\\/]*$/i) ) {
+					var src = elems[i].src;
+					src = src.substring(0, src.lastIndexOf('/'));
+					this.baseURL = src;
+					this.file_name= elems[i].src.substr(elems[i].src.lastIndexOf("/")+1);
+					break;
+				}
+			}
+		}
+		
+		docBasePath	= document.location.href;
+		if (docBasePath.indexOf('?') != -1)
+			docBasePath	= docBasePath.substring(0, docBasePath.indexOf('?'));
+		docBasePath	= docBasePath.substring(0, docBasePath.lastIndexOf('/'));
+	
+		// If not HTTP absolute
+		if (t.baseURL.indexOf('://') == -1 && t.baseURL.charAt(0) != '/') {
+			// If site absolute
+			t.baseURL = docBasePath + "/" + t.baseURL;
+		}
+		t.baseURL	+="/";	
+	},
+	
+	get_button_html : function(id, img, exec, isFileSpecific, baseURL) {
+		var cmd,html;
+		if(!baseURL)
+			baseURL= this.baseURL;
+		cmd	= 'editArea.execCommand(\'' + exec + '\')';
+		html	= '<a id="a_'+ id +'" href="javascript:' + cmd + '" onclick="' + cmd + ';return false;" onmousedown="return false;" target="_self" fileSpecific="'+ (isFileSpecific?'yes':'no') +'">';
+		html	+= '<img id="' + id + '" src="'+ baseURL +'images/' + img + '" title="{$' + id + '}" width="20" height="20" class="editAreaButtonNormal" onmouseover="editArea.switchClass(this,\'editAreaButtonOver\');" onmouseout="editArea.restoreClass(this);" onmousedown="editArea.restoreAndSwitchClass(this,\'editAreaButtonDown\');" /></a>';
+		return html;
+	},
+
+	get_control_html : function(button_name, lang) {		
+		var t=this,i,but,html,si;
+		for (i=0; i<t.advanced_buttons.length; i++)
+		{
+			but = t.advanced_buttons[i];			
+			if (but[0] == button_name)
+			{
+				return t.get_button_html(but[0], but[1], but[2], but[3]);
+			}	
+		}		
+				
+		switch (button_name){
+			case "*":
+			case "return":
+				return "<br />";
+			case "|":
+		  	case "separator":
+				return '<img src="'+ t.baseURL +'images/spacer.gif" width="1" height="15" class="editAreaSeparatorLine">';
+			case "select_font":
+				html= "<select id='area_font_size' onchange='javascript:editArea.execCommand(\"change_font_size\")' fileSpecific='yes'>";
+				html+="<option value='-1'>{$font_size}</option>";
+				si=[8,9,10,11,12,14];
+				for( i=0;i<si.length;i++){
+					html+="<option value='"+si[i]+"'>"+si[i]+" pt</option>";
+				}
+				html+="</select>";
+				return html;
+			case "syntax_selection":
+				html= "<select id='syntax_selection' onchange='javascript:editArea.execCommand(\"change_syntax\", this.value)' fileSpecific='yes'>";
+				html+="<option value='-1'>{$syntax_selection}</option>";
+				html+="</select>";
+				return html;
+		}
+		
+		return "<span id='tmp_tool_"+button_name+"'>["+button_name+"]</span>";		
+	},
+	
+	
+	get_template : function(){
+		if(this.template=="")
+		{
+			var xhr_object = null; 
+			if(window.XMLHttpRequest) // Firefox 
+				xhr_object = new XMLHttpRequest(); 
+			else if(window.ActiveXObject) // Internet Explorer 
+				xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
+			else { // XMLHttpRequest not supported
+				alert("XMLHTTPRequest not supported. EditArea not loaded"); 
+				return; 
+			} 
+			 
+			xhr_object.open("GET", this.baseURL+"template.html", false); 
+			xhr_object.send(null); 
+			if(xhr_object.readyState == 4) 
+				this.template=xhr_object.responseText;
+			else
+				this.has_error();
+		}
+	},
+	
+	// translate text
+	translate : function(text, lang, mode){
+		if(mode=="word")
+			text=editAreaLoader.get_word_translation(text, lang);
+		else if(mode="template"){
+			editAreaLoader.current_language= lang;
+			text=text.replace(/\{\$([^\}]+)\}/gm, editAreaLoader.translate_template);
+		}
+		return text;
+	},
+	
+	translate_template : function(){
+		return editAreaLoader.get_word_translation(EditAreaLoader.prototype.translate_template.arguments[1], editAreaLoader.current_language);
+	},
+	
+	get_word_translation : function(val, lang){
+		var i;
+		
+		for( i in editAreaLoader.lang[lang]){
+			if(i == val)
+				return editAreaLoader.lang[lang][i];
+		}
+		return "_"+val;
+	},
+	
+	load_script : function(url){
+		var t=this,d=document,script,head;
+		
+		if( t.loadedFiles[url] )
+			return;	
+		//alert("load: "+url);
+		try{
+			script= d.createElement("script");
+			script.type= "text/javascript";
+			script.src= url;
+			script.charset= "UTF-8";
+			d.getElementsByTagName("head")[0].appendChild(script);
+		}catch(e){
+			d.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '" charset="UTF-8"></sc'+'ript>');
+		}
+		
+		t.loadedFiles[url] = true;
+	},
+	
+	add_event : function(obj, name, handler) {
+		try{
+			if (obj.attachEvent) {
+				obj.attachEvent("on" + name, handler);
+			} else{
+				obj.addEventListener(name, handler, false);
+			}
+		}catch(e){}
+	},
+	
+	remove_event : function(obj, name, handler){
+		try{
+			if (obj.detachEvent)
+				obj.detachEvent("on" + name, handler);
+			else
+				obj.removeEventListener(name, handler, false);
+		}catch(e){}
+	},
+
+
+	// reset all the editareas in the form that have been reseted
+	reset : function(e){
+		var formObj,is_child,i,x;
+		
+		formObj = editAreaLoader.isIE ? window.event.srcElement : e.target;
+		if(formObj.tagName!='FORM')
+			formObj= formObj.form;
+		
+		for( i in editAreas ){			
+			is_child= false;
+			for( x=0;x<formObj.elements.length;x++ ) {
+				if(formObj.elements[x].id == i)
+					is_child=true;
+			}
+			
+			if(window.frames["frame_"+i] && is_child && editAreas[i]["displayed"]==true){
+			
+				var exec= 'window.frames["frame_'+ i +'"].editArea.textarea.value= document.getElementById("'+ i +'").value;';
+				exec+= 'window.frames["frame_'+ i +'"].editArea.execCommand("focus");';
+				exec+= 'window.frames["frame_'+ i +'"].editArea.check_line_selection();';
+				exec+= 'window.frames["frame_'+ i +'"].editArea.execCommand("reset");';
+				window.setTimeout(exec, 10);
+			}
+		}		
+		return;
+	},
+	
+	
+	// prepare all the textarea replaced by an editarea to be submited
+	submit : function(e){		
+		var formObj,is_child,fs=window.frames,i,x;
+		formObj = editAreaLoader.isIE ? window.event.srcElement : e.target;
+		if(formObj.tagName!='FORM')
+			formObj= formObj.form;
+		
+		for( i in editAreas){
+			is_child= false;
+			for( x=0;x<formObj.elements.length;x++ ) {
+				if(formObj.elements[x].id == i)
+					is_child=true;
+			}
+		
+			if(is_child)
+			{
+				if(fs["frame_"+i] && editAreas[i]["displayed"]==true)
+					document.getElementById(i).value= fs["frame_"+ i].editArea.textarea.value;
+				editAreaLoader.execCommand(i,"EA_submit");
+			}
+		}				
+		if( typeof(formObj.edit_area_replaced_submit) == "function" ){
+			res= formObj.edit_area_replaced_submit();
+			if(res==false){
+				if(editAreaLoader.isIE)
+					return false;
+				else
+					e.preventDefault();
+			}
+		}
+		return;
+	},
+	
+	// allow to get the value of the editarea
+	getValue : function(id){
+        if(window.frames["frame_"+id] && editAreas[id]["displayed"]==true){
+            return window.frames["frame_"+ id].editArea.textarea.value;       
+        }else if(elem=document.getElementById(id)){
+        	return elem.value;
+        }
+        return false;
+    },
+    
+    // allow to set the value of the editarea
+    setValue : function(id, new_val){
+    	var fs=window.frames;
+    	
+        if( ( f=fs["frame_"+id] ) && editAreas[id]["displayed"]==true){
+			f.editArea.textarea.value= new_val;     
+			f.editArea.execCommand("focus"); 
+			f.editArea.check_line_selection(false);  
+			f.editArea.execCommand("onchange");
+        }else if(elem=document.getElementById(id)){
+        	elem.value= new_val;
+        }
+    },
+	    
+    // allow to get infos on the selection: array(start, end)
+    getSelectionRange : function(id){
+    	var sel,eA,fs=window.frames;
+    	
+    	sel= {"start": 0, "end": 0};
+        if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
+        	eA= fs["frame_"+ id].editArea;
+
+			sel["start"]	= eA.textarea.selectionStart;
+			sel["end"]		= eA.textarea.selectionEnd;
+		
+        }else if( elem=document.getElementById(id) ){
+        	sel= getSelectionRange(elem);
+        }
+        return sel;
+    },
+    
+    // allow to set the selection with the given start and end positions
+    setSelectionRange : function(id, new_start, new_end){
+    	var fs=window.frames;
+    	
+        if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
+            fs["frame_"+ id].editArea.area_select(new_start, new_end-new_start);  
+			// make an auto-scroll to the selection
+			if(!this.isIE){
+				fs["frame_"+ id].editArea.check_line_selection(false); 
+				fs["frame_"+ id].editArea.scroll_to_view();
+			}   
+        }else if(elem=document.getElementById(id)){
+        	setSelectionRange(elem, new_start, new_end);
+        }
+    },
+    
+    getSelectedText : function(id){
+    	var sel= this.getSelectionRange(id);
+    	
+        return this.getValue(id).substring(sel["start"], sel["end"]);
+    },
+	
+	setSelectedText : function(id, new_val){
+		var fs=window.frames,d=document,sel,text,scrollTop,scrollLeft,new_sel_end;
+		
+		new_val	= new_val.replace(/\r/g, ""); 
+		sel		= this.getSelectionRange(id);
+		text	= this.getValue(id);
+		if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
+			scrollTop	= fs["frame_"+ id].document.getElementById("result").scrollTop;
+			scrollLeft	= fs["frame_"+ id].document.getElementById("result").scrollLeft;
+		}else{
+			scrollTop	= d.getElementById(id).scrollTop;
+			scrollLeft	= d.getElementById(id).scrollLeft;
+		}
+		
+		text	= text.substring(0, sel["start"])+ new_val +text.substring(sel["end"]);
+		this.setValue(id, text);
+		new_sel_end	= sel["start"]+ new_val.length;
+		this.setSelectionRange(id, sel["start"], new_sel_end);
+		
+		
+		// fix \r problem for selection length count on IE & Opera
+		if(new_val != this.getSelectedText(id).replace(/\r/g, "")){
+			this.setSelectionRange(id, sel["start"], new_sel_end+ new_val.split("\n").length -1);
+		}
+		// restore scrolling position
+		if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
+			fs["frame_"+ id].document.getElementById("result").scrollTop= scrollTop;
+			fs["frame_"+ id].document.getElementById("result").scrollLeft= scrollLeft;
+			fs["frame_"+ id].editArea.execCommand("onchange");
+		}else{
+			d.getElementById(id).scrollTop= scrollTop;
+			d.getElementById(id).scrollLeft= scrollLeft;
+		}
+    },
+    
+    insertTags : function(id, open_tag, close_tag){
+    	var old_sel,new_sel;
+    	
+    	old_sel	= this.getSelectionRange(id);
+    	text	= open_tag + this.getSelectedText(id) + close_tag;
+    	 
+		editAreaLoader.setSelectedText(id, text);
+		
+    	new_sel	= this.getSelectionRange(id);
+    	if(old_sel["end"] > old_sel["start"])	// if text was selected, cursor at the end
+    		this.setSelectionRange(id, new_sel["end"], new_sel["end"]);
+    	else // cursor in the middle
+    		this.setSelectionRange(id, old_sel["start"]+open_tag.length, old_sel["start"]+open_tag.length);
+    },
+    
+    // hide both EditArea and normal textarea
+	hide : function(id){
+		var fs= window.frames,d=document,t=this,scrollTop,scrollLeft,span;
+		if(d.getElementById(id) && !t.hidden[id])
+		{
+			t.hidden[id]= {};
+			t.hidden[id]["selectionRange"]= t.getSelectionRange(id);
+			if(d.getElementById(id).style.display!="none")
+			{
+				t.hidden[id]["scrollTop"]= d.getElementById(id).scrollTop;
+				t.hidden[id]["scrollLeft"]= d.getElementById(id).scrollLeft;
+			}
+					
+			if(fs["frame_"+id])
+			{
+				t.hidden[id]["toggle"]= editAreas[id]["displayed"];
+				
+				if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
+					scrollTop	= fs["frame_"+ id].document.getElementById("result").scrollTop;
+					scrollLeft	= fs["frame_"+ id].document.getElementById("result").scrollLeft;
+				}else{
+					scrollTop	= d.getElementById(id).scrollTop;
+					scrollLeft	= d.getElementById(id).scrollLeft;
+				}
+				t.hidden[id]["scrollTop"]= scrollTop;
+				t.hidden[id]["scrollLeft"]= scrollLeft;
+				
+				if(editAreas[id]["displayed"]==true)
+					editAreaLoader.toggle_off(id);
+			}
+			
+			// hide toggle button and debug box
+			span= d.getElementById("EditAreaArroundInfos_"+id);
+			if(span){
+				span.style.display='none';
+			}
+			
+			// hide textarea
+			d.getElementById(id).style.display= "none";
+		}
+	},
+	
+	// restore hidden EditArea and normal textarea
+	show : function(id){
+		var fs= window.frames,d=document,t=this,span;
+		if((elem=d.getElementById(id)) && t.hidden[id])
+		{
+			elem.style.display= "inline";
+			elem.scrollTop= t.hidden[id]["scrollTop"];
+			elem.scrollLeft= t.hidden[id]["scrollLeft"];
+			span= d.getElementById("EditAreaArroundInfos_"+id);
+			if(span){
+				span.style.display='inline';
+			}
+			
+			if(fs["frame_"+id])
+			{
+								
+				// restore toggle button and debug box
+			
+				
+				// restore textarea
+				elem.style.display= "inline";
+				
+				// restore EditArea
+				if(t.hidden[id]["toggle"]==true)
+					editAreaLoader.toggle_on(id);
+				
+				scrollTop	= t.hidden[id]["scrollTop"];
+				scrollLeft	= t.hidden[id]["scrollLeft"];
+				
+				if(fs["frame_"+id] && editAreas[id]["displayed"]==true){
+					fs["frame_"+ id].document.getElementById("result").scrollTop	= scrollTop;
+					fs["frame_"+ id].document.getElementById("result").scrollLeft	= scrollLeft;
+				}else{
+					elem.scrollTop	= scrollTop;
+					elem.scrollLeft	= scrollLeft;
+				}
+			
+			}
+			// restore selection
+			sel	= t.hidden[id]["selectionRange"];
+			t.setSelectionRange(id, sel["start"], sel["end"]);
+			delete t.hidden[id];	
+		}
+	},
+	
+	// get the current file datas (for multi file editing mode)
+	getCurrentFile : function(id){
+		return this.execCommand(id, 'get_file', this.execCommand(id, 'curr_file'));
+	},
+	
+	// get the given file datas (for multi file editing mode)
+	getFile : function(id, file_id){
+		return this.execCommand(id, 'get_file', file_id);
+	},
+	
+	// get all the openned files datas (for multi file editing mode)
+	getAllFiles : function(id){
+		return this.execCommand(id, 'get_all_files()');
+	},
+	
+	// open a file (for multi file editing mode)
+	openFile : function(id, file_infos){
+		return this.execCommand(id, 'open_file', file_infos);
+	},
+	
+	// close the given file (for multi file editing mode)
+	closeFile : function(id, file_id){
+		return this.execCommand(id, 'close_file', file_id);
+	},
+	
+	// close the given file (for multi file editing mode)
+	setFileEditedMode : function(id, file_id, to){
+		var reg1,reg2;
+		reg1	= new RegExp('\\\\', 'g');
+		reg2	= new RegExp('"', 'g');
+		return this.execCommand(id, 'set_file_edited_mode("'+ file_id.replace(reg1, '\\\\').replace(reg2, '\\"') +'", '+ to +')');
+	},
+	
+	
+	// allow to access to editarea functions and datas (for advanced users only)
+	execCommand : function(id, cmd, fct_param){
+		switch(cmd){
+			case "EA_init":
+				if(editAreas[id]['settings']["EA_init_callback"].length>0)
+					eval(editAreas[id]['settings']["EA_init_callback"]+"('"+ id +"');");
+				break;
+			case "EA_delete":
+				if(editAreas[id]['settings']["EA_delete_callback"].length>0)
+					eval(editAreas[id]['settings']["EA_delete_callback"]+"('"+ id +"');");
+				break;
+			case "EA_submit":
+				if(editAreas[id]['settings']["submit_callback"].length>0)
+					eval(editAreas[id]['settings']["submit_callback"]+"('"+ id +"');");
+				break;
+		}
+        if(window.frames["frame_"+id] && window.frames["frame_"+ id].editArea){
+			if(fct_param!=undefined)
+				return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +'(fct_param);');
+			else
+				return eval('window.frames["frame_'+ id +'"].editArea.'+ cmd +';');       
+        }
+        return false;
+    }
+};
+	
+	var editAreaLoader= new EditAreaLoader();
+	var editAreas= {};
+


[03/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_mgt.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_mgt.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_mgt.jsp
deleted file mode 100644
index cb13dad..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_mgt.jsp
+++ /dev/null
@@ -1,239 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="org.wso2.carbon.theme.mgt.ui.utils.ThemeUtil" %>
-<%@ 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">
-function setChecked(value,id){
-	var itemLength = document.forms['ThemeMgtForm'].elements['theme'].length; 
-	setCheckedValue(document.forms['ThemeMgtForm'].elements['theme'], value);
-	for(var i=0;i<=itemLength;i++){
-		YAHOO.util.Dom.removeClass('themeObj'+i,'sel-box');
-		YAHOO.util.Dom.addClass('themeObj'+i,'nor-box');
-	}	
-	YAHOO.util.Dom.removeClass('themeObj'+id,'nor-box');
-	YAHOO.util.Dom.addClass('themeObj'+id,'sel-box');
-	
-}
-function setCheckedValue(radioObj, newValue) {
-	if(!radioObj)
-		return;
-	var radioLength = radioObj.length;
-	if(radioLength == undefined) {
-		radioObj.checked = (radioObj.value == newValue.toString());
-		return;
-	}
-	for(var i = 0; i < radioLength; i++) {
-		radioObj[i].checked = false;
-		if(radioObj[i].value == newValue.toString()) {
-			radioObj[i].checked = true;
-		}
-	}
-}
-
-</script>
-<%--Syntax hylighter include--%>
-<script language="javascript" type="text/javascript" src="../tenant-theme/js/editarea/edit_area/edit_area_full.js"></script>
-
-<%
-    // the redirectWithStr will be used in the following operations
-    String redirectWithStr = request.getParameter("redirectWith");
-    if (redirectWithStr == null) {
-        redirectWithStr = "";
-    }
-%>
-
-<fmt:bundle basename="org.wso2.carbon.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="theme_mgt.jsp?redirectWith=<%=redirectWithStr%>";
-    </script>
-<%
-    }
-
-
-    ThemeMgtServiceClient client;
-    String[] allThemes;
-    try {
-        client = new ThemeMgtServiceClient(config, session);
-
-        allThemes = client.getAllThemes(redirectWithStr);
-    } catch (Exception e) {
-%>
-<jsp:forward page="../admin/error.jsp?<%=e.getMessage()%>"/>
-<%
-        return;
-    }
-    String parentPathToUpload = "/";
-    String logoFilename = "logo.gif";
-    
-    if (allThemes.length < 2) {
-        return;
-    }
-
-    // to derive the thumbnail url
-    //Customization of UI theming per tenant
-
-
-%>
-
-
-<carbon:breadcrumb label="resources"
-                       resourceBundle="org.wso2.carbon.registry.resource.ui.i18n.Resources"
-                       topPage="true" request="<%=request%>"/>
-<div id="middle">
-
-<h2> Theme Management </h2>
-
-<div id="workArea">
-    
-<div class="subtopic">Select a Theme</div>
-<div class="subcontent">
-<form id="ThemeMgtForm" name="ThemeMgtForm" action="theme_mgt_ajaxprocessor.jsp?redirectWith=<%=redirectWithStr%>" method="post">
-
-<%
-String selectedTheme = allThemes[0];
-
-for (int i = 1; i < allThemes.length; i ++) {
-    String theme = allThemes[i];
-    String checkedStr = "";
-    String thumbUrl = ThemeUtil.getThumbUrl(request, theme);
-    if (theme.equals(selectedTheme)) {
-        checkedStr = "checked";
-    }
-%>
-<a onclick="setChecked('<%=theme%>','<%=i%>')">
-<div <%if (theme.equals(selectedTheme)) {%>class="sel-box"<% } else { %>class="nor-box"<%}%> id="themeObj<%=i%>">
-	<span><%=theme%></span>
-	<div>
-		<input style="display:none" type="radio"  name="theme" checked="<%=checkedStr%>" value="<%=theme%>"/>
-		<div><img src="<%=thumbUrl%>"/></div>
-	</div>
-</div>
-</a>
-<%
-}
-%>
-<div style="clear:both;"></div>
-<p>
-<%
-    if (redirectWithStr.equals("")) {
-        // mean the user is logged in
-%>
-<input type="submit" value="Update"/>
-<%
-    } else {
-%>
-<input type="submit" value="Apply theme"/>
-<input type="button" value="Skip" onclick="javascript:location.href='../admin/login.jsp'"/>
-<%
-    }
-%>
-</p>
-</form>
-</div>
-
-<%
-    if (redirectWithStr.equals("")) {
-        // mean the user is logged in
-%>
-    
-<div class="subtopic">Customize the theme</div>
-<div class="subcontent">
-<a href="theme_advanced.jsp">Click here</a>  to customize the current theme
-</div>
-</div>
-
-<%
-    }
-%>
-    
-</div>
-
-</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_mgt_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_mgt_ajaxprocessor.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_mgt_ajaxprocessor.jsp
deleted file mode 100644
index 4afff98..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/theme_mgt_ajaxprocessor.jsp
+++ /dev/null
@@ -1,48 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.CarbonConstants" %>
-<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
-<%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="java.util.UUID" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
-<carbon:jsi18n
-		resourceBundle="org.wso2.carbon.theme.mgt.ui.i18n.JSResources"
-		request="<%=request%>" />
-<%
-
-    String redirectWithStr = request.getParameter("redirectWith");
-    if (redirectWithStr == null) {
-        redirectWithStr = "";
-    }
-    try {
-        ThemeMgtServiceClient client = new ThemeMgtServiceClient(config, session);
-        String themeName = request.getParameter("theme");
-        request.getSession().setAttribute(
-                CarbonConstants.THEME_URL_RANDOM_SUFFIX_SESSION_KEY, UUID.randomUUID().toString());        
-        client.applyTheme(themeName, redirectWithStr);
-        if (redirectWithStr.equals("")) {
-            response.sendRedirect("../tenant-theme/theme_mgt.jsp?updateTheme=Success&redirectWith=" + redirectWithStr);
-        } else {
-            response.sendRedirect("../admin/login.jsp");
-        }
-    } catch (UIException e) {
-        response.sendRedirect("../tenant-theme/theme_mgt.jsp?updateTheme=Failed&redirectWith=" + redirectWithStr);
-    }
-%>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/update_text_content.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/update_text_content.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/update_text_content.jsp
deleted file mode 100644
index 5ecfef6..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/update_text_content.jsp
+++ /dev/null
@@ -1,51 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.UIException" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<fmt:bundle basename="org.wso2.carbon.registry.resource.ui.i18n.Resources">
-
-    <%
-        try {
-            String resourcePath = request.getParameter("resourcePath");
-            String contentText = request.getParameter("contentText");
-
-             String cookie = (String) request.
-                    getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-
-            try {
-                ThemeMgtServiceClient client =
-                        new ThemeMgtServiceClient(cookie, config, request.getSession());
-                client.updateTextContent(resourcePath, contentText);
-
-            } catch (Exception e) {
-                String msg = "Failed to update text content of the resource " +
-                        resourcePath + ". " + e.getMessage();
-                throw new UIException(msg, e);
-            }
-        } catch (UIException e) {
-            response.setStatus(500);
-            %><fmt:message key="error.updating.text.message"/>.<br/><%=e.getMessage()%><%
-            return;
-        }
-%>
-
-</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/pom.xml b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/pom.xml
deleted file mode 100644
index 73477b4..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/pom.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<!--
-# Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-#
-# Licensed 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.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <parent>
-        <groupId>org.wso2.carbon</groupId>
-        <artifactId>theme-mgt-parent</artifactId>
-        <version>2.1.0</version>
-<relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-	<artifactId>org.wso2.carbon.theme.mgt</artifactId>
-	<version>2.1.0</version>
-    <packaging>bundle</packaging>
-    <name>WSO2 Stratos - Tenant Theme Configurations</name>
-
-    <build>
-
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Name>${project.artifactId}</Bundle-Name>
-                        <Axis2Module>${project.artifactId}-${project.version}</Axis2Module>
-                        <Private-Package>
-                            org.wso2.carbon.theme.mgt.internal.*,
-                            org.wso2.carbon.theme.mgt.services.*,
-                        </Private-Package>
-                        <Export-Package>
-                            org.wso2.carbon.theme.mgt.util.*,
-                            org.wso2.carbon.theme.mgt.module.*,
-                            org.wso2.carbon.theme.mgt.handler.*,
-                        </Export-Package>
-                        <Import-Package>
-                            org.wso2.carbon.registry.core.*;version=1.0.1,
-                            org.wso2.carbon.registry.resource.*,
-                            !javax.xml.namespace,
-                            javax.xml.namespace; version=0.0.0,
-                            javax.servlet;version="${imp.pkg.version.javax.servlet}",
-                            javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
-                            org.apache.axiom.*; version="${axiom.osgi.version.range}",
-                            *;resolution:=optional
-                        </Import-Package>
-                         <DynamicImport-Package>*</DynamicImport-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.apache.axis2.wso2</groupId>
-            <artifactId>axis2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.resource</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.stratos.common</artifactId>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/internal/TenantThemeMgtServiceComponent.java
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/internal/TenantThemeMgtServiceComponent.java b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/internal/TenantThemeMgtServiceComponent.java
deleted file mode 100644
index 4769b85..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/internal/TenantThemeMgtServiceComponent.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-*  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-*
-*  WSO2 Inc. 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.
-*/
-package org.wso2.carbon.theme.mgt.internal;
-
-import org.wso2.carbon.stratos.common.listeners.TenantMgtListener;
-import org.wso2.carbon.theme.mgt.util.ThemeLoadingListener;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.service.component.ComponentContext;
-import org.osgi.framework.BundleContext;
-import org.wso2.carbon.registry.core.service.RegistryService;
-import org.wso2.carbon.theme.mgt.util.ThemeUtil;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.utils.ConfigurationContextService;
-
-import java.util.Hashtable;
-
-/**
- * @scr.component name="org.wso2.carbon.governance.theme.tenant" immediate="true"
- * @scr.reference name="registry.service"
- * interface="org.wso2.carbon.registry.core.service.RegistryService" cardinality="1..1"
- * policy="dynamic" bind="setRegistryService" unbind="unsetRegistryService"
- * @scr.reference name="user.realmservice.default" interface="org.wso2.carbon.user.core.service.RealmService"
- * cardinality="1..1" policy="dynamic" bind="setRealmService"
- * unbind="unsetRealmService"
- * @scr.reference name="config.context.service"
- *                interface="org.wso2.carbon.utils.ConfigurationContextService" cardinality="1..1"
- *                policy="dynamic" bind="setConfigurationContextService"
- *                unbind="unsetConfigurationContextService"
- *
- */
-public class TenantThemeMgtServiceComponent {
-    private static Log log = LogFactory.getLog(TenantThemeMgtServiceComponent.class);
-    private static ConfigurationContextService configContextService = null;
-
-    protected void activate(ComponentContext context) {
-        try {
-            ThemeUtil.loadResourceThemes();
-
-            // registering the Theme Logding Listener
-            BundleContext bundleContext = context.getBundleContext();
-            bundleContext.registerService(TenantMgtListener.class.getName(),
-                new ThemeLoadingListener(), new Hashtable());
-            
-            log.debug("******* Multitenancy Theme Config bundle is activated ******* ");
-        } catch (Exception e) {
-            log.error("******* Multitenancy Theme Config bundle failed activating ****", e);
-        }
-    }
-
-    protected void deactivate(ComponentContext context) {
-        log.debug("******* Multitenancy Theme Config bundle is deactivated ******* ");
-    }
-
-    protected void setRegistryService(RegistryService registryService) {
-        ThemeUtil.setRegistryService(registryService);
-    }
-
-    protected void unsetRegistryService(RegistryService registryService) {
-        ThemeUtil.setRegistryService(null);
-    }
-
-    protected void setRealmService(RealmService realmService) {
-        ThemeUtil.setRealmService(realmService);
-    }
-
-    protected void unsetRealmService(RealmService realmService) {
-        ThemeUtil.setRealmService(null);
-    }
-
-    protected void setConfigurationContextService(ConfigurationContextService contextService) {
-        if (log.isDebugEnabled()) {
-            log.debug("Setting the ConfigurationContext");
-        }
-        configContextService = contextService;
-    }
-
-    protected void unsetConfigurationContextService(ConfigurationContextService contextService) {
-        if (log.isDebugEnabled()) {
-            log.debug("Unsetting the ConfigurationContext");
-        }
-    }
-   
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/services/ThemeMgtService.java
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/services/ThemeMgtService.java b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/services/ThemeMgtService.java
deleted file mode 100644
index ea21565..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/services/ThemeMgtService.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- *  WSO2 Inc. 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.
- *
- */
-package org.wso2.carbon.theme.mgt.services;
-
-import org.wso2.carbon.core.AbstractAdmin;
-import org.wso2.carbon.registry.core.Registry;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.registry.core.Collection;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.theme.mgt.util.ThemeUtil;
-import org.wso2.carbon.registry.resource.beans.*;
-import org.wso2.carbon.registry.resource.services.utils.*;
-import org.wso2.carbon.registry.common.ResourceData;
-import org.wso2.carbon.registry.common.utils.RegistryUtil;
-
-import javax.activation.DataHandler;
-import java.util.ArrayList;
-import java.util.Stack;
-
-public class ThemeMgtService extends AbstractAdmin {
-    public ResourceTreeEntryBean getResourceTreeEntry(String resourcePath) throws Exception {
-        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        return GetResourceTreeEntryUtil.getResourceTreeEntry(resourcePath, themeRegistry);
-    }
-
-    public ContentBean getContentBean(String path) throws Exception {
-        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        return ContentUtil.getContent(path, themeRegistry);
-    }
-
-
-    public CollectionContentBean getCollectionContent(String path) throws Exception {
-        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        return ContentUtil.getCollectionContent(path, themeRegistry);
-    }
-
-    public ResourceData[] getResourceData(String[] paths) throws Exception {
-        UserRegistry themeRegistry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        return ContentUtil.getResourceData(paths, themeRegistry);
-    }
-    
-    public String addCollection(
-            String parentPath, String collectionName, String mediaType, String description)
-            throws Exception {
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        return AddCollectionUtil.process(parentPath, collectionName, mediaType, description, registry);
-    }
-
-    public void addResource(String path, String mediaType, String description, DataHandler content,
-                            String symlinkLocation, String tenantPass)
-            throws Exception {
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        if (registry == null) {
-            registry = ThemeUtil.getThemeRegistryFromTenantPass(tenantPass);
-        }
-        AddResourceUtil.addResource(path, mediaType, description, content, symlinkLocation, registry,new String[0][0]);
-    }
-
-    public void importResource(
-            String parentPath,
-            String resourceName,
-            String mediaType,
-            String description,
-            String fetchURL,
-            String symlinkLocation,
-            String tenantPass) throws Exception {
-
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        if (registry == null) {
-            registry = ThemeUtil.getThemeRegistryFromTenantPass(tenantPass);
-        }
-        ImportResourceUtil.importResource(parentPath, resourceName, mediaType, description, fetchURL,
-                        symlinkLocation, registry,new String[0][0]);
-    }
-
-    public void addTextResource(
-            String parentPath,
-            String fileName,
-            String mediaType,
-            String description,
-            String content) throws Exception {
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        AddTextResourceUtil.addTextResource(parentPath, fileName, mediaType, description, content, registry);
-    }
-
-    public MetadataBean getMetadata(String path) throws Exception {
-        RegistryUtil.setSessionResourcePath(path);
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        return MetadataPopulator.populate(path, registry);
-    }
-
-    public String getSessionResourcePath() throws Exception {
-        return RegistryUtil.getSessionResourcePath();
-    }
-
-    public String getTextContent(String path) throws Exception {
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        return GetTextContentUtil.getTextContent(path, registry);
-    }
-
-    public void updateTextContent(String resourcePath, String contentText) throws Exception {
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        UpdateTextContentUtil.updateTextContent(resourcePath, contentText, registry);
-    }
-
-    public ContentDownloadBean getContentDownloadBean(String path) throws Exception {
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        return GetDownloadContentUtil.getContentDownloadBean(path, registry);
-    }
-
-    public void renameResource(
-            String parentPath, String oldResourcePath, String newResourceName)
-            throws Exception {
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        RenameResourceUtil.renameResource(parentPath, oldResourcePath, newResourceName, registry);
-    }
-
-    public void delete(String pathToDelete) throws Exception {
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        DeleteUtil.process(pathToDelete, registry);
-    }
-
-    public String[] getAllPaths() throws Exception {
-        UserRegistry registry = ThemeUtil.getThemeRegistry(getGovernanceSystemRegistry());
-        // will use a stack in place of calling recurssion
-
-        
-        ArrayList<String> paths = new ArrayList<String>();
-        Stack<Collection> parentCollections = new Stack<Collection>();
-        Collection rootCollection = (Collection)registry.get("/");
-        parentCollections.push(rootCollection);
-        while (!parentCollections.empty()) {
-            Collection parentCollection = parentCollections.pop();
-            String[] childs = parentCollection.getChildren();
-            for (String childPath: childs) {
-                String pathToAdd = childPath.substring(1);
-                paths.add(pathToAdd);
-                Resource resource = registry.get(childPath);
-                if (resource instanceof Collection) {
-                    Collection c = (Collection)resource;
-                    parentCollections.push(c);
-                }
-            }
-        }
-        return paths.toArray(new String[paths.size()]);
-    }
-
-    public String[] getAllThemes(String tenantPass) throws Exception {
-        String[] allThemes = ThemeUtil.getAvailableThemes();
-        //we are readding the selected theme as the first element
-        String currentTheme = ThemeUtil.getCurrentTheme(tenantPass, (UserRegistry) getGovernanceSystemRegistryIfLoggedIn());
-        String[] returnVal = new String[allThemes.length + 1];
-        returnVal[0] = currentTheme;
-        for (int i = 0; i < allThemes.length; i ++) {
-            returnVal[i + 1] = allThemes[i];
-        }
-        return returnVal;
-    }
-
-    public void applyTheme(String themeName, String tenantPass) throws Exception {
-        ThemeUtil.applyTheme(themeName, tenantPass, (UserRegistry) getGovernanceSystemRegistryIfLoggedIn());
-        ThemeUtil.removeTheUUID(tenantPass);
-    }
-
-    private Registry getGovernanceSystemRegistryIfLoggedIn() {
-        UserRegistry tempRegistry = (UserRegistry)getConfigUserRegistry();
-        if (tempRegistry != null) {
-            try {
-                return ThemeUtil.getRegistryService().getGovernanceSystemRegistry(
-                        tempRegistry.getTenantId());
-            } catch (Exception ignored) {
-                // The Registry service should not fail if the above if condition holds.
-                return null;
-            }
-        }
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeLoadingListener.java
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeLoadingListener.java b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeLoadingListener.java
deleted file mode 100644
index d6f9151..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeLoadingListener.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.
- */
-package org.wso2.carbon.theme.mgt.util;
-
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.stratos.common.beans.TenantInfoBean;
-import org.wso2.carbon.stratos.common.exception.StratosException;
-import org.wso2.carbon.stratos.common.listeners.TenantMgtListener;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public class ThemeLoadingListener implements TenantMgtListener {
-    private static final Log log = LogFactory.getLog(ThemeLoadingListener.class);
-    private static final int EXEC_ORDER = 10;
-    public void onTenantCreate(TenantInfoBean tenantInfo) throws StratosException {
-        try {
-            ThemeUtil.loadTheme(tenantInfo.getTenantId());
-        } catch (RegistryException e) {
-            String msg = "Error in loading the theme for the tenant: " 
-                + tenantInfo.getTenantDomain() + ".";
-            log.error(msg, e);
-            throw new StratosException(msg, e);
-        }
-    }
-    
-    public void onTenantUpdate(TenantInfoBean tenantInfo) throws StratosException {
-        // doing nothing
-    }
-    
-    public void onTenantRename(int tenantId, String oldDomainName,
-                             String newDomainName) throws StratosException {
-        // doing nothing
-    }
-
-    public int getListenerOrder() {
-        return EXEC_ORDER;
-    }
-
-    public void onTenantInitialActivation(int tenantId) throws StratosException {
-        // doing nothing
-        
-    }
-
-    public void onTenantActivation(int tenantId) throws StratosException {
-        // doing nothing
-        
-    }
-
-    public void onTenantDeactivation(int tenantId) throws StratosException {
-        // doing nothing
-        
-    }
-
-    public void onSubscriptionPlanChange(int tenentId, String oldPlan, 
-                                         String newPlan) throws StratosException {
-        // doing nothing
-        
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeUtil.java
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeUtil.java b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeUtil.java
deleted file mode 100644
index 7a29521..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/util/ThemeUtil.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed 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.
- */
-package org.wso2.carbon.theme.mgt.util;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.registry.core.Collection;
-import org.wso2.carbon.registry.core.Registry;
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.service.RegistryService;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.registry.core.utils.RegistryUtils;
-import org.wso2.carbon.stratos.common.constants.StratosConstants;
-import org.wso2.carbon.stratos.common.util.CommonUtil;
-import org.wso2.carbon.user.core.service.RealmService;
-import org.wso2.carbon.utils.ServerConstants;
-
-import javax.activation.MimetypesFileTypeMap;
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ThemeUtil {
-
-    private static final Log log = LogFactory.getLog(ThemeUtil.class);
-
-    private static RegistryService registryService;
-    private static RealmService realmService;
-    private static final String CURRENT_THEME_KEY = "current-theme";
-    private static final String THEME_PATH = "/repository/theme";
-    private static final String THEME_ADMIN_PATH = THEME_PATH + "/admin";
-
-    public static synchronized void setRegistryService(RegistryService service) {
-        if (registryService == null) {
-            registryService = service;
-        }
-    }
-    public static RegistryService getRegistryService() {
-        return registryService;
-    }
-
-    public static synchronized void setRealmService(RealmService service) {
-        if (realmService == null) {
-            realmService = service;
-        }
-    }
-
-    public static RealmService getRealmService() {
-        return realmService;
-    }
-
-    public static UserRegistry getThemeMgtSystemRegistry(String tenantPass) throws RegistryException {
-        if (tenantPass != null && !tenantPass.equals("")) {
-            // tenant 0th system registry
-            UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
-            Resource resource = systemRegistry.get(
-                    StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass);
-            String tenantIdStr = resource.getProperty("tenantId");
-            int tenantId = Integer.parseInt(tenantIdStr);
-
-            return registryService.getGovernanceSystemRegistry(tenantId);
-        }
-
-        return null;
-    }
-
-    public static void removeTheUUID(String tenantPass) throws RegistryException {
-        if (tenantPass != null && !tenantPass.equals("")) {
-            // tenant 0th system registry
-            UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
-            if(systemRegistry.resourceExists(
-                    StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass)) {
-                systemRegistry.delete(
-                        StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass);
-            }
-        }
-    }
-
-    public static void transferAllThemesToRegistry(File rootDirectory, Registry registry,
-                                                String registryPath)
-                                                throws RegistryException {
-        try {
-            // adding the common media types
-            Map<String, String> extensionToMediaTypeMap = new HashMap<String, String>();
-            extensionToMediaTypeMap.put("gif", "image/gif");
-            extensionToMediaTypeMap.put("jpg", "image/jpeg");
-            extensionToMediaTypeMap.put("jpe", "image/jpeg");
-            extensionToMediaTypeMap.put("jpeg", "image/jpeg");
-            extensionToMediaTypeMap.put("png", "image/png");
-            extensionToMediaTypeMap.put("css", "text/css");
-            
-            File[] filesAndDirs = rootDirectory.listFiles();
-            if (filesAndDirs == null) {
-                return;
-            }
-            List<File> filesDirs = Arrays.asList(filesAndDirs);
-
-            for (File file : filesDirs) {
-                String filename = file.getName();
-                String fileRegistryPath = registryPath + RegistryConstants.PATH_SEPARATOR + filename;
-                if (!file.isFile()) {
-                    // This is a Directory add a new collection
-                    // This path is used to store the file resource under registry
-                    Collection newCollection = registry.newCollection();
-                    registry.put(fileRegistryPath, newCollection);
-
-                    // recur
-                    transferAllThemesToRegistry(file, registry, fileRegistryPath);
-                } else {
-                    // Add the file to registry
-                    Resource newResource = registry.newResource();
-                    String mediaType = null;
-                    if (filename.contains(".")) {
-                        String fileExt = filename.substring(filename.lastIndexOf(".") + 1);
-                        mediaType = extensionToMediaTypeMap.get(fileExt.toLowerCase());
-                    }
-                    if (mediaType == null) {
-                        mediaType = new MimetypesFileTypeMap().getContentType(file);
-                    }
-                    newResource.setMediaType(mediaType);
-                    newResource.setContentStream(new FileInputStream(file));
-                    registry.put(fileRegistryPath, newResource);
-                }
-            }
-        } catch (Exception e) {
-            String msg = "Error loading theme to the sytem registry for registry path: " + registryPath;
-            log.error(msg, e);
-            throw new RegistryException(msg, e);
-        }
-
-    }
-
-    public static UserRegistry getThemeRegistryFromTenantPass(String tenantPass) throws RegistryException {
-        UserRegistry themeMgtSystemRegistry = getThemeMgtSystemRegistry(tenantPass);
-        if (themeMgtSystemRegistry != null) {
-            return themeMgtSystemRegistry.getChrootedRegistry(THEME_ADMIN_PATH);
-        } else {
-            return null;
-        }
-    }
-
-    public static UserRegistry getThemeRegistry(Registry registry) throws RegistryException {
-        if (registry == null) {
-            return null;
-        }
-        return ((UserRegistry)registry).getChrootedRegistry(THEME_ADMIN_PATH);
-    }
-
-    public static void loadResourceThemes() throws RegistryException {
-        // loads the tenant0's system registry
-        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
-        // we are not checking whether the theme resources already exists to make sure, the newly
-        // added themes can be loaded just at the activation of the component
-        String themeRootFileName = System.getProperty(ServerConstants.CARBON_HOME) + File
-                .separator + "resources" + File.separator + "allthemes";
-        // we are always making this accessible from anyware
-        File themeRootFile = new File(themeRootFileName);
-        ThemeUtil.transferAllThemesToRegistry(themeRootFile, systemRegistry, StratosConstants.ALL_THEMES_PATH);
-
-        CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + StratosConstants.ALL_THEMES_PATH,
-                systemRegistry.getUserRealm());
-    }
-
-    public static String[] getAvailableThemes() throws RegistryException {
-        Registry systemRegistry = registryService.getGovernanceSystemRegistry();
-        if (!systemRegistry.resourceExists(StratosConstants.ALL_THEMES_PATH)) {
-            log.info("The theme root path: " + StratosConstants.ALL_THEMES_PATH + " doesn't exist.");
-            return new String[0];
-        }
-        Collection c = (Collection)systemRegistry.get(StratosConstants.ALL_THEMES_PATH);
-        String[] childPaths = c.getChildren();
-        for (int i = 0; i < childPaths.length; i ++) {
-            childPaths[i] = RegistryUtils.getResourceName(childPaths[i]);
-        }
-        return childPaths;
-    }
-
-
-    public static void loadTheme(int tenantId) throws RegistryException {
-        // get the util functions from the theme
-        // this is always the 0th system reigstry
-        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry(tenantId);
-        String[] allThemes = getAvailableThemes();
-        if (allThemes.length == 0) {
-            log.info("No themes found.");
-            return;
-        }
-        int randomNumber = (int)(Math.random() * allThemes.length);
-        String ourLuckyTheme = allThemes[randomNumber];
-        // anway now we are hard coding the default theme to be loaded here,
-        ourLuckyTheme = "Default";
-        applyThemeForDomain(ourLuckyTheme, systemRegistry);
-    }
-
-    public static void applyTheme(String themeName, String tenantPass, UserRegistry systemTenantRegistry) throws Exception {
-        if (systemTenantRegistry == null) {
-            systemTenantRegistry = getThemeMgtSystemRegistry(tenantPass);
-        }
-        applyThemeForDomain(themeName, systemTenantRegistry);
-    }
-
-    public static void applyThemeForDomain(String themeName, UserRegistry systemTenantRegistry)
-                throws RegistryException {
-        String sourcePath = StratosConstants.ALL_THEMES_PATH + "/" + themeName; // tenant 0s path
-        String targetPath = THEME_PATH;
-
-        UserRegistry systemZeroRegistry = registryService.getGovernanceSystemRegistry();
-
-        // if the themes doesn't exist we would exclude applying it
-        if (!systemZeroRegistry.resourceExists(sourcePath)) {
-            log.info("The theme source path: " + sourcePath + " doesn't exist.");
-            return;
-        }
-
-        // first delete the old one, or we can backup it if required
-        // we are anyway getting a backup of the logo
-        Resource logoR = null;
-        String logoPath = targetPath + "/admin/" + "logo.gif";
-        if (systemTenantRegistry.resourceExists(targetPath)) {
-            if (systemTenantRegistry.resourceExists(logoPath)) {
-                logoR = systemTenantRegistry.get(logoPath);
-            }
-            if (logoR != null) {
-                logoR.getContent(); // we will load the content as well.
-            }
-            systemTenantRegistry.delete(targetPath);
-        }
-
-        // copy theme resources to tenant's registry 
-        addResourcesRecursively(sourcePath, targetPath, systemZeroRegistry, systemTenantRegistry);
-
-        // replace the logo
-        if (logoR != null) {
-            systemTenantRegistry.put(logoPath, logoR);
-        }
-
-        // remember the theme name
-        Resource tenantThemeCollection = systemTenantRegistry.get(targetPath);
-        tenantThemeCollection.setProperty(CURRENT_THEME_KEY, themeName);
-        systemTenantRegistry.put(targetPath, tenantThemeCollection);
-
-        try {
-            CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + targetPath,
-                    systemTenantRegistry.getUserRealm());
-            CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + 
-                    StratosConstants.ALL_THEMES_PATH,
-                    systemTenantRegistry.getUserRealm());
-        } catch (RegistryException e) {
-            String msg = "Error in giving authorizations of the " + targetPath +
-                    " to the anonymous user and everyone role.";
-            log.error(msg, e);
-            throw new RegistryException(msg, e);
-        }
-    }
-
-    private static void addResourcesRecursively(String sourcePath, String targetPath,
-                                                Registry superRegistry, Registry tenantRegistry)
-            throws RegistryException {
-        Resource resource = superRegistry.get(sourcePath);
-        tenantRegistry.put(targetPath, resource);
-
-        if (resource instanceof Collection) {
-            String[] children = ((Collection) resource).getChildren();
-            for (String child : children) {
-                String childName = child.substring(child.lastIndexOf("/"), child.length());
-                addResourcesRecursively(child, targetPath + childName, superRegistry, tenantRegistry);
-            }
-        }
-    }
-
-    public static String getCurrentTheme(String tenantPass, UserRegistry registry) throws Exception {
-        if (registry == null) {
-            registry = getThemeMgtSystemRegistry(tenantPass);
-        }
-        String targetPath = THEME_PATH;
-
-        // remember the theme name
-        Resource tenantThemeCollection = registry.get(targetPath);
-        if (tenantThemeCollection == null) {
-            return null;
-        }
-        return tenantThemeCollection.getProperty(CURRENT_THEME_KEY);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/resources/META-INF/component.xml b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/resources/META-INF/component.xml
deleted file mode 100644
index 8d674c1..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/resources/META-INF/component.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-  ~
-  ~  Licensed 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.
-  -->
-
-<component xmlns="http://products.wso2.org/carbon">
-    <ManagementPermissions>
-        <ManagementPermission>
-            <DisplayName>Configure</DisplayName>
-            <ResourceId>/permission/admin/configure</ResourceId>
-        </ManagementPermission>
-        <ManagementPermission>
-            <DisplayName>Theme</DisplayName>
-            <ResourceId>/permission/admin/configure/theme</ResourceId>
-        </ManagementPermission>
-    </ManagementPermissions>
-</component>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/resources/META-INF/services.xml b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/resources/META-INF/services.xml
deleted file mode 100644
index f72d5b8..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt/2.1.0/src/main/resources/META-INF/services.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- !
- ! Copyright 2006 The Apache Software Foundation.
- !
- ! Licensed 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.
- !-->
-<serviceGroup>
-    <service name="ThemeMgtService" scope="transportsession">
-        <transports>
-            <transport>https</transport>
-        </transports>
-        <parameter name="ServiceClass" locked="false">
-            org.wso2.carbon.theme.mgt.services.ThemeMgtService
-        </parameter>
-
-        <operation name="getResourceTreeEntry">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="getContentBean">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="getCollectionContent">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="getResourceData">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="addCollection">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="addResource">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="importResource">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="addTextResource">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="getMetadata">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="getSessionResourcePath">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="getTextContent">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="updateTextContent">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="getContentDownloadBean">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="renameResource">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="delete">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-
-        <operation name="getAllPaths">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-        <operation name="getAllThemes">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-        
-        <operation name="applyTheme">
-            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
-        </operation>
-        
-        
-        <parameter name="enableMTOM" locked="true">false</parameter>
-    </service>
-     <parameter name="adminService" locked="true">true</parameter>
-    <parameter name="hiddenService" locked="true">true</parameter>
-</serviceGroup>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/pom.xml b/components/stratos/theme-mgt/pom.xml
deleted file mode 100644
index 66f11f7..0000000
--- a/components/stratos/theme-mgt/pom.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (c) 2009-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ Licensed 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.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.wso2.carbon</groupId>
-        <artifactId>stratos-components</artifactId>
-        <version>2.1.0</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>theme-mgt-parent</artifactId>
-    <packaging>pom</packaging>
-    <name>WSO2 Stratos - Theme Management Parent Module</name>
-    <description>WSO2 Stratos Theme Management Parent Module</description>
-    <url>http://wso2.org</url>
-
-    <modules>
-        <module>org.wso2.carbon.theme.mgt/2.1.0</module>
-        <module>org.wso2.carbon.theme.mgt.ui/2.1.0</module>
-    </modules>
-
-</project>
-

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/service-stubs/org.apache.stratos.theme.mgt.stub/pom.xml
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.theme.mgt.stub/pom.xml b/service-stubs/org.apache.stratos.theme.mgt.stub/pom.xml
new file mode 100644
index 0000000..26a4be2
--- /dev/null
+++ b/service-stubs/org.apache.stratos.theme.mgt.stub/pom.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     ~  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.
+     ~
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.apache.stratos</groupId>
+        <artifactId>stratos-service-stubs-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.apache.stratos.theme.mgt.stub</artifactId>
+    <packaging>bundle</packaging>
+    <version>3.0.0-SNAPSHOT</version>
+    <name>Apache Stratos - Theme Configuration User Interface</name>
+
+    <build>
+
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.1</version>
+                <executions>
+                    <execution>
+                        <id>source-code-generation</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+                                    <arg line="-uri src/main/resources/ThemeMgtService.wsdl -u -uw -o target/generated-code
+                                    -p org.wso2.carbon.theme.mgt.stub
+                                    -ns2p http://services.mgt.theme.carbon.wso2.org=org.wso2.carbon.theme.mgt.stub.services,http://utils.services.resource.registry.carbon.wso2.org/xsd=org.wso2.carbon.theme.mgt.stub.registry.resource.stub.services.utils.xsd,http://common.registry.carbon.wso2.org/xsd=org.wso2.carbon.theme.mgt.stub.registry.resource.stub.common.xsd,http://beans.resource.registry.carbon.wso2.org/xsd=org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd,http://services.resource.registry.carbon.wso2.org=org.wso2.carbon.theme.mgt.stub.registry.resource.stub.services"/>
+                                    <classpath refid="maven.dependency.classpath"/>
+                                    <classpath refid="maven.compile.classpath"/>
+                                    <classpath refid="maven.runtime.classpath"/>
+                                </java>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+	    
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>add-source</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                <source>target/generated-code/src</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                        <Bundle-Name>${project.artifactId}</Bundle-Name>
+                        <Export-Package>
+                            org.wso2.carbon.theme.mgt.stub.*; version="${carbon.platform.package.export.version}",
+                        </Export-Package>
+                        <Import-Package>
+                            !org.wso2.carbon.theme.mgt.stub.*;
+                            *;resolution:=optional
+                        </Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>


[19/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_full.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_full.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_full.js
new file mode 100644
index 0000000..db136a8
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/edit_area_full.js
@@ -0,0 +1,38 @@
+ function EAL(){var t=this;t.version="0.8.1.1";date=new Date();t.start_time=date.getTime();t.win="loading";t.error=false;t.baseURL="";t.template="";t.lang={};t.load_syntax={};t.syntax={};t.loadedFiles=[];t.waiting_loading={};t.scripts_to_load=[];t.sub_scripts_to_load=[];t.resize=[];t.hidden={};t.default_settings={debug:false,smooth_selection:true,font_size:"10",font_family:"monospace",start_highlight:false,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,word_wrap,|,help",begin_toolbar:"",end_toolbar:"",is_multi_files:false,allow_resize:"both",show_line_colors:false,min_width:400,min_height:125,replace_tab_by_spaces:false,allow_toggle:true,language:"en",syntax:"",syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,java,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml",display:"onload",max_undo:30,browsers:"known",plugins:"",gecko_spellcheck:false,fullscreen:false,is_editable:true,cursor_position:"b
 egin",word_wrap:false,autocompletion:false,load_callback:"",save_callback:"",change_callback:"",submit_callback:"",EA_init_callback:"",EA_delete_callback:"",EA_load_callback:"",EA_unload_callback:"",EA_toggle_on_callback:"",EA_toggle_off_callback:"",EA_file_switch_on_callback:"",EA_file_switch_off_callback:"",EA_file_close_callback:""};t.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['word_wrap','word_wrap.gif','toggle_word_wrap',true]
 ,['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];t.set_browser_infos(t);if(t.isIE>=6||t.isGecko||(t.isWebKit&&!t.isSafari<3)||t.isOpera>=9||t.isCamino)t.isValidBrowser=true;
+else t.isValidBrowser=false;t.set_base_url();for(var i=0;i<t.scripts_to_load.length;i++){setTimeout("eAL.load_script('"+t.baseURL+t.scripts_to_load[i]+".js');",1);t.waiting_loading[t.scripts_to_load[i]+".js"]=false;}t.add_event(window,"load",EAL.prototype.window_loaded);};EAL.prototype={has_error:function(){this.error=true;for(var i in EAL.prototype){EAL.prototype[i]=function(){};}},set_browser_infos:function(o){ua=navigator.userAgent;o.isWebKit=/WebKit/.test(ua);o.isGecko=!o.isWebKit&&/Gecko/.test(ua);o.isMac=/Mac/.test(ua);o.isIE=(navigator.appName=="Microsoft Internet Explorer");if(o.isIE){o.isIE=ua.replace(/^.*?MSIE\s+([0-9\.]+).*$/,"$1");if(o.isIE<6)o.has_error();}if(o.isOpera=(ua.indexOf('Opera')!=-1)){o.isOpera=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(o.isOpera<9)o.has_error();o.isIE=false;}if(o.isFirefox=(ua.indexOf('Firefox')!=-1))o.isFirefox=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('Iceweasel')!=-1)o.isFirefox=ua.replace(/^.*?Iceweasel.*?([0-9\
 .]+).*$/i,"$1");if(ua.indexOf('GranParadiso')!=-1)o.isFirefox=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('BonEcho')!=-1)o.isFirefox=ua.replace(/^.*?BonEcho.*?([0-9\.]+).*$/i,"$1");if(ua.indexOf('SeaMonkey')!=-1)o.isFirefox=(ua.replace(/^.*?SeaMonkey.*?([0-9\.]+).*$/i,"$1"))+1;if(o.isCamino=(ua.indexOf('Camino')!=-1))o.isCamino=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(o.isSafari=(ua.indexOf('Safari')!=-1))o.isSafari=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(o.isChrome=(ua.indexOf('Chrome')!=-1)){o.isChrome=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");o.isSafari=false;}},window_loaded:function(){eAL.win="loaded";if(document.forms){for(var i=0;i<document.forms.length;i++){var form=document.forms[i];form.edit_area_replaced_submit=null;try{form.edit_area_replaced_submit=form.onsubmit;form.onsubmit="";}catch(e){}eAL.add_event(form,"submit",EAL.prototype.submit);eAL.add_event(form,"reset",EAL.prototype.reset);}}eAL.add_event(window,"unload",
 function(){for(var i in eAs){eAL.delete_instance(i);}});},init_ie_textarea:function(id){var a=document.getElementById(id);try{if(a&&typeof(a.focused)=="undefined"){a.focus();a.focused=true;a.selectionStart=a.selectionEnd=0;get_IE_selection(a);eAL.add_event(a,"focus",IE_textarea_focus);eAL.add_event(a,"blur",IE_textarea_blur);}}catch(ex){}},init:function(settings){var t=this,s=settings,i;if(!s["id"])t.has_error();if(t.error)return;if(eAs[s["id"]])t.delete_instance(s["id"]);for(i in t.default_settings){if(typeof(s[i])=="undefined")s[i]=t.default_settings[i];}if(s["browsers"]=="known"&&t.isValidBrowser==false){return;}if(s["begin_toolbar"].length>0)s["toolbar"]=s["begin_toolbar"]+","+s["toolbar"];if(s["end_toolbar"].length>0)s["toolbar"]=s["toolbar"]+","+s["end_toolbar"];s["tab_toolbar"]=s["toolbar"].replace(/ /g,"").split(",");s["plugins"]=s["plugins"].replace(/ /g,"").split(",");for(i=0;i<s["plugins"].length;i++){if(s["plugins"][i].length==0)s["plugins"].splice(i,1);}t.get_template()
 ;t.load_script(t.baseURL+"langs/"+s["language"]+".js");if(s["syntax"].length>0){s["syntax"]=s["syntax"].toLowerCase();t.load_script(t.baseURL+"reg_syntax/"+s["syntax"]+".js");}eAs[s["id"]]={"settings":s};eAs[s["id"]]["displayed"]=false;eAs[s["id"]]["hidden"]=false;t.start(s["id"]);},delete_instance:function(id){var d=document,fs=window.frames,span,iframe;eAL.execCommand(id,"EA_delete");if(fs["frame_"+id]&&fs["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");fs["frame_"+id].editArea.execCommand("EA_unload");}span=d.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);iframe=d.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete fs["frame_"+id];}catch(e){}}delete eAs[id];},start:function(id){var t=this,d=document,f,span,father,next,html='',html_toolbar_content='',template,content,i;if(t.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(i in t.waiting_loading){if(t.waiting_loading[i]!="l
 oaded"&&typeof(t.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!t.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!t.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)t.init_syntax_regexp();if(!d.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){span=d.createElement("span");span.id="EditAreaArroundInfos_"+id;if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked='checked'":"";html+="<div id='edit_area_toggle_"+i+"'>";html+="<input id='edit_area_toggle_checkbox_"+id+"' class='toggle_"+id+"' type='checkbox' onclick='eAL.toggle(\""+id+"\");' accesskey='e' "+checked+" />";html+="<label for='edit_area_toggle_checkbox_"+id+"'>{$toggle}</label></div>";}if(eAs[id]["settings"]["debug"])html+="<textarea id='edit_area_debug_"+id+"' spellc
 heck='off' style='z-index:20;width:100%;height:120px;overflow:auto;border:solid black 1px;'></textarea><br />";html=t.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;father=d.getElementById(id).parentNode;next=d.getElementById(id).nextSibling;if(next==null)father.appendChild(span);
+else father.insertBefore(span,next);}if(!eAs[id]["initialized"]){t.execCommand(id,"EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(t.isIE){t.init_ie_textarea(id);}area=eAs[id];for(i=0;i<area["settings"]["tab_toolbar"].length;i++){html_toolbar_content+=t.get_control_html(area["settings"]["tab_toolbar"][i],area["settings"]["language"]);}html_toolbar_content=t.translate(html_toolbar_content,area["settings"]["language"],"template");if(!t.iframe_script){t.iframe_script="";for(i=0;i<t.sub_scripts_to_load.length;i++)t.iframe_script+='<script language="javascript" type="text/javascript" src="'+t.baseURL+t.sub_scripts_to_load[i]+'.js"></script>';}for(i=0;i<area["settings"]["plugins"].length;i++){if(!t.all_plugins_loaded)t.iframe_script+='<script language="javascript" type="text/javascript" src="'+t.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/'+area["settings"]["plugins"][i]+'.js"></script>';t.iframe_script+='<script language="javascript" 
 type="text/javascript" src="'+t.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/langs/'+area["settings"]["language"]+'.js"></script>';}if(!t.iframe_css){t.iframe_css="<link href='"+t.baseURL+"edit_area.css' rel='stylesheet' type='text/css' />";}template=t.template.replace(/\[__BASEURL__\]/g,t.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=t.translate(template,area["settings"]["language"],"template");template=template.replace("[__CSSRULES__]",t.iframe_css);template=template.replace("[__JSCODE__]",t.iframe_script);template=template.replace("[__EA_VERSION__]",t.version);area.textarea=d.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')delete window.frames["frame_"+area["settings"]["id"]];father=area.textarea.parentNode;content=d.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["i
 d"];content.style.borderWidth="0px";setAttribute(content,"frameBorder","0");content.style.overflow="hidden";content.style.display="none";next=area.textarea.nextSibling;if(next==null)father.appendChild(content);
+else father.insertBefore(content,next);f=window.frames["frame_"+area["settings"]["id"]];f.document.open();f.eAs=eAs;f.area_id=area["settings"]["id"];f.document.area_id=area["settings"]["id"];f.document.write(template);f.document.close();},toggle:function(id,toggle_to){if(!toggle_to)toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true&&toggle_to=="off"){this.toggle_off(id);}
+else if(eAs[id]["displayed"]==false&&toggle_to=="on"){this.toggle_on(id);}return false;},toggle_off:function(id){var fs=window.frames,f,t,parNod,nxtSib,selStart,selEnd,scrollTop,scrollLeft;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];if(f.editArea.fullscreen['isFull'])f.editArea.toggle_full_screen(false);eAs[id]["displayed"]=false;t.wrap="off";setAttribute(t,"wrap","off");parNod=t.parentNode;nxtSib=t.nextSibling;parNod.removeChild(t);parNod.insertBefore(t,nxtSib);t.value=f.editArea.textarea.value;selStart=f.editArea.last_selection["selectionStart"];selEnd=f.editArea.last_selection["selectionEnd"];scrollTop=f.document.getElementById("result").scrollTop;scrollLeft=f.document.getElementById("result").scrollLeft;document.getElementById("frame_"+id).style.display='none';t.style.display="inline";try{t.focus();}catch(e){};if(this.isIE){t.selectionStart=selStart;t.selectionEnd=selEnd;t.focused=true;set_IE_selection(t);}
+else{if(this.isOpera&&this.isOpera < 9.6){t.setSelectionRange(0,0);}try{t.setSelectionRange(selStart,selEnd);}catch(e){};}t.scrollTop=scrollTop;t.scrollLeft=scrollLeft;f.editArea.execCommand("toggle_off");}},toggle_on:function(id){var fs=window.frames,f,t,selStart=0,selEnd=0,scrollTop=0,scrollLeft=0,curPos,elem;if(fs["frame_"+id]){f=fs["frame_"+id];t=eAs[id]["textarea"];area=f.editArea;area.textarea.value=t.value;curPos=eAs[id]["settings"]["cursor_position"];if(t.use_last==true){selStart=t.last_selectionStart;selEnd=t.last_selectionEnd;scrollTop=t.last_scrollTop;scrollLeft=t.last_scrollLeft;t.use_last=false;}
+else if(curPos=="auto"){try{selStart=t.selectionStart;selEnd=t.selectionEnd;scrollTop=t.scrollTop;scrollLeft=t.scrollLeft;}catch(ex){}}this.set_editarea_size_from_textarea(id,document.getElementById("frame_"+id));t.style.display="none";document.getElementById("frame_"+id).style.display="inline";area.execCommand("focus");eAs[id]["displayed"]=true;area.execCommand("update_size");f.document.getElementById("result").scrollTop=scrollTop;f.document.getElementById("result").scrollLeft=scrollLeft;area.area_select(selStart,selEnd-selStart);area.execCommand("toggle_on");}
+else{elem=document.getElementById(id);elem.last_selectionStart=elem.selectionStart;elem.last_selectionEnd=elem.selectionEnd;elem.last_scrollTop=elem.scrollTop;elem.last_scrollLeft=elem.scrollLeft;elem.use_last=true;eAL.start(id);}},set_editarea_size_from_textarea:function(id,frame){var elem,width,height;elem=document.getElementById(id);width=Math.max(eAs[id]["settings"]["min_width"],elem.offsetWidth)+"px";height=Math.max(eAs[id]["settings"]["min_height"],elem.offsetHeight)+"px";if(elem.style.width.indexOf("%")!=-1)width=elem.style.width;if(elem.style.height.indexOf("%")!=-1)height=elem.style.height;frame.style.width=width;frame.style.height=height;},set_base_url:function(){var t=this,elems,i,docBasePath;if(!this.baseURL){elems=document.getElementsByTagName('script');for(i=0;i<elems.length;i++){if(elems[i].src&&elems[i].src.match(/edit_area_[^\\\/]*$/i)){var src=elems[i].src;src=src.substring(0,src.lastIndexOf('/'));this.baseURL=src;this.file_name=elems[i].src.substr(elems[i].src.las
 tIndexOf("/")+1);break;}}}docBasePath=document.location.href;if(docBasePath.indexOf('?')!=-1)docBasePath=docBasePath.substring(0,docBasePath.indexOf('?'));docBasePath=docBasePath.substring(0,docBasePath.lastIndexOf('/'));if(t.baseURL.indexOf('://')==-1&&t.baseURL.charAt(0)!='/'){t.baseURL=docBasePath+"/"+t.baseURL;}t.baseURL+="/";},get_button_html:function(id,img,exec,isFileSpecific,baseURL){var cmd,html;if(!baseURL)baseURL=this.baseURL;cmd='editArea.execCommand(\''+exec+'\')';html='<a id="a_'+id+'" href="javascript:'+cmd+'" onclick="'+cmd+';return false;" onmousedown="return false;" target="_self" fileSpecific="'+(isFileSpecific?'yes':'no')+'">';html+='<img id="'+id+'" src="'+baseURL+'images/'+img+'" title="{$'+id+'}" width="20" height="20" class="editAreaButtonNormal" onmouseover="editArea.switchClass(this,\'editAreaButtonOver\');" onmouseout="editArea.restoreClass(this);" onmousedown="editArea.restoreAndSwitchClass(this,\'editAreaButtonDown\');" /></a>';return html;},get_control_
 html:function(button_name,lang){var t=this,i,but,html,si;for(i=0;i<t.advanced_buttons.length;i++){but=t.advanced_buttons[i];if(but[0]==button_name){return t.get_button_html(but[0],but[1],but[2],but[3]);}}switch(button_name){case "*":case "return":return "<br />";case "|":case "separator":return '<img src="'+t.baseURL+'images/spacer.gif" width="1" height="15" class="editAreaSeparatorLine">';case "select_font":html="<select id='area_font_size' onchange='javascript:editArea.execCommand(\"change_font_size\")' fileSpecific='yes'>";html+="<option value='-1'>{$font_size}</option>";si=[8,9,10,11,12,14];for(i=0;i<si.length;i++){html+="<option value='"+si[i]+"'>"+si[i]+" pt</option>";}html+="</select>";return html;case "syntax_selection":html="<select id='syntax_selection' onchange='javascript:editArea.execCommand(\"change_syntax\",this.value)' fileSpecific='yes'>";html+="<option value='-1'>{$syntax_selection}</option>";html+="</select>";return html;}return "<span id='tmp_tool_"+button_name+"
 '>["+button_name+"]</span>";},get_template:function(){if(this.template==""){var xhr_object=null;if(window.XMLHttpRequest)xhr_object=new XMLHttpRequest();
+else if(window.ActiveXObject)xhr_object=new ActiveXObject("Microsoft.XMLHTTP");
+else{alert("XMLHTTPRequest not supported. EditArea not loaded");return;}xhr_object.open("GET",this.baseURL+"template.html",false);xhr_object.send(null);if(xhr_object.readyState==4)this.template=xhr_object.responseText;
+else this.has_error();}},translate:function(text,lang,mode){if(mode=="word")text=eAL.get_word_translation(text,lang);
+else if(mode="template"){eAL.current_language=lang;text=text.replace(/\{\$([^\}]+)\}/gm,eAL.translate_template);}return text;},translate_template:function(){return eAL.get_word_translation(EAL.prototype.translate_template.arguments[1],eAL.current_language);},get_word_translation:function(val,lang){var i;for(i in eAL.lang[lang]){if(i==val)return eAL.lang[lang][i];}return "_"+val;},load_script:function(url){var t=this,d=document,script,head;if(t.loadedFiles[url])return;try{script=d.createElement("script");script.type="text/javascript";script.src=url;script.charset="UTF-8";d.getElementsByTagName("head")[0].appendChild(script);}catch(e){d.write('<sc'+'ript language="javascript" type="text/javascript" src="'+url+'" charset="UTF-8"></sc'+'ript>');}t.loadedFiles[url]=true;},add_event:function(obj,name,handler){try{if(obj.attachEvent){obj.attachEvent("on"+name,handler);}
+else{obj.addEventListener(name,handler,false);}}catch(e){}},remove_event:function(obj,name,handler){try{if(obj.detachEvent)obj.detachEvent("on"+name,handler);
+else obj.removeEventListener(name,handler,false);}catch(e){}},reset:function(e){var formObj,is_child,i,x;formObj=eAL.isIE ? window.event.srcElement:e.target;if(formObj.tagName!='FORM')formObj=formObj.form;for(i in eAs){is_child=false;for(x=0;x<formObj.elements.length;x++){if(formObj.elements[x].id==i)is_child=true;}if(window.frames["frame_"+i]&&is_child&&eAs[i]["displayed"]==true){var exec='window.frames["frame_'+i+'"].editArea.textarea.value=document.getElementById("'+i+'").value;';exec+='window.frames["frame_'+i+'"].editArea.execCommand("focus");';exec+='window.frames["frame_'+i+'"].editArea.check_line_selection();';exec+='window.frames["frame_'+i+'"].editArea.execCommand("reset");';window.setTimeout(exec,10);}}return;},submit:function(e){var formObj,is_child,fs=window.frames,i,x;formObj=eAL.isIE ? window.event.srcElement:e.target;if(formObj.tagName!='FORM')formObj=formObj.form;for(i in eAs){is_child=false;for(x=0;x<formObj.elements.length;x++){if(formObj.elements[x].id==i)is_chil
 d=true;}if(is_child){if(fs["frame_"+i]&&eAs[i]["displayed"]==true)document.getElementById(i).value=fs["frame_"+i].editArea.textarea.value;eAL.execCommand(i,"EA_submit");}}if(typeof(formObj.edit_area_replaced_submit)=="function"){res=formObj.edit_area_replaced_submit();if(res==false){if(eAL.isIE)return false;
+else e.preventDefault();}}return;},getValue:function(id){if(window.frames["frame_"+id]&&eAs[id]["displayed"]==true){return window.frames["frame_"+id].editArea.textarea.value;}
+else if(elem=document.getElementById(id)){return elem.value;}return false;},setValue:function(id,new_val){var fs=window.frames;if((f=fs["frame_"+id])&&eAs[id]["displayed"]==true){f.editArea.textarea.value=new_val;f.editArea.execCommand("focus");f.editArea.check_line_selection(false);f.editArea.execCommand("onchange");}
+else if(elem=document.getElementById(id)){elem.value=new_val;}},getSelectionRange:function(id){var sel,eA,fs=window.frames;sel={"start":0,"end":0};if(fs["frame_"+id]&&eAs[id]["displayed"]==true){eA=fs["frame_"+id].editArea;sel["start"]=eA.textarea.selectionStart;sel["end"]=eA.textarea.selectionEnd;}
+else if(elem=document.getElementById(id)){sel=getSelectionRange(elem);}return sel;},setSelectionRange:function(id,new_start,new_end){var fs=window.frames;if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].editArea.area_select(new_start,new_end-new_start);if(!this.isIE){fs["frame_"+id].editArea.check_line_selection(false);fs["frame_"+id].editArea.scroll_to_view();}}
+else if(elem=document.getElementById(id)){setSelectionRange(elem,new_start,new_end);}},getSelectedText:function(id){var sel=this.getSelectionRange(id);return this.getValue(id).substring(sel["start"],sel["end"]);},setSelectedText:function(id,new_val){var fs=window.frames,d=document,sel,text,scrollTop,scrollLeft,new_sel_end;new_val=new_val.replace(/\r/g,"");sel=this.getSelectionRange(id);text=this.getValue(id);if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;}
+else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}text=text.substring(0,sel["start"])+new_val+text.substring(sel["end"]);this.setValue(id,text);new_sel_end=sel["start"]+new_val.length;this.setSelectionRange(id,sel["start"],new_sel_end);if(new_val !=this.getSelectedText(id).replace(/\r/g,"")){this.setSelectionRange(id,sel["start"],new_sel_end+new_val.split("\n").length-1);}if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scrollLeft=scrollLeft;fs["frame_"+id].editArea.execCommand("onchange");}
+else{d.getElementById(id).scrollTop=scrollTop;d.getElementById(id).scrollLeft=scrollLeft;}},insertTags:function(id,open_tag,close_tag){var old_sel,new_sel;old_sel=this.getSelectionRange(id);text=open_tag+this.getSelectedText(id)+close_tag;eAL.setSelectedText(id,text);new_sel=this.getSelectionRange(id);if(old_sel["end"] > old_sel["start"])this.setSelectionRange(id,new_sel["end"],new_sel["end"]);
+else this.setSelectionRange(id,old_sel["start"]+open_tag.length,old_sel["start"]+open_tag.length);},hide:function(id){var fs=window.frames,d=document,t=this,scrollTop,scrollLeft,span;if(d.getElementById(id)&&!t.hidden[id]){t.hidden[id]={};t.hidden[id]["selectionRange"]=t.getSelectionRange(id);if(d.getElementById(id).style.display!="none"){t.hidden[id]["scrollTop"]=d.getElementById(id).scrollTop;t.hidden[id]["scrollLeft"]=d.getElementById(id).scrollLeft;}if(fs["frame_"+id]){t.hidden[id]["toggle"]=eAs[id]["displayed"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){scrollTop=fs["frame_"+id].document.getElementById("result").scrollTop;scrollLeft=fs["frame_"+id].document.getElementById("result").scrollLeft;}
+else{scrollTop=d.getElementById(id).scrollTop;scrollLeft=d.getElementById(id).scrollLeft;}t.hidden[id]["scrollTop"]=scrollTop;t.hidden[id]["scrollLeft"]=scrollLeft;if(eAs[id]["displayed"]==true)eAL.toggle_off(id);}span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='none';}d.getElementById(id).style.display="none";}},show:function(id){var fs=window.frames,d=document,t=this,span;if((elem=d.getElementById(id))&&t.hidden[id]){elem.style.display="inline";elem.scrollTop=t.hidden[id]["scrollTop"];elem.scrollLeft=t.hidden[id]["scrollLeft"];span=d.getElementById("EditAreaArroundInfos_"+id);if(span){span.style.display='inline';}if(fs["frame_"+id]){elem.style.display="inline";if(t.hidden[id]["toggle"]==true)eAL.toggle_on(id);scrollTop=t.hidden[id]["scrollTop"];scrollLeft=t.hidden[id]["scrollLeft"];if(fs["frame_"+id]&&eAs[id]["displayed"]==true){fs["frame_"+id].document.getElementById("result").scrollTop=scrollTop;fs["frame_"+id].document.getElementById("result").scro
 llLeft=scrollLeft;}
+else{elem.scrollTop=scrollTop;elem.scrollLeft=scrollLeft;}}sel=t.hidden[id]["selectionRange"];t.setSelectionRange(id,sel["start"],sel["end"]);delete t.hidden[id];}},getCurrentFile:function(id){return this.execCommand(id,'get_file',this.execCommand(id,'curr_file'));},getFile:function(id,file_id){return this.execCommand(id,'get_file',file_id);},getAllFiles:function(id){return this.execCommand(id,'get_all_files()');},openFile:function(id,file_infos){return this.execCommand(id,'open_file',file_infos);},closeFile:function(id,file_id){return this.execCommand(id,'close_file',file_id);},setFileEditedMode:function(id,file_id,to){var reg1,reg2;reg1=new RegExp('\\\\','g');reg2=new RegExp('"','g');return this.execCommand(id,'set_file_edited_mode("'+file_id.replace(reg1,'\\\\').replace(reg2,'\\"')+'",'+to+')');},execCommand:function(id,cmd,fct_param){switch(cmd){case "EA_init":if(eAs[id]['settings']["EA_init_callback"].length>0)eval(eAs[id]['settings']["EA_init_callback"]+"('"+id+"');");break;ca
 se "EA_delete":if(eAs[id]['settings']["EA_delete_callback"].length>0)eval(eAs[id]['settings']["EA_delete_callback"]+"('"+id+"');");break;case "EA_submit":if(eAs[id]['settings']["submit_callback"].length>0)eval(eAs[id]['settings']["submit_callback"]+"('"+id+"');");break;}if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(fct_param!=undefined)return eval('window.frames["frame_'+id+'"].editArea.'+cmd+'(fct_param);');
+else return eval('window.frames["frame_'+id+'"].editArea.'+cmd+';');}return false;}};var eAL=new EAL();var eAs={}; function getAttribute(elm,aName){var aValue,taName,i;try{aValue=elm.getAttribute(aName);}catch(exept){}if(! aValue){for(i=0;i < elm.attributes.length;i++){taName=elm.attributes[i] .name.toLowerCase();if(taName==aName){aValue=elm.attributes[i] .value;return aValue;}}}return aValue;};function setAttribute(elm,attr,val){if(attr=="class"){elm.setAttribute("className",val);elm.setAttribute("class",val);}
+else{elm.setAttribute(attr,val);}};function getChildren(elem,elem_type,elem_attribute,elem_attribute_match,option,depth){if(!option)var option="single";if(!depth)var depth=-1;if(elem){var children=elem.childNodes;var result=null;var results=[];for(var x=0;x<children.length;x++){strTagName=new String(children[x].tagName);children_class="?";if(strTagName!="undefined"){child_attribute=getAttribute(children[x],elem_attribute);if((strTagName.toLowerCase()==elem_type.toLowerCase()||elem_type=="")&&(elem_attribute==""||child_attribute==elem_attribute_match)){if(option=="all"){results.push(children[x]);}
+else{return children[x];}}if(depth!=0){result=getChildren(children[x],elem_type,elem_attribute,elem_attribute_match,option,depth-1);if(option=="all"){if(result.length>0){results=results.concat(result);}}
+else if(result!=null){return result;}}}}if(option=="all")return results;}return null;};function isChildOf(elem,parent){if(elem){if(elem==parent)return true;while(elem.parentNode !='undefined'){return isChildOf(elem.parentNode,parent);}}return false;};function getMouseX(e){if(e!=null&&typeof(e.pageX)!="undefined"){return e.pageX;}
+else{return(e!=null?e.x:event.x)+document.documentElement.scrollLeft;}};function getMouseY(e){if(e!=null&&typeof(e.pageY)!="undefined"){return e.pageY;}
+else{return(e!=null?e.y:event.y)+document.documentElement.scrollTop;}};function calculeOffsetLeft(r){return calculeOffset(r,"offsetLeft")};function calculeOffsetTop(r){return calculeOffset(r,"offsetTop")};function calculeOffset(element,attr){var offset=0;while(element){offset+=element[attr];element=element.offsetParent}return offset;};function get_css_property(elem,prop){if(document.defaultView){return document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop);}
+else if(elem.currentStyle){var prop=prop.replace(/-\D/gi,function(sMatch){return sMatch.charAt(sMatch.length-1).toUpperCase();});return elem.currentStyle[prop];}
+else return null;}var _mCE;function start_move_element(e,id,frame){var elem_id=(e.target||e.srcElement).id;if(id)elem_id=id;if(!frame)frame=window;if(frame.event)e=frame.event;_mCE=frame.document.getElementById(elem_id);_mCE.frame=frame;frame.document.onmousemove=move_element;frame.document.onmouseup=end_move_element;mouse_x=getMouseX(e);mouse_y=getMouseY(e);_mCE.start_pos_x=mouse_x-(_mCE.style.left.replace("px","")||calculeOffsetLeft(_mCE));_mCE.start_pos_y=mouse_y-(_mCE.style.top.replace("px","")||calculeOffsetTop(_mCE));return false;};function end_move_element(e){_mCE.frame.document.onmousemove="";_mCE.frame.document.onmouseup="";_mCE=null;};function move_element(e){var newTop,newLeft,maxLeft;if(_mCE.frame&&_mCE.frame.event)e=_mCE.frame.event;newTop=getMouseY(e)-_mCE.start_pos_y;newLeft=getMouseX(e)-_mCE.start_pos_x;maxLeft=_mCE.frame.document.body.offsetWidth-_mCE.offsetWidth;max_top=_mCE.frame.document.body.offsetHeight-_mCE.offsetHeight;newTop=Math.min(Math.max(0,newTop),max_t
 op);newLeft=Math.min(Math.max(0,newLeft),maxLeft);_mCE.style.top=newTop+"px";_mCE.style.left=newLeft+"px";return false;};var nav=eAL.nav;function getSelectionRange(textarea){return{"start":textarea.selectionStart,"end":textarea.selectionEnd};};function setSelectionRange(t,start,end){t.focus();start=Math.max(0,Math.min(t.value.length,start));end=Math.max(start,Math.min(t.value.length,end));if(this.isOpera&&this.isOpera < 9.6){t.selectionEnd=1;t.selectionStart=0;t.selectionEnd=1;t.selectionStart=0;}t.selectionStart=start;t.selectionEnd=end;if(isIE)set_IE_selection(t);};function get_IE_selection(t){var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;if(t&&t.focused){if(!t.ea_line_height){div=d.createElement("div");div.style.fontFamily=get_css_property(t,"font-family");div.style.fontSize=get_css_property(t,"font-size");div.style.visibility="hidden";div.innerHTML="0";d.body.appendChild(div);t.ea_line_height=div.offsetHeight;d.bod
 y.removeChild(div);}range=d.selection.createRange();try{stored_range=range.duplicate();stored_range.moveToElementText(t);stored_range.setEndPoint('EndToEnd',range);if(stored_range.parentElement()==t){elem=t;scrollTop=0;while(elem.parentNode){scrollTop+=elem.scrollTop;elem=elem.parentNode;}relative_top=range.offsetTop-calculeOffsetTop(t)+scrollTop;line_start=Math.round((relative_top / t.ea_line_height)+1);line_nb=Math.round(range.boundingHeight / t.ea_line_height);range_start=stored_range.text.length-range.text.length;tab=t.value.substr(0,range_start).split("\n");range_start+=(line_start-tab.length)*2;t.selectionStart=range_start;range_end=t.selectionStart+range.text.length;tab=t.value.substr(0,range_start+range.text.length).split("\n");range_end+=(line_start+line_nb-1-tab.length)*2;t.selectionEnd=range_end;}}catch(e){}}setTimeout("get_IE_selection(document.getElementById('"+t.id+"'));",50);};function IE_textarea_focus(){event.srcElement.focused=true;}function IE_textarea_blur(){even
 t.srcElement.focused=false;}function set_IE_selection(t){var nbLineStart,nbLineStart,nbLineEnd,range;if(!window.closed){nbLineStart=t.value.substr(0,t.selectionStart).split("\n").length-1;nbLineEnd=t.value.substr(0,t.selectionEnd).split("\n").length-1;try{range=document.selection.createRange();range.moveToElementText(t);range.setEndPoint('EndToStart',range);range.moveStart('character',t.selectionStart-nbLineStart);range.moveEnd('character',t.selectionEnd-nbLineEnd-(t.selectionStart-nbLineStart));range.select();}catch(e){}}};eAL.waiting_loading["elements_functions.js"]="loaded";
+ EAL.prototype.start_resize_area=function(){var d=document,a,div,width,height,father;d.onmouseup=eAL.end_resize_area;d.onmousemove=eAL.resize_area;eAL.toggle(eAL.resize["id"]);a=eAs[eAL.resize["id"]]["textarea"];div=d.getElementById("edit_area_resize");if(!div){div=d.createElement("div");div.id="edit_area_resize";div.style.border="dashed #888888 1px";}width=a.offsetWidth-2;height=a.offsetHeight-2;div.style.display="block";div.style.width=width+"px";div.style.height=height+"px";father=a.parentNode;father.insertBefore(div,a);a.style.display="none";eAL.resize["start_top"]=calculeOffsetTop(div);eAL.resize["start_left"]=calculeOffsetLeft(div);};EAL.prototype.end_resize_area=function(e){var d=document,div,a,width,height;d.onmouseup="";d.onmousemove="";div=d.getElementById("edit_area_resize");a=eAs[eAL.resize["id"]]["textarea"];width=Math.max(eAs[eAL.resize["id"]]["settings"]["min_width"],div.offsetWidth-4);height=Math.max(eAs[eAL.resize["id"]]["settings"]["min_height"],div.offsetHeight-4)
 ;if(eAL.isIE==6){width-=2;height-=2;}a.style.width=width+"px";a.style.height=height+"px";div.style.display="none";a.style.display="inline";a.selectionStart=eAL.resize["selectionStart"];a.selectionEnd=eAL.resize["selectionEnd"];eAL.toggle(eAL.resize["id"]);return false;};EAL.prototype.resize_area=function(e){var allow,newHeight,newWidth;allow=eAs[eAL.resize["id"]]["settings"]["allow_resize"];if(allow=="both"||allow=="y"){newHeight=Math.max(20,getMouseY(e)-eAL.resize["start_top"]);document.getElementById("edit_area_resize").style.height=newHeight+"px";}if(allow=="both"||allow=="x"){newWidth=Math.max(20,getMouseX(e)-eAL.resize["start_left"]);document.getElementById("edit_area_resize").style.width=newWidth+"px";}return false;};eAL.waiting_loading["resize_area.js"]="loaded";
+	EAL.prototype.get_regexp=function(text_array){res="(\\b)(";for(i=0;i<text_array.length;i++){if(i>0)res+="|";res+=this.get_escaped_regexp(text_array[i]);}res+=")(\\b)";reg=new RegExp(res);return res;};EAL.prototype.get_escaped_regexp=function(str){return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g,"\\$1");};EAL.prototype.init_syntax_regexp=function(){var lang_style={};for(var lang in this.load_syntax){if(!this.syntax[lang]){this.syntax[lang]={};this.syntax[lang]["keywords_reg_exp"]={};this.keywords_reg_exp_nb=0;if(this.load_syntax[lang]['KEYWORDS']){param="g";if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)param+="i";for(var i in this.load_syntax[lang]['KEYWORDS']){if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function")continue;this.syntax[lang]["keywords_reg_exp"][i]=new RegExp(this.get_regexp(this.load_syntax[lang]['KEYWORDS'][i]),param);this.keywords_reg_exp_nb++;}}if(this.load_syntax[lang]['OPERATORS']){var str="";var nb=0;for(var i in
  this.load_syntax[lang]['OPERATORS']){if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);nb++;}if(str.length>0)this.syntax[lang]["operators_reg_exp"]=new RegExp("("+str+")","g");}if(this.load_syntax[lang]['DELIMITERS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['DELIMITERS']){if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);nb++;}if(str.length>0)this.syntax[lang]["delimiters_reg_exp"]=new RegExp("("+str+")","g");}var syntax_trace=[];this.syntax[lang]["quotes"]={};var quote_tab=[];if(this.load_syntax[lang]['QUOTEMARKS']){for(var i in this.load_syntax[lang]['QUOTEMARKS']){if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);this.syntax[lang]["quotes"][x]=x;quote_tab[quot
 e_tab.length]="("+x+"(\\\\.|[^"+x+"])*(?:"+x+"|$))";syntax_trace.push(x);}}this.syntax[lang]["comments"]={};if(this.load_syntax[lang]['COMMENT_SINGLE']){for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";syntax_trace.push(x);this.syntax[lang]["comments"][x]="\n";}}if(this.load_syntax[lang]['COMMENT_MULTI']){for(var i in this.load_syntax[lang]['COMMENT_MULTI']){if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function")continue;var start=this.get_escaped_regexp(i);var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";syntax_trace.push(start);syntax_trace.push(end);this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];}}if(quote_tab.length>0)this.syntax[lang]["c
 omment_or_quote_reg_exp"]=new RegExp("("+quote_tab.join("|")+")","gi");if(syntax_trace.length>0)this.syntax[lang]["syntax_trace_regexp"]=new RegExp("((.|\n)*?)(\\\\*("+syntax_trace.join("|")+"|$))","gmi");if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){this.syntax[lang]["script_delimiters"]={};for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function")continue;this.syntax[lang]["script_delimiters"][i]=this.load_syntax[lang]['SCRIPT_DELIMITERS'];}}this.syntax[lang]["custom_regexp"]={};if(this.load_syntax[lang]['REGEXPS']){for(var i in this.load_syntax[lang]['REGEXPS']){if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function")continue;var val=this.load_syntax[lang]['REGEXPS'][i];if(!this.syntax[lang]["custom_regexp"][val['execute']])this.syntax[lang]["custom_regexp"][val['execute']]={};this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp':new RegExp(val['search'],val['modifiers']),'class':val['class']};}
 }if(this.load_syntax[lang]['STYLES']){lang_style[lang]={};for(var i in this.load_syntax[lang]['STYLES']){if(typeof(this.load_syntax[lang]['STYLES'][i])=="function")continue;if(typeof(this.load_syntax[lang]['STYLES'][i])!="string"){for(var j in this.load_syntax[lang]['STYLES'][i]){lang_style[lang][j]=this.load_syntax[lang]['STYLES'][i][j];}}
+else{lang_style[lang][i]=this.load_syntax[lang]['STYLES'][i];}}}var style="";for(var i in lang_style[lang]){if(lang_style[lang][i].length>0){style+="."+lang+" ."+i.toLowerCase()+" span{"+lang_style[lang][i]+"}\n";style+="."+lang+" ."+i.toLowerCase()+"{"+lang_style[lang][i]+"}\n";}}this.syntax[lang]["styles"]=style;}}};eAL.waiting_loading["reg_syntax.js"]="loaded";
+var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "<script type='text/javascript'> Ã EA(){var t=Á;t.error=Ì;t.inlinePopup=[{popup_id:\"area_search_replace\",icon_id:\"search\"},{popup_id:\"edit_area_help\",icon_id:\"help\"}];t.plugins={};t.line_number=0;È.eAL.set_browser_infos(t);if(t.isIE >=8)t.isIE=7;t.É={};t.last_text_to_highlight=\"\";t.last_hightlighted_text=\"\";t.syntax_list=[];t.allready_used_syntax={};t.check_line_selection_timer=50;t.ÂFocused=Ì;t.highlight_selection_line=null;t.previous=[];t.next=[];t.last_undo=\"\";t.files={};t.filesIdAssoc={};t.curr_file='';t.assocBracket={};t.revertAssocBracket={};t.assocBracket[\"(\"]=\")\";t.assocBracket[\"{\"]=\"}\";t.assocBracket[\"[\"]=\"]\";for(var index in t.assocBracket){t.revertAssocBracket[t.assocBracket[index]]=index;}t.is_editable=Ë;t.lineHeight=16;t.tab_nb_char=8;if(t.isOpera)t.tab_nb_char=6;t.is_tabbing=Ì;t.fullscreen={'isFull':Ì};t.isResizing=Ì;t.id=area_id;t.Å=eAs[t.id
 ][\"Å\"];if((\"\"+t.Å['replace_tab_by_spaces']).match(/^[0-9]+$/)){t.tab_nb_char=t.Å['replace_tab_by_spaces'];t.tabulation=\"\";for(var i=0;i<t.tab_nb_char;i++)t.tabulation+=\" \";}\nelse{t.tabulation=\"\t\";}if(t.Å[\"syntax_selection_allow\"]&&t.Å[\"syntax_selection_allow\"].Æ>0)t.syntax_list=t.Å[\"syntax_selection_allow\"].replace(/ /g,\"\").split(\",\");if(t.Å['syntax'])t.allready_used_syntax[t.Å['syntax']]=Ë;};EA.Ä.init=Ã(){var t=Á,a,s=t.Å;t.Â=_$(\"Â\");t.container=_$(\"container\");t.result=_$(\"result\");t.content_highlight=_$(\"content_highlight\");t.selection_field=_$(\"selection_field\");t.selection_field_text=_$(\"selection_field_text\");t.processing_screen=_$(\"processing\");t.editor_area=_$(\"editor\");t.tab_browsing_area=_$(\"tab_browsing_area\");t.test_font_size=_$(\"test_font_size\");a=t.Â;if(!s['is_editable'])t.set_editable(Ì);t.set_show_line_colors(s['show_line_colors']);if(syntax_selec=_$(\"syntax_selection\")){for(var i=0;i<t.syntax_list.Æ;i++){
 var syntax=t.syntax_list[i];var option=document.createElement(\"option\");option.Ê=syntax;if(syntax==s['syntax'])option.selected=\"selected\";option.innerHTML=t.get_translation(\"syntax_\"+syntax,\"word\");syntax_selec.appendChild(option);}}spans=È.getChildren(_$(\"toolbar_1\"),\"span\",\"\",\"\",\"all\",-1);for(var i=0;i<spans.Æ;i++){id=spans[i].id.replace(/tmp_tool_(.*)/,\"$1\");if(id!=spans[i].id){for(var j in t.plugins){if(typeof(t.plugins[j].get_control_html)==\"Ã\"){html=t.plugins[j].get_control_html(id);if(html!=Ì){html=t.get_translation(html,\"template\");var new_span=document.createElement(\"span\");new_span.innerHTML=html;var father=spans[i].ÈNode;spans[i].ÈNode.replaceChild(new_span,spans[i]);break;}}}}}if(s[\"debug\"]){t.debug=È.document.getElementById(\"edit_area_debug_\"+t.id);}if(_$(\"redo\")!=null)t.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);if(typeof(È.eAL.syntax[s[\"syntax\"]])!=\"undefined\"){for(var i in È.eAL.syntax){if(typeof(È.eAL.s
 yntax[i][\"Çs\"])!=\"undefined\"){t.add_Ç(È.eAL.syntax[i][\"Çs\"]);}}}if(t.isOpera)_$(\"editor\").onkeypress=keyDown;\nelse _$(\"editor\").onkeydown=keyDown;for(var i=0;i<t.inlinePopup.Æ;i++){if(t.isOpera)_$(t.inlinePopup[i][\"popup_id\"]).onkeypress=keyDown;\nelse _$(t.inlinePopup[i][\"popup_id\"]).onkeydown=keyDown;}if(s[\"allow_resize\"]==\"both\"||s[\"allow_resize\"]==\"x\"||s[\"allow_resize\"]==\"y\")t.allow_resize(Ë);È.eAL.toggle(t.id,\"on\");t.change_smooth_selection_mode(eA.smooth_selection);t.execCommand(\"change_highlight\",s[\"start_highlight\"]);t.set_font(eA.Å[\"font_family\"],eA.Å[\"font_size\"]);children=È.getChildren(document.body,\"\",\"selec\",\"none\",\"all\",-1);for(var i=0;i<children.Æ;i++){if(t.isIE)children[i].unselectable=Ë;\nelse children[i].onmousedown=Ã(){return Ì};}a.spellcheck=s[\"gecko_spellcheck\"];if(t.isFirefox >='3'){t.content_highlight.Ç.paddingLeft=\"1px\";t.selection_field.Ç.paddingLeft=\"1px\";t.selection_field_text.Ç.paddingLef
 t=\"1px\";}if(t.isIE&&t.isIE < 8){a.Ç.marginTop=\"-1px\";}if(t.isSafari){t.editor_area.Ç.position=\"absolute\";a.Ç.marginLeft=\"-3px\";if(t.isSafari < 3.2)a.Ç.marginTop=\"1px\";}È.eAL.add_event(t.result,\"click\",Ã(e){if((e.target||e.srcElement)==eA.result){eA.area_select(eA.Â.Ê.Æ,0);}});if(s['is_multi_files']!=Ì)t.open_file({'id':t.curr_file,'text':''});t.set_word_wrap(s['word_wrap']);setTimeout(\"eA.focus();eA.manage_size();eA.execCommand('EA_load');\",10);t.check_undo();t.check_line_selection(Ë);t.scroll_to_view();for(var i in t.plugins){if(typeof(t.plugins[i].onload)==\"Ã\")t.plugins[i].onload();}if(s['fullscreen']==Ë)t.toggle_full_screen(Ë);È.eAL.add_event(window,\"resize\",eA.update_size);È.eAL.add_event(È.window,\"resize\",eA.update_size);È.eAL.add_event(top.window,\"resize\",eA.update_size);È.eAL.add_event(window,\"unload\",Ã(){if(È.eAL){È.eAL.remove_event(È.window,\"resize\",eA.update_size);È.eAL.remove_event(top.window,\"resize\",eA.update_size);}if
 (eAs[eA.id]&&eAs[eA.id][\"displayed\"]){eA.execCommand(\"EA_unload\");}});};EA.Ä.update_size=Ã(){var d=document,pd=È.document,height,width,popup,maxLeft,maxTop;if(typeof eAs !='undefined'&&eAs[eA.id]&&eAs[eA.id][\"displayed\"]==Ë){if(eA.fullscreen['isFull']){pd.getElementById(\"frame_\"+eA.id).Ç.width=pd.getElementsByTagName(\"html\")[0].clientWidth+\"px\";pd.getElementById(\"frame_\"+eA.id).Ç.height=pd.getElementsByTagName(\"html\")[0].clientHeight+\"px\";}if(eA.tab_browsing_area.Ç.display=='block'&&(!eA.isIE||eA.isIE >=8)){eA.tab_browsing_area.Ç.height=\"0px\";eA.tab_browsing_area.Ç.height=(eA.result.offsetTop-eA.tab_browsing_area.offsetTop-1)+\"px\";}height=d.body.offsetHeight-eA.get_all_toolbar_height()-4;eA.result.Ç.height=height+\"px\";width=d.body.offsetWidth-2;eA.result.Ç.width=width+\"px\";for(i=0;i < eA.inlinePopup.Æ;i++){popup=_$(eA.inlinePopup[i][\"popup_id\"]);maxLeft=d.body.offsetWidth-popup.offsetWidth;maxTop=d.body.offsetHeight-popup.offsetHeight;if(popup
 .offsetTop > maxTop)popup.Ç.top=maxTop+\"px\";if(popup.offsetLeft > maxLeft)popup.Ç.left=maxLeft+\"px\";}eA.manage_size(Ë);eA.fixLinesHeight(eA.Â.Ê,0,-1);}};EA.Ä.manage_size=Ã(onlyOneTime){if(!eAs[Á.id])return Ì;if(eAs[Á.id][\"displayed\"]==Ë&&Á.ÂFocused){var area_height,resized=Ì;if(!Á.Å['word_wrap']){var area_width=Á.Â.scrollWidth;area_height=Á.Â.scrollHeight;if(Á.isOpera&&Á.isOpera < 9.6){area_width=10000;}if(Á.Â.previous_scrollWidth!=area_width){Á.container.Ç.width=area_width+\"px\";Á.Â.Ç.width=area_width+\"px\";Á.content_highlight.Ç.width=area_width+\"px\";Á.Â.previous_scrollWidth=area_width;resized=Ë;}}if(Á.Å['word_wrap']){newW=Á.Â.offsetWidth;if(Á.isFirefox||Á.isIE)newW-=2;if(Á.isSafari)newW-=6;Á.content_highlight.Ç.width=Á.selection_field_text.Ç.width=Á.selection_field.Ç.width=Á.test_font_size.Ç.width=newW+\"px\";}if(Á.isOpera||Á.isFirefox||Á.isSafari){area_height=Á.getLinePosTop(Á.É[\"nb_line\"]+1);}\nelse{area_height=�
 �.Â.scrollHeight;}if(Á.Â.previous_scrollHeight!=area_height){Á.container.Ç.height=(area_height+2)+\"px\";Á.Â.Ç.height=area_height+\"px\";Á.content_highlight.Ç.height=area_height+\"px\";Á.Â.previous_scrollHeight=area_height;resized=Ë;}if(Á.É[\"nb_line\"] >=Á.line_number){var newLines='',destDiv=_$(\"line_number\"),start=Á.line_number,end=Á.É[\"nb_line\"]+100;for(i=start+1;i < end;i++){newLines+='<div id=\"line_'+i+'\">'+i+\"</div>\";Á.line_number++;}destDiv.innerHTML=destDiv.innerHTML+newLines;Á.fixLinesHeight(Á.Â.Ê,start,-1);}Á.Â.scrollTop=\"0px\";Á.Â.scrollLeft=\"0px\";if(resized==Ë){Á.scroll_to_view();}}if(!onlyOneTime)setTimeout(\"eA.manage_size();\",100);};EA.Ä.execCommand=Ã(cmd,param){for(var i in Á.plugins){if(typeof(Á.plugins[i].execCommand)==\"Ã\"){if(!Á.plugins[i].execCommand(cmd,param))return;}}switch(cmd){case \"save\":if(Á.Å[\"save_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"save_callback\"]+\"('\"+Á.id+\"',eA.Â.Ê);\");break;case \"load
 \":if(Á.Å[\"load_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"load_callback\"]+\"('\"+Á.id+\"');\");break;case \"onchange\":if(Á.Å[\"change_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"change_callback\"]+\"('\"+Á.id+\"');\");break;case \"EA_load\":if(Á.Å[\"EA_load_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_load_callback\"]+\"('\"+Á.id+\"');\");break;case \"EA_unload\":if(Á.Å[\"EA_unload_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_unload_callback\"]+\"('\"+Á.id+\"');\");break;case \"toggle_on\":if(Á.Å[\"EA_toggle_on_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_toggle_on_callback\"]+\"('\"+Á.id+\"');\");break;case \"toggle_off\":if(Á.Å[\"EA_toggle_off_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_toggle_off_callback\"]+\"('\"+Á.id+\"');\");break;case \"re_sync\":if(!Á.do_highlight)break;case \"file_switch_on\":if(Á.Å[\"EA_file_switch_on_callback\"].Æ>0)eval(\"È.\"+Á.Å[\"EA_file_switch_on_callback\"]+\"(param);\");break;case \"file_switch_off\":if(Á.Å[\"EA_file_switch_off_callback\"].Æ
 >0)eval(\"È.\"+Á.Å[\"EA_file_switch_off_callback\"]+\"(param);\");break;case \"file_close\":if(Á.Å[\"EA_file_close_callback\"].Æ>0)return eval(\"È.\"+Á.Å[\"EA_file_close_callback\"]+\"(param);\");break;default:if(typeof(eval(\"eA.\"+cmd))==\"Ã\"){if(Á.Å[\"debug\"])eval(\"eA.\"+cmd+\"(param);\");\nelse try{eval(\"eA.\"+cmd+\"(param);\");}catch(e){};}}};EA.Ä.get_translation=Ã(word,mode){if(mode==\"template\")return È.eAL.translate(word,Á.Å[\"language\"],mode);\nelse return È.eAL.get_word_translation(word,Á.Å[\"language\"]);};EA.Ä.add_plugin=Ã(plug_name,plug_obj){for(var i=0;i<Á.Å[\"plugins\"].Æ;i++){if(Á.Å[\"plugins\"][i]==plug_name){Á.plugins[plug_name]=plug_obj;plug_obj.baseURL=È.eAL.baseURL+\"plugins/\"+plug_name+\"/\";if(typeof(plug_obj.init)==\"Ã\")plug_obj.init();}}};EA.Ä.load_css=Ã(url){try{link=document.createElement(\"link\");link.type=\"text/css\";link.rel=\"Çsheet\";link.media=\"all\";link.href=url;head=document.getElementsByTagName(\"head\"
 );head[0].appendChild(link);}catch(e){document.write(\"<link href='\"+url+\"' rel='Çsheet' type='text/css' />\");}};EA.Ä.load_script=Ã(url){try{script=document.createElement(\"script\");script.type=\"text/javascript\";script.src=url;script.charset=\"UTF-8\";head=document.getElementsByTagName(\"head\");head[0].appendChild(script);}catch(e){document.write(\"<script type='text/javascript' src='\"+url+\"' charset=\\\"UTF-8\\\"><\"+\"/script>\");}};EA.Ä.add_lang=Ã(language,Ês){if(!È.eAL.lang[language])È.eAL.lang[language]={};for(var i in Ês)È.eAL.lang[language][i]=Ês[i];};Ã _$(id){return document.getElementById(id);};var eA=new EA();È.eAL.add_event(window,\"load\",init);Ã init(){setTimeout(\"eA.init();\",10);};	EA.Ä.focus=Ã(){Á.Â.focus();Á.ÂFocused=Ë;};EA.Ä.check_line_selection=Ã(timer_checkup){var changes,infos,new_top,new_width,i;var t1=t2=t2_1=t3=tLines=tend=new Date().getTime();if(!eAs[Á.id])return Ì;if(!Á.smooth_selection&&!Á.do_highlight){}\nelse if(Á.Â
 Focused&&eAs[Á.id][\"displayed\"]==Ë&&Á.isResizing==Ì){infos=Á.get_selection_infos();changes=Á.checkTextEvolution(typeof(Á.É['full_text'])=='undefined' ? '':Á.É['full_text'],infos['full_text']);t2=new Date().getTime();if(Á.É[\"line_start\"] !=infos[\"line_start\"]||Á.É[\"line_nb\"] !=infos[\"line_nb\"]||infos[\"full_text\"] !=Á.É[\"full_text\"]||Á.reload_highlight||Á.É[\"selectionStart\"] !=infos[\"selectionStart\"]||Á.É[\"selectionEnd\"] !=infos[\"selectionEnd\"]||!timer_checkup){new_top=Á.getLinePosTop(infos[\"line_start\"]);new_width=Math.max(Á.Â.scrollWidth,Á.container.clientWidth-50);Á.selection_field.Ç.top=Á.selection_field_text.Ç.top=new_top+\"px\";if(!Á.Å['word_wrap']){Á.selection_field.Ç.width=Á.selection_field_text.Ç.width=Á.test_font_size.Ç.width=new_width+\"px\";}if(Á.do_highlight==Ë){var curr_text=infos[\"full_text\"].split(\"\\n\");var content=\"\";var start=Math.max(0,infos[\"line_start\"]-1);var end=Math.min(curr_text.Æ,infos[\
 "line_start\"]+infos[\"line_nb\"]-1);for(i=start;i< end;i++){content+=curr_text[i]+\"\\n\";}selLength=infos['selectionEnd']-infos['selectionStart'];content=content.substr(0,infos[\"curr_pos\"]-1)+\"\\r\\r\"+content.substr(infos[\"curr_pos\"]-1,selLength)+\"\\r\\r\"+content.substr(infos[\"curr_pos\"]-1+selLength);content='<span>'+content.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(\"\\r\\r\",'</span><strong>').replace(\"\\r\\r\",'</strong><span>')+'</span>';if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){Á.selection_field.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{Á.selection_field.innerHTML=content;}Á.selection_field_text.innerHTML=Á.selection_field.innerHTML;t2_1=new Date().getTime();if(Á.reload_highlight||(infos[\"full_text\"] !=Á.last_text_to_highlight&&(Á.É[\"line_start\"]!=infos[\"line_start\"]||Á.show_line_colors||Á.Å['word_wrap']||Á.É[\"line_nb\"]!=infos[\"line_nb\"]||Á.É[\"nb_line\"]!=infos[\"nb_li
 ne\"]))){Á.maj_highlight(infos);}}}t3=new Date().getTime();if(Á.Å['word_wrap']&&infos[\"full_text\"] !=Á.É[\"full_text\"]){if(changes.newText.split(\"\\n\").Æ==1&&Á.É['nb_line']&&infos['nb_line']==Á.É['nb_line']){Á.fixLinesHeight(infos['full_text'],changes.lineStart,changes.lineStart);}\nelse{Á.fixLinesHeight(infos['full_text'],changes.lineStart,-1);}}tLines=new Date().getTime();if(infos[\"line_start\"] !=Á.É[\"line_start\"]||infos[\"curr_pos\"] !=Á.É[\"curr_pos\"]||infos[\"full_text\"].Æ!=Á.É[\"full_text\"].Æ||Á.reload_highlight||!timer_checkup){var selec_char=infos[\"curr_line\"].charAt(infos[\"curr_pos\"]-1);var no_real_move=Ë;if(infos[\"line_nb\"]==1&&(Á.assocBracket[selec_char]||Á.revertAssocBracket[selec_char])){no_real_move=Ì;if(Á.findEndBracket(infos,selec_char)===Ë){_$(\"end_bracket\").Ç.visibility=\"visible\";_$(\"cursor_pos\").Ç.visibility=\"visible\";_$(\"cursor_pos\").innerHTML=selec_char;_$(\"end_bracket\").innerHTML=(Á.assocBracket[selec_
 char]||Á.revertAssocBracket[selec_char]);}\nelse{_$(\"end_bracket\").Ç.visibility=\"hidden\";_$(\"cursor_pos\").Ç.visibility=\"hidden\";}}\nelse{_$(\"cursor_pos\").Ç.visibility=\"hidden\";_$(\"end_bracket\").Ç.visibility=\"hidden\";}Á.displayToCursorPosition(\"cursor_pos\",infos[\"line_start\"],infos[\"curr_pos\"]-1,infos[\"curr_line\"],no_real_move);if(infos[\"line_nb\"]==1&&infos[\"line_start\"]!=Á.É[\"line_start\"])Á.scroll_to_view();}Á.É=infos;}tend=new Date().getTime();if(timer_checkup){setTimeout(\"eA.check_line_selection(Ë)\",Á.check_line_selection_timer);}};EA.Ä.get_selection_infos=Ã(){var sel={},start,end,len,str;Á.getIESelection();start=Á.Â.selectionStart;end=Á.Â.selectionEnd;if(Á.É[\"selectionStart\"]==start&&Á.É[\"selectionEnd\"]==end&&Á.É[\"full_text\"]==Á.Â.Ê){return Á.É;}if(Á.tabulation!=\"\t\"&&Á.Â.Ê.indexOf(\"\t\")!=-1){len=Á.Â.Ê.Æ;Á.Â.Ê=Á.replace_tab(Á.Â.Ê);start=end=start+(Á.Â.Ê.Æ-len);Á.area_select(start,0);}sel[
 \"selectionStart\"]=start;sel[\"selectionEnd\"]=end;sel[\"full_text\"]=Á.Â.Ê;sel[\"line_start\"]=1;sel[\"line_nb\"]=1;sel[\"curr_pos\"]=0;sel[\"curr_line\"]=\"\";sel[\"indexOfCursor\"]=0;sel[\"selec_direction\"]=Á.É[\"selec_direction\"];var splitTab=sel[\"full_text\"].split(\"\\n\");var nbLine=Math.max(0,splitTab.Æ);var nbChar=Math.max(0,sel[\"full_text\"].Æ-(nbLine-1));if(sel[\"full_text\"].indexOf(\"\\r\")!=-1)nbChar=nbChar-(nbLine-1);sel[\"nb_line\"]=nbLine;sel[\"nb_char\"]=nbChar;if(start>0){str=sel[\"full_text\"].substr(0,start);sel[\"curr_pos\"]=start-str.lastIndexOf(\"\\n\");sel[\"line_start\"]=Math.max(1,str.split(\"\\n\").Æ);}\nelse{sel[\"curr_pos\"]=1;}if(end>start){sel[\"line_nb\"]=sel[\"full_text\"].substring(start,end).split(\"\\n\").Æ;}sel[\"indexOfCursor\"]=start;sel[\"curr_line\"]=splitTab[Math.max(0,sel[\"line_start\"]-1)];if(sel[\"selectionStart\"]==Á.É[\"selectionStart\"]){if(sel[\"selectionEnd\"]>Á.É[\"selectionEnd\"])sel[\"selec_direction\"]=\"down\
 ";\nelse if(sel[\"selectionEnd\"]==Á.É[\"selectionStart\"])sel[\"selec_direction\"]=Á.É[\"selec_direction\"];}\nelse if(sel[\"selectionStart\"]==Á.É[\"selectionEnd\"]&&sel[\"selectionEnd\"]>Á.É[\"selectionEnd\"]){sel[\"selec_direction\"]=\"down\";}\nelse{sel[\"selec_direction\"]=\"up\";}_$(\"nbLine\").innerHTML=nbLine;_$(\"nbChar\").innerHTML=nbChar;_$(\"linePos\").innerHTML=sel[\"line_start\"];_$(\"currPos\").innerHTML=sel[\"curr_pos\"];return sel;};EA.Ä.getIESelection=Ã(){var selectionStart,selectionEnd,range,stored_range;if(!Á.isIE)return Ì;if(Á.Å['word_wrap'])Á.Â.wrap='off';try{range=document.selection.createRange();stored_range=range.duplicate();stored_range.moveToElementText(Á.Â);stored_range.setEndPoint('EndToEnd',range);if(stored_range.ÈElement()!=Á.Â)throw \"invalid focus\";var scrollTop=Á.result.scrollTop+document.body.scrollTop;var relative_top=range.offsetTop-È.calculeOffsetTop(Á.Â)+scrollTop;var line_start=Math.round((relative_top / Á.lineHeigh
 t)+1);var line_nb=Math.round(range.boundingHeight / Á.lineHeight);selectionStart=stored_range.text.Æ-range.text.Æ;selectionStart+=(line_start-Á.Â.Ê.substr(0,selectionStart).split(\"\\n\").Æ)*2;selectionStart-=(line_start-Á.Â.Ê.substr(0,selectionStart).split(\"\\n\").Æ)* 2;selectionEnd=selectionStart+range.text.Æ;selectionEnd+=(line_start+line_nb-1-Á.Â.Ê.substr(0,selectionEnd).split(\"\\n\").Æ)*2;Á.Â.selectionStart=selectionStart;Á.Â.selectionEnd=selectionEnd;}catch(e){}if(Á.Å['word_wrap'])Á.Â.wrap='soft';};EA.Ä.setIESelection=Ã(){var a=Á.Â,nbLineStart,nbLineEnd,range;if(!Á.isIE)return Ì;nbLineStart=a.Ê.substr(0,a.selectionStart).split(\"\\n\").Æ-1;nbLineEnd=a.Ê.substr(0,a.selectionEnd).split(\"\\n\").Æ-1;range=document.selection.createRange();range.moveToElementText(a);range.setEndPoint('EndToStart',range);range.moveStart('character',a.selectionStart-nbLineStart);range.moveEnd('character',a.selectionEnd-nbLineEnd-(a.selectionStart-nbLineStart));rang
 e.select();};EA.Ä.checkTextEvolution=Ã(lastText,newText){var ch={},baseStep=200,cpt=0,end,step,tStart=new Date().getTime();end=Math.min(newText.Æ,lastText.Æ);step=baseStep;while(cpt<end&&step>=1){if(lastText.substr(cpt,step)==newText.substr(cpt,step)){cpt+=step;}\nelse{step=Math.floor(step/2);}}ch.posStart=cpt;ch.lineStart=newText.substr(0,ch.posStart).split(\"\\n\").Æ-1;cpt_last=lastText.Æ;cpt=newText.Æ;step=baseStep;while(cpt>=0&&cpt_last>=0&&step>=1){if(lastText.substr(cpt_last-step,step)==newText.substr(cpt-step,step)){cpt-=step;cpt_last-=step;}\nelse{step=Math.floor(step/2);}}ch.posNewEnd=cpt;ch.posLastEnd=cpt_last;if(ch.posNewEnd<=ch.posStart){if(lastText.Æ < newText.Æ){ch.posNewEnd=ch.posStart+newText.Æ-lastText.Æ;ch.posLastEnd=ch.posStart;}\nelse{ch.posLastEnd=ch.posStart+lastText.Æ-newText.Æ;ch.posNewEnd=ch.posStart;}}ch.newText=newText.substring(ch.posStart,ch.posNewEnd);ch.lastText=lastText.substring(ch.posStart,ch.posLastEnd);ch.lineNewEnd=newText.substr(0,c
 h.posNewEnd).split(\"\\n\").Æ-1;ch.lineLastEnd=lastText.substr(0,ch.posLastEnd).split(\"\\n\").Æ-1;ch.newTextLine=newText.split(\"\\n\").slice(ch.lineStart,ch.lineNewEnd+1).join(\"\\n\");ch.lastTextLine=lastText.split(\"\\n\").slice(ch.lineStart,ch.lineLastEnd+1).join(\"\\n\");return ch;};EA.Ä.tab_selection=Ã(){if(Á.is_tabbing)return;Á.is_tabbing=Ë;Á.getIESelection();var start=Á.Â.selectionStart;var end=Á.Â.selectionEnd;var insText=Á.Â.Ê.substring(start,end);var pos_start=start;var pos_end=end;if(insText.Æ==0){Á.Â.Ê=Á.Â.Ê.substr(0,start)+Á.tabulation+Á.Â.Ê.substr(end);pos_start=start+Á.tabulation.Æ;pos_end=pos_start;}\nelse{start=Math.max(0,Á.Â.Ê.substr(0,start).lastIndexOf(\"\\n\")+1);endText=Á.Â.Ê.substr(end);startText=Á.Â.Ê.substr(0,start);tmp=Á.Â.Ê.substring(start,end).split(\"\\n\");insText=Á.tabulation+tmp.join(\"\\n\"+Á.tabulation);Á.Â.Ê=startText+insText+endText;pos_start=start;pos_end=Á.Â.Ê.indexOf(\"\\n\",startText.Æ+insText
 .Æ);if(pos_end==-1)pos_end=Á.Â.Ê.Æ;}Á.Â.selectionStart=pos_start;Á.Â.selectionEnd=pos_end;if(Á.isIE){Á.setIESelection();setTimeout(\"eA.is_tabbing=Ì;\",100);}\nelse{Á.is_tabbing=Ì;}};EA.Ä.invert_tab_selection=Ã(){var t=Á,a=Á.Â;if(t.is_tabbing)return;t.is_tabbing=Ë;t.getIESelection();var start=a.selectionStart;var end=a.selectionEnd;var insText=a.Ê.substring(start,end);var pos_start=start;var pos_end=end;if(insText.Æ==0){if(a.Ê.substring(start-t.tabulation.Æ,start)==t.tabulation){a.Ê=a.Ê.substr(0,start-t.tabulation.Æ)+a.Ê.substr(end);pos_start=Math.max(0,start-t.tabulation.Æ);pos_end=pos_start;}}\nelse{start=a.Ê.substr(0,start).lastIndexOf(\"\\n\")+1;endText=a.Ê.substr(end);startText=a.Ê.substr(0,start);tmp=a.Ê.substring(start,end).split(\"\\n\");insText=\"\";for(i=0;i<tmp.Æ;i++){for(j=0;j<t.tab_nb_char;j++){if(tmp[i].charAt(0)==\"\t\"){tmp[i]=tmp[i].substr(1);j=t.tab_nb_char;}\nelse if(tmp[i].charAt(0)==\" \")tmp[i]=tmp[i].substr(1);}insText+=tmp[i]
 ;if(i<tmp.Æ-1)insText+=\"\\n\";}a.Ê=startText+insText+endText;pos_start=start;pos_end=a.Ê.indexOf(\"\\n\",startText.Æ+insText.Æ);if(pos_end==-1)pos_end=a.Ê.Æ;}a.selectionStart=pos_start;a.selectionEnd=pos_end;if(t.isIE){t.setIESelection();setTimeout(\"eA.is_tabbing=Ì;\",100);}\nelse t.is_tabbing=Ì;};EA.Ä.press_enter=Ã(){if(!Á.smooth_selection)return Ì;Á.getIESelection();var scrollTop=Á.result.scrollTop;var scrollLeft=Á.result.scrollLeft;var start=Á.Â.selectionStart;var end=Á.Â.selectionEnd;var start_last_line=Math.max(0,Á.Â.Ê.substring(0,start).lastIndexOf(\"\\n\")+1);var begin_line=Á.Â.Ê.substring(start_last_line,start).replace(/^([ \t]*).*/gm,\"$1\");var lineStart=Á.Â.Ê.substring(0,start).split(\"\\n\").Æ;if(begin_line==\"\\n\"||begin_line==\"\\r\"||begin_line.Æ==0){return Ì;}if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){begin_line=\"\\r\\n\"+begin_line;}\nelse{begin_line=\"\\n\"+begin_line;}Á.Â.Ê=Á.Â.Ê.substring(0,start)+begin_line+Á.Â.Ê.sub
 string(end);Á.area_select(start+begin_line.Æ,0);if(Á.isIE){Á.result.scrollTop=scrollTop;Á.result.scrollLeft=scrollLeft;}return Ë;};EA.Ä.findEndBracket=Ã(infos,bracket){var start=infos[\"indexOfCursor\"];var normal_order=Ë;if(Á.assocBracket[bracket])endBracket=Á.assocBracket[bracket];\nelse if(Á.revertAssocBracket[bracket]){endBracket=Á.revertAssocBracket[bracket];normal_order=Ì;}var end=-1;var nbBracketOpen=0;for(var i=start;i<infos[\"full_text\"].Æ&&i>=0;){if(infos[\"full_text\"].charAt(i)==endBracket){nbBracketOpen--;if(nbBracketOpen<=0){end=i;break;}}\nelse if(infos[\"full_text\"].charAt(i)==bracket)nbBracketOpen++;if(normal_order)i++;\nelse i--;}if(end==-1)return Ì;var endLastLine=infos[\"full_text\"].substr(0,end).lastIndexOf(\"\\n\");if(endLastLine==-1)line=1;\nelse line=infos[\"full_text\"].substr(0,endLastLine).split(\"\\n\").Æ+1;var curPos=end-endLastLine-1;var endLineLength=infos[\"full_text\"].substring(end).split(\"\\n\")[0].Æ;Á.displayToCursorPosition
 (\"end_bracket\",line,curPos,infos[\"full_text\"].substring(endLastLine+1,end+endLineLength));return Ë;};EA.Ä.displayToCursorPosition=Ã(id,start_line,cur_pos,lineContent,no_real_move){var elem,dest,content,posLeft=0,posTop,fixPadding,topOffset,endElem;elem=Á.test_font_size;dest=_$(id);content=\"<span id='test_font_size_inner'>\"+lineContent.substr(0,cur_pos).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\")+\"</span><span id='endTestFont'>\"+lineContent.substr(cur_pos).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\")+\"</span>\";if(Á.isIE||(Á.isOpera&&Á.isOpera < 9.6)){elem.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{elem.innerHTML=content;}endElem=_$('endTestFont');topOffset=endElem.offsetTop;fixPadding=parseInt(Á.content_highlight.Ç.paddingLeft.replace(\"px\",\"\"));posLeft=45+endElem.offsetLeft+(!isNaN(fixPadding)&&topOffset > 0 ? fixPadding:0);posTop=Á.getLinePosTop(start_line)+topOffset;if(Á.isIE&&cur_pos > 0&&endElem.offsetLeft==0){posTop+
 =Á.lineHeight;}if(no_real_move!=Ë){dest.Ç.top=posTop+\"px\";dest.Ç.left=posLeft+\"px\";}dest.cursor_top=posTop;dest.cursor_left=posLeft;};EA.Ä.getLinePosTop=Ã(start_line){var elem=_$('line_'+start_line),posTop=0;if(elem)posTop=elem.offsetTop;\nelse posTop=Á.lineHeight *(start_line-1);return posTop;};EA.Ä.getTextHeight=Ã(text){var t=Á,elem,height;elem=t.test_font_size;content=text.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\");if(t.isIE||(Á.isOpera&&Á.isOpera < 9.6)){elem.innerHTML=\"<pre>\"+content.replace(/^\\r?\\n/,\"<br>\")+\"</pre>\";}\nelse{elem.innerHTML=content;}height=elem.offsetHeight;height=Math.max(1,Math.floor(elem.offsetHeight / Á.lineHeight))* Á.lineHeight;return height;};EA.Ä.fixLinesHeight=Ã(textValue,lineStart,lineEnd){var aText=textValue.split(\"\\n\");if(lineEnd==-1)lineEnd=aText.Æ-1;for(var i=Math.max(0,lineStart);i <=lineEnd;i++){if(elem=_$('line_'+(i+1))){elem.Ç.height=typeof(aText[i])!=\"undefined\" ? Á.getTextHeight(aText[i])+\"px\":Á.line
 Height;}}};EA.Ä.area_select=Ã(start,Æ){Á.Â.focus();start=Math.max(0,Math.min(Á.Â.Ê.Æ,start));end=Math.max(start,Math.min(Á.Â.Ê.Æ,start+Æ));if(Á.isIE){Á.Â.selectionStart=start;Á.Â.selectionEnd=end;Á.setIESelection();}\nelse{if(Á.isOpera&&Á.isOpera < 9.6){Á.Â.setSelectionRange(0,0);}Á.Â.setSelectionRange(start,end);}Á.check_line_selection();};EA.Ä.area_get_selection=Ã(){var text=\"\";if(document.selection){var range=document.selection.createRange();text=range.text;}\nelse{text=Á.Â.Ê.substring(Á.Â.selectionStart,Á.Â.selectionEnd);}return text;}; EA.Ä.replace_tab=Ã(text){return text.replace(/((\\n?)([^\t\\n]*)\t)/gi,eA.smartTab);};EA.Ä.smartTab=Ã(){val=\"                   \";return EA.Ä.smartTab.arguments[2]+EA.Ä.smartTab.arguments[3]+val.substr(0,eA.tab_nb_char-(EA.Ä.smartTab.arguments[3].Æ)%eA.tab_nb_char);};EA.Ä.show_waiting_screen=Ã(){width=Á.editor_area.offsetWidth;height=Á.editor_area.offsetHeight;if(!(Á.isIE&&Á.isIE<6)){width-=2;
 height-=2;}Á.processing_screen.Ç.display=\"block\";Á.processing_screen.Ç.width=width+\"px\";Á.processing_screen.Ç.height=height+\"px\";Á.waiting_screen_displayed=Ë;};EA.Ä.hide_waiting_screen=Ã(){Á.processing_screen.Ç.display=\"none\";Á.waiting_screen_displayed=Ì;};EA.Ä.add_Ç=Ã(Çs){if(Çs.Æ>0){newcss=document.createElement(\"Ç\");newcss.type=\"text/css\";newcss.media=\"all\";if(newcss.ÇSheet){newcss.ÇSheet.cssText=Çs;}\nelse{newcss.appendChild(document.createTextNode(Çs));}document.getElementsByTagName(\"head\")[0].appendChild(newcss);}};EA.Ä.set_font=Ã(family,size){var t=Á,a=Á.Â,s=Á.Å,elem_font,i,elem;var elems=[\"Â\",\"content_highlight\",\"cursor_pos\",\"end_bracket\",\"selection_field\",\"selection_field_text\",\"line_number\"];if(family&&family!=\"\")s[\"font_family\"]=family;if(size&&size>0)s[\"font_size\"]=size;if(t.isOpera&&t.isOpera < 9.6)s['font_family']=\"monospace\";if(elem_font=_$(\"area_font_size\")){for(i=0;i < elem_font.Æ;i++){if(elem_
 font.options[i].Ê&&elem_font.options[i].Ê==s[\"font_size\"])elem_font.options[i].selected=Ë;}}if(t.isFirefox){var nbTry=3;do{var div1=document.createElement('div'),text1=document.createElement('Â');var Çs={width:'40px',overflow:'scroll',zIndex:50,visibility:'hidden',fontFamily:s[\"font_family\"],fontSize:s[\"font_size\"]+\"pt\",lineHeight:t.lineHeight+\"px\",padding:'0',margin:'0',border:'none',whiteSpace:'nowrap'};var diff,changed=Ì;for(i in Çs){div1.Ç[ i ]=Çs[i];text1.Ç[ i ]=Çs[i];}text1.wrap='off';text1.setAttribute('wrap','off');t.container.appendChild(div1);t.container.appendChild(text1);div1.innerHTML=text1.Ê='azertyuiopqsdfghjklm';div1.innerHTML=text1.Ê=text1.Ê+'wxcvbn^p*ù$!:;,,';diff=text1.scrollWidth-div1.scrollWidth;if(Math.abs(diff)>=2){s[\"font_size\"]++;changed=Ë;}t.container.removeChild(div1);t.container.removeChild(text1);nbTry--;}while(changed&&nbTry > 0);}elem=t.test_font_size;elem.Ç.fontFamily=\"\"+s[\"font_family\"];elem.Ç.fontSize=s[\"font_size\
 "]+\"pt\";elem.innerHTML=\"0\";t.lineHeight=elem.offsetHeight;for(i=0;i<elems.Æ;i++){elem=_$(elems[i]);elem.Ç.fontFamily=s[\"font_family\"];elem.Ç.fontSize=s[\"font_size\"]+\"pt\";elem.Ç.lineHeight=t.lineHeight+\"px\";}t.add_Ç(\"pre{font-family:\"+s[\"font_family\"]+\"}\");if((t.isOpera&&t.isOpera < 9.6)||t.isIE >=8){var parNod=a.ÈNode,nxtSib=a.nextSibling,start=a.selectionStart,end=a.selectionEnd;parNod.removeChild(a);parNod.insertBefore(a,nxtSib);t.area_select(start,end-start);}Á.focus();Á.update_size();Á.check_line_selection();};EA.Ä.change_font_size=Ã(){var size=_$(\"area_font_size\").Ê;if(size>0)Á.set_font(\"\",size);};EA.Ä.open_inline_popup=Ã(popup_id){Á.close_all_inline_popup();var popup=_$(popup_id);var editor=_$(\"editor\");for(var i=0;i<Á.inlinePopup.Æ;i++){if(Á.inlinePopup[i][\"popup_id\"]==popup_id){var icon=_$(Á.inlinePopup[i][\"icon_id\"]);if(icon){Á.switchClassSticky(icon,'editAreaButtonSelected',Ë);break;}}}popup.Ç.height=\"auto\";popup.Ç.over
 flow=\"visible\";if(document.body.offsetHeight< popup.offsetHeight){popup.Ç.height=(document.body.offsetHeight-10)+\"px\";popup.Ç.overflow=\"auto\";}if(!popup.positionned){var new_left=editor.offsetWidth /2-popup.offsetWidth /2;var new_top=editor.offsetHeight /2-popup.offsetHeight /2;popup.Ç.left=new_left+\"px\";popup.Ç.top=new_top+\"px\";popup.positionned=Ë;}popup.Ç.visibility=\"visible\";};EA.Ä.close_inline_popup=Ã(popup_id){var popup=_$(popup_id);for(var i=0;i<Á.inlinePopup.Æ;i++){if(Á.inlinePopup[i][\"popup_id\"]==popup_id){var icon=_$(Á.inlinePopup[i][\"icon_id\"]);if(icon){Á.switchClassSticky(icon,'editAreaButtonNormal',Ì);break;}}}popup.Ç.visibility=\"hidden\";};EA.Ä.close_all_inline_popup=Ã(e){for(var i=0;i<Á.inlinePopup.Æ;i++){Á.close_inline_popup(Á.inlinePopup[i][\"popup_id\"]);}Á.Â.focus();};EA.Ä.show_help=Ã(){Á.open_inline_popup(\"edit_area_help\");};EA.Ä.new_document=Ã(){Á.Â.Ê=\"\";Á.area_select(0,0);};EA.Ä.get_all_toolbar_height=Ã(){va
 r area=_$(\"editor\");var results=È.getChildren(area,\"div\",\"class\",\"area_toolbar\",\"all\",\"0\");var height=0;for(var i=0;i<results.Æ;i++){height+=results[i].offsetHeight;}return height;};EA.Ä.go_to_line=Ã(line){if(!line){var icon=_$(\"go_to_line\");if(icon !=null){Á.restoreClass(icon);Á.switchClassSticky(icon,'editAreaButtonSelected',Ë);}line=prompt(Á.get_translation(\"go_to_line_prompt\"));if(icon !=null)Á.switchClassSticky(icon,'editAreaButtonNormal',Ì);}if(line&&line!=null&&line.search(/^[0-9]+$/)!=-1){var start=0;var lines=Á.Â.Ê.split(\"\\n\");if(line > lines.Æ)start=Á.Â.Ê.Æ;\nelse{for(var i=0;i<Math.min(line-1,lines.Æ);i++)start+=lines[i].Æ+1;}Á.area_select(start,0);}};EA.Ä.change_smooth_selection_mode=Ã(setTo){if(Á.do_highlight)return;if(setTo !=null){if(setTo===Ì)Á.smooth_selection=Ë;\nelse Á.smooth_selection=Ì;}var icon=_$(\"change_smooth_selection\");Á.Â.focus();if(Á.smooth_selection===Ë){Á.switchClassSticky(icon,'editAreaButtonNorma
 l',Ì);Á.smooth_selection=Ì;Á.selection_field.Ç.display=\"none\";_$(\"cursor_pos\").Ç.display=\"none\";_$(\"end_bracket\").Ç.display=\"none\";}\nelse{Á.switchClassSticky(icon,'editAreaButtonSelected',Ì);Á.smooth_selection=Ë;Á.selection_field.Ç.display=\"block\";_$(\"cursor_pos\").Ç.display=\"block\";_$(\"end_bracket\").Ç.display=\"block\";}};EA.Ä.scroll_to_view=Ã(show){var zone,lineElem;if(!Á.smooth_selection)return;zone=_$(\"result\");var cursor_pos_top=_$(\"cursor_pos\").cursor_top;if(show==\"bottom\"){cursor_pos_top+=Á.getLinePosTop(Á.É['line_start']+Á.É['line_nb']-1);}var max_height_visible=zone.clientHeight+zone.scrollTop;var miss_top=cursor_pos_top+Á.lineHeight-max_height_visible;if(miss_top>0){zone.scrollTop=zone.scrollTop+miss_top;}\nelse if(zone.scrollTop > cursor_pos_top){zone.scrollTop=cursor_pos_top;}var cursor_pos_left=_$(\"cursor_pos\").cursor_left;var max_width_visible=zone.clientWidth+zone.scrollLeft;var miss_left=cursor_pos_left+10-max_width_v
 isible;if(miss_left>0){zone.scrollLeft=zone.scrollLeft+miss_left+50;}\nelse if(zone.scrollLeft > cursor_pos_left){zone.scrollLeft=cursor_pos_left;}\nelse if(zone.scrollLeft==45){zone.scrollLeft=0;}};EA.Ä.check_undo=Ã(only_once){if(!eAs[Á.id])return Ì;if(Á.ÂFocused&&eAs[Á.id][\"displayed\"]==Ë){var text=Á.Â.Ê;if(Á.previous.Æ<=1)Á.switchClassSticky(_$(\"undo\"),'editAreaButtonDisabled',Ë);if(!Á.previous[Á.previous.Æ-1]||Á.previous[Á.previous.Æ-1][\"text\"] !=text){Á.previous.push({\"text\":text,\"selStart\":Á.Â.selectionStart,\"selEnd\":Á.Â.selectionEnd});if(Á.previous.Æ > Á.Å[\"max_undo\"]+1)Á.previous.shift();}if(Á.previous.Æ >=2)Á.switchClassSticky(_$(\"undo\"),'editAreaButtonNormal',Ì);}if(!only_once)setTimeout(\"eA.check_undo()\",3000);};EA.Ä.undo=Ã(){if(Á.previous.Æ > 0){Á.getIESelection();Á.next.push({\"text\":Á.Â.Ê,\"selStart\":Á.Â.selectionStart,\"selEnd\":Á.Â.selectionEnd});var prev=Á.previous.pop();if(prev[\"text\"]==Á.Â.Ê
 &&Á.previous.Æ > 0)prev=Á.previous.pop();Á.Â.Ê=prev[\"text\"];Á.last_undo=prev[\"text\"];Á.area_select(prev[\"selStart\"],prev[\"selEnd\"]-prev[\"selStart\"]);Á.switchClassSticky(_$(\"redo\"),'editAreaButtonNormal',Ì);Á.resync_highlight(Ë);Á.check_file_changes();}};EA.Ä.redo=Ã(){if(Á.next.Æ > 0){var next=Á.next.pop();Á.previous.push(next);Á.Â.Ê=next[\"text\"];Á.last_undo=next[\"text\"];Á.area_select(next[\"selStart\"],next[\"selEnd\"]-next[\"selStart\"]);Á.switchClassSticky(_$(\"undo\"),'editAreaButtonNormal',Ì);Á.resync_highlight(Ë);Á.check_file_changes();}if(Á.next.Æ==0)Á.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);};EA.Ä.check_redo=Ã(){if(eA.next.Æ==0||eA.Â.Ê!=eA.last_undo){eA.next=[];eA.switchClassSticky(_$(\"redo\"),'editAreaButtonDisabled',Ë);}\nelse{Á.switchClassSticky(_$(\"redo\"),'editAreaButtonNormal',Ì);}};EA.Ä.switchClass=Ã(element,class_name,lock_state){var lockChanged=Ì;if(typeof(lock_state)!=\"undefined\"&&ele
 ment !=null){element.classLock=lock_state;lockChanged=Ë;}if(element !=null&&(lockChanged||!element.classLock)){element.oldClassName=element.className;element.className=class_name;}};EA.Ä.restoreAndSwitchClass=Ã(element,class_name){if(element !=null&&!element.classLock){Á.restoreClass(element);Á.switchClass(element,class_name);}};EA.Ä.restoreClass=Ã(element){if(element !=null&&element.oldClassName&&!element.classLock){element.className=element.oldClassName;element.oldClassName=null;}};EA.Ä.setClassLock=Ã(element,lock_state){if(element !=null)element.classLock=lock_state;};EA.Ä.switchClassSticky=Ã(element,class_name,lock_state){var lockChanged=Ì;if(typeof(lock_state)!=\"undefined\"&&element !=null){element.classLock=lock_state;lockChanged=Ë;}if(element !=null&&(lockChanged||!element.classLock)){element.className=class_name;element.oldClassName=class_name;}};EA.Ä.scroll_page=Ã(params){var dir=params[\"dir\"],shift_pressed=params[\"shift\"];var lines=Á.Â.Ê.split(\"\\n\
 ");var new_pos=0,Æ=0,char_left=0,line_nb=0,curLine=0;var toScrollAmount=_$(\"result\").clientHeight-30;var nbLineToScroll=0,diff=0;if(dir==\"up\"){nbLineToScroll=Math.ceil(toScrollAmount / Á.lineHeight);for(i=Á.É[\"line_start\"];i-diff > Á.É[\"line_start\"]-nbLineToScroll;i--){if(elem=_$('line_'+i)){diff+=Math.floor((elem.offsetHeight-1)/ Á.lineHeight);}}nbLineToScroll-=diff;if(Á.É[\"selec_direction\"]==\"up\"){for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]-nbLineToScroll,lines.Æ);line_nb++){new_pos+=lines[line_nb].Æ+1;}char_left=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]-1);if(shift_pressed)Æ=Á.É[\"selectionEnd\"]-new_pos-char_left;Á.area_select(new_pos+char_left,Æ);view=\"top\";}\nelse{view=\"bottom\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+Á.É[\"line_nb\"]-1-nbLineToScroll,lines.Æ);line_nb++){new_pos+=lines[line_nb].Æ+1;}char_left=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]-1);if(shift_press
 ed){start=Math.min(Á.É[\"selectionStart\"],new_pos+char_left);Æ=Math.max(new_pos+char_left,Á.É[\"selectionStart\"])-start;if(new_pos+char_left < Á.É[\"selectionStart\"])view=\"top\";}\nelse start=new_pos+char_left;Á.area_select(start,Æ);}}\nelse{var nbLineToScroll=Math.floor(toScrollAmount / Á.lineHeight);for(i=Á.É[\"line_start\"];i+diff < Á.É[\"line_start\"]+nbLineToScroll;i++){if(elem=_$('line_'+i)){diff+=Math.floor((elem.offsetHeight-1)/ Á.lineHeight);}}nbLineToScroll-=diff;if(Á.É[\"selec_direction\"]==\"down\"){view=\"bottom\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+Á.É[\"line_nb\"]-2+nbLineToScroll,lines.Æ);line_nb++){if(line_nb==Á.É[\"line_start\"]-1)char_left=Á.É[\"selectionStart\"]-new_pos;new_pos+=lines[line_nb].Æ+1;}if(shift_pressed){Æ=Math.abs(Á.É[\"selectionStart\"]-new_pos);Æ+=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"]);Á.area_select(Math.min(Á.É[\"selectionStart\"],new_pos),Æ);}\nelse{Á.area_selec
 t(new_pos+char_left,0);}}\nelse{view=\"top\";for(line_nb=0;line_nb< Math.min(Á.É[\"line_start\"]+nbLineToScroll-1,lines.Æ,lines.Æ);line_nb++){if(line_nb==Á.É[\"line_start\"]-1)char_left=Á.É[\"selectionStart\"]-new_pos;new_pos+=lines[line_nb].Æ+1;}if(shift_pressed){Æ=Math.abs(Á.É[\"selectionEnd\"]-new_pos-char_left);Æ+=Math.min(lines[Math.min(lines.Æ-1,line_nb)].Æ,Á.É[\"curr_pos\"])-char_left-1;Á.area_select(Math.min(Á.É[\"selectionEnd\"],new_pos+char_left),Æ);if(new_pos+char_left > Á.É[\"selectionEnd\"])view=\"bottom\";}\nelse{Á.area_select(new_pos+char_left,0);}}}Á.check_line_selection();Á.scroll_to_view(view);};EA.Ä.start_resize=Ã(e){È.eAL.resize[\"id\"]=eA.id;È.eAL.resize[\"start_x\"]=(e)? e.pageX:event.x+document.body.scrollLeft;È.eAL.resize[\"start_y\"]=(e)? e.pageY:event.y+document.body.scrollTop;if(eA.isIE){eA.Â.focus();eA.getIESelection();}È.eAL.resize[\"selectionStart\"]=eA.Â.selectionStart;È.eAL.resize[\"selectionEnd\"]=eA.Â.selectionEnd
 ;È.eAL.start_resize_area();};EA.Ä.toggle_full_screen=Ã(to){var t=Á,p=È,a=t.Â,html,frame,selStart,selEnd,old,icon;if(typeof(to)==\"undefined\")to=!t.fullscreen['isFull'];old=t.fullscreen['isFull'];t.fullscreen['isFull']=to;icon=_$(\"fullscreen\");selStart=t.Â.selectionStart;selEnd=t.Â.selectionEnd;html=p.document.getElementsByTagName(\"html\")[0];frame=p.document.getElementById(\"frame_\"+t.id);if(to&&to!=old){t.fullscreen['old_overflow']=p.get_css_property(html,\"overflow\");t.fullscreen['old_height']=p.get_css_property(html,\"height\");t.fullscreen['old_width']=p.get_css_property(html,\"width\");t.fullscreen['old_scrollTop']=html.scrollTop;t.fullscreen['old_scrollLeft']=html.scrollLeft;t.fullscreen['old_zIndex']=p.get_css_property(frame,\"z-index\");if(t.isOpera){html.Ç.height=\"100%\";html.Ç.width=\"100%\";}html.Ç.overflow=\"hidden\";html.scrollTop=0;html.scrollLeft=0;frame.Ç.position=\"absolute\";frame.Ç.width=html.clientWidth+\"px\";frame.Ç.height=html.clientHeight
 +\"px\";frame.Ç.display=\"block\";frame.Ç.zIndex=\"999999\";frame.Ç.top=\"0px\";frame.Ç.left=\"0px\";frame.Ç.top=\"-\"+p.calculeOffsetTop(frame)+\"px\";frame.Ç.left=\"-\"+p.calculeOffsetLeft(frame)+\"px\";t.switchClassSticky(icon,'editAreaButtonSelected',Ì);t.fullscreen['allow_resize']=t.resize_allowed;t.allow_resize(Ì);if(t.isFirefox){p.eAL.execCommand(t.id,\"update_size();\");t.area_select(selStart,selEnd-selStart);t.scroll_to_view();t.focus();}\nelse{setTimeout(\"p.eAL.execCommand('\"+t.id+\"','update_size();');eA.focus();\",10);}}\nelse if(to!=old){frame.Ç.position=\"static\";frame.Ç.zIndex=t.fullscreen['old_zIndex'];if(t.isOpera){html.Ç.height=\"auto\";html.Ç.width=\"auto\";html.Ç.overflow=\"auto\";}\nelse if(t.isIE&&p!=top){html.Ç.overflow=\"auto\";}\nelse{html.Ç.overflow=t.fullscreen['old_overflow'];}html.scrollTop=t.fullscreen['old_scrollTop'];html.scrollLeft=t.fullscreen['old_scrollLeft'];p.eAL.hide(t.id);p.eAL.show(t.id);t.switchClassSticky(icon,'editAreaBut
 tonNormal',Ì);if(t.fullscreen['allow_resize'])t.allow_resize(t.fullscreen['allow_resize']);if(t.isFirefox){t.area_select(selStart,selEnd-selStart);setTimeout(\"eA.scroll_to_view();\",10);}}};EA.Ä.allow_resize=Ã(allow){var resize=_$(\"resize_area\");if(allow){resize.Ç.visibility=\"visible\";È.eAL.add_event(resize,\"mouseup\",eA.start_resize);}\nelse{resize.Ç.visibility=\"hidden\";È.eAL.remove_event(resize,\"mouseup\",eA.start_resize);}Á.resize_allowed=allow;};EA.Ä.change_syntax=Ã(new_syntax,is_waiting){if(new_syntax==Á.Å['syntax'])return Ë;var founded=Ì;for(var i=0;i<Á.syntax_list.Æ;i++){if(Á.syntax_list[i]==new_syntax)founded=Ë;}if(founded==Ë){if(!È.eAL.load_syntax[new_syntax]){if(!is_waiting)È.eAL.load_script(È.eAL.baseURL+\"reg_syntax/\"+new_syntax+\".js\");setTimeout(\"eA.change_syntax('\"+new_syntax+\"',Ë);\",100);Á.show_waiting_screen();}\nelse{if(!Á.allready_used_syntax[new_syntax]){È.eAL.init_syntax_regexp();Á.add_Ç(È.eAL.syntax[new_syntax][\"Çs\
 "]);Á.allready_used_syntax[new_syntax]=Ë;}var sel=_$(\"syntax_selection\");if(sel&&sel.Ê!=new_syntax){for(var i=0;i<sel.Æ;i++){if(sel.options[i].Ê&&sel.options[i].Ê==new_syntax)sel.options[i].selected=Ë;}}Á.Å['syntax']=new_syntax;Á.resync_highlight(Ë);Á.hide_waiting_screen();return Ë;}}return Ì;};EA.Ä.set_editable=Ã(is_editable){if(is_editable){document.body.className=\"\";Á.Â.readOnly=Ì;Á.is_editable=Ë;}\nelse{document.body.className=\"non_editable\";Á.Â.readOnly=Ë;Á.is_editable=Ì;}if(eAs[Á.id][\"displayed\"]==Ë)Á.update_size();};EA.Ä.toggle_word_wrap=Ã(){Á.set_word_wrap(!Á.Å['word_wrap']);};EA.Ä.set_word_wrap=Ã(to){var t=Á,a=t.Â;if(t.isOpera){Á.Å['word_wrap']=Ì;t.switchClassSticky(_$(\"word_wrap\"),'editAreaButtonDisabled',Ë);return Ì;}if(to){wrap_mode='soft';Á.container.className+=' word_wrap';Á.container.Ç.width=\"\";Á.content_highlight.Ç.width=\"\";a.Ç.width=\"100%\";if(t.isIE&&t.isIE < 7){a.Ç.width=(a.offsetWidth-5)+\"px\";}t.s
 witchClassSticky(_$(\"word_wrap\"),'editAreaButtonSelected',Ì);}\nelse{wrap_mode='off';Á.container.className=Á.container.className.replace(/word_wrap/g,'');t.switchClassSticky(_$(\"word_wrap\"),'editAreaButtonNormal',Ë);}Á.Â.previous_scrollWidth='';Á.Â.previous_scrollHeight='';a.wrap=wrap_mode;a.setAttribute('wrap',wrap_mode);if(!Á.isIE){var start=a.selectionStart,end=a.selectionEnd;var parNod=a.ÈNode,nxtSib=a.nextSibling;parNod.removeChild(a);parNod.insertBefore(a,nxtSib);Á.area_select(start,end-start);}Á.Å['word_wrap']=to;Á.focus();Á.update_size();Á.check_line_selection();};EA.Ä.open_file=Ã(Å){if(Å['id']!=\"undefined\"){var id=Å['id'];var new_file={};new_file['id']=id;new_file['title']=id;new_file['text']=\"\";new_file['É']=\"\";new_file['last_text_to_highlight']=\"\";new_file['last_hightlighted_text']=\"\";new_file['previous']=[];new_file['next']=[];new_file['last_undo']=\"\";new_file['smooth_selection']=Á.Å['smooth_selection'];new_file['do_highlight']=Á.
 Å['start_highlight'];new_file['syntax']=Á.Å['syntax'];new_file['scroll_top']=0;new_file['scroll_left']=0;new_file['selection_start']=0;new_file['selection_end']=0;new_file['edited']=Ì;new_file['font_size']=Á.Å[\"font_size\"];new_file['font_family']=Á.Å[\"font_family\"];new_file['word_wrap']=Á.Å[\"word_wrap\"];new_file['toolbar']={'links':{},'selects':{}};new_file['compare_edited_text']=new_file['text'];Á.files[id]=new_file;Á.update_file(id,Å);Á.files[id]['compare_edited_text']=Á.files[id]['text'];var html_id='tab_file_'+encodeURIComponent(id);Á.filesIdAssoc[html_id]=id;Á.files[id]['html_id']=html_id;if(!_$(Á.files[id]['html_id'])&&id!=\"\"){Á.tab_browsing_area.Ç.display=\"block\";var elem=document.createElement('li');elem.id=Á.files[id]['html_id'];var close=\"<img src=\\\"\"+È.eAL.baseURL+\"images/close.gif\\\" title=\\\"\"+Á.get_translation('close_tab','word')+\"\\\" onclick=\\\"eA.execCommand('close_file',eA.filesIdAssoc['\"+html_id+\"']);return Ì;\\\" clas
 s=\\\"hidden\\\" onmouseover=\\\"Á.className=''\\\" onmouseout=\\\"Á.className='hidden'\\\" />\";elem.innerHTML=\"<a onclick=\\\"javascript:eA.execCommand('switch_to_file',eA.filesIdAssoc['\"+html_id+\"']);\\\" selec=\\\"none\\\"><b><span><strong class=\\\"edited\\\">*</strong>\"+Á.files[id]['title']+close+\"</span></b></a>\";_$('tab_browsing_list').appendChild(elem);var elem=document.createElement('text');Á.update_size();}if(id!=\"\")Á.execCommand('file_open',Á.files[id]);Á.switch_to_file(id,Ë);return Ë;}\nelse return Ì;};EA.Ä.close_file=Ã(id){if(Á.files[id]){Á.save_file(id);if(Á.execCommand('file_close',Á.files[id])!==Ì){var li=_$(Á.files[id]['html_id']);li.ÈNode.removeChild(li);if(id==Á.curr_file){var next_file=\"\";var is_next=Ì;for(var i in Á.files){if(is_next){next_file=i;break;}\nelse if(i==id)is_next=Ë;\nelse next_file=i;}Á.switch_to_file(next_file);}delete(Á.files[id]);Á.update_size();}}};EA.Ä.save_file=Ã(id){var t=Á,save,a_links,a_selects,save_
 butt,img,i;if(t.files[id]){var save=t.files[id];save['É']=t.É;save['last_text_to_highlight']=t.last_text_to_highlight;save['last_hightlighted_text']=t.last_hightlighted_text;save['previous']=t.previous;save['next']=t.next;save['last_undo']=t.last_undo;save['smooth_selection']=t.smooth_selection;save['do_highlight']=t.do_highlight;save['syntax']=t.Å['syntax'];save['text']=t.Â.Ê;save['scroll_top']=t.result.scrollTop;save['scroll_left']=t.result.scrollLeft;save['selection_start']=t.É[\"selectionStart\"];save['selection_end']=t.É[\"selectionEnd\"];save['font_size']=t.Å[\"font_size\"];save['font_family']=t.Å[\"font_family\"];save['word_wrap']=t.Å[\"word_wrap\"];save['toolbar']={'links':{},'selects':{}};a_links=_$(\"toolbar_1\").getElementsByTagName(\"a\");for(i=0;i<a_links.Æ;i++){if(a_links[i].getAttribute('fileSpecific')=='yes'){save_butt={};img=a_links[i].getElementsByTagName('img')[0];save_butt['classLock']=img.classLock;save_butt['className']=img.className;save_butt['oldCl
 assName']=img.oldClassName;save['toolbar']['links'][a_links[i].id]=save_butt;}}a_selects=_$(\"toolbar_1\").getElementsByTagName(\"select\");for(i=0;i<a_selects.Æ;i++){if(a_selects[i].getAttribute('fileSpecific')=='yes'){save['toolbar']['selects'][a_selects[i].id]=a_selects[i].Ê;}}t.files[id]=save;return save;}return Ì;};EA.Ä.update_file=Ã(id,new_Ês){for(var i in new_Ês){Á.files[id][i]=new_Ês[i];}};EA.Ä.display_file=Ã(id){var t=Á,a=t.Â,new_file,a_lis,a_selects,a_links,a_options,i,j;if(id==''){a.readOnly=Ë;t.tab_browsing_area.Ç.display=\"none\";_$(\"no_file_selected\").Ç.display=\"block\";t.result.className=\"empty\";if(!t.files['']){t.open_file({id:''});}}\nelse if(typeof(t.files[id])=='undefined'){return Ì;}\nelse{t.result.className=\"\";a.readOnly=!t.is_editable;_$(\"no_file_selected\").Ç.display=\"none\";t.tab_browsing_area.Ç.display=\"block\";}t.check_redo(Ë);t.check_undo(Ë);t.curr_file=id;a_lis=t.tab_browsing_area.getElementsByTagName('li');for(i=0;i<a_lis.�
 �;i++){if(a_lis[i].id==t.files[id]['html_id'])a_lis[i].className='selected';\nelse a_lis[i].className='';}new_file=t.files[id];a.Ê=new_file['text'];t.set_font(new_file['font_family'],new_file['font_size']);t.area_select(new_file['É']['selection_start'],new_file['É']['selection_end']-new_file['É']['selection_start']);t.manage_size(Ë);t.result.scrollTop=new_file['scroll_top'];t.result.scrollLeft=new_file['scroll_left'];t.previous=new_file['previous'];t.next=new_file['next'];t.last_undo=new_file['last_undo'];t.check_redo(Ë);t.check_undo(Ë);t.execCommand(\"change_highlight\",new_file['do_highlight']);t.execCommand(\"change_syntax\",new_file['syntax']);t.execCommand(\"change_smooth_selection_mode\",new_file['smooth_selection']);t.execCommand(\"set_word_wrap\",new_file['word_wrap']);a_links=new_file['toolbar']['links'];for(i in a_links){if(img=_$(i).getElementsByTagName('img')[0]){img.classLock=a_links[i]['classLock'];img.className=a_links[i]['className'];img.oldClassName=a_links[i
 ]['oldClassName'];}}a_selects=new_file['toolbar']['selects'];for(i in a_selects){a_options=_$(i).options;for(j=0;j<a_options.Æ;j++){if(a_options[j].Ê==a_selects[i])_$(i).options[j].selected=Ë;}}};EA.Ä.switch_to_file=Ã(file_to_show,force_refresh){if(file_to_show!=Á.curr_file||force_refresh){Á.save_file(Á.curr_file);if(Á.curr_file!='')Á.execCommand('file_switch_off',Á.files[Á.curr_file]);Á.display_file(file_to_show);if(file_to_show!='')Á.execCommand('file_switch_on',Á.files[file_to_show]);}};EA.Ä.get_file=Ã(id){if(id==Á.curr_file)Á.save_file(id);return Á.files[id];};EA.Ä.get_all_files=Ã(){tmp_files=Á.files;Á.save_file(Á.curr_file);if(tmp_files[''])delete(Á.files['']);return tmp_files;};EA.Ä.check_file_changes=Ã(){var id=Á.curr_file;if(Á.files[id]&&Á.files[id]['compare_edited_text']!=undefined){if(Á.files[id]['compare_edited_text'].Æ==Á.Â.Ê.Æ&&Á.files[id]['compare_edited_text']==Á.Â.Ê){if(Á.files[id]['edited']!=Ì)Á.set_file_edited_mode(id,Ì)
 ;}\nelse{if(Á.files[id]['edited']!=Ë)Á.set_file_edited_mode(id,Ë);}}};EA.Ä.set_file_edited_mode=Ã(id,to){if(Á.files[id]&&_$(Á.files[id]['html_id'])){var link=_$(Á.files[id]['html_id']).getElementsByTagName('a')[0];if(to==Ë){link.className='edited';}\nelse{link.className='';if(id==Á.curr_file)text=Á.Â.Ê;\nelse text=Á.files[id]['text'];Á.files[id]['compare_edited_text']=text;}Á.files[id]['edited']=to;}};EA.Ä.set_show_line_colors=Ã(new_Ê){Á.show_line_colors=new_Ê;if(new_Ê)Á.selection_field.className+=' show_colors';\nelse Á.selection_field.className=Á.selection_field.className.replace(/ show_colors/g,'');};var EA_keys={8:\"Retour arriere\",9:\"Tabulation\",12:\"Milieu(pave numerique)\",13:\"Entrer\",16:\"Shift\",17:\"Ctrl\",18:\"Alt\",19:\"Pause\",20:\"Verr Maj\",27:\"Esc\",32:\"Space\",33:\"Page up\",34:\"Page down\",35:\"End\",36:\"Begin\",37:\"Left\",38:\"Up\",39:\"Right\",40:\"Down\",44:\"Impr ecran\",45:\"Inser\",46:\"Suppr\",91:\"Menu Demarrer Windows / 
 touche pomme Mac\",92:\"Menu Demarrer Windows\",93:\"Menu contextuel Windows\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"Verr Num\",145:\"Arret defil\"};Ã keyDown(e){if(!e){e=event;}for(var i in eA.plugins){if(typeof(eA.plugins[i].onkeydown)==\"Ã\"){if(eA.plugins[i].onkeydown(e)===Ì){if(eA.isIE)e.keyCode=0;return Ì;}}}var target_id=(e.target||e.srcElement).id;var use=Ì;if(EA_keys[e.keyCode])letter=EA_keys[e.keyCode];\nelse letter=String.fromCharCode(e.keyCode);var low_letter=letter.toLowerCase();if(letter==\"Page up\"&&!eA.isOpera){eA.execCommand(\"scroll_page\",{\"dir\":\"up\",\"shift\":ShiftPressed(e)});use=Ë;}\nelse if(letter==\"Page down\"&&!eA.isOpera){eA.execCommand(\"scroll_page\",{\"dir\":\"down\",\"shift\":ShiftPressed(e)});use=Ë;}\nelse if(eA.is_editable==Ì){return Ë;}\nelse if(letter==\"Tabulation\"&&target_id==\"Â\"&&!CtrlPressed(e)&&!AltPressed(e)){if(ShiftPresse
 d(e))eA.execCommand(\"invert_tab_selection\");\nelse eA.execCommand(\"tab_selection\");use=Ë;if(eA.isOpera||(eA.isFirefox&&eA.isMac))setTimeout(\"eA.execCommand('focus');\",1);}\nelse if(letter==\"Entrer\"&&target_id==\"Â\"){if(eA.press_enter())use=Ë;}\nelse if(letter==\"Entrer\"&&target_id==\"area_search\"){eA.execCommand(\"area_search\");use=Ë;}\nelse  if(letter==\"Esc\"){eA.execCommand(\"close_all_inline_popup\",e);use=Ë;}\nelse if(CtrlPressed(e)&&!AltPressed(e)&&!ShiftPressed(e)){switch(low_letter){case \"f\":eA.execCommand(\"area_search\");use=Ë;break;case \"r\":eA.execCommand(\"area_replace\");use=Ë;break;case \"q\":eA.execCommand(\"close_all_inline_popup\",e);use=Ë;break;case \"h\":eA.execCommand(\"change_highlight\");use=Ë;break;case \"g\":setTimeout(\"eA.execCommand('go_to_line');\",5);use=Ë;break;case \"e\":eA.execCommand(\"show_help\");use=Ë;break;case \"z\":use=Ë;eA.execCommand(\"undo\");break;case \"y\":use=Ë;eA.execCommand(\"redo\");break;default:break;}}i
 f(eA.next.Æ > 0){setTimeout(\"eA.check_redo();\",10);}setTimeout(\"eA.check_file_changes();\",10);if(use){if(eA.isIE)e.keyCode=0;return Ì;}return Ë;};Ã AltPressed(e){if(window.event){return(window.event.altKey);}\nelse{if(e.modifiers)return(e.altKey||(e.modifiers % 2));\nelse return e.altKey;}};Ã CtrlPressed(e){if(window.event){return(window.event.ctrlKey);}\nelse{return(e.ctrlKey||(e.modifiers==2)||(e.modifiers==3)||(e.modifiers>5));}};Ã ShiftPressed(e){if(window.event){return(window.event.shiftKey);}\nelse{return(e.shiftKey||(e.modifiers>3));}};	EA.Ä.show_search=Ã(){if(_$(\"area_search_replace\").Ç.visibility==\"visible\"){Á.hidden_search();}\nelse{Á.open_inline_popup(\"area_search_replace\");var text=Á.area_get_selection();var search=text.split(\"\\n\")[0];_$(\"area_search\").Ê=search;_$(\"area_search\").focus();}};EA.Ä.hidden_search=Ã(){Á.close_inline_popup(\"area_search_replace\");};EA.Ä.area_search=Ã(mode){if(!mode)mode=\"search\";_$(\"area_search_msg\").inne
 rHTML=\"\";var search=_$(\"area_search\").Ê;Á.Â.focus();Á.Â.ÂFocused=Ë;var infos=Á.get_selection_infos();var start=infos[\"selectionStart\"];var pos=-1;var pos_begin=-1;var Æ=search.Æ;if(_$(\"area_search_replace\").Ç.visibility!=\"visible\"){Á.show_search();return;}if(search.Æ==0){_$(\"area_search_msg\").innerHTML=Á.get_translation(\"search_field_empty\");return;}if(mode!=\"replace\"){if(_$(\"area_search_reg_exp\").checked)start++;\nelse start+=search.Æ;}if(_$(\"area_search_reg_exp\").checked){var opt=\"m\";if(!_$(\"area_search_match_case\").checked)opt+=\"i\";var reg=new RegExp(search,opt);pos=infos[\"full_text\"].substr(start).search(reg);pos_begin=infos[\"full_text\"].search(reg);if(pos!=-1){pos+=start;Æ=infos[\"full_text\"].substr(start).match(reg)

<TRUNCATED>

[12/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt/src/main/resources/META-INF/services.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt/src/main/resources/META-INF/services.xml b/components/org.apache.stratos.theme.mgt/src/main/resources/META-INF/services.xml
new file mode 100644
index 0000000..4f11147
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt/src/main/resources/META-INF/services.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ !
+ ! Copyright 2006 The Apache Software Foundation.
+ !
+ ! Licensed 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.
+ !-->
+<serviceGroup>
+    <service name="ThemeMgtService" scope="transportsession">
+        <transports>
+            <transport>https</transport>
+        </transports>
+        <parameter name="ServiceClass" locked="false">
+            org.apache.stratos.theme.mgt.services.ThemeMgtService
+        </parameter>
+
+        <operation name="getResourceTreeEntry">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="getContentBean">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="getCollectionContent">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="getResourceData">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="addCollection">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="addResource">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="importResource">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="addTextResource">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="getMetadata">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="getSessionResourcePath">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="getTextContent">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="updateTextContent">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="getContentDownloadBean">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="renameResource">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="delete">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+
+        <operation name="getAllPaths">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+        <operation name="getAllThemes">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+        
+        <operation name="applyTheme">
+            <parameter name="AuthorizationAction" locked="true">/permission/admin/configure/theme</parameter>
+        </operation>
+        
+        
+        <parameter name="enableMTOM" locked="true">false</parameter>
+    </service>
+     <parameter name="adminService" locked="true">true</parameter>
+    <parameter name="hiddenService" locked="true">true</parameter>
+</serviceGroup>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/pom.xml b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/pom.xml
deleted file mode 100644
index 16999ff..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/pom.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-# Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-#
-# Licensed 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.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <parent>
-        <groupId>org.wso2.carbon</groupId>
-        <artifactId>theme-mgt-parent</artifactId>
-        <version>2.1.0</version>
-<relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.wso2.carbon.theme.mgt.ui</artifactId>
-    <packaging>bundle</packaging>
-    <name>WSO2 Stratos - Theme Configuration User Interface</name>
-
-    <build>
-
-        <plugins>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Name>${project.artifactId}</Bundle-Name>
-                        <Export-Package>
-                            org.wso2.carbon.theme.mgt.ui.*,
-                            org.wso2.carbon.theme.mgt.ui.processors.*,
-                        </Export-Package>
-                        <Import-Package>
-                            org.wso2.carbon.registry.resource.ui.*,
-                            org.wso2.carbon.theme.mgt.ui.servlets.*,
-                            javax.servlet;version="${imp.pkg.version.javax.servlet}",
-                            javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
-                            org.apache.lucene.*,
-                            org.apache.batik.*,
-                            org.wso2.carbon.theme.mgt.stub.*; version="${carbon.platform.package.import.version.range}",
-                            *;resolution:=optional
-                        </Import-Package>
-                        <Carbon-Component>UIBundle</Carbon-Component>
-                    </instructions>
-                </configuration>
-            </plugin>
-
-        </plugins>
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.theme.mgt.stub</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.common.ui</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.resource.ui</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.registry.core</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.eclipse.equinox</groupId>
-            <artifactId>javax.servlet</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2.wso2</groupId>
-            <artifactId>axis2</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons.axiom.wso2</groupId>
-            <artifactId>axiom</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.ui</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.wso2.carbon</groupId>
-            <artifactId>org.wso2.carbon.core</artifactId>
-            <version>${carbon.platform.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.batik.wso2</groupId>
-            <artifactId>batik</artifactId>
-        </dependency>
-        <!--<dependency>-->
-            <!--<groupId>org.wso2.carbon</groupId>-->
-            <!--<artifactId>org.wso2.carbon.registry.profiles.ui</artifactId>-->
-            <!--<version>${registry-component.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.wso2.carbon</groupId>-->
-            <!--<artifactId>org.wso2.carbon.governance.wsdltool.ui</artifactId>-->
-            <!--<version>${registry-component.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.wso2.carbon</groupId>-->
-            <!--<artifactId>org.wso2.carbon.registry.resource.ui</artifactId>-->
-            <!--<version>${registry-component.version}</version>-->
-        <!--</dependency>-->
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/clients/ThemeMgtServiceClient.java
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/clients/ThemeMgtServiceClient.java b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/clients/ThemeMgtServiceClient.java
deleted file mode 100644
index 3630e3a..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/clients/ThemeMgtServiceClient.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- *  WSO2 Inc. 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.
- *
- */
-package org.wso2.carbon.theme.mgt.ui.clients;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.CarbonConstants;
-import org.wso2.carbon.registry.common.utils.RegistryUtil;
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException;
-import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.CollectionContentBean;
-import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentBean;
-import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentDownloadBean;
-import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.MetadataBean;
-import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.ResourceTreeEntryBean;
-import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.common.xsd.ResourceData;
-import org.wso2.carbon.theme.mgt.stub.ThemeMgtServiceStub;
-import org.wso2.carbon.ui.CarbonUIUtil;
-import org.wso2.carbon.utils.ServerConstants;
-
-import javax.activation.DataHandler;
-import javax.servlet.ServletConfig;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-public class ThemeMgtServiceClient {
-
-    private static final Log log = LogFactory.getLog(ThemeMgtServiceClient.class);
-
-    private ThemeMgtServiceStub stub;
-    private String epr;
-
-    public ThemeMgtServiceClient (
-            String cookie, String backendServerURL, ConfigurationContext configContext)
-            throws RegistryException {
-
-        epr = backendServerURL + "ThemeMgtService";
-
-        try {
-            stub = new ThemeMgtServiceStub(configContext, epr);
-
-            ServiceClient client = stub._getServiceClient();
-            Options option = client.getOptions();
-            option.setManageSession(true);
-            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
-
-        } catch (AxisFault axisFault) {
-            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-
-    public ThemeMgtServiceClient(String cookie, ServletConfig config, HttpSession session)
-            throws RegistryException {
-
-        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
-        ConfigurationContext configContext = (ConfigurationContext) config.
-                getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
-        epr = backendServerURL + "ThemeMgtService";
-
-        try {
-            stub = new ThemeMgtServiceStub(configContext, epr);
-
-            ServiceClient client = stub._getServiceClient();
-            Options option = client.getOptions();
-            option.setManageSession(true);
-            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
-
-        } catch (AxisFault axisFault) {
-            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public ThemeMgtServiceClient(ServletConfig config, HttpSession session)
-            throws RegistryException {
-
-        String cookie = (String)session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
-        ConfigurationContext configContext = (ConfigurationContext) config.
-                getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
-        epr = backendServerURL + "ThemeMgtService";
-
-        try {
-            stub = new ThemeMgtServiceStub(configContext, epr);
-
-            ServiceClient client = stub._getServiceClient();
-            Options option = client.getOptions();
-            option.setManageSession(true);
-            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
-
-        } catch (AxisFault axisFault) {
-            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
-            log.error(msg, axisFault);
-            throw new RegistryException(msg, axisFault);
-        }
-    }
-
-    public ResourceTreeEntryBean getResourceTreeEntry(String resourcePath)
-            throws Exception {
-
-        ResourceTreeEntryBean entryBean = null;
-        try {
-            Options options = stub._getServiceClient().getOptions();
-            options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
-            entryBean = stub.getResourceTreeEntry(resourcePath);
-        } catch (Exception e) {
-            String msg = "Failed to get resource tree entry for resource " +
-                    resourcePath + ". " + e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-        if (entryBean == null) {
-            throw new ResourceNotFoundException("The resource does not exist");
-        }
-        return entryBean;
-    }
-
-     public ContentBean getContent(HttpServletRequest request) throws Exception {
-
-        String path = RegistryUtil.getPath(request);
-        ContentBean bean = null;
-        try {
-            bean = stub.getContentBean(path);
-        } catch (Exception e) {
-            String msg = "Failed to get content from the resource service. " +
-                    e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-
-        return bean;
-    }
-
-
-    public CollectionContentBean getCollectionContent(HttpServletRequest request) throws Exception {
-
-        String path = RegistryUtil.getPath(request);
-        CollectionContentBean bean = null;
-        try {
-            bean = stub.getCollectionContent(path);
-
-        } catch (Exception e) {
-            String msg = "Failed to get collection content from the resource service. " +
-                    e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-
-        return bean;
-    }
-
-
-    public ResourceData[] getResourceData(String[] paths) throws Exception {
-
-        ResourceData[] resourceData;
-        try {
-            resourceData = stub.getResourceData(paths);
-        } catch (Exception e) {
-            String msg = "Failed to get resource data from the resource service. " +
-                    e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-
-        return resourceData;
-    }
-
-    public String addCollection(
-            String parentPath, String collectionName, String mediaType, String description) throws Exception  {
-        try {
-            return stub.addCollection(parentPath, collectionName, mediaType, description);
-        } catch (Exception e) {
-            String msg = "Failed to add collection " + collectionName + " for parent path: " + parentPath + ". " +
-                    e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-    }
-
-    public void addResource(String path, String mediaType, String description, DataHandler content,
-                            String symlinkLocation, String tenantPass)
-            throws Exception {
-
-        try {
-            Options options = stub._getServiceClient().getOptions();
-            options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
-            options.setTimeOutInMilliSeconds(300000);
-            stub.addResource(path, mediaType, description, content, symlinkLocation, tenantPass);
-
-        } catch (Exception e) {
-
-            String msg = "Failed to add resource " + path + ". " + e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-    }
-
-    public void importResource(
-            String parentPath,
-            String resourceName,
-            String mediaType,
-            String description,
-            String fetchURL,
-            String symlinkLocation,
-            boolean isAsync,
-            String tenantPass) throws Exception {
-
-        try {
-            // This is used by the add wsdl UI. WSDL validation takes long when there are wsdl
-            // imports to prevent this we make a async call.
-            if (isAsync) {
-                stub._getServiceClient().getOptions().setProperty(
-                        MessageContext.CLIENT_API_NON_BLOCKING,Boolean.TRUE);
-            }
-            stub.importResource(parentPath, resourceName, mediaType, description, fetchURL, symlinkLocation, tenantPass);
-        } catch (Exception e) {
-            String msg = "Failed to import resource with name " + resourceName +
-                    " to the parent collection " + parentPath + ". " + e.getMessage();
-            log.error(msg, e);
-            throw new RegistryException(msg, e);
-        }
-    }
-
-
-    public void addTextResource(
-            String parentPath,
-            String fileName,
-            String mediaType,
-            String description,
-            String content) throws Exception {
-
-        try {
-            stub.addTextResource(parentPath, fileName, mediaType, description, content);
-        } catch (Exception e) {
-            String msg = "Failed to add new text resource with name " + fileName +
-                    " to the parent collection " + parentPath + ". " + e.getMessage();
-            log.error(msg, e);
-            throw new RegistryException(msg, e);
-        }
-    }
-
-    public MetadataBean getMetadata(HttpServletRequest request) throws Exception {
-
-        String path = RegistryUtil.getPath(request);
-        if (path == null) {
-            path = getSessionResourcePath();
-            if (path == null) {
-                path = RegistryConstants.ROOT_PATH;
-            }
-
-            request.setAttribute("path", path);
-        }
-
-        MetadataBean bean = null;
-        try {
-            bean = stub.getMetadata(path);
-        } catch (Exception e) {
-            String msg = "Failed to get resource metadata from the resource service. " +
-                    e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-
-        return bean;
-    }
-
-    public MetadataBean getMetadata(HttpServletRequest request,String root) throws Exception {
-
-        String path = RegistryConstants.ROOT_PATH;
-        request.setAttribute("path", path);
-        if (path == null) {
-            path = getSessionResourcePath();
-            if (path == null) {
-                path = RegistryConstants.ROOT_PATH;
-            }
-        }
-
-        MetadataBean bean = null;
-        try {
-            bean = stub.getMetadata(path);
-        } catch (Exception e) {
-            String msg = "Failed to get resource metadata from the resource service. " +
-                    e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-
-        return bean;
-    }
-
-    public String getSessionResourcePath() throws Exception {
-
-        String sessionResourcePath;
-        try {
-            sessionResourcePath = stub.getSessionResourcePath();
-        } catch (Exception e) {
-
-            String msg = "Failed to get the session resource path. " + e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-        return sessionResourcePath;
-    }
-
-
-    public String getTextContent(HttpServletRequest request) throws Exception {
-
-        String path = RegistryUtil.getPath(request);
-
-        String textContent = null;
-        try {
-            textContent = stub.getTextContent(path);
-        } catch (Exception e) {
-
-            String msg = "Failed get text content of the resource " +
-                    path + ". " + e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-        return textContent;
-    }
-
-     public void updateTextContent(String resourcePath, String contentText) throws Exception {
-
-        try {
-            stub.updateTextContent(resourcePath, contentText);
-        } catch (Exception e) {
-
-            String msg = "Failed to update text content of the resource " +
-                    resourcePath + ". " + e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-    }
-
-    public ContentDownloadBean getContentDownloadBean(String path) throws Exception {
-
-        ContentDownloadBean bean = stub.getContentDownloadBean(path);
-        return bean;
-    }
-
-    public void renameResource(
-            String parentPath, String oldResourcePath, String newResourceName)
-            throws Exception {
-
-        try {
-            stub.renameResource(parentPath, oldResourcePath, newResourceName);
-        } catch (Exception e) {
-            String msg = "Failed to rename resource with name " + oldResourcePath +
-                    " to the new name " + newResourceName + ". " + e.getMessage();
-            log.error(msg, e);
-            throw new RegistryException(msg, e);
-        }
-    }
-
-    public void delete(String pathToDelete) throws Exception {
-
-        try {
-            stub.delete(pathToDelete);
-        } catch (Exception e) {
-            String msg = "Failed to delete " + pathToDelete + ". " + e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-    }
-
-    public String[] getAllPaths() throws Exception {
-
-        try {
-            return  stub.getAllPaths();
-        } catch (Exception e) {
-            String msg = "Failed to getAllPaths. " + e.getMessage();
-            log.error(msg, e);
-            throw e;
-        }
-    }
-
-    public String[] getAllThemes(String tenantPass) throws Exception {
-        try {
-            return stub.getAllThemes(tenantPass);
-        } catch (Exception e) {
-            String msg = "Failed to get All Themes.";
-            log.error(msg, e);
-            throw e;
-        }
-    }
-
-    public void applyTheme(String themeName, String tenantPass) throws Exception {
-        try {
-            stub.applyTheme(themeName, tenantPass);
-        } catch (Exception e) {
-            String msg = "Failed to apply the theme: " + themeName;
-            log.error(msg, e);
-            throw e;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/processors/AddThemeResourceProcessor.java
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/processors/AddThemeResourceProcessor.java b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/processors/AddThemeResourceProcessor.java
deleted file mode 100644
index 11b0bd6..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/processors/AddThemeResourceProcessor.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- *  WSO2 Inc. 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.
- *
- */
-package org.wso2.carbon.theme.mgt.ui.processors;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.CarbonConstants;
-import org.wso2.carbon.CarbonException;
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient;
-import org.wso2.carbon.ui.CarbonUIMessage;
-import org.wso2.carbon.ui.transports.fileupload.AbstractFileUploadExecutor;
-import org.wso2.carbon.utils.FileItemData;
-import org.wso2.carbon.utils.ServerConstants;
-
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.imageio.ImageIO;
-import javax.mail.util.ByteArrayDataSource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import java.awt.*;
-import java.awt.image.BufferedImage;
-import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Map;
-
-
-/*
-* Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-*
-* Licensed 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.
-*/
-
-
-public class AddThemeResourceProcessor extends AbstractFileUploadExecutor {
-
-    private static final Log log = LogFactory.getLog(AddThemeResourceProcessor.class);
-
-    public boolean execute(HttpServletRequest request, HttpServletResponse response)
-            throws CarbonException, IOException {
-
-        String webContext = (String) request.getAttribute(CarbonConstants.WEB_CONTEXT);
-        String serverURL = (String) request.getAttribute(CarbonConstants.SERVER_URL);
-        String cookie = (String) request.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-        // HttpSession session = request.getSession();
-
-        Map<String, ArrayList<FileItemData>> fileItemsMap = getFileItemsMap();
-        if (fileItemsMap == null || fileItemsMap.isEmpty()) {
-            String msg = "File uploading failed. Content is not set properly.";
-            log.error(msg);
-
-            CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.ERROR, request);
-            response.sendRedirect(
-                    "../" + webContext + "/admin/error.jsp");
-
-            return false;
-        }
-
-        try {
-            ThemeMgtServiceClient client =
-                    new ThemeMgtServiceClient(cookie, serverURL, configurationContext);
-
-            String parentPath = null;
-            Map<String, ArrayList<java.lang.String>> formFieldsMap = getFormFieldsMap();
-            if (formFieldsMap.get("path") != null) {
-                parentPath = formFieldsMap.get("path").get(0);
-            }
-            String resourceName = null;
-            if (formFieldsMap.get("filename") != null) {
-                resourceName = formFieldsMap.get("filename").get(0);
-            }
-            String mediaType = null;
-            if (formFieldsMap.get("mediaType") != null) {
-                mediaType = formFieldsMap.get("mediaType").get(0);
-            }
-            String description = null;
-            if (formFieldsMap.get("description") != null) {
-                description = formFieldsMap.get("description").get(0);
-            }
-            String symlinkLocation = null;
-            if (formFieldsMap.get("symlinkLocation") != null) {
-                symlinkLocation = formFieldsMap.get("symlinkLocation").get(0);
-            }
-            String redirectWith = null;
-            if (formFieldsMap.get("redirectWith") != null) {
-                redirectWith = formFieldsMap.get("redirectWith").get(0);
-            }
-            /*
-            // currently chroot will not work with multitenancy
-            IServerAdmin adminClient =
-                    (IServerAdmin) CarbonUIUtil.
-                            getServerProxy(new ServerAdminClient(configurationContext,
-                                    serverURL, cookie, session), IServerAdmin.class, session);
-            ServerData data = adminClient.getServerData();
-            String chroot = "";
-            if (data.getRegistryType().equals("remote") && data.getRemoteRegistryChroot() != null &&
-                    !data.getRemoteRegistryChroot().equals(RegistryConstants.PATH_SEPARATOR)) {
-                chroot = data.getRemoteRegistryChroot();
-                if (!chroot.startsWith(RegistryConstants.PATH_SEPARATOR)) {
-                    chroot = RegistryConstants.PATH_SEPARATOR + chroot;
-                }
-                if (chroot.endsWith(RegistryConstants.PATH_SEPARATOR)) {
-                    chroot = chroot.substring(0, chroot.length() - RegistryConstants.PATH_SEPARATOR.length());
-                }
-            }
-            if (symlinkLocation != null) {
-                symlinkLocation = chroot + symlinkLocation;
-            }
-            */
-
-            FileItemData fileItemData = fileItemsMap.get("upload").get(0);
-
-            if ((fileItemData == null) || (fileItemData.getFileItem().getSize() == 0)) {
-                String msg = "Failed add resource. Resource content is empty.";
-                log.error(msg);
-
-                CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.ERROR, request);
-                response.sendRedirect(
-                        "../" + webContext + "/admin/error.jsp");
-
-                return false;
-            }
-            DataHandler dataHandler = scaleImage(fileItemData.getDataHandler(), 48, 119);
-
-            client.addResource(
-                    calculatePath(parentPath, resourceName), mediaType, description, dataHandler,
-                    symlinkLocation, redirectWith);
-
-            response.setContentType("text/html; charset=utf-8");
-            String msg = "The logo has been successfully updated.";
-            CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.INFO, request);
-
-            String redirectTo = request.getParameter("redirectto");
-            if ("theme_mgt".equals(redirectTo)) {
-                response.setHeader("Cache-Control", "no-cache, must-revalidate");
-                response.sendRedirect("../" + webContext +
-                        "/tenant-theme/theme_mgt.jsp?logoChanged=true&redirectWith=" + redirectWith);
-            }else if ("logo_mgt".equals(redirectTo)) {
-                response.setHeader("Cache-Control", "no-cache, must-revalidate");
-                response.sendRedirect("../" + webContext +
-                        "/tenant-theme/logo_mgt.jsp?logoChanged=true&redirectWith=" + redirectWith);
-            }
-            else {
-                response.sendRedirect("../" + webContext + "/tenant-theme/theme_advanced.jsp?path=" + parentPath);
-            }
-            return true;
-
-        } catch (Exception e) {
-            String msg = "File upload failed. Please confirm that the chosen image is not corrupted " +
-                    "and retry uploading, or upload a valid image.";
-            log.error(msg + " " + e.getMessage());
-
-            CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.ERROR, request);
-            response.sendRedirect(
-                    "../" + webContext + "/admin/error.jsp");
-
-            return false;
-        }
-    }
-
-    private static DataHandler scaleImage(DataHandler dataHandler, int height, int width) throws IOException {
-
-        Image image = ImageIO.read(new BufferedInputStream(dataHandler.getInputStream()));
-        // Check if the image has transparent pixels
-        boolean hasAlpha = ((BufferedImage)image).getColorModel().hasAlpha();
-
-        // Maintain Aspect ratio
-        int thumbHeight = height;
-        int thumbWidth = width;
-        double thumbRatio = (double)width / (double)height;
-        double imageRatio = (double)image.getWidth(null) / (double)image.getHeight(null);
-        if (thumbRatio < imageRatio) {
-            thumbHeight = (int)(thumbWidth / imageRatio);
-        } else {
-            thumbWidth = (int)(thumbHeight * imageRatio);
-        }
-
-        BufferedImage thumb;
-        // Check if transparent pixels are available and set the color mode accordingly 
-        if (hasAlpha) {
-            thumb = new BufferedImage(thumbWidth, thumbHeight, BufferedImage.TYPE_INT_ARGB);
-        } else {
-            thumb = new BufferedImage(thumbWidth, thumbHeight, BufferedImage.TYPE_INT_RGB);
-        }
-        Graphics2D graphics2D = thumb.createGraphics();
-        graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
-                                    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
-        graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);
-
-        // Save the image as PNG so that transparent images are rendered as intended
-        ByteArrayOutputStream output = new ByteArrayOutputStream();
-        ImageIO.write(thumb, "PNG", output);
-
-        DataSource dataSource= new ByteArrayDataSource(output.toByteArray(), "application/octet-stream");
-        return new DataHandler(dataSource);
-    }
-
-    private static String calculatePath(String parentPath, String resourceName) {
-        String resourcePath;
-        if (!parentPath.startsWith(RegistryConstants.PATH_SEPARATOR)) {
-            parentPath = RegistryConstants.PATH_SEPARATOR + parentPath;
-        }
-        if (parentPath.endsWith(RegistryConstants.PATH_SEPARATOR)) {
-            resourcePath = parentPath + resourceName;
-        } else {
-            resourcePath = parentPath + RegistryConstants.PATH_SEPARATOR + resourceName;
-        }
-        return resourcePath;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/servlets/ThemeResourceSevelet.java
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/servlets/ThemeResourceSevelet.java b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/servlets/ThemeResourceSevelet.java
deleted file mode 100644
index 6fbfb26..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/servlets/ThemeResourceSevelet.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- *  WSO2 Inc. 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.
- *
- */
-package org.wso2.carbon.theme.mgt.ui.servlets;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentDownloadBean;
-import org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class ThemeResourceSevelet extends HttpServlet {
-
-    private static final Log log = LogFactory.getLog(ThemeResourceSevelet.class);
-
-    private ServletConfig servletConfig;
-
-    public void init(ServletConfig servletConfig) throws ServletException {
-        super.init(servletConfig);
-        this.servletConfig = servletConfig;
-    }
-
-    protected void doGet(HttpServletRequest request, HttpServletResponse response)
-            throws ServletException, IOException {
-
-        try {
-            ThemeMgtServiceClient client = new ThemeMgtServiceClient(servletConfig, request.getSession());
-            String path = request.getParameter("path");
-            String viewImage = request.getParameter("viewImage");
-            if (path == null) {
-                String msg = "Could not get the resource content. Path is not specified.";
-                log.error(msg);
-                response.setStatus(400);
-                return;
-            }
-
-            ContentDownloadBean bean = client.getContentDownloadBean(path);
-
-            InputStream contentStream = null;
-            if (bean.getContent() != null) {
-                contentStream = bean.getContent().getInputStream();
-            } else {
-                String msg = "The resource content was empty.";
-                log.error(msg);
-                response.setStatus(204);
-                return;
-            }
-
-            response.setDateHeader("Last-Modified", bean.getLastUpdatedTime().getTime().getTime());
-            String ext = "jpg";
-            if (path.lastIndexOf(".") < path.length() -1 && path.lastIndexOf(".") > 0) {
-                ext = path.substring(path.lastIndexOf(".") + 1);
-            }
-
-            if (viewImage != null && viewImage.equals("1")) {
-                response.setContentType("img/" + ext);
-            }
-            else {
-                if (bean.getMediatype() != null && bean.getMediatype().length() > 0) {
-                    response.setContentType(bean.getMediatype());
-                } else {
-                    response.setContentType("application/download");
-                }
-
-                if (bean.getResourceName() != null) {
-                    response.setHeader(
-                            "Content-Disposition", "attachment; filename=\"" + bean.getResourceName() + "\"");
-                }
-            }
-
-            if (contentStream != null) {
-
-                ServletOutputStream servletOutputStream = null;
-                try {
-                    servletOutputStream = response.getOutputStream();
-
-                    byte[] contentChunk = new byte[1024];
-                    int byteCount;
-                    while ((byteCount = contentStream.read(contentChunk)) != -1) {
-                        servletOutputStream.write(contentChunk, 0, byteCount);
-                    }
-
-                    response.flushBuffer();
-                    servletOutputStream.flush();
-
-                } finally {
-                    contentStream.close();
-
-                    if (servletOutputStream != null) {
-                        servletOutputStream.close();
-                    }
-                }
-            }
-        } catch (Exception e) {
-
-            String msg = "Failed to get resource content. " + e.getMessage();
-            log.error(msg, e);
-            response.setStatus(500);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/utils/ThemeUtil.java
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/utils/ThemeUtil.java b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/utils/ThemeUtil.java
deleted file mode 100644
index bca9fce..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/java/org/wso2/carbon/theme/mgt/ui/utils/ThemeUtil.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- *  WSO2 Inc. 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.
- *
- */
-package org.wso2.carbon.theme.mgt.ui.utils;
-
-import org.wso2.carbon.registry.core.RegistryConstants;
-import org.wso2.carbon.ui.CarbonUIUtil;
-import org.wso2.carbon.registry.core.utils.UUIDGenerator;
-import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.servlet.ServletConfig;
-
-public class ThemeUtil {
-	public static String getThemeResourceDownloadURL(String path) {
-		return "../../registry/themeResourceContent?path=" + path;
-	}
-
-	public static String getThemeResourceViewAsImageURL(String path) {
-		return "../../registry/themeResourceContent?path=" + path
-		        + "&viewImage=1";
-	}
-
-	public static String getThumbUrl(HttpServletRequest request, String themeName) {
-		String serverURL = CarbonUIUtil.getAdminConsoleURL(request);
-		String serverRoot = serverURL.substring(0, serverURL.length()
-		        - "carbon/".length());
-		return serverRoot + "registry/resource"
-		        + RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH
-		        + "/repository/components/org.wso2.carbon.all-themes/"
-		        + themeName + "/thumb.png";
-	}
-
-	public static String getLogoURL(ServletConfig config, HttpSession session) {
-		// this is to avoid the caching problem
-		String randomUUID = UUIDGenerator.generateUUID();
-		String serverURL = CarbonUIUtil.getServerURL(
-		        config.getServletContext(), session);
-		String serverRoot = serverURL.substring(0, serverURL.length() - "services/".length());
-		String tenantDomain = (String) session
-		        .getAttribute(MultitenantConstants.TENANT_DOMAIN);
-		if (tenantDomain == null) {
-			return "";
-		}
-
-        // Using relative path instead of the back-end server url.
-        return  "../../../../t/" + tenantDomain + "/registry/resource"
-		        + RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH
-		        + "/repository/theme/admin/logo.gif?thatsrnd=" + randomUUID;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/META-INF/component.xml b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/META-INF/component.xml
deleted file mode 100644
index 194145b..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/META-INF/component.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.
- -->
-<component xmlns="http://products.wso2.org/carbon">
-    <!-- sample menu configuration -->
-    <menus>
-        <menu>
-            <id>mt_theme_mgt_menu</id>
-            <i18n-key>theme.management</i18n-key>
-            <i18n-bundle>org.wso2.carbon.theme.mgt.ui.i18n.Resources</i18n-bundle>
-            <parent-menu>configure_menu</parent-menu>
-            <link>../tenant-theme/theme_mgt.jsp</link>
-            <region>region1</region>
-            <icon>../tenant-theme/images/thememgt.gif</icon>
-            <order>41</order>
-            <style-class>home</style-class>
-            <require-permission>/permission/admin/configure/theme</require-permission>
-            <require-not-super-tenant>true</require-not-super-tenant>
-        </menu>
-        <menu>
-            <id>mt_logo_mgt_menu</id>
-            <i18n-key>logo.management</i18n-key>
-            <i18n-bundle>org.wso2.carbon.theme.mgt.ui.i18n.Resources</i18n-bundle>
-            <parent-menu>configure_menu</parent-menu>
-            <link>../tenant-theme/logo_mgt.jsp</link>
-            <region>region1</region>
-            <icon>../tenant-theme/images/logomgt.gif</icon>
-            <order>42</order>
-            <style-class>home</style-class>
-            <require-permission>/permission/admin/configure/theme</require-permission>
-            <require-not-super-tenant>true</require-not-super-tenant>
-        </menu>
-    </menus>
-
-
-    <FileUploadConfig>
-        <Mapping>
-            <Actions>
-                <Action>themeResource</Action>
-            </Actions>
-            <Class>org.wso2.carbon.theme.mgt.ui.processors.AddThemeResourceProcessor</Class>
-        </Mapping>
-    </FileUploadConfig>
-
-    <servlets>
-        <servlet id="testthemeservlet">
-            <servlet-name>ThemeResourceContentServlet</servlet-name>
-            <url-pattern>/registry/themeResourceContent</url-pattern>
-            <display-name>Theme Resource Content Servlet</display-name>
-
-            <servlet-class>org.wso2.carbon.theme.mgt.ui.servlets.ThemeResourceSevelet</servlet-class>
-        </servlet>
-    </servlets>
-</component>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/JSResources.properties
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/JSResources.properties b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/JSResources.properties
deleted file mode 100644
index 4282f03..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/JSResources.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-password.mismatched=Passwords do not match.
-current.password.should.provided=You should provide the current password inorder to change the password.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/Resources.properties
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/Resources.properties b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/Resources.properties
deleted file mode 100644
index edf3f48..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/Resources.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-submit.tenant=Submit Tenant
-domain=Domain
-domain.information=Domain Information
-contact.details=Contact Details
-admin.username=Admin Username
-current.admin.password=Current Admin Password
-new.admin.password=New Admin Password
-new.admin.password.repeat=New Admin Password (Repeat)
-admin.password=Admin Password
-admin.password.repeat=Admin Password (Repeat)
-govern.add_tenants.menu=Add New Tenant
-govern.view_tenants.menu=View Tenants
-overview=Overview
-tenants.list=Tenants List
-company.organization=Company/Organization
-admin.contact=Admin Contact
-edit=Edit
-multitenancy=Multitenancy
-added.successfully=You have successfully added a new tenant with domain:
-updated.successfully=You have successfully updated the tenant with domain:
-update.added.tenant=Update the just added/updated tenant
-update.tenant=Update Tenant
-add.new.tenant=Add a new tenant
-register.new.organization=Register A New Organization
-view.all.tenants=View all tenants
-tenant.admin=Tenant Admin
-tenant.description=Tenant Description
-admin.fullname=Full Name
-admin.address=Address
-admin.email=Email
-admin.telephone=Telephone
-admin.im=IM
-admin.url=URL
-self.registration=Registry Tenant
-gaas=GaaS
-gaas.register.a.new.tenant=Register A New Tenant
-active=Active
-theme.management=Theme
-word.verification=Word Verification
-captcha.message=Type the characters you see in the picture below.
-add.image=Add an Image
-image.path.help.text=Give the path of a file to fetch a image (bmp,gif,jpg,png)
-image.url.help.text=Give the full url of the resource to fetch a image from URL (bmp,gif,jpg,png)
-upload.image.from.file=Upload an image from a file
-import.image.from.url=Import an image from a URL
-update.logo.image.from.file=Update the logo image from a file
-update.logo.image.from.url=Update the logo image from a URL
-method=Method
-logo.management=Logo Management
-change.the.logo=Change the Logo
-wait.message=Process may take some time. Please wait..

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/add_collection_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/add_collection_ajaxprocessor.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/add_collection_ajaxprocessor.jsp
deleted file mode 100644
index d160252..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/add_collection_ajaxprocessor.jsp
+++ /dev/null
@@ -1,49 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-    String errorMessage = null;
-    try {
-        
-        String parentPath = request.getParameter("parentPath");
-        String collectionName = request.getParameter("collectionName");
-        String mediaType = request.getParameter("mediaType");
-        String description = request.getParameter("description");
-
-        String cookie = (String) request.
-                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-
-        try {
-        ThemeMgtServiceClient client = new ThemeMgtServiceClient(cookie, config, session);
-        client.addCollection(parentPath, collectionName, mediaType, description);
-        } catch (Exception e) {
-            String msg = "Failed to add new collection " + collectionName +
-                    " to the parent collection " + parentPath + ". " + e.getMessage();
-            throw new UIException(msg, e);
-        }
-
-    } catch (Exception e) {
-        errorMessage = e.getMessage();
-        response.setStatus(500);
-        out.write(errorMessage);
-        return;
-    }
-%>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/add_text_resource_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/add_text_resource_ajaxprocessor.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/add_text_resource_ajaxprocessor.jsp
deleted file mode 100644
index 5bffddc..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/add_text_resource_ajaxprocessor.jsp
+++ /dev/null
@@ -1,57 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.utils.ServerConstants" %>
-<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
-<%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="org.wso2.carbon.registry.resource.ui.processors.AddTextResourceProcessor" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-    String errorMessage = null;
-    try {
-
-        String parentPath = request.getParameter("parentPath");
-        String fileName = request.getParameter("fileName");
-        String mediaType = request.getParameter("mediaType");
-        String description = request.getParameter("description");
-        String content = request.getParameter("content");
-
-        String cookie = (String) request.
-                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-
-        try {
-            ThemeMgtServiceClient client =
-                    new ThemeMgtServiceClient(cookie, config, request.getSession());
-            client.addTextResource(parentPath, fileName, mediaType, description, content);
-        } catch (Exception e) {
-            String msg = "Failed to add new text resource " + fileName +
-                    " to the parent collection " + parentPath + ". " + e.getMessage();
-            throw new UIException(msg, e);
-        }
-
-    } catch (Exception e) {
-        errorMessage = e.getMessage();
-    }
-%>
-
-<% if (errorMessage != null) { %>
-
-<script type="text/javascript">
-	location.href='../error.jsp?errorMsg=<%=errorMessage%>'
-</script>
-
-<% } %>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/content_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/content_ajaxprocessor.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/content_ajaxprocessor.jsp
deleted file mode 100644
index 1635670..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/content_ajaxprocessor.jsp
+++ /dev/null
@@ -1,241 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentBean" %>
-<%@ page import="org.wso2.carbon.registry.resource.ui.Utils" %>
-<%@ page import="org.wso2.carbon.registry.resource.ui.clients.CustomUIHandler" %>
-<%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="org.wso2.carbon.theme.mgt.ui.utils.ThemeUtil" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<fmt:bundle basename="org.wso2.carbon.registry.resource.ui.i18n.Resources">
-
-    <%
-        String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-        String viewMode = Utils.getResourceViewMode(request);
-        boolean isInlinedView = "inlined".equals(viewMode);
-        ContentBean cb;
-        ThemeMgtServiceClient client;
-
-
-        try {
-            client = new ThemeMgtServiceClient(cookie, config, session);
-            cb = client.getContent(request);
-        } catch (Exception e) {
-    %>
-    <jsp:forward page="../admin/error.jsp?<%=e.getMessage()%>"/>
-    <%
-            return;
-        }
-
-        String cuiURL = CustomUIHandler.getCustomViewUI(cb.getMediaType(), request.getSession());
-        String mode = request.getParameter("mode");
-        boolean cui = false;
-        if (cuiURL != null && !"standard".equals(mode)) {
-            cui = true;
-        }
-if(!cb.getAbsent().equals("true")){
-    %>
-
-    <div class="box1-head">
-        <table cellspacing="0" cellpadding="0" border="0" style="width:100%">
-            <tr>
-                <td valign="top">
-                    <h2 class="sub-headding-entries"><%if (cb.getCollection()) { %>
-                        <fmt:message key="entries"/> <% } else { %>
-                        <fmt:message key="content"/> <% } %></h2>
-                </td>
-                <td align="right" valign="top" class="expanIconCell">
-
-                    <a onclick="javascript: showHideCommon('entriesIconExpanded');showHideCommon('entriesIconMinimized');showHideCommon('entriesExpanded');showHideCommon('entriesMinimized');">
-                        <img src="../resources/images/icon-expanded.gif" border="0" align="top"
-                             id="entriesIconExpanded"/>
-                        <img src="../resources/images/icon-minimized.gif" border="0" align="top"
-                             id="entriesIconMinimized" style="display:none;"/>
-                    </a>
-
-
-                </td>
-
-            </tr>
-        </table>
-    </div>
-    <div class="box1-mid-fill" id="entriesMinimized" style="display:none"></div>
-    <div class="box1-mid" id="entriesExpanded">
-        <%
-            if (!isInlinedView) {
-        %>
-
-        <% if (cb.getCollection() && cb.getPutAllowed() && !cb.getVersionView() && cb.getLoggedIn() && !cui) { %>
-
-<fmt:bundle basename="org.wso2.carbon.theme.mgt.ui.i18n.Resources">
-        <div style="display:block;height:30px;">
-            <a class="add-resource-icon-link"
-               onclick="showHide('add-resource-div');resetThemeResourceForms()"><fmt:message
-                    key="add.image"/></a>
-        </div>
-
-</fmt:bundle>
-        <div style="display:block;height:30px;">
-            <a class="add-collection-icon-link"
-               onclick="javascript: showHide('add-folder-div');expandIfNot('entries');if($('add-folder-div').style.display!='none')$('collectionName').focus();">
-                <fmt:message key="add.collection"/></a>
-        </div>
-        <% }
-        }%>
-
-        <!-- all the content goes here -->
-        <% if (cui) { %>
-        <a onclick="viewStandardThemeContentSection('<%=cb.getPathWithVersion()%>')">Standard
-            view</a><br/>
-
-        <div id="customViewUIDiv">
-            <jsp:include page="<%=cuiURL%>"/>
-        </div>
-        <%
-        } else {
-
-            if (cuiURL != null) {
-        %>
-        <a onclick="refreshThemeContentSection('<%=cb.getPathWithVersion()%>')"><fmt:message
-                key="custom.view"/></a><br/>
-        <%
-            }
-            boolean isImage = false;
-            String contentPathLower = (cb.getContentPath() == null)? "" : cb.getContentPath().toLowerCase();
-            String[] expectedImageExts = {".jpg", ".jpeg", ".png", ".gif"};
-
-            for (String ext: expectedImageExts) {
-               if (contentPathLower.endsWith(ext)) {
-                   isImage = true;
-                   break;
-               }
-            }
-            if (cb.getCollection()) {
-        %>
-
-        <jsp:include page="raw-collection-content.jsp"/>
-
-        <% } else if(isImage) {
-        %>
-
-        <table style="*width:340px !important;">
-        <tr>
-        <!--<td>
-        <a onclick="displayThemeContentAsText('<%=cb.getPathWithVersion()%>')" class="icon-link" style="background-image:url(../admin/images/view.gif);"><fmt:message
-                key="display.as.text"/></a>
-        </td>
-        <% if (cb.getPutAllowed() && !cb.getVersionView()) { %>
-        <td style="vertical-align:middle;padding-left:5px;">|</td>
-        <td>
-        <a onclick="displayEditThemeContentAsText('<%=cb.getPathWithVersion()%>')" class="icon-link" style="background-image:url(../admin/images/edit.gif);"><fmt:message
-                key="edit.as.text"/></a>
-        </td>
-        <% } %>
-        <td style="vertical-align:middle;padding-left:5px;">|</td>  -->
-        <td>
-            <%
-                String path;
-            if (cb.getRealPath() != null) {
-                path = cb.getRealPath();
-            } else {
-                path = cb.getPathWithVersion();
-            }
-            if (path.startsWith("http")) {
-                %>
-                <a class="icon-link" style="background-image:url(../resources/images/icon-download.jpg);"
-		           href="<%=path%>"
-		           target="_blank"><fmt:message key="download"/></a>
-       <%
-            } else {
-        %>
-	    <a class="icon-link" style="background-image:url(../resources/images/icon-download.jpg);"
-		           href="<%=ThemeUtil.getThemeResourceDownloadURL(path)%>"
-		           target="_blank"><fmt:message key="download"/></a>
-	    <% }
-            %>
-        </td>
-        </tr>
-        </table>
-        <br/>
-        <br/>
-
-        <div id="generalContentDiv" style="display:block;">
-            <%
-                String imageViewLink = path;
-                if (!path.startsWith("http")) {
-                    imageViewLink = ThemeUtil.getThemeResourceViewAsImageURL(path);     
-                }
-            %>
-            <img src="<%=imageViewLink%>" alt="The Image for <%=path%>"/> 
-        </div>
-
-        <% } else {
-        %>
-
-        <table style="*width:340px !important;">
-        <tr>
-        <td>
-        <a onclick="displayThemeContentAsText('<%=cb.getPathWithVersion()%>')" class="icon-link" style="background-image:url(../admin/images/view.gif);"><fmt:message
-                key="display.as.text"/></a>
-        </td>
-        <% if (cb.getPutAllowed() && !cb.getVersionView()) { %>
-        <td style="vertical-align:middle;padding-left:5px;">|</td>
-        <td>
-        <a onclick="displayEditThemeContentAsText('<%=cb.getPathWithVersion()%>')" class="icon-link" style="background-image:url(../admin/images/edit.gif);"><fmt:message
-                key="edit.as.text"/></a>
-        </td>
-        <% } %>
-        <td style="vertical-align:middle;padding-left:5px;">|</td>
-        <td>
-            <%
-                String path;
-            if (cb.getRealPath() != null) {
-                path = cb.getRealPath();
-            } else {
-                path = cb.getPathWithVersion();
-            }
-            if (path.startsWith("http")) {
-                %>
-                <a class="icon-link" style="background-image:url(../resources/images/icon-download.jpg);"
-		           href="<%=path%>"
-		           target="_blank"><fmt:message key="download"/></a>
-       <%
-            } else {
-        %>
-	    <a class="icon-link" style="background-image:url(../resources/images/icon-download.jpg);"
-		           href="<%=ThemeUtil.getThemeResourceDownloadURL(path)%>"
-		           target="_blank"><fmt:message key="download"/></a>
-	    <% }
-            %>
-        </td>
-        </tr>
-        </table>
-        <br/>
-        <br/>
-
-        <div id="generalContentDiv" style="display:none;">
-        </div>
-
-        <% }
-        } %>
-
-    </div>
- <%}%>
-</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css-editor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css-editor.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css-editor.jsp
deleted file mode 100644
index dd882be..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css-editor.jsp
+++ /dev/null
@@ -1,58 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-    java.lang.String[] imagePaths = {"test1", "test2"};
-
-    String cookie = (String) request.
-            getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-
-    try {
-        ThemeMgtServiceClient client =
-                new ThemeMgtServiceClient(cookie, config, request.getSession());
-        imagePaths = client.getAllPaths();
-
-
-    } catch (Exception e) {
-        String type = "resource";
-        response.setStatus(500);
-        out.write("Fail to get image paths");
-        return;
-    }
-%>
-<script type="text/javascript">
-    var imagePaths = new Array();
-    <%
-    for(int i=0;i<imagePaths.length;i++){
-    %>
-    imagePaths.push("<%=imagePaths[i]%>");
-    <%
-    } %>
-</script>
-
-<div class="box1-head">
-</div>
-<div class="box1-mid">
-    <div id="cssEditorDiv">
-        <script type="text/javascript">
-            cssEditorDisplay("/main.css", "cssEditorDiv",imagePaths);
-        </script>
-    </div>
-</div>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/loginpage.css
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/loginpage.css b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/loginpage.css
deleted file mode 100644
index 430f1a1..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/loginpage.css
+++ /dev/null
@@ -1,110 +0,0 @@
-.gou-page{
-    background-image: url(../images/page-back.jpg);
-    background-position: 0px 0px;
-    background-repeat:repeat-x;
-    background-color:#5b4e17;
-}
-.gou-header{
-    background-image: url(../images/header.jpg);
-    background-position: top right;
-    background-repeat:no-repeat;
-}
-.gou-logo{
-    background-image: url(../images/logo.jpg);
-    background-position: top right;
-    background-repeat:no-repeat;
-    width:387px;
-    height:89px;
-}
-.gou-page-sizer{
-    width:100%;
-}
-.gou-content{
-    background-image: url(../images/content-back.jpg);
-    background-position: 0px 0px;
-    background-repeat:repeat-x;
-    background-color:#ffffff;
-    border:solid 1px #eafde6;
-    margin-left:10px;
-    margin-right:10px;
-}
-.gou-content-img{
-    background-image: url(../images/content-back-left.jpg);
-    background-position: 0px 0px;
-    background-repeat:no-repeat;
-    padding-top:20px;
-    padding-left:20px;
-    padding-right:20px;
-    padding-bottom:20px;
-
-}
-.gou-footer{
-    background-image: url(../images/footer.jpg);
-    background-position: 0px 0px;
-    background-repeat:repeat-x;
-    border-bottom:solid 1px #eafde6;
-    height:42px;
-    color:#ffffff;
-    font-size:10px;
-    line-height:40px;
-    padding-left:10px;
-}
-.gou-input-text{
-    height:18px;
-    font-size:10.5px;
-    border:solid 1px #cccccc;
-    width:200px;
-}
-.gou-input-button{
-       background-image: url(../images/button-back.gif);
-    background-position: 0px 0px;
-    background-repeat:repeat-x;
-    height:22px;
-    color:#ffffff;
-    background-color:#515151;
-}
-.gou-content-box{
-    padding:15px;
-    background-color:#ffffff;
-    border:solid 1px #4f301c;
-    margin-right:20px;
-}
-.gou-h1,.gou-h1 a{
-    font-size:16px;
-    font-weight:bold;
-    color:#ffffff;
-}
-.gou-content-text{
-    font-size:11px;
-    color:#636363;
-}
-body, td, th,h1, h2, div{
-    font-family:Helvetica,Arial,Sans-serif;
-    font-size:11px;
-    padding:0px;
-    margin:0px;
-}
-.gou-login-table td{
-    padding-right:20px;
-    padding-top:10px;
-}
-.gou-form-label{
-    font-color:#3b3b3b;
-    font-size:12px;
-}
-.gou-sign-in{
-    padding-left:5px;
-    color:#1b676b;
-    height:40px;
-    text-decoration:none;
-}
-.gou-links-table img{
-    border: none;
-}
-.gou-links-table td{
-    padding-bottom:20px;
-    padding-left:20px;
-}
-.gou-links-table a{
-    text-decoration:none;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/tenant.css
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/tenant.css b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/tenant.css
deleted file mode 100644
index 8f211b8..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/tenant.css
+++ /dev/null
@@ -1,74 +0,0 @@
-/*css editor styles */
-.csseditor-top-line{
-    background-color:black;
-    height:5px;
-}
-.csseditor-leftbox{
-    background-color:#e6e6e6;
-    padding-left:5px;
-    padding-right:5px;
-    padding-bottom:5px;
-    padding-top:15px;
-   height:380px;
-}
-.csseditor-leftbox-top{
-    color:#000000;
-    font-size:18px;
-    height:30px;
-}
-.csseditor-textbox{
-    background-color:#dfe7ed;
-    border:solid 1px #ffffff;
-    width:100%;
-}
-.csseditor-rightbox{
-    background-color:#f3f3f3;
-    border:solid 1px #ffffff;
-    height:400px;
-}
-.csseditor-rightbox-title{
-    background-color:#9a9a9a;
-    height:25px;
-    color:#ffffff;
-    padding-left:10px;
-    padding-top:5px;
-}
-.csseditor-searchbox{
-    padding-left:10px;
-    padding-top:10px;
-}
-.csseditor-right{
-    width:320px;
-}
-#flickr_results{
-    height:210px;
-    overflow-y:auto;
-    overflow-x:hidden;
-    margin-left:5px;
-    margin-right:5px;
-    border:solid 1px #ffffff;
-}
-.flicker_selected{
-    height:20px;
-    border:solid 1px #cccccc;
-    background-color:#ffffff;
-    color:#333333;
-    padding:5px;
-    margin-top:5px;
-    margin-bottom:5px;
-}
-.imageList{
-}
-.imageList li {
-    padding-top: 3px !important;
-    padding-left: 5px !important;
-    background-color: #e1e9ec;
-    border: solid 1px #b5bdc1;
-}
-
-.imageList li a {
-    background-image: url(../images/images.gif);
-    background-repeat: no-repeat;
-    padding-left: 20px;
-    text-indent: 50px;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/tenent-theme.css
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/tenent-theme.css b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/tenent-theme.css
deleted file mode 100644
index c3397db..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/tenent-theme.css
+++ /dev/null
@@ -1,32 +0,0 @@
-.sel-box{
-	background-image:url(../images/sel-02.jpg);
-	background-repeat:repeat-x;
-	background-position:0 0;
-	background-color:#f2f2f2;
-	border: inset 2px #48657a;
-	padding:3px;
-	float:left;
-	margin-right:20px;
-	margin-bottom:20px;
-}
-.sel-box span{
-	color:#1c475f;
-	font-weight:bold;
-	text-align:center;
-	font-size:14px;
-	line-height:30px;
-}
-.nor-box{
-	background-color:#ffffff;
-	border: solid 1px #7699b3;
-	padding:3px;
-	float:left;
-	margin-right:20px;
-	margin-bottom:20px;
-}
-.nor-box span{
-	color:#1c475f;
-	font-weight:bold;
-	text-align:center;
-	line-height:30px;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/theme-mgt.css
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/theme-mgt.css b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/theme-mgt.css
deleted file mode 100644
index 18f7aac..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/css/theme-mgt.css
+++ /dev/null
@@ -1,16 +0,0 @@
-.subcontent {
-    padding:5px 0px 5px; 0px
-}
-
-.subtopic {
-    padding:10px 0px 5px; 0px;
-    border-bottom:1px solid #000000;
-    font-size:140%;
-    font-weight:normal;
-    margin-bottom:10px;
-    margin-top:5px;
-}
-
-.green-note {
-    color: #058000;    
-}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/delete_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/delete_ajaxprocessor.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/delete_ajaxprocessor.jsp
deleted file mode 100644
index 21bebe9..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/delete_ajaxprocessor.jsp
+++ /dev/null
@@ -1,47 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.resource.ui.processors.DeleteProcessor" %>
-<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
-<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
-<%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-    String errorMessage = null;
-    String pathToDelete = request.getParameter("pathToDelete");
-
-     String cookie = (String) request.
-            getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-
-    try {
-        ThemeMgtServiceClient client =
-                new ThemeMgtServiceClient(cookie, config, request.getSession());
-        client.delete(pathToDelete);
-    } catch (Exception e) {
-        String msg = "Failed to delete " + pathToDelete + ". " + e.getMessage();
-        errorMessage = new Exception(msg, e).getMessage();
-    }
-
-%>
-
-<% if (errorMessage != null) { %>
-
-<script type="text/javascript">
-	location.href='../error.jsp?errorMsg=<%=errorMessage%>'
-</script>
-
-<% } %>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/display_text_content_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/display_text_content_ajaxprocessor.jsp b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/display_text_content_ajaxprocessor.jsp
deleted file mode 100644
index bcd8ceb..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/display_text_content_ajaxprocessor.jsp
+++ /dev/null
@@ -1,47 +0,0 @@
-<!--
- ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- ~
- ~ WSO2 Inc. 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.utils.ServerConstants" %>
-<%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-
-<fmt:bundle basename="org.wso2.carbon.registry.resource.ui.i18n.Resources">
-    <%
-        String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
-
-        String textContent;
-        try {
-            ThemeMgtServiceClient client = new ThemeMgtServiceClient(cookie, config, session);
-            textContent = client.getTextContent(request);
-        } catch (Exception e) {
-            response.setStatus(500);
-    %><%=e.getMessage()%><%
-        return;
-    }
-%>
-
-    <br/>
-    <textarea rows="15" cols="70" readonly="readonly"><%=textContent%></textarea>
-    <br/>
-    <input type='button' class='button' id="cancelContentButtonID"
-           onclick='cancelTextContentDisplay()'
-           value='<fmt:message key="done"/>'/>
-    <br/>
-
-</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/change-logo.png
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/change-logo.png b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/change-logo.png
deleted file mode 100644
index 528fb26..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/change-logo.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/edit-theme.png
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/edit-theme.png b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/edit-theme.png
deleted file mode 100644
index cebe21c..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/docs/images/edit-theme.png and /dev/null differ


[16/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/manage_area.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/manage_area.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/manage_area.js
new file mode 100644
index 0000000..e10c5e9
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/manage_area.js
@@ -0,0 +1,623 @@
+	EditArea.prototype.focus = function() {
+		this.textarea.focus();
+		this.textareaFocused=true;
+	};
+
+
+	EditArea.prototype.check_line_selection= function(timer_checkup){
+		var changes, infos, new_top, new_width,i;
+		
+		var t1=t2=t2_1=t3=tLines=tend= new Date().getTime();
+		// l'editeur n'existe plus => on quitte
+		if(!editAreas[this.id])
+			return false;
+		
+		if(!this.smooth_selection && !this.do_highlight)
+		{
+			//do nothing
+		}
+		else if(this.textareaFocused && editAreas[this.id]["displayed"]==true && this.isResizing==false)
+		{
+			infos	= this.get_selection_infos();
+			changes	= this.checkTextEvolution( typeof( this.last_selection['full_text'] ) == 'undefined' ? '' : this.last_selection['full_text'], infos['full_text'] );
+		
+			t2= new Date().getTime();
+			
+			// if selection change
+			if(this.last_selection["line_start"] != infos["line_start"] || this.last_selection["line_nb"] != infos["line_nb"] || infos["full_text"] != this.last_selection["full_text"] || this.reload_highlight || this.last_selection["selectionStart"] != infos["selectionStart"] || this.last_selection["selectionEnd"] != infos["selectionEnd"] || !timer_checkup )
+			{
+				// move and adjust text selection elements
+				new_top		= this.getLinePosTop( infos["line_start"] );
+				new_width	= Math.max(this.textarea.scrollWidth, this.container.clientWidth -50);
+				this.selection_field.style.top=this.selection_field_text.style.top=new_top+"px";
+				if(!this.settings['word_wrap']){	
+					this.selection_field.style.width=this.selection_field_text.style.width=this.test_font_size.style.width=new_width+"px";
+				}
+				
+				// usefull? => _$("cursor_pos").style.top=new_top+"px";	
+		
+				if(this.do_highlight==true)
+				{
+					// fill selection elements
+					var curr_text	= infos["full_text"].split("\n");
+					var content		= "";
+					//alert("length: "+curr_text.length+ " i: "+ Math.max(0,infos["line_start"]-1)+ " end: "+Math.min(curr_text.length, infos["line_start"]+infos["line_nb"]-1)+ " line: "+infos["line_start"]+" [0]: "+curr_text[0]+" [1]: "+curr_text[1]);
+					var start		= Math.max(0,infos["line_start"]-1);
+					var end			= Math.min(curr_text.length, infos["line_start"]+infos["line_nb"]-1);
+					
+					//curr_text[start]= curr_text[start].substr(0,infos["curr_pos"]-1) +"¤_overline_¤"+ curr_text[start].substr(infos["curr_pos"]-1);
+					for(i=start; i< end; i++){
+						content+= curr_text[i]+"\n";	
+					}
+					
+					// add special chars arround selected characters
+					selLength	= infos['selectionEnd'] - infos['selectionStart'];
+					content		= content.substr( 0, infos["curr_pos"] - 1 ) + "\r\r" + content.substr( infos["curr_pos"] - 1, selLength ) + "\r\r" + content.substr( infos["curr_pos"] - 1 + selLength );
+					content		= '<span>'+ content.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace("\r\r", '</span><strong>').replace("\r\r", '</strong><span>') +'</span>';
+					
+					if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
+						this.selection_field.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
+					} else {
+						this.selection_field.innerHTML= content;
+					}
+					this.selection_field_text.innerHTML = this.selection_field.innerHTML;
+					t2_1 = new Date().getTime();
+					// check if we need to update the highlighted background 
+					if(this.reload_highlight || (infos["full_text"] != this.last_text_to_highlight && (this.last_selection["line_start"]!=infos["line_start"] || this.show_line_colors || this.settings['word_wrap'] || this.last_selection["line_nb"]!=infos["line_nb"] || this.last_selection["nb_line"]!=infos["nb_line"]) ) )
+					{
+						this.maj_highlight(infos);
+					}
+				}		
+			}
+			t3= new Date().getTime();
+			
+			// manage line heights
+			if( this.settings['word_wrap'] && infos["full_text"] != this.last_selection["full_text"])
+			{
+				// refresh only 1 line if text change concern only one line and that the total line number has not changed
+				if( changes.newText.split("\n").length == 1 && this.last_selection['nb_line'] && infos['nb_line'] == this.last_selection['nb_line'] )
+				{
+					this.fixLinesHeight( infos['full_text'], changes.lineStart, changes.lineStart );
+				}
+				else
+				{
+					this.fixLinesHeight( infos['full_text'], changes.lineStart, -1 );
+				}
+			}
+		
+			tLines= new Date().getTime();
+			// manage bracket finding
+			if( infos["line_start"] != this.last_selection["line_start"] || infos["curr_pos"] != this.last_selection["curr_pos"] || infos["full_text"].length!=this.last_selection["full_text"].length || this.reload_highlight || !timer_checkup )
+			{
+				// move _cursor_pos
+				var selec_char= infos["curr_line"].charAt(infos["curr_pos"]-1);
+				var no_real_move=true;
+				if(infos["line_nb"]==1 && (this.assocBracket[selec_char] || this.revertAssocBracket[selec_char]) ){
+					
+					no_real_move=false;					
+					//findEndBracket(infos["line_start"], infos["curr_pos"], selec_char);
+					if(this.findEndBracket(infos, selec_char) === true){
+						_$("end_bracket").style.visibility	="visible";
+						_$("cursor_pos").style.visibility	="visible";
+						_$("cursor_pos").innerHTML			= selec_char;
+						_$("end_bracket").innerHTML			= (this.assocBracket[selec_char] || this.revertAssocBracket[selec_char]);
+					}else{
+						_$("end_bracket").style.visibility	="hidden";
+						_$("cursor_pos").style.visibility	="hidden";
+					}
+				}else{
+					_$("cursor_pos").style.visibility	="hidden";
+					_$("end_bracket").style.visibility	="hidden";
+				}
+				//alert("move cursor");
+				this.displayToCursorPosition("cursor_pos", infos["line_start"], infos["curr_pos"]-1, infos["curr_line"], no_real_move);
+				if(infos["line_nb"]==1 && infos["line_start"]!=this.last_selection["line_start"])
+					this.scroll_to_view();
+			}
+			this.last_selection=infos;
+		}
+		
+		tend= new Date().getTime();
+		//if( (tend-t1) > 7 )
+		//	console.log( "tps total: "+ (tend-t1) + " tps get_infos: "+ (t2-t1)+ " tps selec: "+ (t2_1-t2)+ " tps highlight: "+ (t3-t2_1) +" tps lines: "+ (tLines-t3) +" tps cursor+lines: "+ (tend-tLines)+" \n" );
+		
+		
+		if(timer_checkup){
+			setTimeout("editArea.check_line_selection(true)", this.check_line_selection_timer);
+		}
+	};
+
+
+	EditArea.prototype.get_selection_infos= function(){
+		var sel={}, start, end, len, str;
+	
+		this.getIESelection();
+		start	= this.textarea.selectionStart;
+		end		= this.textarea.selectionEnd;		
+		
+		if( this.last_selection["selectionStart"] == start && this.last_selection["selectionEnd"] == end && this.last_selection["full_text"] == this.textarea.value )
+		{	
+			return this.last_selection;
+		}
+			
+		if(this.tabulation!="\t" && this.textarea.value.indexOf("\t")!=-1) 
+		{	// can append only after copy/paste 
+			len		= this.textarea.value.length;
+			this.textarea.value	= this.replace_tab(this.textarea.value);
+			start	= end	= start+(this.textarea.value.length-len);
+			this.area_select( start, 0 );
+		}
+		
+		sel["selectionStart"]	= start;
+		sel["selectionEnd"]		= end;		
+		sel["full_text"]		= this.textarea.value;
+		sel["line_start"]		= 1;
+		sel["line_nb"]			= 1;
+		sel["curr_pos"]			= 0;
+		sel["curr_line"]		= "";
+		sel["indexOfCursor"]	= 0;
+		sel["selec_direction"]	= this.last_selection["selec_direction"];
+
+		//return sel;	
+		var splitTab= sel["full_text"].split("\n");
+		var nbLine	= Math.max(0, splitTab.length);		
+		var nbChar	= Math.max(0, sel["full_text"].length - (nbLine - 1));	// (remove \n caracters from the count)
+		if( sel["full_text"].indexOf("\r") != -1 )
+			nbChar	= nbChar - ( nbLine - 1 );		// (remove \r caracters from the count)
+		sel["nb_line"]	= nbLine;		
+		sel["nb_char"]	= nbChar;
+	
+		if(start>0){
+			str					= sel["full_text"].substr(0,start);
+			sel["curr_pos"]		= start - str.lastIndexOf("\n");
+			sel["line_start"]	= Math.max(1, str.split("\n").length);
+		}else{
+			sel["curr_pos"]=1;
+		}
+		if(end>start){
+			sel["line_nb"]=sel["full_text"].substring(start,end).split("\n").length;
+		}
+		sel["indexOfCursor"]=start;		
+		sel["curr_line"]=splitTab[Math.max(0,sel["line_start"]-1)];
+	
+		// determine in which direction the selection grow
+		if(sel["selectionStart"] == this.last_selection["selectionStart"]){
+			if(sel["selectionEnd"]>this.last_selection["selectionEnd"])
+				sel["selec_direction"]= "down";
+			else if(sel["selectionEnd"] == this.last_selection["selectionStart"])
+				sel["selec_direction"]= this.last_selection["selec_direction"];
+		}else if(sel["selectionStart"] == this.last_selection["selectionEnd"] && sel["selectionEnd"]>this.last_selection["selectionEnd"]){
+			sel["selec_direction"]= "down";
+		}else{
+			sel["selec_direction"]= "up";
+		}
+		
+		_$("nbLine").innerHTML	= nbLine;		
+		_$("nbChar").innerHTML	= nbChar;		
+		_$("linePos").innerHTML	= sel["line_start"];
+		_$("currPos").innerHTML	= sel["curr_pos"];
+
+		return sel;		
+	};
+	
+	// set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd)
+	EditArea.prototype.getIESelection= function(){
+		var selectionStart, selectionEnd, range, stored_range;
+		
+		if( !this.isIE )
+			return false;
+			
+		// make it work as nowrap mode (easier for range manipulation with lineHeight)
+		if( this.settings['word_wrap'] )
+			this.textarea.wrap='off';
+			
+		try{
+			range			= document.selection.createRange();
+			stored_range	= range.duplicate();
+			stored_range.moveToElementText( this.textarea );
+			stored_range.setEndPoint( 'EndToEnd', range );
+			if( stored_range.parentElement() != this.textarea )
+				throw "invalid focus";
+				
+			// the range don't take care of empty lines in the end of the selection
+			var scrollTop	= this.result.scrollTop + document.body.scrollTop;
+			var relative_top= range.offsetTop - parent.calculeOffsetTop(this.textarea) + scrollTop;
+			var line_start	= Math.round((relative_top / this.lineHeight) +1);
+			var line_nb		= Math.round( range.boundingHeight / this.lineHeight );
+						
+			selectionStart	= stored_range.text.length - range.text.length;		
+			selectionStart	+= ( line_start - this.textarea.value.substr(0, selectionStart).split("\n").length)*2;		// count missing empty \r to the selection
+			selectionStart	-= ( line_start - this.textarea.value.substr(0, selectionStart).split("\n").length ) * 2;
+			
+			selectionEnd	= selectionStart + range.text.length;		
+			selectionEnd	+= (line_start + line_nb - 1 - this.textarea.value.substr(0, selectionEnd ).split("\n").length)*2;			
+		
+			this.textarea.selectionStart	= selectionStart;
+			this.textarea.selectionEnd		= selectionEnd;
+		}
+		catch(e){}
+		
+		// restore wrap mode
+		if( this.settings['word_wrap'] )
+			this.textarea.wrap='soft';
+	};
+	
+	// select the text for IE (and take care of \r caracters)
+	EditArea.prototype.setIESelection= function(){
+		var a = this.textarea, nbLineStart, nbLineEnd, range;
+		
+		if( !this.isIE )
+			return false;
+		
+		nbLineStart	= a.value.substr(0, a.selectionStart).split("\n").length - 1;
+		nbLineEnd 	= a.value.substr(0, a.selectionEnd).split("\n").length - 1;
+		range		= document.selection.createRange();
+		range.moveToElementText( a );
+		range.setEndPoint( 'EndToStart', range );
+		
+		range.moveStart('character', a.selectionStart - nbLineStart);
+		range.moveEnd('character', a.selectionEnd - nbLineEnd - (a.selectionStart - nbLineStart)  );
+		range.select();
+	};
+	
+	
+	
+	EditArea.prototype.checkTextEvolution=function(lastText,newText){
+		// ch will contain changes datas
+		var ch={},baseStep=200, cpt=0, end, step,tStart=new Date().getTime();
+	
+		end		= Math.min(newText.length, lastText.length);
+        step	= baseStep;
+        // find how many chars are similar at the begin of the text						
+		while( cpt<end && step>=1 ){
+            if(lastText.substr(cpt, step) == newText.substr(cpt, step)){
+                cpt+= step;
+            }else{
+                step= Math.floor(step/2);
+            }
+		}
+		
+		ch.posStart	= cpt;
+		ch.lineStart= newText.substr(0, ch.posStart).split("\n").length -1;						
+		
+		cpt_last	= lastText.length;
+        cpt			= newText.length;
+        step		= baseStep;			
+        // find how many chars are similar at the end of the text						
+		while( cpt>=0 && cpt_last>=0 && step>=1 ){
+            if(lastText.substr(cpt_last-step, step) == newText.substr(cpt-step, step)){
+                cpt-= step;
+                cpt_last-= step;
+            }else{
+                step= Math.floor(step/2);
+            }
+		}
+		
+		ch.posNewEnd	= cpt;
+		ch.posLastEnd	= cpt_last;
+		if(ch.posNewEnd<=ch.posStart){
+			if(lastText.length < newText.length){
+				ch.posNewEnd= ch.posStart + newText.length - lastText.length;
+				ch.posLastEnd= ch.posStart;
+			}else{
+				ch.posLastEnd= ch.posStart + lastText.length - newText.length;
+				ch.posNewEnd= ch.posStart;
+			}
+		} 
+		ch.newText		= newText.substring(ch.posStart, ch.posNewEnd);
+		ch.lastText		= lastText.substring(ch.posStart, ch.posLastEnd);			            
+		
+		ch.lineNewEnd	= newText.substr(0, ch.posNewEnd).split("\n").length -1;
+		ch.lineLastEnd	= lastText.substr(0, ch.posLastEnd).split("\n").length -1;
+		
+		ch.newTextLine	= newText.split("\n").slice(ch.lineStart, ch.lineNewEnd+1).join("\n");
+		ch.lastTextLine	= lastText.split("\n").slice(ch.lineStart, ch.lineLastEnd+1).join("\n");
+		//console.log( ch );
+		return ch;	
+	};
+	
+	EditArea.prototype.tab_selection= function(){
+		if(this.is_tabbing)
+			return;
+		this.is_tabbing=true;
+		//infos=getSelectionInfos();
+		//if( document.selection ){
+		this.getIESelection();
+		/* Insertion du code de formatage */
+		var start = this.textarea.selectionStart;
+		var end = this.textarea.selectionEnd;
+		var insText = this.textarea.value.substring(start, end);
+		
+		/* Insert tabulation and ajust cursor position */
+		var pos_start=start;
+		var pos_end=end;
+		if (insText.length == 0) {
+			// if only one line selected
+			this.textarea.value = this.textarea.value.substr(0, start) + this.tabulation + this.textarea.value.substr(end);
+			pos_start = start + this.tabulation.length;
+			pos_end=pos_start;
+		} else {
+			start= Math.max(0, this.textarea.value.substr(0, start).lastIndexOf("\n")+1);
+			endText=this.textarea.value.substr(end);
+			startText=this.textarea.value.substr(0, start);
+			tmp= this.textarea.value.substring(start, end).split("\n");
+			insText= this.tabulation+tmp.join("\n"+this.tabulation);
+			this.textarea.value = startText + insText + endText;
+			pos_start = start;
+			pos_end= this.textarea.value.indexOf("\n", startText.length + insText.length);
+			if(pos_end==-1)
+				pos_end=this.textarea.value.length;
+			//pos = start + repdeb.length + insText.length + ;
+		}
+		this.textarea.selectionStart = pos_start;
+		this.textarea.selectionEnd = pos_end;
+		
+		//if( document.selection ){
+		if(this.isIE)
+		{
+			this.setIESelection();
+			setTimeout("editArea.is_tabbing=false;", 100);	// IE can't accept to make 2 tabulation without a little break between both
+		}
+		else
+		{ 
+			this.is_tabbing=false;
+		}	
+		
+  	};
+	
+	EditArea.prototype.invert_tab_selection= function(){
+		var t=this, a=this.textarea;
+		if(t.is_tabbing)
+			return;
+		t.is_tabbing=true;
+		//infos=getSelectionInfos();
+		//if( document.selection ){
+		t.getIESelection();
+		
+		var start	= a.selectionStart;
+		var end		= a.selectionEnd;
+		var insText	= a.value.substring(start, end);
+		
+		/* Tab remove and cursor seleciton adjust */
+		var pos_start=start;
+		var pos_end=end;
+		if (insText.length == 0) {
+			if(a.value.substring(start-t.tabulation.length, start)==t.tabulation)
+			{
+				a.value		= a.value.substr(0, start-t.tabulation.length) + a.value.substr(end);
+				pos_start	= Math.max(0, start-t.tabulation.length);
+				pos_end		= pos_start;
+			}	
+			/*
+			a.value = a.value.substr(0, start) + t.tabulation + insText + a.value.substr(end);
+			pos_start = start + t.tabulation.length;
+			pos_end=pos_start;*/
+		} else {
+			start		= a.value.substr(0, start).lastIndexOf("\n")+1;
+			endText		= a.value.substr(end);
+			startText	= a.value.substr(0, start);
+			tmp			= a.value.substring(start, end).split("\n");
+			insText		= "";
+			for(i=0; i<tmp.length; i++){				
+				for(j=0; j<t.tab_nb_char; j++){
+					if(tmp[i].charAt(0)=="\t"){
+						tmp[i]=tmp[i].substr(1);
+						j=t.tab_nb_char;
+					}else if(tmp[i].charAt(0)==" ")
+						tmp[i]=tmp[i].substr(1);
+				}		
+				insText+=tmp[i];
+				if(i<tmp.length-1)
+					insText+="\n";
+			}
+			//insText+="_";
+			a.value		= startText + insText + endText;
+			pos_start	= start;
+			pos_end		= a.value.indexOf("\n", startText.length + insText.length);
+			if(pos_end==-1)
+				pos_end=a.value.length;
+			//pos = start + repdeb.length + insText.length + ;
+		}
+		a.selectionStart = pos_start;
+		a.selectionEnd = pos_end;
+		
+		//if( document.selection ){
+		if(t.isIE){
+			// select the text for IE
+			t.setIESelection();
+			setTimeout("editArea.is_tabbing=false;", 100);	// IE can accept to make 2 tabulation without a little break between both
+		}else
+			t.is_tabbing=false;
+  	};
+	
+	EditArea.prototype.press_enter= function(){		
+		if(!this.smooth_selection)
+			return false;
+		this.getIESelection();
+		var scrollTop= this.result.scrollTop;
+		var scrollLeft= this.result.scrollLeft;
+		var start=this.textarea.selectionStart;
+		var end= this.textarea.selectionEnd;
+		var start_last_line= Math.max(0 , this.textarea.value.substring(0, start).lastIndexOf("\n") + 1 );
+		var begin_line= this.textarea.value.substring(start_last_line, start).replace(/^([ \t]*).*/gm, "$1");
+		var lineStart = this.textarea.value.substring(0, start).split("\n").length;
+		if(begin_line=="\n" || begin_line=="\r" || begin_line.length==0)
+		{
+			return false;
+		}
+			
+		if(this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ){
+			begin_line="\r\n"+ begin_line;
+		}else{
+			begin_line="\n"+ begin_line;
+		}	
+		//alert(start_last_line+" strat: "+start +"\n"+this.textarea.value.substring(start_last_line, start)+"\n_"+begin_line+"_")
+		this.textarea.value= this.textarea.value.substring(0, start) + begin_line + this.textarea.value.substring(end);
+		
+		this.area_select(start+ begin_line.length ,0);
+		// during this process IE scroll back to the top of the textarea
+		if(this.isIE){
+			this.result.scrollTop	= scrollTop;
+			this.result.scrollLeft	= scrollLeft;
+		}
+		return true;
+		
+	};
+	
+	EditArea.prototype.findEndBracket= function(infos, bracket){
+			
+		var start=infos["indexOfCursor"];
+		var normal_order=true;
+		//curr_text=infos["full_text"].split("\n");
+		if(this.assocBracket[bracket])
+			endBracket=this.assocBracket[bracket];
+		else if(this.revertAssocBracket[bracket]){
+			endBracket=this.revertAssocBracket[bracket];
+			normal_order=false;
+		}	
+		var end=-1;
+		var nbBracketOpen=0;
+		
+		for(var i=start; i<infos["full_text"].length && i>=0; ){
+			if(infos["full_text"].charAt(i)==endBracket){				
+				nbBracketOpen--;
+				if(nbBracketOpen<=0){
+					//i=infos["full_text"].length;
+					end=i;
+					break;
+				}
+			}else if(infos["full_text"].charAt(i)==bracket)
+				nbBracketOpen++;
+			if(normal_order)
+				i++;
+			else
+				i--;
+		}
+		
+		//end=infos["full_text"].indexOf("}", start);
+		if(end==-1)
+			return false;	
+		var endLastLine=infos["full_text"].substr(0, end).lastIndexOf("\n");			
+		if(endLastLine==-1)
+			line=1;
+		else
+			line= infos["full_text"].substr(0, endLastLine).split("\n").length + 1;
+					
+		var curPos= end - endLastLine - 1;
+		var endLineLength	= infos["full_text"].substring(end).split("\n")[0].length;
+		this.displayToCursorPosition("end_bracket", line, curPos, infos["full_text"].substring(endLastLine +1, end + endLineLength));
+		return true;
+	};
+	
+	EditArea.prototype.displayToCursorPosition= function(id, start_line, cur_pos, lineContent, no_real_move){
+		var elem,dest,content,posLeft=0,posTop,fixPadding,topOffset,endElem;	
+
+		elem		= this.test_font_size;
+		dest		= _$(id);
+		content		= "<span id='test_font_size_inner'>"+lineContent.substr(0, cur_pos).replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</span><span id='endTestFont'>"+lineContent.substr(cur_pos).replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</span>";
+		if( this.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
+			elem.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
+		} else {
+			elem.innerHTML= content;
+		}
+		
+
+		endElem		= _$('endTestFont');
+		topOffset	= endElem.offsetTop;
+		fixPadding	= parseInt( this.content_highlight.style.paddingLeft.replace("px", "") );
+		posLeft 	= 45 + endElem.offsetLeft + ( !isNaN( fixPadding ) && topOffset > 0 ? fixPadding : 0 );
+		posTop		= this.getLinePosTop( start_line ) + topOffset;// + Math.floor( ( endElem.offsetHeight - 1 ) / this.lineHeight ) * this.lineHeight;
+	
+		// detect the case where the span start on a line but has no display on it
+		if( this.isIE && cur_pos > 0 && endElem.offsetLeft == 0 )
+		{
+			posTop	+=	this.lineHeight;
+		}
+		if(no_real_move!=true){	// when the cursor is hidden no need to move him
+			dest.style.top=posTop+"px";
+			dest.style.left=posLeft+"px";	
+		}
+		// usefull for smarter scroll
+		dest.cursor_top=posTop;
+		dest.cursor_left=posLeft;	
+	//	_$(id).style.marginLeft=posLeft+"px";
+	};
+	
+	EditArea.prototype.getLinePosTop= function(start_line){
+		var elem= _$('line_'+ start_line), posTop=0;
+		if( elem )
+			posTop	= elem.offsetTop;
+		else
+			posTop	= this.lineHeight * (start_line-1);
+		return posTop;
+	};
+	
+	
+	// return the dislpayed height of a text (take word-wrap into account)
+	EditArea.prototype.getTextHeight= function(text){
+		var t=this,elem,height;
+		elem		= t.test_font_size;
+		content		= text.replace(/&/g,"&amp;").replace(/</g,"&lt;");
+		if( t.isIE || ( this.isOpera && this.isOpera < 9.6 ) ) {
+			elem.innerHTML= "<pre>" + content.replace(/^\r?\n/, "<br>") + "</pre>";
+		} else {
+			elem.innerHTML= content;
+		}
+		height	= elem.offsetHeight;
+		height	= Math.max( 1, Math.floor( elem.offsetHeight / this.lineHeight ) ) * this.lineHeight;
+		return height;
+	};
+
+	/**
+	 * Fix line height for the given lines
+	 * @param Integer linestart
+	 * @param Integer lineEnd End line or -1 to cover all lines
+	 */
+	EditArea.prototype.fixLinesHeight= function( textValue, lineStart,lineEnd ){
+		var aText = textValue.split("\n");
+		if( lineEnd == -1 )
+			lineEnd	= aText.length-1;
+		for( var i = Math.max(0, lineStart); i <= lineEnd; i++ )
+		{
+			if( elem = _$('line_'+ ( i+1 ) ) )
+			{
+				elem.style.height= typeof( aText[i] ) != "undefined" ? this.getTextHeight( aText[i] )+"px" : this.lineHeight;
+			}
+		}
+	};
+	
+	EditArea.prototype.area_select= function(start, length){
+		this.textarea.focus();
+		
+		start	= Math.max(0, Math.min(this.textarea.value.length, start));
+		end		= Math.max(start, Math.min(this.textarea.value.length, start+length));
+
+		if(this.isIE)
+		{
+			this.textarea.selectionStart	= start;
+			this.textarea.selectionEnd		= end;		
+			this.setIESelection();
+		}
+		else
+		{
+			// Opera bug when moving selection start and selection end
+			if(this.isOpera && this.isOpera < 9.6 )
+			{	
+				this.textarea.setSelectionRange(0, 0);
+			}
+			this.textarea.setSelectionRange(start, end);
+		}
+		this.check_line_selection();
+	};
+	
+	
+	EditArea.prototype.area_get_selection= function(){
+		var text="";
+		if( document.selection ){
+			var range = document.selection.createRange();
+			text=range.text;
+		}else{
+			text= this.textarea.value.substring(this.textarea.selectionStart, this.textarea.selectionEnd);
+		}
+		return text;			
+	};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax.js
new file mode 100644
index 0000000..11518cc
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax.js
@@ -0,0 +1,166 @@
+	EditAreaLoader.prototype.get_regexp= function(text_array){
+		//res="( |=|\\n|\\r|\\[|\\(|µ|)(";
+		res="(\\b)(";
+		for(i=0; i<text_array.length; i++){
+			if(i>0)
+				res+="|";
+			//res+="("+ tab_text[i] +")";
+			//res+=tab_text[i].replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\{|\})/g, "\\$1");
+			res+=this.get_escaped_regexp(text_array[i]);
+		}
+		//res+=")( |\\.|:|\\{|\\(|\\)|\\[|\\]|\'|\"|\\r|\\n|\\t|$)";
+		res+=")(\\b)";
+		reg= new RegExp(res);
+		
+		return res;
+	};
+	
+	
+	EditAreaLoader.prototype.get_escaped_regexp= function(str){
+		return str.toString().replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g, "\\$1");
+	};
+	
+	EditAreaLoader.prototype.init_syntax_regexp= function(){
+		var lang_style= {};	
+		for(var lang in this.load_syntax){
+			if(!this.syntax[lang])	// init the regexp if not already initialized
+			{
+				this.syntax[lang]= {};
+				this.syntax[lang]["keywords_reg_exp"]= {};
+				this.keywords_reg_exp_nb=0;
+			
+				if(this.load_syntax[lang]['KEYWORDS']){
+					param="g";
+					if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)
+						param+="i";
+					for(var i in this.load_syntax[lang]['KEYWORDS']){
+						if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function") continue;
+						this.syntax[lang]["keywords_reg_exp"][i]= new RegExp(this.get_regexp( this.load_syntax[lang]['KEYWORDS'][i] ), param);
+						this.keywords_reg_exp_nb++;
+					}
+				}
+				
+				if(this.load_syntax[lang]['OPERATORS']){
+					var str="";
+					var nb=0;
+					for(var i in this.load_syntax[lang]['OPERATORS']){
+						if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function") continue;
+						if(nb>0)
+							str+="|";				
+						str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);
+						nb++;
+					}
+					if(str.length>0)
+						this.syntax[lang]["operators_reg_exp"]= new RegExp("("+str+")","g");
+				}
+				
+				if(this.load_syntax[lang]['DELIMITERS']){
+					var str="";
+					var nb=0;
+					for(var i in this.load_syntax[lang]['DELIMITERS']){
+						if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function") continue;
+						if(nb>0)
+							str+="|";
+						str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);
+						nb++;
+					}
+					if(str.length>0)
+						this.syntax[lang]["delimiters_reg_exp"]= new RegExp("("+str+")","g");
+				}
+				
+				
+		//		/(("(\\"|[^"])*"?)|('(\\'|[^'])*'?)|(//(.|\r|\t)*\n)|(/\*(.|\n|\r|\t)*\*/)|(<!--(.|\n|\r|\t)*-->))/gi
+				var syntax_trace=[];
+				
+		//		/("(?:[^"\\]*(\\\\)*(\\"?)?)*("|$))/g
+				
+				this.syntax[lang]["quotes"]={};
+				var quote_tab= [];
+				if(this.load_syntax[lang]['QUOTEMARKS']){
+					for(var i in this.load_syntax[lang]['QUOTEMARKS']){	
+						if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function") continue;			
+						var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);
+						this.syntax[lang]["quotes"][x]=x;
+						//quote_tab[quote_tab.length]="("+x+"(?:\\\\"+x+"|[^"+x+"])*("+x+"|$))";
+						//previous working : quote_tab[quote_tab.length]="("+x+"(?:[^"+x+"\\\\]*(\\\\\\\\)*(\\\\"+x+"?)?)*("+x+"|$))";
+						quote_tab[quote_tab.length]="("+ x +"(\\\\.|[^"+ x +"])*(?:"+ x +"|$))";
+						
+						syntax_trace.push(x);			
+					}			
+				}
+						
+				this.syntax[lang]["comments"]={};
+				if(this.load_syntax[lang]['COMMENT_SINGLE']){
+					for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){	
+						if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function") continue;						
+						var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);
+						quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";
+						syntax_trace.push(x);
+						this.syntax[lang]["comments"][x]="\n";
+					}			
+				}		
+				// (/\*(.|[\r\n])*?\*/)
+				if(this.load_syntax[lang]['COMMENT_MULTI']){
+					for(var i in this.load_syntax[lang]['COMMENT_MULTI']){
+						if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function") continue;							
+						var start=this.get_escaped_regexp(i);
+						var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);
+						quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";
+						syntax_trace.push(start);
+						syntax_trace.push(end);
+						this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];
+					}			
+				}		
+				if(quote_tab.length>0)
+					this.syntax[lang]["comment_or_quote_reg_exp"]= new RegExp("("+quote_tab.join("|")+")","gi");
+				
+				if(syntax_trace.length>0) //   /((.|\n)*?)(\\*("|'|\/\*|\*\/|\/\/|$))/g
+					this.syntax[lang]["syntax_trace_regexp"]= new RegExp("((.|\n)*?)(\\\\*("+ syntax_trace.join("|") +"|$))", "gmi");
+				
+				if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){
+					this.syntax[lang]["script_delimiters"]= {};
+					for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){
+						if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function") continue;							
+						this.syntax[lang]["script_delimiters"][i]= this.load_syntax[lang]['SCRIPT_DELIMITERS'];
+					}			
+				}
+				
+				this.syntax[lang]["custom_regexp"]= {};
+				if(this.load_syntax[lang]['REGEXPS']){
+					for(var i in this.load_syntax[lang]['REGEXPS']){
+						if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function") continue;
+						var val= this.load_syntax[lang]['REGEXPS'][i];
+						if(!this.syntax[lang]["custom_regexp"][val['execute']])
+							this.syntax[lang]["custom_regexp"][val['execute']]= {};
+						this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp' : new RegExp(val['search'], val['modifiers'])
+																			, 'class' : val['class']};
+					}
+				}
+				
+				if(this.load_syntax[lang]['STYLES']){							
+					lang_style[lang]= {};
+					for(var i in this.load_syntax[lang]['STYLES']){
+						if(typeof(this.load_syntax[lang]['STYLES'][i])=="function") continue;
+						if(typeof(this.load_syntax[lang]['STYLES'][i]) != "string"){
+							for(var j in this.load_syntax[lang]['STYLES'][i]){							
+								lang_style[lang][j]= this.load_syntax[lang]['STYLES'][i][j];
+							}
+						}else{
+							lang_style[lang][i]= this.load_syntax[lang]['STYLES'][i];
+						}
+					}
+				}
+				// build style string
+				var style="";		
+				for(var i in lang_style[lang]){
+					if(lang_style[lang][i].length>0){
+						style+= "."+ lang +" ."+ i.toLowerCase() +" span{"+lang_style[lang][i]+"}\n";
+						style+= "."+ lang +" ."+ i.toLowerCase() +"{"+lang_style[lang][i]+"}\n";				
+					}
+				}
+				this.syntax[lang]["styles"]=style;
+			}
+		}				
+	};
+	
+	editAreaLoader.waiting_loading["reg_syntax.js"]= "loaded";

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/basic.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/basic.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/basic.js
new file mode 100644
index 0000000..93b578d
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/basic.js
@@ -0,0 +1,69 @@
+editAreaLoader.load_syntax["basic"] = {
+	'COMMENT_SINGLE' : {1 : "'", 2 : 'rem'}
+	,'COMMENT_MULTI' : { }
+	,'QUOTEMARKS' : {1: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+		'statements' : [
+			'if','then','for','wend','while',
+			'else','elseif','select','case','end select',
+			'until','next','step','to','end if', 'call'
+		]
+		,'keywords' : [
+			'sub', 'end sub', 'function', 'end function', 'exit',
+			'exit function', 'dim', 'redim', 'shared', 'const',
+			'is', 'absolute', 'access', 'any', 'append', 'as',
+			'base', 'beep', 'binary', 'bload', 'bsave', 'chain',
+			'chdir', 'circle', 'clear', 'close', 'cls', 'color',
+			'com', 'common', 'data', 'date', 'declare', 'def',
+			'defdbl', 'defint', 'deflng', 'defsng', 'defstr',
+			'double', 'draw', 'environ', 'erase', 'error', 'field',
+			'files', 'fn', 'get', 'gosub', 'goto', 'integer', 'key',
+			'kill', 'let', 'line', 'list', 'locate', 'lock', 'long',
+			'lprint', 'lset', 'mkdir', 'name', 'off', 'on', 'open',
+			'option', 'out', 'output', 'paint', 'palette', 'pcopy',
+			'poke', 'preset', 'print', 'pset', 'put', 'random',
+			'randomize', 'read', 'reset', 'restore', 'resume',
+			'return', 'rmdir', 'rset', 'run', 'screen', 'seg',
+			'shell', 'single', 'sleep', 'sound', 'static', 'stop',
+			'strig', 'string', 'swap', 'system', 'time', 'timer',
+			'troff', 'tron', 'type', 'unlock', 'using', 'view',
+			'wait', 'width', 'window', 'write'
+	        ]
+		,'functions' : [
+			'abs', 'asc', 'atn', 'cdbl', 'chr', 'cint', 'clng',
+			'cos', 'csng', 'csrlin', 'cvd', 'cvdmbf', 'cvi', 'cvl',
+			'cvs', 'cvsmbf', 'eof', 'erdev', 'erl', 'err', 'exp',
+			'fileattr', 'fix', 'fre', 'freefile', 'hex', 'inkey',
+			'inp', 'input', 'instr', 'int', 'ioctl', 'lbound',
+			'lcase', 'left', 'len', 'loc', 'lof', 'log', 'lpos',
+			'ltrim', 'mid', 'mkd', 'mkdmbf', 'mki', 'mkl', 'mks',
+			'mksmbf', 'oct', 'peek', 'pen', 'play', 'pmap', 'point',
+			'pos', 'right', 'rnd', 'rtrim', 'seek', 'sgn', 'sin',
+			'space', 'spc', 'sqr', 'stick', 'str', 'tab', 'tan',
+			'ubound', 'ucase', 'val', 'varptr', 'varseg'
+		]
+		,'operators' : [
+			'and', 'eqv', 'imp', 'mod', 'not', 'or', 'xor'
+		]
+	}
+	,'OPERATORS' :[
+		'+', '-', '/', '*', '=', '<', '>', '!', '&'
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'STYLES' : {
+		'COMMENTS': 'color: #99CC00;'
+		,'QUOTESMARKS': 'color: #333399;'
+		,'KEYWORDS' : {
+			'keywords' : 'color: #3366FF;'
+			,'functions' : 'color: #0000FF;'
+			,'statements' : 'color: #3366FF;'
+			,'operators' : 'color: #FF0000;'
+			}
+		,'OPERATORS' : 'color: #FF0000;'
+		,'DELIMITERS' : 'color: #0000FF;'
+
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/brainfuck.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/brainfuck.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/brainfuck.js
new file mode 100644
index 0000000..810c3d6
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/brainfuck.js
@@ -0,0 +1,44 @@
+editAreaLoader.load_syntax["brainfuck"] = {
+	'COMMENT_SINGLE' : {}
+	,'COMMENT_MULTI' : {}
+	,'QUOTEMARKS' : {}
+	,'KEYWORD_CASE_SENSITIVE' : true
+	,'OPERATORS' :[
+		'+', '-'
+	]
+	,'DELIMITERS' :[
+		'[', ']'
+	]
+	,'REGEXPS' : {
+		'bfispis' : {
+			'search' : '()(\\.)()'
+			,'class' : 'bfispis'
+			,'modifiers' : 'g'
+			,'execute' : 'before'
+		}
+		,'bfupis' : {
+			'search' : '()(\\,)()'
+			,'class' : 'bfupis'
+			,'modifiers' : 'g'
+			,'execute' : 'before'
+		}
+		,'bfmemory' : {
+			'search' : '()([<>])()'
+			,'class' : 'bfmemory'
+			,'modifiers' : 'g'
+			,'execute' : 'before'
+		}
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'OPERATORS' : 'color: #88AA00;'
+		,'DELIMITERS' : 'color: #00C138;'
+		,'REGEXPS' : {
+			'bfispis' : 'color: #EE0000;'
+			,'bfupis' : 'color: #4455ee;'
+			,'bfmemory' : 'color: #DD00DD;'
+		}
+	}
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/c.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/c.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/c.js
new file mode 100644
index 0000000..31667a0
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/c.js
@@ -0,0 +1,62 @@
+editAreaLoader.load_syntax["c"] = {
+	'COMMENT_SINGLE' : {1 : '//'}
+	,'COMMENT_MULTI' : {'/*' : '*/'}
+	,'QUOTEMARKS' : {1: "'", 2: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : true
+	,'KEYWORDS' : {
+		'constants' : [
+			'NULL', 'false', 'stdin', 'stdout', 'stderr', 'true'
+		]
+		,'types' : [
+			'FILE', 'auto', 'char', 'const', 'double',
+			'extern', 'float', 'inline', 'int', 'long', 'register',
+			'short', 'signed', 'size_t', 'static', 'struct',
+			'time_t', 'typedef', 'union', 'unsigned', 'void',
+			'volatile'
+		]
+		,'statements' : [
+			'do', 'else', 'enum', 'for', 'goto', 'if', 'sizeof',
+			'switch', 'while'
+		]
+ 		,'keywords' : [
+			'break', 'case', 'continue', 'default', 'delete',
+			'return'
+		]
+	}
+	,'OPERATORS' :[
+		'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'REGEXPS' : {
+		'precompiler' : {
+			'search' : '()(#[^\r\n]*)()'
+			,'class' : 'precompiler'
+			,'modifiers' : 'g'
+			,'execute' : 'before'
+		}
+/*		,'precompilerstring' : {
+			'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
+			,'class' : 'precompilerstring'
+			,'modifiers' : 'g'
+			,'execute' : 'before'
+		}*/
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'KEYWORDS' : {
+			'constants' : 'color: #EE0000;'
+			,'types' : 'color: #0000EE;'
+			,'statements' : 'color: #60CA00;'
+			,'keywords' : 'color: #48BDDF;'
+		}
+		,'OPERATORS' : 'color: #FF00FF;'
+		,'DELIMITERS' : 'color: #0038E1;'
+		,'REGEXPS' : {
+			'precompiler' : 'color: #009900;'
+			,'precompilerstring' : 'color: #994400;'
+		}
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/coldfusion.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/coldfusion.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/coldfusion.js
new file mode 100644
index 0000000..673e874
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/coldfusion.js
@@ -0,0 +1,119 @@
+editAreaLoader.load_syntax["coldfusion"] = {
+	'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
+	,'COMMENT_MULTI' : {'<!--' : '-->'}
+	,'COMMENT_MULTI2' : {'<!---' : '--->'}
+	,'QUOTEMARKS' : {1: "'", 2: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : false
+		,'KEYWORDS' : {
+		'statements' : [
+			'include', 'require', 'include_once', 'require_once',
+			'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
+            'endif', 'switch', 'case', 'endswitch',
+			'return', 'break', 'continue'
+		]
+		,'reserved' : [
+			'AND', 'break', 'case', 'CONTAIN', 'CONTAINS', 'continue', 'default', 'do', 
+			'DOES', 'else', 'EQ', 'EQUAL', 'EQUALTO', 'EQV', 'FALSE', 'for', 'GE', 
+			'GREATER', 'GT', 'GTE', 'if', 'IMP', 'in', 'IS', 'LE', 'LESS', 'LT', 'LTE', 
+			'MOD', 'NEQ', 'NOT', 'OR', 'return', 'switch', 'THAN', 'TO', 'TRUE', 'var', 
+			'while', 'XOR'
+		]
+		,'functions' : [
+			'Abs', 'ACos', 'ArrayAppend', 'ArrayAvg', 'ArrayClear', 'ArrayDeleteAt', 'ArrayInsertAt', 
+			'ArrayIsEmpty', 'ArrayLen', 'ArrayMax', 'ArrayMin', 'ArrayNew', 'ArrayPrepend', 'ArrayResize', 
+			'ArraySet', 'ArraySort', 'ArraySum', 'ArraySwap', 'ArrayToList', 'Asc', 'ASin', 'Atn', 'AuthenticatedContext', 
+			'AuthenticatedUser', 'BitAnd', 'BitMaskClear', 'BitMaskRead', 'BitMaskSet', 'BitNot', 'BitOr', 
+			'BitSHLN', 'BitSHRN', 'BitXor', 'Ceiling', 'Chr', 'CJustify', 'Compare', 'CompareNoCase', 'Cos', 
+			'CreateDate', 'CreateDateTime', 'CreateODBCDate', 'CreateODBCDateTime', 'CreateODBCTime', 
+			'CreateTime', 'CreateTimeSpan', 'DateAdd', 'DateCompare', 'DateConvert', 'DateDiff', 
+			'DateFormat', 'DatePart', 'Day', 'DayOfWeek', 'DayOfWeekAsString', 'DayOfYear', 'DaysInMonth', 
+			'DaysInYear', 'DE', 'DecimalFormat', 'DecrementValue', 'Decrypt', 'DeleteClientVariable', 
+			'DirectoryExists', 'DollarFormat', 'Duplicate', 'Encrypt', 'Evaluate', 'Exp', 'ExpandPath', 
+			'FileExists', 'Find', 'FindNoCase', 'FindOneOf', 'FirstDayOfMonth', 'Fix', 'FormatBaseN', 
+			'GetBaseTagData', 'GetBaseTagList', 'GetBaseTemplatePath', 'GetClientVariablesList', 
+			'GetCurrentTemplatePath', 'GetDirectoryFromPath', 'GetException', 'GetFileFromPath', 
+			'GetFunctionList', 'GetHttpTimeString', 'GetHttpRequestData', 'GetLocale', 'GetMetricData', 
+			'GetProfileString', 'GetTempDirectory', 'GetTempFile', 'GetTemplatePath', 'GetTickCount', 
+			'GetTimeZoneInfo', 'GetToken', 'Hash', 'Hour', 'HTMLCodeFormat', 'HTMLEditFormat', 'IIf', 
+			'IncrementValue', 'InputBaseN', 'Insert', 'Int', 'IsArray', 'IsAuthenticated', 'IsAuthorized', 
+			'IsBoolean', 'IsBinary', 'IsCustomFunction', 'IsDate', 'IsDebugMode', 'IsDefined', 'IsLeapYear', 
+			'IsNumeric', 'IsNumericDate', 'IsProtected', 'IsQuery', 'IsSimpleValue', 'IsStruct', 'IsWDDX', 
+			'JavaCast', 'JSStringFormat', 'LCase', 'Left', 'Len', 'ListAppend', 'ListChangeDelims', 
+			'ListContains', 'ListContainsNoCase', 'ListDeleteAt', 'ListFind', 'ListFindNoCase', 'ListFirst', 
+			'ListGetAt', 'ListInsertAt', 'ListLast', 'ListLen', 'ListPrepend', 'ListQualify', 'ListRest', 
+			'ListSetAt', 'ListSort', 'ListToArray', 'ListValueCount', 'ListValueCountNoCase', 'LJustify', 
+			'Log', 'Log10', 'LSCurrencyFormat', 'LSDateFormat', 'LSEuroCurrencyFormat', 'LSIsCurrency', 
+			'LSIsDate', 'LSIsNumeric', 'LSNumberFormat', 'LSParseCurrency', 'LSParseDateTime', 'LSParseNumber', 
+			'LSTimeFormat', 'LTrim', 'Max', 'Mid', 'Min', 'Minute', 'Month', 'MonthAsString', 'Now', 'NumberFormat', 
+			'ParagraphFormat', 'ParameterExists', 'ParseDateTime', 'Pi', 'PreserveSingleQuotes', 'Quarter', 
+			'QueryAddRow', 'QueryNew', 'QuerySetCell', 'QuotedValueList', 'Rand', 'Randomize', 'RandRange', 
+			'REFind', 'REFindNoCase', 'RemoveChars', 'RepeatString', 'Replace', 'ReplaceList', 'ReplaceNoCase', 
+			'REReplace', 'REReplaceNoCase', 'Reverse', 'Right', 'RJustify', 'Round', 'RTrim', 'Second', 'SetLocale', 
+			'SetProfileString', 'SetVariable', 'Sgn', 'Sin', 'SpanExcluding', 'SpanIncluding', 'Sqr', 'StripCR', 
+			'StructAppend', 'StructClear', 'StructCopy', 'StructCount', 'StructDelete', 'StructFind', 'StructFindKey', 
+			'StructFindValue', 'StructGet', 'StructInsert', 'StructIsEmpty', 'StructKeyArray', 'StructKeyExists', 
+			'StructKeyList', 'StructNew', 'StructSort', 'StructUpdate', 'Tan', 'TimeFormat', 'ToBase64', 'ToBinary', 
+			'ToString', 'Trim', 'UCase', 'URLDecode', 'URLEncodedFormat', 'Val', 'ValueList', 'Week', 'WriteOutput', 
+			'XMLFormat', 'Year', 'YesNoFormat'
+		]
+	}
+	,'OPERATORS' :[
+		'+', '-', '/', '*', '%', '!', '&&', '||'
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'REGEXPS' : {
+		'doctype' : {
+			'search' : '()(<!DOCTYPE[^>]*>)()'
+			,'class' : 'doctype'
+			,'modifiers' : ''
+			,'execute' : 'before' // before or after
+		}
+		,'cftags' : {
+			'search' : '(<)(/cf[a-z][^ \r\n\t>]*)([^>]*>)'
+			,'class' : 'cftags'
+			,'modifiers' : 'gi'
+			,'execute' : 'before' // before or after
+		}
+		,'cftags2' : {
+			'search' : '(<)(cf[a-z][^ \r\n\t>]*)([^>]*>)'
+			,'class' : 'cftags2'
+			,'modifiers' : 'gi'
+			,'execute' : 'before' // before or after
+		}
+		,'tags' : {
+			'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
+			,'class' : 'tags'
+			,'modifiers' : 'gi'
+			,'execute' : 'before' // before or after
+		}
+		,'attributes' : {
+			'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
+			,'class' : 'attributes'
+			,'modifiers' : 'g'
+			,'execute' : 'before' // before or after
+		}
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'KEYWORDS' : {
+			'reserved' : 'color: #48BDDF;'
+			,'functions' : 'color: #0000FF;'
+			,'statements' : 'color: #60CA00;'
+			}
+		,'OPERATORS' : 'color: #E775F0;'
+		,'DELIMITERS' : ''
+		,'REGEXPS' : {
+			'attributes': 'color: #990033;'
+			,'cftags': 'color: #990033;'
+			,'cftags2': 'color: #990033;'
+			,'tags': 'color: #000099;'
+			,'doctype': 'color: #8DCFB5;'
+			,'test': 'color: #00FF00;'
+		}	
+	}		
+};
+
+ 	  	 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/cpp.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/cpp.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/cpp.js
new file mode 100644
index 0000000..74826d3
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/cpp.js
@@ -0,0 +1,65 @@
+editAreaLoader.load_syntax["cpp"] = {
+	'COMMENT_SINGLE' : {1 : '//'}
+	,'COMMENT_MULTI' : {'/*' : '*/'}
+	,'QUOTEMARKS' : {1: "'", 2: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : true
+	,'KEYWORDS' : {
+		'constants' : [
+			'NULL', 'false', 'std', 'stdin', 'stdout', 'stderr',
+			'true'
+		]
+		,'types' : [
+			'FILE', 'auto', 'char', 'class', 'const', 'double',
+			'extern', 'float', 'friend', 'inline', 'int',
+			'iterator', 'long', 'map', 'operator', 'queue',
+			'register', 'short', 'signed', 'size_t', 'stack',
+			'static', 'string', 'struct', 'time_t', 'typedef',
+			'union', 'unsigned', 'vector', 'void', 'volatile'
+		]
+		,'statements' : [
+			'catch', 'do', 'else', 'enum', 'for', 'goto', 'if',
+			'sizeof', 'switch', 'this', 'throw', 'try', 'while'
+		]
+ 		,'keywords' : [
+			'break', 'case', 'continue', 'default', 'delete',
+			'namespace', 'new', 'private', 'protected', 'public',
+			'return', 'using'
+		]
+	}
+	,'OPERATORS' :[
+		'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'REGEXPS' : {
+		'precompiler' : {
+			'search' : '()(#[^\r\n]*)()'
+			,'class' : 'precompiler'
+			,'modifiers' : 'g'
+			,'execute' : 'before'
+		}
+/*		,'precompilerstring' : {
+			'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
+			,'class' : 'precompilerstring'
+			,'modifiers' : 'g'
+			,'execute' : 'before'
+		}*/
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'KEYWORDS' : {
+			'constants' : 'color: #EE0000;'
+			,'types' : 'color: #0000EE;'
+			,'statements' : 'color: #60CA00;'
+			,'keywords' : 'color: #48BDDF;'
+		}
+		,'OPERATORS' : 'color: #FF00FF;'
+		,'DELIMITERS' : 'color: #0038E1;'
+		,'REGEXPS' : {
+			'precompiler' : 'color: #009900;'
+			,'precompilerstring' : 'color: #994400;'
+		}
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/css.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/css.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/css.js
new file mode 100644
index 0000000..8dded1b
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/css.js
@@ -0,0 +1,84 @@
+editAreaLoader.load_syntax["css"] = {
+	'COMMENT_SINGLE' : {1 : '@'}
+	,'COMMENT_MULTI' : {'/*' : '*/'}
+	,'QUOTEMARKS' : ['"', "'"]
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+		'attributes' : [
+			'aqua', 'azimuth', 'background-attachment', 'background-color',
+			'background-image', 'background-position', 'background-repeat',
+			'background', 'border-bottom-color', 'border-bottom-style',
+			'border-bottom-width', 'border-left-color', 'border-left-style',
+			'border-left-width', 'border-right', 'border-right-color',
+			'border-right-style', 'border-right-width', 'border-top-color',
+			'border-top-style', 'border-top-width','border-bottom', 'border-collapse',
+			'border-left', 'border-width', 'border-color', 'border-spacing',
+			'border-style', 'border-top', 'border',  'caption-side',
+			'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
+			'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
+			'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
+			'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
+			'font-weight', 'font', 'height', 'letter-spacing', 'line-height',
+			'list-style', 'list-style-image', 'list-style-position', 'list-style-type',
+			'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin',
+			'marker-offset', 'marks', 'max-height', 'max-width', 'min-height',
+			'min-width', 'opacity', 'orphans', 'outline', 'outline-color', 'outline-style',
+			'outline-width', 'overflow', 'padding-bottom', 'padding-left',
+			'padding-right', 'padding-top', 'padding', 'page', 'page-break-after',
+			'page-break-before', 'page-break-inside', 'pause-after', 'pause-before',
+			'pause', 'pitch', 'pitch-range',  'play-during', 'position', 'quotes',
+			'richness', 'right', 'size', 'speak-header', 'speak-numeral', 'speak-punctuation',
+			'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration',
+			'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
+			'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows',
+			'width', 'word-spacing', 'z-index', 'bottom', 'left'
+		]
+		,'values' : [
+			'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid',
+			'baseline', 'behind', 'below', 'bidi-override', 'black', 'blue', 'blink', 'block', 'bold', 'bolder', 'both',
+			'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic', 
+            'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive',
+			'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
+			'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded',
+			'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia',
+			'georgian', 'gray', 'green', 'groove', 'hebrew', 'help', 'hidden', 'hide', 'higher',
+			'high', 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table', 'inline',
+			'inset', 'inside', 'invert', 'italic', 'justify', 'katakana-iroha', 'katakana',
+			'landscape', 'larger', 'large', 'left-side', 'leftwards', 'level', 'lighter', 'lime', 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek', 'lower-roman', 'lowercase', 'ltr', 'lower', 'low',
+			'maroon', 'medium', 'message-box', 'middle', 'mix', 'monospace',
+			'n-resize', 'narrower', 'navy', 'ne-resize', 'no-close-quote', 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap', 'nw-resize',
+			'oblique', 'olive', 'once', 'open-quote', 'outset', 'outside', 'overline',
+			'pointer', 'portrait', 'purple', 'px',
+			'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb', 'ridge', 'right-side', 'rightwards',
+			's-resize', 'sans-serif', 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded', 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower', 'small-caps', 'small-caption', 'smaller', 'soft', 'solid', 'spell-out', 'square',
+			'static', 'status-bar', 'super', 'sw-resize',
+			'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom', 'text-top', 'thick', 'thin', 'transparent',
+			'ultra-condensed', 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin', 'upper-roman', 'uppercase', 'url',
+			'visible',
+			'w-resize', 'wait', 'white', 'wider',
+			'x-fast', 'x-high', 'x-large', 'x-loud', 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small',
+			'yellow', 'yes'
+		]
+		,'specials' : [
+			'important'
+		]
+	}
+	,'OPERATORS' :[
+		':', ';', '!', '.', '#'
+	]
+	,'DELIMITERS' :[
+		'{', '}'
+	]
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'KEYWORDS' : {
+			'attributes' : 'color: #48BDDF;'
+			,'values' : 'color: #2B60FF;'
+			,'specials' : 'color: #FF0000;'
+			}
+		,'OPERATORS' : 'color: #FF00FF;'
+		,'DELIMITERS' : 'color: #60CA00;'
+				
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/html.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/html.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/html.js
new file mode 100644
index 0000000..d508364
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/html.js
@@ -0,0 +1,50 @@
+/*
+* last update: 2006-08-24
+*/
+
+editAreaLoader.load_syntax["html"] = {
+	'COMMENT_SINGLE' : {}
+	,'COMMENT_MULTI' : {'<!--' : '-->'}
+	,'QUOTEMARKS' : {1: "'", 2: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+	}
+	,'OPERATORS' :[
+	]
+	,'DELIMITERS' :[
+	]
+	,'REGEXPS' : {
+		'doctype' : {
+			'search' : '()(<!DOCTYPE[^>]*>)()'
+			,'class' : 'doctype'
+			,'modifiers' : ''
+			,'execute' : 'before' // before or after
+		}
+		,'tags' : {
+			'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
+			,'class' : 'tags'
+			,'modifiers' : 'gi'
+			,'execute' : 'before' // before or after
+		}
+		,'attributes' : {
+			'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
+			,'class' : 'attributes'
+			,'modifiers' : 'g'
+			,'execute' : 'before' // before or after
+		}
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'KEYWORDS' : {
+			}
+		,'OPERATORS' : 'color: #E775F0;'
+		,'DELIMITERS' : ''
+		,'REGEXPS' : {
+			'attributes': 'color: #B1AC41;'
+			,'tags': 'color: #E62253;'
+			,'doctype': 'color: #8DCFB5;'
+			,'test': 'color: #00FF00;'
+		}	
+	}		
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/java.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/java.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/java.js
new file mode 100644
index 0000000..bf48b53
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/java.js
@@ -0,0 +1,56 @@
+editAreaLoader.load_syntax["java"] = {
+'COMMENT_SINGLE': { 1: '//', 2: '@' }
+	, 'COMMENT_MULTI': { '/*': '*/' }
+	, 'QUOTEMARKS': { 1: "'", 2: '"' }
+	, 'KEYWORD_CASE_SENSITIVE': true
+	, 'KEYWORDS': {
+	    'constants': [
+			'null', 'false', 'true'
+		]
+		, 'types': [
+			'String', 'int', 'short', 'long', 'char', 'double', 'byte',
+			'float', 'static', 'void', 'private', 'boolean', 'protected',
+			'public', 'const', 'class', 'final', 'abstract', 'volatile',
+			'enum', 'transient', 'interface'
+		]
+		, 'statements': [
+            'this', 'extends', 'if', 'do', 'while', 'try', 'catch', 'finally',
+            'throw', 'throws', 'else', 'for', 'switch', 'continue', 'implements',
+            'break', 'case', 'default', 'goto'
+		]
+ 		, 'keywords': [
+           'new', 'return', 'import', 'native', 'super', 'package', 'assert', 'synchronized',
+           'instanceof', 'strictfp'
+		]
+	}
+	, 'OPERATORS': [
+		'+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
+	]
+	, 'DELIMITERS': [
+		'(', ')', '[', ']', '{', '}'
+	]
+	, 'REGEXPS': {
+	    'precompiler': {
+	        'search': '()(#[^\r\n]*)()'
+			, 'class': 'precompiler'
+			, 'modifiers': 'g'
+			, 'execute': 'before'
+	    }
+	}
+	, 'STYLES': {
+	    'COMMENTS': 'color: #AAAAAA;'
+		, 'QUOTESMARKS': 'color: #6381F8;'
+		, 'KEYWORDS': {
+		    'constants': 'color: #EE0000;'
+			, 'types': 'color: #0000EE;'
+			, 'statements': 'color: #60CA00;'
+			, 'keywords': 'color: #48BDDF;'
+		}
+		, 'OPERATORS': 'color: #FF00FF;'
+		, 'DELIMITERS': 'color: #0038E1;'
+		, 'REGEXPS': {
+		    'precompiler': 'color: #009900;'
+			, 'precompilerstring': 'color: #994400;'
+		}
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/js.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/js.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/js.js
new file mode 100644
index 0000000..2799b70
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/js.js
@@ -0,0 +1,93 @@
+editAreaLoader.load_syntax["js"] = {
+	'COMMENT_SINGLE' : {1 : '//'}
+	,'COMMENT_MULTI' : {'/*' : '*/'}
+	,'QUOTEMARKS' : {1: "'", 2: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+		'statements' : [
+			'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
+			'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
+			'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
+			'while', 'write', 'with'
+		]
+ 		,'keywords' : [
+			'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
+			'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
+			'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',		
+			// the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
+			'Link ', 'outerHeight ', 'Anchor', 'FileUpload', 
+			'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self', 
+			'arguments', 'locationbar', 'pageXoffset', 'Form', 
+			'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status', 
+			'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy', 
+			'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden', 
+			'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents', 
+			'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text', 
+			'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity', 
+			'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed', 
+			'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents', 
+			'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus', 
+			'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document', 
+			'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window', 
+			'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'			
+		]
+    	,'functions' : [
+			// common functions for Window object
+			'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
+			'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
+			'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
+			'stop' 
+		]
+	}
+	,'OPERATORS' :[
+		'+', '-', '/', '*', '=', '<', '>', '%', '!'
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'KEYWORDS' : {
+			'statements' : 'color: #60CA00;'
+			,'keywords' : 'color: #48BDDF;'
+			,'functions' : 'color: #2B60FF;'
+		}
+		,'OPERATORS' : 'color: #FF00FF;'
+		,'DELIMITERS' : 'color: #0038E1;'
+				
+	}
+	,'AUTO_COMPLETION' :  {
+		"default": {	// the name of this definition group. It's posisble to have different rules inside the same definition file
+			"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^"	// \\s|\\.|
+						,"possible_words_letters": "[a-zA-Z0-9_]+"
+						,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
+						,"prefix_separator": "\\."
+					}
+			,"CASE_SENSITIVE": true
+			,"MAX_TEXT_LENGTH": 100		// the maximum length of the text being analyzed before the cursor position
+			,"KEYWORDS": {
+				'': [	// the prefix of thoses items
+						/**
+						 * 0 : the keyword the user is typing
+						 * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
+						 * 		If empty the keyword will be displayed
+						 * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
+						 */
+						 ['Array', '§()', '']
+			    		,['alert', '§({@})', 'alert(String message)']
+			    		,['document']
+			    		,['window']
+			    	]
+		    	,'window' : [
+			    		 ['location']
+			    		,['document']
+			    		,['scrollTo', 'scrollTo({@})', 'scrollTo(Int x,Int y)']
+					]
+		    	,'location' : [
+			    		 ['href']
+					]
+			}
+		}
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/pas.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/pas.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/pas.js
new file mode 100644
index 0000000..7c1bc3c
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/pas.js
@@ -0,0 +1,82 @@
+editAreaLoader.load_syntax["pas"] = {
+	'COMMENT_SINGLE' : {}
+	,'COMMENT_MULTI' : {'{' : '}', '(*':'*)'}
+	,'QUOTEMARKS' : {1: '"', 2: "'"}
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+		'constants' : [
+			'Blink', 'Black', 'Blue', 'Green', 'Cyan', 'Red',
+			'Magenta', 'Brown', 'LightGray', 'DarkGray',
+			'LightBlue', 'LightGreen', 'LightCyan', 'LightRed',
+			'LightMagenta', 'Yellow', 'White', 'MaxSIntValue',
+			'MaxUIntValue', 'maxint', 'maxLongint', 'maxSmallint',
+			'erroraddr', 'errorcode', 'LineEnding'
+		]
+		,'keywords' : [
+			'in', 'or', 'div', 'mod', 'and', 'shl', 'shr', 'xor',
+			'pow', 'is', 'not','Absolute', 'And_then', 'Array',
+			'Begin', 'Bindable', 'Case', 'Const', 'Do', 'Downto',
+			'Else', 'End', 'Export', 'File', 'For', 'Function',
+			'Goto', 'If', 'Import', 'Implementation', 'Inherited',
+			'Inline', 'Interface', 'Label', 'Module', 'Nil',
+			'Object', 'Of', 'Only', 'Operator', 'Or_else',
+			'Otherwise', 'Packed', 'Procedure', 'Program',
+			'Protected', 'Qualified', 'Record', 'Repeat',
+			'Restricted', 'Set', 'Then', 'To', 'Type', 'Unit',
+			'Until', 'Uses', 'Value', 'Var', 'Virtual', 'While',
+			'With'
+		]
+		,'functions' : [
+			'Abs', 'Addr', 'Append', 'Arctan', 'Assert', 'Assign',
+			'Assigned', 'BinStr', 'Blockread', 'Blockwrite',
+			'Break', 'Chdir', 'Chr', 'Close', 'CompareByte',
+			'CompareChar', 'CompareDWord', 'CompareWord', 'Concat',
+			'Continue', 'Copy', 'Cos', 'CSeg', 'Dec', 'Delete',
+			'Dispose', 'DSeg', 'Eof', 'Eoln', 'Erase', 'Exclude',
+			'Exit', 'Exp', 'Filepos', 'Filesize', 'FillByte',
+			'Fillchar', 'FillDWord', 'Fillword', 'Flush', 'Frac',
+			'Freemem', 'Getdir', 'Getmem', 'GetMemoryManager',
+			'Halt', 'HexStr', 'Hi', 'High', 'Inc', 'Include',
+			'IndexByte', 'IndexChar', 'IndexDWord', 'IndexWord',
+			'Insert', 'IsMemoryManagerSet', 'Int', 'IOresult',
+			'Length', 'Ln', 'Lo', 'LongJmp', 'Low', 'Lowercase',
+			'Mark', 'Maxavail', 'Memavail', 'Mkdir', 'Move',
+			'MoveChar0', 'New', 'Odd', 'OctStr', 'Ofs', 'Ord',
+			'Paramcount', 'Paramstr', 'Pi', 'Pos', 'Power', 'Pred',
+			'Ptr', 'Random', 'Randomize', 'Read', 'Readln',
+			'Real2Double', 'Release', 'Rename', 'Reset', 'Rewrite',
+			'Rmdir', 'Round', 'Runerror', 'Seek', 'SeekEof',
+			'SeekEoln', 'Seg', 'SetMemoryManager', 'SetJmp',
+			'SetLength', 'SetString', 'SetTextBuf', 'Sin', 'SizeOf',
+			'Sptr', 'Sqr', 'Sqrt', 'SSeg', 'Str', 'StringOfChar',
+			'Succ', 'Swap', 'Trunc', 'Truncate', 'Upcase', 'Val',
+			'Write', 'WriteLn'
+		]
+		,'types' : [
+			'Integer', 'Shortint', 'SmallInt', 'Longint',
+			'Longword', 'Int64', 'Byte', 'Word', 'Cardinal',
+			'QWord', 'Boolean', 'ByteBool', 'LongBool', 'Char',
+			'Real', 'Single', 'Double', 'Extended', 'Comp',
+			'String', 'ShortString', 'AnsiString', 'PChar'
+		]
+	}
+	,'OPERATORS' :[
+		'@', '*', '+', '-', '/', '^', ':=', '<', '=', '>'
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']'
+	]
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #6381F8;'
+		,'KEYWORDS' : {
+			'specials' : 'color: #EE0000;'
+			,'constants' : 'color: #654321;'
+			,'keywords' : 'color: #48BDDF;'
+			,'functions' : 'color: #449922;'
+			,'types' : 'color: #2B60FF;'
+			}
+		,'OPERATORS' : 'color: #FF00FF;'
+		,'DELIMITERS' : 'color: #60CA00;'
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/perl.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/perl.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/perl.js
new file mode 100644
index 0000000..b63e951
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/perl.js
@@ -0,0 +1,88 @@
+/***************************************************************************
+ * (c) 2008 - file created by Christoph Pinkel, MTC Infomedia OHG.
+ *
+ * You may choose any license of the current release or any future release
+ * of editarea to use, modify and/or redistribute this file.
+ *
+ * This language specification file supports for syntax checking on
+ * a large subset of Perl 5.x.
+ * The basic common syntax of Perl is fully supported, but as for
+ * the highlighting of built-in operations, it's mainly designed
+ * to support for hightlighting Perl code in a Safe environment (compartment)
+ * as used by CoMaNet for evaluation of administrative scripts. This Safe
+ * compartment basically allows for all of Opcode's :default operations,
+ * but little others. See http://perldoc.perl.org/Opcode.html to learn
+ * more.
+ ***************************************************************************/
+
+editAreaLoader.load_syntax["perl"] = {
+
+	'COMMENT_SINGLE' : {1 : '#'},
+	'QUOTEMARKS' : {1: "'", 2: '"'},
+	'KEYWORD_CASE_SENSITIVE' : true,
+	'KEYWORDS' :
+	{
+		'core' :
+			[ "if", "else", "elsif", "while", "for", "each", "foreach",
+				"next", "last", "goto", "exists", "delete", "undef",
+				"my", "our", "local", "use", "require", "package", "keys", "values",
+				"sub", "bless", "ref", "return" ],
+		'functions' :
+			[
+				//from :base_core
+				"int", "hex", "oct", "abs", "substr", "vec", "study", "pos",
+				"length", "index", "rindex", "ord", "chr", "ucfirst", "lcfirst",
+				"uc", "lc", "quotemeta", "chop", "chomp", "split", "list", "splice",
+				"push", "pop", "shift", "unshift", "reverse", "and", "or", "dor",
+				"xor", "warn", "die", "prototype",
+				//from :base_mem
+				"concat", "repeat", "join", "range",
+				//none from :base_loop, as we'll see them as basic statements...
+				//from :base_orig
+				"sprintf", "crypt", "tie", "untie", "select", "localtime", "gmtime",
+				//others
+				"print", "open", "close"
+			]
+	},
+	'OPERATORS' :
+		[ '+', '-', '/', '*', '=', '<', '>', '!', '||', '.', '&&',
+			' eq ', ' ne ', '=~' ],
+	'DELIMITERS' :
+		[ '(', ')', '[', ']', '{', '}' ],
+	'REGEXPS' :
+	{
+		'packagedecl' : { 'search': '(package )([^ \r\n\t#;]*)()',
+			'class' : 'scopingnames',
+			'modifiers' : 'g', 'execute' : 'before' },
+		'subdecl' : { 'search': '(sub )([^ \r\n\t#]*)()',
+			'class' : 'scopingnames',
+			'modifiers' : 'g', 'execute' : 'before' },
+		'scalars' : { 'search': '()(\\\$[a-zA-Z0-9_:]*)()',
+			'class' : 'vars',
+			'modifiers' : 'g', 'execute' : 'after' },
+		'arrays' : { 'search': '()(@[a-zA-Z0-9_:]*)()',
+			'class' : 'vars',
+			'modifiers' : 'g', 'execute' : 'after' },
+		'hashs' : { 'search': '()(%[a-zA-Z0-9_:]*)()',
+			'class' : 'vars',
+			'modifiers' : 'g', 'execute' : 'after' },
+	},
+
+	'STYLES' :
+	{
+		'COMMENTS': 'color: #AAAAAA;',
+		'QUOTESMARKS': 'color: #DC0000;',
+		'KEYWORDS' :
+		{
+			'core' : 'color: #8aca00;',
+			'functions' : 'color: #2B60FF;'
+		},
+		'OPERATORS' : 'color: #8aca00;',
+		'DELIMITERS' : 'color: #0038E1;',
+		'REGEXPS':
+		{
+			'scopingnames' : 'color: #ff0000;',
+			'vars' : 'color: #00aaaa;',
+		}
+	} //'STYLES'
+};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/php.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/php.js b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/php.js
new file mode 100644
index 0000000..5a5cff9
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/php.js
@@ -0,0 +1,156 @@
+editAreaLoader.load_syntax["php"] = {
+	'COMMENT_SINGLE' : {1 : '//', 2 : '#'}
+	,'COMMENT_MULTI' : {'/*' : '*/'}
+	,'QUOTEMARKS' : {1: "'", 2: '"'}
+	,'KEYWORD_CASE_SENSITIVE' : false
+	,'KEYWORDS' : {
+		'statements' : [
+			'include', 'require', 'include_once', 'require_once',
+			'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
+            'endif', 'switch', 'case', 'endswitch',
+			'return', 'break', 'continue'
+		]
+		,'reserved' : [
+			'_GET', '_POST', '_SESSION', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST',
+			'null', '__LINE__', '__FILE__',
+			'false', '&lt;?php', '?&gt;', '&lt;?',
+			'&lt;script language', '&lt;/script&gt;',
+			'true', 'var', 'default',
+			'function', 'class', 'new', '&amp;new', 'this',
+			'__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
+			'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
+			'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
+			'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
+			'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
+			'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
+			'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
+			
+		]
+		,'functions' : [
+			'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
+			'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
+			'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
+			'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv',
+			'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime',
+			'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar',
+			'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewi
 nddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown',
+			'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists
 ', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate',
+			'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
+			'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_i
 nsert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat',
+			'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_fi
 eld_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from',
+			'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport',
+			'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
+
+		]
+	}
+	,'OPERATORS' :[
+		'+', '-', '/', '*', '=', '<', '>', '%', '!', '&&', '||'
+	]
+	,'DELIMITERS' :[
+		'(', ')', '[', ']', '{', '}'
+	]
+	,'REGEXPS' : {
+		// highlight all variables ($...)
+		'variables' : {
+			'search' : '()(\\$\\w+)()'
+			,'class' : 'variables'
+			,'modifiers' : 'g'
+			,'execute' : 'before' // before or after
+		}
+	}
+	,'STYLES' : {
+		'COMMENTS': 'color: #AAAAAA;'
+		,'QUOTESMARKS': 'color: #879EFA;'
+		,'KEYWORDS' : {
+			'reserved' : 'color: #48BDDF;'
+			,'functions' : 'color: #0040FD;'
+			,'statements' : 'color: #60CA00;'
+			}
+		,'OPERATORS' : 'color: #FF00FF;'
+		,'DELIMITERS' : 'color: #2B60FF;'
+		,'REGEXPS' : {
+			'variables' : 'color: #E0BD54;'
+		}		
+	}
+	,'AUTO_COMPLETION' :  {
+		"default": {	// the name of this definition group. It's posisble to have different rules inside the same definition file
+			"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^"	// \\s|\\.|
+						,"possible_words_letters": "[a-zA-Z0-9_\$]+"
+						,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
+						,"prefix_separator": "\\-\\>|\\:\\:"
+					}
+			,"CASE_SENSITIVE": true
+			,"MAX_TEXT_LENGTH": 100		// the maximum length of the text being analyzed before the cursor position
+			,"KEYWORDS": {
+					'': [	// the prefix of thoses items
+						/**
+						 * 0 : the keyword the user is typing
+						 * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
+						 * 		If empty the keyword will be displayed
+						 * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
+						 */
+						 ['$_POST']
+			    		,['$_GET']
+			    		,['$_SESSION']
+			    		,['$_SERVER']
+			    		,['$_FILES']
+			    		,['$_ENV']
+			    		,['$_COOKIE']
+			    		,['$_REQUEST']
+			    		// magic methods
+			    		,['__construct', '§( {@} )']
+			    		,['__destruct', '§( {@} )']
+			    		,['__sleep', '§( {@} )']
+			    		,['__wakeup', '§( {@} )']
+			    		,['__toString', '§( {@} )']
+			    		// include
+			    		,['include', '§ "{@}";']
+			    		,['include_once', '§ "{@}";']
+			    		,['require', '§ "{@}";']
+			    		,['require_once', '§ "{@}";']
+			    		// statements
+			    		,['for', '§( {@} )']
+			    		,['foreach', '§( {@} )']
+			    		,['if', '§( {@} )']
+			    		,['elseif', '§( {@} )']
+			    		,['while', '§( {@} )']
+			    		,['switch', '§( {@} )']
+			    		,['break']
+			    		,['case']
+			    		,['continue']
+			    		,['do']
+			    		,['else']
+			    		,['endif']
+			    		,['endswitch']
+			    		,['endwhile']
+			    		,['return']
+			    		// function
+			    		,['unset', '§( {@} )']
+					]
+				}
+			}
+		,"live": {	
+			
+			// class NAME: /class\W+([a-z]+)\W+/gi
+			// method: /^(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi
+			// static: /^(public|private|protected)?\s+static\s+(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi 
+			// attributes: /(\$this\-\>|(?:var|public|protected|private)\W+\$)([a-z0-9\_]+)(?!\()\b/gi 
+			// 		v1 : /(\$this\-\>|var\W+|public\W+|protected\W+|private\W+)([a-z0-9\_]+)\W*(=|;)/gi 
+			// var type: /(\$(this\-\>)?[a-z0-9\_]+)\s*\=\s*new\s+([a-z0-9\_])+/gi 
+			
+			
+			"REGEXP": { "before_word": "[^a-zA-Z0-9_]|^"	// \\s|\\.|
+						,"possible_words_letters": "[a-zA-Z0-9_\$]+"
+						,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
+						,"prefix_separator": "\\-\\>"
+					}
+			,"CASE_SENSITIVE": true
+			,"MAX_TEXT_LENGTH": 100		// the maximum length of the text being analyzed before the cursor position
+			,"KEYWORDS": {
+					'$this': [	// the prefix of thoses items
+						['test']
+					]
+				}
+			}
+	}
+};


[14/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/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
new file mode 100644
index 0000000..2b21b02
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/js/theme_resource_util.js
@@ -0,0 +1,828 @@
+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/incubator-stratos/blob/f6330834/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
new file mode 100644
index 0000000..f47bd4a
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/logo_mgt.jsp
@@ -0,0 +1,221 @@
+<!--
+  ~ 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/incubator-stratos/blob/f6330834/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
new file mode 100644
index 0000000..33ff546
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/metadata_resourcepath.jsp
@@ -0,0 +1,107 @@
+<!--
+  ~ 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/incubator-stratos/blob/f6330834/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
new file mode 100644
index 0000000..63916ab
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/raw-collection-content.jsp
@@ -0,0 +1,756 @@
+<!--
+  ~ 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/incubator-stratos/blob/f6330834/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
new file mode 100644
index 0000000..13bbc26
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/rename_resource_ajaxprocessor.jsp
@@ -0,0 +1,42 @@
+<!--
+  ~ 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/incubator-stratos/blob/f6330834/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
new file mode 100644
index 0000000..285737f
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_advanced.jsp
@@ -0,0 +1,140 @@
+<!--
+  ~ 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>


[07/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/elements_functions.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/elements_functions.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/elements_functions.js
deleted file mode 100644
index 3426fd1..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/elements_functions.js
+++ /dev/null
@@ -1,333 +0,0 @@
-/****
- * This page contains some general usefull functions for javascript
- *
- ****/  
-	
-	
-	// need to redefine this functiondue to IE problem
-	function getAttribute( elm, aName ) {
-		var aValue,taName,i;
-		try{
-			aValue = elm.getAttribute( aName );
-		}catch(exept){}
-		
-		if( ! aValue ){
-			for( i = 0; i < elm.attributes.length; i ++ ) {
-				taName = elm.attributes[i] .name.toLowerCase();
-				if( taName == aName ) {
-					aValue = elm.attributes[i] .value;
-					return aValue;
-				}
-			}
-		}
-		return aValue;
-	};
-	
-	// need to redefine this function due to IE problem
-	function setAttribute( elm, attr, val ) {
-		if(attr=="class"){
-			elm.setAttribute("className", val);
-			elm.setAttribute("class", val);
-		}else{
-			elm.setAttribute(attr, val);
-		}
-	};
-	
-	/* return a child element
-		elem: element we are searching in
-		elem_type: type of the eleemnt we are searching (DIV, A, etc...)
-		elem_attribute: attribute of the searched element that must match
-		elem_attribute_match: value that elem_attribute must match
-		option: "all" if must return an array of all children, otherwise return the first match element
-		depth: depth of search (-1 or no set => unlimited)
-	*/
-	function getChildren(elem, elem_type, elem_attribute, elem_attribute_match, option, depth)
-	{           
-		if(!option)
-			var option="single";
-		if(!depth)
-			var depth=-1;
-		if(elem){
-			var children= elem.childNodes;
-			var result=null;
-			var results= [];
-			for (var x=0;x<children.length;x++) {
-				strTagName = new String(children[x].tagName);
-				children_class="?";
-				if(strTagName!= "undefined"){
-					child_attribute= getAttribute(children[x],elem_attribute);
-					if((strTagName.toLowerCase()==elem_type.toLowerCase() || elem_type=="") && (elem_attribute=="" || child_attribute==elem_attribute_match)){
-						if(option=="all"){
-							results.push(children[x]);
-						}else{
-							return children[x];
-						}
-					}
-					if(depth!=0){
-						result=getChildren(children[x], elem_type, elem_attribute, elem_attribute_match, option, depth-1);
-						if(option=="all"){
-							if(result.length>0){
-								results= results.concat(result);
-							}
-						}else if(result!=null){                                                                          
-							return result;
-						}
-					}
-				}
-			}
-			if(option=="all")
-			   return results;
-		}
-		return null;
-	};       
-	
-	function isChildOf(elem, parent){
-		if(elem){
-			if(elem==parent)
-				return true;
-			while(elem.parentNode != 'undefined'){
-				return isChildOf(elem.parentNode, parent);
-			}
-		}
-		return false;
-	};
-	
-	function getMouseX(e){
-
-		if(e!=null && typeof(e.pageX)!="undefined"){
-			return e.pageX;
-		}else{
-			return (e!=null?e.x:event.x)+ document.documentElement.scrollLeft;
-		}
-	};
-	
-	function getMouseY(e){
-		if(e!=null && typeof(e.pageY)!="undefined"){
-			return e.pageY;
-		}else{
-			return (e!=null?e.y:event.y)+ document.documentElement.scrollTop;
-		}
-	};
-	
-	function calculeOffsetLeft(r){
-		return calculeOffset(r,"offsetLeft")
-	};
-	
-	function calculeOffsetTop(r){
-		return calculeOffset(r,"offsetTop")
-	};
-	
-	function calculeOffset(element,attr){
-		var offset=0;
-		while(element){
-			offset+=element[attr];
-			element=element.offsetParent
-		}
-		return offset;
-	};
-	
-	/** return the computed style
-	 *	@param: elem: the reference to the element
-	 *	@param: prop: the name of the css property	 
-	 */
-	function get_css_property(elem, prop)
-	{
-		if(document.defaultView)
-		{
-			return document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop);
-		}
-		else if(elem.currentStyle)
-		{
-			var prop = prop.replace(/-\D/gi, function(sMatch)
-			{
-				return sMatch.charAt(sMatch.length - 1).toUpperCase();
-			});
-			return elem.currentStyle[prop];
-		}
-		else return null;
-	}
-	
-/****
- * Moving an element 
- ***/  
-	
-	var _mCE;	// currently moving element
-	
-	/* allow to move an element in a window
-		e: the event
-		id: the id of the element
-		frame: the frame of the element 
-		ex of use:
-			in html:	<img id='move_area_search_replace' onmousedown='return parent.start_move_element(event,"area_search_replace", parent.frames["this_frame_id"]);' .../>  
-		or
-			in javascript: document.getElementById("my_div").onmousedown= start_move_element
-	*/
-	function start_move_element(e, id, frame){
-		var elem_id=(e.target || e.srcElement).id;
-		if(id)
-			elem_id=id;		
-		if(!frame)
-			frame=window;
-		if(frame.event)
-			e=frame.event;
-			
-		_mCE= frame.document.getElementById(elem_id);
-		_mCE.frame=frame;
-		frame.document.onmousemove= move_element;
-		frame.document.onmouseup= end_move_element;
-		/*_mCE.onmousemove= move_element;
-		_mCE.onmouseup= end_move_element;*/
-		
-		//alert(_mCE.frame.document.body.offsetHeight);
-		
-		mouse_x= getMouseX(e);
-		mouse_y= getMouseY(e);
-		//window.status=frame+ " elem: "+elem_id+" elem: "+ _mCE + " mouse_x: "+mouse_x;
-		_mCE.start_pos_x = mouse_x - (_mCE.style.left.replace("px","") || calculeOffsetLeft(_mCE));
-		_mCE.start_pos_y = mouse_y - (_mCE.style.top.replace("px","") || calculeOffsetTop(_mCE));
-		return false;
-	};
-	
-	function end_move_element(e){
-		_mCE.frame.document.onmousemove= "";
-		_mCE.frame.document.onmouseup= "";		
-		_mCE=null;
-	};
-	
-	function move_element(e){
-		var newTop,newLeft,maxLeft;
-
-		if( _mCE.frame && _mCE.frame.event )
-			e=_mCE.frame.event;
-		newTop	= getMouseY(e) - _mCE.start_pos_y;
-		newLeft	= getMouseX(e) - _mCE.start_pos_x;
-		
-		maxLeft	= _mCE.frame.document.body.offsetWidth- _mCE.offsetWidth;
-		max_top	= _mCE.frame.document.body.offsetHeight- _mCE.offsetHeight;
-		newTop	= Math.min(Math.max(0, newTop), max_top);
-		newLeft	= Math.min(Math.max(0, newLeft), maxLeft);
-		
-		_mCE.style.top	= newTop+"px";
-		_mCE.style.left	= newLeft+"px";		
-		return false;
-	};
-	
-/***
- * Managing a textarea (this part need the navigator infos from editAreaLoader
- ***/ 
-	
-	var nav= editAreaLoader.nav;
-	
-	// allow to get infos on the selection: array(start, end)
-	function getSelectionRange(textarea){
-		return {"start": textarea.selectionStart, "end": textarea.selectionEnd};
-	};
-	
-	// allow to set the selection
-	function setSelectionRange(t, start, end){
-		t.focus();
-		
-		start	= Math.max(0, Math.min(t.value.length, start));
-		end		= Math.max(start, Math.min(t.value.length, end));
-	
-		if( this.isOpera && this.isOpera < 9.6 ){	// Opera bug when moving selection start and selection end
-			t.selectionEnd = 1;	
-			t.selectionStart = 0;			
-			t.selectionEnd = 1;	
-			t.selectionStart = 0;		
-		}
-		t.selectionStart	= start;
-		t.selectionEnd		= end;		
-		//textarea.setSelectionRange(start, end);
-		
-		if(isIE)
-			set_IE_selection(t);
-	};
-
-	
-	// set IE position in Firefox mode (textarea.selectionStart and textarea.selectionEnd). should work as a repeated task
-	function get_IE_selection(t){
-		var d=document,div,range,stored_range,elem,scrollTop,relative_top,line_start,line_nb,range_start,range_end,tab;
-		if(t && t.focused)
-		{	
-			if(!t.ea_line_height)
-			{	// calculate the lineHeight
-				div= d.createElement("div");
-				div.style.fontFamily= get_css_property(t, "font-family");
-				div.style.fontSize= get_css_property(t, "font-size");
-				div.style.visibility= "hidden";			
-				div.innerHTML="0";
-				d.body.appendChild(div);
-				t.ea_line_height= div.offsetHeight;
-				d.body.removeChild(div);
-			}
-			//t.focus();
-			range = d.selection.createRange();
-			try
-			{
-				stored_range = range.duplicate();
-				stored_range.moveToElementText( t );
-				stored_range.setEndPoint( 'EndToEnd', range );
-				if(stored_range.parentElement() == t){
-					// the range don't take care of empty lines in the end of the selection
-					elem		= t;
-					scrollTop	= 0;
-					while(elem.parentNode){
-						scrollTop+= elem.scrollTop;
-						elem	= elem.parentNode;
-					}
-				
-				//	var scrollTop= t.scrollTop + document.body.scrollTop;
-					
-				//	var relative_top= range.offsetTop - calculeOffsetTop(t) + scrollTop;
-					relative_top= range.offsetTop - calculeOffsetTop(t)+ scrollTop;
-				//	alert("rangeoffset: "+ range.offsetTop +"\ncalcoffsetTop: "+ calculeOffsetTop(t) +"\nrelativeTop: "+ relative_top);
-					line_start	= Math.round((relative_top / t.ea_line_height) +1);
-					
-					line_nb		= Math.round(range.boundingHeight / t.ea_line_height);
-					
-					range_start	= stored_range.text.length - range.text.length;
-					tab	= t.value.substr(0, range_start).split("\n");			
-					range_start	+= (line_start - tab.length)*2;		// add missing empty lines to the selection
-					t.selectionStart = range_start;
-					
-					range_end	= t.selectionStart + range.text.length;
-					tab	= t.value.substr(0, range_start + range.text.length).split("\n");			
-					range_end	+= (line_start + line_nb - 1 - tab.length)*2;
-					t.selectionEnd = range_end;
-				}
-			}
-			catch(e){}
-		}
-		setTimeout("get_IE_selection(document.getElementById('"+ t.id +"'));", 50);
-	};
-	
-	function IE_textarea_focus(){
-		event.srcElement.focused= true;
-	}
-	
-	function IE_textarea_blur(){
-		event.srcElement.focused= false;
-	}
-	
-	// select the text for IE (take into account the \r difference)
-	function set_IE_selection( t ){
-		var nbLineStart,nbLineStart,nbLineEnd,range;
-		if(!window.closed){ 
-			nbLineStart=t.value.substr(0, t.selectionStart).split("\n").length - 1;
-			nbLineEnd=t.value.substr(0, t.selectionEnd).split("\n").length - 1;
-			try
-			{
-				range = document.selection.createRange();
-				range.moveToElementText( t );
-				range.setEndPoint( 'EndToStart', range );
-				range.moveStart('character', t.selectionStart - nbLineStart);
-				range.moveEnd('character', t.selectionEnd - nbLineEnd - (t.selectionStart - nbLineStart)  );
-				range.select();
-			}
-			catch(e){}
-		}
-	};
-	
-	
-	editAreaLoader.waiting_loading["elements_functions.js"]= "loaded";

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/highlight.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/highlight.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/highlight.js
deleted file mode 100644
index fbfbc00..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/highlight.js
+++ /dev/null
@@ -1,391 +0,0 @@
-	// change_to: "on" or "off"
-	EditArea.prototype.change_highlight= function(change_to){
-		if(this.settings["syntax"].length==0 && change_to==false){
-			this.switchClassSticky(_$("highlight"), 'editAreaButtonDisabled', true);
-			this.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
-			return false;
-		}
-		
-		if(this.do_highlight==change_to)
-			return false;
-	
-			
-		this.getIESelection();
-		var pos_start= this.textarea.selectionStart;
-		var pos_end= this.textarea.selectionEnd;
-		
-		if(this.do_highlight===true || change_to==false)
-			this.disable_highlight();
-		else
-			this.enable_highlight();
-		this.textarea.focus();
-		this.textarea.selectionStart = pos_start;
-		this.textarea.selectionEnd = pos_end;
-		this.setIESelection();
-				
-	};
-	
-	EditArea.prototype.disable_highlight= function(displayOnly){
-		var t= this, a=t.textarea, new_Obj, old_class, new_class;
-			
-		t.selection_field.innerHTML="";
-		t.selection_field_text.innerHTML="";
-		t.content_highlight.style.visibility="hidden";
-		// replacing the node is far more faster than deleting it's content in firefox
-		new_Obj= t.content_highlight.cloneNode(false);
-		new_Obj.innerHTML= "";			
-		t.content_highlight.parentNode.insertBefore(new_Obj, t.content_highlight);
-		t.content_highlight.parentNode.removeChild(t.content_highlight);	
-		t.content_highlight= new_Obj;
-		old_class= parent.getAttribute( a,"class" );
-		if(old_class){
-			new_class= old_class.replace( "hidden","" );
-			parent.setAttribute( a, "class", new_class );
-		}
-	
-		a.style.backgroundColor="transparent";	// needed in order to see the bracket finders
-		
-		//var icon= document.getElementById("highlight");
-		//setAttribute(icon, "class", getAttribute(icon, "class").replace(/ selected/g, "") );
-		//t.restoreClass(icon);
-		//t.switchClass(icon,'editAreaButtonNormal');
-		t.switchClassSticky(_$("highlight"), 'editAreaButtonNormal', true);
-		t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonDisabled', true);
-	
-		t.do_highlight=false;
-	
-		t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonSelected', true);
-		if(typeof(t.smooth_selection_before_highlight)!="undefined" && t.smooth_selection_before_highlight===false){
-			t.change_smooth_selection_mode(false);
-		}
-		
-	//	this.textarea.style.backgroundColor="#FFFFFF";
-	};
-
-	EditArea.prototype.enable_highlight= function(){
-		var t=this, a=t.textarea, new_class;
-		t.show_waiting_screen();
-			
-		t.content_highlight.style.visibility="visible";
-		new_class	=parent.getAttribute(a,"class")+" hidden";
-		parent.setAttribute( a, "class", new_class );
-		
-		// IE can't manage mouse click outside text range without this
-		if( t.isIE )
-			a.style.backgroundColor="#FFFFFF";	
-
-		t.switchClassSticky(_$("highlight"), 'editAreaButtonSelected', false);
-		t.switchClassSticky(_$("reset_highlight"), 'editAreaButtonNormal', false);
-		
-		t.smooth_selection_before_highlight=t.smooth_selection;
-		if(!t.smooth_selection)
-			t.change_smooth_selection_mode(true);
-		t.switchClassSticky(_$("change_smooth_selection"), 'editAreaButtonDisabled', true);
-		
-		
-		t.do_highlight=true;
-		t.resync_highlight();
-					
-		t.hide_waiting_screen();	
-	};
-	
-	/**
-	 * Ask to update highlighted text
-	 * @param Array infos - Array of datas returned by EditArea.get_selection_infos()
-	 */
-	EditArea.prototype.maj_highlight= function(infos){
-		// for speed mesure
-		var debug_opti="",tps_start= new Date().getTime(), tps_middle_opti=new Date().getTime();
-		var t=this, hightlighted_text, updated_highlight;	
-		var textToHighlight=infos["full_text"], doSyntaxOpti = false, doHtmlOpti = false, stay_begin="", stay_end="", trace_new , trace_last;
-		
-		if(t.last_text_to_highlight==infos["full_text"] && t.resync_highlight!==true)
-			return;
-					
-		//  OPTIMISATION: will search to update only changed lines
-		if(t.reload_highlight===true){
-			t.reload_highlight=false;
-		}else if(textToHighlight.length==0){
-			textToHighlight="\n ";
-		}else{
-			// get text change datas
-			changes = t.checkTextEvolution(t.last_text_to_highlight,textToHighlight);
-			
-			// check if it can only reparse the changed text
-			trace_new		= t.get_syntax_trace(changes.newTextLine).replace(/\r/g, '');
-			trace_last		= t.get_syntax_trace(changes.lastTextLine).replace(/\r/g, '');
-			doSyntaxOpti	= ( trace_new == trace_last );
-			
-			// check if the difference comes only from a new line created 
-			// => we have to remember that the editor can automaticaly add tabulation or space after the new line) 
-			if( !doSyntaxOpti && trace_new == "\n"+trace_last && /^[ \t\s]*\n[ \t\s]*$/.test( changes.newText.replace(/\r/g, '') ) && changes.lastText =="" )
-			{
-				doSyntaxOpti	= true;
-			}
-			
-			// we do the syntax optimisation
-			if( doSyntaxOpti ){
-						
-				tps_middle_opti=new Date().getTime();	
-			
-				stay_begin= t.last_hightlighted_text.split("\n").slice(0, changes.lineStart).join("\n");
-				if(changes.lineStart>0)
-					stay_begin+= "\n";
-				stay_end= t.last_hightlighted_text.split("\n").slice(changes.lineLastEnd+1).join("\n");
-				if(stay_end.length>0)
-					stay_end= "\n"+stay_end;
-					
-				// Final check to see that we're not in the middle of span tags
-				if( stay_begin.split('<span').length != stay_begin.split('</span').length 
-					|| stay_end.split('<span').length != stay_end.split('</span').length )
-				{
-					doSyntaxOpti	= false;
-					stay_end		= '';
-					stay_begin		= '';
-				}
-				else
-				{
-					if(stay_begin.length==0 && changes.posLastEnd==-1)
-						changes.newTextLine+="\n";
-					textToHighlight=changes.newTextLine;
-				}
-			}
-			if(t.settings["debug"]){
-				var ch =changes;
-				debug_opti= ( doSyntaxOpti?"Optimisation": "No optimisation" )
-					+" start: "+ch.posStart +"("+ch.lineStart+")"
-					+" end_new: "+ ch.posNewEnd+"("+ch.lineNewEnd+")"
-					+" end_last: "+ ch.posLastEnd+"("+ch.lineLastEnd+")"
-					+"\nchanged_text: "+ch.newText+" => trace: "+trace_new
-					+"\nchanged_last_text: "+ch.lastText+" => trace: "+trace_last
-					//debug_opti+= "\nchanged: "+ infos["full_text"].substring(ch.posStart, ch.posNewEnd);
-					+ "\nchanged_line: "+ch.newTextLine
-					+ "\nlast_changed_line: "+ch.lastTextLine
-					+"\nstay_begin: "+ stay_begin.slice(-100)
-					+"\nstay_end: "+ stay_end.substr( 0, 100 );
-					//debug_opti="start: "+stay_begin_len+ "("+nb_line_start_unchanged+") end: "+ (stay_end_len)+ "("+(splited.length-nb_line_end_unchanged)+") ";
-					//debug_opti+="changed: "+ textToHighlight.substring(stay_begin_len, textToHighlight.length-stay_end_len)+" \n";
-					
-					//debug_opti+="changed: "+ stay_begin.substr(stay_begin.length-200)+ "----------"+ textToHighlight+"------------------"+ stay_end.substr(0,200) +"\n";
-					+"\n";
-			}
-	
-			
-			// END OPTIMISATION
-		}
-
-		tps_end_opti	= new Date().getTime();	
-				
-		// apply highlight
-		updated_highlight	= t.colorize_text(textToHighlight);
-		tpsAfterReg			= new Date().getTime();
-		
-		/***
-		 * see if we can optimize for updating only the required part of the HTML code
-		 * 
-		 * The goal here will be to find the text node concerned by the modification and to update it
-		 */
-		//-------------------------------------------
-		// 
-		if( doSyntaxOpti )
-		{
-			try
-			{
-				var replacedBloc, i, nbStart = '', nbEnd = '', newHtml, lengthOld, lengthNew;
-				replacedBloc		= t.last_hightlighted_text.substring( stay_begin.length, t.last_hightlighted_text.length - stay_end.length );
-				
-				lengthOld	= replacedBloc.length;
-				lengthNew	= updated_highlight.length;
-				
-				// find the identical caracters at the beginning
-				for( i=0; i < lengthOld && i < lengthNew && replacedBloc.charAt(i) == updated_highlight.charAt(i) ; i++ )
-				{
-				}
-				nbStart = i;
-				// find the identical caracters at the end
-				for( i=0; i + nbStart < lengthOld && i + nbStart < lengthNew && replacedBloc.charAt(lengthOld-i-1) == updated_highlight.charAt(lengthNew-i-1) ; i++ )
-				{
-				}
-				nbEnd	= i;
-				
-				// get the changes
-				lastHtml	= replacedBloc.substring( nbStart, lengthOld - nbEnd );
-				newHtml		= updated_highlight.substring( nbStart, lengthNew - nbEnd );
-				
-				
-				// We can do the optimisation only if we havn't touch to span elements
-				if( newHtml.indexOf('<span') == -1 && newHtml.indexOf('</span') == -1 
-					&& lastHtml.indexOf('<span') == -1 && lastHtml.indexOf('</span') == -1 )
-				{
-					var beginStr, nbOpendedSpan, nbClosedSpan, nbUnchangedChars, span, textNode;
-					doHtmlOpti		= true;
-					beginStr		= t.last_hightlighted_text.substr( 0, stay_begin.length + nbStart );
-			
-					nbOpendedSpan	= beginStr.split('<span').length - 1;
-					nbClosedSpan	= beginStr.split('</span').length - 1;
-					// retrieve the previously opened span (Add 1 for the first level span?)
-					span 			= t.content_highlight.getElementsByTagName('span')[ nbOpendedSpan ];
-					
-					//--------[
-					// get the textNode to update
-					
-					// if we're inside a span, we'll take the one that is opened (can be a parent of the current span)
-					parentSpan		= span;
-					maxStartOffset	= maxEndOffset = 0;
-					
-					// it will be in the child of the root node 
-					if( nbOpendedSpan == nbClosedSpan )
-					{
-						while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' )
-						{
-							parentSpan	= parentSpan.parentNode;
-						}
-					}
-					// get the last opened span
-					else
-					{
-						maxStartOffset	= maxEndOffset = beginStr.length + 1;
-						// move to parent node for each closed span found after the lastest open span
-						nbClosed = beginStr.substr( Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ).split('</span').length - 1;
-						while( nbClosed > 0 )
-						{
-							nbClosed--;
-							parentSpan = parentSpan.parentNode;
-						}
-						
-						// find the position of the last opended tag
-						while( parentSpan.parentNode != t.content_highlight && parentSpan.parentNode.tagName != 'PRE' && ( tmpMaxStartOffset = Math.max( 0, beginStr.lastIndexOf( '<span', maxStartOffset - 1 ) ) ) < ( tmpMaxEndOffset = Math.max( 0, beginStr.lastIndexOf( '</span', maxEndOffset - 1 ) ) ) )
-						{
-							maxStartOffset	= tmpMaxStartOffset;
-							maxEndOffset	= tmpMaxEndOffset;
-						}
-					}
-					// Note: maxEndOffset is no more used but maxStartOffset will be used
-					
-					if( parentSpan.parentNode == t.content_highlight || parentSpan.parentNode.tagName == 'PRE' )
-					{
-						maxStartOffset	= Math.max( 0, beginStr.indexOf( '<span' ) );
-					}
-					
-					// find the matching text node (this will be one that will be at the end of the beginStr
-					if( maxStartOffset == beginStr.length )
-					{
-						nbSubSpanBefore	= 0;
-					}
-					else
-					{
-						lastEndPos 				= Math.max( 0, beginStr.lastIndexOf( '>', maxStartOffset ) );
-		
-						// count the number of sub spans
-						nbSubSpanBefore			= beginStr.substr( lastEndPos ).split('<span').length-1;
-					}
-					
-					// there is no sub-span before
-					if( nbSubSpanBefore == 0 )
-					{
-						textNode	= parentSpan.firstChild;
-					}
-					// we need to find where is the text node modified
-					else
-					{
-						// take the last direct child (no sub-child)
-						lastSubSpan	= parentSpan.getElementsByTagName('span')[ nbSubSpanBefore - 1 ];
-						while( lastSubSpan.parentNode != parentSpan )
-						{
-							lastSubSpan	= lastSubSpan.parentNode;
-						}
-
-						// associate to next text node following the last sub span
-						if( lastSubSpan.nextSibling == null || lastSubSpan.nextSibling.nodeType != 3 )
-						{
-							textNode	= document.createTextNode('');
-							lastSubSpan.parentNode.insertBefore( textNode, lastSubSpan.nextSibling );
-						}
-						else
-						{
-							textNode	= lastSubSpan.nextSibling;
-						}
-					}
-					//--------]
-					
-					
-					//--------[
-					// update the textNode content
-					
-					// number of caracters after the last opened of closed span
-					nbUnchangedChars = beginStr.length - Math.max( 0, beginStr.lastIndexOf( '>' ) + 1 );
-					
-					//	console.log( span, textNode, nbOpendedSpan,nbClosedSpan,  span.nextSibling, textNode.length, nbUnchangedChars, lastHtml, lastHtml.length, newHtml, newHtml.length );
-					//	alert( textNode.parentNode.className +'-'+ textNode.parentNode.tagName+"\n"+ textNode.data +"\n"+ nbUnchangedChars +"\n"+ lastHtml.length +"\n"+ newHtml +"\n"+ newHtml.length  );
-					
-					// IE only manage \r for cariage return in textNode and not \n or \r\n
-					if( t.isIE )
-					{
-						nbUnchangedChars	-= ( beginStr.substr( beginStr.length - nbUnchangedChars ).split("\n").length - 1 );
-						//alert( textNode.data.replace(/\r/g, '_r').replace(/\n/g, '_n')); 
-						textNode.replaceData( nbUnchangedChars, lastHtml.replace(/\n/g, '').length, newHtml.replace(/\n/g, '') );
-					}
-					else
-					{
-						textNode.replaceData( nbUnchangedChars, lastHtml.length, newHtml );
-					}
-					//--------]
-				}
-			}
-			// an exception shouldn't occured but if replaceData failed at least it won't break everything
-			catch( e )
-			{
-		//		throw e;
-		//		console.log( e );
-				doHtmlOpti	= false;
-			}
-			
-		}
-		/*** END HTML update's optimisation ***/
-		// end test
-		
-	//			console.log(  (TPS6-TPS5), (TPS5-TPS4), (TPS4-TPS3), (TPS3-TPS2), (TPS2-TPS1), _CPT );
-		// get the new highlight content
-		tpsAfterOpti2		= new Date().getTime();
-		hightlighted_text	= stay_begin + updated_highlight + stay_end;
-		if( !doHtmlOpti )
-		{
-			// update the content of the highlight div by first updating a clone node (as there is no display in the same time for t node it's quite faster (5*))
-			var new_Obj= t.content_highlight.cloneNode(false);
-			if( ( t.isIE && t.isIE < 8 ) || ( t.isOpera && t.isOpera < 9.6 ) )
-				new_Obj.innerHTML= "<pre><span class='"+ t.settings["syntax"] +"'>" + hightlighted_text + "</span></pre>";	
-			else
-				new_Obj.innerHTML= "<span class='"+ t.settings["syntax"] +"'>"+ hightlighted_text +"</span>";
-	
-			t.content_highlight.parentNode.replaceChild(new_Obj, t.content_highlight);
-		
-			t.content_highlight= new_Obj;
-		}
-		
-		t.last_text_to_highlight= infos["full_text"];
-		t.last_hightlighted_text= hightlighted_text;
-		
-		tps3=new Date().getTime();
-	
-		if(t.settings["debug"]){
-			//lineNumber=tab_text.length;
-			//t.debug.value+=" \nNB char: "+_$("src").value.length+" Nb line: "+ lineNumber;
-		
-			t.debug.value= "Tps optimisation "+(tps_end_opti-tps_start)
-				+" | tps reg exp: "+ (tpsAfterReg-tps_end_opti)
-				+" | tps opti HTML : "+ (tpsAfterOpti2-tpsAfterReg) + ' '+ ( doHtmlOpti ? 'yes' : 'no' )
-				+" | tps update highlight content: "+ (tps3-tpsAfterOpti2)
-				+" | tpsTotal: "+ (tps3-tps_start)
-				+ "("+tps3+")\n"+ debug_opti;
-		//	t.debug.value+= "highlight\n"+hightlighted_text;*/
-		}
-		
-	};
-	
-	EditArea.prototype.resync_highlight= function(reload_now){
-		this.reload_highlight=true;
-		this.last_text_to_highlight="";
-		this.focus();		
-		if(reload_now)
-			this.check_line_selection(false); 
-	};	

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/autocompletion.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/autocompletion.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/autocompletion.gif
deleted file mode 100644
index f3dfc2e..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/autocompletion.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/close.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/close.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/close.gif
deleted file mode 100644
index 679ca2a..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/close.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/fullscreen.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/fullscreen.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/fullscreen.gif
deleted file mode 100644
index 66fa6d9..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/fullscreen.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/go_to_line.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/go_to_line.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/go_to_line.gif
deleted file mode 100644
index 06042ec..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/go_to_line.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/help.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/help.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/help.gif
deleted file mode 100644
index 51a1ee4..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/help.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/highlight.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/highlight.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/highlight.gif
deleted file mode 100644
index 16491f6..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/highlight.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/load.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/load.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/load.gif
deleted file mode 100644
index 461698f..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/load.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/move.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/move.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/move.gif
deleted file mode 100644
index d15f9f5..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/move.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/newdocument.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/newdocument.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/newdocument.gif
deleted file mode 100644
index a9d2938..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/newdocument.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/opacity.png
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/opacity.png b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/opacity.png
deleted file mode 100644
index b4217cb..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/opacity.png and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/processing.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/processing.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/processing.gif
deleted file mode 100644
index cce32f2..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/processing.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/redo.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/redo.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/redo.gif
deleted file mode 100644
index 3af9069..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/redo.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/reset_highlight.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/reset_highlight.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/reset_highlight.gif
deleted file mode 100644
index 0fa3cb7..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/reset_highlight.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/save.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/save.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/save.gif
deleted file mode 100644
index 2777beb..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/save.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/search.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/search.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/search.gif
deleted file mode 100644
index cfe76b5..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/search.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/smooth_selection.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/smooth_selection.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/smooth_selection.gif
deleted file mode 100644
index 8a532e5..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/smooth_selection.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/spacer.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/spacer.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/spacer.gif
deleted file mode 100644
index 3884865..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/spacer.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/statusbar_resize.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/statusbar_resize.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/statusbar_resize.gif
deleted file mode 100644
index af89d80..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/statusbar_resize.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/undo.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/undo.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/undo.gif
deleted file mode 100644
index 520796d..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/undo.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/word_wrap.gif
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/word_wrap.gif b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/word_wrap.gif
deleted file mode 100644
index 8f256cc..0000000
Binary files a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/word_wrap.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/keyboard.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/keyboard.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/keyboard.js
deleted file mode 100644
index 71b3a7c..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/keyboard.js
+++ /dev/null
@@ -1,145 +0,0 @@
-var EA_keys = {8:"Retour arriere",9:"Tabulation",12:"Milieu (pave numerique)",13:"Entrer",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"Verr Maj",27:"Esc",32:"Space",33:"Page up",34:"Page down",35:"End",36:"Begin",37:"Left",38:"Up",39:"Right",40:"Down",44:"Impr ecran",45:"Inser",46:"Suppr",91:"Menu Demarrer Windows / touche pomme Mac",92:"Menu Demarrer Windows",93:"Menu contextuel Windows",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Verr Num",145:"Arret defil"};
-
-
-
-function keyDown(e){
-	if(!e){	// if IE
-		e=event;
-	}
-	
-	// send the event to the plugins
-	for(var i in editArea.plugins){
-		if(typeof(editArea.plugins[i].onkeydown)=="function"){
-			if(editArea.plugins[i].onkeydown(e)===false){ // stop propaging
-				if(editArea.isIE)
-					e.keyCode=0;
-				return false;
-			}
-		}
-	}
-
-	var target_id=(e.target || e.srcElement).id;
-	var use=false;
-	if (EA_keys[e.keyCode])
-		letter=EA_keys[e.keyCode];
-	else
-		letter=String.fromCharCode(e.keyCode);
-	
-	var low_letter= letter.toLowerCase();
-			
-	if(letter=="Page up" && !editArea.isOpera){
-		editArea.execCommand("scroll_page", {"dir": "up", "shift": ShiftPressed(e)});
-		use=true;
-	}else if(letter=="Page down" && !editArea.isOpera){
-		editArea.execCommand("scroll_page", {"dir": "down", "shift": ShiftPressed(e)});
-		use=true;
-	}else if(editArea.is_editable==false){
-		// do nothing but also do nothing else (allow to navigate with page up and page down)
-		return true;
-	}else if(letter=="Tabulation" && target_id=="textarea" && !CtrlPressed(e) && !AltPressed(e)){	
-		if(ShiftPressed(e))
-			editArea.execCommand("invert_tab_selection");
-		else
-			editArea.execCommand("tab_selection");
-		
-		use=true;
-		if(editArea.isOpera || (editArea.isFirefox && editArea.isMac) )	// opera && firefox mac can't cancel tabulation events...
-			setTimeout("editArea.execCommand('focus');", 1);
-	}else if(letter=="Entrer" && target_id=="textarea"){
-		if(editArea.press_enter())
-			use=true;
-	}else if(letter=="Entrer" && target_id=="area_search"){
-		editArea.execCommand("area_search");
-		use=true;
-	}else  if(letter=="Esc"){
-		editArea.execCommand("close_all_inline_popup", e);
-		use=true;
-	}else if(CtrlPressed(e) && !AltPressed(e) && !ShiftPressed(e)){
-		switch(low_letter){
-			case "f":				
-				editArea.execCommand("area_search");
-				use=true;
-				break;
-			case "r":
-				editArea.execCommand("area_replace");
-				use=true;
-				break;
-			case "q":
-				editArea.execCommand("close_all_inline_popup", e);
-				use=true;
-				break;
-			case "h":
-				editArea.execCommand("change_highlight");			
-				use=true;
-				break;
-			case "g":
-				setTimeout("editArea.execCommand('go_to_line');", 5);	// the prompt stop the return false otherwise
-				use=true;
-				break;
-			case "e":
-				editArea.execCommand("show_help");
-				use=true;
-				break;
-			case "z":
-				use=true;
-				editArea.execCommand("undo");
-				break;
-			case "y":
-				use=true;
-				editArea.execCommand("redo");
-				break;
-			default:
-				break;			
-		}		
-	}		
-	
-	// check to disable the redo possibility if the textarea content change
-	if(editArea.next.length > 0){
-		setTimeout("editArea.check_redo();", 10);
-	}
-	
-	setTimeout("editArea.check_file_changes();", 10);
-	
-	
-	if(use){
-		// in case of a control that sould'nt be used by IE but that is used => THROW a javascript error that will stop key action
-		if(editArea.isIE)
-			e.keyCode=0;
-		return false;
-	}
-	//alert("Test: "+ letter + " ("+e.keyCode+") ALT: "+ AltPressed(e) + " CTRL "+ CtrlPressed(e) + " SHIFT "+ ShiftPressed(e));
-	
-	return true;
-	
-};
-
-
-// return true if Alt key is pressed
-function AltPressed(e) {
-	if (window.event) {
-		return (window.event.altKey);
-	} else {
-		if(e.modifiers)
-			return (e.altKey || (e.modifiers % 2));
-		else
-			return e.altKey;
-	}
-};
-
-// return true if Ctrl key is pressed
-function CtrlPressed(e) {
-	if (window.event) {
-		return (window.event.ctrlKey);
-	} else {
-		return (e.ctrlKey || (e.modifiers==2) || (e.modifiers==3) || (e.modifiers>5));
-	}
-};
-
-// return true if Shift key is pressed
-function ShiftPressed(e) {
-	if (window.event) {
-		return (window.event.shiftKey);
-	} else {
-		return (e.shiftKey || (e.modifiers>3));
-	}
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/langs/en.js
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/langs/en.js b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/langs/en.js
deleted file mode 100644
index 1ec2561..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/langs/en.js
+++ /dev/null
@@ -1,67 +0,0 @@
-editAreaLoader.lang["en"]={
-new_document: "new empty document",
-search_button: "search and replace",
-search_command: "search next / open search area",
-search: "search",
-replace: "replace",
-replace_command: "replace / open search area",
-find_next: "find next",
-replace_all: "replace all",
-reg_exp: "regular expressions",
-match_case: "match case",
-not_found: "not found.",
-occurrence_replaced: "occurences replaced.",
-search_field_empty: "Search field empty",
-restart_search_at_begin: "End of area reached. Restart at begin.",
-move_popup: "move search popup",
-font_size: "--Font size--",
-go_to_line: "go to line",
-go_to_line_prompt: "go to line number:",
-undo: "undo",
-redo: "redo",
-change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
-highlight: "toggle syntax highlight on/off",
-reset_highlight: "reset highlight (if desyncronized from text)",
-word_wrap: "toggle word wrapping mode",
-help: "about",
-save: "save",
-load: "load",
-line_abbr: "Ln",
-char_abbr: "Ch",
-position: "Position",
-total: "Total",
-close_popup: "close popup",
-shortcuts: "Shortcuts",
-add_tab: "add tabulation to text",
-remove_tab: "remove tabulation to text",
-about_notice: "Notice: syntax highlight function is only for small text",
-toggle: "Toggle editor",
-accesskey: "Accesskey",
-tab: "Tab",
-shift: "Shift",
-ctrl: "Ctrl",
-esc: "Esc",
-processing: "Processing...",
-fullscreen: "fullscreen",
-syntax_selection: "--Syntax--",
-syntax_css: "CSS",
-syntax_html: "HTML",
-syntax_js: "Javascript",
-syntax_php: "Php",
-syntax_python: "Python",
-syntax_vb: "Visual Basic",
-syntax_xml: "Xml",
-syntax_c: "C",
-syntax_cpp: "CPP",
-syntax_basic: "Basic",
-syntax_pas: "Pascal",
-syntax_brainfuck: "Brainfuck",
-syntax_sql: "SQL",
-syntax_ruby: "Ruby",
-syntax_robotstxt: "Robots txt",
-syntax_tsql: "T-SQL",
-syntax_perl: "Perl",
-syntax_coldfusion: "Coldfusion",
-syntax_java: "Java",
-close_tab: "Close file"
-};

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_apache.txt
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_apache.txt b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_apache.txt
deleted file mode 100644
index c7ef5e6..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_apache.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Copyright 2008 Christophe Dolivet
-
-Licensed 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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_bsd.txt
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_bsd.txt b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_bsd.txt
deleted file mode 100644
index f36bbe4..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_bsd.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Copyright (c) 2008, Christophe Dolivet
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-    * Neither the name of EditArea nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_lgpl.txt
----------------------------------------------------------------------
diff --git a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_lgpl.txt b/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_lgpl.txt
deleted file mode 100644
index 8c177f8..0000000
--- a/components/stratos/theme-mgt/org.wso2.carbon.theme.mgt.ui/2.1.0/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_lgpl.txt
+++ /dev/null
@@ -1,458 +0,0 @@
-		  GNU LESSER GENERAL PUBLIC LICENSE
-		       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-		  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-  
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-			    NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-		     END OF TERMS AND CONDITIONS


[21/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/servlets/ThemeResourceSevelet.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/servlets/ThemeResourceSevelet.java b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/servlets/ThemeResourceSevelet.java
new file mode 100644
index 0000000..6fbfb26
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/servlets/ThemeResourceSevelet.java
@@ -0,0 +1,124 @@
+/*
+ *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. 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.
+ *
+ */
+package org.wso2.carbon.theme.mgt.ui.servlets;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentDownloadBean;
+import org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+
+public class ThemeResourceSevelet extends HttpServlet {
+
+    private static final Log log = LogFactory.getLog(ThemeResourceSevelet.class);
+
+    private ServletConfig servletConfig;
+
+    public void init(ServletConfig servletConfig) throws ServletException {
+        super.init(servletConfig);
+        this.servletConfig = servletConfig;
+    }
+
+    protected void doGet(HttpServletRequest request, HttpServletResponse response)
+            throws ServletException, IOException {
+
+        try {
+            ThemeMgtServiceClient client = new ThemeMgtServiceClient(servletConfig, request.getSession());
+            String path = request.getParameter("path");
+            String viewImage = request.getParameter("viewImage");
+            if (path == null) {
+                String msg = "Could not get the resource content. Path is not specified.";
+                log.error(msg);
+                response.setStatus(400);
+                return;
+            }
+
+            ContentDownloadBean bean = client.getContentDownloadBean(path);
+
+            InputStream contentStream = null;
+            if (bean.getContent() != null) {
+                contentStream = bean.getContent().getInputStream();
+            } else {
+                String msg = "The resource content was empty.";
+                log.error(msg);
+                response.setStatus(204);
+                return;
+            }
+
+            response.setDateHeader("Last-Modified", bean.getLastUpdatedTime().getTime().getTime());
+            String ext = "jpg";
+            if (path.lastIndexOf(".") < path.length() -1 && path.lastIndexOf(".") > 0) {
+                ext = path.substring(path.lastIndexOf(".") + 1);
+            }
+
+            if (viewImage != null && viewImage.equals("1")) {
+                response.setContentType("img/" + ext);
+            }
+            else {
+                if (bean.getMediatype() != null && bean.getMediatype().length() > 0) {
+                    response.setContentType(bean.getMediatype());
+                } else {
+                    response.setContentType("application/download");
+                }
+
+                if (bean.getResourceName() != null) {
+                    response.setHeader(
+                            "Content-Disposition", "attachment; filename=\"" + bean.getResourceName() + "\"");
+                }
+            }
+
+            if (contentStream != null) {
+
+                ServletOutputStream servletOutputStream = null;
+                try {
+                    servletOutputStream = response.getOutputStream();
+
+                    byte[] contentChunk = new byte[1024];
+                    int byteCount;
+                    while ((byteCount = contentStream.read(contentChunk)) != -1) {
+                        servletOutputStream.write(contentChunk, 0, byteCount);
+                    }
+
+                    response.flushBuffer();
+                    servletOutputStream.flush();
+
+                } finally {
+                    contentStream.close();
+
+                    if (servletOutputStream != null) {
+                        servletOutputStream.close();
+                    }
+                }
+            }
+        } catch (Exception e) {
+
+            String msg = "Failed to get resource content. " + e.getMessage();
+            log.error(msg, e);
+            response.setStatus(500);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/utils/ThemeUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/utils/ThemeUtil.java b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/utils/ThemeUtil.java
new file mode 100644
index 0000000..bca9fce
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/java/org/wso2/carbon/theme/mgt/ui/utils/ThemeUtil.java
@@ -0,0 +1,67 @@
+/*
+ *  Copyright (c) 2005-2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ *  WSO2 Inc. 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.
+ *
+ */
+package org.wso2.carbon.theme.mgt.ui.utils;
+
+import org.wso2.carbon.registry.core.RegistryConstants;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.registry.core.utils.UUIDGenerator;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.servlet.ServletConfig;
+
+public class ThemeUtil {
+	public static String getThemeResourceDownloadURL(String path) {
+		return "../../registry/themeResourceContent?path=" + path;
+	}
+
+	public static String getThemeResourceViewAsImageURL(String path) {
+		return "../../registry/themeResourceContent?path=" + path
+		        + "&viewImage=1";
+	}
+
+	public static String getThumbUrl(HttpServletRequest request, String themeName) {
+		String serverURL = CarbonUIUtil.getAdminConsoleURL(request);
+		String serverRoot = serverURL.substring(0, serverURL.length()
+		        - "carbon/".length());
+		return serverRoot + "registry/resource"
+		        + RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH
+		        + "/repository/components/org.wso2.carbon.all-themes/"
+		        + themeName + "/thumb.png";
+	}
+
+	public static String getLogoURL(ServletConfig config, HttpSession session) {
+		// this is to avoid the caching problem
+		String randomUUID = UUIDGenerator.generateUUID();
+		String serverURL = CarbonUIUtil.getServerURL(
+		        config.getServletContext(), session);
+		String serverRoot = serverURL.substring(0, serverURL.length() - "services/".length());
+		String tenantDomain = (String) session
+		        .getAttribute(MultitenantConstants.TENANT_DOMAIN);
+		if (tenantDomain == null) {
+			return "";
+		}
+
+        // Using relative path instead of the back-end server url.
+        return  "../../../../t/" + tenantDomain + "/registry/resource"
+		        + RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH
+		        + "/repository/theme/admin/logo.gif?thatsrnd=" + randomUUID;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/META-INF/component.xml b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/META-INF/component.xml
new file mode 100644
index 0000000..cca3e42
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/META-INF/component.xml
@@ -0,0 +1,68 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. 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.
+ -->
+<component xmlns="http://products.wso2.org/carbon">
+    <!-- sample menu configuration -->
+    <menus>
+        <menu>
+            <id>mt_theme_mgt_menu</id>
+            <i18n-key>theme.management</i18n-key>
+            <i18n-bundle>org.apache.stratos.theme.mgt.ui.i18n.Resources</i18n-bundle>
+            <parent-menu>configure_menu</parent-menu>
+            <link>../tenant-theme/theme_mgt.jsp</link>
+            <region>region1</region>
+            <icon>../tenant-theme/images/thememgt.gif</icon>
+            <order>41</order>
+            <style-class>home</style-class>
+            <require-permission>/permission/admin/configure/theme</require-permission>
+            <require-not-super-tenant>true</require-not-super-tenant>
+        </menu>
+        <menu>
+            <id>mt_logo_mgt_menu</id>
+            <i18n-key>logo.management</i18n-key>
+            <i18n-bundle>org.apache.stratos.theme.mgt.ui.i18n.Resources</i18n-bundle>
+            <parent-menu>configure_menu</parent-menu>
+            <link>../tenant-theme/logo_mgt.jsp</link>
+            <region>region1</region>
+            <icon>../tenant-theme/images/logomgt.gif</icon>
+            <order>42</order>
+            <style-class>home</style-class>
+            <require-permission>/permission/admin/configure/theme</require-permission>
+            <require-not-super-tenant>true</require-not-super-tenant>
+        </menu>
+    </menus>
+
+
+    <FileUploadConfig>
+        <Mapping>
+            <Actions>
+                <Action>themeResource</Action>
+            </Actions>
+            <Class>org.apache.stratos.theme.mgt.ui.processors.AddThemeResourceProcessor</Class>
+        </Mapping>
+    </FileUploadConfig>
+
+    <servlets>
+        <servlet id="testthemeservlet">
+            <servlet-name>ThemeResourceContentServlet</servlet-name>
+            <url-pattern>/registry/themeResourceContent</url-pattern>
+            <display-name>Theme Resource Content Servlet</display-name>
+
+            <servlet-class>org.apache.stratos.theme.mgt.ui.servlets.ThemeResourceSevelet</servlet-class>
+        </servlet>
+    </servlets>
+</component>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/apache/stratos/theme/mgt/ui/i18n/JSResources.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/apache/stratos/theme/mgt/ui/i18n/JSResources.properties b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/apache/stratos/theme/mgt/ui/i18n/JSResources.properties
new file mode 100644
index 0000000..4282f03
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/apache/stratos/theme/mgt/ui/i18n/JSResources.properties
@@ -0,0 +1,2 @@
+password.mismatched=Passwords do not match.
+current.password.should.provided=You should provide the current password inorder to change the password.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/apache/stratos/theme/mgt/ui/i18n/Resources.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/apache/stratos/theme/mgt/ui/i18n/Resources.properties b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/apache/stratos/theme/mgt/ui/i18n/Resources.properties
new file mode 100644
index 0000000..edf3f48
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/apache/stratos/theme/mgt/ui/i18n/Resources.properties
@@ -0,0 +1,51 @@
+submit.tenant=Submit Tenant
+domain=Domain
+domain.information=Domain Information
+contact.details=Contact Details
+admin.username=Admin Username
+current.admin.password=Current Admin Password
+new.admin.password=New Admin Password
+new.admin.password.repeat=New Admin Password (Repeat)
+admin.password=Admin Password
+admin.password.repeat=Admin Password (Repeat)
+govern.add_tenants.menu=Add New Tenant
+govern.view_tenants.menu=View Tenants
+overview=Overview
+tenants.list=Tenants List
+company.organization=Company/Organization
+admin.contact=Admin Contact
+edit=Edit
+multitenancy=Multitenancy
+added.successfully=You have successfully added a new tenant with domain:
+updated.successfully=You have successfully updated the tenant with domain:
+update.added.tenant=Update the just added/updated tenant
+update.tenant=Update Tenant
+add.new.tenant=Add a new tenant
+register.new.organization=Register A New Organization
+view.all.tenants=View all tenants
+tenant.admin=Tenant Admin
+tenant.description=Tenant Description
+admin.fullname=Full Name
+admin.address=Address
+admin.email=Email
+admin.telephone=Telephone
+admin.im=IM
+admin.url=URL
+self.registration=Registry Tenant
+gaas=GaaS
+gaas.register.a.new.tenant=Register A New Tenant
+active=Active
+theme.management=Theme
+word.verification=Word Verification
+captcha.message=Type the characters you see in the picture below.
+add.image=Add an Image
+image.path.help.text=Give the path of a file to fetch a image (bmp,gif,jpg,png)
+image.url.help.text=Give the full url of the resource to fetch a image from URL (bmp,gif,jpg,png)
+upload.image.from.file=Upload an image from a file
+import.image.from.url=Import an image from a URL
+update.logo.image.from.file=Update the logo image from a file
+update.logo.image.from.url=Update the logo image from a URL
+method=Method
+logo.management=Logo Management
+change.the.logo=Change the Logo
+wait.message=Process may take some time. Please wait..

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/JSResources.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/JSResources.properties b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/JSResources.properties
new file mode 100644
index 0000000..4282f03
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/JSResources.properties
@@ -0,0 +1,2 @@
+password.mismatched=Passwords do not match.
+current.password.should.provided=You should provide the current password inorder to change the password.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/Resources.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/Resources.properties b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/Resources.properties
new file mode 100644
index 0000000..edf3f48
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/Resources.properties
@@ -0,0 +1,51 @@
+submit.tenant=Submit Tenant
+domain=Domain
+domain.information=Domain Information
+contact.details=Contact Details
+admin.username=Admin Username
+current.admin.password=Current Admin Password
+new.admin.password=New Admin Password
+new.admin.password.repeat=New Admin Password (Repeat)
+admin.password=Admin Password
+admin.password.repeat=Admin Password (Repeat)
+govern.add_tenants.menu=Add New Tenant
+govern.view_tenants.menu=View Tenants
+overview=Overview
+tenants.list=Tenants List
+company.organization=Company/Organization
+admin.contact=Admin Contact
+edit=Edit
+multitenancy=Multitenancy
+added.successfully=You have successfully added a new tenant with domain:
+updated.successfully=You have successfully updated the tenant with domain:
+update.added.tenant=Update the just added/updated tenant
+update.tenant=Update Tenant
+add.new.tenant=Add a new tenant
+register.new.organization=Register A New Organization
+view.all.tenants=View all tenants
+tenant.admin=Tenant Admin
+tenant.description=Tenant Description
+admin.fullname=Full Name
+admin.address=Address
+admin.email=Email
+admin.telephone=Telephone
+admin.im=IM
+admin.url=URL
+self.registration=Registry Tenant
+gaas=GaaS
+gaas.register.a.new.tenant=Register A New Tenant
+active=Active
+theme.management=Theme
+word.verification=Word Verification
+captcha.message=Type the characters you see in the picture below.
+add.image=Add an Image
+image.path.help.text=Give the path of a file to fetch a image (bmp,gif,jpg,png)
+image.url.help.text=Give the full url of the resource to fetch a image from URL (bmp,gif,jpg,png)
+upload.image.from.file=Upload an image from a file
+import.image.from.url=Import an image from a URL
+update.logo.image.from.file=Update the logo image from a file
+update.logo.image.from.url=Update the logo image from a URL
+method=Method
+logo.management=Logo Management
+change.the.logo=Change the Logo
+wait.message=Process may take some time. Please wait..

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/add_collection_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/add_collection_ajaxprocessor.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/add_collection_ajaxprocessor.jsp
new file mode 100644
index 0000000..da520f0
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/add_collection_ajaxprocessor.jsp
@@ -0,0 +1,50 @@
+<!--
+  ~ 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 import="org.wso2.carbon.registry.common.ui.UIException" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+    String errorMessage = null;
+    try {
+        
+        String parentPath = request.getParameter("parentPath");
+        String collectionName = request.getParameter("collectionName");
+        String mediaType = request.getParameter("mediaType");
+        String description = request.getParameter("description");
+
+        String cookie = (String) request.
+                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+
+        try {
+        ThemeMgtServiceClient client = new ThemeMgtServiceClient(cookie, config, session);
+        client.addCollection(parentPath, collectionName, mediaType, description);
+        } catch (Exception e) {
+            String msg = "Failed to add new collection " + collectionName +
+                    " to the parent collection " + parentPath + ". " + e.getMessage();
+            throw new UIException(msg, e);
+        }
+
+    } catch (Exception e) {
+        errorMessage = e.getMessage();
+        response.setStatus(500);
+        out.write(errorMessage);
+        return;
+    }
+%>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/add_text_resource_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/add_text_resource_ajaxprocessor.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/add_text_resource_ajaxprocessor.jsp
new file mode 100644
index 0000000..0341505
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/add_text_resource_ajaxprocessor.jsp
@@ -0,0 +1,59 @@
+<!--
+  ~ 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.
+  -->icense.
+ -->
+<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
+<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
+<%@ page import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
+<%@ page import="org.wso2.carbon.registry.resource.ui.processors.AddTextResourceProcessor" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+    String errorMessage = null;
+    try {
+
+        String parentPath = request.getParameter("parentPath");
+        String fileName = request.getParameter("fileName");
+        String mediaType = request.getParameter("mediaType");
+        String description = request.getParameter("description");
+        String content = request.getParameter("content");
+
+        String cookie = (String) request.
+                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+
+        try {
+            ThemeMgtServiceClient client =
+                    new ThemeMgtServiceClient(cookie, config, request.getSession());
+            client.addTextResource(parentPath, fileName, mediaType, description, content);
+        } catch (Exception e) {
+            String msg = "Failed to add new text resource " + fileName +
+                    " to the parent collection " + parentPath + ". " + e.getMessage();
+            throw new UIException(msg, e);
+        }
+
+    } catch (Exception e) {
+        errorMessage = e.getMessage();
+    }
+%>
+
+<% if (errorMessage != null) { %>
+
+<script type="text/javascript">
+	location.href='../error.jsp?errorMsg=<%=errorMessage%>'
+</script>
+
+<% } %>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/content_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/content_ajaxprocessor.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/content_ajaxprocessor.jsp
new file mode 100644
index 0000000..491b65f
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/content_ajaxprocessor.jsp
@@ -0,0 +1,242 @@
+<!--
+  ~ 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.apache.stratos.theme.mgt.stub.registry.resource.stub.beans.xsd.ContentBean" %>
+<%@ page import="org.wso2.carbon.registry.resource.ui.Utils" %>
+<%@ page import="org.wso2.carbon.registry.resource.ui.clients.CustomUIHandler" %>
+<%@ 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 contentType="text/html;charset=UTF-8" language="java" %>
+<fmt:bundle basename="org.wso2.carbon.registry.resource.ui.i18n.Resources">
+
+    <%
+        String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+        String viewMode = Utils.getResourceViewMode(request);
+        boolean isInlinedView = "inlined".equals(viewMode);
+        ContentBean cb;
+        ThemeMgtServiceClient client;
+
+
+        try {
+            client = new ThemeMgtServiceClient(cookie, config, session);
+            cb = client.getContent(request);
+        } catch (Exception e) {
+    %>
+    <jsp:forward page="../admin/error.jsp?<%=e.getMessage()%>"/>
+    <%
+            return;
+        }
+
+        String cuiURL = CustomUIHandler.getCustomViewUI(cb.getMediaType(), request.getSession());
+        String mode = request.getParameter("mode");
+        boolean cui = false;
+        if (cuiURL != null && !"standard".equals(mode)) {
+            cui = true;
+        }
+if(!cb.getAbsent().equals("true")){
+    %>
+
+    <div class="box1-head">
+        <table cellspacing="0" cellpadding="0" border="0" style="width:100%">
+            <tr>
+                <td valign="top">
+                    <h2 class="sub-headding-entries"><%if (cb.getCollection()) { %>
+                        <fmt:message key="entries"/> <% } else { %>
+                        <fmt:message key="content"/> <% } %></h2>
+                </td>
+                <td align="right" valign="top" class="expanIconCell">
+
+                    <a onclick="javascript: showHideCommon('entriesIconExpanded');showHideCommon('entriesIconMinimized');showHideCommon('entriesExpanded');showHideCommon('entriesMinimized');">
+                        <img src="../resources/images/icon-expanded.gif" border="0" align="top"
+                             id="entriesIconExpanded"/>
+                        <img src="../resources/images/icon-minimized.gif" border="0" align="top"
+                             id="entriesIconMinimized" style="display:none;"/>
+                    </a>
+
+
+                </td>
+
+            </tr>
+        </table>
+    </div>
+    <div class="box1-mid-fill" id="entriesMinimized" style="display:none"></div>
+    <div class="box1-mid" id="entriesExpanded">
+        <%
+            if (!isInlinedView) {
+        %>
+
+        <% if (cb.getCollection() && cb.getPutAllowed() && !cb.getVersionView() && cb.getLoggedIn() && !cui) { %>
+
+<fmt:bundle basename="org.apache.stratos.theme.mgt.ui.i18n.Resources">
+        <div style="display:block;height:30px;">
+            <a class="add-resource-icon-link"
+               onclick="showHide('add-resource-div');resetThemeResourceForms()"><fmt:message
+                    key="add.image"/></a>
+        </div>
+
+</fmt:bundle>
+        <div style="display:block;height:30px;">
+            <a class="add-collection-icon-link"
+               onclick="javascript: showHide('add-folder-div');expandIfNot('entries');if($('add-folder-div').style.display!='none')$('collectionName').focus();">
+                <fmt:message key="add.collection"/></a>
+        </div>
+        <% }
+        }%>
+
+        <!-- all the content goes here -->
+        <% if (cui) { %>
+        <a onclick="viewStandardThemeContentSection('<%=cb.getPathWithVersion()%>')">Standard
+            view</a><br/>
+
+        <div id="customViewUIDiv">
+            <jsp:include page="<%=cuiURL%>"/>
+        </div>
+        <%
+        } else {
+
+            if (cuiURL != null) {
+        %>
+        <a onclick="refreshThemeContentSection('<%=cb.getPathWithVersion()%>')"><fmt:message
+                key="custom.view"/></a><br/>
+        <%
+            }
+            boolean isImage = false;
+            String contentPathLower = (cb.getContentPath() == null)? "" : cb.getContentPath().toLowerCase();
+            String[] expectedImageExts = {".jpg", ".jpeg", ".png", ".gif"};
+
+            for (String ext: expectedImageExts) {
+               if (contentPathLower.endsWith(ext)) {
+                   isImage = true;
+                   break;
+               }
+            }
+            if (cb.getCollection()) {
+        %>
+
+        <jsp:include page="raw-collection-content.jsp"/>
+
+        <% } else if(isImage) {
+        %>
+
+        <table style="*width:340px !important;">
+        <tr>
+        <!--<td>
+        <a onclick="displayThemeContentAsText('<%=cb.getPathWithVersion()%>')" class="icon-link" style="background-image:url(../admin/images/view.gif);"><fmt:message
+                key="display.as.text"/></a>
+        </td>
+        <% if (cb.getPutAllowed() && !cb.getVersionView()) { %>
+        <td style="vertical-align:middle;padding-left:5px;">|</td>
+        <td>
+        <a onclick="displayEditThemeContentAsText('<%=cb.getPathWithVersion()%>')" class="icon-link" style="background-image:url(../admin/images/edit.gif);"><fmt:message
+                key="edit.as.text"/></a>
+        </td>
+        <% } %>
+        <td style="vertical-align:middle;padding-left:5px;">|</td>  -->
+        <td>
+            <%
+                String path;
+            if (cb.getRealPath() != null) {
+                path = cb.getRealPath();
+            } else {
+                path = cb.getPathWithVersion();
+            }
+            if (path.startsWith("http")) {
+                %>
+                <a class="icon-link" style="background-image:url(../resources/images/icon-download.jpg);"
+		           href="<%=path%>"
+		           target="_blank"><fmt:message key="download"/></a>
+       <%
+            } else {
+        %>
+	    <a class="icon-link" style="background-image:url(../resources/images/icon-download.jpg);"
+		           href="<%=ThemeUtil.getThemeResourceDownloadURL(path)%>"
+		           target="_blank"><fmt:message key="download"/></a>
+	    <% }
+            %>
+        </td>
+        </tr>
+        </table>
+        <br/>
+        <br/>
+
+        <div id="generalContentDiv" style="display:block;">
+            <%
+                String imageViewLink = path;
+                if (!path.startsWith("http")) {
+                    imageViewLink = ThemeUtil.getThemeResourceViewAsImageURL(path);     
+                }
+            %>
+            <img src="<%=imageViewLink%>" alt="The Image for <%=path%>"/> 
+        </div>
+
+        <% } else {
+        %>
+
+        <table style="*width:340px !important;">
+        <tr>
+        <td>
+        <a onclick="displayThemeContentAsText('<%=cb.getPathWithVersion()%>')" class="icon-link" style="background-image:url(../admin/images/view.gif);"><fmt:message
+                key="display.as.text"/></a>
+        </td>
+        <% if (cb.getPutAllowed() && !cb.getVersionView()) { %>
+        <td style="vertical-align:middle;padding-left:5px;">|</td>
+        <td>
+        <a onclick="displayEditThemeContentAsText('<%=cb.getPathWithVersion()%>')" class="icon-link" style="background-image:url(../admin/images/edit.gif);"><fmt:message
+                key="edit.as.text"/></a>
+        </td>
+        <% } %>
+        <td style="vertical-align:middle;padding-left:5px;">|</td>
+        <td>
+            <%
+                String path;
+            if (cb.getRealPath() != null) {
+                path = cb.getRealPath();
+            } else {
+                path = cb.getPathWithVersion();
+            }
+            if (path.startsWith("http")) {
+                %>
+                <a class="icon-link" style="background-image:url(../resources/images/icon-download.jpg);"
+		           href="<%=path%>"
+		           target="_blank"><fmt:message key="download"/></a>
+       <%
+            } else {
+        %>
+	    <a class="icon-link" style="background-image:url(../resources/images/icon-download.jpg);"
+		           href="<%=ThemeUtil.getThemeResourceDownloadURL(path)%>"
+		           target="_blank"><fmt:message key="download"/></a>
+	    <% }
+            %>
+        </td>
+        </tr>
+        </table>
+        <br/>
+        <br/>
+
+        <div id="generalContentDiv" style="display:none;">
+        </div>
+
+        <% }
+        } %>
+
+    </div>
+ <%}%>
+</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css-editor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css-editor.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css-editor.jsp
new file mode 100644
index 0000000..c83c95e
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css-editor.jsp
@@ -0,0 +1,59 @@
+    <!--
+      ~ 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" %>
+<%
+    java.lang.String[] imagePaths = {"test1", "test2"};
+
+    String cookie = (String) request.
+            getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+
+    try {
+        ThemeMgtServiceClient client =
+                new ThemeMgtServiceClient(cookie, config, request.getSession());
+        imagePaths = client.getAllPaths();
+
+
+    } catch (Exception e) {
+        String type = "resource";
+        response.setStatus(500);
+        out.write("Fail to get image paths");
+        return;
+    }
+%>
+<script type="text/javascript">
+    var imagePaths = new Array();
+    <%
+    for(int i=0;i<imagePaths.length;i++){
+    %>
+    imagePaths.push("<%=imagePaths[i]%>");
+    <%
+    } %>
+</script>
+
+<div class="box1-head">
+</div>
+<div class="box1-mid">
+    <div id="cssEditorDiv">
+        <script type="text/javascript">
+            cssEditorDisplay("/main.css", "cssEditorDiv",imagePaths);
+        </script>
+    </div>
+</div>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/loginpage.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/loginpage.css b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/loginpage.css
new file mode 100644
index 0000000..430f1a1
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/loginpage.css
@@ -0,0 +1,110 @@
+.gou-page{
+    background-image: url(../images/page-back.jpg);
+    background-position: 0px 0px;
+    background-repeat:repeat-x;
+    background-color:#5b4e17;
+}
+.gou-header{
+    background-image: url(../images/header.jpg);
+    background-position: top right;
+    background-repeat:no-repeat;
+}
+.gou-logo{
+    background-image: url(../images/logo.jpg);
+    background-position: top right;
+    background-repeat:no-repeat;
+    width:387px;
+    height:89px;
+}
+.gou-page-sizer{
+    width:100%;
+}
+.gou-content{
+    background-image: url(../images/content-back.jpg);
+    background-position: 0px 0px;
+    background-repeat:repeat-x;
+    background-color:#ffffff;
+    border:solid 1px #eafde6;
+    margin-left:10px;
+    margin-right:10px;
+}
+.gou-content-img{
+    background-image: url(../images/content-back-left.jpg);
+    background-position: 0px 0px;
+    background-repeat:no-repeat;
+    padding-top:20px;
+    padding-left:20px;
+    padding-right:20px;
+    padding-bottom:20px;
+
+}
+.gou-footer{
+    background-image: url(../images/footer.jpg);
+    background-position: 0px 0px;
+    background-repeat:repeat-x;
+    border-bottom:solid 1px #eafde6;
+    height:42px;
+    color:#ffffff;
+    font-size:10px;
+    line-height:40px;
+    padding-left:10px;
+}
+.gou-input-text{
+    height:18px;
+    font-size:10.5px;
+    border:solid 1px #cccccc;
+    width:200px;
+}
+.gou-input-button{
+       background-image: url(../images/button-back.gif);
+    background-position: 0px 0px;
+    background-repeat:repeat-x;
+    height:22px;
+    color:#ffffff;
+    background-color:#515151;
+}
+.gou-content-box{
+    padding:15px;
+    background-color:#ffffff;
+    border:solid 1px #4f301c;
+    margin-right:20px;
+}
+.gou-h1,.gou-h1 a{
+    font-size:16px;
+    font-weight:bold;
+    color:#ffffff;
+}
+.gou-content-text{
+    font-size:11px;
+    color:#636363;
+}
+body, td, th,h1, h2, div{
+    font-family:Helvetica,Arial,Sans-serif;
+    font-size:11px;
+    padding:0px;
+    margin:0px;
+}
+.gou-login-table td{
+    padding-right:20px;
+    padding-top:10px;
+}
+.gou-form-label{
+    font-color:#3b3b3b;
+    font-size:12px;
+}
+.gou-sign-in{
+    padding-left:5px;
+    color:#1b676b;
+    height:40px;
+    text-decoration:none;
+}
+.gou-links-table img{
+    border: none;
+}
+.gou-links-table td{
+    padding-bottom:20px;
+    padding-left:20px;
+}
+.gou-links-table a{
+    text-decoration:none;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/tenant.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/tenant.css b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/tenant.css
new file mode 100644
index 0000000..8f211b8
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/tenant.css
@@ -0,0 +1,74 @@
+/*css editor styles */
+.csseditor-top-line{
+    background-color:black;
+    height:5px;
+}
+.csseditor-leftbox{
+    background-color:#e6e6e6;
+    padding-left:5px;
+    padding-right:5px;
+    padding-bottom:5px;
+    padding-top:15px;
+   height:380px;
+}
+.csseditor-leftbox-top{
+    color:#000000;
+    font-size:18px;
+    height:30px;
+}
+.csseditor-textbox{
+    background-color:#dfe7ed;
+    border:solid 1px #ffffff;
+    width:100%;
+}
+.csseditor-rightbox{
+    background-color:#f3f3f3;
+    border:solid 1px #ffffff;
+    height:400px;
+}
+.csseditor-rightbox-title{
+    background-color:#9a9a9a;
+    height:25px;
+    color:#ffffff;
+    padding-left:10px;
+    padding-top:5px;
+}
+.csseditor-searchbox{
+    padding-left:10px;
+    padding-top:10px;
+}
+.csseditor-right{
+    width:320px;
+}
+#flickr_results{
+    height:210px;
+    overflow-y:auto;
+    overflow-x:hidden;
+    margin-left:5px;
+    margin-right:5px;
+    border:solid 1px #ffffff;
+}
+.flicker_selected{
+    height:20px;
+    border:solid 1px #cccccc;
+    background-color:#ffffff;
+    color:#333333;
+    padding:5px;
+    margin-top:5px;
+    margin-bottom:5px;
+}
+.imageList{
+}
+.imageList li {
+    padding-top: 3px !important;
+    padding-left: 5px !important;
+    background-color: #e1e9ec;
+    border: solid 1px #b5bdc1;
+}
+
+.imageList li a {
+    background-image: url(../images/images.gif);
+    background-repeat: no-repeat;
+    padding-left: 20px;
+    text-indent: 50px;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/tenent-theme.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/tenent-theme.css b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/tenent-theme.css
new file mode 100644
index 0000000..c3397db
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/tenent-theme.css
@@ -0,0 +1,32 @@
+.sel-box{
+	background-image:url(../images/sel-02.jpg);
+	background-repeat:repeat-x;
+	background-position:0 0;
+	background-color:#f2f2f2;
+	border: inset 2px #48657a;
+	padding:3px;
+	float:left;
+	margin-right:20px;
+	margin-bottom:20px;
+}
+.sel-box span{
+	color:#1c475f;
+	font-weight:bold;
+	text-align:center;
+	font-size:14px;
+	line-height:30px;
+}
+.nor-box{
+	background-color:#ffffff;
+	border: solid 1px #7699b3;
+	padding:3px;
+	float:left;
+	margin-right:20px;
+	margin-bottom:20px;
+}
+.nor-box span{
+	color:#1c475f;
+	font-weight:bold;
+	text-align:center;
+	line-height:30px;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/theme-mgt.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/theme-mgt.css b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/theme-mgt.css
new file mode 100644
index 0000000..18f7aac
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/css/theme-mgt.css
@@ -0,0 +1,16 @@
+.subcontent {
+    padding:5px 0px 5px; 0px
+}
+
+.subtopic {
+    padding:10px 0px 5px; 0px;
+    border-bottom:1px solid #000000;
+    font-size:140%;
+    font-weight:normal;
+    margin-bottom:10px;
+    margin-top:5px;
+}
+
+.green-note {
+    color: #058000;    
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/delete_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/delete_ajaxprocessor.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/delete_ajaxprocessor.jsp
new file mode 100644
index 0000000..2ab58d2
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/delete_ajaxprocessor.jsp
@@ -0,0 +1,48 @@
+<!--
+  ~ 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.resource.ui.processors.DeleteProcessor" %>
+<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
+<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
+<%@ page import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+    String errorMessage = null;
+    String pathToDelete = request.getParameter("pathToDelete");
+
+     String cookie = (String) request.
+            getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+
+    try {
+        ThemeMgtServiceClient client =
+                new ThemeMgtServiceClient(cookie, config, request.getSession());
+        client.delete(pathToDelete);
+    } catch (Exception e) {
+        String msg = "Failed to delete " + pathToDelete + ". " + e.getMessage();
+        errorMessage = new Exception(msg, e).getMessage();
+    }
+
+%>
+
+<% if (errorMessage != null) { %>
+
+<script type="text/javascript">
+	location.href='../error.jsp?errorMsg=<%=errorMessage%>'
+</script>
+
+<% } %>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/display_text_content_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/display_text_content_ajaxprocessor.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/display_text_content_ajaxprocessor.jsp
new file mode 100644
index 0000000..5794b14
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/display_text_content_ajaxprocessor.jsp
@@ -0,0 +1,48 @@
+<!--
+  ~ 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.utils.ServerConstants" %>
+<%@ page import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+<fmt:bundle basename="org.wso2.carbon.registry.resource.ui.i18n.Resources">
+    <%
+        String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+
+        String textContent;
+        try {
+            ThemeMgtServiceClient client = new ThemeMgtServiceClient(cookie, config, session);
+            textContent = client.getTextContent(request);
+        } catch (Exception e) {
+            response.setStatus(500);
+    %><%=e.getMessage()%><%
+        return;
+    }
+%>
+
+    <br/>
+    <textarea rows="15" cols="70" readonly="readonly"><%=textContent%></textarea>
+    <br/>
+    <input type='button' class='button' id="cancelContentButtonID"
+           onclick='cancelTextContentDisplay()'
+           value='<fmt:message key="done"/>'/>
+    <br/>
+
+</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/change-logo.png
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/change-logo.png b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/change-logo.png
new file mode 100644
index 0000000..528fb26
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/change-logo.png differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/edit-theme.png
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/edit-theme.png b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/edit-theme.png
new file mode 100644
index 0000000..cebe21c
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/edit-theme.png differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/select-theme.png
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/select-theme.png b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/select-theme.png
new file mode 100644
index 0000000..0c10585
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/select-theme.png differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/userguide.html
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/userguide.html b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/userguide.html
new file mode 100644
index 0000000..dc14f10
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/userguide.html
@@ -0,0 +1,78 @@
+<!--
+  ~ 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.
+  -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+  <title>Theme Management UI - User Guide</title>
+  <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+
+<body>
+<h1>Theme Management UI </h1>
+
+<p>
+You can configure the themes of the UI from this page. This theme will be common to all users under your organization. </p>
+
+<p>
+This provides several sections that allow you to configure
+the theme for your organization in several levels.
+</p>
+
+<h2>Change the Logo</h2>
+<p>
+    You can change the logo image of your theme (Mostly appear on the left top corner) to the logo of your organization. 
+</p>
+
+<img src="images/change-logo.png" alt="Changing the logo"/>
+<p>Figure1: The Change The Logo Section</p>
+
+<p>
+You can upload the logo image from either
+</p>
+<ul>
+    <li>
+        local file system - by selecting "Update the logo image from File"
+    </li>
+    <li>
+        Internet/network - by selecting "Upload the logo image from a URL"
+    </li>
+</ul>
+
+<h2>Select a Theme</h2>
+
+<p>
+This will show you a list of themes from where you can choose one for the theme of your organziation's account.    
+</p>
+
+<img src="images/select-theme.png" alt="Select a theme"/>
+<p>Figure2: The Select a Theme Section</p>
+
+
+<h2>Create your own themes </h2>
+<p>
+This section allows you to edit the theme. You can add/remove images + edit the main css file to change your theme.     
+</p>
+
+<em>Note: This section is visible only for users with theme-management permission. You need to login to that.</em>
+
+<img src="images/edit-theme.png" alt="Edit theme"/>
+<p>Figure3: Edit the theme</p>
+</body>
+
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/edit_text_content_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/edit_text_content_ajaxprocessor.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/edit_text_content_ajaxprocessor.jsp
new file mode 100644
index 0000000..e6841de
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/edit_text_content_ajaxprocessor.jsp
@@ -0,0 +1,97 @@
+<!--
+  ~ 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.utils.ServerConstants" %>
+<%@ page import="org.apache.stratos.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<fmt:bundle basename="org.wso2.carbon.registry.resource.ui.i18n.Resources">
+
+    <%
+        String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+
+        String path = request.getParameter("path");
+        String textContent;
+        try {
+            ThemeMgtServiceClient client = new ThemeMgtServiceClient(cookie, config, session);
+            textContent = client.getTextContent(request);
+        } catch (Exception e) {
+            response.setStatus(500);
+    %><%=e.getMessage()%><%
+        return;
+    }
+    Boolean displayCssEditor = false;
+    if(path.endsWith(".css")){
+           displayCssEditor = true;
+    }
+%>
+
+     <% if (displayCssEditor){ %>
+    <div class="csseditor-box">
+        <div class="csseditor-top-line"></div>
+        <table cellpadding="0" cellspacing="0" style="width:100%">
+            <tr>
+                <td>
+                    <div class="csseditor-leftbox">
+                        <div class="csseditor-leftbox-top">
+                            Css Editor
+                        </div>
+                        <textarea id="editTextContentID" name="content" style="width:100%;*width:98%;height:300px;"><%=textContent%></textarea>
+                    </div>
+                </td>
+                <td>
+                    <div class="csseditor-rightbox">
+                        <div class="csseditor-rightbox-title">Image Search</div>
+                        <div class="csseditor-searchbox"> Text: <input type="text" id="flickr_search"
+                                                                       onkeydown="filterImagePathPicker()"
+                                                                       style="margin-left:10px;">
+                            <p style="margin-top:10px;">Enter * to see all the available images.</p>
+                        </div>
+
+
+
+                        <div id="flickr_results" style="margin-top:10px;">
+                        </div>
+                        <div style="padding:5px;">
+
+                            Selected Image
+                            <div id="flickr_selected" class="flicker_selected"></div>
+                            <table>
+                                <tr>
+                                    <td><input class="button" type="button" value="Insert image path to css file" style="margin-right:5px;" onclick="insertImagePath()" /></td>
+                                    <td><input class="button" type="button" value="Preview Image" onclick="previewImagePath()" /></td>
+                                </tr>
+                            </table>
+                        </div>
+                    </div>
+                </td>
+            </tr>
+        </table>
+    </div>
+    <% }else { %>
+    <textarea id='editTextContentID' rows='15' cols='70'><%=textContent%></textarea>
+    <% }  %>
+    <br/>
+    <input type='button' class='button' id="saveContentButtonID" onclick='updateThemeTextContent("<%=path%>",<%=displayCssEditor%>)'
+           value='<fmt:message key="save.content"/>'/>
+    <input type='button' class='button' id="cancelContentButtonID" onclick='cancelTextContentEdit(<%=displayCssEditor%>)'
+           value='<fmt:message key="cancel"/>'/>
+    <br/>
+
+</fmt:bundle>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/ajax-loader.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/ajax-loader.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/ajax-loader.gif
new file mode 100644
index 0000000..f2a1bc0
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/ajax-loader.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/button-back.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/button-back.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/button-back.gif
new file mode 100644
index 0000000..6a52e34
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/button-back.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back-left.jpg
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back-left.jpg b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back-left.jpg
new file mode 100644
index 0000000..ebfe8ed
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back-left.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back.jpg
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back.jpg b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back.jpg
new file mode 100644
index 0000000..62b8da1
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/create-org-button.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/create-org-button.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/create-org-button.gif
new file mode 100644
index 0000000..b7e62a3
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/create-org-button.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/footer.jpg
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/footer.jpg b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/footer.jpg
new file mode 100644
index 0000000..c617091
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/footer.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/forum.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/forum.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/forum.gif
new file mode 100644
index 0000000..e92779a
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/forum.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/header.jpg
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/header.jpg b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/header.jpg
new file mode 100644
index 0000000..4438a06
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/header.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/help.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/help.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/help.gif
new file mode 100644
index 0000000..43242c2
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/help.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/images.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/images.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/images.gif
new file mode 100644
index 0000000..94b46dc
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/images.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/issue-tracker.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/issue-tracker.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/issue-tracker.gif
new file mode 100644
index 0000000..9029c12
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/issue-tracker.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logo.jpg
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logo.jpg b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logo.jpg
new file mode 100644
index 0000000..202360d
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logo.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logomgt.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logomgt.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logomgt.gif
new file mode 100644
index 0000000..9534693
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logomgt.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/mailing-list.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/mailing-list.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/mailing-list.gif
new file mode 100644
index 0000000..06d61e3
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/mailing-list.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/page-back.jpg
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/page-back.jpg b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/page-back.jpg
new file mode 100644
index 0000000..2e21b54
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/page-back.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/people.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/people.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/people.gif
new file mode 100644
index 0000000..edfa49b
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/people.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/sel-02.jpg
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/sel-02.jpg b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/sel-02.jpg
new file mode 100644
index 0000000..2e7dccf
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/sel-02.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/services.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/services.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/services.gif
new file mode 100755
index 0000000..9883116
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/services.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/thememgt.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/thememgt.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/thememgt.gif
new file mode 100644
index 0000000..e554e87
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/thememgt.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/user-guide.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/user-guide.gif b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/user-guide.gif
new file mode 100644
index 0000000..9342adc
Binary files /dev/null and b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/images/user-guide.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/import_resource_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/import_resource_ajaxprocessor.jsp b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/import_resource_ajaxprocessor.jsp
new file mode 100644
index 0000000..236d005
--- /dev/null
+++ b/components/org.apache.stratos.theme.mgt.ui/src/main/resources/web/tenant-theme/import_resource_ajaxprocessor.jsp
@@ -0,0 +1,101 @@
+<!--
+  ~ 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.axis2.util.JavaUtils" %>
+<%@ page import="org.wso2.carbon.CarbonConstants" %>
+<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
+<%@ 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 errorMessage = null;
+    boolean displayPlainError = false;
+    try {
+        displayPlainError = (request.getParameter("printerror") != null);
+
+        String parentPath = request.getParameter("parentPath");
+        String resourceName = request.getParameter("resourceName");
+        String mediaType = request.getParameter("mediaType");
+        String description = request.getParameter("description");
+        String fetchURL = request.getParameter("fetchURL");
+        String isAsync = request.getParameter("isAsync");
+        String symlinkLocation = request.getParameter("symlinkLocation");
+        String redirectWith = request.getParameter("redirectWith");
+
+        String cookie = (String) request.
+                getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+        String serverURL = (String) request.getAttribute(CarbonConstants.SERVER_URL);
+
+        try {
+            /*
+            // currently chroot will not work with multitenancy
+            ConfigurationContext configContext = (ConfigurationContext) config.
+                    getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+            IServerAdmin adminClient =
+                    (IServerAdmin) CarbonUIUtil.
+                            getServerProxy(new ServerAdminClient(configContext,
+                                    serverURL, cookie, session), IServerAdmin.class, session);
+            ServerData data = adminClient.getServerData();
+            String chroot = "";
+            if (data.getRegistryType().equals("remote") && data.getRemoteRegistryChroot() != null &&
+                    !data.getRemoteRegistryChroot().equals(RegistryConstants.PATH_SEPARATOR)) {
+                chroot = data.getRemoteRegistryChroot();
+                if (!chroot.startsWith(RegistryConstants.PATH_SEPARATOR)) {
+                    chroot = RegistryConstants.PATH_SEPARATOR + chroot;
+                }
+                if (chroot.endsWith(RegistryConstants.PATH_SEPARATOR)) {
+                    chroot = chroot.substring(0, chroot.length() - RegistryConstants.PATH_SEPARATOR.length());
+                }
+            }
+            if (symlinkLocation != null) {
+                symlinkLocation = chroot + symlinkLocation;
+            }
+            */
+            ThemeMgtServiceClient client =
+                    new ThemeMgtServiceClient(cookie, config, request.getSession());
+            if (JavaUtils.isTrueExplicitly(isAsync)) {
+                client.importResource(parentPath, resourceName, mediaType, description, fetchURL,
+                        symlinkLocation, true, redirectWith);
+            } else {
+                client.importResource(parentPath, resourceName, mediaType, description, fetchURL,
+                        symlinkLocation, false, redirectWith);
+            }
+        } catch (Exception e) {
+            String msg = "Failed to import resource " + resourceName +
+                    " to the parent collection " + parentPath + ". " + e.getMessage();
+            throw new UIException(msg, e);
+        }
+
+    } catch (Exception e) {
+        response.setStatus(500);
+        if (displayPlainError) {
+            %><%=e.getMessage()%><%
+            return;
+        }
+
+        errorMessage = e.getMessage();
+    }
+%>
+
+<% if (errorMessage != null) { %>
+
+<script type="text/javascript">
+    location.href='../error.jsp?errorMsg=<%=errorMessage%>'
+</script>
+
+<% } %>


[02/22] refactoring theme-mgt components, service stub and changing service stub parent name to stratos-service-stubs-parent

Posted by la...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/service-stubs/org.apache.stratos.theme.mgt.stub/src/main/resources/ThemeMgtService.wsdl
----------------------------------------------------------------------
diff --git a/service-stubs/org.apache.stratos.theme.mgt.stub/src/main/resources/ThemeMgtService.wsdl b/service-stubs/org.apache.stratos.theme.mgt.stub/src/main/resources/ThemeMgtService.wsdl
new file mode 100644
index 0000000..1284f4a
--- /dev/null
+++ b/service-stubs/org.apache.stratos.theme.mgt.stub/src/main/resources/ThemeMgtService.wsdl
@@ -0,0 +1,1146 @@
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://services.mgt.theme.stratos.apache.org" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax25="http://common.registry.carbon.wso2.org/xsd" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax23="http://beans.resource.registry.carbon.wso2.org/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://services.mgt.theme.stratos.apache.org">
+    <wsdl:documentation>ThemeMgtService</wsdl:documentation>
+    <wsdl:types>
+        <xs:schema xmlns:ax27="http://common.registry.carbon.wso2.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://beans.resource.registry.carbon.wso2.org/xsd">
+            <xs:import namespace="http://common.registry.carbon.wso2.org/xsd"/>
+            <xs:complexType name="ResourceTreeEntryBean">
+                <xs:sequence>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="children" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="collection" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="symlink" nillable="true" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="MetadataBean">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="activeResourcePath" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="author" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="collection" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="contentPath" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="deleteLocked" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="formattedCreatedOn" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="formattedLastModified" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="lastUpdater" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="navigatablePaths" nillable="true" type="ax27:WebResourcePath"/>
+                    <xs:element minOccurs="0" name="path" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="pathWithVersion" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="permalink" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="putAllowed" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="resourceVersion" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="serverBaseURL" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="versionView" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="writeLocked" nillable="true" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="ContentDownloadBean">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="content" nillable="true" type="xs:base64Binary"/>
+                    <xs:element minOccurs="0" name="lastUpdatedTime" nillable="true" type="xs:dateTime"/>
+                    <xs:element minOccurs="0" name="mediatype" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="resourceName" nillable="true" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="ContentBean">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="absent" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="collection" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="contentPath" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="loggedIn" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="pathWithVersion" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="putAllowed" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="realPath" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="versionView" type="xs:boolean"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="CollectionContentBean">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="childCount" type="xs:int"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="childPaths" nillable="true" type="xs:string"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="collectionTypes" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="pathWithVersion" nillable="true" type="xs:string"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="remoteInstances" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="versionView" type="xs:boolean"/>
+                </xs:sequence>
+            </xs:complexType>
+        </xs:schema>
+        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://common.registry.carbon.wso2.org/xsd">
+            <xs:complexType name="ResourceData">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="absent" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="authorUserName" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="averageRating" type="xs:float"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="averageStars" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="createdOn" nillable="true" type="xs:dateTime"/>
+                    <xs:element minOccurs="0" name="deleteAllowed" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="externalLink" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="formattedCreatedOn" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="getAllowed" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="link" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="mounted" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="putAllowed" type="xs:boolean"/>
+                    <xs:element minOccurs="0" name="realPath" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="relativePath" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="resourcePath" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="resourceType" nillable="true" type="xs:string"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="tagCounts" nillable="true" type="ax25:TagCount"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="TagCount">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="key" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="value" nillable="true" type="xs:long"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:complexType name="WebResourcePath">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="navigateName" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="navigatePath" nillable="true" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+        </xs:schema>
+        <xs:schema xmlns:ax26="http://common.registry.carbon.wso2.org/xsd" xmlns:ax24="http://beans.resource.registry.carbon.wso2.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.mgt.theme.stratos.apache.org">
+            <xs:import namespace="http://beans.resource.registry.carbon.wso2.org/xsd"/>
+            <xs:import namespace="http://common.registry.carbon.wso2.org/xsd"/>
+            <xs:element name="ThemeMgtServiceException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="ThemeMgtServiceException" nillable="true" type="ns:Exception"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:complexType name="Exception">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="updateTextContent">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="resourcePath" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="contentText" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="renameResource">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="parentPath" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="oldResourcePath" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="newResourceName" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="importResource">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="parentPath" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="resourceName" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="fetchURL" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="symlinkLocation" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="tenantPass" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getTextContent">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getTextContentResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getSessionResourcePath">
+                <xs:complexType>
+                    <xs:sequence/>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getSessionResourcePathResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getResourceTreeEntry">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="resourcePath" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getResourceTreeEntryResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax23:ResourceTreeEntryBean"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getResourceData">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="paths" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getResourceDataResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="ax25:ResourceData"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getMetadata">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getMetadataResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax23:MetadataBean"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getContentDownloadBean">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getContentDownloadBeanResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax23:ContentDownloadBean"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getContentBean">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getContentBeanResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax23:ContentBean"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getCollectionContent">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getCollectionContentResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax23:CollectionContentBean"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getAllThemes">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="tenantPass" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getAllThemesResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getAllPaths">
+                <xs:complexType>
+                    <xs:sequence/>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getAllPathsResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="delete">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="pathToDelete" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="applyTheme">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="themeName" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="tenantPass" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="addTextResource">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="parentPath" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="fileName" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="content" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="addResource">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="path" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="content" nillable="true" type="xs:base64Binary"/>
+                        <xs:element minOccurs="0" name="symlinkLocation" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="tenantPass" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="addCollection">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="parentPath" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="collectionName" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="mediaType" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="description" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="addCollectionResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="deleteRequest">
+        <wsdl:part name="parameters" element="ns:delete"/>
+    </wsdl:message>
+    <wsdl:message name="deleteResponse"/>
+    <wsdl:message name="ThemeMgtServiceException">
+        <wsdl:part name="parameters" element="ns:ThemeMgtServiceException"/>
+    </wsdl:message>
+    <wsdl:message name="getContentBeanRequest">
+        <wsdl:part name="parameters" element="ns:getContentBean"/>
+    </wsdl:message>
+    <wsdl:message name="getContentBeanResponse">
+        <wsdl:part name="parameters" element="ns:getContentBeanResponse"/>
+    </wsdl:message>
+    <wsdl:message name="getContentDownloadBeanRequest">
+        <wsdl:part name="parameters" element="ns:getContentDownloadBean"/>
+    </wsdl:message>
+    <wsdl:message name="getContentDownloadBeanResponse">
+        <wsdl:part name="parameters" element="ns:getContentDownloadBeanResponse"/>
+    </wsdl:message>
+    <wsdl:message name="getResourceDataRequest">
+        <wsdl:part name="parameters" element="ns:getResourceData"/>
+    </wsdl:message>
+    <wsdl:message name="getResourceDataResponse">
+        <wsdl:part name="parameters" element="ns:getResourceDataResponse"/>
+    </wsdl:message>
+    <wsdl:message name="getResourceTreeEntryRequest">
+        <wsdl:part name="parameters" element="ns:getResourceTreeEntry"/>
+    </wsdl:message>
+    <wsdl:message name="getResourceTreeEntryResponse">
+        <wsdl:part name="parameters" element="ns:getResourceTreeEntryResponse"/>
+    </wsdl:message>
+    <wsdl:message name="addTextResourceRequest">
+        <wsdl:part name="parameters" element="ns:addTextResource"/>
+    </wsdl:message>
+    <wsdl:message name="addTextResourceResponse"/>
+    <wsdl:message name="importResourceRequest">
+        <wsdl:part name="parameters" element="ns:importResource"/>
+    </wsdl:message>
+    <wsdl:message name="importResourceResponse"/>
+    <wsdl:message name="updateTextContentRequest">
+        <wsdl:part name="parameters" element="ns:updateTextContent"/>
+    </wsdl:message>
+    <wsdl:message name="updateTextContentResponse"/>
+    <wsdl:message name="getSessionResourcePathRequest">
+        <wsdl:part name="parameters" element="ns:getSessionResourcePath"/>
+    </wsdl:message>
+    <wsdl:message name="getSessionResourcePathResponse">
+        <wsdl:part name="parameters" element="ns:getSessionResourcePathResponse"/>
+    </wsdl:message>
+    <wsdl:message name="getMetadataRequest">
+        <wsdl:part name="parameters" element="ns:getMetadata"/>
+    </wsdl:message>
+    <wsdl:message name="getMetadataResponse">
+        <wsdl:part name="parameters" element="ns:getMetadataResponse"/>
+    </wsdl:message>
+    <wsdl:message name="addCollectionRequest">
+        <wsdl:part name="parameters" element="ns:addCollection"/>
+    </wsdl:message>
+    <wsdl:message name="addCollectionResponse">
+        <wsdl:part name="parameters" element="ns:addCollectionResponse"/>
+    </wsdl:message>
+    <wsdl:message name="renameResourceRequest">
+        <wsdl:part name="parameters" element="ns:renameResource"/>
+    </wsdl:message>
+    <wsdl:message name="renameResourceResponse"/>
+    <wsdl:message name="addResourceRequest">
+        <wsdl:part name="parameters" element="ns:addResource"/>
+    </wsdl:message>
+    <wsdl:message name="addResourceResponse"/>
+    <wsdl:message name="applyThemeRequest">
+        <wsdl:part name="parameters" element="ns:applyTheme"/>
+    </wsdl:message>
+    <wsdl:message name="applyThemeResponse"/>
+    <wsdl:message name="getCollectionContentRequest">
+        <wsdl:part name="parameters" element="ns:getCollectionContent"/>
+    </wsdl:message>
+    <wsdl:message name="getCollectionContentResponse">
+        <wsdl:part name="parameters" element="ns:getCollectionContentResponse"/>
+    </wsdl:message>
+    <wsdl:message name="getAllThemesRequest">
+        <wsdl:part name="parameters" element="ns:getAllThemes"/>
+    </wsdl:message>
+    <wsdl:message name="getAllThemesResponse">
+        <wsdl:part name="parameters" element="ns:getAllThemesResponse"/>
+    </wsdl:message>
+    <wsdl:message name="getAllPathsRequest">
+        <wsdl:part name="parameters" element="ns:getAllPaths"/>
+    </wsdl:message>
+    <wsdl:message name="getAllPathsResponse">
+        <wsdl:part name="parameters" element="ns:getAllPathsResponse"/>
+    </wsdl:message>
+    <wsdl:message name="getTextContentRequest">
+        <wsdl:part name="parameters" element="ns:getTextContent"/>
+    </wsdl:message>
+    <wsdl:message name="getTextContentResponse">
+        <wsdl:part name="parameters" element="ns:getTextContentResponse"/>
+    </wsdl:message>
+    <wsdl:portType name="ThemeMgtServicePortType">
+        <wsdl:operation name="delete">
+            <wsdl:input message="ns:deleteRequest" wsaw:Action="urn:delete"/>
+            <wsdl:output message="ns:deleteResponse" wsaw:Action="urn:deleteResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:deleteThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="getContentBean">
+            <wsdl:input message="ns:getContentBeanRequest" wsaw:Action="urn:getContentBean"/>
+            <wsdl:output message="ns:getContentBeanResponse" wsaw:Action="urn:getContentBeanResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getContentBeanThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="getContentDownloadBean">
+            <wsdl:input message="ns:getContentDownloadBeanRequest" wsaw:Action="urn:getContentDownloadBean"/>
+            <wsdl:output message="ns:getContentDownloadBeanResponse" wsaw:Action="urn:getContentDownloadBeanResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getContentDownloadBeanThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="getResourceData">
+            <wsdl:input message="ns:getResourceDataRequest" wsaw:Action="urn:getResourceData"/>
+            <wsdl:output message="ns:getResourceDataResponse" wsaw:Action="urn:getResourceDataResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getResourceDataThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="getResourceTreeEntry">
+            <wsdl:input message="ns:getResourceTreeEntryRequest" wsaw:Action="urn:getResourceTreeEntry"/>
+            <wsdl:output message="ns:getResourceTreeEntryResponse" wsaw:Action="urn:getResourceTreeEntryResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getResourceTreeEntryThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="addTextResource">
+            <wsdl:input message="ns:addTextResourceRequest" wsaw:Action="urn:addTextResource"/>
+            <wsdl:output message="ns:addTextResourceResponse" wsaw:Action="urn:addTextResourceResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:addTextResourceThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="importResource">
+            <wsdl:input message="ns:importResourceRequest" wsaw:Action="urn:importResource"/>
+            <wsdl:output message="ns:importResourceResponse" wsaw:Action="urn:importResourceResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:importResourceThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="updateTextContent">
+            <wsdl:input message="ns:updateTextContentRequest" wsaw:Action="urn:updateTextContent"/>
+            <wsdl:output message="ns:updateTextContentResponse" wsaw:Action="urn:updateTextContentResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:updateTextContentThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="getSessionResourcePath">
+            <wsdl:input message="ns:getSessionResourcePathRequest" wsaw:Action="urn:getSessionResourcePath"/>
+            <wsdl:output message="ns:getSessionResourcePathResponse" wsaw:Action="urn:getSessionResourcePathResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getSessionResourcePathThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="getMetadata">
+            <wsdl:input message="ns:getMetadataRequest" wsaw:Action="urn:getMetadata"/>
+            <wsdl:output message="ns:getMetadataResponse" wsaw:Action="urn:getMetadataResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getMetadataThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="addCollection">
+            <wsdl:input message="ns:addCollectionRequest" wsaw:Action="urn:addCollection"/>
+            <wsdl:output message="ns:addCollectionResponse" wsaw:Action="urn:addCollectionResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:addCollectionThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="renameResource">
+            <wsdl:input message="ns:renameResourceRequest" wsaw:Action="urn:renameResource"/>
+            <wsdl:output message="ns:renameResourceResponse" wsaw:Action="urn:renameResourceResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:renameResourceThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="addResource">
+            <wsdl:input message="ns:addResourceRequest" wsaw:Action="urn:addResource"/>
+            <wsdl:output message="ns:addResourceResponse" wsaw:Action="urn:addResourceResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:addResourceThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="applyTheme">
+            <wsdl:input message="ns:applyThemeRequest" wsaw:Action="urn:applyTheme"/>
+            <wsdl:output message="ns:applyThemeResponse" wsaw:Action="urn:applyThemeResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:applyThemeThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="getCollectionContent">
+            <wsdl:input message="ns:getCollectionContentRequest" wsaw:Action="urn:getCollectionContent"/>
+            <wsdl:output message="ns:getCollectionContentResponse" wsaw:Action="urn:getCollectionContentResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getCollectionContentThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="getAllThemes">
+            <wsdl:input message="ns:getAllThemesRequest" wsaw:Action="urn:getAllThemes"/>
+            <wsdl:output message="ns:getAllThemesResponse" wsaw:Action="urn:getAllThemesResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getAllThemesThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="getAllPaths">
+            <wsdl:input message="ns:getAllPathsRequest" wsaw:Action="urn:getAllPaths"/>
+            <wsdl:output message="ns:getAllPathsResponse" wsaw:Action="urn:getAllPathsResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getAllPathsThemeMgtServiceException"/>
+        </wsdl:operation>
+        <wsdl:operation name="getTextContent">
+            <wsdl:input message="ns:getTextContentRequest" wsaw:Action="urn:getTextContent"/>
+            <wsdl:output message="ns:getTextContentResponse" wsaw:Action="urn:getTextContentResponse"/>
+            <wsdl:fault message="ns:ThemeMgtServiceException" name="ThemeMgtServiceException" wsaw:Action="urn:getTextContentThemeMgtServiceException"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="ThemeMgtServiceSoap11Binding" type="ns:ThemeMgtServicePortType">
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+        <wsdl:operation name="delete">
+            <soap:operation soapAction="urn:delete" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getContentBean">
+            <soap:operation soapAction="urn:getContentBean" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getContentDownloadBean">
+            <soap:operation soapAction="urn:getContentDownloadBean" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getResourceData">
+            <soap:operation soapAction="urn:getResourceData" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getResourceTreeEntry">
+            <soap:operation soapAction="urn:getResourceTreeEntry" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="importResource">
+            <soap:operation soapAction="urn:importResource" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="addTextResource">
+            <soap:operation soapAction="urn:addTextResource" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="updateTextContent">
+            <soap:operation soapAction="urn:updateTextContent" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getMetadata">
+            <soap:operation soapAction="urn:getMetadata" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getSessionResourcePath">
+            <soap:operation soapAction="urn:getSessionResourcePath" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="addCollection">
+            <soap:operation soapAction="urn:addCollection" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="addResource">
+            <soap:operation soapAction="urn:addResource" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="renameResource">
+            <soap:operation soapAction="urn:renameResource" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="applyTheme">
+            <soap:operation soapAction="urn:applyTheme" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getCollectionContent">
+            <soap:operation soapAction="urn:getCollectionContent" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getAllThemes">
+            <soap:operation soapAction="urn:getAllThemes" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getAllPaths">
+            <soap:operation soapAction="urn:getAllPaths" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getTextContent">
+            <soap:operation soapAction="urn:getTextContent" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="ThemeMgtServiceSoap12Binding" type="ns:ThemeMgtServicePortType">
+        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+        <wsdl:operation name="delete">
+            <soap12:operation soapAction="urn:delete" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getContentBean">
+            <soap12:operation soapAction="urn:getContentBean" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getContentDownloadBean">
+            <soap12:operation soapAction="urn:getContentDownloadBean" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getResourceData">
+            <soap12:operation soapAction="urn:getResourceData" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getResourceTreeEntry">
+            <soap12:operation soapAction="urn:getResourceTreeEntry" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="importResource">
+            <soap12:operation soapAction="urn:importResource" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="addTextResource">
+            <soap12:operation soapAction="urn:addTextResource" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="updateTextContent">
+            <soap12:operation soapAction="urn:updateTextContent" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getMetadata">
+            <soap12:operation soapAction="urn:getMetadata" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getSessionResourcePath">
+            <soap12:operation soapAction="urn:getSessionResourcePath" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="addCollection">
+            <soap12:operation soapAction="urn:addCollection" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="addResource">
+            <soap12:operation soapAction="urn:addResource" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="renameResource">
+            <soap12:operation soapAction="urn:renameResource" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="applyTheme">
+            <soap12:operation soapAction="urn:applyTheme" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getCollectionContent">
+            <soap12:operation soapAction="urn:getCollectionContent" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getAllThemes">
+            <soap12:operation soapAction="urn:getAllThemes" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getAllPaths">
+            <soap12:operation soapAction="urn:getAllPaths" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getTextContent">
+            <soap12:operation soapAction="urn:getTextContent" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="ThemeMgtServiceException">
+                <soap12:fault use="literal" name="ThemeMgtServiceException"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="ThemeMgtServiceHttpBinding" type="ns:ThemeMgtServicePortType">
+        <http:binding verb="POST"/>
+        <wsdl:operation name="delete">
+            <http:operation location="delete"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getContentBean">
+            <http:operation location="getContentBean"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getContentDownloadBean">
+            <http:operation location="getContentDownloadBean"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getResourceData">
+            <http:operation location="getResourceData"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getResourceTreeEntry">
+            <http:operation location="getResourceTreeEntry"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="importResource">
+            <http:operation location="importResource"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="addTextResource">
+            <http:operation location="addTextResource"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="updateTextContent">
+            <http:operation location="updateTextContent"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getMetadata">
+            <http:operation location="getMetadata"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getSessionResourcePath">
+            <http:operation location="getSessionResourcePath"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="addCollection">
+            <http:operation location="addCollection"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="addResource">
+            <http:operation location="addResource"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="renameResource">
+            <http:operation location="renameResource"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="applyTheme">
+            <http:operation location="applyTheme"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getCollectionContent">
+            <http:operation location="getCollectionContent"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getAllThemes">
+            <http:operation location="getAllThemes"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getAllPaths">
+            <http:operation location="getAllPaths"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getTextContent">
+            <http:operation location="getTextContent"/>
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="ThemeMgtService">
+        <wsdl:port name="ThemeMgtServiceHttpsSoap11Endpoint" binding="ns:ThemeMgtServiceSoap11Binding">
+            <soap:address location="https://192.168.122.1:9444/services/ThemeMgtService.ThemeMgtServiceHttpsSoap11Endpoint/"/>
+        </wsdl:port>
+        <wsdl:port name="ThemeMgtServiceHttpsSoap12Endpoint" binding="ns:ThemeMgtServiceSoap12Binding">
+            <soap12:address location="https://192.168.122.1:9444/services/ThemeMgtService.ThemeMgtServiceHttpsSoap12Endpoint/"/>
+        </wsdl:port>
+        <wsdl:port name="ThemeMgtServiceHttpsEndpoint" binding="ns:ThemeMgtServiceHttpBinding">
+            <http:address location="https://192.168.122.1:9444/services/ThemeMgtService.ThemeMgtServiceHttpsEndpoint/"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6330834/service-stubs/org.wso2.carbon.theme.mgt.stub/4.1.0/pom.xml
----------------------------------------------------------------------
diff --git a/service-stubs/org.wso2.carbon.theme.mgt.stub/4.1.0/pom.xml b/service-stubs/org.wso2.carbon.theme.mgt.stub/4.1.0/pom.xml
deleted file mode 100644
index 3135eaa..0000000
--- a/service-stubs/org.wso2.carbon.theme.mgt.stub/4.1.0/pom.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-# Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
-#
-# Licensed 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.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <parent>
-        <groupId>org.wso2.carbon</groupId>
-        <artifactId>carbon-service-stubs</artifactId>
-        <version>4.1.0</version>
-<relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.wso2.carbon.theme.mgt.stub</artifactId>
-    <packaging>bundle</packaging>
-    <name>WSO2 Stratos - Theme Configuration User Interface</name>
-
-    <build>
-
-        <plugins>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
-                </configuration>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <version>1.1</version>
-                <executions>
-                    <execution>
-                        <id>source-code-generation</id>
-                        <phase>process-resources</phase>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                        <configuration>
-                            <tasks>
-                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
-                                    <arg line="-uri src/main/resources/ThemeMgtService.wsdl -u -uw -o target/generated-code
-                                    -p org.wso2.carbon.theme.mgt.stub
-                                    -ns2p http://services.mgt.theme.carbon.wso2.org=org.wso2.carbon.theme.mgt.stub.services,http://utils.services.resource.registry.carbon.wso2.org/xsd=org.wso2.carbon.theme.mgt.stub.registry.resource.stub.services.utils.xsd,http://common.registry.carbon.wso2.org/xsd=org.wso2.carbon.theme.mgt.stub.registry.resource.stub.common.xsd,http://beans.resource.registry.carbon.wso2.org/xsd=org.wso2.carbon.theme.mgt.stub.registry.resource.stub.beans.xsd,http://services.resource.registry.carbon.wso2.org=org.wso2.carbon.theme.mgt.stub.registry.resource.stub.services"/>
-                                    <classpath refid="maven.dependency.classpath"/>
-                                    <classpath refid="maven.compile.classpath"/>
-                                    <classpath refid="maven.runtime.classpath"/>
-                                </java>
-                            </tasks>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-	    
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>add-source</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>add-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <source>target/generated-code/src</source>
-                            </sources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Name>${project.artifactId}</Bundle-Name>
-                        <Export-Package>
-                            org.wso2.carbon.theme.mgt.stub.*; version="${carbon.platform.package.export.version}",
-                        </Export-Package>
-                        <Import-Package>
-                            !org.wso2.carbon.theme.mgt.stub.*;
-                            *;resolution:=optional
-                        </Import-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-
-        </plugins>
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.axis2.wso2</groupId>
-            <artifactId>axis2</artifactId>
-        </dependency>
-    </dependencies>
-
-</project>