![]() |
|
Spaces home Patrice SecheressePhotosProfileFriendsBlog | ![]() |
|
|
November 24 Stable version of VolunteerBaseThis version 0.6 of volunteerbase contains fixes and minor improvements, the project is now in a stable phase. The Wiki user guide has a comprehensive coverage of all the functions. The package has been upgraded to Tomcat 6.0 and the distribution can use Java 5.0 or 6.0. October 19 Volunteerbase project specifications completedWith the release 0.5, the project is now covering the initial specifications. The next big steps will be the functional tests, acceptance test and the documentation. The test by the new SPW Australia team should add some new ideas and further evolutions. October 04 Release 0.4 of VolunteerBase projectAfter a long iteration, finally the 0.4 is published. The biggest challenge was to include a reporting capability without using heavy weight framework. After some issues with JPA and iReport, I have decided to choose a simpler and well known solution with Apache Fop. The idea of xsl-format looks good. It uses the css style and is able to generate many output (html, pdf, png, RTF etc...). It's really handful to separate the content of the presentation and it gives the possibility to customize easily the report. However it's not very efficient to create rapid report with complex structure. Associated with a lack of tools and the future css3, I not sure of the future of this product. The release contains also a bunch of bug fixes. The new function is the volunteer contribution management. The features are:
The next feature in 0.5 will be an individual report to give a situation of the volunteer contributions. August 22 Volunteer Base release 0.3
This release is mainly focused on usability improvements. The iterations will deliver alternatively new functions and defect fixes. The goal is to move from a prototype (release 0.1) to a production ready software with all the functions required in version 1.0. This release includes work from Sean Melody, a new active and motivated contributor. August 08 Programmatic Login from a Stand-Alone ClientThis blog follow the previous one "Secured EJB 3.0 Web Start Application Client". Now, we want to access the same EJB without Java Web Start and we want to provide a user/login programmatically. We can use a class provided with GlassFish : ProgrammaticLogin. I assume you have done and deployed the previous project. The client part of the previous Enterprise Application is not necessary, you can skip it if you have not already done the demo. We will create a totally independent project. Create the projectCreate a new project, select Java, Projects -> Java Application and click Next. Name the project ProgrammaticLogin and click finish. Add the librariesWe need few libraries from Glassfish in order to run the project. Right click on Libraries -> Add JAR/Folder, Right click again on Libraries -> Add Project and add the EJB project Login-ejb. Login codeYou can now open the Main class and input the following code inside the main method: ProgrammaticLogin pm = new ProgrammaticLogin(); InitialContext ctx; Resolve the imports (Ctrl+Maj+F with NB 5, Ctrl+Maj+I with NB 6). Run the demoStart the application server. Before running the client, we must set the configuration in order to obtain the correct login module. We must give the JAAS config file. Right click on the project, select Properties -> Run. In VM Options, add : -Djava.security.auth.login.config=D:/JavaServers/glassfish-v2-b53/lib/appclient/appclientlogin.conf Replace D:/JavaServers/glassfish-v2-b53/ by the directory of your GlassFish serveur. Note: don't forget the - at the beginning of -Djava.sec... Click Run, you will see the 2 messages, including the message from restricted method hello(). NoteThe programmatic login can be used with Java Web Start. Just add the 2 lines in bold in the code to the previous demo and add the required libraries. August 05 Secured EJB 3.0 and Web Start Application ClientOne option of the Glassfish Server is the ability to launch a desktop client application from the server with Java Web Start. Associated with NetBeans, it's easy to create a secured application easy to distribute. First, with NetBeans, ensure you have GlassFish server registered (see Tools -> Server Manager and add your server GlassFish or Sun Java System Application Server version 9 included in the JavaEE 5 SDK). Create the projectCreate a new project, select Enterprise, Projects -> Enterprise Application and click Next. In window 'Name and Location', fill in the project name with Login, your GlasFish server as Sun Java System Application Server, Java version as Java EE 5 and select Create EJB Module, deselect Create Web Application Module, select Create Application Client Module. Leave the default values for the module names and press Finish. Create the EJBRight click on Login-ejb -> New -> Session Bean. Set the EJB name with Calculator, package with demo, check Remote and uncheck Local. Leave stateless checked. Create method addIn the CalculatorBean.java source, right click -> EJB Methods -> Add Business Method. Name the method 'add' with int as return type and 2 parameters a and b as int. Replace return 0 by return a + b Create the method helloRepeat the same process to add a business method hello with a String a return type and a String as parameter with 'name' as parameter name. Replace return null by return "Hello " + name; Add security annotationsBefore @Stateless, add an annotation to declare the role admin. Insert the line : @DeclareRoles("admin") Before the method hello, add an annotation to restrict the access of the method to the role "admin": @RolesAllowed("admin") The source of the EJB must look like this package demo; import javax.annotation.security.DeclareRoles; /** public int add(final int a, final int b) { @RolesAllowed("admin") Client codeOpen the project nodes Login-app-client -> Source Package, login and double click on Main.java. Right click in the source select Entreprise Resources -> Call Enterprise Bean and select CalculatorBean. Press OK. The line to reference the bean is automatically inserted: @EJB Add the lines below to call the methods: javax.swing.JOptionPane.showMessageDialog(null, "2 + 2 = " + calculatorBean.add(2, 2)); Press Alt+Maj+F to resolve the import. The source must look like: package login; import demo.CalculatorRemote; /** Run the applicationPress the Run button Enter any name and password, the application will fail because we need to create the users and map the role admin. Create the usersIn the Runtime tab (service with NetBeans 6), open the Servers node and right click on Sun Java System Application Server and select View Admin Console: Your browser will open a window to log on the server. Put the admin name and password you give when installing the application server. Select Configuration -> Security -> Realms -> file and click Manage Users. Click New to create two user, one in the group user, the other in the group admin. In my example, the user demo is in the group admin and the user user is in the group user. Roles mappingTo map the roles, open in the project tab the Login project -> Configuration Files and double click on sun-application.xml. Click on Edit As XML and replace <sun-application/> by : <sun-application> Run again the application, enter the user demo and the password, you will see two windows: If you try again with a user outside the admin group, you will see only the first message and the application will throw an error. Note : with NetBeans 5.5.1, I must kill the Login process after the execution. To do this, select the Runtime tab, open the Processes node, right click on Login (Run) and select Terminate Process. Java Web Start the applicationIf you open the browser and use the address http://localhost:8080/Login/Login-app-client the application will start automatically. This conclude the demo and give a glimpse of the power of NetBeans and GlassFish. These products are easy to use, well designed, efficient and designed for enterprise solution. Associated with the power of Java EE 5 annotations, you can construct a solution without headache. July 29 English vocabularyThank you Sandy for your message to notify some mistakes but I can not respond as a result of your security setting which prevent it. I must admit that my English is still weak after seven months in Australia. Unfortunately, it could not be as good as my computer skills and my native French (Sandy guess was right, I'm French). I try to go ahead but sometimes errors happen, it is part of the learning process. I know it's important to improve my English level so I am student in night courses. Furthermore, I can't ask people to check my writing, I'm working alone and my wife is also French. If you are ready to give me a hand, you are welcome Last point, I agree that the missing 's' of adds was an ugly fault and I can't argue about the plural of functionality but if you look up in the Macquarie (Australia's national dictionary): functionality 1. the purpose designed to be fulfilled by a device, tool, machine, etc. 2. Computers the range of functions which an application has. Not so ugly, isn't it? Volunteerbase project release 0.2This version adds new functions to the product : - new search filters and advanced search criterias - export to merge mail / emailer to send e-mails - reminder and actions to be completed It also includes some code improvements and minor bug fixes. July 09 Release 0.1 of VolunteerbaseThe first release is ready. This is a typical front end system without any extra functionalities. It gives all you need to add, modify, delete, search any information, including documents. The next release is intended to add a mailer with merge capabilities, reminders, actions to be conducted, etc... June 06 Volunteer Base project hosted on SourceForgeThe volunteer project (about volunteering) wich I am developing is new hosted on SourceForge. Feel free to look the site http://volunteerbase.sourceforge.net/ March 17 First blogWelcome to this blog. If you are looking for an exellent project manager or/and analyst programmer, I fit the bill. If you are looking for a free lancer or volunteer for your Information System with latest technology, stop here, I can help you. You can find some examples of my work on www.microcode.fr or www.habitersurlacote.com |
|
|