]> git.mxchange.org Git - jfinancials-lib.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Fri, 9 Oct 2015 18:59:20 +0000 (20:59 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 9 Oct 2015 18:59:20 +0000 (20:59 +0200)
- added jcoree.jar (for ...)
- added validator for validating address book names
- added dist.sh as this lib needs to be copied to the domain's lib folder

dist.sh [new file with mode: 0755]
lib/jcoreee.jar [new file with mode: 0644]
nbproject/project.properties
src/org/mxchange/addressbook/validator/names/AddressbookNameValidator.java [new file with mode: 0644]

diff --git a/dist.sh b/dist.sh
new file mode 100755 (executable)
index 0000000..f48251e
--- /dev/null
+++ b/dist.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+NAME="${PWD##*/}"
+DIST="dist/${NAME}.jar"
+LIST=`find ../*/lib/${NAME}.jar`
+LIST="${LIST} `find ../*/*-ejb/lib/${NAME}.jar`"
+LIST="${LIST} ${HOME}/gf_domains/domain1/lib/"
+
+for target in ${LIST};
+do
+       if [ ! -f "${DIST}" ]
+       then
+               echo "$0: '${DIST}' not found."
+       elif [ -d "${target}" ]
+       then
+               cp -v "${DIST}" "${target}"
+       elif [ -f "${target}" ]
+       then
+               cp -v "${DIST}" "${target}"
+       else
+               echo "$0: Target '${target}' not found."
+       fi
+done
diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar
new file mode 100644 (file)
index 0000000..e680266
Binary files /dev/null and b/lib/jcoreee.jar differ
index 1d739ec627a047b5623b9f355a81c42aaf15e9a1..82646a8972d87f2f862d9a014ea889252dbba552 100644 (file)
@@ -35,6 +35,7 @@ file.reference.jcontacts-core.jar=lib/jcontacts-core.jar
 file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar
 file.reference.jcore-swing.jar=lib/jcore-swing.jar
 file.reference.jcore.jar=lib/jcore.jar
+file.reference.jcoreee.jar=lib/jcoreee.jar
 file.reference.juser-core.jar=lib\\juser-core.jar
 includes=**
 jar.archive.disabled=${jnlp.enabled}
@@ -42,6 +43,7 @@ jar.compress=false
 jar.index=${jnlp.enabled}
 javac.classpath=\
     ${file.reference.jcore.jar}:\
+    ${file.reference.jcoreee.jar}:\
     ${file.reference.jcore-swing.jar}:\
     ${file.reference.jcore-logger-lib.jar}:\
     ${file.reference.jcontacts-core.jar}:\
@@ -102,6 +104,7 @@ source.reference.jcontacts-core.jar=../jcontacts-core/src/
 source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/
 source.reference.jcore-swing.jar=../jcore-swing/src
 source.reference.jcore.jar=../jcore/src
+source.reference.jcoreee.jar=../jcoreee/src/
 source.reference.juser-core.jar=../juser-core/src/
 src.dir=src
 test.src.dir=test
diff --git a/src/org/mxchange/addressbook/validator/names/AddressbookNameValidator.java b/src/org/mxchange/addressbook/validator/names/AddressbookNameValidator.java
new file mode 100644 (file)
index 0000000..15ef2bc
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.addressbook.validator.names;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import org.mxchange.jcoreee.validator.string.BaseStringValidator;
+
+/**
+ * A validation class for addressbook names, such as first name or family name.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public class AddressbookNameValidator extends BaseStringValidator implements Validator {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 27_587_896_710_689_451L;
+
+       @Override
+       public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
+               // Trace message
+               //this.getLogger().logTrace(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N
+
+               // All accepted, required fields
+               String[] requiredFileds = {"addressbookName"}; //NOI18N
+
+               // Pre-validation (e.g. not null, not a string, empty string ...)
+               super.preValidate(context, component, value, requiredFileds);
+
+               // Trace message
+               //this.getLogger().logTrace("validate: EXIT!"); //NOI18N
+       }
+}