code: protected void prepareStateCondition(
          CmsUUID projectId,
          CmsResourceState state,
          int mode,
          StringBuffer conditions,
          List<Object> params) {
  
          if (state != null) {
              if ((mode & CmsDriverManager.READMODE_EXCLUDE_STATE) > 0) {
                  // C_READ_MODIFIED_STATES: add condition to match against any state but not given state
                  conditions.append(BEGIN_EXCLUDE_CONDITION);
              } else {
                  // otherwise add condition to match against given state if necessary
                  conditions.append(BEGIN_INCLUDE_CONDITION);
              }
              conditions.append(m_sqlManager.readQuery(projectId, "C_RESOURCES_SELECT_BY_RESOURCE_STATE"));
              conditions.append(END_CONDITION);
              params.add(new Integer(state.getState()));
              params.add(new Integer(state.getState()));
          }
      }
docs: Appends the appropriate selection criteria related with the resource state.<p>
  
  @param projectId the id of the project of the resources
  @param state the resource state
  @param mode the selection mode
  @param conditions buffer to append the selection criteria
  @param params list to append the selection parameters