예제 #1
0
  /**
   * This method must be implementing by inheriting classes and should return the representation of
   * an object as an URL, for example if implementing class has 2 params: county/region then this
   * method should return: country=XXX&region=YYY, in order to put the object on the request to
   * forward params to next page.
   *
   * @return An URL compatible representation of this object.
   */
  public String toURLParam() {
    StringBuffer res = new StringBuffer();

    if (null != searchType) {
      res.append(Utilities.writeURLParameter("searchType", searchType.toString()));
    }
    if (null != searchString) {
      res.append(Utilities.writeURLParameter("searchString", searchString));
    }
    if (null != relationOp) {
      res.append(Utilities.writeURLParameter("relationOp", relationOp.toString()));
    }
    if (null != searchStringMin) {
      res.append(Utilities.writeURLParameter("searchStringMin", searchStringMin));
    }
    if (null != searchStringMax) {
      res.append(Utilities.writeURLParameter("searchStringMax", searchStringMax));
    }
    if (null != country) {
      res.append(Utilities.writeURLParameter("country", country));
    }
    if (null != yearMin) {
      res.append(Utilities.writeURLParameter("yearMin", yearMin));
    }
    if (null != yearMax) {
      res.append(Utilities.writeURLParameter("yearMax", yearMax));
    }
    // Search in results
    if (null != criteriaSearch) {
      res.append(Utilities.writeURLParameter("criteriaSearch", criteriaSearch));
    }
    if (null != criteriaType) {
      res.append(Utilities.writeURLParameter("criteriaType", criteriaType.toString()));
    }
    if (null != oper) {
      res.append(Utilities.writeURLParameter("oper", oper.toString()));
    }
    return res.toString();
  }
  /**
   * This method must be implementing by inheriting classes and should return the representation of
   * an object as an URL, for example if implementing class has 2 params: county/region then this
   * method should return: country=XXX&region=YYY, in order to put the object on the request to
   * forward params to next page.
   *
   * @return An URL compatible representation of this object.
   */
  public String toURLParam() {
    StringBuffer url = new StringBuffer();

    if (null != author) {
      url.append(Utilities.writeURLParameter("author", author));
    }
    if (null != relationOpAuthor) {
      url.append(Utilities.writeURLParameter("relationOpAuthor", relationOpAuthor.toString()));
    }

    if (null != date) {
      url.append(Utilities.writeURLParameter("date", date));
    }
    if (null != date1) {
      url.append(Utilities.writeURLParameter("date1", date1));
    }
    if (null != relationOpDate) {
      url.append(Utilities.writeURLParameter("relationOpDate", relationOpDate.toString()));
    }

    if (null != title) {
      url.append(Utilities.writeURLParameter("title", title));
    }
    if (null != relationOpTitle) {
      url.append(Utilities.writeURLParameter("relationOpTitle", relationOpTitle.toString()));
    }

    if (null != editor) {
      url.append(Utilities.writeURLParameter("editor", editor));
    }
    if (null != relationOpEditor) {
      url.append(Utilities.writeURLParameter("relationOpEditor", relationOpEditor.toString()));
    }

    if (null != publisher) {
      url.append(Utilities.writeURLParameter("publisher", publisher));
    }
    if (null != relationOpPublisher) {
      url.append(
          Utilities.writeURLParameter("relationOpPublisher", relationOpPublisher.toString()));
    }

    // Search in results
    if (null != criteriaSearch) {
      url.append(Utilities.writeURLParameter("criteriaSearch", criteriaSearch));
    }
    if (null != criteriaType) {
      url.append(Utilities.writeURLParameter("criteriaType", criteriaType.toString()));
    }
    if (null != oper) {
      url.append(Utilities.writeURLParameter("oper", oper.toString()));
    }
    return url.toString();
  }