import org.splat.service.KnowledgeElementTypeService;
import org.splat.service.SearchService;
import org.splat.service.dto.KnowledgeSearchFilterDTO;
+import org.splat.simer.AbstractSearchBaseAction.SortCriterion;
import org.splat.wapp.Constants;
/**
// ==============================================================================================================================
/**
- * The action initialization.
- *
- * @return SUCCESS if succeeded, ERROR if doSearch() is failed
+ * Common initialization for doInitialize() and doSetOrder() methods.
*/
- public String doInitialize() {
-
- initializationFullScreenContext(Constants.OPEN, Constants.NONE,
- Constants.OPEN);
-
- String res = SUCCESS;
+ private void commonInit() {
// Final initialization of the form
_knowledgeTypes = buildKnowledgeTypesOptions();
setCandidates(); // not selected by default
if (ktypeId != null) {
getFilter().setKtype(String.valueOf(ktypeId));
}
+ }
+
+ /**
+ * The action initialization.
+ *
+ * @return SUCCESS if succeeded, ERROR if doSearch() is failed
+ */
+ public String doInitialize() {
+
+ initializationFullScreenContext(Constants.OPEN, Constants.NONE,
+ Constants.OPEN);
+
+ String res = SUCCESS;
+ commonInit();
try {
doSearch();
} catch (Exception error) {
}
return res;
}
+
+ /**
+ * {@inheritDoc}
+ * @see org.splat.simer.AbstractSearchBaseAction#doSetOrder()
+ */
+ @Override
+ public String doSetOrder() {
+ commonInit();
+ return super.doSetOrder();
+ }
/**
* Build the map of translated knowledge types available for selection.
}
_result = getSearchService().selectKnowledgeElementsWhere(getFilter());
getSession().put(RESULT_KEY, _result); // For redisplaying the page without re-executing the search
+ getSession().put(RESULT_KEY, _result); // For redisplaying the page without re-executing the search
+ getSession().put(ORDER_KEY, false);
+ getSession().put(CRITERION_KEY, SortCriterion.NAME);
return "refresh";
}