First commit waiting for Budget Alert

This commit is contained in:
2025-09-04 13:37:35 +01:00
commit 2d681f27f5
4563 changed files with 1061534 additions and 0 deletions

View File

@ -0,0 +1,21 @@
apply plugin: "com.axelor.app-module"
apply from: "../version.gradle"
apply {
version = openSuiteVersion
}
axelor {
title "Axelor Tool"
description "Axelor Tool Module"
}
dependencies {
compile "commons-net:commons-net:2.0"
compile "org.apache.commons:commons-io:1.3.2"
compile "org.apache.commons:commons-lang3:3.1"
compile "com.sun.xml.bind:jaxb-impl:2.2.2"
compile "org.apache.pdfbox:pdfbox:2.0.9"
compile project(":modules:axelor-exception")
}

View File

@ -0,0 +1 @@
<h1>About Me</h1><hr /><p><strong>First Name:</strong> {{contact.firstName}}</p><p><strong>Last Name:</strong> {{contact.lastName}}</p><p>&nbsp;</p><p><em>Contact me:</em>&nbsp;<a href='mailto:{{contact.email | e}}' target='_blank'>{{contact.fullName}}</a></p><hr /><ul><li>Java</li><li>JavaScript</li><li>Groovy</li><li>HTML5</li></ul><pre>public class Hello {<br /><br />private String testKey1 = {{testKey1}}<br />private String testKey2 = {{testKey2}}<br />private String testKey3 = {{testKey3}}<br />}</pre>

View File

@ -0,0 +1,47 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
public final class ContextTool {
public static String SPAN_CLASS_WARNING = "label-warning";
public static String SPAN_CLASS_IMPORTANT = "label-important";
/**
* Function that split a message that we want display in a label to avoid to exceed the panel and
* create a popup size issue
*
* @param message The message to format
* @param spanClass The span class (label-warning, label-important...)
* @param length The max length of the message
* @return
*/
public static String formatLabel(String message, String spanClass, int length) {
if (message.length() > 80) {
String formattedMessage =
String.format(
"<span class='label %s'>%s</span>", spanClass, message.substring(0, length));
formattedMessage +=
String.format(
"<br/><span class='label %s'>%s</span>", spanClass, message.substring(length));
return formattedMessage;
} else {
return String.format("<span class='label %s'>%s</span>", spanClass, message);
}
}
}

View File

@ -0,0 +1,114 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import com.axelor.apps.tool.date.DateTool;
import java.lang.invoke.MethodHandles;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** Outils simplifiant l'utilisation des nombres. */
public final class DecimalTool {
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
/**
* Proratiser une valeur en fonction de date.
*
* @param fromDate Date de début de la période de conso.
* @param toDate Date de fin de la période de conso.
* @param date Date de proratisation.
* @param value Valeur initiale.
* @return La quantité proratisée.
*/
public static BigDecimal prorata(
LocalDate fromDate, LocalDate toDate, LocalDate date, BigDecimal value, int scale) {
BigDecimal prorataValue = BigDecimal.ZERO;
if (fromDate == null || toDate == null || date == null) {
return prorataValue;
}
BigDecimal totalDays = new BigDecimal(DateTool.daysBetween(fromDate, toDate, false));
BigDecimal days = new BigDecimal(DateTool.daysBetween(date, toDate, false));
prorataValue = prorata(totalDays, days, value, scale);
LOG.debug(
"Proratisation ({} pour {} à {}) à la date du {} : {}",
new Object[] {value, fromDate, toDate, date, prorataValue});
return prorataValue;
}
/**
* Proratiser une valeur en fonction du nombre de jours. (Règle de 3)
*
* @param totalDays Le nombre total de jour.
* @param days Le nombre de jour.
* @param value La valeur à proratiser.
* @return La valeur proratisée.
*/
public static BigDecimal prorata(
BigDecimal totalDays, BigDecimal days, BigDecimal value, int scale) {
BigDecimal prorataValue = BigDecimal.ZERO;
if (totalDays.compareTo(prorataValue) == 0) {
return prorataValue;
} else {
prorataValue =
(days.multiply(value).divide(totalDays, scale, BigDecimal.ROUND_HALF_EVEN))
.setScale(scale, RoundingMode.HALF_EVEN);
}
LOG.debug(
"Proratisation d'une valeur sur un total de jour {} pour {} jours et une valeur de {} : {}",
new Object[] {totalDays, days, value, prorataValue});
return prorataValue;
}
public static BigDecimal prorata(
LocalDate fromDate, LocalDate toDate, LocalDate date, BigDecimal value) {
return prorata(fromDate, toDate, date, value, 2);
}
public static BigDecimal prorata(BigDecimal totalDays, BigDecimal days, BigDecimal value) {
return prorata(totalDays, days, value, 2);
}
/**
* Fonction permettant d'obtenir le pourcentage d'une valeur.
*
* @param value Valeur initiale.
* @param percent Pourcentage (format : 10%).
* @param scale Précision.
* @return Le pourcentage de la valeur initiale.
*/
public static BigDecimal percent(BigDecimal value, BigDecimal percent, int scale) {
return value.multiply(percent).divide(new BigDecimal("100"), scale, RoundingMode.HALF_EVEN);
}
}

View File

@ -0,0 +1,29 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import java.util.regex.Pattern;
public class EmailTool {
public static boolean isValidEmailAddress(String email) {
final String EMAIL_PATTERN =
"[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})";
Pattern pattern = Pattern.compile(EMAIL_PATTERN);
return pattern.matcher(email).matches();
}
}

View File

@ -0,0 +1,50 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import com.axelor.meta.db.MetaAction;
import com.axelor.meta.loader.XMLViews;
import com.axelor.meta.schema.actions.Action;
public class MetaActionTool {
/**
* Creates a new {@code MetaAction} from the given action.<br>
* This can be used for example to create a new menu entry with an {@code ActionView} generated
* with user input.
*
* @param action The {@code Action} to be converted
* @param name The {@code String} representing the name of the resulting {@code MetaAction}
* @param type The {@code String} representing the type of the resulting {@code MetaAction}
* @param module The {@code String} representing the name of the module that the resulting {@code
* MetaAction} should be attached to.
* @return The {@code MetaAction} created from the given action
*/
public static MetaAction actionToMetaAction(
Action action, String name, String type, String module) {
MetaAction metaAction = new MetaAction();
metaAction.setModel(action.getModel());
metaAction.setModule(module);
metaAction.setName(name);
metaAction.setType(type);
metaAction.setXml(XMLViews.toXml(action, true));
return metaAction;
}
}

View File

@ -0,0 +1,192 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import com.axelor.apps.tool.exception.IExceptionMessage;
import com.axelor.db.EntityHelper;
import com.axelor.db.JPA;
import com.axelor.db.JpaRepository;
import com.axelor.db.Model;
import com.axelor.db.mapper.Mapper;
import com.axelor.exception.AxelorException;
import com.axelor.exception.db.repo.TraceBackRepository;
import com.axelor.exception.service.TraceBackService;
import com.axelor.i18n.I18n;
import com.google.common.base.Preconditions;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.persistence.Column;
public final class ModelTool {
private ModelTool() {}
/**
* Apply consumer to each record found from collection of IDs.
*
* @param ids collection of IDs.
* @param consumer to apply on each record.
* @return the number of errors that occurred.
*/
public static <T extends Model> int apply(
Class<? extends Model> modelClass,
Collection<? extends Number> ids,
ThrowConsumer<T> consumer) {
Preconditions.checkNotNull(ids, I18n.get("The collection of IDs cannot be null."));
Preconditions.checkNotNull(consumer, I18n.get("The consumer cannot be null."));
int errorCount = 0;
for (Number id : ids) {
try {
if (id != null) {
Model model = JPA.find(modelClass, id.longValue());
if (model != null) {
consumer.accept((T) model);
continue;
}
}
throw new AxelorException(
modelClass,
TraceBackRepository.CATEGORY_NO_VALUE,
I18n.get("Cannot find record #%s"),
String.valueOf(id));
} catch (Exception e) {
++errorCount;
TraceBackService.trace(e);
} finally {
JPA.clear();
}
}
return errorCount;
}
/**
* Get unique constraint errors.
*
* @param model
* @param messages
* @return
*/
public static Map<String, String> getUniqueErrors(Model model, Map<String, String> messages) {
Map<String, String> errors = new HashMap<>();
Collection<Field> fields = ModelTool.checkUniqueFields(model);
for (Field field : fields) {
String message =
messages.getOrDefault(field.getName(), IExceptionMessage.RECORD_UNIQUE_FIELD);
errors.put(field.getName(), message);
}
return errors;
}
/**
* Get unique constraint errors.
*
* @param model
* @return
*/
public static Map<String, String> getUniqueErrors(Model model) {
return getUniqueErrors(model, Collections.emptyMap());
}
/**
* Get set of fields affected by unique constraint error.
*
* @param model
* @return
*/
private static Set<Field> checkUniqueFields(Model model) {
Set<Field> errors = new HashSet<>();
Class<? extends Model> modelClass = EntityHelper.getEntityClass(model);
for (Field field : modelClass.getDeclaredFields()) {
Column column = field.getAnnotation(Column.class);
if (column == null || !column.unique()) {
continue;
}
String filter = String.format("self.%s = :value", field.getName());
String getterName = fieldNameToGetter(field.getName());
try {
Method getter = modelClass.getMethod(getterName);
Object value = getter.invoke(model);
Model existing = JPA.all(modelClass).filter(filter).bind("value", value).fetchOne();
if (existing != null && !existing.getId().equals(model.getId())) {
errors.add(field);
}
} catch (NoSuchMethodException
| SecurityException
| IllegalAccessException
| IllegalArgumentException
| InvocationTargetException e) {
TraceBackService.trace(e);
}
}
return errors;
}
private static String fieldNameToGetter(String name) {
return "get" + capitalize(name);
}
private static String capitalize(String string) {
return string.substring(0, 1).toUpperCase() + string.substring(1);
}
@SuppressWarnings("unchecked")
public static <T> T toBean(Class<T> klass, Object mapObject) {
Map<String, Object> map = (Map<String, Object>) mapObject;
return Mapper.toBean(klass, map);
}
/**
* Copy the content of a list with repository copy method.
*
* @param repo Repository to use for copy model.
* @param src The source list to copy.
* @param deep Copy all deep reference.
* @param <T> The list model.
* @return A new list with the content of src list.
*/
public static <T extends Model> List<T> copy(JpaRepository<T> repo, List<T> src, boolean deep) {
List<T> dest = new ArrayList<>();
for (T obj : src) {
T cpy = repo.copy(obj, deep);
dest.add(cpy);
}
return dest;
}
}

View File

@ -0,0 +1,532 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Set;
public final class NamingTool {
private NamingTool() {}
/** Check whether the given name is Java reserved keyword. */
public static boolean isReserved(String name) {
return RESERVED_JAVA.contains(name);
}
/** Check whether the given name is SQL reserved keyword. */
public static boolean isKeyword(String name) {
return RESERVED_POSTGRESQL.contains(name)
|| RESERVED_MYSQL.contains(name)
|| RESERVED_ORACLE.contains(name);
}
/** Quote the given column name. */
public static String quoteColumn(String name) {
return "`" + name + "`";
}
// Java Keywords
private static final Set<String> RESERVED_JAVA =
new LinkedHashSet<>(
Arrays.asList(
"abstract",
"assert",
"boolean",
"break",
"byte",
"case",
"catch",
"char",
"class",
"const",
"continue",
"default",
"do",
"double",
"else",
"enum",
"extends",
"false",
"final",
"finally",
"float",
"for",
"goto",
"if",
"implements",
"import",
"instanceof",
"int",
"interface",
"long",
"native",
"new",
"null",
"package",
"private",
"protected",
"public",
"return",
"short",
"static",
"strictfp",
"super",
"switch",
"synchronized",
"this",
"throw",
"throws",
"transient",
"true",
"try",
"void",
"volatile",
"while"));
// PostgreSQL 9.x
private static final Set<String> RESERVED_POSTGRESQL =
new LinkedHashSet<>(
Arrays.asList(
"all",
"analyse",
"analyze",
"and",
"any",
"array",
"as",
"asc",
"asymmetric",
"both",
"case",
"cast",
"check",
"collate",
"column",
"constraint",
"create",
"current_catalog",
"current_date",
"current_role",
"current_time",
"current_timestamp",
"current_user",
"default",
"deferrable",
"desc",
"distinct",
"do",
"else",
"end",
"except",
"false",
"fetch",
"for",
"foreign",
"from",
"grant",
"group",
"having",
"in",
"initially",
"intersect",
"into",
"lateral",
"leading",
"limit",
"localtime",
"localtimestamp",
"not",
"null",
"offset",
"on",
"only",
"or",
"order",
"placing",
"primary",
"references",
"returning",
"select",
"session_user",
"some",
"symmetric",
"table",
"then",
"to",
"trailing",
"true",
"union",
"unique",
"user",
"using",
"variadic",
"when",
"where",
"window",
"with"));
// MariaDB 10.x & MySQL 5.5
private static final Set<String> RESERVED_MYSQL =
new LinkedHashSet<>(
Arrays.asList(
"accessible",
"add",
"all",
"alter",
"analyze",
"and",
"as",
"asc",
"asensitive",
"before",
"between",
"bigint",
"binary",
"blob",
"both",
"by",
"call",
"cascade",
"case",
"change",
"char",
"character",
"check",
"collate",
"column",
"condition",
"constraint",
"continue",
"convert",
"create",
"cross",
"current_date",
"current_time",
"current_timestamp",
"current_user",
"cursor",
"database",
"databases",
"day_hour",
"day_microsecond",
"day_minute",
"day_second",
"dec",
"decimal",
"declare",
"default",
"delayed",
"delete",
"desc",
"describe",
"deterministic",
"distinct",
"distinctrow",
"div",
"double",
"drop",
"dual",
"each",
"else",
"elseif",
"enclosed",
"escaped",
"exists",
"exit",
"explain",
"false",
"fetch",
"float",
"float4",
"float8",
"for",
"force",
"foreign",
"from",
"fulltext",
"grant",
"group",
"having",
"high_priority",
"hour_microsecond",
"hour_minute",
"hour_second",
"if",
"ignore",
"in",
"index",
"infile",
"inner",
"inout",
"insensitive",
"insert",
"int",
"int1",
"int2",
"int3",
"int4",
"int8",
"integer",
"interval",
"into",
"is",
"iterate",
"join",
"key",
"keys",
"kill",
"leading",
"leave",
"left",
"like",
"limit",
"linear",
"lines",
"load",
"localtime",
"localtimestamp",
"lock",
"long",
"longblob",
"longtext",
"loop",
"low_priority",
"master_ssl_verify_server_cert",
"match",
"maxvalue",
"mediumblob",
"mediumint",
"mediumtext",
"middleint",
"minute_microsecond",
"minute_second",
"mod",
"modifies",
"natural",
"not",
"no_write_to_binlog",
"null",
"numeric",
"on",
"optimize",
"option",
"optionally",
"or",
"order",
"out",
"outer",
"outfile",
"precision",
"primary",
"procedure",
"purge",
"range",
"read",
"reads",
"read_write",
"real",
"references",
"regexp",
"release",
"rename",
"repeat",
"replace",
"require",
"resignal",
"restrict",
"return",
"revoke",
"right",
"rlike",
"schema",
"schemas",
"second_microsecond",
"select",
"sensitive",
"separator",
"set",
"show",
"signal",
"smallint",
"spatial",
"specific",
"sql",
"sql_big_result",
"sql_calc_found_rows",
"sqlexception",
"sql_small_result",
"sqlstate",
"sqlwarning",
"ssl",
"starting",
"straight_join",
"table",
"terminated",
"then",
"tinyblob",
"tinyint",
"tinytext",
"to",
"trailing",
"trigger",
"true",
"undo",
"union",
"unique",
"unlock",
"unsigned",
"update",
"usage",
"use",
"using",
"utc_date",
"utc_time",
"utc_timestamp",
"values",
"varbinary",
"varchar",
"varcharacter",
"varying",
"when",
"where",
"while",
"with",
"write",
"xor",
"year_month",
"zerofill"));
// Oracle
private static final Set<String> RESERVED_ORACLE =
new LinkedHashSet<>(
Arrays.asList(
"access",
"add",
"all",
"alter",
"and",
"any",
"arraylen",
"as",
"asc",
"audit",
"between",
"by",
"char",
"check",
"cluster",
"column",
"comment",
"compress",
"connect",
"create",
"current",
"date",
"decimal",
"default",
"delete",
"desc",
"distinct",
"drop",
"else",
"exclusive",
"exists",
"file",
"float",
"for",
"from",
"grant",
"group",
"having",
"identified",
"immediate",
"in",
"increment",
"index",
"initial",
"insert",
"integer",
"intersect",
"into",
"is",
"level",
"like",
"lock",
"long",
"maxextents",
"minus",
"mode",
"modify",
"noaudit",
"nocompress",
"not",
"notfound",
"nowait",
"null",
"number",
"of",
"offline",
"on",
"online",
"option",
"or",
"order",
"pctfree",
"prior",
"privileges",
"public",
"raw",
"rename",
"resource",
"revoke",
"row",
"rowid",
"rowlabel",
"rownum",
"rows",
"select",
"session",
"set",
"share",
"size",
"smallint",
"sqlbuf",
"start",
"successful",
"synonym",
"sysdate",
"table",
"then",
"to",
"trigger",
"uid",
"union",
"unique",
"update",
"user",
"validate",
"values",
"varchar",
"varchar2",
"view",
"whenever",
"where",
"with"));
}

View File

@ -0,0 +1,87 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import com.axelor.exception.service.TraceBackService;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class ObjectTool {
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
/**
* Méthode permettant de récupéré un champ d'une classe depuis son nom
*
* @param fieldName Le nom d'un champ
* @param classGotten La classe portant le champ
* @return
*/
public static Field getField(String fieldName, @SuppressWarnings("rawtypes") Class classGotten) {
Field field = null;
try {
LOG.debug("Classe traitée - {}", classGotten);
field = classGotten.getDeclaredField(fieldName);
} catch (SecurityException e) {
TraceBackService.trace(e);
} catch (NoSuchFieldException e) {
TraceBackService.trace(e);
}
LOG.debug("Champ récupéré : {}", field);
return field;
}
/**
* Methode permettant de récupéré un object enfant (d'après le nom d'un champ) depuis un object
* parent
*
* @param obj Un objet parent
* @param linked Un nom de champ
* @return
*/
public static Object getObject(Object obj, String fieldName) {
Method m = null;
try {
@SuppressWarnings("rawtypes")
Class[] paramTypes = null;
m = obj.getClass().getMethod("get" + StringTool.capitalizeFirstLetter(fieldName), paramTypes);
} catch (SecurityException e) {
return null;
} catch (NoSuchMethodException e) {
return null;
}
LOG.debug("Méthode récupéré : {}", m);
try {
Object[] args = null;
obj = m.invoke(obj, args);
} catch (IllegalArgumentException e) {
return null;
} catch (IllegalAccessException e) {
return null;
} catch (InvocationTargetException e) {
return null;
}
LOG.debug("Objet récupéré", obj);
return obj;
}
}

View File

@ -0,0 +1,96 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import com.axelor.db.Model;
import com.axelor.db.Query;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
public class QueryBuilder<T extends Model> {
private final List<String> filterList;
private final Map<String, Object> bindingMap;
private final Class<T> modelClass;
private QueryBuilder(Class<T> modelClass) {
filterList = new ArrayList<>();
bindingMap = new HashMap<>();
this.modelClass = modelClass;
}
/**
* Get a query builder.
*
* @param modelClass
* @return
*/
public static <T extends Model> QueryBuilder<T> of(Class<T> modelClass) {
return new QueryBuilder<>(modelClass);
}
/**
* Add filter.
*
* @param filter
* @return
*/
public QueryBuilder<T> add(String filter) {
filterList.add(filter);
return this;
}
/**
* Add binding.
*
* @param name
* @param value
* @return
*/
public QueryBuilder<T> bind(String name, Object value) {
bindingMap.put(name, value);
return this;
}
/**
* Build the query.
*
* @return
*/
public Query<T> build() {
String filter =
Joiner.on(" AND ").join(Lists.transform(filterList, input -> String.format("(%s)", input)));
Query<T> query = Query.of(modelClass).filter(filter);
for (Entry<String, Object> entry : bindingMap.entrySet()) {
query.bind(entry.getKey(), entry.getValue());
}
return query;
}
/** @deprecated (use build() instead) */
@Deprecated
public Query<T> create() {
return build();
}
}

View File

@ -0,0 +1,303 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import com.axelor.db.Model;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
public final class StringTool {
private static final String[] FILENAME_SEARCH_LIST =
new String[] {"*", "\"", "/", "\\", "?", "%", ":", "|", "<", ">"};
private static final String[] FILENAME_REPLACEMENT_LIST =
new String[] {"#", "'", "_", "_", "_", "_", "_", "_", "_", "_"};
private StringTool() {}
/**
* First character lower
*
* @param string
* @return
*/
public static String toFirstLower(String string) {
return string.replaceFirst("\\w", Character.toString(string.toLowerCase().charAt(0)));
}
/**
* First character upper.
*
* @param string
* @return
*/
public static String toFirstUpper(String string) {
return string.replaceFirst("\\w", Character.toString(string.toUpperCase().charAt(0)));
}
/**
* Complete string with fixed length.
*
* @param s
* @param fillChar
* @param size
* @return
*/
public static String fillStringRight(String s, char fillChar, int size) {
String string = s;
if (string.length() < size) {
string += fillString(fillChar, size - string.length());
} else {
string = truncRight(string, size);
}
return string;
}
/**
* Complete string with fixed length.
*
* @param s
* @param fillChar
* @param size
* @return
*/
public static String fillStringLeft(String s, char fillChar, int size) {
String string = s;
if (string.length() < size) {
string = fillString(fillChar, size - string.length()) + string;
} else {
string = truncLeft(string, size);
}
return string;
}
/**
* Truncate string with the first chars at size.
*
* @param s
* @param size
* @return
*/
public static String truncRight(String s, int size) {
String string = s;
if (string.length() > size) {
string = string.substring(0, size);
}
return string;
}
/**
* Truncate string with the s length subtract size at s length.
*
* @param s
* @param size
* @return
*/
public static String truncLeft(String s, int size) {
String string = s;
if (string.length() > size) {
string = string.substring(string.length() - size, string.length());
}
return string;
}
/**
* Create string with one char * count.
*
* @param fillChar
* @param count
* @return
*/
public static String fillString(char fillChar, int count) {
// creates a string of 'x' repeating characters
char[] chars = new char[count];
java.util.Arrays.fill(chars, fillChar);
return new String(chars);
}
public static String deleteAccent(String s) {
String temp = Normalizer.normalize(s, Normalizer.Form.NFD);
return temp.replaceAll("[^\\p{ASCII}]", "");
}
public static boolean equalsIgnoreCaseAndAccents(String s1, String s2) {
return deleteAccent(s1).equalsIgnoreCase(deleteAccent(s2));
}
/**
* Check if string s contain only digital character
*
* @param s
* @return
*/
public static boolean isDigital(String s) {
for (Character c : s.toCharArray()) {
if (!Character.isDigit(c)) {
return false;
}
}
return true;
}
/**
* Extract a string from right
*
* @param string
* @param startIndex
* @param lenght
* @return
*/
public static String extractStringFromRight(String string, int startIndex, int lenght) {
String extractString = "";
try {
if (string != null
&& startIndex >= 0
&& lenght >= 0
&& string.length() - startIndex + lenght <= string.length()) {
extractString =
string.substring(string.length() - startIndex, string.length() - startIndex + lenght);
}
} catch (Exception ex) {
return "";
}
return extractString;
}
/**
* Fonction permettant de convertir un tableau de bytes en une chaine hexadécimale Convert to
* hexadecimal string from bytes table
*
* @param bytes
* @return
*/
public static String getHexString(byte[] bytes) {
StringBuilder sb = new StringBuilder(bytes.length * 2);
String s = "";
for (byte b : bytes) {
s = String.format("%x", b);
if (s.length() == 1) {
sb.append('0');
}
sb.append(s);
}
return sb.toString();
}
/**
* Fonction permettant de mettre la première lettre d'une chaine de caractère en majuscule
*
* @param s
* @return
*/
public static String capitalizeFirstLetter(String s) {
if (s == null) {
return null;
}
if (s.length() == 0) {
return s;
}
StringBuilder result = new StringBuilder(s);
result.replace(0, 1, result.substring(0, 1).toUpperCase());
return result.toString();
}
/**
* Get a list of integers from a string.
*
* @param string
* @return list of integers
*/
public static List<Integer> getIntegerList(String string) {
return string != null && !"".equals(string)
? Arrays.stream(string.split("\\D+")).map(Integer::valueOf).collect(Collectors.toList())
: new ArrayList<>();
}
/**
* Retrieve an ID list string from a collection of model objects. If the collection is empty, this
* method will return "0".
*
* @param collection
* @return
*/
public static String getIdListString(Collection<? extends Model> collection) {
List<Long> idList = new ArrayList<>();
String idString;
if (collection.isEmpty()) {
idString = "0";
} else {
for (Model item : collection) {
if (item != null) {
idList.add(item.getId());
}
}
idString = idList.stream().map(l -> l.toString()).collect(Collectors.joining(","));
}
return idString;
}
public static String getFilename(String name) {
return StringUtils.replaceEach(name, FILENAME_SEARCH_LIST, FILENAME_REPLACEMENT_LIST);
}
/**
* Some strings cannot be over 255 char because of database restriction. Cut it to 252 char then
* add "..." to indicate the string has been cut.
*
* @return the cut string
*/
public static String cutTooLongString(String str) {
int defaultDbStrLength = 255;
String fillString = "...";
if (str.length() > defaultDbStrLength) {
return str.substring(0, defaultDbStrLength - fillString.length()) + fillString;
} else {
return str;
}
}
}

View File

@ -0,0 +1,34 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
/**
* Represents an operation that accepts one argument, returns no result and can throws exception.
*
* @param <T>
*/
@FunctionalInterface
public interface ThrowConsumer<T> {
/**
* Performs this operation on the given argument.
*
* @param t the input argument.
* @throws Exception from operation.
*/
void accept(T t) throws Exception;
}

View File

