# jmoordbutils

Utilidades

**Dependencias**

```java
 <dependency>
            <groupId>com.github.avbravo</groupId>
            <artifactId>jmoordbutils</artifactId>
            <version>0.1</version>
```

**Repository**

```java
 <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
```

## Migración de avbravoutils a jmoordbutils

## Proyecto ejb

cambiar

![](https://2819834543-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6wzqWd-vuP4MQJ%2F-Lc1WiPBw4oZ0KNAK7bx%2F-Lc1WuawqojufqsJ9eQo%2Freemplazar.png?generation=1554820616699447\&alt=media)

Reemplazar

```java
import com.avbravo.avbravoutils.JsfUtil;  
import com.avbravo.avbravoutils.DateUtil;
import com.avbravo.avbravoutils.printer.Printer;
import com.avbravo.avbravoutils.email.ManagerEmail;
import com.avbravo.avbravoutils.QR;
import com.avbravo.avbravoutils.menu.MenuElement;
```

por

```java
import com.avbravo.jmoordbutils.JsfUtil;
import com.avbravo.jmoordbutils.DateUtil;
import com.avbravo.jmoordbutils.printer.Printer;
import com.avbravo.jmoordbutils.email.ManagerEmail;
import com.avbravo.jmoordbutils.QR;
import com.avbravo.jmoordbutils.menu.MenuElement;
```

Podemos usar un replace All de NetBeans para hacer mas rápido.

![](https://2819834543-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6wzqWd-vuP4MQJ%2F-Lc1WiPBw4oZ0KNAK7bx%2F-Lc1Wuay-kc0aIDbza3i%2Freplace.png?generation=1554820616546558\&alt=media)

## Metodos

* Recuerde que los metodos se elimino get

```java
  cliente.setEdad(DateUtil.getAnioActual() - DateUtil.getAnioDeUnaFecha(cliente.getFechanacimiento()));
```

cambiarlo por

```java
```

## En ResourcesFiles.java

![](https://2819834543-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6wzqWd-vuP4MQJ%2F-Lc1WiPBw4oZ0KNAK7bx%2F-Lc1Wub-e9MA49Xqmppn%2Freso.png?generation=1554820616543120\&alt=media)

* Cambiar

```java
 public void saveLocale() {
        currentLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
        mrb = ResourceBundle.getBundle("com.avbravo.store.properties.messages",
                currentLocale);
        arb = ResourceBundle.getBundle("com.avbravoutils.properties.application",
                currentLocale);
    }
```

* **por**&#x20;

  arb = ResourceBundle.getBundle("com.jmoordbutils.properties.application",

Segmento

```java
 public void saveLocale() {
        currentLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
        mrb = ResourceBundle.getBundle("com.avbravo.store.properties.messages",
                currentLocale);
        arb = ResourceBundle.getBundle("com.jmoordbutils.properties.application",
                currentLocale);
    }
```

## Editar login.xhtml

![](https://2819834543-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6wzqWd-vuP4MQJ%2F-Lc1WiPBw4oZ0KNAK7bx%2F-Lc1Wub16NDFnKva2icG%2Flogin.png?generation=1554820607220055\&alt=media)

**Cambiar**

```java
  <f:facet name="first">
            <f:view locale="#{idiomas.locale}"></f:view>
            <f:loadBundle basename="com.avbravo.store.properties.messages" var="msg" />
            <f:loadBundle basename="com.avbravoutils.properties.application" var="app" />

        </f:facet>
```

**Por**

```java
  <f:facet name="first">
            <f:view locale="#{idiomas.locale}"></f:view>
            <f:loadBundle basename="com.avbravo.store.properties.messages" var="msg" />
            <f:loadBundle basename="com.jmoordbutils.properties.application" var="app" />

        </f:facet>
```

## Editar template.xhtml

![](https://2819834543-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lc1Wg6wzqWd-vuP4MQJ%2F-Lc1WiPBw4oZ0KNAK7bx%2F-Lc1Wub3JkCw7oRMNlGM%2Ftemplate.png?generation=1554820616798751\&alt=media)

**cambiar**

```java
  <f:facet name="first">
            <f:view locale="#{idiomas.locale}"></f:view>
            <f:loadBundle basename="com.avbravo.store.properties.messages" var="msg" />
            <f:loadBundle basename="com.avbravoutils.properties.application" var="app" />

        </f:facet>
```

Por

```
 <f:facet name="first">
            <f:view locale="#{idiomas.locale}"></f:view>
            <f:loadBundle basename="com.avbravo.store.properties.messages" var="msg" />
            <f:loadBundle basename="com.jmoordbutils.properties.application" var="app" />

        </f:facet>
```
