Notes and remarks over the GUI - apache-flex

I am developing a flex application for collaborative data analysis. To present the data my application uses standard and custom components (grids, charts etc.).
I want to deliver the feature that allows users making notes over the GUI of my application. So, other users will see they notes late on.
At the moment my question is: How can be implemented mechanism that allows making notes over the GUI? All suggestions and examples are welcome?

There are a lot of ways to approach this. ( Check out Buzzword, MS Word, and Acrobat all for slightly different approaches of note taking on a document--I assume an application GUI could use any of the same approaches ).
I'd start by saying that the click event bubbles:
http://livedocs.adobe.com/flex/3/langref/flash/display/InteractiveObject.html#event:click
So, listen for the click event on every child of your main application file. When you receive that click event you can provide some business logic as to whether or not you want to add a comment /note on the component that was clicked. Then you just some "note" component for collecting and displaying the note data. You an position them based on the x, y values of the click event.

So, actually my problem is much easier then I expected (thank for great design of Flex).
I decided to utilize PopUpManager functionality for my task. It does everything I need at the moment.

Related

Connecting an IObservableVector<T> to a WinJS ListView

We are developing a Metro-style app in C++ and JavaScript. The C++ side provides us with IObservableVector<T> instances. The JavaScript side uses the WinJS.UI.ListView control.
List views are normally hooked up to WinJS.UI.IListDataSource instances. Most typically, one takes a WinJS.Binding.List and uses its dataSource property.
However, it seems very natural to want to hook up an IObservableVector<T> to the list view. Is there any way to do this? For example, is there any adapter for turning IObservableVector<T>s into Lists or IListDataSources?
One route we could go down is to write our own custom WinJS.UI.IListDataAdapter implementation that hooks up to an IObservableVector<T>, then go through the whole game with the poorly-documented WinJS.UI.VirtualizedDataSource and so on. But, has anyone done this already? It seems like it should be in the framework.
WinJS 1.0 doesn't support the WinRT change notification interfaces (INotifyPropertyChanged, IObservableVector). If you want to hook them together, you'll need to write an adapter/data source.
Based on #Chris Tavares's helpful, if discouraging, response, I wrote such an adapter:
https://github.com/NobleJS/WinningJS/blob/master/lib/ObservableVectorDataSource.js
It is currently read-only (so you cannot update the data source and expect changes to propagate to the observable vector), but works great in our app.

Workflow Foundation 4 - How to create a web based representation of the workflow?

