package org.mxchange.jfinancials.beans;
import java.io.Serializable;
-import java.security.Principal;
-import java.text.MessageFormat;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
+import org.mxchange.jcoreee.bean.BaseBean;
import org.mxchange.jusercore.model.user.UserUtils;
/**
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-public abstract class BaseFinancialsController implements Serializable {
+public abstract class BaseFinancialsController extends BaseBean implements Serializable {
/**
* Serial number
protected BaseFinancialsController () {
}
- /**
- * Determines principal's name or returns null if no principal (security) is
- * set.
- * <p>
- * @return Principal's name or null
- */
- protected String determinePrincipalName () {
- // Get principal
- Principal userPrincipal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal();
-
- // Init with null
- String principalName = null;
-
- // Is the principal set?
- if (userPrincipal instanceof Principal) {
- // Get principal's name
- principalName = userPrincipal.getName();
- }
-
- // Return it
- return principalName;
- }
-
- /**
- * Returns given property key or throws an exception if not found.
- * <p>
- * @param parameterKey Property key
- * <p>
- * @return Property value
- * <p>
- * @throws NullPointerException If given key is not found
- * @throws NumberFormatException If no number is given in context parameter
- */
- protected int getIntegerContextParameter (final String parameterKey) throws NullPointerException, NumberFormatException {
- // Get context parameter
- Integer contextValue = Integer.parseInt(this.getStringContextParameter(parameterKey));
-
- // Return it
- return contextValue;
- }
-
- /**
- * Returns given property key or throws an exception if not found.
- * <p>
- * @param parameterKey Property key
- * <p>
- * @return Property value
- * <p>
- * @throws NullPointerException If given key is not found
- */
- protected String getStringContextParameter (final String parameterKey) throws NullPointerException {
- // Get context parameter
- String contextValue = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(parameterKey);
-
- // Is it null?
- if (null == contextValue) {
- // Throw NPE
- throw new NullPointerException(MessageFormat.format("parameterKey={0} is not set.", parameterKey)); //NOI18N
- }
-
- // Return it
- return contextValue;
- }
-
- /**
- * Checks whether debug mode is enabled for given controller
- * <p>
- * @param controllerName Name of controller
- * <p>
- * @return Whether debug mode is enabled
- */
- protected boolean isDebugModeEnabled (final String controllerName) {
- // Parameters should be valid
- if (null == controllerName) {
- // Throw NPE
- throw new NullPointerException("controllerName is null"); //NOI18N
- } else if (controllerName.isEmpty()) {
- // Is empty
- throw new IllegalArgumentException("controllerName is empty"); //NOI18N
- }
-
- // Try to get context parameter
- String contextParameter = this.getStringContextParameter(String.format("is_debug_%s_enabled", controllerName)); //NOI18N
-
- // Is it set and true?
- boolean isEnabled = (Boolean.parseBoolean(contextParameter) == Boolean.TRUE);
-
- // Return it
- return isEnabled;
- }
-
/**
* Checks if given password is to weak to be used
* <p>
return isWeak;
}
- /**
- * Shows a faces message for given causing exception. The message from the
- * exception is being inserted into the message.
- * <p>
- * @param clientId Client id to send message to
- * @param cause Causing exception
- */
- protected void showFacesMessage (final String clientId, final Throwable cause) {
- // Get context and add message
- this.showFacesMessage(clientId, cause.getMessage());
- }
-
- /**
- * Shows a faces message with given message (i18n) key.
- * <p>
- * @param clientId Client id to send message to
- * @param i18nKey Message key
- * <p>
- * @throws NullPointerException If clientId or i18nKey is null
- * @throws IllegalArgumentException If clientId or i18nKey is empty
- */
- protected void showFacesMessage (final String clientId, final String i18nKey) throws NullPointerException, IllegalArgumentException {
- // Both parameter must be valid
- if (null == clientId) {
- // Throw NPE
- throw new NullPointerException("clientId is null"); //NOI18N
- } else if (clientId.isEmpty()) {
- // Is empty
- throw new IllegalArgumentException("clientId is null"); //NOI18N
- } else if (null == i18nKey) {
- // Throw NPE
- throw new NullPointerException("i18nKey is null"); //NOI18N
- } else if (i18nKey.isEmpty()) {
- // Is empty
- throw new IllegalArgumentException("i18nKey is null"); //NOI18N
- }
-
- // Get current locale
- Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
-
- // Get bundle bundle
- ResourceBundle bundle = ResourceBundle.getBundle("org.mxchange.localization.bundle", locale);
-
- // Default is i18nKey
- String message = i18nKey;
-
- // Try it
- try {
- // Get message
- message = bundle.getString(i18nKey);
- } catch (final MissingResourceException ex) {
- // Did not find it, ignored
- }
-
- // Get context and add message
- FacesContext.getCurrentInstance().addMessage(clientId, new FacesMessage(message));
- }
-
}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.beans.financial.income;
-
-import java.text.MessageFormat;
-import java.util.Arrays;
-import java.util.List;
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.RequestScoped;
-import javax.faces.view.facelets.FaceletException;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.mxchange.jfinancials.beans.BaseFinancialsController;
-import org.mxchange.jfinancials.beans.login.user.FinancialsUserLoginWebSessionController;
-import org.mxchange.jfinancials.financial.income.FinancialIncomeSessionBeanRemote;
-import org.mxchange.jfinancials.model.income.BillableIncome;
-import org.mxchange.jfinancials.model.income.FinancialIncome;
-import org.mxchange.jfinancials.model.income.interval.FinancialInterval;
-
-/**
- * An administrative financial income bean (controller)
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Named ("financialIncomeController")
-@RequestScoped
-public class FinancialsAdminFinancialIncomeWebRequestBean extends BaseFinancialsController implements FinancialsAdminFinancialIncomeWebRequestController {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 56_189_028_928_371L;
-
- /**
- * Remote contact bean
- */
- private FinancialIncomeSessionBeanRemote financialBean;
-
- /**
- * Income interval
- */
- private FinancialInterval incomeInterval;
-
- /**
- * Income single amount
- */
- private Float incomeSingleAmount;
-
- /**
- * Income (type) title
- */
- private String incomeTitle;
-
- /**
- * User instance
- */
- @Inject
- private FinancialsUserLoginWebSessionController userLoginController;
-
- /**
- * Constructor
- */
- public FinancialsAdminFinancialIncomeWebRequestBean () {
- // Call super constructor
- super();
- }
-
- /**
- * Adds income data by calling proper business method of the EJB.
- * <p>
- * @return Redirect outcome
- */
- public String addFinancialIncome () {
- // Is all data valid?
- if (!this.userLoginController.isUserLoggedIn()) {
- // Not logged-in
- throw new IllegalStateException("User is not logged-in"); //NOI18N
- } else if (null == this.getIncomeInterval()) {
- // Throw NPE
- throw new NullPointerException("incomeInterval is null"); //NOI18N
- } else if (null == this.getIncomeSingleAmount()) {
- // Throw again
- throw new NullPointerException("incomeSingleAmount is null"); //NOI18N
- } else if (this.getIncomeSingleAmount() < 0) {
- // Not allowed value
- throw new IllegalArgumentException(MessageFormat.format("incomeSingleAmount={0} is not valid.", this.getIncomeSingleAmount())); //NOI18N
- } else if (null == this.getIncomeTitle()) {
- // Throw again
- throw new NullPointerException("incomeTitle is null"); //NOI18N
- } else if (this.getIncomeTitle().isEmpty()) {
- // Should not be empty
- throw new IllegalArgumentException("incomeTitle is empty"); //NOI18N
- }
-
- // Now that all required data has been entered, prepare new income instance
- BillableIncome income = new FinancialIncome(this.getIncomeTitle(), this.getIncomeSingleAmount(), this.getIncomeInterval(), this.userLoginController.getLoggedInUser());
-
- // Handle it over to the EJB
- // @TODO Use updated income instance, e.g. fire event
- BillableIncome updatedIncome = this.financialBean.addIncome(income);
-
- // All fine
- return "add_user_fiancial_income"; //NOI18N
- }
-
- @Override
- public List<FinancialInterval> getAllIncomeIntervals () {
- // Init array
- List<FinancialInterval> incomeIntervals = Arrays.asList(FinancialInterval.values());
-
- // Return it
- return incomeIntervals;
- }
-
- @Override
- public FinancialInterval getIncomeInterval () {
- return this.incomeInterval;
- }
-
- @Override
- public void setIncomeInterval (final FinancialInterval incomeInterval) {
- this.incomeInterval = incomeInterval;
- }
-
- @Override
- public Float getIncomeSingleAmount () {
- return this.incomeSingleAmount;
- }
-
- @Override
- public void setIncomeSingleAmount (final Float incomeSingleAmount) {
- this.incomeSingleAmount = incomeSingleAmount;
- }
-
- @Override
- public String getIncomeTitle () {
- return this.incomeTitle;
- }
-
- @Override
- public void setIncomeTitle (final String incomeTitle) {
- this.incomeTitle = incomeTitle;
- }
-
- /**
- * Post-initialization of this class
- */
- @PostConstruct
- public void init () {
- // Try it
- try {
- // Get initial context
- Context context = new InitialContext();
-
- // Try to lookup
- this.financialBean = (FinancialIncomeSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/financial!org.mxchange.jfinancials.financial.income.FinancialIncomeSessionBeanRemote"); //NOI18N
- } catch (final NamingException e) {
- // Throw again
- throw new FaceletException(e);
- }
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * 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.beans.financial.income;
-
-import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jfinancials.model.income.interval.FinancialInterval;
-
-/**
- * An administrative interface for financial income beans
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface FinancialsAdminFinancialIncomeWebRequestController extends Serializable {
-
- /**
- * Getter for income single amount
- * <p>
- * @return Income single amount
- */
- Float getIncomeSingleAmount ();
-
- /**
- * Setter for income single amount
- * <p>
- * @param incomeSingleAmount Income single amount
- */
- void setIncomeSingleAmount (final Float incomeSingleAmount);
-
- /**
- * Getter for income (type) title
- * <p>
- * @return Income title
- */
- String getIncomeTitle ();
-
- /**
- * Setter for income (type) title
- * <p>
- * @param incomeTitle Income title
- */
- void setIncomeTitle (final String incomeTitle);
-
- /**
- * Getter for income interval
- * <p>
- * @return Income interval
- */
- FinancialInterval getIncomeInterval ();
-
- /**
- * Setter for income (type) interval
- * <p>
- * @param incomeInterval Income interval
- */
- void setIncomeInterval (final FinancialInterval incomeInterval);
-
- /**
- * Returns a list of all all income intervals
- * <p>
- * @return Income intervals
- */
- List<FinancialInterval> getAllIncomeIntervals ();
-
-}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.beans.financial.income;
+
+import java.text.MessageFormat;
+import java.util.Arrays;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.RequestScoped;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jfinancials.beans.BaseFinancialsController;
+import org.mxchange.jfinancials.beans.login.user.FinancialsUserLoginWebSessionController;
+import org.mxchange.jfinancials.financial.income.FinancialIncomeSessionBeanRemote;
+import org.mxchange.jfinancials.model.income.BillableIncome;
+import org.mxchange.jfinancials.model.income.FinancialIncome;
+import org.mxchange.jfinancials.model.income.interval.FinancialInterval;
+
+/**
+ * An administrative financial income bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("financialIncomeController")
+@RequestScoped
+public class FinancialsIncomeWebRequestBean extends BaseFinancialsController implements FinancialsIncomeWebRequestController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 56_189_028_928_371L;
+
+ /**
+ * Remote contact bean
+ */
+ private FinancialIncomeSessionBeanRemote financialBean;
+
+ /**
+ * Income interval
+ */
+ private FinancialInterval incomeInterval;
+
+ /**
+ * Income single amount
+ */
+ private Float incomeSingleAmount;
+
+ /**
+ * Income (type) title
+ */
+ private String incomeTitle;
+
+ /**
+ * User instance
+ */
+ @Inject
+ private FinancialsUserLoginWebSessionController userLoginController;
+
+ /**
+ * Constructor
+ */
+ public FinancialsIncomeWebRequestBean () {
+ // Call super constructor
+ super();
+ }
+
+ /**
+ * Adds income data by calling proper business method of the EJB.
+ * <p>
+ * @return Redirect outcome
+ */
+ public String addIncome () {
+ // Is all data valid?
+ if (!this.userLoginController.isUserLoggedIn()) {
+ // Not logged-in
+ throw new IllegalStateException("User is not logged-in"); //NOI18N
+ } else if (null == this.getIncomeInterval()) {
+ // Throw NPE
+ throw new NullPointerException("incomeInterval is null"); //NOI18N
+ } else if (null == this.getIncomeSingleAmount()) {
+ // Throw again
+ throw new NullPointerException("incomeSingleAmount is null"); //NOI18N
+ } else if (this.getIncomeSingleAmount() < 0) {
+ // Not allowed value
+ throw new IllegalArgumentException(MessageFormat.format("incomeSingleAmount={0} is not valid.", this.getIncomeSingleAmount())); //NOI18N
+ } else if (null == this.getIncomeTitle()) {
+ // Throw again
+ throw new NullPointerException("incomeTitle is null"); //NOI18N
+ } else if (this.getIncomeTitle().isEmpty()) {
+ // Should not be empty
+ throw new IllegalArgumentException("incomeTitle is empty"); //NOI18N
+ }
+
+ // Now that all required data has been entered, prepare new income instance
+ BillableIncome income = new FinancialIncome(this.getIncomeTitle(), this.getIncomeSingleAmount(), this.getIncomeInterval(), this.userLoginController.getLoggedInUser());
+
+ // Handle it over to the EJB
+ // @TODO Use updated income instance, e.g. fire event
+ BillableIncome updatedIncome = this.financialBean.addIncome(income);
+
+ // All fine
+ return "add_user_fiancial_income"; //NOI18N
+ }
+
+ @Override
+ public List<FinancialInterval> allIncomeIntervals () {
+ // Init array
+ List<FinancialInterval> incomeIntervals = Arrays.asList(FinancialInterval.values());
+
+ // Return it
+ return incomeIntervals;
+ }
+
+ @Override
+ public FinancialInterval getIncomeInterval () {
+ return this.incomeInterval;
+ }
+
+ @Override
+ public void setIncomeInterval (final FinancialInterval incomeInterval) {
+ this.incomeInterval = incomeInterval;
+ }
+
+ @Override
+ public Float getIncomeSingleAmount () {
+ return this.incomeSingleAmount;
+ }
+
+ @Override
+ public void setIncomeSingleAmount (final Float incomeSingleAmount) {
+ this.incomeSingleAmount = incomeSingleAmount;
+ }
+
+ @Override
+ public String getIncomeTitle () {
+ return this.incomeTitle;
+ }
+
+ @Override
+ public void setIncomeTitle (final String incomeTitle) {
+ this.incomeTitle = incomeTitle;
+ }
+
+ /**
+ * Post-initialization of this class
+ */
+ @PostConstruct
+ public void init () {
+ // Try it
+ try {
+ // Get initial context
+ Context context = new InitialContext();
+
+ // Try to lookup
+ this.financialBean = (FinancialIncomeSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/financial!org.mxchange.jfinancials.financial.income.FinancialIncomeSessionBeanRemote"); //NOI18N
+ } catch (final NamingException e) {
+ // Throw again
+ throw new FaceletException(e);
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.beans.financial.income;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jfinancials.model.income.interval.FinancialInterval;
+
+/**
+ * An administrative interface for financial income beans
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface FinancialsIncomeWebRequestController extends Serializable {
+
+ /**
+ * Getter for income single amount
+ * <p>
+ * @return Income single amount
+ */
+ Float getIncomeSingleAmount ();
+
+ /**
+ * Setter for income single amount
+ * <p>
+ * @param incomeSingleAmount Income single amount
+ */
+ void setIncomeSingleAmount (final Float incomeSingleAmount);
+
+ /**
+ * Getter for income (type) title
+ * <p>
+ * @return Income title
+ */
+ String getIncomeTitle ();
+
+ /**
+ * Setter for income (type) title
+ * <p>
+ * @param incomeTitle Income title
+ */
+ void setIncomeTitle (final String incomeTitle);
+
+ /**
+ * Getter for income interval
+ * <p>
+ * @return Income interval
+ */
+ FinancialInterval getIncomeInterval ();
+
+ /**
+ * Setter for income (type) interval
+ * <p>
+ * @param incomeInterval Income interval
+ */
+ void setIncomeInterval (final FinancialInterval incomeInterval);
+
+ /**
+ * Returns a list of all all income intervals
+ * <p>
+ * @return Income intervals
+ */
+ List<FinancialInterval> allIncomeIntervals ();
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.beans.financial.receipt;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.RequestScoped;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jfinancials.beans.BaseFinancialsController;
+import org.mxchange.jfinancials.beans.login.user.FinancialsUserLoginWebSessionController;
+import org.mxchange.jfinancials.financial.receipt.FinancialReceiptSessionBeanRemote;
+
+/**
+ * An administrative financial receipt bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("financialReceiptController")
+@RequestScoped
+public class FinancialsReceiptWebRequestBean extends BaseFinancialsController implements FinancialsReceiptWebRequestController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 56_189_028_928_371L;
+
+ /**
+ * Remote contact bean
+ */
+ private FinancialReceiptSessionBeanRemote financialBean;
+
+ /**
+ * User instance
+ */
+ @Inject
+ private FinancialsUserLoginWebSessionController userLoginController;
+
+ /**
+ * Constructor
+ */
+ public FinancialsReceiptWebRequestBean () {
+ // Call super constructor
+ super();
+ }
+
+ /**
+ * Post-initialization of this class
+ */
+ @PostConstruct
+ public void init () {
+ // Try it
+ try {
+ // Get initial context
+ Context context = new InitialContext();
+
+ // Try to lookup
+ this.financialBean = (FinancialReceiptSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/financial!org.mxchange.jfinancials.financial.receipt.FinancialReceiptSessionBeanRemote"); //NOI18N
+ } catch (final NamingException e) {
+ // Throw again
+ throw new FaceletException(e);
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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.beans.financial.receipt;
+
+import java.io.Serializable;
+
+/**
+ * An administrative interface for financial receipt beans
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface FinancialsReceiptWebRequestController extends Serializable {
+
+}
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
- xmlns:p="http://primefaces.org/ui">
+ xmlns:p="http://primefaces.org/ui"
+ >
<div class="para notice">
#{msg.PERSONAL_DATA_MINIMUM_NOTICE}
<div class="table_right_medium">
<h:selectOneMenu styleClass="select" id="incomeInterval" value="#{financialIncomeController.incomeInterval}" required="true" requiredMessage="#{msg.FIELD_FINANCIAL_INCOME_REQUIRED}">
<f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" noSelectionOption="true" />
- <f:selectItems value="#{financialIncomeController.allIncomeIntervals}" var="incomeInterval" itemValue="#{incomeInterval}" itemLabel="#{msg[incomeInterval.concat('_INTERVAL')]}" />
+ <f:selectItems value="#{financialIncomeController.allIncomeIntervals()}" var="incomeInterval" itemValue="#{incomeInterval}" itemLabel="#{msg[incomeInterval.concat('_INTERVAL')]}" />
</h:selectOneMenu>
</div>
<div class="table_footer">
<h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" id="submit_add_income" type="submit" action="#{financialIncomeController.addFinancialIncome()}" value="#{msg.BUTTON_LOGIN_FINCIAL_ADD_INCOME}" />
+ <h:commandButton styleClass="submit" id="submit_add_income" type="submit" action="#{financialIncomeController.addIncome()}" value="#{msg.BUTTON_LOGIN_FINCIAL_ADD_INCOME}" />
</div>
</h:panelGroup>
</h:form>
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
+ xmlns:p="http://primefaces.org/ui">
+ >
<ui:composition template="/WEB-INF/templates/login/user/user_base.tpl">
<ui:define name="login_title">
<ui:define name="content">
<h:form id="form_add_financials_receipt">
+ <h:panelGroup styleClass="table_medium" layout="block">
+ <div class="table_header">
+ <h:outputText value="#{msg.LOGIN_FINANCIAL_ADD_RECEIPT_FORM_TITLE}" />
+ </div>
+ <div class="table_row">
+ <div class="table_left_medium">
+ <h:outputLabel for="receiptCompany" value="#{msg.LOGIN_FINANCIAL_SELECT_RECEIPT_COMPANY}" />
+ </div>
+
+ <div class="table_right_medium">
+ <h:selectOneMenu styleClass="select" id="receiptCompany" value="#{financialReceiptController.incomeInterval}" required="true" requiredMessage="#{msg.FIELD_FINANCIAL_RECEIPT_COMPANY_REQUIRED}">
+ <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" noSelectionOption="true" />
+ <f:selectItems value="#{financialReceiptController.allRegisteredCompanies()}" var="receiptCompany" itemValue="#{receiptCompany}" itemLabel="#{receiptCompany.someFoo}" />
+ </h:selectOneMenu>
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left_medium">
+ <h:outputLabel for="receiptCreated" value="#{msg.LOGIN_FINANCIAL_ENTER_RECEIPT_CREATED}" />
+ </div>
+
+ <div class="table_right_medium">
+ <p:calendar id="receiptCreated" locale="#{localizationController.locale.displayCountry}" value="#{financialReceiptController.receiptCreated}" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <h:outputText value="#{msg.LOGIN_FINANCIAL_COMPANY_NOT_FOUND}" />
+ <h:outputText value=" " />
+ <p:link title="#{msg.LINK_LOGIN_FINANCIAL_ADD_COMPANY_TITLE}" outcome="login_add_receipt_company" value="#{msg.LINK_LOGIN_FINANCIAL_ADD_COMPANY}" />
+ </div>
+
+ <div class="table_footer">
+ <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+
+ <h:commandButton styleClass="submit" id="submit_add_income" type="submit" action="#{financialReceiptController.addReceipt()}" value="#{msg.BUTTON_LOGIN_FINCIAL_ADD_INCOME}" />
+ </div>
+ </h:panelGroup>
</h:form>
</ui:define>
</ui:composition>