Latest articles

Great ad-on for Visual Studio for CSS/javascript work

Web Workbench helps you develop css/javascript much quicker.

See

http://www.mindscapehq.com/products/web-workbench

The same group offers a free edition of ORM tools for Visual Studio

http://www.mindscapehq.com/products/lightspeed

File explorer for VS2008 and VS2010

http://www.mindscapehq.com/products/vsfileexplorer

Read more


.NET offers easy XML parsing

XDocument doc = XDocument.Load("http://localhost:8153/some.xml");
var query = from node in doc.Descendants("node")
select new { ff = node.Element("ff").Value, xx = node.Element("xx").Value };

foreach (var ele in query)
{
System.Console.WriteLine(" HEY " + ele.ff);
}

Assuming the xml looks like this

<root>
<node>
<ff>hey</ff>
<xx>Hello</xx>
</node>
</root>

Read more


European mobile firm developers skin scan app

A phrase "An app for that" is already iconic and yes games and silly apps are fun but what about health related applications. Here is one from a Romanian startup: SkinScan App http://www.skinscanapp.com/ A quick picture might help people warn them if a mole is potentially cancerous. Now this is innovation for humanity.

Read more


Oracle Localization tips

Localization settings can be set on Database level, Instance level (imagine geographically despersed cluster) , Session level

 

Environmental variable NLS_LANG allows to override Language settings on a session level.

For example you have an application deployment in Italy, obviously you're expecting data to come in an Italian/European format here is the settings for your Unix box:

 

NLS_LANG=ITALIAN_.WE8MSWIN1252

 

Database language settings

 

To find out your setting use this handy query:

 

select * from nls_database_parameters;

 

Will you quite a list of information on your settings, such as:

 

NLS_LANGUAGE ITALIAN

NLS_TERRITORY ITALY

NLS_CURRENCY <euro sign here>

NLS_ISO_CURRENCY ITALY

 

 

More information can be found at Oracle:
http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq.htm#_Toc110410543

Read more


Spring Web Flow stream or generate files

Spring Web Flow is a neat framework for JSF navigation and action management. It may not be the most versatile or very advanced but it will handle almost all of the scenarios in web development. In the future they will finally get rid of Dojo dependency for ajax operations and allow any javascript library (jquery, prototype,etc) to be used instead.

 

http://www.springsource.org/go-webflow2

In any enterprise application users expect to generate Adobe PDF reports or Excel worksheets, but how do you map an action that retrieves a pdf back to the user using Spring Web Flow. Here is a perfect example from my own experience:

Flow definition

 

<transition on="getPdfreport" validate="false">
            <evaluate
                expression="someBean.getFile(flowRequestContext,requestParameters.selectedName)" />
        </transition>

 

Class method

 

 public void getFile(final RequestContext context, final String name
            ) throws Exception

{

//some standard code to set content

try{ 

final HttpServletResponse response = (HttpServletResponse) context
                    .getExternalContext().getNativeResponse();
            response.setContentType("application/pdf");
            final OutputStream out = response.getOutputStream();
            out.write(fileContent);
            out.flush();
            out.close();
        }catch(Exception ex){
            log.error(ex);
        }finally{
            // its important to complete response otherwise the JSF rendering will
            // fail
            // java.lang.IllegalStateException: Response already committed
            context.getExternalContext().recordResponseComplete();
        }

}

 

The most important line here is recordResponseComplete(), it completes the response JSF cycle properly through SWF.

You must be passing the context in order to do this, see class: org.springframework.webflow.execution.RequestContext

 

Happy Programming

Read more