← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10982: WIP: app deletion complete

 

------------------------------------------------------------
revno: 10982
committer: Saptarshi <sunbiz@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-05-24 14:05:28 +0200
message:
  WIP: app deletion complete
added:
  dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/DeleteAppAction.java
  dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/javascript/deleteApp.js
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/appmanager/App.java
  dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java
  dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppListAction.java
  dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java
  dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppStoreAction.java
  dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/org/hisp/dhis/appmanager/i18n_module.properties
  dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/appSettings.vm
  dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/javascript/uploadApp.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/appmanager/App.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/appmanager/App.java	2013-05-17 11:14:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/appmanager/App.java	2013-05-24 12:05:28 +0000
@@ -187,5 +187,29 @@
     {
         this.activities = activities;
     }
+    
+    // -------------------------------------------------------------------------
+    // Hashcode & Equals 
+    // -------------------------------------------------------------------------
+    @Override
+    public int hashCode() {
+        int hash = 7;
+        hash = 79 * hash + (this.name != null ? this.name.hashCode() : 0);
+        return hash;
+    }
 
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final App other = (App) obj;
+        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
+            return false;
+        }
+        return true;
+    }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java	2013-05-23 06:17:02 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java	2013-05-24 12:05:28 +0000
@@ -136,11 +136,13 @@
                 if ( !manifestFound )
                 {
                     message = i18n.getString( "appmanager_invalid_package" );
+                    return "failure";
                 }
             }
             else
             {
                 message = i18n.getString( "appmanager_not_zip" );
+                return "failure";
             }
         }
         

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppListAction.java'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppListAction.java	2013-05-23 06:17:02 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppListAction.java	2013-05-24 12:05:28 +0000
@@ -55,7 +55,7 @@
 
     public List<App> getAppList()
     {
-        return appList;
+        return appManagerService.getInstalledApps();
     }
 
     private List<String> appFolderNames;
@@ -73,15 +73,11 @@
     public String execute()
         throws Exception
     {
-        appList = appManagerService.getInstalledApps();
-        
         appFolderNames = new ArrayList<String>();
-        
-        for ( App app : appList )
+        for ( App app : getAppList() )
         {
             appFolderNames.add( appManagerService.getAppFolderName( app ) );
         }
-        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java	2013-05-23 06:17:02 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java	2013-05-24 12:05:28 +0000
@@ -29,7 +29,9 @@
 
 import com.opensymphony.xwork2.Action;
 import java.io.File;
+import java.util.List;
 import org.apache.struts2.ServletActionContext;
+import org.hisp.dhis.appmanager.App;
 import org.hisp.dhis.appmanager.AppManagerService;
 import org.hisp.dhis.i18n.I18n;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -86,6 +88,13 @@
         appManagerService.setAppStoreUrl( appStoreUrl );
     }
 