@ -0,0 +1,154 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.address;
import com.axelor.exception.service.TraceBackService;
import com.qas.web_2005_02.Address;
import com.qas.web_2005_02.EngineEnumType;
import com.qas.web_2005_02.EngineType;
import com.qas.web_2005_02.PromptSetType;
import com.qas.web_2005_02.QACanSearch;
import com.qas.web_2005_02.QAData;
import com.qas.web_2005_02.QADataSet;
import com.qas.web_2005_02.QAGetAddress;
import com.qas.web_2005_02.QAPortType;
import com.qas.web_2005_02.QASearch;
import com.qas.web_2005_02.QASearchOk;
import com.qas.web_2005_02.QASearchResult;
import java.lang.invoke.MethodHandles;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AddressTool {
private static QName SERVICE_NAME = null;
private static QName PORT_NAME = null;
private static URL wsdlURL = null;
private static Service service = null;
private static QAPortType client = null;
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
public void setService(String wsdlUrl) throws MalformedURLException {
// TODO: inject this
if (client == null) {
SERVICE_NAME = new QName("http://www.qas.com/web-2005-02", "ProWeb");
PORT_NAME = new QName("http://www.qas.com/web-2005-02", "QAPortType");
// def wsdlURL = new URL("http://ip.axelor.com:2021/proweb.wsdl")
wsdlURL = new URL(wsdlUrl);
// println this.wsdlURL
service = Service.create(wsdlURL, SERVICE_NAME);
client = service.getPort(QAPortType.class);
// QAPortType client = service.getPort(PORT_NAME, QAPortType.class)
LOG.debug("setService this.client = {}", client);
}
}
public boolean doCanSearch(String wsdlUrl) {
try {
QName SERVICE_NAME = new QName("http://www.qas.com/web-2005-02", "ProWeb");
QName PORT_NAME = new QName("http://www.qas.com/web-2005-02", "QAPortType");
// def wsdlURL = new URL("http://ip.axelor.com:2021/proweb.wsdl")
URL wsdlURL = new URL(wsdlUrl);
Service service = Service.create(wsdlURL, SERVICE_NAME);
QAPortType client = service.getPort(QAPortType.class);
// QAPortType client = service.getPort(PORT_NAME, QAPortType.class)
LOG.debug("setService client = {}", client);
// 1. Pre-check.
QAData qadata = client.doGetData();
QADataSet ds = qadata.getDataSet().get(0);
QACanSearch canSearch = new QACanSearch();
canSearch.setCountry("FRX");
canSearch.setLayout("AFNOR INSEE");
EngineType engType = new EngineType();
engType.setFlatten(true);
engType.setValue(EngineEnumType.VERIFICATION);
canSearch.setEngine(engType);
QASearchOk resp = client.doCanSearch(canSearch);
return resp.isIsOk();
} catch (Exception e) {
TraceBackService.trace(e);
return false;
}
}
public Map<String, Object> doSearch(String wsdlUrl, String searchString) {
try {
this.setService(wsdlUrl);
// 2. Initial search.
QASearch search = new QASearch();
search.setCountry("FRX");
search.setLayout("AFNOR INSEE");
search.setSearch(searchString);
EngineType engTypeT = new EngineType();
engTypeT.setPromptSet(PromptSetType.ONE_LINE); // DEFAULT
engTypeT.setValue(EngineEnumType.VERIFICATION);
engTypeT.setFlatten(true);
search.setEngine(engTypeT);
QASearchResult respSearch = client.doSearch(search);
Map<String, Object> mapSearch = new HashMap<>();
mapSearch.put("verifyLevel", respSearch.getVerifyLevel());
mapSearch.put("qaPicklist", respSearch.getQAPicklist());
mapSearch.put("qaAddress", respSearch.getQAAddress());
return mapSearch;
} catch (Exception e) {
TraceBackService.trace(e);
return new HashMap<>();
}
}
public Address doGetAddress(String wsdlUrl, String moniker) {
try {
this.setService(wsdlUrl);
// 4. Format the final address.
QAGetAddress getAddress = new QAGetAddress();
getAddress.setMoniker(moniker);
getAddress.setLayout("AFNOR INSEE");
return client.doGetAddress(getAddress);
} catch (Exception e) {
TraceBackService.trace(e);
}
return null;
}
}

View File

@ -0,0 +1,309 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.date;
import static java.time.temporal.ChronoUnit.DAYS;
import java.lang.invoke.MethodHandles;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DateTool {
private DateTool() {
throw new IllegalStateException("Utility class");
}
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
public static long daysBetween(LocalDate date1, LocalDate date2, boolean days360) {
long days = 0;
if (days360) {
days = date1.isBefore(date2) ? days360Between(date1, date2) : -days360Between(date2, date1);
} else {
days = daysBetween(date1, date2);
}
LOG.debug(
"Number of days between {} - {} (month of 30 days ? {}) : {}", date1, date2, days360, days);
return days;
}
private static long daysBetween(LocalDate date1, LocalDate date2) {
if (date2.isBefore(date1)) {
return DAYS.between(date1, date2) - 1;
} else {
return DAYS.between(date1, date2) + 1;
}
}
private static int days360Between(LocalDate startDate, LocalDate endDate) {
int nbDayOfFirstMonth = 0;
int nbDayOfOthersMonths = 0;
int nbDayOfLastMonth = 0;
LocalDate start = startDate;
if (endDate.getMonthValue() != startDate.getMonthValue()
|| endDate.getYear() != startDate.getYear()) {
// First month :: if the startDate is not the last day of the month
if (!startDate.isEqual(startDate.withDayOfMonth(startDate.lengthOfMonth()))) {
nbDayOfFirstMonth = 30 - startDate.getDayOfMonth();
}
// The startDate is included
nbDayOfFirstMonth = nbDayOfFirstMonth + 1;
// Months between the first one and the last one
LocalDate date1 = startDate.plusMonths(1).withDayOfMonth(1);
while (endDate.getMonthValue() != date1.getMonthValue()
|| endDate.getYear() != date1.getYear()) {
nbDayOfOthersMonths = nbDayOfOthersMonths + 30;
date1 = date1.plusMonths(1);
}
// Last Month
start = endDate.withDayOfMonth(1);
}
if (endDate.isEqual(endDate.withDayOfMonth(endDate.lengthOfMonth()))) {
nbDayOfLastMonth = 30 - start.getDayOfMonth();
} else {
nbDayOfLastMonth = endDate.getDayOfMonth() - start.getDayOfMonth();
}
// The endDate is included
nbDayOfLastMonth = nbDayOfLastMonth + 1;
return nbDayOfFirstMonth + nbDayOfOthersMonths + nbDayOfLastMonth;
}
public static int days360MonthsBetween(LocalDate startDate, LocalDate endDate) {
if (startDate.isBefore(endDate)) {
return days360Between(startDate, endDate) / 30;
} else {
return -days360Between(endDate, startDate) / 30;
}
}
public static boolean isProrata(
LocalDate dateFrame1, LocalDate dateFrame2, LocalDate date1, LocalDate date2) {
if (date2 == null && (date1.isBefore(dateFrame2) || date1.isEqual(dateFrame2))) {
return true;
} else if (date2 == null) {
return false;
}
return ((date1.isAfter(dateFrame1) || date1.isEqual(dateFrame1))
&& (date1.isBefore(dateFrame2) || date1.isEqual(dateFrame2)))
|| ((date2.isAfter(dateFrame1) || date2.isEqual(dateFrame1))
&& (date2.isBefore(dateFrame2) || date2.isEqual(dateFrame2)))
|| (date1.isBefore(dateFrame1) && date2.isAfter(dateFrame2));
}
public static boolean isBetween(LocalDate dateFrame1, LocalDate dateFrame2, LocalDate date) {
return (dateFrame2 == null && (date.isAfter(dateFrame1) || date.isEqual(dateFrame1)))
|| (dateFrame2 != null
&& (date.isAfter(dateFrame1) || date.isEqual(dateFrame1))
&& (date.isBefore(dateFrame2) || date.isEqual(dateFrame2)));
}
/**
* Computes the date of the next occurrence of an event according to the following calculation:
* deletes as many times as possible the frequency in month to the targeted date while being
* greater than the start date.
*
* @param startDate The start date
* @param goalDate The targeted date
* @param frequencyInMonth Number of months depicting the frequency of the event
*/
public static LocalDate nextOccurency(
LocalDate startDate, LocalDate goalDate, int frequencyInMonth) {
if (!checkValidInputs(startDate, goalDate, frequencyInMonth)) {
return null;
} else if (startDate.isAfter(goalDate)) {
return goalDate;
}
return minusMonths(
goalDate,
days360MonthsBetween(startDate.plusDays(1), goalDate.minusDays(1))
/ frequencyInMonth
* frequencyInMonth);
}
/**
* Computes the date of the next occurrence of an event according to the following calculation:
* deletes as many times as possible the frequency in month to the targeted date while being
* greater than or equal to the start date.
*
* @param startDate The start date
* @param goalDate The targeted date
* @param frequencyInMonth Number of months depicting the frequency of the event
*/
public LocalDate nextOccurencyStartDateIncluded(
LocalDate startDate, LocalDate goalDate, int frequencyInMonth) {
if (!checkValidInputs(startDate, goalDate, frequencyInMonth)) {
return null;
} else if (startDate.isAfter(goalDate)) {
return goalDate;
}
return minusMonths(
goalDate,
days360MonthsBetween(startDate, goalDate.minusDays(1))
/ frequencyInMonth
* frequencyInMonth);
}
/**
* Computes the date of the last occurrence of an event according to the following calculation:
* adds as many times as possible the frequency in month to the start date while being less than
* or equal to the end date.
*
* @param startDate
* @param endDate
* @param frequencyInMonth Number of months depicting the frequency of the event
*/
public static LocalDate lastOccurency(
LocalDate startDate, LocalDate endDate, int frequencyInMonth) {
if (!checkValidInputs(startDate, endDate, frequencyInMonth)) {
return null;
} else if (startDate.isAfter(endDate)) {
return null;
} else {
return plusMonths(
startDate,
days360MonthsBetween(startDate, endDate) / frequencyInMonth * frequencyInMonth);
}
}
/**
* Checks that the frequency is not equal to zero and that the start and end dates are not null.
*
* @param startDate
* @param endDate
* @param frequencyInMonth
* @return
*/
private static boolean checkValidInputs(
LocalDate startDate, LocalDate endDate, int frequencyInMonth) {
if (frequencyInMonth == 0) {
LOG.debug("The frequency should not be zero.");
return false;
} else if (startDate == null) {
LOG.debug("The start date should not be null.");
return false;
} else if (endDate == null) {
LOG.debug("The end date should not be null.");
return false;
}
return true;
}
public static LocalDate minusMonths(LocalDate date, int nbMonths) {
return date.plusDays(1).minusMonths(nbMonths).minusDays(1);
}
public static LocalDate plusMonths(LocalDate date, int nbMonths) {
return date.plusDays(1).plusMonths(nbMonths).minusDays(1);
}
public static LocalDateTime plusSeconds(LocalDateTime datetime, long duration) {
return datetime.plusSeconds(duration);
}
public static LocalDateTime minusSeconds(LocalDateTime datetime, long duration) {
return datetime.minusSeconds(duration);
}
/**
* Checks if a date is in a specific period.
*
* @param date The date to check
* @param dayBegin The start day of the period
* @param monthBegin The start month of the period
* @param dayEnd The end day of the period
* @param monthEnd The start month of the period
* @return
*/
public static boolean dateInPeriod(
LocalDate date, int dayBegin, int monthBegin, int dayEnd, int monthEnd) {
if (monthBegin > monthEnd) {
return (date.getMonthValue() == monthBegin && date.getDayOfMonth() >= dayBegin)
|| (date.getMonthValue() > monthBegin)
|| (date.getMonthValue() < monthEnd)
|| (date.getMonthValue() == monthEnd && date.getDayOfMonth() <= dayEnd);
} else if (monthBegin == monthEnd) {
return (date.getMonthValue() == monthBegin
&& date.getDayOfMonth() >= dayBegin
&& date.getDayOfMonth() <= dayEnd);
} else {
return (date.getMonthValue() == monthBegin && date.getDayOfMonth() >= dayBegin)
|| (date.getMonthValue() > monthBegin && date.getMonthValue() < monthEnd)
|| (date.getMonthValue() == monthEnd && date.getDayOfMonth() <= dayEnd);
}
}
public static LocalDate toLocalDate(Date date) {
Instant instant = date.toInstant();
return instant.atZone(ZoneId.systemDefault()).toLocalDate();
}
public static LocalDateTime toLocalDateT(Date date) {
Instant instant = date.toInstant();
return instant.atZone(ZoneId.systemDefault()).toLocalDateTime();
}
public static Date toDate(LocalDate date) {
return Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant());
}
}

View File

@ -0,0 +1,49 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.date;
import java.time.Duration;
import java.time.LocalDateTime;
public class DurationTool {
private DurationTool() {
throw new IllegalStateException("Utility class");
}
public static Duration computeDuration(LocalDateTime startDateTime, LocalDateTime endDateTime) {
return Duration.between(startDateTime, endDateTime);
}
public static long getDaysDuration(Duration duration) {
return duration.toDays();
}
public static long getHoursDuration(Duration duration) {
return duration.toHours();
}
public static long getMinutesDuration(Duration duration) {
return duration.toMinutes();
}
public static long getSecondsDuration(Duration duration) {
return duration.getSeconds();
}
}

View File

@ -0,0 +1,188 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.date;
import com.axelor.apps.tool.exception.IExceptionMessage;
import com.axelor.i18n.I18n;
import com.google.inject.Inject;
import java.time.LocalDate;
/**
* A period is composed of a start date, an end date and a boolean attribute to determine if the
* year is fixed to 360 days.
*
* <p>Seems to be unused since there is another object Period in base module.
*/
@Deprecated
public class Period {
private LocalDate from;
private LocalDate to;
private boolean days360;
@Inject
public Period() {}
public LocalDate getFrom() {
return from;
}
public void setFrom(LocalDate from) {
this.from = from;
}
public LocalDate getTo() {
return to;
}
public void setTo(LocalDate to) {
this.to = to;
}
public boolean isDays360() {
return days360;
}
public void setDays360(boolean days360) {
this.days360 = days360;
}
public Period(boolean days360) {
this.days360 = days360;
}
public Period(LocalDate from, LocalDate to, boolean days360) {
this.from = from;
this.to = to;
this.days360 = days360;
}
public Period(LocalDate from, LocalDate to) {
this.from = from;
this.to = to;
this.days360 = false;
}
public Period(Period p) {
this.from = p.getFrom();
this.to = p.getTo();
this.days360 = p.isDays360();
}
public long getDays() {
return DateTool.daysBetween(this.from, this.to, this.days360);
}
public long getMonths() {
if (this.days360) {
return DateTool.days360MonthsBetween(this.from, this.to);
} else {
return java.time.Period.between(this.from, this.to).getMonths();
}
}
public Period prorata(Period period) {
return prorata(period.getFrom(), period.getTo());
}
public Period prorata(LocalDate date1, LocalDate date2) {
Period p = null;
if (DateTool.isProrata(this.from, this.to, date1, date2)) {
p = new Period(this);
if (date1.isAfter(this.from)) {
p.setFrom(date1);
}
if (date2 != null && date2.isBefore(this.to)) {
p.setTo(date2);
}
}
return p;
}
public boolean isProrata(Period period) {
return DateTool.isProrata(this.from, this.to, period.getFrom(), period.getTo());
}
public boolean fromBetween(LocalDate date1, LocalDate date2) {
return DateTool.isBetween(date1, date2, this.from);
}
public boolean toBetween(LocalDate date1, LocalDate date2) {
return DateTool.isBetween(date1, date2, this.to);
}
public boolean contains(LocalDate date) {
return DateTool.isBetween(this.from, this.to, date);
}
public boolean isNotNull() {
return this.getFrom() != null && this.getTo() != null;
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof Period) {
Period period = (Period) obj;
return this.from.equals(period.getFrom())
&& this.to.equals(period.getTo())
&& this.days360 == period.isDays360();
}
return false;
}
@Override
public int hashCode() {
if (days360) {
return from.hashCode() ^ to.hashCode();
} else {
return from.hashCode() ^ to.hashCode() * -1;
}
}
@Override
public String toString() {
return this.from
+ " - "
+ this.to
+ "("
+ I18n.get(IExceptionMessage.PERIOD_1)
+ " :"
+ this.days360
+ ")";
}
}

View File

@ -0,0 +1,44 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.exception;
/** @author axelor */
public interface IExceptionMessage {
/** Period service */
static final String PERIOD_1 = /*$$(*/ "Years in 360 days" /*)*/;
/** URL service */
static final String URL_SERVICE_1 = /*$$(*/
"Can not opening the connection to a empty URL." /*)*/;
static final String URL_SERVICE_2 = /*$$(*/ "Url %s is malformed." /*)*/;
static final String URL_SERVICE_3 = /*$$(*/
"An error occurs while opening the connection. Please verify the following URL : %s." /*)*/;
/** Template maker */
static final String TEMPLATE_MAKER_1 = /*$$(*/ "No such template" /*)*/;
static final String TEMPLATE_MAKER_2 = /*$$(*/ "Templating can not be empty" /*)*/;
static final String RECORD_UNIQUE_FIELD = /*$$(*/ "This field needs to be unique." /*)*/;
/** Pdf Tool */
static final String BAD_COPY_NUMBER_ARGUMENT = /*$$(*/
"The parameter copyNumber should be superior to 0." /*)*/;
}

View File

@ -0,0 +1,108 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.file;
import com.opencsv.CSVReader;
import com.opencsv.CSVWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;
public final class CsvTool {
private CsvTool() {}
/**
* Méthode permettant de lire le contenu d'un fichier
*
* @param fileName Le nom du fichier
* @return Une liste de tableau de valeur contenant l'ensemble des lignes
* @throws IOException
* @throws AxelorException
*/
public static List<String[]> cSVFileReader(String fileName, char separator) throws IOException {
CSVReader reader;
List<String[]> myEntries;
reader = new CSVReader(new FileReader(fileName), separator);
myEntries = reader.readAll();
reader.close();
return myEntries;
}
/*
* Format Windows, sans double quote et CR/LF à chaque fin de ligne
*/
public static CSVWriter setCsvFile(final String filePath, final String fileName, char separator)
throws IOException {
java.io.Writer w = new FileWriter(filePath + File.separator + fileName);
return new CSVWriter(w, separator, CSVWriter.NO_QUOTE_CHARACTER, "\r\n");
}
public static CSVWriter setCsvFile(
final String filePath, final String fileName, char separator, char quoteChar)
throws IOException {
java.io.Writer w = new FileWriter(filePath + File.separator + fileName);
return new CSVWriter(w, separator, quoteChar, "\r\n");
}
public static void csvWriter(
String filePath, String fileName, char separator, String[] headers, List<String[]> dataList)
throws IOException {
CSVWriter reconWriter = setCsvFile(filePath, fileName, separator);
if (headers != null) {
reconWriter.writeNext(headers);
}
reconWriter.writeAll(dataList);
reconWriter.flush();
try {
reconWriter.close();
} catch (IOException e) {
reconWriter = null;
}
}
public static void csvWriter(
String filePath,
String fileName,
char separator,
char quoteChar,
String[] headers,
List<String[]> dataList)
throws IOException {
CSVWriter reconWriter = setCsvFile(filePath, fileName, separator, quoteChar);
if (headers != null) {
reconWriter.writeNext(headers);
}
reconWriter.writeAll(dataList);
reconWriter.flush();
try {
reconWriter.close();
} catch (IOException e) {
reconWriter = null;
}
}
}

View File

@ -0,0 +1,221 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.file;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class FileTool {
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private FileTool() {}
/**
* Méthode permettant de lire le contenu d'un fichier
*
* @param fileName Le nom du fichier
* @return Une liste contenant l'ensemble des lignes
* @throws IOException
* @throws AxelorException
*/
public static List<String> reader(String fileName) throws IOException {
List<String> content = new ArrayList<>();
try (BufferedReader br = new BufferedReader(new FileReader(new File(fileName)))) {
String ligne = "";
while ((ligne = br.readLine()) != null) {
content.add(ligne);
}
}
return content;
}
/**
* Méthode permettant d'écrire une ligne dans un fichier
*
* @param destinationFolder Le chemin du fichier
* @param fileName Le nom du fichier
* @param line La ligne à écrire
* @throws IOException
*/
public static void writer(String destinationFolder, String fileName, String line)
throws IOException {
System.setProperty("line.separator", "\r\n");
File file = create(destinationFolder, fileName);
try (FileWriter writer = new FileWriter(file); ) {
writer.write(line);
} catch (IOException ex) {
LOG.error(ex.getMessage());
}
}
/**
* Méthode permettant d'écrire plusieurs lignes dans un fichier
*
* @param destinationFolder Le chemin du fichier
* @param fileName Le nom du fichier
* @param line La liste de ligne à écrire
* @throws IOException
*/
public static File writer(String destinationFolder, String fileName, List<String> multiLine)
throws IOException {
System.setProperty("line.separator", "\r\n");
File file = create(destinationFolder, fileName);
try (BufferedWriter output = new BufferedWriter(new FileWriter(file))) {
int i = 0;
for (String line : multiLine) {
output.write(line);
output.newLine();
i++;
if (i % 50 == 0) {
output.flush();
}
}
} catch (IOException ex) {
LOG.error(ex.getMessage());
}
return file;
}
/**
* Création d'un fichier avec son chemin si il n'existe pas
*
* @param fileName
* @return
* @throws IOException
*/
public static File create(String fileName) {
String[] filePath = fileName.split(Pattern.quote(File.separator));
String name = filePath[filePath.length - 1];
return create(fileName.replace(name, ""), name);
}
/**
* Création d'un fichier avec son chemin si il n'existe pas
*
* @param destinationFolder
* @param fileName
* @return
* @throws IOException
*/
public static File create(String destinationFolder, String fileName) {
File folder = new File(destinationFolder);
if (!folder.exists()) {
folder.mkdirs();
}
return new File(folder, fileName);
}
/**
* Méthode permettant de copier le fichier vers une destination
*
* @param fileSrc Le chemin du fichier source
* @param fileDest Le chemin du fichier destination
* @throws IOException
* @throws FileNotFoundException
* @throws AxelorException
*/
public static void copy(String fileSrc, String fileDest) throws IOException {
IOUtils.copy(new FileInputStream(fileSrc), new FileOutputStream(fileDest));
}
/**
* Copy all files and directories from a Folder to a destination Folder. Must be called like:
* listAllFilesInFolder(srcFolderPath, "", srcFolderPath, destFolderPath)
*
* @param currentFolder Used for the recursive called.
* @param relatedPath Used for the recursive called.
* @param sourceFolder Source directory.
* @param destinationFolder Destination directory.
* @param logger A logger.
* @throws IOException
*/
public static void copyFolderToFolder(String sourceFolder, String destinationFolder)
throws IOException {
// Current Directory.
File current = new File(sourceFolder);
File destFile = new File(destinationFolder);
if (!destFile.exists()) {
destFile.mkdir();
}
if (current.isDirectory()) {
// List all files and folder in the current directory.
File[] list = current.listFiles();
if (list != null) {
// Read the files list.
for (int i = 0; i < list.length; i++) {
// Create current source File
File tf = new File(sourceFolder + File.separator + list[i].getName());
// Create current destination File
File pf = new File(destinationFolder + File.separator + list[i].getName());
if (tf.isDirectory() && !pf.exists()) {
// If the file is a directory and does not exit in the
// destination Folder.
// Create the directory.
pf.mkdir();
copyFolderToFolder(tf.getAbsolutePath(), pf.getAbsolutePath());
} else if (tf.isDirectory() && pf.exists()) {
// If the file is a directory and exits in the
// destination Folder.
copyFolderToFolder(tf.getAbsolutePath(), pf.getAbsolutePath());
} else if (tf.isFile()) {
// If it is a file.
copy(
sourceFolder + File.separator + list[i].getName(),
destinationFolder + File.separator + list[i].getName());
} else {
// Other cases.
LOG.error("Error : Copy folder");
}
}
}
}
}
}

View File

@ -0,0 +1,107 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.file;
import com.axelor.apps.tool.exception.IExceptionMessage;
import com.axelor.i18n.I18n;
import com.axelor.meta.MetaFiles;
import com.google.common.base.Preconditions;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.invoke.MethodHandles;
import java.net.URLEncoder;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import org.apache.pdfbox.multipdf.PDFMergerUtility;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class PdfTool {
private static final Logger logger =
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private PdfTool() {}
/**
* Merge pdf, then return the webservice url to the created file.
*
* @param fileList a list of files to merge
* @param fileName the name of the created file
* @return the link to the file
* @throws IOException
*/
public static String mergePdfToFileLink(List<File> fileList, String fileName) throws IOException {
return getFileLinkFromPdfFile(mergePdf(fileList), fileName);
}
/**
* Append multiple PDF files into one PDF.
*
* @param fileList a list of path of PDF files to merge.
* @return The link to access the generated PDF.
*/
public static File mergePdf(List<File> fileList) throws IOException {
PDFMergerUtility pdfMergerUtility = new PDFMergerUtility();
for (File file : fileList) {
pdfMergerUtility.addSource(file);
}
Path tmpFile = MetaFiles.createTempFile(null, "");
FileOutputStream stream = new FileOutputStream(tmpFile.toFile());
pdfMergerUtility.setDestinationStream(stream);
pdfMergerUtility.mergeDocuments(null);
return tmpFile.toFile();
}
/**
* Return a webservice url to get a printed pdf with a defined name.
*
* @param file the printed report
* @param fileName the file name
* @return the url
*/
public static String getFileLinkFromPdfFile(File file, String fileName) {
String fileLink = "ws/files/report/" + file.getName();
try {
fileLink += "?name=" + URLEncoder.encode(fileName, "UTF-8");
} catch (UnsupportedEncodingException e) {
logger.error(e.getLocalizedMessage());
}
return fileLink;
}
/**
* Allows to get a PDF with multiple copies.
*
* @param file the PDF to copy
* @param copyNumber the number of copies
* @return a new file with the number of asked copies.
* @throws IllegalArgumentException if copy number is inferior or equal to 0.
* @throws IOException if mergePdf fails to write the new file.
*/
public static File printCopiesToFile(File file, int copyNumber) throws IOException {
Preconditions.checkArgument(
copyNumber > 0, I18n.get(IExceptionMessage.BAD_COPY_NUMBER_ARGUMENT));
List<File> invoicePrintingToMerge = Collections.nCopies(copyNumber, file);
return mergePdf(invoicePrintingToMerge);
}
}

View File

@ -0,0 +1,36 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.module;
import com.axelor.app.AxelorModule;
import com.axelor.apps.tool.service.ArchivingToolService;
import com.axelor.apps.tool.service.ArchivingToolServiceImpl;
import com.axelor.apps.tool.service.CipherService;
import com.axelor.apps.tool.service.CipherServiceImpl;
import com.axelor.apps.tool.service.TranslationService;
import com.axelor.apps.tool.service.TranslationServiceImpl;
public class ToolModule extends AxelorModule {
@Override
protected void configure() {
bind(CipherService.class).to(CipherServiceImpl.class);
bind(TranslationService.class).to(TranslationServiceImpl.class);
bind(ArchivingToolService.class).to(ArchivingToolServiceImpl.class);
}
}