We have to write a ASP.NET site based on a workflow.
The client wants to see a graphical representation of the workflow. In addition (let's say it is a workflow for processing orders), the client wants to see at what point in the workflow any given order is, indicated on the graphical workflow representation by a highlighted node or some visual queue.
All of this must be available via a web interface.
Was hoping somebody had some bright ideas for how to achieve this without writing extensive custom controls.
Does Workflow Foundation 4 offer anything itself that would assist toward this end?
There are ways to use the WorkflowDesigner and issue the save image command through code but as it's a WPF control it needs to be hosted on a WPF form. I have tried to do this from a webpage but as the form isn't visible it has a size of 0. I didn't spend a lot of time in this so it might be possible.
See this for details on how to do so.

How to do Actionscript trace and/or component flow log using debugger

An existing (though incomplete) FLEX3 project was given to us to finish (always a nightmare).
It is quite small but highly abstracted (contains well over 150 files to support only about 10 page views). I'm attempting to trace a single mouseclick event through this maze.
Is there a way to print out an actionscript trace and/or component flow using the debugger (or any other tool that anyone knows of)?
The flash.txt file appears worthless since it doesn't contain ActionScript calls and/or component flows.
Thanks
This will print your execution graph:
Trace.setLevel(Trace.METHODS, Trace.LISTENER);
Trace.setListener(handleMethods);
function handleMethods(fqcn:String, lineNumber:uint, methodName:String, methodArguments:String):void
{
trace(methodName);
}
Oof. Yeah, always.
The Profiler might give you useful information, but you need to pay for FlexBuilder Pro to get it, if you don't already have it. I'm not real handy with the Profiler, so I may be off base with that advice. It would be worth checking into, though, if you are already familiar with other profiling tools.
I would probably just start looking at every point that .addEventListener(MouseEvent.CLICK occurs in the code - and .addEventListener("click", just in case the previous developer chose not to use the constant, for some reason.
Obviously, that could show up a lot in 150 files, but that's how I would go about it.
I would also look at any custom events that could get into the mix. Because maybe the CLICK event is handled at some point and the handler dispatches a custom event. And maybe the handler for that custom event dispatches another custom event. Or dispatches a MouseEvent.CLICK event, etc.
Hope that helps. Good luck...
Check out
http://jpauclair.net/2010/02/10/mmcfg-treasure/
esp.
AS3Trace = 1|0
This one is also very useful for
debugging It trace every single call
to any function that is being called
in the SWF at runtime! It’s like
expending the StackTrace to the full
software run time.
And many more.

Flex: Testing UI components at the click level?

I've been working on a Flex component and I'd like to write some automated tests for it. The trouble is, the UI testing tools I've looked at (FlexMonkey and Selenium Flex API) don't simulate "enough":
Most of the bugs which have come up so far relate to the way Flex deals with dragging and dropping, which these libraries can't simulate accurately enough. For example, I need to test a case where there is a "drop" event which occurs in the bottom half of a component – neither FlexMonkey nor Selenium Flex API can do that (they may simulate a mouse event, but they won't include coordinates).
So, is there any "good" way to automate that sort of testing?
Edit: After much research, it looks like the only piece of software that can do this is iMacros, which is Windows-only and the interface is... Lacking. So I'm going to be writing my own. Basically, it will put an HTTP interface on java.awt.Robot so code (in any language) can simulate mouse/keyboard events. If you're interested, PM me and I'll keep you updated.
Edit 2: I have published the first version of the framework I wrote, Blunderbuss, over at BitBucket: http://bitbucket.org/wolever/blunderbuss/ . You'll need Jython to run it (http://www.jython.org/), but after that the flex-client example should work.
Videos of Blunderbuss live over at Vimeo:
Automating Flex testing with Blunderbuss
Blunderbuss test suite running
At the moment this remains a proof-of-concept, as I haven't had the cycles to clean it up and make it more useable… But maybe enough people bothering me would give me that time :)
I've used Eggplant to test Flash and AIR apps without having to add any hooks into the code. It's a great tool but it's quite expensive. It simulates a real user by VNC-ing into a system and uses image recognition - among other things - to interact with the app.
I am definitely interested in your custom Java class, and (though I am not the best at Java (yet...)), I would be willing to help out if you're thinking of making this collaborative.
As to Flash MouseEvents. Unfortunately, there really isn't an accurate way to simulate the drag/drop experience in Flash. MouseEvents, when generated by the mouse, are handled in a very different way than regular events and while you could simulate actions by passing events into the handling functions, or by making the dispatcher fire a new DragEvent( DragEvent.DRAG_DROP..., it will not be the same as having the user interact with it. And for some functionality (like gaining access to the clipboard), nothing inside Flash will accomplish your goals.
To be honest, you're probably headed in the right direction -- using something which is not written in Flash to drive faked mouse events is probably your best bet.
I've never had to use it in Flex but i recently stumbled across some info on automation packages in the MS Surface SDK... after looking into it those classes automated user behavior which can be used for testing i.e. move a fake mouse to this point, perform this action. As you're using Flex mx.automation packages and classes. My guess (and hope) is that you'd be able to achieve what you want using these classes.
You could also try auto-hotkey - it is similarly a macro-editing program but it has proven to be very efficient and you can write scripts and set it up very easily.

ASP.NET based Workflow Engine

I am working on a design spec for a new application that will be heavily workflow driven.
Before I re-invent the wheel, is there a decent lightweight workflow engine that plugs into ASP.NET already around?
Basically, I'm looking for something that handles moving through a defined set of workflow pages while handling state management automatically.
If this isn't around already, I'll definitely try to abstract the engine from my app and put it on codeplex, as it would be really handy.
Any suggestions?
Note: .NET 2.0, so no WWF, though I think WWF is overkill for my needs.
EDIT: Seems like there is a legitimate need for this, and there isn't a product out there...So I might build this.
Here is what I'm picturing:
Custom Page class called WebFlowPage
All WebFlowPage's are registered in a Workflow mapper.
Each WebFlowPage has some form of state object.
A HttpHandler handles picking the appropriate WebFlowPage based upon the workflow, and populating it from the state object.
Is the workflow dynamic, or static?
If the workflows are simple, you could roll your own workflow engine.
In certain situations, it can be fairly simple, and just a couple of data tables to handle the rules, processing and state.
Alot of workflow engines are built for large scale processing (credit card applications, for example). For small scale, you should at least consider your own, which would eliminate the overhead and dependency of/on an engine.
Not sure exactly what you wish to do here, but Ra-Ajax can easily keep state at least if you want your solution ajaxified...
For reference purposes you might want to check out the Ajax Calendar sample or even the (banalistically implemented) Ajax Wizard sample. It surely beats the hell out of doing it with JavaScript...
And every time you "do something" you're in "server-land" which means you can store temporaries all the time as you wish...
The project is LGPL
(PS!
Yes I do work with it)
Building a custom workflow engine is not trivial, although it may seem simple at first. We've tried that. It depends a lot on the complexity of the logic you need it to cover.
Given the current state of the Windows Workflow Foundation and the lack of another framework that abstracts the workflow concepts, I would choose WF if you need complex logic, asynchronous handling or branches in your workflows.
Tracking your state through the workflow can be accomplished by carrying some kind of xml payload or storing the state in a database,
If your workflow is actually a sequential set of forms that need to be filled in by the user, tracking the steps and guiding the user to the next step can be accomplished with some simple custom solution.
You could take a look at the InRule engine too.
Also, there is nxBRE.
These too are mostly used for business rules.
InRule is proprietary, whereas nxBRE supports RuleML (the defacto standard).
You might need to make your own implementation for the pages, and use the rule engine as the "structure".
At this moment, I know that Sharepoint 2007 supports page workflows (using WF), but this would imply using .NET Framework 3 and deployng sharepoint.
My suggestion would be to use whatever you find more light and easier to use.
I think the term "workflow" is very open to interpretation. I have been working lately with a type of workflow that is very different from what you seem to be describing. Mine is a state machine based workflow where the state of a particular record determines what actions a user can take to move the record to the next step in the business process. So "workflow" in this instance means how the record flows from one state to another until it is finally completed.
Your usage of workflow seems to have more to do with moving a user from one page to another in a linear multi-step process, which is a completely different use case (correct me if I'm wrong). So before coming up with a general purpose "workflow" engine that anyone could use, I would recommend defining a little bit better exactly what types of situations this system would handle.
I've been using this for a few months http://objectflow.codeplex.com. Not asp specific but it may fit your needs
While browsing the web for some workflow & BPM resources, I found the following project: NetBPM. Unfortunately, the project seems to be stopped.
I don't think there is a workflow engine that will automatically handle state for you, but if you are moving through a set of pages like a process such as checkout on an ecommerce site, perhaps the ASP.NET wizard control could help you?
There are few workflow options. "Aspose" and "Skelta" are the offers I´m evaluating.
Fábio
you can use WorkFlow Engine, just read the document and run the Demo.
all of the features you need for a dynamic workflow engine they added in there.

Resources