+    private List<App> appList;
+
+    public List<App> getAppList()
+    {
+        return appManagerService.getInstalledApps();
+    }
+
     private I18n i18n;
 
     public void setI18n( I18n i18n )

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppStoreAction.java'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppStoreAction.java	2013-05-23 06:17:02 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppStoreAction.java	2013-05-24 12:05:28 +0000
@@ -1,68 +1,70 @@
-package org.hisp.dhis.appmanager.action;
-
-/*
- * Copyright (c) 2004-2013, University of Oslo
- * 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 the HISP project 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.
- */
-
-import com.opensymphony.xwork2.Action;
-import org.hisp.dhis.appmanager.AppManagerService;
-import org.springframework.beans.factory.annotation.Autowired;
-
-/**
- * @author Saptarshi Purkayastha
- */
-public class AppStoreAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    @Autowired
-    private AppManagerService appManagerService;
-
-    // -------------------------------------------------------------------------
-    // Input & Output
-    // -------------------------------------------------------------------------
-
-    private String appStoreUrl;
-
-    public String getAppStoreUrl()
-    {
-        return appManagerService.getAppStoreUrl();
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    @Override
-    public String execute()
-        throws Exception
-    {
-        return SUCCESS;
-    }
-}
+package org.hisp.dhis.appmanager.action;
+
+/*
+ * Copyright (c) 2004-2013, University of Oslo
+ * 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 the HISP project 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.
+ */
+
+import com.opensymphony.xwork2.Action;
+import static com.opensymphony.xwork2.Action.SUCCESS;
+import org.hisp.dhis.appmanager.AppManagerService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @author Saptarshi Purkayastha
+ * @version $Id
+ */
+public class AppStoreAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    @Autowired
+    private AppManagerService appManagerService;
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private String appStoreUrl;
+
+    public String getAppStoreUrl()
+    {
+        return appManagerService.getAppStoreUrl();
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        return SUCCESS;
+    }
+}
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/DeleteAppAction.java'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/DeleteAppAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/DeleteAppAction.java	2013-05-24 12:05:28 +0000
@@ -0,0 +1,101 @@
+package org.hisp.dhis.appmanager.action;
+
+/*
+ * Copyright (c) 2004-2013, University of Oslo
+ * 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 the HISP project 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.
+ */
+
+import com.opensymphony.xwork2.Action;
+import java.io.File;
+import org.apache.commons.io.FileUtils;
+import org.apache.struts2.ServletActionContext;
+import org.hisp.dhis.appmanager.App;
+import org.hisp.dhis.appmanager.AppManagerService;
+import org.hisp.dhis.i18n.I18n;
+import org.hisp.dhis.security.authority.SystemAuthoritiesProvider;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @author Saptarshi Purkayastha
+ * @version $Id$
+ */
+public class DeleteAppAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    @Autowired
+    private AppManagerService appManagerService;
+
+    private SystemAuthoritiesProvider authoritiesProvider;
+
+    public void setAuthoritiesProvider( SystemAuthoritiesProvider authoritiesProvider )
+    {
+        this.authoritiesProvider = authoritiesProvider;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+    private I18n i18n;
+
+    public void setI18n( I18n i18n )
+    {
+        this.i18n = i18n;
+    }
+
+    private String message;
+
+    public String getMessage()
+    {
+        return message;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        String appName = ServletActionContext.getRequest().getParameter( "appName" );
+        if ( null != appName )
+        {
+            for ( App app : appManagerService.getInstalledApps() )
+            {
+                if ( app.getName().equals( appName ) )
+                {
+                    String folderPath = appManagerService.getAppFolderPath() + File.separator
+                        + appManagerService.getAppFolderName( app );
+                    FileUtils.forceDelete( new File( folderPath ) );
+                    message = i18n.getString( "appmanager_delete_success" );
+                }
+            }
+        }
+        return SUCCESS;
+    }
+}

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/org/hisp/dhis/appmanager/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/org/hisp/dhis/appmanager/i18n_module.properties	2013-05-23 00:18:55 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/org/hisp/dhis/appmanager/i18n_module.properties	2013-05-24 12:05:28 +0000
@@ -9,6 +9,9 @@
 appmanager_install_success=App Installed Successfully
 appmanager_invalid_package=Invalid App Package
 appmanager_not_zip=Incorrect App Package Format
+appmanager_confirm_delete=Are you sure to delete this App?
+appmanager_delete_success=App Deleted Successfully
+appmanager_management=Manage Installed Apps
 
 #-- See module privilegies ----------------------------------------------------#
 

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/struts.xml	2013-05-23 00:18:55 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/resources/struts.xml	2013-05-24 12:05:28 +0000
@@ -21,11 +21,19 @@
     
     <action name="addApp" class="org.hisp.dhis.appmanager.action.AddAppAction">
       <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+      <result name="failure" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
       <param name="menu">/dhis-web-appmanager/menu.vm</param>
       <param name="javascripts">javascript/jquery.form.js</param>
       <interceptor-ref name="fileUploadStack" />
     </action>
     
+    <action name="deleteApp" class="org.hisp.dhis.appmanager.action.DeleteAppAction">
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+      <param name="page">/dhis-web-appmanager/index.vm</param>
+      <param name="menu">/dhis-web-appmanager/menu.vm</param>
+      <param name="javascripts">javascript/jquery.form.js</param>
+    </action>
+    
     <action name="appStore" class="org.hisp.dhis.appmanager.action.AppStoreAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-appmanager/getApps.vm</param>
@@ -40,7 +48,7 @@
       <param name="menu">/dhis-web-appmanager/menu.vm</param>
       <param name="onExceptionReturn">plainTextError</param>
       <param name="requiredAuthorities">F_SYSTEM_SETTING</param>