View File

@ -0,0 +1,86 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.net;
import com.axelor.exception.service.TraceBackService;
import java.io.File;
import java.io.FileOutputStream;
import java.lang.invoke.MethodHandles;
import java.util.Calendar;
import java.util.Date;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class MyFtp {
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private MyFtp() {}
public static void getDataFiles(
String server,
String username,
String password,
String folder,
String destinationFolder,
Calendar start,
Calendar end) {
try {
// Connect and logon to FTP Server
FTPClient ftp = new FTPClient();
ftp.connect(server);
ftp.login(username, password);
// List the files in the directory
ftp.changeWorkingDirectory(folder);
FTPFile[] files = ftp.listFiles();
getDataFile(files, destinationFolder, start, end, ftp);
// Logout from the FTP Server and disconnect
ftp.logout();
ftp.disconnect();
} catch (Exception e) {
LOG.error(e.getMessage());
}
}
public static void getDataFile(
FTPFile[] files, String destinationFolder, Calendar start, Calendar end, FTPClient ftp) {
for (int i = 0; i < files.length; i++) {
Date fileDate = files[i].getTimestamp().getTime();
if (fileDate.compareTo(start.getTime()) >= 0 && fileDate.compareTo(end.getTime()) <= 0) {
// Download a file from the FTP Server
File file = new File(destinationFolder + File.separator + files[i].getName());
try (FileOutputStream fos = new FileOutputStream(file); ) {
ftp.retrieveFile(files[i].getName(), fos);
file.setLastModified(fileDate.getTime());
} catch (Exception e) {
LOG.error(e.getMessage());
TraceBackService.trace(e);
}
}
}
}
}

View File

@ -0,0 +1,126 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.net;
import com.axelor.apps.tool.exception.IExceptionMessage;
import com.axelor.apps.tool.file.FileTool;
import com.axelor.i18n.I18n;
import com.google.common.base.Strings;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.invoke.MethodHandles;
import java.net.URL;
import java.net.URLConnection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class URLService {
static final int size = 1024;
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
/**
* Test la validité d'une url.
*
* @param url L'URL à tester.
* @return
*/
public static String notExist(String url) {
if (Strings.isNullOrEmpty(url)) {
return I18n.get(IExceptionMessage.URL_SERVICE_1);
}
try {
URL fileURL = new URL(url);
fileURL.openConnection().connect();
return null;
} catch (java.net.MalformedURLException ex) {
ex.printStackTrace();
return String.format(I18n.get(IExceptionMessage.URL_SERVICE_2), url);
} catch (java.io.IOException ex) {
ex.printStackTrace();
return String.format(I18n.get(IExceptionMessage.URL_SERVICE_3), url);
}
}
public static void fileUrl(
File file, String fAddress, String localFileName, String destinationDir) throws IOException {
try (OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(file))) {
int byteRead;
int byteWritten = 0;
byte[] buf = new byte[size];
URL url = new URL(fAddress);
URLConnection urlConnection = url.openConnection();
InputStream inputStream = urlConnection.getInputStream();
while ((byteRead = inputStream.read(buf)) != -1) {
outputStream.write(buf, 0, byteRead);
byteWritten += byteRead;
}
LOG.info("Downloaded Successfully.");
LOG.debug("No of bytes", byteWritten);
} catch (IOException ex) {
LOG.error(ex.getMessage());
}
}
public static File fileDownload(String fAddress, String destinationDir, String fileName)
throws IOException {
int slashIndex = fAddress.lastIndexOf('/');
int periodIndex = fAddress.lastIndexOf('.');
if (periodIndex >= 1 && slashIndex >= 0 && slashIndex < fAddress.length() - 1) {
LOG.debug("Downloading file {} from {} to {}", fileName, fAddress, destinationDir);
File file = FileTool.create(destinationDir, fileName);
fileUrl(file, fAddress, fileName, destinationDir);
return file;
} else {
LOG.error("Destination path or filename is not well formatted.");
return null;
}
}
public static void fileDownload(
File file, String fAddress, String destinationDir, String fileName) throws IOException {
int slashIndex = fAddress.lastIndexOf('/');
int periodIndex = fAddress.lastIndexOf('.');
if (periodIndex >= 1 && slashIndex >= 0 && slashIndex < fAddress.length() - 1) {
LOG.debug("Downloading file {} from {} to {}", fileName, fAddress, destinationDir);
fileUrl(file, fAddress, fileName, destinationDir);
} else {
LOG.error("Destination path or filename is not well formatted.");
}
}
}

View File

@ -0,0 +1,28 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.service;
import com.axelor.exception.AxelorException;
import java.util.Map;
public interface ArchivingToolService {
public Map<String, String> getObjectLinkTo(Object object, Long id) throws AxelorException;
public String getModelTitle(String modelName) throws AxelorException;
}

View File

@ -0,0 +1,153 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.service;
import com.axelor.db.JPA;
import com.axelor.exception.AxelorException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.NoResultException;
import javax.persistence.Query;
/** @author axelor */
public class ArchivingToolServiceImpl implements ArchivingToolService {
/** */
@Override
public Map<String, String> getObjectLinkTo(Object object, Long id) throws AxelorException {
Map<String, String> objectsLinkToMap = new HashMap<String, String>();
Query FindModelWithobjectFieldQuery =
JPA.em()
.createNativeQuery(
"SELECT field.name as fieldName, model.name as ModelName,field.relationship as relationship,field.mapped_by as mappedBy,model.table_name as tableName"
+ " FROM meta_field field"
+ " LEFT JOIN meta_model model on field.meta_model = model.id"
+ " WHERE field.type_name like :objectName");
FindModelWithobjectFieldQuery.setParameter("objectName", object.getClass().getSimpleName());
List<Object[]> resultList = FindModelWithobjectFieldQuery.getResultList();
for (Object[] result : resultList) {
String fieldName = ((String) result[0]).replaceAll("([A-Z])", "_$1").toLowerCase();
String modelName = (String) result[1];
String modelNameBDDFormat =
modelName.replaceAll("([A-Z])", "_$1").toLowerCase().replace("^_", "");
String relationship = (String) result[2];
String mappedBy = null;
if (result[3] != null) {
mappedBy = ((String) result[3]).replaceAll("([A-Z])", "_$1").toLowerCase();
}
String tableObjectLinkName = ((String) result[4]).toLowerCase().replace(" ", "_");
String tableObjectName = this.getTableObjectName(object);
Query findobjectQuery = null;
if (relationship.equals("ManyToOne") || relationship.equals("OneToOne")) {
findobjectQuery =
JPA.em()
.createNativeQuery(
"SELECT DISTINCT ol."
+ fieldName
+ " FROM "
+ tableObjectLinkName
+ " ol LEFT JOIN "
+ tableObjectName
+ " o ON ol."
+ fieldName
+ " = "
+ "o.id"
+ " WHERE o.id = :objectId ");
findobjectQuery.setParameter("objectId", id);
} else if (result[3].equals("OneToMany")) {
String manyToOneMappedfield = null;
if (mappedBy != null && !mappedBy.isEmpty()) {
manyToOneMappedfield = mappedBy;
} else {
manyToOneMappedfield = modelNameBDDFormat;
}
findobjectQuery =
JPA.em()
.createNativeQuery(
"SELECT DISTINCT ol."
+ fieldName
+ " FROM "
+ tableObjectLinkName
+ " ol LEFT JOIN "
+ tableObjectName
+ " o ON ol.id = o."
+ manyToOneMappedfield
+ " WHERE o.id = :objectId ");
findobjectQuery.setParameter("objectId", id);
} else if (result[2].equals("ManyToMany")) {
String tableNameSet = tableObjectLinkName + "_" + fieldName;
findobjectQuery =
JPA.em()
.createNativeQuery(
"SELECT DISTINCT "
+ fieldName
+ " FROM "
+ tableNameSet
+ " WHERE "
+ fieldName
+ " = :objectId");
findobjectQuery.setParameter("objectId", id);
}
if (findobjectQuery != null) {
Object objectToCheck = null;
try {
objectToCheck = (Object) findobjectQuery.getSingleResult();
} catch (NoResultException nRE) {
// nothing to do
}
if (objectToCheck != null) {
objectsLinkToMap.put(modelName, relationship);
}
}
}
return objectsLinkToMap;
}
protected String getTableObjectName(Object object) {
String moduleName =
object
.getClass()
.getPackage()
.getName()
.replace("com.axelor.apps.", "")
.replace(".db", "")
.replace(".", "_")
.toLowerCase();
String objectName =
object.getClass().getSimpleName().replaceAll("([A-Z])", "_$1").toLowerCase();
;
return moduleName + objectName;
}
@Override
public String getModelTitle(String modelName) throws AxelorException {
Query FindModelWithobjectFieldQuery =
JPA.em()
.createNativeQuery(
"SELECT view.title as viewTitle"
+ " FROM meta_view view"
+ " WHERE view.name like :viewtName");
FindModelWithobjectFieldQuery.setParameter(
"viewtName", modelName.replaceAll("([a-z])([A-Z])", "$1-$2").toLowerCase() + "-form");
return (String) FindModelWithobjectFieldQuery.getSingleResult();
}
}

View File

@ -0,0 +1,25 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.service;
public interface CipherService {
public String encrypt(String unencryptedString);
public String decrypt(String encryptedString);
}

View File

@ -0,0 +1,101 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.service;
import com.axelor.app.AppSettings;
import com.axelor.common.StringUtils;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;
public class CipherServiceImpl implements CipherService {
private static final String UNICODE_FORMAT = "UTF8";
public static final String DESEDE_ENCRYPTION_SCHEME = "DESede";
private Cipher cipher;
@Override
public String encrypt(String unencryptedString) {
String encryptedString = null;
try {
SecretKey key = this.initEncryptOrDecrypt();
if (key != null) {
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] plainText = unencryptedString.getBytes(UNICODE_FORMAT);
byte[] encryptedText = cipher.doFinal(plainText);
encryptedString = Base64.getEncoder().encodeToString(encryptedText);
} else {
return unencryptedString;
}
} catch (Exception e) {
e.printStackTrace();
}
return encryptedString;
}
@Override
public String decrypt(String encryptedString) {
String decryptedText = null;
try {
SecretKey key = this.initEncryptOrDecrypt();
if (key != null) {
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] encryptedText = Base64.getDecoder().decode(encryptedString);
byte[] plainText = cipher.doFinal(encryptedText);
decryptedText = new String(plainText);
} else {
return encryptedString;
}
} catch (Exception e) {
e.printStackTrace();
}
return decryptedText;
}
private SecretKey initEncryptOrDecrypt()
throws UnsupportedEncodingException, InvalidKeyException, NoSuchAlgorithmException,
NoSuchPaddingException, InvalidKeySpecException {
String encryptionScheme = DESEDE_ENCRYPTION_SCHEME;
String encryptionkey = AppSettings.get().get("application.encryptionkey");
SecretKey key = null;
if (StringUtils.notEmpty(encryptionkey)) {
byte[] arrayBytes = encryptionkey.getBytes(UNICODE_FORMAT);
KeySpec ks = new DESedeKeySpec(arrayBytes);
SecretKeyFactory skf = SecretKeyFactory.getInstance(encryptionScheme);
cipher = Cipher.getInstance(encryptionScheme);
key = skf.generateSecret(ks);
}
return key;
}
}

View File

@ -0,0 +1,69 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.service;
public interface TranslationService {
/**
* Update formated value translations.
*
* @param oldKey
* @param format
* @param args
*/
void updateFormatedValueTranslations(String oldKey, String format, Object... args);
/**
* Create formated value translations.
*
* @param format
* @param args
*/
void createFormatedValueTranslations(String format, Object... args);
/**
* Remove value translations.
*
* @param key
*/
void removeValueTranslations(String key);
/**
* Get the translation of the given key.
*
* @param key
*/
String getTranslation(String key, String language);
/**
* Get the translation key of the given message.
*
* @param value
* @param language
* @return
*/
String getTranslationKey(String message, String language);
/**
* Get the translation of the given value key.
*
* @param key
* @param language
* @return
*/
String getValueTranslation(String key, String language);
}

View File

@ -0,0 +1,136 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.service;
import com.axelor.common.StringUtils;
import com.axelor.meta.db.MetaTranslation;
import com.axelor.meta.db.repo.MetaTranslationRepository;
import com.google.inject.Inject;
import com.google.inject.persist.Transactional;
import java.util.Collection;
import java.util.HashSet;
public class TranslationServiceImpl implements TranslationService {
protected MetaTranslationRepository metaTranslationRepo;
protected static final String VALUE_KEY_PREFIX = "value:";
@Inject
TranslationServiceImpl(MetaTranslationRepository metaTranslationRepo) {
this.metaTranslationRepo = metaTranslationRepo;
}
@Override
@Transactional
public void updateFormatedValueTranslations(String oldKey, String format, Object... args) {
removeValueTranslations(oldKey);
createFormatedValueTranslations(format, args);
}
@Override
@Transactional
public void createFormatedValueTranslations(String format, Object... args) {
String key = VALUE_KEY_PREFIX + String.format(format, args);
for (String language : getLanguages(args)) {
MetaTranslation metaTranslation = metaTranslationRepo.findByKey(key, language);
if (metaTranslation == null) {
metaTranslation = new MetaTranslation();
metaTranslation.setKey(key);
metaTranslation.setLanguage(language);
}
String message = String.format(format, getTranslatedValueArgs(args, language));
metaTranslation.setMessage(message);
metaTranslationRepo.save(metaTranslation);
}
}
@Override
@Transactional
public void removeValueTranslations(String key) {
if (StringUtils.isBlank(key)) {
return;
}
for (MetaTranslation metaTranslation :
metaTranslationRepo
.all()
.filter("self.key = :key")
.bind("key", VALUE_KEY_PREFIX + key)
.fetch()) {
metaTranslationRepo.remove(metaTranslation);
}
}
private Object[] getTranslatedValueArgs(Object[] args, String language) {
Object[] translatedArgs = new String[args.length];
for (int i = 0; i < args.length; ++i) {
String key = String.valueOf(args[i]);
translatedArgs[i] = getValueTranslation(key, language);
}
return translatedArgs;
}
@Override
public String getTranslation(String key, String language) {
MetaTranslation metaTranslation = metaTranslationRepo.findByKey(key, language);
return metaTranslation != null && !StringUtils.isBlank(metaTranslation.getMessage())
? metaTranslation.getMessage()
: key;
}
@Override
public String getTranslationKey(String message, String language) {
MetaTranslation metaTranslation =
metaTranslationRepo
.all()
.filter("self.message = ?1 AND self.language = ?2", message, language)
.fetchOne();
return metaTranslation != null && !StringUtils.isBlank(metaTranslation.getKey())
? metaTranslation.getKey()
: message;
}
@Override
public String getValueTranslation(String key, String language) {
String valueKey = VALUE_KEY_PREFIX + key;
String translation = getTranslation(valueKey, language);
return !valueKey.equals(translation) ? translation : key;
}
private Collection<String> getLanguages(Object... args) {
Collection<String> languages = new HashSet<>();
for (Object arg : args) {
for (MetaTranslation metaTranslation :
metaTranslationRepo
.all()
.filter("self.key = :key")
.bind("key", VALUE_KEY_PREFIX + arg)
.fetch()) {
languages.add(metaTranslation.getLanguage());
}
}
return languages;
}
}

View File

@ -0,0 +1,47 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.xml;
import java.lang.invoke.MethodHandles;
import java.time.LocalDateTime;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class DateToXML {
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
public static XMLGregorianCalendar convert(LocalDateTime in) {
XMLGregorianCalendar date = null;
try {
date = DatatypeFactory.newInstance().newXMLGregorianCalendar(in.toString());
} catch (DatatypeConfigurationException e) {
LOG.error(e.getMessage());
}
return date;
}
}

View File

@ -0,0 +1,129 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.xml;
import com.axelor.apps.tool.file.FileTool;
import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
public final class Marschaller {
private Marschaller() {}
public static void marschalOutputStream(Object jaxbElement, String context) throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(context);
marschalOutputStream(jaxbElement, jaxbContext);
}
public static void marschalOutputStream(Object jaxbElement, JAXBContext jaxbContext)
throws JAXBException {
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.marshal(jaxbElement, System.out);
}
public static void marschal(Object jaxbElement, String context, StringWriter writer)
throws JAXBException {
JAXBContext jaxbContext = JAXBContext.newInstance(context);
marschal(jaxbElement, jaxbContext, writer);
}
public static void marschal(Object jaxbElement, JAXBContext jaxbContext, StringWriter sw)
throws JAXBException {
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
sw.write("<?xml version=\"1.0\" encoding=\"utf-8\"?> \n");
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.setProperty(
"com.sun.xml.bind.namespacePrefixMapper", new CustomNamespacePrefixMapper());
marshaller.marshal(jaxbElement, sw);
}
public static File marschalFile(
Object jaxbElement, String context, String destinationFolder, String fileName)
throws JAXBException, IOException {
JAXBContext jaxbContext = JAXBContext.newInstance(context);
return marschalFile(jaxbElement, jaxbContext, destinationFolder, fileName);
}
public static File marschalFile(
Object jaxbElement, JAXBContext jaxbContext, String destinationFolder, String fileName)
throws JAXBException, IOException {
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
File file = FileTool.create(destinationFolder, fileName);
marshaller.marshal(jaxbElement, file);
return file;
}
public static Object unmarschalFile(String context, String data) throws JAXBException {
JAXBContext jc = JAXBContext.newInstance(context);
return unmarschalFile(jc, data);
}
public static Object unmarschalFile(JAXBContext jaxbContext, String data) throws JAXBException {
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
StringReader reader = new StringReader(data);
return unmarshaller.unmarshal(reader);
}
/**
* Coerces the JAXB marshaller to declare the "xsi" and "xsd" namespaces at the root element
* instead of putting them inline on each element that uses one of the namespaces.
*/
private static class CustomNamespacePrefixMapper extends NamespacePrefixMapper {
@Override
public String getPreferredPrefix(
String namespaceUri, String suggestion, boolean requirePrefix) {
return suggestion;
}
@Override
public String[] getPreDeclaredNamespaceUris2() {
return new String[] {
"xsi",
"http://www.w3.org/2001/XMLSchema-instance",
"xsd",
"http://www.w3.org/2001/XMLSchema"
};
}
}
}

View File

@ -0,0 +1,140 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.xml;
import java.lang.invoke.MethodHandles;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
public class XPathParse {
private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private Document doc;
protected Document getDoc() {
return doc;
}
protected void setDoc(Document doc) {
this.doc = doc;
}
public XPathParse() {}
public XPathParse(String xml) {
DocumentBuilderFactory domFactory = getDocumentBuilderFactory();
domFactory.setNamespaceAware(true); // never forget this!
DocumentBuilder builder;
try {
builder = domFactory.newDocumentBuilder();
this.doc = builder.parse(xml);
} catch (Exception e) {
LOG.error(e.getMessage());
}
}
public DocumentBuilderFactory getDocumentBuilderFactory() {
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
try {
String feature = "http://apache.org/xml/features/disallow-doctype-decl";
domFactory.setFeature(feature, true);
// Disable #external-general-entities
feature = "http://xml.org/sax/features/external-general-entities";
domFactory.setFeature(feature, false);
// Disable #external-parameter-entities
feature = "http://xml.org/sax/features/external-parameter-entities";
domFactory.setFeature(feature, false);
// Disable external DTDs as well
feature = "http://apache.org/xml/features/nonvalidating/load-external-dtd";
domFactory.setFeature(feature, false);
// and these as well
domFactory.setXIncludeAware(false);
domFactory.setExpandEntityReferences(false);
domFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
} catch (ParserConfigurationException e) {
LOG.error(e.getMessage());
}
return domFactory;
}
/**
* public static TreeMap<String,String> parse(String xml, ArrayList<String> xpeList) throws
* ParserConfigurationException, SAXException, IOException, XPathExpressionException {
*
* <p>Ref: http://www.ibm.com/developerworks/library/x-javaxpathapi/index.html HashMap replaced by
* TreeMap since it is sorted Exceptions catched here since no way to catch them in aml
*/
public Map<String, String> parse(List<String> xpeList) {
Map<String, String> dict = new TreeMap<String, String>();
try {
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
for (String xpe : xpeList) {
XPathExpression expr = xpath.compile(xpe); // /text()
Object result = expr.evaluate(this.doc, XPathConstants.NODESET);
NodeList nodes = (NodeList) result;
if (nodes.getLength() == 1) {
dict.put(xpe, nodes.item(0).getNodeValue());
} else {
for (int i = 0; i < nodes.getLength(); i++) {
dict.put(i + "__" + xpe, nodes.item(i).getNodeValue());
}
}
}
} catch (Exception e) {
LOG.error("some pb occurred during xml scan");
}
return dict;
}
}

View File

@ -0,0 +1,262 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.tool.template;
import com.axelor.apps.tool.exception.IExceptionMessage;
import com.axelor.auth.AuthUtils;
import com.axelor.db.Model;
import com.axelor.db.mapper.Mapper;
import com.axelor.db.mapper.Property;
import com.axelor.i18n.I18n;
import com.axelor.inject.Beans;
import com.axelor.meta.db.MetaSelectItem;
import com.axelor.meta.db.repo.MetaSelectItemRepository;
import com.axelor.rpc.Resource;
import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import com.google.common.io.Files;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import org.apache.commons.lang3.StringEscapeUtils;
import org.stringtemplate.v4.AttributeRenderer;
import org.stringtemplate.v4.DateRenderer;
import org.stringtemplate.v4.Interpreter;
import org.stringtemplate.v4.ModelAdaptor;
import org.stringtemplate.v4.NumberRenderer;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.StringRenderer;
import org.stringtemplate.v4.misc.ObjectModelAdaptor;
public class TemplateMaker {
private Map<String, Object> context;
private Map<String, Object> localContext;
private String template;
private STGroup stGroup;
private Locale locale;
public TemplateMaker(Locale locale, char delimiterStartChar, char delimiterStopChar) {
this.locale = locale;
this.stGroup = new STGroup(delimiterStartChar, delimiterStopChar);
// Custom renderer
this.stGroup.registerModelAdaptor(Model.class, new ModelFormatRenderer());
this.stGroup.registerRenderer(LocalDate.class, new LocalDateRenderer());
this.stGroup.registerRenderer(LocalDateTime.class, new LocalDateTimeRenderer());
this.stGroup.registerRenderer(LocalTime.class, new LocalTimeRenderer());
// Default renderer provide by ST
this.stGroup.registerRenderer(String.class, new StringRenderer());
this.stGroup.registerRenderer(Number.class, new NumberRenderer());
this.stGroup.registerRenderer(Date.class, new DateRenderer());
}
public void setContext(Model model) {
this.setContext(model, null, null);
}
public void setContext(Model model, String nameInContext) {
this.setContext(model, null, nameInContext);
}
public void setContext(Model model, Map<String, Object> map) {
this.setContext(model, map, null);
}
public void setContext(Model model, Map<String, Object> map, String nameInContext) {
Preconditions.checkNotNull(model);
this.context = makeContext(nameInContext, model, map);
}
public void addContext(String nameInContext, Object object) {
if (this.context == null) {
this.context = Maps.newHashMap();
}
this.context.put(nameInContext, object);
}
private Map<String, Object> makeContext(
String nameInContext, Model model, Map<String, Object> map) {
Map<String, Object> _map = Maps.newHashMap();
if (nameInContext != null) {
_map.put(nameInContext, model);
} else {
_map.putAll(Resource.toMap(model));
}
if (map != null) {
_map.putAll(map);
}
return _map;
}
public void setTemplate(String text) {
this.template = text;
}
public void setTemplate(File file) throws FileNotFoundException {
if (!file.isFile()) {
throw new FileNotFoundException(
I18n.get(IExceptionMessage.TEMPLATE_MAKER_1) + ": " + file.getName());
}
String text;
try {
text = Files.toString(file, Charsets.UTF_8);
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
this.setTemplate(text);
}
public void addInContext(String key, Object value) {
if (localContext == null) {
localContext = Maps.newHashMap();
}
localContext.put(key, value);
}
public void addInContext(Map<String, Object> map) {
if (localContext == null) {
localContext = Maps.newHashMap();
}
localContext.putAll(map);
}
public Class<?> getBeanClass(Model model) {
return model.getClass();
}
public String make() {
if (Strings.isNullOrEmpty(this.template)) {
throw new IllegalArgumentException(I18n.get(IExceptionMessage.TEMPLATE_MAKER_2));
}
ST st = new ST(stGroup, template);
Map<String, Object> _map = Maps.newHashMap();
if (localContext != null && !localContext.isEmpty()) {
_map.putAll(localContext);
}
if (context != null) {
_map.putAll(context);
}
// Internal context
_map.put("__user__", AuthUtils.getUser());
_map.put("__date__", LocalDate.now());
_map.put("__time__", LocalTime.now());
_map.put("__datetime__", LocalDateTime.now());
for (String key : _map.keySet()) {
Object value = _map.get(key);
if (value instanceof String) {
value = StringEscapeUtils.escapeXml11(value.toString());
}
st.add(key, value);
}
return _make(st);
}
private String _make(ST st) {
return st.render(locale);
}
class ModelFormatRenderer implements ModelAdaptor {
private Property getProperty(Class<?> beanClass, String name) {
return Mapper.of(beanClass).getProperty(name);
}
private String getSelectionValue(Property prop, Object o, Object value) {
if (value == null) {
return "";
}
MetaSelectItem item =
Beans.get(MetaSelectItemRepository.class)
.all()
.filter("self.select.name = ?1 AND self.value = ?2", prop.getSelection(), value)
.fetchOne();
if (item != null) {
return item.getTitle();
}
return value == null ? "" : value.toString();
}
@Override
public Object getProperty(
Interpreter interp, ST self, Object o, Object property, String propertyName) {
Property prop = this.getProperty(o.getClass(), (String) property);
ModelAdaptor adap =
self.groupThatCreatedThisInstance.getModelAdaptor(ObjectModelAdaptor.class);
if (prop == null || Strings.isNullOrEmpty(prop.getSelection())) {
return adap.getProperty(interp, self, o, property, propertyName);
}
Object value = adap.getProperty(interp, self, o, property, propertyName);
return getSelectionValue(prop, o, value);
}
}
class LocalDateRenderer implements AttributeRenderer {
@Override
public String toString(Object o, String formatString, Locale locale) {
if (formatString == null) return o.toString();
LocalDate ld = (LocalDate) o;
return ld.format(DateTimeFormatter.ofPattern(formatString));
}
}
class LocalDateTimeRenderer implements AttributeRenderer {
@Override
public String toString(Object o, String formatString, Locale locale) {
if (formatString == null) return o.toString();
LocalDateTime ld = (LocalDateTime) o;
return ld.format(DateTimeFormatter.ofPattern(formatString));
}
}
class LocalTimeRenderer implements AttributeRenderer {
@Override
public String toString(Object o, String formatString, Locale locale) {
if (formatString == null) return o.toString();
LocalTime ld = (LocalTime) o;
return ld.format(DateTimeFormatter.ofPattern(formatString));
}
}
}

View File

@ -0,0 +1,71 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="QAAddress" type="{http://www.qas.com/web-2005-02}QAAddressType"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"qaAddress"}
)
@XmlRootElement(name = "Address")
public class Address {
@XmlElement(name = "QAAddress", required = true)
protected QAAddressType qaAddress;
/**
* Obtient la valeur de la propriété qaAddress.
*
* @return possible object is {@link QAAddressType }
*/
public QAAddressType getQAAddress() {
return qaAddress;
}
/**
* Définit la valeur de la propriété qaAddress.
*
* @param value allowed object is {@link QAAddressType }
*/
public void setQAAddress(QAAddressType value) {
this.qaAddress = value;
}
}

