use of org.jaffa.exceptions.GetQueryDataException in project jaffa-framework by jaffa-projects.
the class FinderComponent2 method generateFieldValuesMap.
/**
* generateFieldValuesMap
* @param fields to save values of
* @return of fields and values
* @throws GetQueryDataException
*/
private Map generateFieldValuesMap(List fields) throws GetQueryDataException {
Map retVal = new HashMap();
Iterator fieldsIterator = fields.iterator();
while (fieldsIterator.hasNext()) {
String fieldName = (String) fieldsIterator.next();
try {
retVal.put(fieldName, BeanHelper.getField(this, fieldName));
} catch (NoSuchMethodException e) {
log.error("NoSuchMethodException getting " + fieldName, e);
throw new GetQueryDataException(e);
}
}
return retVal;
}
use of org.jaffa.exceptions.GetQueryDataException in project jaffa-framework by jaffa-projects.
the class FinderComponent2 method deleteQuery.
/**
* deleteQuery
*
* @throws ApplicationException
*
* Deletes the currntly selected saved query
*/
public void deleteQuery() throws ApplicationException {
if (getSavedQueryId() != null) {
IContextManager contextManager = ContextManagerFactory.instance();
QuerySaver querySaver = new QuerySaver(contextManager);
try {
querySaver.removeSavedQuery(getComponentDefinition().getComponentName(), getSavedQueryId().toString());
} catch (IOException e) {
log.error("IOError removing Queries ", e);
throw new GetQueryDataException(e);
}
}
initializeSavedQueries();
getUserSession().getWidgetCache(getComponentId()).clear();
}
use of org.jaffa.exceptions.GetQueryDataException in project jaffa-framework by jaffa-projects.
the class FinderComponent2 method saveQuery.
/**
* saveQuery
* @throws ApplicationException
*
* Saves the current query
*/
public void saveQuery() throws ApplicationException {
Map queryData = null;
queryData = getQueryData();
queryData.putAll(getCommonQueryData());
try {
IContextManager contextManager = ContextManagerFactory.instance();
QuerySaver querySaver = new QuerySaver(contextManager);
querySaver.saveQuery(getNewQueryName(), this.getComponentDefinition().getComponentName(), queryData, getDefaultQueryYn().booleanValue(), getQueryHasShortcutYn().booleanValue());
} catch (IOException e) {
log.error("IOError saving Queries ", e);
throw new GetQueryDataException(e);
}
initializeSavedQueries();
getUserSession().getWidgetCache(getComponentId()).clear();
}
Aggregations