use of nl.nn.adapterframework.util.StringTagger in project iaf by ibissource.
the class ExecuteJdbcQuery method executeSub.
public ActionForward executeSub(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
// Initialize action
initAction(request);
IniDynaActionForm executeJdbcQueryForm = (IniDynaActionForm) form;
Cookie[] cookies = request.getCookies();
if (null != cookies) {
for (int i = 0; i < cookies.length; i++) {
Cookie aCookie = cookies[i];
if (aCookie.getName().equals(AppConstants.getInstance().getString("WEB_EXECJDBCCOOKIE_NAME", "WEB_EXECJDBCCOOKIE"))) {
StringTagger cs = new StringTagger(aCookie.getValue());
log.debug("restoring values from cookie: " + cs.toString());
try {
executeJdbcQueryForm.set("jmsRealm", cs.Value("jmsRealm"));
executeJdbcQueryForm.set("queryType", cs.Value("queryType"));
executeJdbcQueryForm.set("resultType", cs.Value("resultType"));
executeJdbcQueryForm.set("query", cs.Value("query"));
} catch (Exception e) {
log.warn("could not restore Cookie value's", e);
}
}
}
}
List jmsRealms = JmsRealmFactory.getInstance().getRegisteredRealmNamesAsList();
if (jmsRealms.size() == 0)
jmsRealms.add("no realms defined");
executeJdbcQueryForm.set("jmsRealms", jmsRealms);
List queryTypes = new ArrayList();
queryTypes.add("select");
queryTypes.add("other");
executeJdbcQueryForm.set("queryTypes", queryTypes);
List resultTypes = new ArrayList();
resultTypes.add("csv");
resultTypes.add("xml");
executeJdbcQueryForm.set("resultTypes", resultTypes);
// Forward control to the specified success URI
log.debug("forward to success");
return (mapping.findForward("success"));
}
use of nl.nn.adapterframework.util.StringTagger in project iaf by ibissource.
the class BrowseJdbcTable method executeSub.
public ActionForward executeSub(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
// Initialize action
initAction(request);
if (form == null) {
log.debug(" Creating new browseJdbcTableForm bean under key " + mapping.getAttribute());
IniDynaActionForm browseJdbcTableForm = new IniDynaActionForm();
if ("request".equals(mapping.getScope())) {
request.setAttribute(mapping.getAttribute(), form);
} else {
session.setAttribute(mapping.getAttribute(), form);
}
}
IniDynaActionForm browseJdbcTableForm = (IniDynaActionForm) form;
Cookie[] cookies = request.getCookies();
if (null != cookies) {
for (int i = 0; i < cookies.length; i++) {
Cookie aCookie = cookies[i];
if (aCookie.getName().equals(AppConstants.getInstance().getProperty("WEB_JDBCBROWSECOOKIE_NAME"))) {
StringTagger cs = new StringTagger(aCookie.getValue());
log.debug("restoring values from cookie: " + cs.toString());
try {
browseJdbcTableForm.set("jmsRealm", cs.Value("jmsRealm"));
browseJdbcTableForm.set("tableName", cs.Value("tableName"));
browseJdbcTableForm.set("where", cs.Value("where"));
browseJdbcTableForm.set("order", cs.Value("order"));
browseJdbcTableForm.set("numberOfRowsOnly", new Boolean(cs.Value("numberOfRowsOnly")));
browseJdbcTableForm.set("rownumMin", new Integer(cs.Value("rownumMin")));
browseJdbcTableForm.set("rownumMax", new Integer(cs.Value("rownumMax")));
} catch (Exception e) {
log.warn("could not restore Cookie value's", e);
}
}
}
}
List jmsRealms = JmsRealmFactory.getInstance().getRegisteredRealmNamesAsList();
if (jmsRealms.size() == 0)
jmsRealms.add("no realms defined");
browseJdbcTableForm.set("jmsRealms", jmsRealms);
// Forward control to the specified success URI
log.debug("forward to success");
return (mapping.findForward("success"));
}
use of nl.nn.adapterframework.util.StringTagger in project iaf by ibissource.
the class BrowseQueue method executeSub.
public ActionForward executeSub(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
// Initialize action
initAction(request);
if (form == null) {
log.debug(" Creating new browseQueueForm bean under key [" + mapping.getAttribute() + "]");
IniDynaActionForm browseQueueForm = new IniDynaActionForm();
if ("request".equals(mapping.getScope())) {
request.setAttribute(mapping.getAttribute(), form);
} else {
session.setAttribute(mapping.getAttribute(), form);
}
}
IniDynaActionForm browseQueueForm = (IniDynaActionForm) form;
Cookie[] cookies = request.getCookies();
if (null != cookies) {
for (int i = 0; i < cookies.length; i++) {
Cookie aCookie = cookies[i];
if (aCookie.getName().equals(AppConstants.getInstance().getString("WEB_QBROWSECOOKIE_NAME", "WEB_QBROWSECOOKIE"))) {
StringTagger cs = new StringTagger(aCookie.getValue());
log.debug("restoring values from cookie: " + cs.toString());
try {
browseQueueForm.set("jmsRealm", cs.Value("jmsRealm"));
browseQueueForm.set("destinationName", cs.Value("destinationName"));
browseQueueForm.set("destinationType", cs.Value("destinationType"));
browseQueueForm.set("numberOfMessagesOnly", new Boolean(cs.Value("numberOfMessagesOnly")));
browseQueueForm.set("showPayload", new Boolean(cs.Value("showPayload")));
} catch (Exception e) {
log.warn("could not restore Cookie value's", e);
}
}
}
}
List jmsRealms = JmsRealmFactory.getInstance().getRegisteredRealmNamesAsList();
if (jmsRealms.size() == 0)
jmsRealms.add("no realms defined");
browseQueueForm.set("jmsRealms", jmsRealms);
// Forward control to the specified success URI
log.debug("forward to success");
return (mapping.findForward("success"));
}
Aggregations