Why are xforms-submit-error event properties allways empty? - error-handling

I've just started with orbeon and xforms for some project.
I have Orbeon succesfuly integrated with my test application as xforms engine (separate deployment with crosscontext).
Now, xforms basics are behind me and I needed to implement some kind of error checking after submit. So I'm trying to handle xforms-submit-error for example like this (this is modified example from w3.org):
<xf:submission action="/processor500" method="post" id="submission1" replace="none">
<xf:message ev:event="xforms-submit-error" level="modal">submission1 error (<output value="event('response-status-code')"/>)</xf:message>
</xf:submission>
/process500 is empty servlet, which just raise RuntimeException so it is returning 500 response code.
But response-status-code in event is allways empty. Any of event properties are allways empty and i just can't figure it why (google didn't help this time).
Any suggestions?
Thanks.

event('response-status-code') on xforms-submit-error is supported, and your example doesn't work most likely because you're missing a prefix on the <output> (it should be <xf:output>). Also see this XForms test case showing the event('response-status-code') in action.

Related

How to handle 500 server errors in Umbraco

I just want a custom error page when a server error occurs - I've tried endless combinations of suggestions that I've found on google but nothing even begins to get me there.
Essentially, I have some error handling routines in my surface controllers where I want to log the error & then throw the exception so that somewhere down the line a 500 response code is returned & a custom error page is displayed.
try
{
repository.AddShoppingCartItem(sci);
}
catch(Exception e)
{
Log.Error("whatever...");
throw;
}
Then in my web.config I've tried
<customErrors mode="On" defaultRedirect="error500">
</customErrors>
and
<customErrors mode="On" defaultRedirect="umbraco/surface/error500surface">
</customErrors>
(where the 1st version uses a regular controller & the second a surface controller)
Neither do anything.
I've also added this line as others have suggested but it makes no difference:
What I get is my normal layout page getting rendered along with this message:
Error loading Partial View script (file: ~/Views/MacroPartials/Addcart.cshtml)
what I want to happen is for a custom error page to be displayed instead.
Reading all the stuff on google, I'm completely confused as to whether I need to configure Umbraco to handle these errors or whether it's a pure MVC approach. I get the impression that 404 errors are done through umbraco but 500 errors need to be a pure MVC approach. Don't know if anyone can confirm this. Either way, something up the chain is swallowing my throw statement & I don't know what it is.
I've also tried
return new HttpStatusCodeResult(500);
in place of the throw & that just gets me a nasty IIS error page.
Any help would be most appreciated as this is driving me nuts.
500 errors are server errors and no different in Umbraco than in regular IIS:
This is a server error and can only be solved by website admin who has access to files and the web-server. There can be one of/or multiple reasons to get this error. One has to track down the issue and handle accordingly.
http://www.codeproject.com/Articles/545054/HTTPplus-plus-e-plusInternalplusserverplus
More info:
https://serverfault.com/questions/407954/how-to-diagnose-a-500-internal-server-error-on-iis-7-5-when-nothing-is-written-t
Edit: apparently you may be able to enable custom errors like so:
http://helpnotes.vpasp.com/kb/611-General-hosting-questions/1089-How-to-Turn-Off-Friendly-Error-in-IIS-7xx/
Edit2: This may be of interest as well:
http://benfoster.io/blog/aspnet-mvc-custom-error-pages

IBM RFT does not find .net object from framework

I have to check a frame window with RFT which is written with a .net framework. My problem is, after adding the frame as Testobject via drag and drop to the script it works fine. But after restarting RFT, it isnt able to recognize that frame any more, neither with find method or the highlight function for objects.
I read that there is a way to add objects to the proxys. But this frame is declared at proxy .Net.FormProxy and this proxy is existing in the file rational_ft.rftcust as
<Obj L=".Proxy">
<ClassName>Rational.Test.Ft.Domain.Net.FormProxy</ClassName>
<Replaces/>
<UsedBy>[System.Windows.Forms]System.Windows.Forms.Form</UsedBy>
</Obj>
I dont get what is the problem. Especially, why is it working some times but not always.
Thx for help..
The problem you have mentioned may happen for the following reasons.
The object recognition is indeed changing . And it is not necessarily the object that you are having problem with has object recognition issue , but an object in the parent heirarchy of this object (unless this object is the top level object).
The second reason could be the application is not getting enabled during playback time and you can try getRootTestObject().enableForTesting(/) API to force enable the application.
On a recorded Form object in the Object Map try to use the "update recognition properties" to see if there is change in recognition properties in actual vs recorded object.
You can also just test a different simple Form Application to see if the issue is related to your application or if it is general issue in your environment( I suspect it to be related to the application).