View File

@ -0,0 +1,170 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour AddressLineType complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="AddressLineType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Label" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="Line" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="LineContent" type="{http://www.qas.com/web-2005-02}LineContentType" default="Address" />
* &lt;attribute name="Overflow" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="Truncated" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "AddressLineType",
propOrder = {"label", "line"}
)
public class AddressLineType {
@XmlElement(name = "Label")
protected String label;
@XmlElement(name = "Line")
protected String line;
@XmlAttribute(name = "LineContent")
protected LineContentType lineContent;
@XmlAttribute(name = "Overflow")
protected Boolean overflow;
@XmlAttribute(name = "Truncated")
protected Boolean truncated;
/**
* Obtient la valeur de la propriété label.
*
* @return possible object is {@link String }
*/
public String getLabel() {
return label;
}
/**
* Définit la valeur de la propriété label.
*
* @param value allowed object is {@link String }
*/
public void setLabel(String value) {
this.label = value;
}
/**
* Obtient la valeur de la propriété line.
*
* @return possible object is {@link String }
*/
public String getLine() {
return line;
}
/**
* Définit la valeur de la propriété line.
*
* @param value allowed object is {@link String }
*/
public void setLine(String value) {
this.line = value;
}
/**
* Obtient la valeur de la propriété lineContent.
*
* @return possible object is {@link LineContentType }
*/
public LineContentType getLineContent() {
if (lineContent == null) {
return LineContentType.ADDRESS;
} else {
return lineContent;
}
}
/**
* Définit la valeur de la propriété lineContent.
*
* @param value allowed object is {@link LineContentType }
*/
public void setLineContent(LineContentType value) {
this.lineContent = value;
}
/**
* Obtient la valeur de la propriété overflow.
*
* @return possible object is {@link Boolean }
*/
public boolean isOverflow() {
if (overflow == null) {
return false;
} else {
return overflow;
}
}
/**
* Définit la valeur de la propriété overflow.
*
* @param value allowed object is {@link Boolean }
*/
public void setOverflow(Boolean value) {
this.overflow = value;
}
/**
* Obtient la valeur de la propriété truncated.
*
* @return possible object is {@link Boolean }
*/
public boolean isTruncated() {
if (truncated == null) {
return false;
} else {
return truncated;
}
}
/**
* Définit la valeur de la propriété truncated.
*
* @param value allowed object is {@link Boolean }
*/
public void setTruncated(Boolean value) {
this.truncated = value;
}
}

View File

@ -0,0 +1,68 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour EngineEnumType.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <p>
*
* <pre>
* &lt;simpleType name="EngineEnumType">
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="Singleline"/>
* &lt;enumeration value="Typedown"/>
* &lt;enumeration value="Verification"/>
* &lt;/restriction>
* &lt;/simpleType>
* </pre>
*/
@XmlType(name = "EngineEnumType")
@XmlEnum
public enum EngineEnumType {
@XmlEnumValue("Singleline")
SINGLELINE("Singleline"),
@XmlEnumValue("Typedown")
TYPEDOWN("Typedown"),
@XmlEnumValue("Verification")
VERIFICATION("Verification");
private final String value;
EngineEnumType(String v) {
value = v;
}
public String value() {
return value;
}
public static EngineEnumType fromValue(String v) {
for (EngineEnumType c : EngineEnumType.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}

View File

@ -0,0 +1,68 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour EngineIntensityType.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <p>
*
* <pre>
* &lt;simpleType name="EngineIntensityType">
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="Exact"/>
* &lt;enumeration value="Close"/>
* &lt;enumeration value="Extensive"/>
* &lt;/restriction>
* &lt;/simpleType>
* </pre>
*/
@XmlType(name = "EngineIntensityType")
@XmlEnum
public enum EngineIntensityType {
@XmlEnumValue("Exact")
EXACT("Exact"),
@XmlEnumValue("Close")
CLOSE("Close"),
@XmlEnumValue("Extensive")
EXTENSIVE("Extensive");
private final String value;
EngineIntensityType(String v) {
value = v;
}
public String value() {
return value;
}
public static EngineIntensityType fromValue(String v) {
for (EngineIntensityType c : EngineIntensityType.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}

View File

@ -0,0 +1,176 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/**
* Classe Java pour EngineType complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="EngineType">
* &lt;simpleContent>
* &lt;extension base="&lt;http://www.qas.com/web-2005-02>EngineEnumType">
* &lt;attribute name="Flatten" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="Intensity" type="{http://www.qas.com/web-2005-02}EngineIntensityType" />
* &lt;attribute name="PromptSet" type="{http://www.qas.com/web-2005-02}PromptSetType" />
* &lt;attribute name="Threshold" type="{http://www.qas.com/web-2005-02}ThresholdType" />
* &lt;attribute name="Timeout" type="{http://www.qas.com/web-2005-02}TimeoutType" />
* &lt;/extension>
* &lt;/simpleContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "EngineType",
propOrder = {"value"}
)
public class EngineType {
@XmlValue protected EngineEnumType value;
@XmlAttribute(name = "Flatten")
protected Boolean flatten;
@XmlAttribute(name = "Intensity")
protected EngineIntensityType intensity;
@XmlAttribute(name = "PromptSet")
protected PromptSetType promptSet;
@XmlAttribute(name = "Threshold")
protected Integer threshold;
@XmlAttribute(name = "Timeout")
protected Integer timeout;
/**
* Obtient la valeur de la propriété value.
*
* @return possible object is {@link EngineEnumType }
*/
public EngineEnumType getValue() {
return value;
}
/**
* Définit la valeur de la propriété value.
*
* @param value allowed object is {@link EngineEnumType }
*/
public void setValue(EngineEnumType value) {
this.value = value;
}
/**
* Obtient la valeur de la propriété flatten.
*
* @return possible object is {@link Boolean }
*/
public Boolean isFlatten() {
return flatten;
}
/**
* Définit la valeur de la propriété flatten.
*
* @param value allowed object is {@link Boolean }
*/
public void setFlatten(Boolean value) {
this.flatten = value;
}
/**
* Obtient la valeur de la propriété intensity.
*
* @return possible object is {@link EngineIntensityType }
*/
public EngineIntensityType getIntensity() {
return intensity;
}
/**
* Définit la valeur de la propriété intensity.
*
* @param value allowed object is {@link EngineIntensityType }
*/
public void setIntensity(EngineIntensityType value) {
this.intensity = value;
}
/**
* Obtient la valeur de la propriété promptSet.
*
* @return possible object is {@link PromptSetType }
*/
public PromptSetType getPromptSet() {
return promptSet;
}
/**
* Définit la valeur de la propriété promptSet.
*
* @param value allowed object is {@link PromptSetType }
*/
public void setPromptSet(PromptSetType value) {
this.promptSet = value;
}
/**
* Obtient la valeur de la propriété threshold.
*
* @return possible object is {@link Integer }
*/
public Integer getThreshold() {
return threshold;
}
/**
* Définit la valeur de la propriété threshold.
*
* @param value allowed object is {@link Integer }
*/
public void setThreshold(Integer value) {
this.threshold = value;
}
/**
* Obtient la valeur de la propriété timeout.
*
* @return possible object is {@link Integer }
*/
public Integer getTimeout() {
return timeout;
}
/**
* Définit la valeur de la propriété timeout.
*
* @param value allowed object is {@link Integer }
*/
public void setTimeout(Integer value) {
this.timeout = value;
}
}

View File

@ -0,0 +1,56 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.ws.WebFault;
/**
* This class was generated by Apache CXF 2.6.2 2012-09-12T15:14:19.665+02:00 Generated source
* version: 2.6.2
*/
@WebFault(name = "QAFault", targetNamespace = "http://www.qas.com/web-2005-02")
public class Fault extends Exception {
private com.qas.web_2005_02.QAFault qaFault;
public Fault() {
super();
}
public Fault(String message) {
super(message);
}
public Fault(String message, Throwable cause) {
super(message, cause);
}
public Fault(String message, com.qas.web_2005_02.QAFault qaFault) {
super(message);
this.qaFault = qaFault;
}
public Fault(String message, com.qas.web_2005_02.QAFault qaFault, Throwable cause) {
super(message, cause);
this.qaFault = qaFault;
}
public com.qas.web_2005_02.QAFault getFaultInfo() {
return this.qaFault;
}
}

View File

@ -0,0 +1,92 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour LicenceWarningLevel.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <p>
*
* <pre>
* &lt;simpleType name="LicenceWarningLevel">
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="None"/>
* &lt;enumeration value="DataExpiring"/>
* &lt;enumeration value="LicenceExpiring"/>
* &lt;enumeration value="ClicksLow"/>
* &lt;enumeration value="Evaluation"/>
* &lt;enumeration value="NoClicks"/>
* &lt;enumeration value="DataExpired"/>
* &lt;enumeration value="EvalLicenceExpired"/>
* &lt;enumeration value="FullLicenceExpired"/>
* &lt;enumeration value="LicenceNotFound"/>
* &lt;enumeration value="DataUnreadable"/>
* &lt;/restriction>
* &lt;/simpleType>
* </pre>
*/
@XmlType(name = "LicenceWarningLevel")
@XmlEnum
public enum LicenceWarningLevel {
@XmlEnumValue("None")
NONE("None"),
@XmlEnumValue("DataExpiring")
DATA_EXPIRING("DataExpiring"),
@XmlEnumValue("LicenceExpiring")
LICENCE_EXPIRING("LicenceExpiring"),
@XmlEnumValue("ClicksLow")
CLICKS_LOW("ClicksLow"),
@XmlEnumValue("Evaluation")
EVALUATION("Evaluation"),
@XmlEnumValue("NoClicks")
NO_CLICKS("NoClicks"),
@XmlEnumValue("DataExpired")
DATA_EXPIRED("DataExpired"),
@XmlEnumValue("EvalLicenceExpired")
EVAL_LICENCE_EXPIRED("EvalLicenceExpired"),
@XmlEnumValue("FullLicenceExpired")
FULL_LICENCE_EXPIRED("FullLicenceExpired"),
@XmlEnumValue("LicenceNotFound")
LICENCE_NOT_FOUND("LicenceNotFound"),
@XmlEnumValue("DataUnreadable")
DATA_UNREADABLE("DataUnreadable");
private final String value;
LicenceWarningLevel(String v) {
value = v;
}
public String value() {
return value;
}
public static LicenceWarningLevel fromValue(String v) {
for (LicenceWarningLevel c : LicenceWarningLevel.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}

View File

@ -0,0 +1,74 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour LineContentType.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <p>
*
* <pre>
* &lt;simpleType name="LineContentType">
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="None"/>
* &lt;enumeration value="Address"/>
* &lt;enumeration value="Name"/>
* &lt;enumeration value="Ancillary"/>
* &lt;enumeration value="DataPlus"/>
* &lt;/restriction>
* &lt;/simpleType>
* </pre>
*/
@XmlType(name = "LineContentType")
@XmlEnum
public enum LineContentType {
@XmlEnumValue("None")
NONE("None"),
@XmlEnumValue("Address")
ADDRESS("Address"),
@XmlEnumValue("Name")
NAME("Name"),
@XmlEnumValue("Ancillary")
ANCILLARY("Ancillary"),
@XmlEnumValue("DataPlus")
DATA_PLUS("DataPlus");
private final String value;
LineContentType(String v) {
value = v;
}
public String value() {
return value;
}
public static LineContentType fromValue(String v) {
for (LineContentType c : LineContentType.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}

View File

@ -0,0 +1,184 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlRegistry;
/**
* This object contains factory methods for each Java content interface and Java element interface
* generated in the com.qas.web_2005_02 package.
*
* <p>An ObjectFactory allows you to programatically construct new instances of the Java
* representation for XML content. The Java representation of XML content can consist of schema
* derived interfaces and classes representing the binding of schema type definitions, element
* declarations and model groups. Factory methods for each of these are provided in this class.
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes
* for package: com.qas.web_2005_02
*/
public ObjectFactory() {}
/** Create an instance of {@link QAPromptSet } */
public QAPromptSet createQAPromptSet() {
return new QAPromptSet();
}
/** Create an instance of {@link PromptLine } */
public PromptLine createPromptLine() {
return new PromptLine();
}
/** Create an instance of {@link QASearchResult } */
public QASearchResult createQASearchResult() {
return new QASearchResult();
}
/** Create an instance of {@link QAPicklistType } */
public QAPicklistType createQAPicklistType() {
return new QAPicklistType();
}
/** Create an instance of {@link QAAddressType } */
public QAAddressType createQAAddressType() {
return new QAAddressType();
}
/** Create an instance of {@link QASearchOk } */
public QASearchOk createQASearchOk() {
return new QASearchOk();
}
/** Create an instance of {@link QAGetAddress } */
public QAGetAddress createQAGetAddress() {
return new QAGetAddress();
}
/** Create an instance of {@link QAConfigType } */
public QAConfigType createQAConfigType() {
return new QAConfigType();
}
/** Create an instance of {@link QALayouts } */
public QALayouts createQALayouts() {
return new QALayouts();
}
/** Create an instance of {@link QALayout } */
public QALayout createQALayout() {
return new QALayout();
}
/** Create an instance of {@link QACanSearch } */
public QACanSearch createQACanSearch() {
return new QACanSearch();
}
/** Create an instance of {@link EngineType } */
public EngineType createEngineType() {
return new EngineType();
}
/** Create an instance of {@link QAGetPromptSet } */
public QAGetPromptSet createQAGetPromptSet() {
return new QAGetPromptSet();
}
/** Create an instance of {@link QASearch } */
public QASearch createQASearch() {
return new QASearch();
}
/** Create an instance of {@link QARefine } */
public QARefine createQARefine() {
return new QARefine();
}
/** Create an instance of {@link QASystemInfo } */
public QASystemInfo createQASystemInfo() {
return new QASystemInfo();
}
/** Create an instance of {@link QAData } */
public QAData createQAData() {
return new QAData();
}
/** Create an instance of {@link QADataSet } */
public QADataSet createQADataSet() {
return new QADataSet();
}
/** Create an instance of {@link Picklist } */
public Picklist createPicklist() {
return new Picklist();
}
/** Create an instance of {@link QALicenceInfo } */
public QALicenceInfo createQALicenceInfo() {
return new QALicenceInfo();
}
/** Create an instance of {@link QALicensedSet } */
public QALicensedSet createQALicensedSet() {
return new QALicensedSet();
}
/** Create an instance of {@link Address } */
public Address createAddress() {
return new Address();
}
/** Create an instance of {@link QAExampleAddresses } */
public QAExampleAddresses createQAExampleAddresses() {
return new QAExampleAddresses();
}
/** Create an instance of {@link QAExampleAddress } */
public QAExampleAddress createQAExampleAddress() {
return new QAExampleAddress();
}
/** Create an instance of {@link QAGetLayouts } */
public QAGetLayouts createQAGetLayouts() {
return new QAGetLayouts();
}
/** Create an instance of {@link QAFault } */
public QAFault createQAFault() {
return new QAFault();
}
/** Create an instance of {@link QAGetExampleAddresses } */
public QAGetExampleAddresses createQAGetExampleAddresses() {
return new QAGetExampleAddresses();
}
/** Create an instance of {@link PicklistEntryType } */
public PicklistEntryType createPicklistEntryType() {
return new PicklistEntryType();
}
/** Create an instance of {@link AddressLineType } */
public AddressLineType createAddressLineType() {
return new AddressLineType();
}
}

View File

@ -0,0 +1,71 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="QAPicklist" type="{http://www.qas.com/web-2005-02}QAPicklistType"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"qaPicklist"}
)
@XmlRootElement(name = "Picklist")
public class Picklist {
@XmlElement(name = "QAPicklist", required = true)
protected QAPicklistType qaPicklist;
/**
* Obtient la valeur de la propriété qaPicklist.
*
* @return possible object is {@link QAPicklistType }
*/
public QAPicklistType getQAPicklist() {
return qaPicklist;
}
/**
* Définit la valeur de la propriété qaPicklist.
*
* @param value allowed object is {@link QAPicklistType }
*/
public void setQAPicklist(QAPicklistType value) {
this.qaPicklist = value;
}
}

View File

@ -0,0 +1,499 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour PicklistEntryType complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="PicklistEntryType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Moniker" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="PartialAddress" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Picklist" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Postcode" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Score" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger"/>
* &lt;/sequence>
* &lt;attribute name="FullAddress" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="Multiples" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="CanStep" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="AliasMatch" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="PostcodeRecoded" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="CrossBorderMatch" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="DummyPOBox" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="Information" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="WarnInformation" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="IncompleteAddr" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="UnresolvableRange" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="PhantomPrimaryPoint" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "PicklistEntryType",
propOrder = {"moniker", "partialAddress", "picklist", "postcode", "score"}
)
public class PicklistEntryType {
@XmlElement(name = "Moniker", required = true)
protected String moniker;
@XmlElement(name = "PartialAddress", required = true)
protected String partialAddress;
@XmlElement(name = "Picklist", required = true)
protected String picklist;
@XmlElement(name = "Postcode", required = true)
protected String postcode;
@XmlElement(name = "Score", required = true)
@XmlSchemaType(name = "nonNegativeInteger")
protected BigInteger score;
@XmlAttribute(name = "FullAddress")
protected Boolean fullAddress;
@XmlAttribute(name = "Multiples")
protected Boolean multiples;
@XmlAttribute(name = "CanStep")
protected Boolean canStep;
@XmlAttribute(name = "AliasMatch")
protected Boolean aliasMatch;
@XmlAttribute(name = "PostcodeRecoded")
protected Boolean postcodeRecoded;
@XmlAttribute(name = "CrossBorderMatch")
protected Boolean crossBorderMatch;
@XmlAttribute(name = "DummyPOBox")
protected Boolean dummyPOBox;
@XmlAttribute(name = "Name")
protected Boolean name;
@XmlAttribute(name = "Information")
protected Boolean information;
@XmlAttribute(name = "WarnInformation")
protected Boolean warnInformation;
@XmlAttribute(name = "IncompleteAddr")
protected Boolean incompleteAddr;
@XmlAttribute(name = "UnresolvableRange")
protected Boolean unresolvableRange;
@XmlAttribute(name = "PhantomPrimaryPoint")
protected Boolean phantomPrimaryPoint;
/**
* Obtient la valeur de la propriété moniker.
*
* @return possible object is {@link String }
*/
public String getMoniker() {
return moniker;
}
/**
* Définit la valeur de la propriété moniker.
*
* @param value allowed object is {@link String }
*/
public void setMoniker(String value) {
this.moniker = value;
}
/**
* Obtient la valeur de la propriété partialAddress.
*
* @return possible object is {@link String }
*/
public String getPartialAddress() {
return partialAddress;
}
/**
* Définit la valeur de la propriété partialAddress.
*
* @param value allowed object is {@link String }
*/
public void setPartialAddress(String value) {
this.partialAddress = value;
}
/**
* Obtient la valeur de la propriété picklist.
*
* @return possible object is {@link String }
*/
public String getPicklist() {
return picklist;
}
/**
* Définit la valeur de la propriété picklist.
*
* @param value allowed object is {@link String }
*/
public void setPicklist(String value) {
this.picklist = value;
}
/**
* Obtient la valeur de la propriété postcode.
*
* @return possible object is {@link String }
*/
public String getPostcode() {
return postcode;
}
/**
* Définit la valeur de la propriété postcode.
*
* @param value allowed object is {@link String }
*/
public void setPostcode(String value) {
this.postcode = value;
}
/**
* Obtient la valeur de la propriété score.
*
* @return possible object is {@link BigInteger }
*/
public BigInteger getScore() {
return score;
}
/**
* Définit la valeur de la propriété score.
*
* @param value allowed object is {@link BigInteger }
*/
public void setScore(BigInteger value) {
this.score = value;
}
/**
* Obtient la valeur de la propriété fullAddress.
*
* @return possible object is {@link Boolean }
*/
public boolean isFullAddress() {
if (fullAddress == null) {
return false;
} else {
return fullAddress;
}
}
/**
* Définit la valeur de la propriété fullAddress.
*
* @param value allowed object is {@link Boolean }
*/
public void setFullAddress(Boolean value) {
this.fullAddress = value;
}
/**
* Obtient la valeur de la propriété multiples.
*
* @return possible object is {@link Boolean }
*/
public boolean isMultiples() {
if (multiples == null) {
return false;
} else {
return multiples;
}
}
/**
* Définit la valeur de la propriété multiples.
*
* @param value allowed object is {@link Boolean }
*/
public void setMultiples(Boolean value) {
this.multiples = value;
}
/**
* Obtient la valeur de la propriété canStep.
*
* @return possible object is {@link Boolean }
*/
public boolean isCanStep() {
if (canStep == null) {
return false;
} else {
return canStep;
}
}
/**
* Définit la valeur de la propriété canStep.
*
* @param value allowed object is {@link Boolean }
*/
public void setCanStep(Boolean value) {
this.canStep = value;
}
/**
* Obtient la valeur de la propriété aliasMatch.
*
* @return possible object is {@link Boolean }
*/
public boolean isAliasMatch() {
if (aliasMatch == null) {
return false;
} else {
return aliasMatch;
}
}
/**
* Définit la valeur de la propriété aliasMatch.
*
* @param value allowed object is {@link Boolean }
*/
public void setAliasMatch(Boolean value) {
this.aliasMatch = value;
}
/**
* Obtient la valeur de la propriété postcodeRecoded.
*
* @return possible object is {@link Boolean }
*/
public boolean isPostcodeRecoded() {
if (postcodeRecoded == null) {
return false;
} else {
return postcodeRecoded;
}
}
/**
* Définit la valeur de la propriété postcodeRecoded.
*
* @param value allowed object is {@link Boolean }
*/
public void setPostcodeRecoded(Boolean value) {
this.postcodeRecoded = value;
}
/**
* Obtient la valeur de la propriété crossBorderMatch.
*
* @return possible object is {@link Boolean }
*/
public boolean isCrossBorderMatch() {
if (crossBorderMatch == null) {
return false;
} else {
return crossBorderMatch;
}
}
/**
* Définit la valeur de la propriété crossBorderMatch.
*
* @param value allowed object is {@link Boolean }
*/
public void setCrossBorderMatch(Boolean value) {
this.crossBorderMatch = value;
}
/**
* Obtient la valeur de la propriété dummyPOBox.
*
* @return possible object is {@link Boolean }
*/
public boolean isDummyPOBox() {
if (dummyPOBox == null) {
return false;
} else {
return dummyPOBox;
}
}
/**
* Définit la valeur de la propriété dummyPOBox.
*
* @param value allowed object is {@link Boolean }
*/
public void setDummyPOBox(Boolean value) {
this.dummyPOBox = value;
}
/**
* Obtient la valeur de la propriété name.
*
* @return possible object is {@link Boolean }
*/
public boolean isName() {
if (name == null) {
return false;
} else {
return name;
}
}
/**
* Définit la valeur de la propriété name.
*
* @param value allowed object is {@link Boolean }
*/
public void setName(Boolean value) {
this.name = value;
}
/**
* Obtient la valeur de la propriété information.
*
* @return possible object is {@link Boolean }
*/
public boolean isInformation() {
if (information == null) {
return false;
} else {
return information;
}
}
/**
* Définit la valeur de la propriété information.
*
* @param value allowed object is {@link Boolean }
*/
public void setInformation(Boolean value) {
this.information = value;
}
/**
* Obtient la valeur de la propriété warnInformation.
*
* @return possible object is {@link Boolean }
*/
public boolean isWarnInformation() {
if (warnInformation == null) {
return false;
} else {
return warnInformation;
}
}
/**
* Définit la valeur de la propriété warnInformation.
*
* @param value allowed object is {@link Boolean }
*/
public void setWarnInformation(Boolean value) {
this.warnInformation = value;
}
/**
* Obtient la valeur de la propriété incompleteAddr.
*
* @return possible object is {@link Boolean }
*/
public boolean isIncompleteAddr() {
if (incompleteAddr == null) {
return false;
} else {
return incompleteAddr;
}
}
/**
* Définit la valeur de la propriété incompleteAddr.
*
* @param value allowed object is {@link Boolean }
*/
public void setIncompleteAddr(Boolean value) {
this.incompleteAddr = value;
}
/**
* Obtient la valeur de la propriété unresolvableRange.
*
* @return possible object is {@link Boolean }
*/
public boolean isUnresolvableRange() {
if (unresolvableRange == null) {
return false;
} else {
return unresolvableRange;
}
}
/**
* Définit la valeur de la propriété unresolvableRange.
*
* @param value allowed object is {@link Boolean }
*/
public void setUnresolvableRange(Boolean value) {
this.unresolvableRange = value;
}
/**
* Obtient la valeur de la propriété phantomPrimaryPoint.
*
* @return possible object is {@link Boolean }
*/
public boolean isPhantomPrimaryPoint() {
if (phantomPrimaryPoint == null) {
return false;
} else {
return phantomPrimaryPoint;
}
}
/**
* Définit la valeur de la propriété phantomPrimaryPoint.
*
* @param value allowed object is {@link Boolean }
*/
public void setPhantomPrimaryPoint(Boolean value) {
this.phantomPrimaryPoint = value;
}
}

View File

@ -0,0 +1,86 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
/**
* This class was generated by Apache CXF 2.6.2 2012-09-12T15:14:19.685+02:00 Generated source
* version: 2.6.2
*/
@WebServiceClient(
name = "ProWeb",
wsdlLocation = "http://ip.axelor.com:2021/proweb.wsdl",
targetNamespace = "http://www.qas.com/web-2005-02"
)
public class ProWeb extends Service {
public static final URL WSDL_LOCATION;
public static final QName SERVICE = new QName("http://www.qas.com/web-2005-02", "ProWeb");
public static final QName QAPortType = new QName("http://www.qas.com/web-2005-02", "QAPortType");
static {
URL url = null;
try {
url = new URL("http://ip.axelor.com:2021/proweb.wsdl");
} catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(ProWeb.class.getName())
.log(
java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}",
"http://ip.axelor.com:2021/proweb.wsdl");
}
WSDL_LOCATION = url;
}
public ProWeb(URL wsdlLocation) {
super(wsdlLocation, SERVICE);
}
public ProWeb(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public ProWeb() {
super(WSDL_LOCATION, SERVICE);
}
/** @return returns QAPortType */
@WebEndpoint(name = "QAPortType")
public QAPortType getQAPortType() {
return super.getPort(QAPortType, QAPortType.class);
}
/**
* @param features A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.
* Supported features not in the <code>features</code> parameter will have their default
* values.
* @return returns QAPortType
*/
@WebEndpoint(name = "QAPortType")
public QAPortType getQAPortType(WebServiceFeature... features) {
return super.getPort(QAPortType, QAPortType.class, features);
}
}

View File

@ -0,0 +1,116 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour PromptLine complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="PromptLine">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Prompt" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="SuggestedInputLength" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger"/>
* &lt;element name="Example" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "PromptLine",
propOrder = {"prompt", "suggestedInputLength", "example"}
)
public class PromptLine {
@XmlElement(name = "Prompt", required = true)
protected String prompt;
@XmlElement(name = "SuggestedInputLength", required = true)
@XmlSchemaType(name = "nonNegativeInteger")
protected BigInteger suggestedInputLength;
@XmlElement(name = "Example", required = true)
protected String example;
/**
* Obtient la valeur de la propriété prompt.
*
* @return possible object is {@link String }
*/
public String getPrompt() {
return prompt;
}
/**
* Définit la valeur de la propriété prompt.
*
* @param value allowed object is {@link String }
*/
public void setPrompt(String value) {
this.prompt = value;
}
/**
* Obtient la valeur de la propriété suggestedInputLength.
*
* @return possible object is {@link BigInteger }
*/
public BigInteger getSuggestedInputLength() {
return suggestedInputLength;
}
/**
* Définit la valeur de la propriété suggestedInputLength.
*
* @param value allowed object is {@link BigInteger }
*/
public void setSuggestedInputLength(BigInteger value) {
this.suggestedInputLength = value;
}
/**
* Obtient la valeur de la propriété example.
*
* @return possible object is {@link String }
*/
public String getExample() {
return example;
}
/**
* Définit la valeur de la propriété example.
*
* @param value allowed object is {@link String }
*/
public void setExample(String value) {
this.example = value;
}
}

View File

@ -0,0 +1,80 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour PromptSetType.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <p>
*
* <pre>
* &lt;simpleType name="PromptSetType">
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="OneLine"/>
* &lt;enumeration value="Default"/>
* &lt;enumeration value="Generic"/>
* &lt;enumeration value="Optimal"/>
* &lt;enumeration value="Alternate"/>
* &lt;enumeration value="Alternate2"/>
* &lt;enumeration value="Alternate3"/>
* &lt;/restriction>
* &lt;/simpleType>
* </pre>
*/
@XmlType(name = "PromptSetType")
@XmlEnum
public enum PromptSetType {
@XmlEnumValue("OneLine")
ONE_LINE("OneLine"),
@XmlEnumValue("Default")
DEFAULT("Default"),
@XmlEnumValue("Generic")
GENERIC("Generic"),
@XmlEnumValue("Optimal")
OPTIMAL("Optimal"),
@XmlEnumValue("Alternate")
ALTERNATE("Alternate"),
@XmlEnumValue("Alternate2")
ALTERNATE_2("Alternate2"),
@XmlEnumValue("Alternate3")
ALTERNATE_3("Alternate3");
private final String value;
PromptSetType(String v) {
value = v;
}
public String value() {
return value;
}
public static PromptSetType fromValue(String v) {
for (PromptSetType c : PromptSetType.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}

View File

@ -0,0 +1,128 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour QAAddressType complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="QAAddressType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="AddressLine" type="{http://www.qas.com/web-2005-02}AddressLineType" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;attribute name="Overflow" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="Truncated" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "QAAddressType",
propOrder = {"addressLine"}
)
public class QAAddressType {
@XmlElement(name = "AddressLine", required = true)
protected List<AddressLineType> addressLine;
@XmlAttribute(name = "Overflow")
protected Boolean overflow;
@XmlAttribute(name = "Truncated")
protected Boolean truncated;
/**
* Gets the value of the addressLine property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the addressLine property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getAddressLine().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link AddressLineType }
*/
public List<AddressLineType> getAddressLine() {
if (addressLine == null) {
addressLine = new ArrayList<AddressLineType>();
}
return this.addressLine;
}
/**
* Obtient la valeur de la propriété overflow.
*
* @return possible object is {@link Boolean }
*/
public boolean isOverflow() {
if (overflow == null) {
return false;
} else {
return overflow;
}
}
/**
* Définit la valeur de la propriété overflow.
*
* @param value allowed object is {@link Boolean }
*/
public void setOverflow(Boolean value) {
this.overflow = value;
}
/**
* Obtient la valeur de la propriété truncated.
*
* @return possible object is {@link Boolean }
*/
public boolean isTruncated() {
if (truncated == null) {
return false;
} else {
return truncated;
}
}
/**
* Définit la valeur de la propriété truncated.
*
* @param value allowed object is {@link Boolean }
*/
public void setTruncated(Boolean value) {
this.truncated = value;
}
}

View File

@ -0,0 +1,137 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Country" type="{http://www.qas.com/web-2005-02}ISOType"/>
* &lt;element name="Engine" type="{http://www.qas.com/web-2005-02}EngineType"/>
* &lt;element name="Layout" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="QAConfig" type="{http://www.qas.com/web-2005-02}QAConfigType" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"country", "engine", "layout", "qaConfig"}
)
@XmlRootElement(name = "QACanSearch")
public class QACanSearch {
@XmlElement(name = "Country", required = true)
protected String country;
@XmlElement(name = "Engine", required = true)
protected EngineType engine;
@XmlElement(name = "Layout")
protected String layout;
@XmlElement(name = "QAConfig")
protected QAConfigType qaConfig;
/**
* Obtient la valeur de la propriété country.
*
* @return possible object is {@link String }
*/
public String getCountry() {
return country;
}
/**
* Définit la valeur de la propriété country.
*
* @param value allowed object is {@link String }
*/
public void setCountry(String value) {
this.country = value;
}
/**
* Obtient la valeur de la propriété engine.
*
* @return possible object is {@link EngineType }
*/
public EngineType getEngine() {
return engine;
}
/**
* Définit la valeur de la propriété engine.
*
* @param value allowed object is {@link EngineType }
*/
public void setEngine(EngineType value) {
this.engine = value;
}
/**
* Obtient la valeur de la propriété layout.
*
* @return possible object is {@link String }
*/
public String getLayout() {
return layout;
}
/**
* Définit la valeur de la propriété layout.
*
* @param value allowed object is {@link String }
*/
public void setLayout(String value) {
this.layout = value;
}
/**
* Obtient la valeur de la propriété qaConfig.
*
* @return possible object is {@link QAConfigType }
*/
public QAConfigType getQAConfig() {
return qaConfig;
}
/**
* Définit la valeur de la propriété qaConfig.
*
* @param value allowed object is {@link QAConfigType }
*/
public void setQAConfig(QAConfigType value) {
this.qaConfig = value;
}
}

View File

@ -0,0 +1,91 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour QAConfigType complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="QAConfigType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="IniFile" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="IniSection" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "QAConfigType",
propOrder = {"iniFile", "iniSection"}
)
public class QAConfigType {
@XmlElement(name = "IniFile")
protected String iniFile;
@XmlElement(name = "IniSection")
protected String iniSection;
/**
* Obtient la valeur de la propriété iniFile.
*
* @return possible object is {@link String }
*/
public String getIniFile() {
return iniFile;
}
/**
* Définit la valeur de la propriété iniFile.
*
* @param value allowed object is {@link String }
*/
public void setIniFile(String value) {
this.iniFile = value;
}
/**
* Obtient la valeur de la propriété iniSection.
*
* @return possible object is {@link String }
*/
public String getIniSection() {
return iniSection;
}
/**
* Définit la valeur de la propriété iniSection.
*
* @param value allowed object is {@link String }
*/
public void setIniSection(String value) {
this.iniSection = value;
}
}

View File

@ -0,0 +1,77 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="DataSet" type="{http://www.qas.com/web-2005-02}QADataSet" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"dataSet"}
)
@XmlRootElement(name = "QAData")
public class QAData {
@XmlElement(name = "DataSet")
protected List<QADataSet> dataSet;
/**
* Gets the value of the dataSet property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the dataSet property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getDataSet().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link QADataSet }
*/
public List<QADataSet> getDataSet() {
if (dataSet == null) {
dataSet = new ArrayList<QADataSet>();
}
return this.dataSet;
}
}

