[wsas-java-dev] svn commit r3461 - in trunk/wsas/java/modules: core/src/org/wso2/wsas/transport/fileupload www/extensions/core/xslt

svn at wso2.org svn at wso2.org
Sun Jun 3 11:59:10 PDT 2007


Author: sumedha
Date: Sun Jun  3 11:59:01 2007
New Revision: 3461

Modified:
   trunk/wsas/java/modules/core/src/org/wso2/wsas/transport/fileupload/ServiceFileUploadExecutor.java
   trunk/wsas/java/modules/www/extensions/core/xslt/list_services.xsl
Log:
Allowed to deploy .dbs file as a service

Modified: trunk/wsas/java/modules/core/src/org/wso2/wsas/transport/fileupload/ServiceFileUploadExecutor.java
==============================================================================
--- trunk/wsas/java/modules/core/src/org/wso2/wsas/transport/fileupload/ServiceFileUploadExecutor.java	(original)
+++ trunk/wsas/java/modules/core/src/org/wso2/wsas/transport/fileupload/ServiceFileUploadExecutor.java	Sun Jun  3 11:59:01 2007
@@ -40,7 +40,8 @@
     private static final String[] ALLOWED_SERVICE_EXTENSIONS =
             new String[]{".aar",
                          ".jar",
-                         ".zip"};
+                         ".zip",
+                         ".dbs"};
 
     public ServiceFileUploadExecutor(ConfigurationContext configurationContext) {
         super(configurationContext);
@@ -73,11 +74,19 @@
 
                         String fileNameOnly = getFileName(fileName);
                         File uploadedFile;
-                        if (fileExtension.endsWith(".aar")) {
+                        if (fileExtension.endsWith(".aar") 
+                        		|| fileExtension.endsWith(".dbs") ) {
                             String repo =
                                     configurationContext.getAxisConfiguration().
                                             getRepository().getPath();
-                            File servicesDir = new File(repo, "services");
+                            String finalFolderName = "";
+                            if (fileExtension.equals("aar")){
+                            	finalFolderName = "services"; 
+                            }else{
+                            	finalFolderName = "dataservices";
+                            }
+                            
+                            File servicesDir = new File(repo, finalFolderName);
                             if (!servicesDir.exists()) {
                                 servicesDir.mkdir();
                             }
@@ -86,7 +95,7 @@
                             out.write("<script language=\"javascript\">" +
                                       "top.completeServiceFileUpload();" +
                                       "</script>");
-                        } else { // .jar or .zip file
+                        }else { // .jar or .zip file
                             String uuid = String.valueOf(
                                     System.currentTimeMillis() + Math.random());
                             String serviceUploadDir =

Modified: trunk/wsas/java/modules/www/extensions/core/xslt/list_services.xsl
==============================================================================
--- trunk/wsas/java/modules/www/extensions/core/xslt/list_services.xsl	(original)
+++ trunk/wsas/java/modules/www/extensions/core/xslt/list_services.xsl	Sun Jun  3 11:59:01 2007
@@ -41,38 +41,41 @@
             </div>
 
         </fieldset>
-   	    <div>
-   			<label><a alt="Add New">
-   				<xsl:attribute name="title">Add new Dataservice</xsl:attribute>
-   				<xsl:attribute name="href">#</xsl:attribute>
-   				<xsl:attribute name="id">add_link</xsl:attribute>
-   				<xsl:attribute name="onclick">javascript:addNewDataService();return false;</xsl:attribute>
-   				<xsl:text>&#160;&#160;&#160;&#160;New Dataservice</xsl:text>
-   			</a></label>
-       	    </div>
-   	    <div>
-   			<label><a alt="Add New EJB Service">
-   				<xsl:attribute name="title">Add new EJB Service</xsl:attribute>
-   				<xsl:attribute name="href">#</xsl:attribute>
-   				<xsl:attribute name="id">add_link</xsl:attribute>
-   				<xsl:attribute name="onclick">javascript:ejbProviderConfig();return false;</xsl:attribute>
-   				<xsl:text>&#160;&#160;&#160;&#160;New EJB Service</xsl:text>
-   			</a></label>
-       	   </div>
     </xsl:template>
 
     <xsl:template name="serviceUploadTemplate">
             <form method="post"  name="serviceUpload" action="fileupload/service" enctype="multipart/form-data" target="globalIFrame">
                 <fieldset>
-                    <legend>Upload a New Service (.aar, .jar or .zip)</legend>
+                    <legend>Upload a New Service (.aar, .jar, .zip or .dbs)</legend>
                     <div>
-                        <label for="module_a">Service archive (.aar,.jar,.zip) :</label><input type="file" id="filename" name="filename" size="50"/>
+                        <label for="module_a">Service archive (.aar,.jar,.zip,.dbs):</label><input type="file" id="filename" name="filename" size="50"/>
                     </div>
                     <div class="buttonrow">
                         <input name="upload" type="submit" value=" Upload ">
                             <xsl:attribute name="onclick">javascript: if (document.serviceUpload.filename.value == '') { wso2.wsf.Util.alertWarning('Please select a file before clicking upload.'); return false;} else { stoppingRefreshingMethodsHook(); return true;}</xsl:attribute>
                         </input>
                     </div>
+		    <div><br/></div>
+	   	    <div>
+   			<label for="module_a"><a alt="Add New Data Service" >
+   				<xsl:attribute name="title">Add new Data Service</xsl:attribute>
+				<xsl:attribute name="style">white-space:nowrap;</xsl:attribute>
+   				<xsl:attribute name="href">#</xsl:attribute>
+   				<xsl:attribute name="id">add_link</xsl:attribute>
+   				<xsl:attribute name="onclick">javascript:addNewDataService();return false;</xsl:attribute>
+   				<xsl:text>&#160;&#160;&#160;&#160;&#160;New Data Service</xsl:text>
+   			</a></label>
+	       	    </div>
+	   	    <div>
+   			<label for="module_a"><a alt="Add New EJB Service">
+   				<xsl:attribute name="title">Add new EJB Service</xsl:attribute>
+				<xsl:attribute name="style">white-space:nowrap;</xsl:attribute>
+   				<xsl:attribute name="href">#</xsl:attribute>
+   				<xsl:attribute name="id">add_link</xsl:attribute>
+   				<xsl:attribute name="onclick">javascript:ejbProviderConfig();return false;</xsl:attribute>
+   				<xsl:text>&#160;&#160;&#160;&#160;&#160;New EJB Service</xsl:text>
+   			</a></label>
+	       	   </div>
                 </fieldset>
              </form>
     </xsl:template>




More information about the Wsas-java-dev mailing list