Changeset 19641


Ignore:
Timestamp:
02/03/12 12:13:05 (4 months ago)
Author:
anp
Message:

Ajout de actionRemoveCacheWsp

Location:
trunk/Xul_Wsp/content
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Xul_Wsp/content/Wsp/defaultActions.jsm

    r19562 r19641  
    5959                        "actionUploadMainStream", 
    6060                        "actionReloadWsp", 
     61                        "actionRemoveCacheWsp", 
    6162                        "actionAdminWsp", 
    6263                        "actionDeleteWsp", 
     
    104105                pWindow.extPoints.registerSvcByInst("actionUploadMainStream", 1, actionUploadMainStream); 
    105106                pWindow.extPoints.registerSvcByInst("actionReloadWsp", 1, actionReloadWsp); 
     107                pWindow.extPoints.registerSvcByInst("actionRemoveCacheWsp", 1, actionRemoveCacheWsp); 
    106108                pWindow.extPoints.registerSvcByInst("actionAdminWsp", 1, actionAdminWsp); 
    107109                pWindow.extPoints.registerSvcByInst("actionDeleteWsp", 1, actionDeleteWsp); 
     
    428430 
    429431/** 
     432 * actionRemoveCacheWsp : Supprime le cache de l'atelier 
     433 * ActionContext : window, scWsp 
     434 */ 
     435const PERM_ACTION_SHOW_REMOVECACHEWSP = security.getOrCreateGlobalPerm("action#show.removeCacheWsp", wsp.PERM_ADMIN_WSP); 
     436const PERM_UI_SHOW_REMOVECACHEWSP = security.getOrCreateGlobalPerm("ui#show.removeCacheWsp", wsp.PERM_ADMIN_WSP); 
     437var actionRemoveCacheWsp = new actions.Action("actionRemoveCacheWsp") 
     438                                                                .setGroup("adminWsp") 
     439                                                                .setLabel("Supprime le cache de cet atelier") 
     440                                                                .requirePermission(PERM_ACTION_SHOW_REMOVECACHEWSP); 
     441actionRemoveCacheWsp.isVisible = function(pContext){ 
     442        return pContext.scWsp!=null && this.checkShortDescPerm(pContext, PERM_UI_SHOW_REMOVECACHEWSP); 
     443} 
     444actionRemoveCacheWsp.execute = function(pEvent, pContext){ 
     445        try{ 
     446                var vWsp = pContext.scWsp; 
     447                function cbRemoveCache(pEvent) { 
     448                        ui.closeWindowWait(vWinWait); 
     449                        if(pEvent.target.status != 200){ 
     450                                log.error({window:pContext.window, msg:"Anomalie au cours de la suppression du cache de cet atelier", adminDetails: "RemoveCache '" + vWsp.getCode() + "' failed : " + vReq.status + "\n" + vReq.responseText}); 
     451                        } 
     452                } 
     453                var vWinWait = ui.openWindowWait(null, "Suppression du cache de l'atelier", "Suppression du cache de l'atelier en cours...", pContext.window); 
     454                vWsp.getDataProvider().loadFromService("/u/adminWsp?cdaction=RemoveCache&param="+encodeURIComponent(vWsp.getCode()), cbRemoveCache); 
     455        } catch(e) {log.debug(e);} 
     456} 
     457 
     458/** 
    430459 * actionAdminWsp : Edition des propriétés de l'atelier.  
    431460 * ActionContext : window, scWsp, shortDesc, callbackOnModify, thisForCbOnModify 
  • trunk/Xul_Wsp/content/WspAdmin/desks/mgrWspDesk/mgrWspDesk.xul

    r18927 r19641  
    6464                                <box id="infoWspView" style="-moz-binding: url(chrome://scenariWspAdmin/content/views/infoWspView/infoWspView.xbl.xml#infoWspView)"/> 
    6565                                <box id="editWspPropsView" style="-moz-binding: url(chrome://scenariWspAdmin/content/views/editWspPropsView/editWspPropsView.xbl.xml#editWspPropsView)"/> 
     66                                <box id="adminWspView" style="-moz-binding: url(chrome://scenariWspAdmin/content/views/adminWspView/adminWspView.xbl.xml#adminWspView)"/> 
    6667            </slot> 
    6768        </matrix> 
     
    112113                wspDeskUtils.addFeatureInitScWsp(window, false, true); 
    113114                wspDeskUtils.addFeatureErrorController(window); 
     115                wspDeskUtils.addFeatureDefaultItemsExtPoints(window); 
    114116                 
    115117                //Lancement du desk 
Note: See TracChangeset for help on using the changeset viewer.