View File

@ -0,0 +1,91 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour QADataSet complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="QADataSet">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="ID" type="{http://www.qas.com/web-2005-02}ISOType"/>
* &lt;element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "QADataSet",
propOrder = {"id", "name"}
)
public class QADataSet {
@XmlElement(name = "ID", required = true)
protected String id;
@XmlElement(name = "Name", required = true)
protected String name;
/**
* Obtient la valeur de la propriété id.
*
* @return possible object is {@link String }
*/
public String getID() {
return id;
}
/**
* Définit la valeur de la propriété id.
*
* @param value allowed object is {@link String }
*/
public void setID(String value) {
this.id = value;
}
/**
* Obtient la valeur de la propriété name.
*
* @return possible object is {@link String }
*/
public String getName() {
return name;
}
/**
* Définit la valeur de la propriété name.
*
* @param value allowed object is {@link String }
*/
public void setName(String value) {
this.name = value;
}
}

View File

@ -0,0 +1,91 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour QAExampleAddress complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="QAExampleAddress">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Address" type="{http://www.qas.com/web-2005-02}QAAddressType"/>
* &lt;element name="Comment" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "QAExampleAddress",
propOrder = {"address", "comment"}
)
public class QAExampleAddress {
@XmlElement(name = "Address", required = true)
protected QAAddressType address;
@XmlElement(name = "Comment", required = true)
protected String comment;
/**
* Obtient la valeur de la propriété address.
*
* @return possible object is {@link QAAddressType }
*/
public QAAddressType getAddress() {
return address;
}
/**
* Définit la valeur de la propriété address.
*
* @param value allowed object is {@link QAAddressType }
*/
public void setAddress(QAAddressType value) {
this.address = value;
}
/**
* Obtient la valeur de la propriété comment.
*
* @return possible object is {@link String }
*/
public String getComment() {
return comment;
}
/**
* Définit la valeur de la propriété comment.
*
* @param value allowed object is {@link String }
*/
public void setComment(String value) {
this.comment = value;
}
}

View File

@ -0,0 +1,77 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="ExampleAddress" type="{http://www.qas.com/web-2005-02}QAExampleAddress" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"exampleAddress"}
)
@XmlRootElement(name = "QAExampleAddresses")
public class QAExampleAddresses {
@XmlElement(name = "ExampleAddress")
protected List<QAExampleAddress> exampleAddress;
/**
* Gets the value of the exampleAddress property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the exampleAddress property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getExampleAddress().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link QAExampleAddress }
*/
public List<QAExampleAddress> getExampleAddress() {
if (exampleAddress == null) {
exampleAddress = new ArrayList<QAExampleAddress>();
}
return this.exampleAddress;
}
}

View File

@ -0,0 +1,93 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="ErrorCode" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="ErrorMessage" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"errorCode", "errorMessage"}
)
@XmlRootElement(name = "QAFault")
public class QAFault {
@XmlElement(name = "ErrorCode", required = true)
protected String errorCode;
@XmlElement(name = "ErrorMessage", required = true)
protected String errorMessage;
/**
* Obtient la valeur de la propriété errorCode.
*
* @return possible object is {@link String }
*/
public String getErrorCode() {
return errorCode;
}
/**
* Définit la valeur de la propriété errorCode.
*
* @param value allowed object is {@link String }
*/
public void setErrorCode(String value) {
this.errorCode = value;
}
/**
* Obtient la valeur de la propriété errorMessage.
*
* @return possible object is {@link String }
*/
public String getErrorMessage() {
return errorMessage;
}
/**
* Définit la valeur de la propriété errorMessage.
*
* @param value allowed object is {@link String }
*/
public void setErrorMessage(String value) {
this.errorMessage = value;
}
}

View File

@ -0,0 +1,115 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Layout" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Moniker" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="QAConfig" type="{http://www.qas.com/web-2005-02}QAConfigType" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"layout", "moniker", "qaConfig"}
)
@XmlRootElement(name = "QAGetAddress")
public class QAGetAddress {
@XmlElement(name = "Layout", required = true)
protected String layout;
@XmlElement(name = "Moniker", required = true)
protected String moniker;
@XmlElement(name = "QAConfig")
protected QAConfigType qaConfig;
/**
* Obtient la valeur de la propriété layout.
*
* @return possible object is {@link String }
*/
public String getLayout() {
return layout;
}
/**
* Définit la valeur de la propriété layout.
*
* @param value allowed object is {@link String }
*/
public void setLayout(String value) {
this.layout = value;
}
/**
* Obtient la valeur de la propriété moniker.
*
* @return possible object is {@link String }
*/
public String getMoniker() {
return moniker;
}
/**
* Définit la valeur de la propriété moniker.
*
* @param value allowed object is {@link String }
*/
public void setMoniker(String value) {
this.moniker = value;
}
/**
* Obtient la valeur de la propriété qaConfig.
*
* @return possible object is {@link QAConfigType }
*/
public QAConfigType getQAConfig() {
return qaConfig;
}
/**
* Définit la valeur de la propriété qaConfig.
*
* @param value allowed object is {@link QAConfigType }
*/
public void setQAConfig(QAConfigType value) {
this.qaConfig = value;
}
}

View File

@ -0,0 +1,115 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Country" type="{http://www.qas.com/web-2005-02}ISOType"/>
* &lt;element name="Layout" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="QAConfig" type="{http://www.qas.com/web-2005-02}QAConfigType" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"country", "layout", "qaConfig"}
)
@XmlRootElement(name = "QAGetExampleAddresses")
public class QAGetExampleAddresses {
@XmlElement(name = "Country", required = true)
protected String country;
@XmlElement(name = "Layout", required = true)
protected String layout;
@XmlElement(name = "QAConfig")
protected QAConfigType qaConfig;
/**
* Obtient la valeur de la propriété country.
*
* @return possible object is {@link String }
*/
public String getCountry() {
return country;
}
/**
* Définit la valeur de la propriété country.
*
* @param value allowed object is {@link String }
*/
public void setCountry(String value) {
this.country = value;
}
/**
* Obtient la valeur de la propriété layout.
*
* @return possible object is {@link String }
*/
public String getLayout() {
return layout;
}
/**
* Définit la valeur de la propriété layout.
*
* @param value allowed object is {@link String }
*/
public void setLayout(String value) {
this.layout = value;
}
/**
* Obtient la valeur de la propriété qaConfig.
*
* @return possible object is {@link QAConfigType }
*/
public QAConfigType getQAConfig() {
return qaConfig;
}
/**
* Définit la valeur de la propriété qaConfig.
*
* @param value allowed object is {@link QAConfigType }
*/
public void setQAConfig(QAConfigType value) {
this.qaConfig = value;
}
}

View File

@ -0,0 +1,93 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Country" type="{http://www.qas.com/web-2005-02}ISOType"/>
* &lt;element name="QAConfig" type="{http://www.qas.com/web-2005-02}QAConfigType" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"country", "qaConfig"}
)
@XmlRootElement(name = "QAGetLayouts")
public class QAGetLayouts {
@XmlElement(name = "Country", required = true)
protected String country;
@XmlElement(name = "QAConfig")
protected QAConfigType qaConfig;
/**
* Obtient la valeur de la propriété country.
*
* @return possible object is {@link String }
*/
public String getCountry() {
return country;
}
/**
* Définit la valeur de la propriété country.
*
* @param value allowed object is {@link String }
*/
public void setCountry(String value) {
this.country = value;
}
/**
* Obtient la valeur de la propriété qaConfig.
*
* @return possible object is {@link QAConfigType }
*/
public QAConfigType getQAConfig() {
return qaConfig;
}
/**
* Définit la valeur de la propriété qaConfig.
*
* @param value allowed object is {@link QAConfigType }
*/
public void setQAConfig(QAConfigType value) {
this.qaConfig = value;
}
}

View File

@ -0,0 +1,137 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Country" type="{http://www.qas.com/web-2005-02}ISOType"/>
* &lt;element name="Engine" type="{http://www.qas.com/web-2005-02}EngineType" minOccurs="0"/>
* &lt;element name="PromptSet" type="{http://www.qas.com/web-2005-02}PromptSetType"/>
* &lt;element name="QAConfig" type="{http://www.qas.com/web-2005-02}QAConfigType" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"country", "engine", "promptSet", "qaConfig"}
)
@XmlRootElement(name = "QAGetPromptSet")
public class QAGetPromptSet {
@XmlElement(name = "Country", required = true)
protected String country;
@XmlElement(name = "Engine")
protected EngineType engine;
@XmlElement(name = "PromptSet", required = true)
protected PromptSetType promptSet;
@XmlElement(name = "QAConfig")
protected QAConfigType qaConfig;
/**
* Obtient la valeur de la propriété country.
*
* @return possible object is {@link String }
*/
public String getCountry() {
return country;
}
/**
* Définit la valeur de la propriété country.
*
* @param value allowed object is {@link String }
*/
public void setCountry(String value) {
this.country = value;
}
/**
* Obtient la valeur de la propriété engine.
*
* @return possible object is {@link EngineType }
*/
public EngineType getEngine() {
return engine;
}
/**
* Définit la valeur de la propriété engine.
*
* @param value allowed object is {@link EngineType }
*/
public void setEngine(EngineType value) {
this.engine = value;
}
/**
* Obtient la valeur de la propriété promptSet.
*
* @return possible object is {@link PromptSetType }
*/
public PromptSetType getPromptSet() {
return promptSet;
}
/**
* Définit la valeur de la propriété promptSet.
*
* @param value allowed object is {@link PromptSetType }
*/
public void setPromptSet(PromptSetType value) {
this.promptSet = value;
}
/**
* Obtient la valeur de la propriété qaConfig.
*
* @return possible object is {@link QAConfigType }
*/
public QAConfigType getQAConfig() {
return qaConfig;
}
/**
* Définit la valeur de la propriété qaConfig.
*
* @param value allowed object is {@link QAConfigType }
*/
public void setQAConfig(QAConfigType value) {
this.qaConfig = value;
}
}

View File

@ -0,0 +1,91 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour QALayout complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="QALayout">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Comment" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "QALayout",
propOrder = {"name", "comment"}
)
public class QALayout {
@XmlElement(name = "Name", required = true)
protected String name;
@XmlElement(name = "Comment", required = true)
protected String comment;
/**
* Obtient la valeur de la propriété name.
*
* @return possible object is {@link String }
*/
public String getName() {
return name;
}
/**
* Définit la valeur de la propriété name.
*
* @param value allowed object is {@link String }
*/
public void setName(String value) {
this.name = value;
}
/**
* Obtient la valeur de la propriété comment.
*
* @return possible object is {@link String }
*/
public String getComment() {
return comment;
}
/**
* Définit la valeur de la propriété comment.
*
* @param value allowed object is {@link String }
*/
public void setComment(String value) {
this.comment = value;
}
}

View File

@ -0,0 +1,77 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Layout" type="{http://www.qas.com/web-2005-02}QALayout" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"layout"}
)
@XmlRootElement(name = "QALayouts")
public class QALayouts {
@XmlElement(name = "Layout")
protected List<QALayout> layout;
/**
* Gets the value of the layout property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the layout property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getLayout().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link QALayout }
*/
public List<QALayout> getLayout() {
if (layout == null) {
layout = new ArrayList<QALayout>();
}
return this.layout;
}
}

View File

@ -0,0 +1,99 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="WarningLevel" type="{http://www.qas.com/web-2005-02}LicenceWarningLevel"/>
* &lt;element name="LicensedSet" type="{http://www.qas.com/web-2005-02}QALicensedSet" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"warningLevel", "licensedSet"}
)
@XmlRootElement(name = "QALicenceInfo")
public class QALicenceInfo {
@XmlElement(name = "WarningLevel", required = true)
protected LicenceWarningLevel warningLevel;
@XmlElement(name = "LicensedSet")
protected List<QALicensedSet> licensedSet;
/**
* Obtient la valeur de la propriété warningLevel.
*
* @return possible object is {@link LicenceWarningLevel }
*/
public LicenceWarningLevel getWarningLevel() {
return warningLevel;
}
/**
* Définit la valeur de la propriété warningLevel.
*
* @param value allowed object is {@link LicenceWarningLevel }
*/
public void setWarningLevel(LicenceWarningLevel value) {
this.warningLevel = value;
}
/**
* Gets the value of the licensedSet property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the licensedSet property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getLicensedSet().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link QALicensedSet }
*/
public List<QALicensedSet> getLicensedSet() {
if (licensedSet == null) {
licensedSet = new ArrayList<QALicensedSet>();
}
return this.licensedSet;
}
}

View File

@ -0,0 +1,306 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour QALicensedSet complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="QALicensedSet">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="ID" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Description" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Copyright" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Version" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="BaseCountry" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Status" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Server" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="WarningLevel" type="{http://www.qas.com/web-2005-02}LicenceWarningLevel"/>
* &lt;element name="DaysLeft" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger"/>
* &lt;element name="DataDaysLeft" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger"/>
* &lt;element name="LicenceDaysLeft" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "QALicensedSet",
propOrder = {
"id",
"description",
"copyright",
"version",
"baseCountry",
"status",
"server",
"warningLevel",
"daysLeft",
"dataDaysLeft",
"licenceDaysLeft"
}
)
public class QALicensedSet {
@XmlElement(name = "ID", required = true)
protected String id;
@XmlElement(name = "Description", required = true)
protected String description;
@XmlElement(name = "Copyright", required = true)
protected String copyright;
@XmlElement(name = "Version", required = true)
protected String version;
@XmlElement(name = "BaseCountry", required = true)
protected String baseCountry;
@XmlElement(name = "Status", required = true)
protected String status;
@XmlElement(name = "Server", required = true)
protected String server;
@XmlElement(name = "WarningLevel", required = true)
protected LicenceWarningLevel warningLevel;
@XmlElement(name = "DaysLeft", required = true)
@XmlSchemaType(name = "nonNegativeInteger")
protected BigInteger daysLeft;
@XmlElement(name = "DataDaysLeft", required = true)
@XmlSchemaType(name = "nonNegativeInteger")
protected BigInteger dataDaysLeft;
@XmlElement(name = "LicenceDaysLeft", required = true)
@XmlSchemaType(name = "nonNegativeInteger")
protected BigInteger licenceDaysLeft;
/**
* Obtient la valeur de la propriété id.
*
* @return possible object is {@link String }
*/
public String getID() {
return id;
}
/**
* Définit la valeur de la propriété id.
*
* @param value allowed object is {@link String }
*/
public void setID(String value) {
this.id = value;
}
/**
* Obtient la valeur de la propriété description.
*
* @return possible object is {@link String }
*/
public String getDescription() {
return description;
}
/**
* Définit la valeur de la propriété description.
*
* @param value allowed object is {@link String }
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Obtient la valeur de la propriété copyright.
*
* @return possible object is {@link String }
*/
public String getCopyright() {
return copyright;
}
/**
* Définit la valeur de la propriété copyright.
*
* @param value allowed object is {@link String }
*/
public void setCopyright(String value) {
this.copyright = value;
}
/**
* Obtient la valeur de la propriété version.
*
* @return possible object is {@link String }
*/
public String getVersion() {
return version;
}
/**
* Définit la valeur de la propriété version.
*
* @param value allowed object is {@link String }
*/
public void setVersion(String value) {
this.version = value;
}
/**
* Obtient la valeur de la propriété baseCountry.
*
* @return possible object is {@link String }
*/
public String getBaseCountry() {
return baseCountry;
}
/**
* Définit la valeur de la propriété baseCountry.
*
* @param value allowed object is {@link String }
*/
public void setBaseCountry(String value) {
this.baseCountry = value;
}
/**
* Obtient la valeur de la propriété status.
*
* @return possible object is {@link String }
*/
public String getStatus() {
return status;
}
/**
* Définit la valeur de la propriété status.
*
* @param value allowed object is {@link String }
*/
public void setStatus(String value) {
this.status = value;
}
/**
* Obtient la valeur de la propriété server.
*
* @return possible object is {@link String }
*/
public String getServer() {
return server;
}
/**
* Définit la valeur de la propriété server.
*
* @param value allowed object is {@link String }
*/
public void setServer(String value) {
this.server = value;
}
/**
* Obtient la valeur de la propriété warningLevel.
*
* @return possible object is {@link LicenceWarningLevel }
*/
public LicenceWarningLevel getWarningLevel() {
return warningLevel;
}
/**
* Définit la valeur de la propriété warningLevel.
*
* @param value allowed object is {@link LicenceWarningLevel }
*/
public void setWarningLevel(LicenceWarningLevel value) {
this.warningLevel = value;
}
/**
* Obtient la valeur de la propriété daysLeft.
*
* @return possible object is {@link BigInteger }
*/
public BigInteger getDaysLeft() {
return daysLeft;
}
/**
* Définit la valeur de la propriété daysLeft.
*
* @param value allowed object is {@link BigInteger }
*/
public void setDaysLeft(BigInteger value) {
this.daysLeft = value;
}
/**
* Obtient la valeur de la propriété dataDaysLeft.
*
* @return possible object is {@link BigInteger }
*/
public BigInteger getDataDaysLeft() {
return dataDaysLeft;
}
/**
* Définit la valeur de la propriété dataDaysLeft.
*
* @param value allowed object is {@link BigInteger }
*/
public void setDataDaysLeft(BigInteger value) {
this.dataDaysLeft = value;
}
/**
* Obtient la valeur de la propriété licenceDaysLeft.
*
* @return possible object is {@link BigInteger }
*/
public BigInteger getLicenceDaysLeft() {
return licenceDaysLeft;
}
/**
* Définit la valeur de la propriété licenceDaysLeft.
*
* @param value allowed object is {@link BigInteger }
*/
public void setLicenceDaysLeft(BigInteger value) {
this.licenceDaysLeft = value;
}
}

View File

