Hi Javi
I am thinking of creating Credit Card stereotype and a validation class for Open Xava.
Please let me know if this is a good idea since my project has no use of this currently.
Thanking You
Janesh
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> ... Credit Card stereotype and a validation ...
> ... is a good idea ...
Of course, it's a good idea
> since my project has no use of this currently
Many features I developed for OpenXava have been developed "on demand",
that is, a customer demands a feature to a developer of my company,
then the developer demands the feature to me.
In this way, our customers finances OpenXava growing.
In the other hand, I also add some features to OpenXava that I think
interesting; as JPA support, Java 5 annotations, AspectJ, etc.
You can choose you way. All useful and interesting things you develop
for OpenXava will be included.
Cheers
Javi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Javi
I am thinking of creating Credit Card stereotype and a validation class for Open Xava.
Please let me know if this is a good idea since my project has no use of this currently.
Thanking You
Janesh
Hi Janesh,
> ... Credit Card stereotype and a validation ...
> ... is a good idea ...
Of course, it's a good idea
> since my project has no use of this currently
Many features I developed for OpenXava have been developed "on demand",
that is, a customer demands a feature to a developer of my company,
then the developer demands the feature to me.
In this way, our customers finances OpenXava growing.
In the other hand, I also add some features to OpenXava that I think
interesting; as JPA support, Java 5 annotations, AspectJ, etc.
You can choose you way. All useful and interesting things you develop
for OpenXava will be included.
Cheers
Javi
Hi Javi
Please find the details for the stereotype below.
Following was done
1) Added to default-size.xml
<for-stereotype name="CREDITCARD" size="19"/>
2) Added to editors.xml
<editor url="textEditor.jsp">
<for-stereotype stereotype="CREDITCARD"/>
</editor>
3) Added to Stereotype-type-default.xml
<for stereotype="CREDITCARD" type="String"/>
4) Added to messages_en.properties file
creditcard_validation_error={0} must be a valid Credit card number
5) Validation class
package org.openxava.validators;
import org.openxava.validators.IPropertyValidator;
import org.openxava.util.Messages;
import org.apache.commons.validator.GenericValidator;
/**
* @author Janesh Kodikara
*/
public class CreditCardValidator implements IPropertyValidator {
public void validate(Messages errors, Object value, String propertyName, String modelName) throws Exception {
if (value == null || value.toString().length() == 0) return;
if (! GenericValidator.isCreditCard(value.toString())) {
errors.add("creditcard_validation_error", propertyName);
}
}
}
Appreciate your comments to improve this.
Thanking You
Janesh
Hi Janesh,
it's good.
I'll add it to OX2.2.4.
Also I will add your ISBN and IP stereotypes.
Cheers
Javi
Hi Janesh,
the code for IP stereotype is already in CVS,
therefore it will be available in OX2.2.4 and OX3.0beta5.
I ignored the part of editor.xml, because if you declare
String as type for you stereotype it will use textEditor by default.
Also I rename the stereotype to CREDIT_CARD (instead of CREDITCARD) because of
coherence with the rest of stereotypes.
Cheers
Javi
Hi Javi
Thank a lot. I was busy with family last week.
New baby girl was added to our family :-)
Thanking You
Janesh
>Thank a lot. I was busy with family last week.
>New baby girl was added to our family :-)
Congratulations, Janesh!!!
Wish you all the best to your new family member and all your family.
Welcome to Father's club!
I have baby girl 4 month old.
Kind regards,
Trifon
Hi Janesh,
> New baby girl was added to our family :-)
Congratulations!
Enjoy your baby!
Cheers
Javi