private void documentRating(SourceBean request, String mod, SourceBean response)
      throws EMFUserError, SourceBeanException {

    String objId = "";
    String rating = "";
    RequestContainer requestContainer = this.getRequestContainer();
    SessionContainer session = requestContainer.getSessionContainer();
    SessionContainer permanentSession = session.getPermanentContainer();
    UserProfile profile =
        (UserProfile) permanentSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    IEngUserProfile profile2 =
        (IEngUserProfile) permanentSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    String userId =
        (profile.getUserUniqueIdentifier() != null
            ? profile.getUserUniqueIdentifier().toString()
            : "");
    List params = request.getContainedAttributes();
    ListIterator it = params.listIterator();

    while (it.hasNext()) {

      Object par = it.next();
      SourceBeanAttribute p = (SourceBeanAttribute) par;
      String parName = (String) p.getKey();
      logger.debug("got parName=" + parName);
      if (parName.equals("OBJECT_ID")) {
        objId = (String) request.getAttribute("OBJECT_ID");
        logger.debug("got OBJECT_ID from Request=" + objId);
      } else if (parName.equals("RATING")) {
        rating = (String) request.getAttribute("RATING");
      }
    }
    boolean canSee = false;

    BIObject obj = DAOFactory.getBIObjectDAO().loadBIObjectById(new Integer(objId));
    try {
      canSee = ObjectsAccessVerifier.canSee(obj, profile);
    } catch (EMFInternalError e1) {
      e1.printStackTrace();
    }
    if (!canSee) {
      logger.error("Object with label = '" + obj.getLabel() + "' cannot be executed by the user!!");
      Vector v = new Vector();
      v.add(obj.getLabel());
      throw new EMFUserError(EMFErrorSeverity.ERROR, "1075", v, null);
    }
    // get all correct execution roles
    List correctRoles = new ArrayList();
    try {
      correctRoles =
          DAOFactory.getBIObjectDAO().getCorrectRolesForExecution(new Integer(objId), profile2);
    } catch (NumberFormatException e2) {
      e2.printStackTrace();
    }
    if (correctRoles == null || correctRoles.size() == 0) {
      logger.warn("Object cannot be executed by no role of the user");
      throw new EMFUserError(EMFErrorSeverity.ERROR, 1006);
    }

    if (objId != null && !objId.equals("")) {
      if (rating != null && !rating.equals("")) {
        // VOTE!
        DAOFactory.getBIObjectRatingDAO().voteBIObject(obj, userId, rating);
      }
    }

    response.setAttribute("MESSAGEDET", mod);
    response.setAttribute(SpagoBIConstants.PUBLISHER_NAME, "ratingBIObjectPubJ");
    response.setAttribute("OBJECT_ID", objId);
  }