@ -0,0 +1,379 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour QAPicklistType complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType name="QAPicklistType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="FullPicklistMoniker" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="PicklistEntry" type="{http://www.qas.com/web-2005-02}PicklistEntryType" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element name="Prompt" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Total" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger"/>
* &lt;/sequence>
* &lt;attribute name="AutoFormatSafe" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="AutoFormatPastClose" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="AutoStepinSafe" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="AutoStepinPastClose" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="LargePotential" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="MaxMatches" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="MoreOtherMatches" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="OverThreshold" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="Timeout" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "QAPicklistType",
propOrder = {"fullPicklistMoniker", "picklistEntry", "prompt", "total"}
)
public class QAPicklistType {
@XmlElement(name = "FullPicklistMoniker", required = true)
protected String fullPicklistMoniker;
@XmlElement(name = "PicklistEntry")
protected List<PicklistEntryType> picklistEntry;
@XmlElement(name = "Prompt", required = true)
protected String prompt;
@XmlElement(name = "Total", required = true)
@XmlSchemaType(name = "nonNegativeInteger")
protected BigInteger total;
@XmlAttribute(name = "AutoFormatSafe")
protected Boolean autoFormatSafe;
@XmlAttribute(name = "AutoFormatPastClose")
protected Boolean autoFormatPastClose;
@XmlAttribute(name = "AutoStepinSafe")
protected Boolean autoStepinSafe;
@XmlAttribute(name = "AutoStepinPastClose")
protected Boolean autoStepinPastClose;
@XmlAttribute(name = "LargePotential")
protected Boolean largePotential;
@XmlAttribute(name = "MaxMatches")
protected Boolean maxMatches;
@XmlAttribute(name = "MoreOtherMatches")
protected Boolean moreOtherMatches;
@XmlAttribute(name = "OverThreshold")
protected Boolean overThreshold;
@XmlAttribute(name = "Timeout")
protected Boolean timeout;
/**
* Obtient la valeur de la propriété fullPicklistMoniker.
*
* @return possible object is {@link String }
*/
public String getFullPicklistMoniker() {
return fullPicklistMoniker;
}
/**
* Définit la valeur de la propriété fullPicklistMoniker.
*
* @param value allowed object is {@link String }
*/
public void setFullPicklistMoniker(String value) {
this.fullPicklistMoniker = value;
}
/**
* Gets the value of the picklistEntry property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the picklistEntry property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getPicklistEntry().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link PicklistEntryType }
*/
public List<PicklistEntryType> getPicklistEntry() {
if (picklistEntry == null) {
picklistEntry = new ArrayList<PicklistEntryType>();
}
return this.picklistEntry;
}
/**
* Obtient la valeur de la propriété prompt.
*
* @return possible object is {@link String }
*/
public String getPrompt() {
return prompt;
}
/**
* Définit la valeur de la propriété prompt.
*
* @param value allowed object is {@link String }
*/
public void setPrompt(String value) {
this.prompt = value;
}
/**
* Obtient la valeur de la propriété total.
*
* @return possible object is {@link BigInteger }
*/
public BigInteger getTotal() {
return total;
}
/**
* Définit la valeur de la propriété total.
*
* @param value allowed object is {@link BigInteger }
*/
public void setTotal(BigInteger value) {
this.total = value;
}
/**
* Obtient la valeur de la propriété autoFormatSafe.
*
* @return possible object is {@link Boolean }
*/
public boolean isAutoFormatSafe() {
if (autoFormatSafe == null) {
return false;
} else {
return autoFormatSafe;
}
}
/**
* Définit la valeur de la propriété autoFormatSafe.
*
* @param value allowed object is {@link Boolean }
*/
public void setAutoFormatSafe(Boolean value) {
this.autoFormatSafe = value;
}
/**
* Obtient la valeur de la propriété autoFormatPastClose.
*
* @return possible object is {@link Boolean }
*/
public boolean isAutoFormatPastClose() {
if (autoFormatPastClose == null) {
return false;
} else {
return autoFormatPastClose;
}
}
/**
* Définit la valeur de la propriété autoFormatPastClose.
*
* @param value allowed object is {@link Boolean }
*/
public void setAutoFormatPastClose(Boolean value) {
this.autoFormatPastClose = value;
}
/**
* Obtient la valeur de la propriété autoStepinSafe.
*
* @return possible object is {@link Boolean }
*/
public boolean isAutoStepinSafe() {
if (autoStepinSafe == null) {
return false;
} else {
return autoStepinSafe;
}
}
/**
* Définit la valeur de la propriété autoStepinSafe.
*
* @param value allowed object is {@link Boolean }
*/
public void setAutoStepinSafe(Boolean value) {
this.autoStepinSafe = value;
}
/**
* Obtient la valeur de la propriété autoStepinPastClose.
*
* @return possible object is {@link Boolean }
*/
public boolean isAutoStepinPastClose() {
if (autoStepinPastClose == null) {
return false;
} else {
return autoStepinPastClose;
}
}
/**
* Définit la valeur de la propriété autoStepinPastClose.
*
* @param value allowed object is {@link Boolean }
*/
public void setAutoStepinPastClose(Boolean value) {
this.autoStepinPastClose = value;
}
/**
* Obtient la valeur de la propriété largePotential.
*
* @return possible object is {@link Boolean }
*/
public boolean isLargePotential() {
if (largePotential == null) {
return false;
} else {
return largePotential;
}
}
/**
* Définit la valeur de la propriété largePotential.
*
* @param value allowed object is {@link Boolean }
*/
public void setLargePotential(Boolean value) {
this.largePotential = value;
}
/**
* Obtient la valeur de la propriété maxMatches.
*
* @return possible object is {@link Boolean }
*/
public boolean isMaxMatches() {
if (maxMatches == null) {
return false;
} else {
return maxMatches;
}
}
/**
* Définit la valeur de la propriété maxMatches.
*
* @param value allowed object is {@link Boolean }
*/
public void setMaxMatches(Boolean value) {
this.maxMatches = value;
}
/**
* Obtient la valeur de la propriété moreOtherMatches.
*
* @return possible object is {@link Boolean }
*/
public boolean isMoreOtherMatches() {
if (moreOtherMatches == null) {
return false;
} else {
return moreOtherMatches;
}
}
/**
* Définit la valeur de la propriété moreOtherMatches.
*
* @param value allowed object is {@link Boolean }
*/
public void setMoreOtherMatches(Boolean value) {
this.moreOtherMatches = value;
}
/**
* Obtient la valeur de la propriété overThreshold.
*
* @return possible object is {@link Boolean }
*/
public boolean isOverThreshold() {
if (overThreshold == null) {
return false;
} else {
return overThreshold;
}
}
/**
* Définit la valeur de la propriété overThreshold.
*
* @param value allowed object is {@link Boolean }
*/
public void setOverThreshold(Boolean value) {
this.overThreshold = value;
}
/**
* Obtient la valeur de la propriété timeout.
*
* @return possible object is {@link Boolean }
*/
public boolean isTimeout() {
if (timeout == null) {
return false;
} else {
return timeout;
}
}
/**
* Définit la valeur de la propriété timeout.
*
* @param value allowed object is {@link Boolean }
*/
public void setTimeout(Boolean value) {
this.timeout = value;
}
}

View File

@ -0,0 +1,172 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.XmlSeeAlso;
/**
* This class was generated by Apache CXF 2.6.2 2012-09-12T15:14:19.675+02:00 Generated source
* version: 2.6.2
*/
@WebService(targetNamespace = "http://www.qas.com/web-2005-02", name = "QAPortType")
@XmlSeeAlso({ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface QAPortType {
@WebResult(
name = "QALicenceInfo",
targetNamespace = "http://www.qas.com/web-2005-02",
partName = "body"
)
@WebMethod(
operationName = "DoGetLicenseInfo",
action = "http://www.qas.com/web-2005-02/DoGetLicenseInfo"
)
public QALicenceInfo doGetLicenseInfo() throws Fault;
@WebResult(name = "QAData", targetNamespace = "http://www.qas.com/web-2005-02", partName = "body")
@WebMethod(operationName = "DoGetData", action = "http://www.qas.com/web-2005-02/DoGetData")
public QAData doGetData() throws Fault;
@WebResult(
name = "QAExampleAddresses",
targetNamespace = "http://www.qas.com/web-2005-02",
partName = "body"
)
@WebMethod(
operationName = "DoGetExampleAddresses",
action = "http://www.qas.com/web-2005-02/DoGetExampleAddresses"
)
public QAExampleAddresses doGetExampleAddresses(
@WebParam(
partName = "body",
name = "QAGetExampleAddresses",
targetNamespace = "http://www.qas.com/web-2005-02"
)
QAGetExampleAddresses body)
throws Fault;
@WebResult(
name = "Picklist",
targetNamespace = "http://www.qas.com/web-2005-02",
partName = "body"
)
@WebMethod(operationName = "DoRefine", action = "http://www.qas.com/web-2005-02/DoRefine")
public Picklist doRefine(
@WebParam(
partName = "body",
name = "QARefine",
targetNamespace = "http://www.qas.com/web-2005-02"
)
QARefine body)
throws Fault;
@WebResult(
name = "Address",
targetNamespace = "http://www.qas.com/web-2005-02",
partName = "body"
)
@WebMethod(operationName = "DoGetAddress", action = "http://www.qas.com/web-2005-02/DoGetAddress")
public Address doGetAddress(
@WebParam(
partName = "body",
name = "QAGetAddress",
targetNamespace = "http://www.qas.com/web-2005-02"
)
QAGetAddress body)
throws Fault;
@WebResult(
name = "QASearchResult",
targetNamespace = "http://www.qas.com/web-2005-02",
partName = "body"
)
@WebMethod(operationName = "DoSearch", action = "http://www.qas.com/web-2005-02/DoSearch")
public QASearchResult doSearch(
@WebParam(
partName = "body",
name = "QASearch",
targetNamespace = "http://www.qas.com/web-2005-02"
)
QASearch body)
throws Fault;
@WebResult(
name = "QASearchOk",
targetNamespace = "http://www.qas.com/web-2005-02",
partName = "body"
)
@WebMethod(operationName = "DoCanSearch", action = "http://www.qas.com/web-2005-02/DoCanSearch")
public QASearchOk doCanSearch(
@WebParam(
partName = "body",
name = "QACanSearch",
targetNamespace = "http://www.qas.com/web-2005-02"
)
QACanSearch body)
throws Fault;
@WebResult(
name = "QALayouts",
targetNamespace = "http://www.qas.com/web-2005-02",
partName = "body"
)
@WebMethod(operationName = "DoGetLayouts", action = "http://www.qas.com/web-2005-02/DoGetLayouts")
public QALayouts doGetLayouts(
@WebParam(
partName = "body",
name = "QAGetLayouts",
targetNamespace = "http://www.qas.com/web-2005-02"
)
QAGetLayouts body)
throws Fault;
@WebResult(
name = "QAPromptSet",
targetNamespace = "http://www.qas.com/web-2005-02",
partName = "body"
)
@WebMethod(
operationName = "DoGetPromptSet",
action = "http://www.qas.com/web-2005-02/DoGetPromptSet"
)
public QAPromptSet doGetPromptSet(
@WebParam(
partName = "body",
name = "QAGetPromptSet",
targetNamespace = "http://www.qas.com/web-2005-02"
)
QAGetPromptSet body)
throws Fault;
@WebResult(
name = "QASystemInfo",
targetNamespace = "http://www.qas.com/web-2005-02",
partName = "body"
)
@WebMethod(
operationName = "DoGetSystemInfo",
action = "http://www.qas.com/web-2005-02/DoGetSystemInfo"
)
public QASystemInfo doGetSystemInfo() throws Fault;
}

View File

@ -0,0 +1,177 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
/** Please modify this class to meet your needs This class is not complete */
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
/**
* This class was generated by Apache CXF 2.6.2 2012-09-12T15:14:19.614+02:00 Generated source
* version: 2.6.2
*/
public final class QAPortType_QAPortType_Client {
private static final QName SERVICE_NAME = new QName("http://www.qas.com/web-2005-02", "ProWeb");
private QAPortType_QAPortType_Client() {}
public static void main(String args[]) throws java.lang.Exception {
URL wsdlURL = ProWeb.WSDL_LOCATION;
if (args.length > 0 && args[0] != null && !"".equals(args[0])) {
File wsdlFile = new File(args[0]);
try {
if (wsdlFile.exists()) {
wsdlURL = wsdlFile.toURI().toURL();
} else {
wsdlURL = new URL(args[0]);
}
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
ProWeb ss = new ProWeb(wsdlURL, SERVICE_NAME);
QAPortType port = ss.getQAPortType();
{
System.out.println("Invoking doGetLicenseInfo...");
try {
com.qas.web_2005_02.QALicenceInfo _doGetLicenseInfo__return = port.doGetLicenseInfo();
System.out.println("doGetLicenseInfo.result=" + _doGetLicenseInfo__return);
} catch (Fault e) {
System.out.println("Expected exception: Fault has occurred.");
System.out.println(e.toString());
}
}
{
System.out.println("Invoking doGetData...");
try {
com.qas.web_2005_02.QAData _doGetData__return = port.doGetData();
System.out.println("doGetData.result=" + _doGetData__return);
} catch (Fault e) {
System.out.println("Expected exception: Fault has occurred.");
System.out.println(e.toString());
}
}
{
System.out.println("Invoking doGetExampleAddresses...");
com.qas.web_2005_02.QAGetExampleAddresses _doGetExampleAddresses_body = null;
try {
com.qas.web_2005_02.QAExampleAddresses _doGetExampleAddresses__return =
port.doGetExampleAddresses(_doGetExampleAddresses_body);
System.out.println("doGetExampleAddresses.result=" + _doGetExampleAddresses__return);
} catch (Fault e) {
System.out.println("Expected exception: Fault has occurred.");
System.out.println(e.toString());
}
}
{
System.out.println("Invoking doRefine...");
com.qas.web_2005_02.QARefine _doRefine_body = null;
try {
com.qas.web_2005_02.Picklist _doRefine__return = port.doRefine(_doRefine_body);
System.out.println("doRefine.result=" + _doRefine__return);
} catch (Fault e) {
System.out.println("Expected exception: Fault has occurred.");
System.out.println(e.toString());
}
}
{
System.out.println("Invoking doGetAddress...");
com.qas.web_2005_02.QAGetAddress _doGetAddress_body = null;
try {
com.qas.web_2005_02.Address _doGetAddress__return = port.doGetAddress(_doGetAddress_body);
System.out.println("doGetAddress.result=" + _doGetAddress__return);
} catch (Fault e) {
System.out.println("Expected exception: Fault has occurred.");
System.out.println(e.toString());
}
}
{
System.out.println("Invoking doSearch...");
com.qas.web_2005_02.QASearch _doSearch_body = null;
try {
com.qas.web_2005_02.QASearchResult _doSearch__return = port.doSearch(_doSearch_body);
System.out.println("doSearch.result=" + _doSearch__return);
} catch (Fault e) {
System.out.println("Expected exception: Fault has occurred.");
System.out.println(e.toString());
}
}
{
System.out.println("Invoking doCanSearch...");
com.qas.web_2005_02.QACanSearch _doCanSearch_body = null;
try {
com.qas.web_2005_02.QASearchOk _doCanSearch__return = port.doCanSearch(_doCanSearch_body);
System.out.println("doCanSearch.result=" + _doCanSearch__return);
} catch (Fault e) {
System.out.println("Expected exception: Fault has occurred.");
System.out.println(e.toString());
}
}
{
System.out.println("Invoking doGetLayouts...");
com.qas.web_2005_02.QAGetLayouts _doGetLayouts_body = null;
try {
com.qas.web_2005_02.QALayouts _doGetLayouts__return = port.doGetLayouts(_doGetLayouts_body);
System.out.println("doGetLayouts.result=" + _doGetLayouts__return);
} catch (Fault e) {
System.out.println("Expected exception: Fault has occurred.");
System.out.println(e.toString());
}
}
{
System.out.println("Invoking doGetPromptSet...");
com.qas.web_2005_02.QAGetPromptSet _doGetPromptSet_body = null;
try {
com.qas.web_2005_02.QAPromptSet _doGetPromptSet__return =
port.doGetPromptSet(_doGetPromptSet_body);
System.out.println("doGetPromptSet.result=" + _doGetPromptSet__return);
} catch (Fault e) {
System.out.println("Expected exception: Fault has occurred.");
System.out.println(e.toString());
}
}
{
System.out.println("Invoking doGetSystemInfo...");
try {
com.qas.web_2005_02.QASystemInfo _doGetSystemInfo__return = port.doGetSystemInfo();
System.out.println("doGetSystemInfo.result=" + _doGetSystemInfo__return);
} catch (Fault e) {
System.out.println("Expected exception: Fault has occurred.");
System.out.println(e.toString());
}
}
System.exit(0);
}
}

View File

@ -0,0 +1,104 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Line" type="{http://www.qas.com/web-2005-02}PromptLine" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="Dynamic" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"line"}
)
@XmlRootElement(name = "QAPromptSet")
public class QAPromptSet {
@XmlElement(name = "Line")
protected List<PromptLine> line;
@XmlAttribute(name = "Dynamic")
protected Boolean dynamic;
/**
* Gets the value of the line property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the line property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getLine().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link PromptLine }
*/
public List<PromptLine> getLine() {
if (line == null) {
line = new ArrayList<PromptLine>();
}
return this.line;
}
/**
* Obtient la valeur de la propriété dynamic.
*
* @return possible object is {@link Boolean }
*/
public boolean isDynamic() {
if (dynamic == null) {
return false;
} else {
return dynamic;
}
}
/**
* Définit la valeur de la propriété dynamic.
*
* @param value allowed object is {@link Boolean }
*/
public void setDynamic(Boolean value) {
this.dynamic = value;
}
}

View File

@ -0,0 +1,160 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Moniker" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Refinement" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="QAConfig" type="{http://www.qas.com/web-2005-02}QAConfigType" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="Threshold" type="{http://www.qas.com/web-2005-02}ThresholdType" />
* &lt;attribute name="Timeout" type="{http://www.qas.com/web-2005-02}TimeoutType" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"moniker", "refinement", "qaConfig"}
)
@XmlRootElement(name = "QARefine")
public class QARefine {
@XmlElement(name = "Moniker", required = true)
protected String moniker;
@XmlElement(name = "Refinement", required = true)
protected String refinement;
@XmlElement(name = "QAConfig")
protected QAConfigType qaConfig;
@XmlAttribute(name = "Threshold")
protected Integer threshold;
@XmlAttribute(name = "Timeout")
protected Integer timeout;
/**
* Obtient la valeur de la propriété moniker.
*
* @return possible object is {@link String }
*/
public String getMoniker() {
return moniker;
}
/**
* Définit la valeur de la propriété moniker.
*
* @param value allowed object is {@link String }
*/
public void setMoniker(String value) {
this.moniker = value;
}
/**
* Obtient la valeur de la propriété refinement.
*
* @return possible object is {@link String }
*/
public String getRefinement() {
return refinement;
}
/**
* Définit la valeur de la propriété refinement.
*
* @param value allowed object is {@link String }
*/
public void setRefinement(String value) {
this.refinement = value;
}
/**
* Obtient la valeur de la propriété qaConfig.
*
* @return possible object is {@link QAConfigType }
*/
public QAConfigType getQAConfig() {
return qaConfig;
}
/**
* Définit la valeur de la propriété qaConfig.
*
* @param value allowed object is {@link QAConfigType }
*/
public void setQAConfig(QAConfigType value) {
this.qaConfig = value;
}
/**
* Obtient la valeur de la propriété threshold.
*
* @return possible object is {@link Integer }
*/
public Integer getThreshold() {
return threshold;
}
/**
* Définit la valeur de la propriété threshold.
*
* @param value allowed object is {@link Integer }
*/
public void setThreshold(Integer value) {
this.threshold = value;
}
/**
* Obtient la valeur de la propriété timeout.
*
* @return possible object is {@link Integer }
*/
public Integer getTimeout() {
return timeout;
}
/**
* Définit la valeur de la propriété timeout.
*
* @param value allowed object is {@link Integer }
*/
public void setTimeout(Integer value) {
this.timeout = value;
}
}

View File

@ -0,0 +1,159 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Country" type="{http://www.qas.com/web-2005-02}ISOType"/>
* &lt;element name="Engine" type="{http://www.qas.com/web-2005-02}EngineType"/>
* &lt;element name="Layout" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="QAConfig" type="{http://www.qas.com/web-2005-02}QAConfigType" minOccurs="0"/>
* &lt;element name="Search" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"country", "engine", "layout", "qaConfig", "search"}
)
@XmlRootElement(name = "QASearch")
public class QASearch {
@XmlElement(name = "Country", required = true)
protected String country;
@XmlElement(name = "Engine", required = true)
protected EngineType engine;
@XmlElement(name = "Layout")
protected String layout;
@XmlElement(name = "QAConfig")
protected QAConfigType qaConfig;
@XmlElement(name = "Search", required = true)
protected String search;
/**
* Obtient la valeur de la propriété country.
*
* @return possible object is {@link String }
*/
public String getCountry() {
return country;
}
/**
* Définit la valeur de la propriété country.
*
* @param value allowed object is {@link String }
*/
public void setCountry(String value) {
this.country = value;
}
/**
* Obtient la valeur de la propriété engine.
*
* @return possible object is {@link EngineType }
*/
public EngineType getEngine() {
return engine;
}
/**
* Définit la valeur de la propriété engine.
*
* @param value allowed object is {@link EngineType }
*/
public void setEngine(EngineType value) {
this.engine = value;
}
/**
* Obtient la valeur de la propriété layout.
*
* @return possible object is {@link String }
*/
public String getLayout() {
return layout;
}
/**
* Définit la valeur de la propriété layout.
*
* @param value allowed object is {@link String }
*/
public void setLayout(String value) {
this.layout = value;
}
/**
* Obtient la valeur de la propriété qaConfig.
*
* @return possible object is {@link QAConfigType }
*/
public QAConfigType getQAConfig() {
return qaConfig;
}
/**
* Définit la valeur de la propriété qaConfig.
*
* @param value allowed object is {@link QAConfigType }
*/
public void setQAConfig(QAConfigType value) {
this.qaConfig = value;
}
/**
* Obtient la valeur de la propriété search.
*
* @return possible object is {@link String }
*/
public String getSearch() {
return search;
}
/**
* Définit la valeur de la propriété search.
*
* @param value allowed object is {@link String }
*/
public void setSearch(String value) {
this.search = value;
}
}

View File

@ -0,0 +1,107 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="IsOk" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* &lt;element name="ErrorCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="ErrorMessage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"isOk", "errorCode", "errorMessage"}
)
@XmlRootElement(name = "QASearchOk")
public class QASearchOk {
@XmlElement(name = "IsOk")
protected boolean isOk;
@XmlElement(name = "ErrorCode")
protected String errorCode;
@XmlElement(name = "ErrorMessage")
protected String errorMessage;
/** Obtient la valeur de la propriété isOk. */
public boolean isIsOk() {
return isOk;
}
/** Définit la valeur de la propriété isOk. */
public void setIsOk(boolean value) {
this.isOk = value;
}
/**
* Obtient la valeur de la propriété errorCode.
*
* @return possible object is {@link String }
*/
public String getErrorCode() {
return errorCode;
}
/**
* Définit la valeur de la propriété errorCode.
*
* @param value allowed object is {@link String }
*/
public void setErrorCode(String value) {
this.errorCode = value;
}
/**
* Obtient la valeur de la propriété errorMessage.
*
* @return possible object is {@link String }
*/
public String getErrorMessage() {
return errorMessage;
}
/**
* Définit la valeur de la propriété errorMessage.
*
* @param value allowed object is {@link String }
*/
public void setErrorMessage(String value) {
this.errorMessage = value;
}
}

View File

@ -0,0 +1,120 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="QAPicklist" type="{http://www.qas.com/web-2005-02}QAPicklistType" minOccurs="0"/>
* &lt;element name="QAAddress" type="{http://www.qas.com/web-2005-02}QAAddressType" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="VerifyLevel" type="{http://www.qas.com/web-2005-02}VerifyLevelType" default="None" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"qaPicklist", "qaAddress"}
)
@XmlRootElement(name = "QASearchResult")
public class QASearchResult {
@XmlElement(name = "QAPicklist")
protected QAPicklistType qaPicklist;
@XmlElement(name = "QAAddress")
protected QAAddressType qaAddress;
@XmlAttribute(name = "VerifyLevel")
protected VerifyLevelType verifyLevel;
/**
* Obtient la valeur de la propriété qaPicklist.
*
* @return possible object is {@link QAPicklistType }
*/
public QAPicklistType getQAPicklist() {
return qaPicklist;
}
/**
* Définit la valeur de la propriété qaPicklist.
*
* @param value allowed object is {@link QAPicklistType }
*/
public void setQAPicklist(QAPicklistType value) {
this.qaPicklist = value;
}
/**
* Obtient la valeur de la propriété qaAddress.
*
* @return possible object is {@link QAAddressType }
*/
public QAAddressType getQAAddress() {
return qaAddress;
}
/**
* Définit la valeur de la propriété qaAddress.
*
* @param value allowed object is {@link QAAddressType }
*/
public void setQAAddress(QAAddressType value) {
this.qaAddress = value;
}
/**
* Obtient la valeur de la propriété verifyLevel.
*
* @return possible object is {@link VerifyLevelType }
*/
public VerifyLevelType getVerifyLevel() {
if (verifyLevel == null) {
return VerifyLevelType.NONE;
} else {
return verifyLevel;
}
}
/**
* Définit la valeur de la propriété verifyLevel.
*
* @param value allowed object is {@link VerifyLevelType }
*/
public void setVerifyLevel(VerifyLevelType value) {
this.verifyLevel = value;
}
}

View File

@ -0,0 +1,77 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="SystemInfo" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"systemInfo"}
)
@XmlRootElement(name = "QASystemInfo")
public class QASystemInfo {
@XmlElement(name = "SystemInfo")
protected List<String> systemInfo;
/**
* Gets the value of the systemInfo property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the systemInfo property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getSystemInfo().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link String }
*/
public List<String> getSystemInfo() {
if (systemInfo == null) {
systemInfo = new ArrayList<String>();
}
return this.systemInfo;
}
}

View File

