Changeset 281
- Timestamp:
- 03/25/10 08:50:42 (14 years ago)
- 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 33 33 private var componentSrv:ComponentInfoService = new ComponentInfoService(); 34 34 35 private var deleteSrv:DeleteService = new DeleteService();35 private var deleteSrv:DeleteService = DeleteService.instance; 36 36 37 37 [Bindable] -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/BrowserColumns.as
r117 r281 30 30 c.dataField = dataField; 31 31 c.headerText = headerText; 32 c.dataTipField = dataField; 32 33 return c; 33 34 } -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/BrowserOverviewList.mxml
r272 r281 102 102 searchInput="{searchBox}" 103 103 keyUp="handleKeyUp(event)" 104 useRollOver="false"> 104 useRollOver="false" 105 showDataTips="true"> 105 106 </comp:FilteringDataGrid> 106 107 </mx:VBox> -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/BrowseContextMenu.as
r272 r281 69 69 private function editItem(event:ContextMenuEvent):void { 70 70 var item:ItemDescription = _dataGrid.selectedItem as ItemDescription; 71 71 viewStack.switchToEditor(item); 72 72 } 73 73 -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/HighlightSelectionItemRenderer.as
r161 r281 2 2 import mx.controls.dataGridClasses.DataGridItemRenderer; 3 3 4 public class HighlightSelectionItemRenderer extends DataGridItemRenderer {4 public class HighlightSelectionItemRenderer extends OptionalTooltipDataGridItemRenderer { 5 5 6 6 private static const OPEN_TAG:String = "<b>"; … … 36 36 } 37 37 38 38 39 } 39 40 } -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/AttributeListEdit.as
r268 r281 3 3 import clarin.cmdi.componentregistry.editor.model.CMDAttribute; 4 4 import clarin.cmdi.componentregistry.editor.model.ValueSchemeInterface; 5 5 6 6 import flash.events.Event; 7 7 import flash.events.MouseEvent; 8 8 9 9 import mx.binding.utils.ChangeWatcher; 10 10 import mx.collections.ArrayCollection; … … 16 16 import mx.core.UIComponent; 17 17 import mx.events.DragEvent; 18 import mx.events.PropertyChangeEvent; 18 19 import mx.managers.DragManager; 19 20 … … 68 69 valueSchemeInput.valueSchemeEnumeration = valueScheme.valueSchemeEnumeration; 69 70 } 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; 72 73 valueScheme.valueSchemePattern = ""; 73 74 valueScheme.valueSchemeEnumeration = null; 74 75 }); 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; 77 78 valueScheme.valueSchemeEnumeration = null; 78 79 valueScheme.valueSchemeSimple = ""; 79 80 }); 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; 82 83 valueScheme.valueSchemeSimple = ""; 83 84 valueScheme.valueSchemePattern = ""; -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/Editor.mxml
r242 r281 38 38 cmdSpec="{cmdSpec}" 39 39 editorChange="handleEditorChange(event)"/> 40 <mx:VBox styleName="borderStyles"> 40 <mx:VBox styleName="borderStyles" 41 width="100%"> 41 42 <mx:Label text="Drag items onto edit canvas"/> 42 43 <mx:HBox id="palette"> 43 <mx:Canvas width="60" 44 height="60" 45 backgroundColor="blue" 46 borderStyle="solid" 44 <mx:Button height="30" 47 45 id="ComponentDrag" 46 label="Component" 47 toolTip="Drag component to add a new empty component" 48 48 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" 54 51 id="ElementDrag" 52 label="Element" 53 toolTip="Drag element onto components" 55 54 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" 61 57 id="AttributeDrag" 58 label="Attribute" 59 toolTip="Drag attribute onto an attribute list" 62 60 mouseMove="enableAttributeDrag(event);"> 63 </mx: Canvas>61 </mx:Button> 64 62 </mx:HBox> 65 63 <browser:BrowserOverviewList id="componentsPaletteOverview" 64 width="100%" 66 65 browserDataProvider="{componentsSrv.itemDescriptions}" 67 66 browserColumns="{browserColumns.getComponentColumns()}" -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/EditorAS.as
r270 r281 10 10 import clarin.cmdi.componentregistry.services.ComponentInfoService; 11 11 import clarin.cmdi.componentregistry.services.ComponentListService; 12 import clarin.cmdi.componentregistry.services.DeleteService; 12 13 import clarin.cmdi.componentregistry.services.ProfileInfoService; 13 14 import clarin.cmdi.componentregistry.services.UploadService; 14 15 15 16 import flash.events.Event; 16 import flash.net.FileReference;17 17 18 18 import mx.core.DragSource; 19 19 import mx.core.UIComponent; 20 import mx.managers.CursorManager; 20 21 import mx.managers.DragManager; 21 22 22 23 23 private var currentDescription:ItemDescription;24 24 private var profileSrv:ProfileInfoService = new ProfileInfoService(); 25 25 private var componentSrv:ComponentInfoService = new ComponentInfoService(); … … 46 46 componentsSrv.load(); 47 47 uploadService.init(uploadProgress); 48 DeleteService.instance.addEventListener(DeleteService.ITEM_DELETED, refreshComponentList); 48 49 } 49 50 … … 51 52 var cmdComponent:XML = profileSrv.profile.profileSource; 52 53 this.cmdSpec = CMDModelFactory.createModel(cmdComponent, profileSrv.profile.description); 54 CursorManager.removeBusyCursor(); 53 55 } 54 56 … … 56 58 var cmdComponent:XML = componentSrv.component.componentMD.xml; 57 59 this.cmdSpec = CMDModelFactory.createModel(cmdComponent, componentSrv.component.description); 60 CursorManager.removeBusyCursor(); 58 61 } 59 62 60 63 61 64 public 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 } 67 72 } 68 73 } … … 93 98 private function handleSaveComplete(event:UploadCompleteEvent):void { 94 99 parentApplication.viewStack.switchToBrowse(event.itemDescription); 100 refreshComponentList(); 101 } 102 103 private function refreshComponentList(event:*=null):void { 104 componentsSrv.load(); 95 105 } 96 106 … … 129 139 componentsPaletteOverview.dataGrid.dragEnabled = true; 130 140 componentsPaletteOverview.dataGrid.allowMultipleSelection = true; 131 componentsPaletteOverview.dataGrid.horizontalScrollPolicy = "auto";132 141 componentsPaletteOverview.dataGrid.resizableColumns = true; 133 142 } -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/editor/IsocatSearchPopUp.mxml
r238 r281 20 20 21 21 private function cleanUp():void { 22 22 searchService.close(); 23 23 PopUpManager.removePopUp(this); 24 24 } … … 51 51 <mx:DataGrid id="dataGrid" 52 52 dataProvider="{searchService.searchResults}" 53 resizableColumns="true"> 53 resizableColumns="true" 54 itemRenderer="clarin.cmdi.componentregistry.common.components.OptionalTooltipDataGridItemRenderer" 55 showDataTips="true"> 54 56 <mx:columns> 55 57 <mx:DataGridColumn dataField="@name" 56 showDataTips="true"57 58 dataTipField="@name" 58 59 headerText="Name"/> 59 60 <mx:DataGridColumn dataField="@definition" 60 showDataTips="true"61 61 dataTipField="@definition" 62 62 headerText="Definition"/> 63 63 <mx:DataGridColumn dataField="@identifier" 64 showDataTips="true"65 64 dataTipField="@identifier" 66 65 headerText="Identifier"/> 67 66 <mx:DataGridColumn dataField="@owner" 68 showDataTips="true"69 67 dataTipField="@owner" 70 68 headerText="Owner"/> 71 69 <mx:DataGridColumn dataField="@pid" 72 showDataTips="true"73 70 dataTipField="@pid" 74 71 headerText="Persistent Identifier" 75 72 width="130"/> 76 73 <mx:DataGridColumn dataField="@type" 74 dataTipField="@type" 77 75 headerText="Type"/> 78 76 <mx:DataGridColumn dataField="@version" 77 dataTipField="@version" 79 78 headerText="Version"/> 80 79 </mx:columns> -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/BrowserService.as
r260 r281 1 1 package clarin.cmdi.componentregistry.services { 2 2 import clarin.cmdi.componentregistry.common.ItemDescription; 3 3 4 4 import mx.collections.ArrayCollection; 5 5 import mx.controls.Alert; … … 22 22 [ArrayElementType("ItemDescription")] 23 23 public var itemDescriptions:ArrayCollection; 24 24 25 25 private var serviceUrl:String; 26 26 27 28 protected var unFilteredItemDescriptions:ArrayCollection; 27 // Not bindable needed for lookups over the whole collections of itemDescriptions 28 protected var unFilteredItemDescriptions:ArrayCollection; 29 29 30 30 31 31 public function BrowserService(restUrl:String) { 32 32 this.serviceUrl = restUrl; 33 33 service = new HTTPService(); 34 34 service.method = HTTPRequestMessage.GET_METHOD; 35 35 service.resultFormat = HTTPService.RESULT_FORMAT_E4X; 36 36 } 37 37 38 38 private function initService():void { 39 service.url = serviceUrl + "?" +new Date().getTime();39 service.url = serviceUrl + "?" + new Date().getTime();// +";JSESSIONID="+Config.instance.sessionId; 40 40 } 41 41 42 42 public function load():void { 43 43 initService(); 44 44 var token:AsyncToken = this.service.send(); 45 45 token.addResponder(new Responder(result, fault)); … … 53 53 54 54 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); 56 56 Alert.show(errorMessage); 57 57 } … … 61 61 unFilteredItemDescriptions = new ArrayCollection(); //create a copy 62 62 for each (var item:Object in items) { 63 unFilteredItemDescriptions.addItem(item); 63 unFilteredItemDescriptions.addItem(item); 64 64 } 65 65 } -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/Config.as
r224 r281 20 20 //Like this: "FlashVars", "isocatSearchUrl=http://www.isocat.org/rest/user/guest/search" 21 21 22 // private var _sessionId:String = ""; 22 23 23 24 public function Config() { … … 33 34 _isocatSearchUrl = isocatSearchUrl; 34 35 } 36 // var sessionId:String = Application.application.parameters.jsessionid; 37 // if (sessionId != null) { 38 // _sessionId = sessionId; 39 // } 35 40 } 36 41 … … 62 67 return _isocatSearchUrl; 63 68 } 69 70 // public function get sessionId():String { 71 // return _sessionId; 72 // } 73 74 public function get serviceRootUrl():String { 75 return _serviceRootUrl; 76 } 77 64 78 65 79 public static function get instance():Config { 66 80 return _instance; 67 81 } 68 82 69 83 } 70 84 } -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/services/DeleteService.as
r224 r281 23 23 private var service:HttpClient; 24 24 25 private static var _instance:DeleteService = new DeleteService(); 26 25 27 public function DeleteService() { 28 if (_instance != null) { 29 throw new Error("DeleteService should only be accessed through DeleteService.instance"); 30 } 26 31 service = new HttpClient(); 27 32 service.listener.onComplete = handleResult; … … 29 34 } 30 35 31 private function getCredentials():String {32 return Base64.encode("tomcat:tomcat");33 }36 // private function getCredentials():String { 37 // return Base64.encode("tomcat:tomcat"); 38 // } 34 39 35 40 public function deleteItem(item:ItemDescription):void { 36 41 CursorManager.setBusyCursor(); 37 var uri:URI = new URI(item.dataUrl); 42 var uri:URI = new URI(item.dataUrl);//+";JSESSIONID="+Config.instance.sessionId 38 43 var httpDelete:Delete = new Delete(); 39 httpDelete.addHeader("Authorization", "BASIC " + getCredentials());44 // httpDelete.addHeader("Authorization", "BASIC " + getCredentials()); 40 45 service.request(uri, httpDelete); 41 46 } … … 58 63 } 59 64 65 public static function get instance():DeleteService { 66 return _instance; 67 } 60 68 } 61 69 } -
ComponentRegistry/trunk/ComponentBrowserGui/src/main/flex/main.mxml
r161 r281 8 8 <mx:Script> 9 9 <![CDATA[ 10 import clarin.cmdi.componentregistry.services.Config; 11 import flash.net.navigateToURL; 10 12 import mx.managers.PopUpManager; 11 13 import clarin.cmdi.componentregistry.services.UploadService; … … 14 16 private function init():void { 15 17 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); 16 39 } 17 40 ]]> … … 29 52 <mx:HBox borderStyle="none"> 30 53 <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)"/> 32 59 </mx:HBox> 33 60 <common:RegistryViewStack id="viewStack"
Note: See TracChangeset
for help on using the changeset viewer.