static void setDeliveryAdvice(Delivery delivery, String advice) throws Exception {
   if (delivery.getClass().isAnnotationPresent(Entity.class)) {
     // In the JPA entity we use a @Transient and @Required for advice property
     // we need to put value to advice in order to pass
     // Hiberntate Validator constraint
     PropertiesManager pm = new PropertiesManager(delivery);
     pm.executeSet("advice", advice);
   }
   // In OX2, advice is a view property then it does not exist in delivery
 }
  public static void setCurrent(HttpServletRequest request) {
    Object rundata = request.getAttribute("rundata");
    String portalUser = (String) request.getSession().getAttribute("xava.portal.user");
    String webUser = (String) request.getSession().getAttribute("xava.user");
    String user = portalUser == null ? webUser : portalUser;
    if (Is.emptyString(user) && rundata != null) {
      PropertiesManager pmRundata = new PropertiesManager(rundata);
      try {
        Object jetspeedUser = pmRundata.executeGet("user");
        PropertiesManager pmUser = new PropertiesManager(jetspeedUser);
        user = (String) pmUser.executeGet("userName");
      } catch (Exception ex) {
        log.warn(XavaResources.getString("warning_get_user"), ex);
        user = null;
      }
    }
    municipioUsuario.set(user);
    request.getSession().setAttribute("xava.user", user);

    municipioUsuarioInfo.set(request.getSession().getAttribute("xava.portal.userinfo"));
  }