@ -0,0 +1,77 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.web_2005_02;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* Classe Java pour VerifyLevelType.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <p>
*
* <pre>
* &lt;simpleType name="VerifyLevelType">
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="None"/>
* &lt;enumeration value="Verified"/>
* &lt;enumeration value="InteractionRequired"/>
* &lt;enumeration value="PremisesPartial"/>
* &lt;enumeration value="StreetPartial"/>
* &lt;enumeration value="Multiple"/>
* &lt;/restriction>
* &lt;/simpleType>
* </pre>
*/
@XmlType(name = "VerifyLevelType")
@XmlEnum
public enum VerifyLevelType {
@XmlEnumValue("None")
NONE("None"),
@XmlEnumValue("Verified")
VERIFIED("Verified"),
@XmlEnumValue("InteractionRequired")
INTERACTION_REQUIRED("InteractionRequired"),
@XmlEnumValue("PremisesPartial")
PREMISES_PARTIAL("PremisesPartial"),
@XmlEnumValue("StreetPartial")
STREET_PARTIAL("StreetPartial"),
@XmlEnumValue("Multiple")
MULTIPLE("Multiple");
private final String value;
VerifyLevelType(String v) {
value = v;
}
public String value() {
return value;
}
public static VerifyLevelType fromValue(String v) {
for (VerifyLevelType c : VerifyLevelType.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}

View File

@ -0,0 +1,22 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@javax.xml.bind.annotation.XmlSchema(
namespace = "http://www.qas.com/web-2005-02",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED
)
package com.qas.web_2005_02;

View File

@ -0,0 +1,12 @@
"key","message","comment","context"
"An error occurs while opening the connection. Please verify the following URL : %s.",,,
"Can not opening the connection to a empty URL.",,,
"Cannot find record #%s",,,
"No such template",,,
"Templating can not be empty",,,
"The collection of IDs cannot be null.",,,
"The consumer cannot be null.",,,
"The parameter copyNumber should be superior to 0.",,,
"This field needs to be unique.",,,
"Url %s is malformed.",,,
"Years in 360 days",,,
1 key message comment context
2 An error occurs while opening the connection. Please verify the following URL : %s.
3 Can not opening the connection to a empty URL.
4 Cannot find record #%s
5 No such template
6 Templating can not be empty
7 The collection of IDs cannot be null.
8 The consumer cannot be null.
9 The parameter copyNumber should be superior to 0.
10 This field needs to be unique.
11 Url %s is malformed.
12 Years in 360 days

View File

@ -0,0 +1,12 @@
"key","message","comment","context"
"An error occurs while opening the connection. Please verify the following URL : %s.","Beim Öffnen der Verbindung tritt ein Fehler auf. Bitte überprüfen Sie die folgende URL: %s.",,
"Can not opening the connection to a empty URL.","Die Verbindung zu einer leeren URL kann nicht geöffnet werden.",,
"Cannot find record #%s","Datensatz #%s kann nicht gefunden werden",,
"No such template","Keine solche Vorlage",,
"Templating can not be empty","Das Templating darf nicht leer sein.",,
"The collection of IDs cannot be null.","Die Sammlung von IDs darf nicht null sein.",,
"The consumer cannot be null.","Der Verbraucher kann nicht Null sein.",,
"The parameter copyNumber should be superior to 0.","Der Parameter copyNumber sollte größer als 0 sein.",,
"This field needs to be unique.","Dieses Feld muss eindeutig sein.",,
"Url %s is malformed.","Url %s ist deformiert.",,
"Years in 360 days","Jahre in 360 Tagen",,
1 key message comment context
2 An error occurs while opening the connection. Please verify the following URL : %s. Beim Öffnen der Verbindung tritt ein Fehler auf. Bitte überprüfen Sie die folgende URL: %s.
3 Can not opening the connection to a empty URL. Die Verbindung zu einer leeren URL kann nicht geöffnet werden.
4 Cannot find record #%s Datensatz #%s kann nicht gefunden werden
5 No such template Keine solche Vorlage
6 Templating can not be empty Das Templating darf nicht leer sein.
7 The collection of IDs cannot be null. Die Sammlung von IDs darf nicht null sein.
8 The consumer cannot be null. Der Verbraucher kann nicht Null sein.
9 The parameter copyNumber should be superior to 0. Der Parameter copyNumber sollte größer als 0 sein.
10 This field needs to be unique. Dieses Feld muss eindeutig sein.
11 Url %s is malformed. Url %s ist deformiert.
12 Years in 360 days Jahre in 360 Tagen

View File

@ -0,0 +1,12 @@
"key","message","comment","context"
"An error occurs while opening the connection. Please verify the following URL : %s.",,,
"Can not opening the connection to a empty URL.",,,
"Cannot find record #%s",,,
"No such template",,,
"Templating can not be empty",,,
"The collection of IDs cannot be null.",,,
"The consumer cannot be null.",,,
"The parameter copyNumber should be superior to 0.",,,
"This field needs to be unique.",,,
"Url %s is malformed.",,,
"Years in 360 days",,,
1 key message comment context
2 An error occurs while opening the connection. Please verify the following URL : %s.
3 Can not opening the connection to a empty URL.
4 Cannot find record #%s
5 No such template
6 Templating can not be empty
7 The collection of IDs cannot be null.
8 The consumer cannot be null.
9 The parameter copyNumber should be superior to 0.
10 This field needs to be unique.
11 Url %s is malformed.
12 Years in 360 days

View File

@ -0,0 +1,12 @@
"key","message","comment","context"
"An error occurs while opening the connection. Please verify the following URL : %s.","Se produce un error al abrir la conexión. Por favor, verifique la siguiente URL: %s.",,
"Can not opening the connection to a empty URL.","No se puede abrir la conexión a una URL vacía.",,
"Cannot find record #%s","No se puede encontrar el registro #%s",,
"No such template","No existe tal plantilla",,
"Templating can not be empty","El modelo no puede estar vacío",,
"The collection of IDs cannot be null.","La colección de documentos de identidad no puede ser nula.",,
"The consumer cannot be null.","El consumidor no puede ser nulo.",,
"The parameter copyNumber should be superior to 0.","El parámetro copyNumber debe ser superior a 0.",,
"This field needs to be unique.","Este campo debe ser único.",,
"Url %s is malformed.","Url %s está malformado.",,
"Years in 360 days","Años en 360 días",,
1 key message comment context
2 An error occurs while opening the connection. Please verify the following URL : %s. Se produce un error al abrir la conexión. Por favor, verifique la siguiente URL: %s.
3 Can not opening the connection to a empty URL. No se puede abrir la conexión a una URL vacía.
4 Cannot find record #%s No se puede encontrar el registro #%s
5 No such template No existe tal plantilla
6 Templating can not be empty El modelo no puede estar vacío
7 The collection of IDs cannot be null. La colección de documentos de identidad no puede ser nula.
8 The consumer cannot be null. El consumidor no puede ser nulo.
9 The parameter copyNumber should be superior to 0. El parámetro copyNumber debe ser superior a 0.
10 This field needs to be unique. Este campo debe ser único.
11 Url %s is malformed. Url %s está malformado.
12 Years in 360 days Años en 360 días

View File

@ -0,0 +1,12 @@
"key","message","comment","context"
"An error occurs while opening the connection. Please verify the following URL : %s.","Une erreur est survenue pendant la connexion. Veuillez verifier l'URL suivant: %s.",,
"Can not opening the connection to a empty URL.","Impossible d'établir la connexion avec un URL vide.",,
"Cannot find record #%s",,,
"No such template","Modèle non trouvé",,
"Templating can not be empty","Le modèle ne peut pas être vide",,
"The collection of IDs cannot be null.",,,
"The consumer cannot be null.",,,
"The parameter copyNumber should be superior to 0.","Le paramètre copyNumber devrait être plus grand que 0.",,
"This field needs to be unique.","Ce champ doit être unique.",,
"Url %s is malformed.","l'url %s est malformé",,
"Years in 360 days","L'année en 360 jours",,
1 key message comment context
2 An error occurs while opening the connection. Please verify the following URL : %s. Une erreur est survenue pendant la connexion. Veuillez verifier l'URL suivant: %s.
3 Can not opening the connection to a empty URL. Impossible d'établir la connexion avec un URL vide.
4 Cannot find record #%s
5 No such template Modèle non trouvé
6 Templating can not be empty Le modèle ne peut pas être vide
7 The collection of IDs cannot be null.
8 The consumer cannot be null.
9 The parameter copyNumber should be superior to 0. Le paramètre copyNumber devrait être plus grand que 0.
10 This field needs to be unique. Ce champ doit être unique.
11 Url %s is malformed. l'url %s est malformé
12 Years in 360 days L'année en 360 jours

View File

@ -0,0 +1,12 @@
"key","message","comment","context"
"An error occurs while opening the connection. Please verify the following URL : %s.","Si verifica un errore durante l'apertura del collegamento. Si prega di verificare il seguente URL: %s.",,
"Can not opening the connection to a empty URL.","Non è possibile aprire la connessione a un URL vuoto.",,
"Cannot find record #%s","Non riesco a trovare il record #%s",,
"No such template","Nessun modello di questo tipo",,
"Templating can not be empty","Templating non può essere vuoto",,
"The collection of IDs cannot be null.","L'insieme di ID non può essere nullo.",,
"The consumer cannot be null.","Il consumatore non può essere nullo.",,
"The parameter copyNumber should be superior to 0.","Il parametro copyNumber dovrebbe essere superiore a 0.",,
"This field needs to be unique.","Questo campo deve essere unico.",,
"Url %s is malformed.","Url %s è malformato.",,
"Years in 360 days","Anni in 360 giorni",,
1 key message comment context
2 An error occurs while opening the connection. Please verify the following URL : %s. Si verifica un errore durante l'apertura del collegamento. Si prega di verificare il seguente URL: %s.
3 Can not opening the connection to a empty URL. Non è possibile aprire la connessione a un URL vuoto.
4 Cannot find record #%s Non riesco a trovare il record #%s
5 No such template Nessun modello di questo tipo
6 Templating can not be empty Templating non può essere vuoto
7 The collection of IDs cannot be null. L'insieme di ID non può essere nullo.
8 The consumer cannot be null. Il consumatore non può essere nullo.
9 The parameter copyNumber should be superior to 0. Il parametro copyNumber dovrebbe essere superiore a 0.
10 This field needs to be unique. Questo campo deve essere unico.
11 Url %s is malformed. Url %s è malformato.
12 Years in 360 days Anni in 360 giorni

View File

@ -0,0 +1,12 @@
"key","message","comment","context"
"An error occurs while opening the connection. Please verify the following URL : %s.","Er treedt een fout op bij het openen van de verbinding. Controleer de volgende URL : %s.",,
"Can not opening the connection to a empty URL.","Kan de verbinding met een lege URL niet openen.",,
"Cannot find record #%s","Kan geen record #%s vinden",,
"No such template","Geen sjabloon",,
"Templating can not be empty","Templateren kan niet leeg zijn",,
"The collection of IDs cannot be null.","De verzameling van ID's kan niet ongeldig zijn.",,
"The consumer cannot be null.","De consument kan niet ongeldig zijn.",,
"The parameter copyNumber should be superior to 0.","De parameter copyNumber moet superieur zijn aan 0.",,
"This field needs to be unique.","Dit veld moet uniek zijn.",,
"Url %s is malformed.","Url %s is misvormd.",,
"Years in 360 days","Jaren in 360 dagen",,
1 key message comment context
2 An error occurs while opening the connection. Please verify the following URL : %s. Er treedt een fout op bij het openen van de verbinding. Controleer de volgende URL : %s.
3 Can not opening the connection to a empty URL. Kan de verbinding met een lege URL niet openen.
4 Cannot find record #%s Kan geen record #%s vinden
5 No such template Geen sjabloon
6 Templating can not be empty Templateren kan niet leeg zijn
7 The collection of IDs cannot be null. De verzameling van ID's kan niet ongeldig zijn.
8 The consumer cannot be null. De consument kan niet ongeldig zijn.
9 The parameter copyNumber should be superior to 0. De parameter copyNumber moet superieur zijn aan 0.
10 This field needs to be unique. Dit veld moet uniek zijn.
11 Url %s is malformed. Url %s is misvormd.
12 Years in 360 days Jaren in 360 dagen

View File

@ -0,0 +1,12 @@
"key","message","comment","context"
"An error occurs while opening the connection. Please verify the following URL : %s.","Podczas otwierania połączenia pojawia się błąd. Proszę sprawdzić następujący adres URL: %s.",,
"Can not opening the connection to a empty URL.","Nie można otworzyć połączenia do pustego adresu URL.",,
"Cannot find record #%s","Nie można znaleźć rekordu #%s",,
"No such template","Brak takiego szablonu",,
"Templating can not be empty","Szablonowanie nie może być puste",,
"The collection of IDs cannot be null.","Zbiór identyfikatorów nie może być nieważny.",,
"The consumer cannot be null.","Konsument nie może być nieważny.",,
"The parameter copyNumber should be superior to 0.","Parametr copyNumber powinien być większy od 0.",,
"This field needs to be unique.","Ta dziedzina musi być unikalna.",,
"Url %s is malformed.","Url %s jest zdeformowany.",,
"Years in 360 days","Lata w 360 dni",,
1 key message comment context
2 An error occurs while opening the connection. Please verify the following URL : %s. Podczas otwierania połączenia pojawia się błąd. Proszę sprawdzić następujący adres URL: %s.
3 Can not opening the connection to a empty URL. Nie można otworzyć połączenia do pustego adresu URL.
4 Cannot find record #%s Nie można znaleźć rekordu #%s
5 No such template Brak takiego szablonu
6 Templating can not be empty Szablonowanie nie może być puste
7 The collection of IDs cannot be null. Zbiór identyfikatorów nie może być nieważny.
8 The consumer cannot be null. Konsument nie może być nieważny.
9 The parameter copyNumber should be superior to 0. Parametr copyNumber powinien być większy od 0.
10 This field needs to be unique. Ta dziedzina musi być unikalna.
11 Url %s is malformed. Url %s jest zdeformowany.
12 Years in 360 days Lata w 360 dni

View File

@ -0,0 +1,12 @@
"key","message","comment","context"
"An error occurs while opening the connection. Please verify the following URL : %s.","Ocorre um erro ao abrir a conexão. Por favor, verifique a seguinte URL : %s.",,
"Can not opening the connection to a empty URL.","Não é possível abrir a conexão a uma URL vazia.",,
"Cannot find record #%s","Não consigo encontrar o recorde #%s",,
"No such template","Esse modelo não existe",,
"Templating can not be empty","O gabarito não pode estar vazio",,
"The collection of IDs cannot be null.","A coleção de IDs não pode ser nula.",,
"The consumer cannot be null.","O consumidor não pode ser nulo.",,
"The parameter copyNumber should be superior to 0.","O parâmetro copyNumber deve ser superior a 0.",,
"This field needs to be unique.","Este campo tem de ser único.",,
"Url %s is malformed.","Url %s é malformado.",,
"Years in 360 days","Anos em 360 dias",,
1 key message comment context
2 An error occurs while opening the connection. Please verify the following URL : %s. Ocorre um erro ao abrir a conexão. Por favor, verifique a seguinte URL : %s.
3 Can not opening the connection to a empty URL. Não é possível abrir a conexão a uma URL vazia.
4 Cannot find record #%s Não consigo encontrar o recorde #%s
5 No such template Esse modelo não existe
6 Templating can not be empty O gabarito não pode estar vazio
7 The collection of IDs cannot be null. A coleção de IDs não pode ser nula.
8 The consumer cannot be null. O consumidor não pode ser nulo.
9 The parameter copyNumber should be superior to 0. O parâmetro copyNumber deve ser superior a 0.
10 This field needs to be unique. Este campo tem de ser único.
11 Url %s is malformed. Url %s é malformado.
12 Years in 360 days Anos em 360 dias

View File

@ -0,0 +1,12 @@
"key","message","comment","context"
"An error occurs while opening the connection. Please verify the following URL : %s.","При разрыве соединения возникает ошибка. Пожалуйста, проверьте следующий URL: %s.",,
"Can not opening the connection to a empty URL.","Невозможно открыть соединение с пустым URL-адресом.",,
"Cannot find record #%s","Не могу найти запись #%s",,
"No such template","Нет такого шаблона",,
"Templating can not be empty","Шаблон не может быть пустым",,
"The collection of IDs cannot be null.","Сбор идентификаторов не может быть нулевым.",,
"The consumer cannot be null.","Потребитель не может быть недействительным.",,
"The parameter copyNumber should be superior to 0.","CopyNumber параметра должен быть выше 0.",,
"This field needs to be unique.","Это поле должно быть уникальным.",,
"Url %s is malformed.","Url %s неправильно сформирован.",,
"Years in 360 days","Годы в 360 дней",,
1 key message comment context
2 An error occurs while opening the connection. Please verify the following URL : %s. При разрыве соединения возникает ошибка. Пожалуйста, проверьте следующий URL: %s.
3 Can not opening the connection to a empty URL. Невозможно открыть соединение с пустым URL-адресом.
4 Cannot find record #%s Не могу найти запись #%s
5 No such template Нет такого шаблона
6 Templating can not be empty Шаблон не может быть пустым
7 The collection of IDs cannot be null. Сбор идентификаторов не может быть нулевым.
8 The consumer cannot be null. Потребитель не может быть недействительным.
9 The parameter copyNumber should be superior to 0. CopyNumber параметра должен быть выше 0.
10 This field needs to be unique. Это поле должно быть уникальным.
11 Url %s is malformed. Url %s неправильно сформирован.
12 Years in 360 days Годы в 360 дней

View File

@ -0,0 +1,176 @@
/**
* Axelor Business Solutions
*
* Copyright (C) 2016 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.test;
import static org.junit.Assert.*
import javax.xml.namespace.QName
import javax.xml.ws.Service
import org.junit.Test
import com.qas.web_2005_02.Address
import com.qas.web_2005_02.EngineEnumType
import com.qas.web_2005_02.EngineType
import com.qas.web_2005_02.ProWeb
import com.qas.web_2005_02.PromptSetType
import com.qas.web_2005_02.QACanSearch
import com.qas.web_2005_02.QAData
import com.qas.web_2005_02.QADataSet
import com.qas.web_2005_02.QAGetAddress
import com.qas.web_2005_02.QAGetLayouts
import com.qas.web_2005_02.QALayouts
import com.qas.web_2005_02.QAPortType
import com.qas.web_2005_02.QASearch
import com.qas.web_2005_02.QASearchResult
class Client {
//stubs generated with:
//arye@dm4:~/projects/axelor/axelor-tool/src/main/java$ ~/opt/cxf/bin/wsdl2java -client -frontend jaxws21 http://ip.axelor.com:2021/proweb.wsdl
//http://cxf.apache.org/docs/how-do-i-develop-a-client.html
@Test
def void WSDL2JavaClient() {
ProWeb service = new ProWeb()
def serviceName = service.getServiceName()
println serviceName
}
@Test
def void JAXWSProxy() {
QName SERVICE_NAME = new QName("http://www.qas.com/web-2005-02"
,"ProWeb")
QName PORT_NAME = new QName("http://www.qas.com/web-2005-02"
,"QAPortType")
def wsdlURL = new URL("http://ip.axelor.com:2021/proweb.wsdl")
println wsdlURL
Service service = Service.create(wsdlURL, SERVICE_NAME);
QAPortType client = service.getPort(QAPortType.class);
//QAPortType client = service.getPort(PORT_NAME, QAPortType.class)
println client.dump()
QAGetLayouts getLayouts = new QAGetLayouts()
getLayouts.country = "FRX"
QALayouts layouts = client.doGetLayouts(getLayouts)
println "layouts= "+layouts.layout
println layouts.layout*.name
// 1. Pre-check.
print "1. Pre-check."
QAData qadata = client.doGetData()
println qadata
println qadata.dataSet
QADataSet ds = qadata.dataSet[0]
println ds.name
println ds.id
QACanSearch canSearch = new QACanSearch()
canSearch.country = "FRX"
canSearch.layout = "AFNOR INSEE"
EngineType engType = new EngineType()
engType.setFlatten(true)
engType.value = EngineEnumType.VERIFICATION
canSearch.engine = engType
def resp = client.doCanSearch(canSearch)
println resp.isOk
// 2. Initial search.
QASearch search = new QASearch()
search.country = "FRX"
search.layout = "AFNOR INSEE"
//search.search = "55 de bercy 75012" //qaPicklist=com.qas.web_2005_02.QAPicklistType@2dd59d3c qaAddress=null verifyLevel=MULTIPLE>
//search.search = "55 rue de bercyi 75012" //qaPicklist=null qaAddress=com.qas.web_2005_02.QAAddressType@25c7f37d verifyLevel=INTERACTION_REQUIRED>
search.search = "110 rue PETIT 75019 paris" //qaPicklist=null qaAddress=com.qas.web_2005_02.QAAddressType@391da0 verifyLevel=VERIFIED>
EngineType engTypeT = new EngineType()
engTypeT.promptSet = PromptSetType.DEFAULT
engTypeT.value = EngineEnumType.VERIFICATION
search.engine = engTypeT
search.engine = engTypeT
QASearchResult respSearch = client.doSearch(search)
println respSearch.dump()
if (respSearch.qaAddress) {
println respSearch.qaAddress.addressLine*.label
println respSearch.qaAddress.addressLine*.line
//println respSearch.qaAddress.addressLine*.lineContent
}
if (respSearch.qaPicklist) {
println respSearch.qaPicklist?.total
println respSearch.qaPicklist?.picklistEntry*.picklist
println respSearch.qaPicklist?.picklistEntry*.postcode
println respSearch.qaPicklist?.picklistEntry*.partialAddress
println respSearch.qaPicklist?.picklistEntry*.score
println respSearch.qaPicklist?.picklistEntry*.moniker
println respSearch.qaPicklist.dump()
}
// 3. OPTIONAL: Refine
//DoRefine
// 4. Format the final address.
//DoGetAddress
QAGetAddress getAddress = new QAGetAddress()
if (respSearch.qaPicklist?.picklistEntry) {
def moniker = respSearch.qaPicklist?.picklistEntry[0].moniker
getAddress.moniker = moniker
getAddress.layout = "AFNOR INSEE"
Address formattedAddress = client.doGetAddress(getAddress)
println formattedAddress.dump()
println formattedAddress.qaAddress.addressLine*.label
println formattedAddress.qaAddress.addressLine*.line
}
}
}

View File

@ -0,0 +1,85 @@
/**
* Axelor Business Solutions
*
* Copyright (C) 2016 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.qas.test;
import static org.junit.Assert.*
import javax.xml.namespace.QName
import javax.xml.ws.Service
import org.junit.Test
import com.qas.web_2005_02.Address
import com.qas.web_2005_02.EngineEnumType
import com.qas.web_2005_02.EngineType
import com.qas.web_2005_02.ProWeb
import com.qas.web_2005_02.PromptSetType
import com.qas.web_2005_02.QACanSearch
import com.qas.web_2005_02.QAData
import com.qas.web_2005_02.QADataSet
import com.qas.web_2005_02.QAGetAddress
import com.qas.web_2005_02.QAGetLayouts
import com.qas.web_2005_02.QALayouts
import com.qas.web_2005_02.QAPortType
import com.qas.web_2005_02.QASearch
import com.qas.web_2005_02.QASearchResult
class ClientMonitor {
//stubs generated with:
//arye@dm4:~/projects/axelor/axelor-tool/src/main/java$ ~/opt/cxf/bin/wsdl2java -client -frontend jaxws21 http://ip.axelor.com:2021/proweb.wsdl
//http://cxf.apache.org/docs/how-do-i-develop-a-client.html
// TODO:
//http://blog.progs.be/92/cxf-ws-client-dynamic-endpoint-and-loading-wsdl-from-the-classpath
@Test
def void JAXWSProxy() {
QName SERVICE_NAME = new QName("http://www.qas.com/web-2005-02"
,"ProWeb")
QName PORT_NAME = new QName("http://www.qas.com/web-2005-02"
,"QAPortType")
// set up TCP/IP monitor under Windows | Preferences
//http://backup.axelor.com/pub/sftp/proweb.wsdl
def wsdlURL = new URL("http://localhost:8001/pub/sftp/proweb.wsdl")
println wsdlURL
Service service = Service.create(wsdlURL, SERVICE_NAME);
QAPortType client = service.getPort(QAPortType.class);
//QAPortType client = service.getPort(PORT_NAME, QAPortType.class)
println client.dump()
QAGetLayouts getLayouts = new QAGetLayouts()
getLayouts.country = "FRX"
QALayouts layouts = client.doGetLayouts(getLayouts)
println "layouts= "+layouts.layout
println layouts.layout*.name
}
}

View File

@ -0,0 +1,200 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import com.axelor.apps.tool.db.Contact;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class InvokationTest {
protected static final Member INVALID_MEMBER;
static {
Member invalidMember;
try {
invalidMember = InvokationTest.class.getDeclaredField("INVALID_MEMBER");
} catch (NoSuchFieldException ex) {
invalidMember = null;
} catch (SecurityException ex) {
invalidMember = null;
}
INVALID_MEMBER = invalidMember;
}
/** Cache exact attribute class and property reflection Member object */
protected static final Map<Class<?>, Map<String, Member>> membersCache =
new HashMap<Class<?>, Map<String, Member>>();
public Contact contact;
@Before
public void prepareTest() {
contact = new Contact("Durand", "Pierre");
contact.setEmail("@test.com");
contact.setFullName(contact.getFullName());
contact.setDateOfBirth(LocalDate.now());
contact.setPayeurQuality(new BigDecimal("2.2569"));
contact.setLanguage("fr");
}
@Test
public void test() {
for (int i = 0; i < 100000; i++) {
ThreadTest thread = new ThreadTest();
thread.run();
}
}
class ThreadTest extends Thread {
@Override
public void run() {
for (int i = 0; i < 10; i++) {
Object valueEmail = getProperty(contact, "email");
Assert.assertEquals(contact.getEmail(), valueEmail);
Object valueFullName = getProperty(contact, "fullName");
Assert.assertEquals(contact.getFullName(), valueFullName);
Object valueFisrtName = getProperty(contact, "firstName");
Assert.assertEquals(contact.getFirstName(), valueFisrtName);
Object valueLastName = getProperty(contact, "lastName");
Assert.assertEquals(contact.getLastName(), valueLastName);
Object valueDateOfBirth = getProperty(contact, "dateOfBirth");
Assert.assertEquals(contact.getDateOfBirth(), valueDateOfBirth);
Object valuePayeurQuality = getProperty(contact, "payeurQuality");
Assert.assertEquals(contact.getPayeurQuality(), valuePayeurQuality);
Object valueLanguage = getProperty(contact, "language");
Assert.assertEquals("fr", valueLanguage);
}
}
}
public synchronized Object getProperty(Object o, String property) {
if (o == null) {
throw new NullPointerException("o");
}
Class<?> c = o.getClass();
if (property == null) {
return null;
}
Member member = findMember(c, property);
if (member != null) {
try {
if (member instanceof Method) {
return ((Method) member).invoke(o);
} else if (member instanceof Field) {
return ((Field) member).get(o);
}
} catch (Exception e) {
}
}
return null;
}
public static Member findMember(Class<?> clazz, String memberName) {
if (clazz == null) {
throw new NullPointerException("clazz");
}
if (memberName == null) {
throw new NullPointerException("memberName");
}
synchronized (membersCache) {
Map<String, Member> members = membersCache.get(clazz);
Member member = null;
if (members != null) {
member = members.get(memberName);
if (member != null) {
return member != INVALID_MEMBER ? member : null;
}
} else {
members = new HashMap<String, Member>();
membersCache.put(clazz, members);
}
// try getXXX and isXXX properties, look up using reflection
String methodSuffix =
Character.toUpperCase(memberName.charAt(0))
+ memberName.substring(1, memberName.length());
member = tryGetMethod(clazz, "get" + methodSuffix);
if (member == null) {
member = tryGetMethod(clazz, "is" + methodSuffix);
if (member == null) {
member = tryGetMethod(clazz, "has" + methodSuffix);
}
}
if (member == null) {
// try for a visible field
member = tryGetField(clazz, memberName);
}
members.put(memberName, member != null ? member : INVALID_MEMBER);
return member;
}
}
protected static Method tryGetMethod(Class<?> clazz, String methodName) {
try {
Method method = clazz.getMethod(methodName);
if (method != null) {
method.setAccessible(true);
}
return method;
} catch (NoSuchMethodException ex) {
} catch (SecurityException ex) {
}
return null;
}
protected static Field tryGetField(Class<?> clazz, String fieldName) {
try {
Field field = clazz.getField(fieldName);
if (field != null) {
field.setAccessible(true);
}
return field;
} catch (NoSuchFieldException ex) {
} catch (SecurityException ex) {
}
return null;
}
}

View File

@ -0,0 +1,221 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import com.axelor.apps.tool.date.DateTool;
import java.time.LocalDate;
import org.junit.Assert;
import org.junit.Test;
public class TestDateTool {
@Test
public void testGetNbDay() {
Assert.assertEquals(1, DateTool.daysBetween(LocalDate.now(), LocalDate.now(), false));
Assert.assertEquals(
30, DateTool.daysBetween(LocalDate.of(2011, 9, 1), LocalDate.of(2011, 9, 30), false));
Assert.assertEquals(
26, DateTool.daysBetween(LocalDate.of(2011, 2, 2), LocalDate.of(2011, 2, 27), true));
Assert.assertEquals(
26, DateTool.daysBetween(LocalDate.of(2011, 2, 2), LocalDate.of(2011, 2, 27), false));
Assert.assertEquals(
-26, DateTool.daysBetween(LocalDate.of(2011, 2, 27), LocalDate.of(2011, 2, 2), false));
Assert.assertEquals(
-26, DateTool.daysBetween(LocalDate.of(2011, 2, 27), LocalDate.of(2011, 2, 2), true));
Assert.assertEquals(
30, DateTool.daysBetween(LocalDate.of(2011, 2, 1), LocalDate.of(2011, 2, 28), true));
Assert.assertEquals(
1, DateTool.daysBetween(LocalDate.of(2011, 7, 30), LocalDate.of(2011, 7, 31), true));
Assert.assertEquals(
54, DateTool.daysBetween(LocalDate.of(2011, 7, 12), LocalDate.of(2011, 9, 5), true));
Assert.assertEquals(
30, DateTool.daysBetween(LocalDate.of(2011, 7, 15), LocalDate.of(2011, 8, 14), true));
Assert.assertEquals(
30, DateTool.daysBetween(LocalDate.of(2011, 7, 1), LocalDate.of(2011, 7, 31), true));
Assert.assertEquals(
31, DateTool.daysBetween(LocalDate.of(2012, 2, 29), LocalDate.of(2012, 3, 30), true));
Assert.assertEquals(
31, DateTool.daysBetween(LocalDate.of(2011, 2, 28), LocalDate.of(2011, 3, 30), true));
Assert.assertEquals(
33, DateTool.daysBetween(LocalDate.of(2012, 2, 28), LocalDate.of(2012, 3, 30), true));
Assert.assertEquals(
181, DateTool.daysBetween(LocalDate.of(2011, 12, 31), LocalDate.of(2012, 6, 30), true));
Assert.assertEquals(
-68, DateTool.daysBetween(LocalDate.of(2011, 12, 9), LocalDate.of(2011, 10, 2), true));
}
@Test
public void testIsProrata() {
// dateFrame1<date1<dateFrame2
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 7, 10),
LocalDate.of(2011, 7, 30)));
// dateFrame1<date2<dateFrame2
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 6, 1),
LocalDate.of(2011, 7, 10)));
// date1<dateFrame1 and dateFrame2<date2
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 6, 1),
LocalDate.of(2011, 7, 30)));
// dateFrame1=date1 and dateFrame2=date2
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15)));
// date1=dateFrame1
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 30)));
// date1=dateFrame2
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 7, 30)));
// date2=dateFrame1
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 6, 1),
LocalDate.of(2011, 7, 1)));
// date2=dateFrame2
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 6, 1),
LocalDate.of(2011, 7, 15)));
// date2=null and date1<dateFrame1
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1), LocalDate.of(2011, 7, 15), LocalDate.of(2011, 6, 1), null));
// date2=null and date1=dateFrame1
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1), LocalDate.of(2011, 7, 15), LocalDate.of(2011, 7, 1), null));
// date2=null and date1>dateFrame1 and date1<dateFrame2
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1), LocalDate.of(2011, 7, 15), LocalDate.of(2011, 7, 10), null));
// date2=null and date1=dateFrame2
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1), LocalDate.of(2011, 7, 15), LocalDate.of(2011, 7, 15), null));
// date2=null and date1<dateFrame1
Assert.assertTrue(
DateTool.isProrata(
LocalDate.of(2011, 7, 1), LocalDate.of(2011, 7, 15), LocalDate.of(2011, 6, 1), null));
// date2=null and date1>dateFrame2
Assert.assertFalse(
DateTool.isProrata(
LocalDate.of(2011, 7, 1), LocalDate.of(2011, 7, 15), LocalDate.of(2011, 8, 1), null));
// date2<dateFrame1
Assert.assertFalse(
DateTool.isProrata(
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 6, 1),
LocalDate.of(2011, 6, 30)));
// date1>dateFrame2
Assert.assertFalse(
DateTool.isProrata(
LocalDate.of(2011, 7, 1),
LocalDate.of(2011, 7, 15),
LocalDate.of(2011, 8, 1),
LocalDate.of(2011, 8, 30)));
}
@Test
public void testGetNbFullMonth() {
Assert.assertEquals(
1, DateTool.days360MonthsBetween(LocalDate.of(2011, 1, 1), LocalDate.of(2011, 2, 5)));
Assert.assertEquals(
0, DateTool.days360MonthsBetween(LocalDate.of(2011, 1, 1), LocalDate.of(2011, 1, 25)));
Assert.assertEquals(
1, DateTool.days360MonthsBetween(LocalDate.of(2011, 12, 15), LocalDate.of(2012, 1, 25)));
Assert.assertEquals(
1, DateTool.days360MonthsBetween(LocalDate.of(2011, 12, 15), LocalDate.of(2012, 1, 15)));
Assert.assertEquals(
1, DateTool.days360MonthsBetween(LocalDate.of(2011, 12, 15), LocalDate.of(2012, 1, 14)));
Assert.assertEquals(
0, DateTool.days360MonthsBetween(LocalDate.of(2011, 12, 15), LocalDate.of(2012, 1, 13)));
Assert.assertEquals(
5, DateTool.days360MonthsBetween(LocalDate.of(2011, 10, 7), LocalDate.of(2012, 3, 9)));
Assert.assertEquals(
1, DateTool.days360MonthsBetween(LocalDate.of(2011, 1, 31), LocalDate.of(2011, 2, 28)));
Assert.assertEquals(
1, DateTool.days360MonthsBetween(LocalDate.of(2011, 3, 31), LocalDate.of(2011, 4, 30)));
Assert.assertEquals(
-5, DateTool.days360MonthsBetween(LocalDate.of(2012, 3, 9), LocalDate.of(2011, 10, 7)));
Assert.assertEquals(
-1, DateTool.days360MonthsBetween(LocalDate.of(2011, 4, 30), LocalDate.of(2011, 3, 31)));
}
@Test
public void testNextOccurency() {
Assert.assertEquals(
LocalDate.of(2010, 11, 9),
DateTool.nextOccurency(LocalDate.of(2010, 10, 7), LocalDate.of(2011, 3, 9), 2));
Assert.assertEquals(
LocalDate.of(2010, 11, 9),
DateTool.nextOccurency(LocalDate.of(2010, 10, 7), LocalDate.of(2011, 5, 9), 2));
Assert.assertEquals(
LocalDate.of(2010, 8, 31),
DateTool.nextOccurency(LocalDate.of(2010, 8, 7), LocalDate.of(2011, 4, 30), 1));
Assert.assertEquals(
LocalDate.of(2010, 5, 9),
DateTool.nextOccurency(LocalDate.of(2010, 3, 9), LocalDate.of(2011, 3, 9), 2));
}
@Test
public void testLastOccurency() {
Assert.assertEquals(
LocalDate.of(2011, 3, 9),
DateTool.lastOccurency(LocalDate.of(2010, 11, 9), LocalDate.of(2011, 5, 9), 4));
Assert.assertEquals(
LocalDate.of(2011, 7, 9),
DateTool.lastOccurency(LocalDate.of(2010, 11, 9), LocalDate.of(2011, 9, 9), 4));
Assert.assertEquals(
LocalDate.of(2011, 7, 9),
DateTool.lastOccurency(LocalDate.of(2010, 11, 9), LocalDate.of(2011, 10, 9), 4));
Assert.assertEquals(
LocalDate.of(2011, 1, 9),
DateTool.lastOccurency(LocalDate.of(2010, 11, 9), LocalDate.of(2011, 1, 9), 2));
Assert.assertEquals(
LocalDate.of(2011, 7, 31),
DateTool.lastOccurency(LocalDate.of(2007, 4, 30), LocalDate.of(2011, 8, 6), 1));
}
}

