+++ /dev/null
-/*
- * Copyright (C) 2016 - 2020 Free Software Foundation
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU 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 org.mxchange.jfinancials.converter.generic_product;
-
-import javax.enterprise.inject.spi.CDI;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.faces.convert.FacesConverter;
-import org.mxchange.jfinancials.beans.generic_product.list.FinancialsProductListWebViewBean;
-import org.mxchange.jfinancials.beans.generic_product.list.FinancialsProductListWebViewController;
-import org.mxchange.jproduct.exceptions.product.ProductNotFoundException;
-import org.mxchange.jproduct.model.product.Product;
-
-/**
- * Converter for product id <-> valid product instance
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@FacesConverter ("GenericProductConverter")
-public class FinancialsGenericProductConverter implements Converter<Product> {
-
- /**
- * Product backing bean
- */
- private static FinancialsProductListWebViewController PRODUCT_LIST_CONTROLLER;
-
- @Override
- public Product getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
- // Is the instance there?
- if (null == PRODUCT_LIST_CONTROLLER) {
- // Get bean from CDI directly
- PRODUCT_LIST_CONTROLLER = CDI.current().select(FinancialsProductListWebViewBean.class).get();
- }
-
- // Is the value null or empty?
- if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
- // Warning message
- // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
- // Return null
- return null;
- }
-
- // Init instance
- Product product = null;
-
- try {
- // Try to parse the value as long
- final Long productId = Long.valueOf(submittedValue);
-
- // Try to get user instance from it
- product = PRODUCT_LIST_CONTROLLER.findProductById(productId);
- } catch (final NumberFormatException ex) {
- // Throw again
- throw new ConverterException(ex);
- } catch (final ProductNotFoundException ex) {
- // Debug message
- // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: Exception: {0} - Returning null ...", ex)); //NOI18N
- }
-
- // Return it
- return product;
- }
-
- @Override
- public String getAsString (final FacesContext context, final UIComponent component, final Product value) {
- // Is the object null?
- if ((null == value) || (String.valueOf(value).isEmpty())) {
- // Is null
- return ""; //NOI18N
- }
-
- // Return id number
- return String.valueOf(value.getProductId());
- }
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2016 - 2020 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU 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 org.mxchange.jfinancials.converter.product.generic_product;
+
+import javax.enterprise.inject.spi.CDI;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import org.mxchange.jfinancials.beans.generic_product.list.FinancialsProductListWebViewBean;
+import org.mxchange.jfinancials.beans.generic_product.list.FinancialsProductListWebViewController;
+import org.mxchange.jproduct.exceptions.product.ProductNotFoundException;
+import org.mxchange.jproduct.model.product.Product;
+
+/**
+ * Converter for product id <-> valid product instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("GenericProductConverter")
+public class FinancialsGenericProductConverter implements Converter<Product> {
+
+ /**
+ * Product backing bean
+ */
+ private static FinancialsProductListWebViewController PRODUCT_LIST_CONTROLLER;
+
+ @Override
+ public Product getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+ // Is the value null or empty?
+ if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+ // Warning message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+ // Return null
+ return null;
+ }
+
+ // Init instance
+ Product product = null;
+
+ // Is the instance there?
+ if (null == PRODUCT_LIST_CONTROLLER) {
+ // Get bean from CDI directly
+ PRODUCT_LIST_CONTROLLER = CDI.current().select(FinancialsProductListWebViewBean.class).get();
+ }
+
+ try {
+ // Try to parse the value as long
+ final Long productId = Long.valueOf(submittedValue);
+
+ // Try to get user instance from it
+ product = PRODUCT_LIST_CONTROLLER.findProductById(productId);
+ } catch (final NumberFormatException ex) {
+ // Throw again
+ throw new ConverterException(ex);
+ } catch (final ProductNotFoundException ex) {
+ // Debug message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: Exception: {0} - Returning null ...", ex)); //NOI18N
+ }
+
+ // Return it
+ return product;
+ }
+
+ @Override
+ public String getAsString (final FacesContext context, final UIComponent component, final Product value) {
+ // Is the object null?
+ if ((null == value) || (String.valueOf(value).isEmpty())) {
+ // Is null
+ return ""; //NOI18N
+ }
+
+ // Return id number
+ return String.valueOf(value.getProductId());
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 - 2020 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU 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 org.mxchange.jfinancials.converter.product.product_category;
+
+import javax.enterprise.inject.spi.CDI;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import org.mxchange.jfinancials.beans.product_category.list.FinancialsCategoryListWebViewBean;
+import org.mxchange.jfinancials.beans.product_category.list.FinancialsCategoryListWebViewController;
+import org.mxchange.jproduct.exceptions.category.CategoryNotFoundException;
+import org.mxchange.jproduct.model.category.Category;
+
+/**
+ * Converter for category id <-> valid category instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("ProductCategoryConverter")
+public class FinancialsProductCategoryConverter implements Converter<Category> {
+
+ /**
+ * Category backing bean
+ */
+ private static FinancialsCategoryListWebViewController CATEGORY_LIST_CONTROLLER;
+
+ @Override
+ public Category getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+ // Is the value null or empty?
+ if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+ // Warning message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+ // Return null
+ return null;
+ }
+
+ // Init instance
+ Category category = null;
+
+ // Is the instance there?
+ if (null == CATEGORY_LIST_CONTROLLER) {
+ // Get bean from CDI directly
+ CATEGORY_LIST_CONTROLLER = CDI.current().select(FinancialsCategoryListWebViewBean.class).get();
+ }
+
+ try {
+ // Try to parse the value as long
+ final Long categoryId = Long.valueOf(submittedValue);
+
+ // Try to get user instance from it
+ category = CATEGORY_LIST_CONTROLLER.findCategoryById(categoryId);
+ } catch (final NumberFormatException ex) {
+ // Throw again
+ throw new ConverterException(ex);
+ } catch (final CategoryNotFoundException ex) {
+ // Debug message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: Exception: {0} - Returning null ...", ex)); //NOI18N
+ }
+
+ // Return it
+ return category;
+ }
+
+ @Override
+ public String getAsString (final FacesContext context, final UIComponent component, final Category value) {
+ // Is the object null?
+ if ((null == value) || (String.valueOf(value).isEmpty())) {
+ // Is null
+ return ""; //NOI18N
+ }
+
+ // Return id number
+ return String.valueOf(value.getCategoryId());
+ }
+
+}
+++ /dev/null
-/*
- * Copyright (C) 2016 - 2020 Free Software Foundation
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU 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 org.mxchange.jfinancials.converter.product_category;
-
-import javax.enterprise.inject.spi.CDI;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.faces.convert.FacesConverter;
-import org.mxchange.jfinancials.beans.product_category.list.FinancialsCategoryListWebViewBean;
-import org.mxchange.jfinancials.beans.product_category.list.FinancialsCategoryListWebViewController;
-import org.mxchange.jproduct.exceptions.category.CategoryNotFoundException;
-import org.mxchange.jproduct.model.category.Category;
-
-/**
- * Converter for category id <-> valid category instance
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@FacesConverter ("ProductCategoryConverter")
-public class FinancialsProductCategoryConverter implements Converter<Category> {
-
- /**
- * Category backing bean
- */
- private static FinancialsCategoryListWebViewController CATEGORY_LIST_CONTROLLER;
-
- @Override
- public Category getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
- // Is the instance there?
- if (null == CATEGORY_LIST_CONTROLLER) {
- // Get bean from CDI directly
- CATEGORY_LIST_CONTROLLER = CDI.current().select(FinancialsCategoryListWebViewBean.class).get();
- }
-
- // Is the value null or empty?
- if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
- // Warning message
- // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
-
- // Return null
- return null;
- }
-
- // Init instance
- Category category = null;
-
- try {
- // Try to parse the value as long
- final Long categoryId = Long.valueOf(submittedValue);
-
- // Try to get user instance from it
- category = CATEGORY_LIST_CONTROLLER.findCategoryById(categoryId);
- } catch (final NumberFormatException ex) {
- // Throw again
- throw new ConverterException(ex);
- } catch (final CategoryNotFoundException ex) {
- // Debug message
- // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: Exception: {0} - Returning null ...", ex)); //NOI18N
- }
-
- // Return it
- return category;
- }
-
- @Override
- public String getAsString (final FacesContext context, final UIComponent component, final Category value) {
- // Is the object null?
- if ((null == value) || (String.valueOf(value).isEmpty())) {
- // Is null
- return ""; //NOI18N
- }
-
- // Return id number
- return String.valueOf(value.getCategoryId());
- }
-
-}
value="#{basicDataListController.allBasicData}"
var="basicData"
itemValue="#{basicData}"
- itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
+ itemLabel="#{beanHelper.renderBasicData(basicData, true, false)}"
/>
</p:selectOneMenu>
value="#{basicDataListController.allBasicData}"
var="basicData"
itemValue="#{basicData}"
- itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
+ itemLabel="#{beanHelper.renderBasicData(basicData, true, false)}"
/>
</p:selectCheckboxMenu>
</f:facet>
<p:link
outcome="admin_show_basic_data"
- value="#{beanHelper.renderBasicData(genericProduct.productManufacturer, true)}"
+ value="#{beanHelper.renderBasicData(genericProduct.productManufacturer, true, false)}"
title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
rendered="#{not empty genericProduct.productManufacturer}"
>