Ignore:
Timestamp:
07/27/11 13:55:35 (13 years ago)
Author:
twagoo
Message:

ComponentUsageService? actually checks results of service call and includes them in event.
Editor shows names of items that use the component in the confirmation dialog.

Fixes #134

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorAS.as

    r1473 r1475  
    105105                // Private components that are in updated require usage check call. If in use, the user can choose whether or not to save the changes .
    106106                if(inUserSpace && uploadAction == UploadService.UPDATE && !item.isProfile){
    107                         checkUsage(item);
     107                        checkUsage(item, inUserSpace);
    108108                }else{
    109109                        doUpload(uploadAction,item);
     
    117117 * Calls usage check for the specified component. If in use, asks user whether to proceed; if positive, initiates update.
    118118 */
    119 private function checkUsage(item:ItemDescription, uploadAction:int = UploadService.UPDATE):void{
    120         var componentUsageService:ComponentUsageService = new ComponentUsageService(item);
     119private function checkUsage(item:ItemDescription, inUserSpace:Boolean = true, uploadAction:int = UploadService.UPDATE):void{
     120        var componentUsageService:ComponentUsageService = new ComponentUsageService(item,inUserSpace);
    121121        componentUsageService.addEventListener(ComponentUsageCheckEvent.COMPONENT_IN_USE,
    122122                function (event:ComponentUsageCheckEvent):void{
    123123                        if(event.isComponentInUse){
    124                                 Alert.show("Component is used by other components and/or profiles. Changes in this component will affect these. Do you want to proceed?","Component is used", Alert.YES|Alert.NO,null,
     124                                var messageBody:String = "The component you are about to save is used by the following component(s) and/or profile(s):\n\n";
     125                                for each(var name:String in event.itemUsingComponent){
     126                                        messageBody += " - " + name + "\n";
     127                                }
     128                                messageBody += "\nChanges in this component will affect the above. Do you want to proceed?";
     129                                Alert.show(messageBody,"Component is used", Alert.YES|Alert.NO,null,
    125130                                        function (eventObj:CloseEvent):void{
    126131                                                if(eventObj.detail == Alert.YES){
Note: See TracChangeset for help on using the changeset viewer.