Archive for the ‘- openTruuls™’ Category.

How to create a Captcha in zk ce version?

Creating an own Captcha component while it’s not in the zk community version.

As i work on the ‘forgotten password?’ module in openTruuls™ i would use a Captcha component for the user verification and i’m wondering that such a component is not in the zk community version. So openTruuls™ will be opensourced i need a Captcha component that developers can using without registering for a personal or commercial zk version.

After a few searching in the zk forum and the WWW i became a hint from Maik, the developer behind the jease cms ( www.jease.org ) to using the simpleCaptcha framework.

Argh, the biggest problem was to find a repository where a not corupted  version is downloading via the maven2 build system. And let me talk that i’m do it at last by a manual downloading in the linux shell on our web server because i don’t find a runing version.

Okay, after done this, the result is a little Captcha Controller who creates the Captcha which we can call in a static way. In the forgottenPassword Controller we use this Captcha and get the image from it which we assign to a zk image.

pieces of the zul-template

    .  .  .
								<!-- Captcha / Captcha -->
								<row>
									<space width="0" />
									<hbox>

										<image id="img_Captcha" />

										<toolbarbutton id="btnReCaptcha"
											image="/images/icons/sync_16x16.gif"
											tooltiptext="${c:l('common.ReCaptcha')}" />
									</hbox>
								</row>
   . . .


The complete dialog should looks like in this picture:

ForgottenPasswordController
ForgottenPasswordController

the FDCaptchaUtils.java


/**
 * EN: Utility class for creating a CAPTCHA.<br>
 * Captcha can be direct loaded into a org.zkoss.zul.Image<br>
 * DE: Hilfsklasse zur Erzeugung eines CAPTCHA.<br>
 * Captcha kann direkt in ein org.zkoss.zul.Image eingelesen werden.
 *
 * <pre>
 * Image img = new org.zkoss.zul.Image();
 * img.setContent(CaptchaUtils.getCaptcha().getImage());
 *
 * String verifyStr = captcha.getAnswer();
 * </pre>
 *
 * @author Stephan Gerth
 */
public class FDCaptchaUtils {

	public FDCaptchaUtils() {
	}

	/**
	 * Create a 5 digits captcha.
	 *
	 * @return
	 */
	public static Captcha getCaptcha() {

		Captcha captcha = new Captcha.Builder(170, 50).addText(new ColoredEdgesWordRenderer()).addNoise().addBackground(new GradiatedBackgroundProducer()).addBorder().build();

		return captcha;
	}

}


In the forgotten password controller we create the Captcha and insert it in the zk Image and handles the verify logic.

The needed methods in the controller code looks like this:

pieces of the ForgottenPassword controller

   . . .
   private Captcha captcha; // + getter/setter
   . . .

/**
 * Do a re-Captcha.<br>
 *
 * @param event
 */
private void doReCaptcha(Event event) {
	// init: disable the send password button
	btnReset.setDisabled(true);

	setCaptcha(FDCaptchaUtils.getCaptcha());
	img_Captcha.setContent(getCaptcha().getImage());
}

/**
 * 1. Checks if the email address is entered.<br>
 * 2. Verify the created captcha digits against the users input from a textbox.<br>
 * 3. Enable/disable the 'reset password' button.<br>
 *
 * @param event
 */
private void doVerifyCaptcha(Event event) {

     // init: disable the reset password button
     btnReset.setDisabled(true);

     // check if the tenant ID is entered
     if (StringUtils.isEmpty(longb_TenantID.getValue().toString().trim())) {
       	 throw new WrongValueException(longb_TenantID, Labels.getLabel("message.Error.CannotBeEmpty"));
     }

     // check if the email address is entered
	if (StringUtils.isEmpty(txtb_EmailAddress.getValue())) {
	    throw new WrongValueException(txtb_EmailAddress, Labels.getLabel("message.Error.CannotBeEmpty"));
	}

	// check if the captcha is verified correctly
	if (StringUtils.equals(txtb_VerifyCaptcha.getValue(), getCaptcha().getAnswer())) {
            btnReset.setDisabled(false);
	}
     }


Have fun with it.

Stephan Gerth

Dipl.rer.pol.


PS: Help to prevent the global warming by writing cool software

openTruuls™ will become Business Process Management from jBoss

The opening of the sources of openTruuls™  ( . powered ) will delayed a little bit because we will integrate jBPM5 (Business Process Management) Drools (Business Rules) and the Guvnor repository from jBoss.

In fact, we will prevent that there comes many needed code modifications/adaptions in future for special industries so we do early our best and take therefore the big step by integrating a professional BPM system where the developer can modify most of such things separate in a workflow. jBPM5 works BPMN 2.0 standard compliant.

In this case i will speak a welcome to Anton from Hannover(Germany) who joins the core developer team.

Interested people/partners write us under zk(at)forsthaus(dot)de

best

Stephan Gerth

Only a few weeks until we open the sources for openTruuls™

At time we work hard on the codes for our new child called openTruuls™. It’s a business solution in the big field of the erp/crm software market. The multi-tenancy web-application is easy to extend for third party developers. It’s build to run in a clustered environment. For higher scaling the tenant/user/security database are separated from the tenants work data.  So our goal is to offer this solution for smaller and middle sized firms as SaaS (Software as a Service) in a hosted environment. For using this system by in house servers in the customers firm we can offer the install, modify or extending of the solution and support them. openTruuls™ openTruuls™ is an open source business application. It comes as a community edition or an enterprise edition with support.  The application self is build on the MVC (model-view-controller) pattern on a stable stack of open source JAVA frameworks. For the frontend that runs in all common used browsers we select the great java AJAX web framework from Potix corp. the zk framework  .. Spring, hibernate, hibernate-generic-dao are working in the middle layer. Out of the box the app will run against a PostgreSQL database. Running against mySQL,  DB2, Informix, Sybase, SQL Server, Oracle or other Hibernate supported databases are doing by modifying the mapping files. For the reporting we use at time JasperReports with DynamicJasper. openTruuls have a full customizable rights management build on top of the spring security framework. Customers can define own access levels for their users and third party developers can easy extend their new written or modified modules with additional rights. In the case of financial accounting we have at first adopt a DATEV compatible accounting module for the german market with pre-defined charts of accounts for the SKR 03 and SKR 04.

Dashboard

Dashboard

System Manager

System Manager

openTruuls™ openTruuls™ SaaS Manager

Interested people/partners write us under sge(at)oxitec(dot)de

be part of it
best

Stephan Gerth
Dipl.rer.pol.


PS: Help to prevent the global warming by writing cool software