navigationservice.navigate not available on the vs2013 project

I have two page application and the main page is default is "MainPage.xaml" and the second one is "AddPerson.xaml" when user click a button on main page I want the app to take user to "AddPerson" page.
And I wrote following for the Click event of the button
Me.Frame.Navigate(System.Type.GetType("AddPerson.xaml"))
and I am getting the following error
An exception of type 'System.NullReferenceException' occurred in MedicineSchedule.exe but was not handled in user code
Additional information: Object reference not set to an instance of an object.
If there is a handler for this exception, the program may be safely continued.
I tried other method of navigationservice.navigate which I cannot find the class in VS2013 express at all. The only method available is Me.Frame.Navigate in my project, please let me know how I can get this simple thing to work.
If it was .net 2.0 I would simple called new form with form.lod or something similar.
This doesn't work?
this.Frame.Navigate(typeof(AddPerson));
If you want/have to use a string take a look at the reply here:
convert string to type of page

ICEfaces ace:fileEntry not working in Liferay portlet. Have a clue that needs explaining

Using LR 6.1.0-ce-ga1 and ICEfaces 3.2.0. Have this code in my xhtml:
<ace:panel>
<ace:fileEntry
required="true"
requiredMessage="You may not save if you have not selected a file."
fileEntryListener="#{profileBean.listener}"
maxFileCount="1"
maxFileCountMessage="Select one file, please."
useSessionSubdir="true"
immediate="true"
/>
</ace:panel>
First, the immediate doesn't work. listener in my bean never gets called. But that's maybe not as important as the following.
I have h:commandButton on the form. When I click it, I see what looks like the beginning of a progress bar drawn like it's going to display file upload progress. This is immediately covered by the following:
This box is often associated with ICEfaces push problems (I've been told by ICEfaces). I added icepush.jar to WEB-INF/lib, but it didn't help. What I'd prefer is not to have the alleged progress bar try to render at all.
So, would appreciate anyone's help in making this file upload work.
P.S., I've tried Tomahawk and plain Apache JSF 2.0, also. I'd like to get the ICEfaces version working, but I'm kind of open to any working solution, given my (Servlet 2.5-based) environment.
Thanks.
I would recommend that you look at the source code for the icefaces3-portlet demo, as it shows how to upload a file with ace:fileEntry in a portlet environment.

CAsyncSocketEx + console application ?

I have console applicaiotn that currently uses CAsyncSocket.
I need to implement SSL so after some searching I found this project: http://www.codeproject.com/Articles/3915/CAsyncSslSocketLayer-SSL-layer-class-for-CAsyncSoc
For some reason same simple code that works fine on GUI code does not work in console app.
Has anyone exp. with CAsyncSslSocketLayer ?
Thanks.
CAsyncSocketEx uses a window as a sort of cheap thread to handle the event notifications that come from select(). Unfortunately, if you don't have a message loop, then the window which it creates will not receive these events.
http://support.microsoft.com/kb/90975
This article explains that a call to CreateWindow() needs to be called from a thread which has a message loop. And if you don't, then anything sent via PostMessage() won't get there.
I've recently started to tinker with this -- I want to remove the annoying hidden window and replace it with a normal thread. Their code relies on WSAAsyncSelect() in order to receive socket events... to a window. Yuk!
It's been a while since I had the same problem, but if I remember correctly, to use CAsyncSocket in a console app you need to add something like DECLARE_CONSOLEAPP (first two links shown below) to your console app. This should give your console a message pump to generate the socket notifications (OnReceive, etc.) GUI apps have these pumps but console apps don't, generally. The third (msdn) link below might also apply, it has more info and a different way.
If these still don't work, you should put breakpoints in your socket code and make sure your socket isn't instantiated in a thread or callback other than the main console app (the one that now has the message pump).
I think googling around for 'CAsyncSocket WinApp' or 'CAsyncSocket console app' would show more.
http://www.codeguru.com/cpp/misc/misc/consoleapps/article.php/c243/Console-app-using-MFC.htm
http://troels.knakkergaard.dk/code.htm
http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/a6f1b72a-21d8-4046-a3dc-d7d29ece2ef6