Wednesday, September 5, 2012

Google plus launches tool for business?


From the post title, open source developers and small business entrepreneurs will be vey happy to see such a great initiative from google. Yes, It’s google plus tool available freely by 2013. We could have use these tools effectively for sharing the data and meeting the friends and colleagues across the world. Sounds good?!

You can see more details from the below mentioned link. Happy reading!
http://mashable.com/2012/08/29/google-plus-for-business

_NjN

Thursday, August 30, 2012

How to know the version of the java/j2ee application deployed?



Many occasions, you might have come across the circumstances where you may want to know the version of the application deployed for particular instances like System testing, UAT and production. Possible situations are,
1. As part of post deployment activity, you may wanted to ensure the whether the deployed build(s) is successfully deployed or not.
2. To see the version of the build deployed in production (to know the stable version of the build). You might have seen many open source applications for this. 

Ant target to achieve the same:


Java Class file that can read the MANIFEST.MF file attributes:
Code is self explanatory.   We have a small piece of Code to get the ServertContext from FacesContext.  If you are not using JSF, replace with relevant code base.





JSF presentation file used to display the MANIFEST.MF file attributes:
Below is the design view of the presentation. Bean attribute values will be populated using VersionInfoMFReader.java class file as mentioned above. Here, presentation values will be populated from the bean as below.




We have implemented the above version info reader in our application. Sample application screen print attached below. 







Tuesday, July 24, 2012

Garbage to Electricity, What does it mean to IT?


Recently, I had gone through the article on “technology to convert solid waste to electric energy”. Just admired about the innovative thought, who really thinks of others need. I* am sure, it will be great news for those who live in an electricity shortage places across the globe.
Now, I am envisaging a similar situation, one related to information technology and how this could influence the software applications. Let’s think about the quantum of application logs that are being archived on daily basis. Most of the times, we consider application logs as garbage, until we’d truly need it to resolve any critical technical incidents. My simple question to you – Have you ever taken a closer look at these logs? May it be data related or scenario based issues?  

I strongly believe these application logs are yet important information which could be used to analyze issues, and findings, which in turn might allure to a new requirement. Those might not only improve the overall application performance or quality, but as well to improve the overall customer, front line staff (if it is branch based application) and application management staff satisfaction and experience.

What do you think?

Honestly, how many invest on overall application improvement activities?

Monday, June 25, 2012

Wanted to generate PDF and MS Excel Reports within Java application?


Do you want to develop a reporting capability within java based application? I have shared my knowledge/experience on reporting projects which I have worked earlier. Happy to hear if from you if you have any concerns/suggestions.

To work with PDF Reports:

We have used FOP and iText earlier (not both in a same project) to create a pdf report using Java. Please read the below for each of its pros and cons.

FOP:
It is an open source Java API to create a PDF report dynamically in a template format. If you have a XML data and formatting object template (xsl), creating PDF report using FOP is very easy.  I would say only 3 lines of code will help you to create a PDF report.

XSLFO is a XSL formatting objects and can be used for formatting XML data and to generate PDF report. Using FOP, it is easy for us to generate a read-only pdf. At the same time, we can’t alter an existing pdf or we can’t apply any security within a pdf using FOP. Want to know more? Have a look @ http://www.codeproject.com/Articles/37663/PDF-Geneartion-using-XSLFO-and-FOP

iText:

It is an open-source and more powerful java api for creating a PDF file using java. Using iText, developers can create a PDF file with digital signature and security (including having permission for opening a document, print/copy the pdf). In addition to that, we can manipulate, split and concatenate the existing PDF(s) within Java program. Also, we can build a form within PDF document. Good set of working examples are available @ http://itextpdf.com/

You can choose the right framework to address your pdf needs.


To work with Excel Reports:

We have used POI and JExcel earlier (not both in a same project) to create a Microsoft   xls (spread sheet) report using Java. Please read the below for each of its pros and cons.

POI:
It is an open source Java API to read/write/modify Excel spread sheets dynamically if you have a template already (xsl). Say implementing the POI will be very easy if you already have the xml data response and xsl template for your report. As I understand, POI is not improved as much like JExcel in terms of protecting the xls spread sheet data. Want to learn more, please look at http://poi.apache.org

JExcel:
It is an open source Java API to read/write/modify Excel spread sheets dynamically. If you want to apply security OR to derive a new data (Sum, average etc) using the existing data, JExcel will be the right option. It is a Java API, we wanted to write Java code for column alignment, font, style etc.  Also, it supports copying charts and images into excel sheet. Want to know more? Visit http://jexcelapi.sourceforge.net/

If you unable to follow the examples used in the above links, any issues or sample codes, reach put to me.

_NjN

Saturday, June 23, 2012

“Lines of Code” Calculator


Are you finding difficulty in calculating “Lines of Codes” written in java based application? I can strongly recommend the open source tool “LOC Calculator” to do the same. It comes with very simple UI screen which is used to calculate the LOC in 10 seconds of time. Sounds interesting? Try the LOC calculator @ http://code.google.com/p/loc-calculator/


Cheers,
_NjN

Friday, June 1, 2012

Password Encryption (Hex Code) using java


In my early blog (http://nanjundanonlinedictonary.co.in/2012/02/password-encryprion-using-java.html), I had articulated the easy way of password encryption using java. The program would result an encrypted text in a hash format but not in a hex code as we can see in Spring ACEGI framework. Here in this article, we are specifically focus on possibilities to convert SHA hash password SHA hex password.

Old Code:
  
byte rawBytes[] = md.digest();
String hashPassword = (new BASE64Encoder()).encode(rawBytes);
  

New Code:

byte rawBytes[] = md.digest();
StringBuffer strBuffer = new StringBuffer();
      for (byte rawByte : rawBytes) {
        strBuffer.append(Integer.toHexString((int) (rawByte & 0xff)));
      }
String hexText = strBuffer.toString();

Saturday, May 19, 2012

How to update the Log4J logger level dynamically for a web application?


Are you looking for an option o update the Log4J logger level dynamically for a web application? If so, here is the solution for people like you to update the logger which doesn’t require any log4j,xml file configuration change or serve restart.

Here we had developed a jsp page that will show the current loggerName, loggerlevel and the list of logger levels lits it can take. Now, you can select the new log level from selectbox to set the new logger on the fly.

Here is the code sample. Wanna try?


<%@ page import="org.apache.log4j.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
Dynamic Log4J control
<%
            Logger logger = Logger.getRootLogger();
            logger.setLevel(Level.toLevel(
                                    request.getParameter("selectedLevel"), Level.INFO));
%>


           

                       

           

           

                       

                       

                       

           

           

                       

                       

                       

           


                       

Dynamic Log4J control


                       
Current Log Level Logger Name Set New Log level
${rootLogger.level} ${rootLogger.name}

Pega Decisioning Consultant - Mission Test Quiz & Answers

The Pega Certified Decisioning Consultant (PCDC) certification is for professionals participating in the design and development of a Pega ...