Example #1
0
        public void onSuccess(Long result) {
          params.setId(result.intValue());

          if (isUserNews) {
            Main.get().mainPanel.search.historySearch.userNews.addNewSavedSearch(params.clone());
            Main.get()
                .mainPanel
                .search
                .historySearch
                .stackPanel
                .showStack(UISearchConstants.SEARCH_USER_NEWS);
            Main.get().mainPanel.dashboard.newsDashboard.getUserSearchs(true);
          } else {
            Main.get().mainPanel.search.historySearch.searchSaved.addNewSavedSearch(params.clone());
            Main.get()
                .mainPanel
                .search
                .historySearch
                .stackPanel
                .showStack(UISearchConstants.SEARCH_SAVED);
          }

          searchSavedName.setText(""); // Clean name atfer saved
          Main.get().mainPanel.search.searchBrowser.searchIn.status.unsetFlag_saveSearch();
        }
Example #2
0
  /** Executes the search */
  public void executeSearch() {
    switch (searchMode) {
      case SEARCH_MODE_SIMPLE:
        SearchSimple searchSimple = Main.get().mainPanel.search.searchBrowser.searchIn.searchSimple;
        Main.get()
            .mainPanel
            .search
            .searchBrowser
            .searchIn
            .futuramaWalking
            .evaluate(searchSimple.fullText.getText());
        controlSearch.executeSearch(
            searchSimple.fullText.getText(),
            Integer.parseInt(resultPage.getItemText(resultPage.getSelectedIndex())));
        break;

      case SEARCH_MODE_ADVANCED:
        long domain = 0;
        SearchNormal searchNormal = Main.get().mainPanel.search.searchBrowser.searchIn.searchNormal;
        SearchAdvanced searchAdvanced =
            Main.get().mainPanel.search.searchBrowser.searchIn.searchAdvanced;
        GWTQueryParams gwtParams = new GWTQueryParams();
        gwtParams.setContent(searchNormal.content.getText());

        if (!searchAdvanced.path.getText().equals("")) {
          gwtParams.setPath(searchAdvanced.path.getText());
        } else {
          gwtParams.setPath(searchNormal.context.getValue(searchNormal.context.getSelectedIndex()));
        }

        if (!searchAdvanced.categoryUuid.equals("")) {
          gwtParams.setCategoryUuid(searchAdvanced.categoryUuid);
        }

        gwtParams.setKeywords(searchNormal.keywords.getText());
        gwtParams.setMimeType("");
        gwtParams.setName(searchNormal.name.getText());
        gwtParams.setAuthor(
            searchNormal.userListBox.getValue(searchNormal.userListBox.getSelectedIndex()));

        gwtParams.setMailFrom(searchAdvanced.from.getText());
        gwtParams.setMailTo(searchAdvanced.to.getText());
        gwtParams.setMailSubject(searchAdvanced.subject.getText());

        if (searchTypeAnd.getValue()) {
          gwtParams.setOperator(GWTQueryParams.OPERATOR_AND);
        } else {
          gwtParams.setOperator(GWTQueryParams.OPERATOR_OR);
        }

        if (searchNormal.modifyDateFrom != null && searchNormal.modifyDateTo != null) {
          gwtParams.setLastModifiedFrom(searchNormal.modifyDateFrom);
          gwtParams.setLastModifiedTo(searchNormal.modifyDateTo);
        } else {
          gwtParams.setLastModifiedFrom(null);
          gwtParams.setLastModifiedTo(null);
        }

        if (searchAdvanced.typeDocument.getValue()) {
          domain += GWTQueryParams.DOCUMENT;
        }

        if (searchAdvanced.typeFolder.getValue()) {
          domain += GWTQueryParams.FOLDER;
        }

        if (searchAdvanced.typeMail.getValue()) {
          domain += GWTQueryParams.MAIL;
        }

        gwtParams.setDomain(domain);
        gwtParams.setProperties(Main.get().mainPanel.search.searchBrowser.searchIn.getProperties());
        gwtParams.setMimeType(
            searchAdvanced.mimeTypes.getValue(searchAdvanced.mimeTypes.getSelectedIndex()));
        Main.get()
            .mainPanel
            .search
            .searchBrowser
            .searchIn
            .futuramaWalking
            .evaluate(searchNormal.content.getText());
        controlSearch.executeSearch(
            gwtParams, Integer.parseInt(resultPage.getItemText(resultPage.getSelectedIndex())));
        break;
    }
  }