-      <param name="javascripts">javascript/jquery.form.js</param>
+      <param name="javascripts">javascript/jquery.form.js,javascript/deleteApp.js</param>
     </action>
     
   </package>

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/appSettings.vm'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/appSettings.vm	2013-05-23 00:18:55 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/appSettings.vm	2013-05-24 12:05:28 +0000
@@ -1,12 +1,13 @@
 <script>
-	jQuery(document).ready(function() {
-            jQuery('#appSettingsForm').ajaxForm({
-                dataType:  'json',
-                success: function(data){
-                    setHeaderDelayMessage(data.message);
-                }
-            });
-	}); 
+    jQuery(document).ready(function() {
+        jQuery('#appSettingsForm').ajaxForm({
+            dataType:  'json',
+            success: function(data){
+                setHeaderDelayMessage(data.message);
+            }
+        });
+    }); 
+    var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "appmanager_confirm_delete" ) , "'")';
 </script>
 
 <h3>$i18n.getString( "appmanager_settings" )</h3>
@@ -24,3 +25,41 @@
   </table>
   <input type="submit" value="Save" />
 </form>
+
+<h3>$i18n.getString( "appmanager_management" )</h3>
+
+<table style="width:100%">
+  <tr>
+    <td style="vertical-align:top">
+      <table class="listTable" id="userList" width='100%'>
+        <col/>
+        <col/>				
+        <thead>				
+          <tr>
+            <th>$i18n.getString( "appname" )</th>
+            <th>$i18n.getString( "version" )</th>
+            <th class="{sorter: false}" style="width:120px;">$i18n.getString( "operations" )</th>
+          </tr>
+        </thead>
+        <tbody id="list">
+          #set( $mark = false )
+          #foreach( $app in $appList )
+          <tr id="tr${app.name.replace(' ','_')}" #alternate( $mark )>
+            <td>$encoder.htmlEncode( $app.name )</td>
+            <td>$encoder.htmlEncode( $app.version )</td>
+            <td style="text-align:right">
+              <a href="javascript:deleteApp( '$encoder.jsEncode( $app.name.replace(' ','_') )', '$encoder.jsEncode( $app.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png"></a>
+            </td>
+          </tr>
+          #if( $mark )
+            #set( $mark = false )
+          #else
+            #set( $mark = true )
+          #end
+          #end
+        </tbody>
+      </table>
+    </td>
+  </tr>
+</table>
+

=== added file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/javascript/deleteApp.js'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/javascript/deleteApp.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/javascript/deleteApp.js	2013-05-24 12:05:28 +0000
@@ -0,0 +1,5 @@
+function deleteApp( appId, appName )
+{
+    removeItem( appId, appName, i18n_confirm_delete, "deleteApp.action?appName="+appName );
+}
+

=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/javascript/uploadApp.js'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/javascript/uploadApp.js	2013-05-23 00:18:55 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/webapp/dhis-web-appmanager/javascript/uploadApp.js	2013-05-24 12:05:28 +0000
@@ -4,20 +4,24 @@
         var xhr = new XMLHttpRequest();
         xhr.addEventListener('progress', function(e) {
             var done = e.position || e.loaded, total = e.totalSize || e.total;
+            jQuery("#progressbar").show();
             jQuery("#progressbar").progressbar({value: (Math.floor(done / total * 1000) / 10)});
         }, false);
         if (xhr.upload) {
             xhr.upload.onprogress = function(e) {
                 var done = e.position || e.loaded, total = e.totalSize || e.total;
+                jQuery("#progressbar").show();
                 jQuery("#progressbar").progressbar({value: (Math.floor(done / total * 1000) / 10)});
-                console.log('xhr.upload progress: ' + done + ' / ' + total + ' = ' + (Math.floor(done / total * 1000) / 10) + '%');
             };
         }
         xhr.onreadystatechange = function(e) {
             if (4 == this.readyState) {
-                console.log(['xhr upload complete', e]);
-                console.log(jQuery(".ui-progressbar-value"));
                 jQuery(".ui-progressbar-value").html('<div style="text-align:center">Upload complete</div>');
+                setTimeout(function(){
+                    jQuery(".ui-progressbar-value").html('');
+                    jQuery("#progressbar").hide();
+                }, 4000);
+                jQuery.growlUI( JSON.parse(xhr.responseText).response, JSON.parse(xhr.responseText).message, JSON.parse(xhr.responseText).response, 2000 );
                 jQuery("#uploadPackageForm")[0].reset();
             }
         };