configuring error messages in flex application - apache-flex

I'm trying to create a Flex based internet application with an EJB layer in the server. This layer provides the XML used by the flex application. It uses the Cairngorm architecture. Currently, on an error I call the handler function defined in all the command files. How can I centralize this?
My idea is to create a XML file that contains all the error messages and the types of error message eg:- Warning, Error etc. In the error handler, I will call the error handling function and pass a unique id which in turn will display the error message defined in the xml config file. Do I need to load this XML file in the Model layer of the application itself and store them as say global variables?
Please suggest me ideas on overriding the Alert box so that I can create Warning alert, Error alert etc.

Load the xml file when the app loads, and store the messages on a model. When you need to fire off an error message, you can fire the appropriate event, and you can have a command that pulls the right one from the model and displays it. Alert is definitely the way to go if you want to have a command open a window.
The better (but harder) option is to have a view that binds to a model, which model has a property like "hasError" and "errorMessage", so if hasError gets set to true, the view opens a custom popup.

TitleWindow is not good enough?

Related

Copy file(directory) to clipboard after exporting to pdf

I want to store the exported pdf file to clip board to be able to paste as an attachment in outlook. I'm using asp.net / vb and i've tried to import system.windows.forms in my web application to use the clipboard class.
any idea?
'here's my code:
Clipboard.SetDataObject(System.IO.Path.Combine("C:/Temp/", HttpContext.Current.Session("fileName")), True)
'this is the error after this process:
Exception thrown: 'System.Threading.ThreadStateException' in System.Windows.Forms.dll
An exception of type 'System.Threading.ThreadStateException' occurred in System.Windows.Forms.dll but was not handled in user code
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
ASP.NET code is run on the back end side, i.e. server. So, accessing the Clipboard on the server doesn't make any sense. Instead, you can find a JavaScript code/component which can be run on the client browser.

BizTalk - WMI script to publish the message to message Box

I am trying to publish a message to BizTalk message box using a WMI script . Basically, I am reading the message from non resumable instance. I need to publish this message back to message box instead of saving as file.
Is there a way to achieve this?
Actually, MQ would probably work for you. What you can do is 'encode' the properties and write them to the MSMQ Label property for example.
Then, you can use a custom Pipeline Component on the Receive Location that 'decodes' the MQ property and re-writes the message context properties.
I've done similar in the past and it works just fine.

var_dumper dump destination

Using VarDumper Component for Symfony 3. It works great apart from the fact that the dump is shown in the toolbar instead of the page itself. I've read the docs but can't find the proper option for dump_destination to show it on the page.
As explained in the doc,
Since generating (even debug) output in the controller or in the model
of your application may just break it by e.g. sending HTTP headers or
corrupting your view, the bundle configures the dump() function so
that variables are dumped in the web debug toolbar.
But if the toolbar can not be displayed because you e.g. called
die/exit or a fatal error occurred, then dumps are written on the
regular output.
So you can call die() or exit() before returning the response if you want to get your dump on the page.
If you want to dump a specific variable in your page while returning a response, you can pass it to Twig and then use {{ dump(foo.bar) }} to dump it in your page.
There is also an explaination on how to dump into a strin in the doc.
You can also try to dump to php://output by configuring dump_destination.

No output (send part) on BizTalk pipeline

I have built a flatfile schema with the flatfile schema wizard.
The schema is valid and I could successfully validate my test instance against the schema.(So the XML file was created correctly).
But when I put my test flat file into a receive location that uses a flatfile disassembler pipeline, nothing happens after the receive location has picked up the message (the logical receive port is bounded to an orchestration)
In the BizTalk Admin Console I only see in the tracked message events from the pipeline that the message has been received. But not sent.
Maybe some of you already had a similar issue and could help me here.
Tracked message events in the pipeline
So. The issue was a wrong declared header schema. I have rebuild it and after that it was working fine.
I have recognized the issue by removing the header schema from the pipeline properties and trigger a new process. At this time the message was created correctly (but with the header line due to a missing header schema that would prevent that line).
Thanks to all who helped here!

Biztalk Message Promotions

I'm relatively new to Biztalk and I'm having a bit of hassle with this:
I have built a simple orchestration, hooked it up correctly to a receive port, I'm using the correct schema and map and the orchestration seems to be subscribing ok.
However, when the file I want to process gets picked up at the port I'm getting the 'could not be routed because no subscribers were found' error.
I ran a HAT query and can see the orch has an active subsription to the correct thing, is there anything else I can check on this?
Is your port hooked directly to the orchestration or is the orchestration picking the message up from the message box? Has the orchestration receive been set to Activate?
What does your subscription filter look like for the orchestration?
As a futher test:
a) create a sendport (FILE)
b) add a filter to it; BTS.ReceivePortName =
c) grab the resulting file - it should be the XML thats produced by your Custom PL
d) Use this file with a receive location using an XML Receive PL and see how your orchestration reacts to
This will at least rule out a Pipeline issue...
HTH
Check your pipeline is XMLReceive. This will promote the MessageType property and hopefully your orchestration will subscribe successfully.
Find the failed message in HAT and look at the body of the message. Copy it out and then run validate it against the schema of the message you are expecting. If it doesn't validate then you have set your flat file disassembler up incorrectly.

Resources