Changeset 281


Ignore:
Timestamp:
03/25/10 08:50:42 (14 years ago)
Author:
patdui
Message:
  • more little bug fixes and layout changes, trying to use shibboleth for authorisation
Location:
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/Browse.mxml

    r272 r281  
    3333                        private var componentSrv:ComponentInfoService = new ComponentInfoService();
    3434                       
    35                         private var deleteSrv:DeleteService = new DeleteService();
     35                        private var deleteSrv:DeleteService = DeleteService.instance;
    3636                       
    3737                        [Bindable]
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/BrowserColumns.as

    r117 r281  
    3030                        c.dataField = dataField;
    3131                        c.headerText = headerText;
     32                        c.dataTipField = dataField;
    3233                        return c;
    3334                }
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/BrowserOverviewList.mxml

    r272 r281  
    102102                                                        searchInput="{searchBox}"
    103103                                                        keyUp="handleKeyUp(event)"
    104                                                         useRollOver="false">
     104                                                        useRollOver="false"
     105                                                        showDataTips="true">
    105106        </comp:FilteringDataGrid>
    106107</mx:VBox>
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/BrowseContextMenu.as

    r272 r281  
    6969                private function editItem(event:ContextMenuEvent):void {
    7070                        var item:ItemDescription = _dataGrid.selectedItem as ItemDescription;
    71                         viewStack.switchToEditor(item);
     71                    viewStack.switchToEditor(item);
    7272                }
    7373
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/HighlightSelectionItemRenderer.as

    r161 r281  
    22        import mx.controls.dataGridClasses.DataGridItemRenderer;
    33
    4         public class HighlightSelectionItemRenderer extends DataGridItemRenderer {
     4        public class HighlightSelectionItemRenderer extends OptionalTooltipDataGridItemRenderer {
    55
    66                private static const OPEN_TAG:String = "<b>";
     
    3636                }
    3737
     38
    3839        }
    3940}
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/AttributeListEdit.as

    r268 r281  
    33        import clarin.cmdi.componentregistry.editor.model.CMDAttribute;
    44        import clarin.cmdi.componentregistry.editor.model.ValueSchemeInterface;
    5 
     5       
    66        import flash.events.Event;
    77        import flash.events.MouseEvent;
    8 
     8       
    99        import mx.binding.utils.ChangeWatcher;
    1010        import mx.collections.ArrayCollection;
     
    1616        import mx.core.UIComponent;
    1717        import mx.events.DragEvent;
     18        import mx.events.PropertyChangeEvent;
    1819        import mx.managers.DragManager;
    1920
     
    6869                                valueSchemeInput.valueSchemeEnumeration = valueScheme.valueSchemeEnumeration;
    6970                        }
    70                         ChangeWatcher.watch(valueSchemeInput, "valueSchemeSimple", function(val:String):void {
    71                                         valueScheme.valueSchemeSimple = val;
     71                        ChangeWatcher.watch(valueSchemeInput, "valueSchemeSimple", function(e:PropertyChangeEvent):void {
     72                                        valueScheme.valueSchemeSimple = e.newValue as String;
    7273                                        valueScheme.valueSchemePattern = "";
    7374                                        valueScheme.valueSchemeEnumeration = null;
    7475                                });
    75                         ChangeWatcher.watch(valueSchemeInput, "valueSchemePattern", function(val:String):void {
    76                                         valueScheme.valueSchemePattern = val;
     76                        ChangeWatcher.watch(valueSchemeInput, "valueSchemePattern", function(e:PropertyChangeEvent):void {
     77                                        valueScheme.valueSchemePattern = e.newValue as String;
    7778                                        valueScheme.valueSchemeEnumeration = null;
    7879                                        valueScheme.valueSchemeSimple = "";
    7980                                });
    80                         ChangeWatcher.watch(valueSchemeInput, "valueSchemeEnumeration", function(val:XMLListCollection):void {
    81                                         valueScheme.valueSchemeEnumeration = val;
     81                        ChangeWatcher.watch(valueSchemeInput, "valueSchemeEnumeration", function(e:PropertyChangeEvent):void {
     82                                        valueScheme.valueSchemeEnumeration = e.newValue as XMLListCollection;
    8283                                        valueScheme.valueSchemeSimple = "";
    8384                                        valueScheme.valueSchemePattern = "";
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/Editor.mxml

    r242 r281  
    3838                                                                                  cmdSpec="{cmdSpec}"
    3939                                                                                  editorChange="handleEditorChange(event)"/>
    40                         <mx:VBox styleName="borderStyles">
     40                        <mx:VBox styleName="borderStyles"
     41                                         width="100%">
    4142                                <mx:Label text="Drag items onto edit canvas"/>
    4243                                <mx:HBox id="palette">
    43                                         <mx:Canvas width="60"
    44                                                            height="60"
    45                                                            backgroundColor="blue"
    46                                                            borderStyle="solid"
     44                                        <mx:Button height="30"
    4745                                                           id="ComponentDrag"
     46                                                           label="Component"
     47                                                           toolTip="Drag component to add a new empty component"
    4848                                                           mouseMove="enableComponentDrag(event);">
    49                                         </mx:Canvas>
    50                                         <mx:Canvas width="45"
    51                                                            height="45"
    52                                                            backgroundColor="green"
    53                                                            borderStyle="solid"
     49                                        </mx:Button>
     50                                        <mx:Button height="30"
    5451                                                           id="ElementDrag"
     52                                                           label="Element"
     53                                                           toolTip="Drag element onto components"
    5554                                                           mouseMove="enableElementDrag(event);">
    56                                         </mx:Canvas>
    57                                         <mx:Canvas width="30"
    58                                                            height="30"
    59                                                            backgroundColor="red"
    60                                                            borderStyle="solid"
     55                                        </mx:Button>
     56                                        <mx:Button height="30"
    6157                                                           id="AttributeDrag"
     58                                                           label="Attribute"
     59                                                           toolTip="Drag attribute onto an attribute list"
    6260                                                           mouseMove="enableAttributeDrag(event);">
    63                                         </mx:Canvas>
     61                                        </mx:Button>
    6462                                </mx:HBox>
    6563                                <browser:BrowserOverviewList id="componentsPaletteOverview"
     64                                                                                         width="100%"
    6665                                                                                         browserDataProvider="{componentsSrv.itemDescriptions}"
    6766                                                                                         browserColumns="{browserColumns.getComponentColumns()}"
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorAS.as

    r270 r281  
    1010import clarin.cmdi.componentregistry.services.ComponentInfoService;
    1111import clarin.cmdi.componentregistry.services.ComponentListService;
     12import clarin.cmdi.componentregistry.services.DeleteService;
    1213import clarin.cmdi.componentregistry.services.ProfileInfoService;
    1314import clarin.cmdi.componentregistry.services.UploadService;
    1415
    1516import flash.events.Event;
    16 import flash.net.FileReference;
    1717
    1818import mx.core.DragSource;
    1919import mx.core.UIComponent;
     20import mx.managers.CursorManager;
    2021import mx.managers.DragManager;
    2122
    2223
    23 private var currentDescription:ItemDescription;
    2424private var profileSrv:ProfileInfoService = new ProfileInfoService();
    2525private var componentSrv:ComponentInfoService = new ComponentInfoService();
     
    4646        componentsSrv.load();
    4747        uploadService.init(uploadProgress);
     48        DeleteService.instance.addEventListener(DeleteService.ITEM_DELETED, refreshComponentList);
    4849}
    4950
     
    5152        var cmdComponent:XML = profileSrv.profile.profileSource;
    5253        this.cmdSpec = CMDModelFactory.createModel(cmdComponent, profileSrv.profile.description);
     54        CursorManager.removeBusyCursor();
    5355}
    5456
     
    5658        var cmdComponent:XML = componentSrv.component.componentMD.xml;
    5759        this.cmdSpec = CMDModelFactory.createModel(cmdComponent, componentSrv.component.description);
     60        CursorManager.removeBusyCursor();
    5861}
    5962
    6063
    6164public function setDescription(itemDescription:ItemDescription):void {
    62         this.currentDescription = itemDescription;
    63         if (currentDescription.isProfile) {
    64                 profileSrv.load(currentDescription);
    65         } else {
    66                 componentSrv.load(currentDescription);
     65        if (itemDescription) {
     66            CursorManager.setBusyCursor();
     67                if (itemDescription.isProfile) {
     68                        profileSrv.load(itemDescription);
     69                } else {
     70                        componentSrv.load(itemDescription);
     71                }
    6772        }
    6873}
     
    9398private function handleSaveComplete(event:UploadCompleteEvent):void {
    9499        parentApplication.viewStack.switchToBrowse(event.itemDescription);
     100        refreshComponentList();
     101}
     102
     103private function refreshComponentList(event:*=null):void {
     104    componentsSrv.load();
    95105}
    96106
     
    129139        componentsPaletteOverview.dataGrid.dragEnabled = true;
    130140        componentsPaletteOverview.dataGrid.allowMultipleSelection = true;
    131         componentsPaletteOverview.dataGrid.horizontalScrollPolicy = "auto";
    132141        componentsPaletteOverview.dataGrid.resizableColumns = true;
    133142}
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/IsocatSearchPopUp.mxml

    r238 r281  
    2020
    2121                        private function cleanUp():void {
    22                             searchService.close();
     22                                searchService.close();
    2323                                PopUpManager.removePopUp(this);
    2424                        }
     
    5151                <mx:DataGrid id="dataGrid"
    5252                                         dataProvider="{searchService.searchResults}"
    53                                          resizableColumns="true">
     53                                         resizableColumns="true"
     54                                         itemRenderer="clarin.cmdi.componentregistry.common.components.OptionalTooltipDataGridItemRenderer"
     55                                         showDataTips="true">
    5456                        <mx:columns>
    5557                                <mx:DataGridColumn dataField="@name"
    56                                                                    showDataTips="true"
    5758                                                                   dataTipField="@name"
    5859                                                                   headerText="Name"/>
    5960                                <mx:DataGridColumn dataField="@definition"
    60                                                                    showDataTips="true"
    6161                                                                   dataTipField="@definition"
    6262                                                                   headerText="Definition"/>
    6363                                <mx:DataGridColumn dataField="@identifier"
    64                                                                    showDataTips="true"
    6564                                                                   dataTipField="@identifier"
    6665                                                                   headerText="Identifier"/>
    6766                                <mx:DataGridColumn dataField="@owner"
    68                                                                    showDataTips="true"
    6967                                                                   dataTipField="@owner"
    7068                                                                   headerText="Owner"/>
    7169                                <mx:DataGridColumn dataField="@pid"
    72                                                                    showDataTips="true"
    7370                                                                   dataTipField="@pid"
    7471                                                                   headerText="Persistent Identifier"
    7572                                                                   width="130"/>
    7673                                <mx:DataGridColumn dataField="@type"
     74                                                                   dataTipField="@type"
    7775                                                                   headerText="Type"/>
    7876                                <mx:DataGridColumn dataField="@version"
     77                                                                   dataTipField="@version"
    7978                                                                   headerText="Version"/>
    8079                        </mx:columns>
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/BrowserService.as

    r260 r281  
    11package clarin.cmdi.componentregistry.services {
    22        import clarin.cmdi.componentregistry.common.ItemDescription;
    3        
     3
    44        import mx.collections.ArrayCollection;
    55        import mx.controls.Alert;
     
    2222                [ArrayElementType("ItemDescription")]
    2323                public var itemDescriptions:ArrayCollection;
    24                
     24
    2525                private var serviceUrl:String;
    2626
    27         // Not bindable needed for lookups over the whole collections of itemDescriptions
    28                 protected var unFilteredItemDescriptions:ArrayCollection; 
     27                // Not bindable needed for lookups over the whole collections of itemDescriptions
     28                protected var unFilteredItemDescriptions:ArrayCollection;
    2929
    3030
    3131                public function BrowserService(restUrl:String) {
    32                     this.serviceUrl = restUrl;
     32                        this.serviceUrl = restUrl;
    3333                        service = new HTTPService();
    3434                        service.method = HTTPRequestMessage.GET_METHOD;
    3535                        service.resultFormat = HTTPService.RESULT_FORMAT_E4X;
    3636                }
    37                
     37
    3838                private function initService():void {
    39                         service.url = serviceUrl + "?"+new Date().getTime();
     39                        service.url = serviceUrl + "?" + new Date().getTime();// +";JSESSIONID="+Config.instance.sessionId;
    4040                }
    4141
    4242                public function load():void {
    43                     initService();
     43                        initService();
    4444                        var token:AsyncToken = this.service.send();
    4545                        token.addResponder(new Responder(result, fault));
     
    5353
    5454                public function fault(faultEvent:FaultEvent):void {
    55                         var errorMessage:String = StringUtil.substitute("Error in {0}: {1} - {2}", this, faultEvent.fault.faultString, faultEvent.fault.faultDetail);
     55                        var errorMessage:String = StringUtil.substitute("Error in {0}: Message: {1} \n Fault: {2} - {3}", this, faultEvent.message, faultEvent.fault.faultString, faultEvent.fault.faultDetail);
    5656                        Alert.show(errorMessage);
    5757                }
     
    6161                        unFilteredItemDescriptions = new ArrayCollection(); //create a copy
    6262                        for each (var item:Object in items) {
    63                 unFilteredItemDescriptions.addItem(item);                   
     63                                unFilteredItemDescriptions.addItem(item);
    6464                        }
    6565                }
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/Config.as

    r224 r281  
    2020                //Like this: "FlashVars", "isocatSearchUrl=http://www.isocat.org/rest/user/guest/search"
    2121
     22       // private var _sessionId:String = "";
    2223
    2324                public function Config() {
     
    3334                                _isocatSearchUrl = isocatSearchUrl;
    3435                        }
     36//                      var sessionId:String = Application.application.parameters.jsessionid;
     37//                      if (sessionId != null) {
     38//                              _sessionId = sessionId;
     39//                      }
    3540                }
    3641
     
    6267                        return _isocatSearchUrl;
    6368                }
     69               
     70//              public function get sessionId():String {
     71//                      return _sessionId;
     72//              }
     73
     74                public function get serviceRootUrl():String {
     75                        return _serviceRootUrl;
     76                }
     77
    6478
    6579                public static function get instance():Config {
    6680                        return _instance;
    6781                }
    68 
     82               
    6983        }
    7084}
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/DeleteService.as

    r224 r281  
    2323                private var service:HttpClient;
    2424
     25        private static var _instance:DeleteService = new DeleteService();
     26
    2527                public function DeleteService() {
     28                        if (_instance != null) {
     29                                throw new Error("DeleteService should only be accessed through DeleteService.instance");
     30                        }
    2631                        service = new HttpClient();
    2732                        service.listener.onComplete = handleResult;
     
    2934                }
    3035
    31                 private function getCredentials():String {
    32                         return Base64.encode("tomcat:tomcat");
    33                 }
     36//              private function getCredentials():String {
     37//                      return Base64.encode("tomcat:tomcat");
     38//              }
    3439
    3540                public function deleteItem(item:ItemDescription):void {
    3641                        CursorManager.setBusyCursor();
    37                         var uri:URI = new URI(item.dataUrl);
     42                        var uri:URI = new URI(item.dataUrl);//+";JSESSIONID="+Config.instance.sessionId
    3843                        var httpDelete:Delete = new Delete();
    39                         httpDelete.addHeader("Authorization", "BASIC " + getCredentials());
     44//                      httpDelete.addHeader("Authorization", "BASIC " + getCredentials());
    4045                        service.request(uri, httpDelete);
    4146                }
     
    5863                }
    5964
     65                public static function get instance():DeleteService {
     66                        return _instance;
     67                }
    6068        }
    6169}
  • ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/main.mxml

    r161 r281  
    88        <mx:Script>
    99                <![CDATA[
     10                        import clarin.cmdi.componentregistry.services.Config;
     11                        import flash.net.navigateToURL;
    1012                        import mx.managers.PopUpManager;
    1113                        import clarin.cmdi.componentregistry.services.UploadService;
     
    1416                        private function init():void {
    1517                                ExternalMouseWheelSupport.getInstance(stage);
     18                                //var sessionId:String = Application.application.parameters.jsessionid;
     19                                //trace("JSession=" + sessionId);
     20//    var urltext:String = "/webapp/ChartXML.do;JSESSIONID="+JSESSIONID;
     21//    trace ("Requested URL:",urltext);
     22//    httpService.url= urltext;
     23//    httpService.send();
     24//    trace("httpService sent");
     25                        }
     26
     27                        private function handleLogin(event:MouseEvent):void {
     28                                var req:URLRequest = new URLRequest();
     29                                req.url = Config.instance.serviceRootUrl + "?shhaaDo=lI";
     30                                navigateToURL(req, "_top");
     31                        }
     32
     33                        [Bindable]
     34                        private var userName:String = "";
     35
     36                        private function checkUser():void {
     37                                userName = Application.application.parameters.userName;
     38                                trace("user = " + userName);
    1639                        }
    1740                ]]>
     
    2952                        <mx:HBox borderStyle="none">
    3053                                <mx:ToggleButtonBar id="toggleBar"
    31                                                                         dataProvider="{viewStack}"/>
     54                                                                        dataProvider="{viewStack}"
     55                                                                        initialize="checkUser();"/>
     56                                <mx:Button id="login"
     57                                                   label="login {userName}"
     58                                                   click="handleLogin(event)"/>
    3259                        </mx:HBox>
    3360                        <common:RegistryViewStack id="viewStack"
Note: See TracChangeset for help on using the changeset viewer.