View File

@ -0,0 +1,58 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool;
import org.junit.Assert;
import org.junit.Test;
public class TestStringTool {
@Test
public void testToFirstLower() {
String actual = "Test";
String result = "test";
Assert.assertEquals(StringTool.toFirstLower(actual), result);
}
@Test
public void testToFirstUpper() {
String actual = "test";
String result = "Test";
Assert.assertEquals(StringTool.toFirstUpper(actual), result);
}
@Test
public void testFillString() {
String actual = "test";
String resultRight = "test ";
String resultLeft = " test";
Assert.assertEquals(StringTool.fillStringRight(actual, ' ', 8), resultRight);
Assert.assertEquals(StringTool.fillStringRight(actual, ' ', 2), "te");
Assert.assertEquals(StringTool.fillStringLeft(actual, ' ', 8), resultLeft);
Assert.assertEquals(StringTool.fillStringLeft(actual, ' ', 2), "st");
Assert.assertEquals(StringTool.fillStringLeft(resultRight, ' ', 4), " ");
}
}

View File

@ -0,0 +1,79 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.crypto;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import org.junit.Assert;
import org.junit.Test;
/**
* From: http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html This program
* generates a AES key, retrieves its raw bytes, and then reinstantiates a AES key from the key
* bytes. The reinstantiated key is used to initialize a AES cipher for encryption and decryption.
*/
public class AESTest {
/**
* Turns array of bytes into string
*
* @param buf Array of bytes to convert to hex string
* @return Generated hex string
*/
public static String asHex(byte buf[]) {
StringBuffer strbuf = new StringBuffer(buf.length * 2);
int i;
for (i = 0; i < buf.length; i++) {
if (((int) buf[i] & 0xff) < 0x10) strbuf.append("0");
strbuf.append(Long.toString((int) buf[i] & 0xff, 16));
}
return strbuf.toString();
}
@Test
public void test() throws Exception {
// Get the KeyGenerator
KeyGenerator kgen = KeyGenerator.getInstance("AES");
kgen.init(128); // 192 and 256 bits may not be available
// Generate the secret key specs.
SecretKey skey = kgen.generateKey();
byte[] raw = skey.getEncoded();
SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
// Instantiate the cipher
Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
byte[] encrypted = cipher.doFinal("Hello World".getBytes());
cipher.init(Cipher.DECRYPT_MODE, skeySpec);
byte[] original = cipher.doFinal(encrypted);
String originalString = new String(original);
Assert.assertEquals("Hello World", originalString);
}
}

View File

@ -0,0 +1,92 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.crypto;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.junit.Assert;
import org.junit.Test;
/** From: http://stackoverflow.com/questions/587357/rijndael-support-in-java */
public class AESTest2 {
@Test
public void test() throws Exception {
String message = "Hello World";
byte[] CRYPTO_KEY_EXT = {
(byte) 0xEF,
(byte) 0xA4,
(byte) 0xA8,
(byte) 0x04,
(byte) 0xB6,
(byte) 0x14,
(byte) 0x3E,
(byte) 0xF7,
(byte) 0xCE,
(byte) 0xD2,
(byte) 0xA2,
(byte) 0x78,
(byte) 0x10,
(byte) 0xB2,
(byte) 0x2B,
(byte) 0x43
};
byte[] CRYPTO_IV_EXT = {
(byte) 0xCC,
(byte) 0xBA,
(byte) 0xAC,
(byte) 0x54,
(byte) 0xA2,
(byte) 0x35,
(byte) 0x56,
(byte) 0x9E,
(byte) 0xEA,
(byte) 0x36,
(byte) 0xAB,
(byte) 0x31,
(byte) 0xBC,
(byte) 0xB4,
(byte) 0x34,
(byte) 0x31
};
byte[] sessionKey = CRYPTO_KEY_EXT; // Where you get this from is beyond
// the scope of this post
byte[] iv = CRYPTO_IV_EXT; // Ditto
byte[] plaintext = message.getBytes("UTF8"); // Whatever you want to
// encrypt/decrypt
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
// You can use ENCRYPT_MODE or DECRYPT_MODE
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(sessionKey, "AES"), new IvParameterSpec(iv));
byte[] ciphertext = cipher.doFinal(plaintext);
Cipher cipher2 = Cipher.getInstance("AES/CBC/PKCS5Padding");
// You can use DECRYPT_MODE or DECRYPT_MODE
cipher2.init(
Cipher.DECRYPT_MODE, new SecretKeySpec(sessionKey, "AES"), new IvParameterSpec(iv));
byte[] roundTriptext = cipher2.doFinal(ciphertext);
String roundTrip = new String(roundTriptext, "UTF8");
Assert.assertEquals(message, roundTrip);
}
}

View File

@ -0,0 +1,124 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.db;
import com.axelor.db.JPA;
import com.axelor.db.JpaModel;
import com.axelor.db.Query;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "CONTACT_ADDRESS")
public class Address extends JpaModel {
@NotNull private String street;
private String area;
@NotNull private String city;
@NotNull private String zip;
@ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
private Country country;
@NotNull
@ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
private Contact contact;
public Address() {}
public Address(String street, String area, String city) {
this.street = street;
this.area = area;
this.city = city;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
}
public Country getCountry() {
return country;
}
public void setCountry(Country country) {
this.country = country;
}
public Contact getContact() {
return contact;
}
public void setContact(Contact contact) {
this.contact = contact;
}
@Override
public String toString() {
ToStringHelper tsh = MoreObjects.toStringHelper(getClass());
tsh.add("id", getId());
tsh.add("contact", contact);
tsh.add("street", street);
tsh.add("area", area);
tsh.add("city", city);
tsh.add("zip", zip);
tsh.add("country", country);
return tsh.omitNullValues().toString();
}
public static Query<Address> all() {
return JPA.all(Address.class);
}
}

View File

@ -0,0 +1,262 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.db;
import com.axelor.db.JPA;
import com.axelor.db.JpaModel;
import com.axelor.db.Query;
import com.axelor.db.annotations.NameColumn;
import com.axelor.db.annotations.VirtualColumn;
import com.axelor.db.annotations.Widget;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import com.google.common.collect.Lists;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "CONTACT_CONTACT")
public class Contact extends JpaModel {
@ManyToOne(
cascade = {CascadeType.PERSIST, CascadeType.MERGE},
fetch = FetchType.LAZY
)
private Title title;
@NotNull private String firstName;
@NotNull private String lastName;
@Widget(search = {"firstName", "lastName"})
@NameColumn
@VirtualColumn
@Access(AccessType.PROPERTY)
private String fullName;
@NotNull private String email;
private String phone;
private LocalDate dateOfBirth;
@OneToMany(
mappedBy = "contact",
cascade = CascadeType.ALL,
fetch = FetchType.LAZY,
orphanRemoval = true
)
private List<Address> addresses;
@ManyToMany(
cascade = {CascadeType.PERSIST, CascadeType.MERGE},
fetch = FetchType.LAZY
)
private Set<Group> groups;
@Widget(title = "Photo", help = "Max size 4MB.")
@Lob
@Basic(fetch = FetchType.LAZY)
private byte[] image;
@Widget(multiline = true)
private String notes;
private BigDecimal payeurQuality;
@Widget(selection = "select.language")
private String language;
public Contact() {}
public Contact(String firstName) {
this.firstName = firstName;
}
public Contact(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
public Title getTitle() {
return title;
}
public void setTitle(Title title) {
this.title = title;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getFullName() {
return fullName = calculateFullName();
}
protected String calculateFullName() {
fullName = firstName + " " + lastName;
if (this.title != null) {
return this.title.getName() + " " + fullName;
}
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public LocalDate getDateOfBirth() {
return dateOfBirth;
}
public void setDateOfBirth(LocalDate dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
public List<Address> getAddresses() {
return addresses;
}
public void setAddresses(List<Address> addresses) {
this.addresses = addresses;
}
public Group getGroup(int index) {
if (groups == null) return null;
return Lists.newArrayList(groups).get(index);
}
public Set<Group> getGroups() {
return groups;
}
public void setGroups(Set<Group> groups) {
this.groups = groups;
}
public byte[] getImage() {
return image;
}
public void setImage(byte[] image) {
this.image = image;
}
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
public BigDecimal getPayeurQuality() {
return payeurQuality;
}
public void setPayeurQuality(BigDecimal payeurQuality) {
this.payeurQuality = payeurQuality;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public String getLanguageTitle() {
// MetaSelectItem item = MetaSelectItem
// .filter("self.select.name = ?1 AND self.value = ?2",
// "select.language", this.language).fetchOne();
//
// if (item != null) {
// return item.getTitle();
// }
return "french";
}
@Override
public String toString() {
ToStringHelper tsh = MoreObjects.toStringHelper(getClass());
tsh.add("id", getId());
tsh.add("fullName", getFirstName());
tsh.add("email", getEmail());
return tsh.omitNullValues().toString();
}
public Contact find(Long id) {
return JPA.find(Contact.class, id);
}
public static Contact edit(Map<String, Object> values) {
return JPA.edit(Contact.class, values);
}
public static Query<Contact> all() {
return JPA.all(Contact.class);
}
}

View File

@ -0,0 +1,95 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.db;
import com.axelor.db.JPA;
import com.axelor.db.Model;
import com.axelor.db.Query;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "CONTACT_COUNTRY")
public class Country extends Model {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CONTACT_COUNTRY_SEQ")
@SequenceGenerator(
name = "CONTACT_COUNTRY_SEQ",
sequenceName = "CONTACT_COUNTRY_SEQ",
allocationSize = 1
)
private Long id;
@NotNull private String code;
@NotNull private String name;
public Country() {}
public Country(String name, String code) {
this.name = name;
this.code = code;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
@Override
public String toString() {
ToStringHelper tsh = MoreObjects.toStringHelper(getClass());
tsh.add("id", getId());
tsh.add("code", code);
tsh.add("name", name);
return tsh.omitNullValues().toString();
}
public static Query<Country> all() {
return JPA.all(Country.class);
}
}

View File

@ -0,0 +1,95 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.db;
import com.axelor.db.JPA;
import com.axelor.db.Model;
import com.axelor.db.Query;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "CONTACT_GROUP")
public class Group extends Model {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CONTACT_GROUP_SEQ")
@SequenceGenerator(
name = "CONTACT_GROUP_SEQ",
sequenceName = "CONTACT_GROUP_SEQ",
allocationSize = 1
)
private Long id;
@NotNull private String name;
@NotNull private String title;
public Group() {}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Group(String name, String title) {
this.name = name;
this.title = title;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Override
public String toString() {
ToStringHelper tsh = MoreObjects.toStringHelper(getClass());
tsh.add("id", getId());
tsh.add("name", getName());
tsh.add("title", getTitle());
return tsh.omitNullValues().toString();
}
public static Query<Group> all() {
return JPA.all(Group.class);
}
}

View File

@ -0,0 +1,127 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.db;
import com.axelor.db.JPA;
import com.axelor.db.JpaModel;
import com.axelor.db.Query;
import java.time.LocalDate;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "TEST_INVOICE")
public class Invoice extends JpaModel {
@ManyToOne(
fetch = FetchType.LAZY,
cascade = {CascadeType.PERSIST, CascadeType.MERGE}
)
private Move move;
@ManyToOne(
fetch = FetchType.LAZY,
cascade = {CascadeType.PERSIST, CascadeType.MERGE}
)
private Move oldMove;
@ManyToOne(
fetch = FetchType.LAZY,
cascade = {CascadeType.PERSIST, CascadeType.MERGE}
)
private MoveLine rejectMoveLine;
private LocalDate date;
private LocalDate dueDate;
public Move getMove() {
return move;
}
public void setMove(Move move) {
this.move = move;
}
public Move getOldMove() {
return oldMove;
}
public void setOldMove(Move oldMove) {
this.oldMove = oldMove;
}
public MoveLine getRejectMoveLine() {
return rejectMoveLine;
}
public void setRejectMoveLine(MoveLine rejectMoveLine) {
this.rejectMoveLine = rejectMoveLine;
}
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}
public LocalDate getDueDate() {
return dueDate;
}
public void setDueDate(LocalDate dueDate) {
this.dueDate = dueDate;
}
public Invoice persist() {
return JPA.persist(this);
}
public Invoice merge() {
return JPA.merge(this);
}
public Invoice save() {
return JPA.save(this);
}
public void remove() {
JPA.remove(this);
}
public void refresh() {
JPA.refresh(this);
}
public void flush() {
JPA.flush();
}
public static Invoice find(Long id) {
return JPA.find(Invoice.class, id);
}
public static Query<Invoice> all() {
return JPA.all(Invoice.class);
}
}

View File

@ -0,0 +1,96 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.db;
import com.axelor.db.JPA;
import com.axelor.db.JpaModel;
import com.axelor.db.Query;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "TEST_MOVE")
public class Move extends JpaModel {
@OneToMany(
fetch = FetchType.LAZY,
mappedBy = "move",
cascade = CascadeType.ALL,
orphanRemoval = true
)
private List<MoveLine> moveLines;
@ManyToOne(
fetch = FetchType.LAZY,
cascade = {CascadeType.PERSIST, CascadeType.MERGE}
)
private Invoice invoice;
public List<MoveLine> getMoveLines() {
return moveLines;
}
public void setMoveLines(List<MoveLine> moveLines) {
this.moveLines = moveLines;
}
public Invoice getInvoice() {
return invoice;
}
public void setInvoice(Invoice invoice) {
this.invoice = invoice;
}
public Move persist() {
return JPA.persist(this);
}
public Move merge() {
return JPA.merge(this);
}
public Move save() {
return JPA.save(this);
}
public void remove() {
JPA.remove(this);
}
public void refresh() {
JPA.refresh(this);
}
public void flush() {
JPA.flush();
}
public static Move find(Long id) {
return JPA.find(Move.class, id);
}
public static Query<Move> all() {
return JPA.all(Move.class);
}
}

View File

@ -0,0 +1,136 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.db;
import com.axelor.db.JPA;
import com.axelor.db.JpaModel;
import com.axelor.db.Query;
import java.math.BigDecimal;
import java.time.LocalDate;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "TEST_MOVE_LINE")
public class MoveLine extends JpaModel {
@ManyToOne(
fetch = FetchType.LAZY,
cascade = {CascadeType.PERSIST, CascadeType.MERGE}
)
private Move move;
@ManyToOne(
fetch = FetchType.LAZY,
cascade = {CascadeType.PERSIST, CascadeType.MERGE}
)
private Invoice invoiceReject;
private LocalDate date;
private LocalDate dueDate;
private BigDecimal credit;
private BigDecimal debit;
public Move getMove() {
return move;
}
public void setMove(Move move) {
this.move = move;
}
public Invoice getInvoiceReject() {
return invoiceReject;
}
public void setInvoiceReject(Invoice invoiceReject) {
this.invoiceReject = invoiceReject;
}
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}
public LocalDate getDueDate() {
return dueDate;
}
public void setDueDate(LocalDate dueDate) {
this.dueDate = dueDate;
}
public BigDecimal getCredit() {
if (credit == null) return BigDecimal.ZERO;
return credit;
}
public void setCredit(BigDecimal credit) {
this.credit = credit;
}
public BigDecimal getDebit() {
if (debit == null) return BigDecimal.ZERO;
return debit;
}
public void setDebit(BigDecimal debit) {
this.debit = debit;
}
public MoveLine persist() {
return JPA.persist(this);
}
public MoveLine merge() {
return JPA.merge(this);
}
public MoveLine save() {
return JPA.save(this);
}
public void remove() {
JPA.remove(this);
}
public void refresh() {
JPA.refresh(this);
}
public void flush() {
JPA.flush();
}
public static MoveLine find(Long id) {
return JPA.find(MoveLine.class, id);
}
public static Query<MoveLine> all() {
return JPA.all(MoveLine.class);
}
}

View File

@ -0,0 +1,98 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.db;
import com.axelor.db.JPA;
import com.axelor.db.Model;
import com.axelor.db.Query;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
@Entity
@Table(name = "CONTACT_TITLE")
public class Title extends Model {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CONTACT_TITLE_SEQ")
@SequenceGenerator(
name = "CONTACT_TITLE_SEQ",
sequenceName = "CONTACT_TITLE_SEQ",
allocationSize = 1
)
private Long id;
@NotNull
@Column(unique = true)
private String code;
@NotNull
@Column(unique = true)
private String name;
public Title(String name, String code) {
this.name = name;
this.code = code;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
ToStringHelper tsh = MoreObjects.toStringHelper(getClass());
tsh.add("id", getId());
tsh.add("code", getCode());
tsh.add("name", getName());
return tsh.omitNullValues().toString();
}
public static Query<Title> all() {
return JPA.all(Title.class);
}
}

View File

@ -0,0 +1,64 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2019 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.axelor.apps.tool.file;
import java.io.File;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Test;
public class TestFileTool {
@Test
public void create() throws IOException {
String destinationFolder =
System.getProperty("java.io.tmpdir")
+ File.separator
+ "tata"
+ File.separator
+ "titi"
+ File.separator
+ "toto";
String fileName = "toto.txt";
File file = FileTool.create(destinationFolder, fileName);
file.deleteOnExit();
Assert.assertTrue(file.createNewFile());
}
@Test
public void create2() throws IOException {
String fileName =
System.getProperty("java.io.tmpdir")
+ File.separator
+ "tata2"
+ File.separator
+ "titi2"
+ File.separator
+ "toto2"
+ File.separator
+ "toto.txt";
File file = FileTool.create(fileName);
file.deleteOnExit();
Assert.assertTrue(file.createNewFile());
}
}

Some files were not shown because too many files have changed in this diff Show More