<%-- *************************************************************************** SeqHound Web Interface (Based on the Biomolecular Interaction Network Database) The Blueprint Initiative 522 University Avenue, 9th Floor, Suite 900 Toronto, Ontario, Canada, M5G 1W7 Hogue Lab - University of Toronto Biochemistry Department Samuel Lunenfeld Research Institute, Mount Sinai Hospital Copyright Notice: Copyright 2003, 2004, 2005 Mount Sinai Hospital (MSH) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or visit http://www.gnu.org/copyleft/gpl.html ************************************************************************* --%> <%@ page import="java.io.*"%> <%@ page import="java.lang.Integer"%> <%@ page import="java.util.*"%> <%@ page import="com.unleashedinformatics.jseqhound.framework.config.BINDDef"%> <%@ page import="com.unleashedinformatics.jseqhound.framework.*"%> <%@ page import="com.unleashedinformatics.jseqhound.framework.ui.*"%> <%@ page import="com.unleashedinformatics.jseqhound.framework.formbeans.*"%> <%@ page import="org.blueprint.common.*"%> <%@ page import="com.unleashedinformatics.jseqhound.bbs.formbeans.BBSFormBean"%> <%@ page import="com.unleashedinformatics.jseqhound.bbs.formbeans.BBSFormBean"%> <%@ page import="com.unleashedinformatics.jseqhound.bbs.export.ExporterFactory" %> <% class BINDWebElements { private FormView viewmode; /*This is used to enable the comment input field during validation mode*/ private boolean disable = false; BINDWebElements() { /*This allows for non BIND record views to use the WebElements*/ this.viewmode = new FormView(); } BINDWebElements(FormView viewmode) { this.viewmode = viewmode; this.disable = !viewmode.isEditable(); } String checked(int value) { if (value > 0) { return " CHECKED "; } return ""; } String checked(boolean value) { if (value) { return " CHECKED "; } return ""; } void printOptionList(JspWriter out, FormBean fbean, SelectOption.OptionList olist, int proptype) throws IOException { SelectOption opt; if(olist==null) { out.println(""); return; } if(fbean==null) { out.println(""); return; } for(int x = 0; x < olist.size(); x++) { opt = (SelectOption) olist.get(x); if (viewmode.isEditable()) { %><% } else { if(fbean.checkSelection(opt.getStrId(), proptype)) { out.print(opt.getName()); } } } } /** * Emits a multi selection box. * @param autoSubmit */ void printMultiSelectBoxElement(JspWriter out, String name, int size, FormBean fbean, SelectOption.OptionList olist, int proptype) throws IOException { %> <% } /** * Emits a multi selection box. * @param autoSubmit */ void printMultiSelectBox(JspWriter out, String name, int size, FormBean fbean, SelectOption.OptionList olist, int proptype) throws IOException { if (viewmode.isEditable()) { %> <%printMultiSelectBoxElement(out, name, size, fbean, olist, proptype);%> <% } else { %><%printOptionList(out, fbean, olist, proptype);%><% } } void printSelectBox(JspWriter out, String name, boolean onChange, FormBean fbean, SelectOption.OptionList olist, int proptype, String extraAction) throws IOException { printSelectBox(out, name, onChange, fbean, olist, proptype, extraAction, true); } /** * Emits a selection box. * @param autoSubmit */ void printSelectBoxElement(JspWriter out, String name, boolean onChange, FormBean fbean, SelectOption.OptionList olist, int proptype, String extraAction, boolean autoSubmit) throws IOException { %> <% } /** * Emits a selection box. * @param autoSubmit */ void printSelectBox(JspWriter out, String name, boolean onChange, FormBean fbean, SelectOption.OptionList olist, int proptype, String extraAction, boolean autoSubmit) throws IOException { printSelectBox(out, name, onChange, fbean, olist, proptype, extraAction, autoSubmit, "left"); } /** * Emits a selection box. * @param autoSubmit */ void printSelectBox(JspWriter out, String name, boolean onChange, FormBean fbean, SelectOption.OptionList olist, int proptype, String extraAction, boolean autoSubmit, String align) throws IOException { if (viewmode.isEditable()) { %> <%printSelectBoxElement(out, name, onChange, fbean, olist, proptype, extraAction, autoSubmit);%> <% } else { %><%printOptionList(out, fbean, olist, proptype);%><% } } /** * Emits a selection box that can show and error field based on proptype, mol, and ehandler * @param autoSubmit */ void printSelectBox(JspWriter out, String name, boolean onChange, FormBean fbean, SelectOption.OptionList olist, int proptype, String extraAction, boolean autoSubmit, String align, String mol, ApplicationErrorHandler ehandler) throws IOException { if (viewmode.isEditable()) { String classStr = ""; if(env.hasFieldError(proptype, mol, ehandler)) { classStr = "class=\"fielderror\""; } %> > <%printSelectBoxElement(out, name, onChange, fbean, olist, proptype, extraAction, autoSubmit);%> <% } else { %><%printOptionList(out, fbean, olist, proptype);%><% } } /** * @param out * @param text * @param name * @param onChange * @param olist * @param fbean * @param prop * @param mol * @param ferr * @param extraAction * * @throws IOException * * Defaults the HttpServletRequet to null and the final boolean (autoSubmit) to true, though, * autosubmission only occurs if 'onChange' is also true. * * @see printSelectBoxRow(JspWriter, HttpServletRequest, String, String, boolean, SelectOption.OptionList, * FormBean, int, String, ApplicationErrorHandler, String, boolean) */ void printSelectBoxRow(JspWriter out, String text, String name, boolean onChange, SelectOption.OptionList olist, FormBean fbean, int prop, String mol, ApplicationErrorHandler ferr, String extraAction) throws IOException { printSelectBoxRow(out, null, text, name, onChange, olist, fbean, prop, mol, ferr, extraAction, true); } /** * @param out * @param request * @param text * @param name * @param onChange * @param olist * @param fbean * @param prop * @param mol * @param ferr * @param extraAction * * @throws IOException * * Defaults the final boolean (autoSubmit) to true, though, autosubmission only occurs if 'onChange' is * also true. * * @see printSelectBoxRow(JspWriter, HttpServletRequest, String, String, boolean, SelectOption.OptionList, * FormBean, int, String, ApplicationErrorHandler, String, boolean) */ void printSelectBoxRow(JspWriter out, HttpServletRequest request, String text, String name, boolean onChange, SelectOption.OptionList olist, FormBean fbean, int prop, String mol, ApplicationErrorHandler ferr, String extraAction) throws IOException { printSelectBoxRow(out, request, text, name, onChange, olist, fbean, prop, mol, ferr, extraAction, true); } /** * * @param out * @param text * @param name * @param onChange * @param olist * @param fbean * @param prop * @param mol * @param ferr * @param extraAction * @param autoSubmit * * @throws IOException * * Defaults the HttpServletRequet to null. * * @see printSelectBoxRow(JspWriter, HttpServletRequest, String, String, boolean, SelectOption.OptionList, * FormBean, int, String, ApplicationErrorHandler, String, boolean) */ void printSelectBoxRow(JspWriter out, String text, String name, boolean onChange, SelectOption.OptionList olist, FormBean fbean, int prop, String mol, ApplicationErrorHandler ferr, String extraAction, boolean autoSubmit) throws IOException { printSelectBoxRow(out, null, text, name, onChange, olist, fbean, prop, mol, ferr, extraAction, autoSubmit); } /** * @param out * @param request * @param text * @param name * @param onChange * @param olist * @param fbean * @param prop * @param mol * @param ferr * @param extraAction * @param autoSubmit * * @throws IOException */ void printSelectBoxRow(JspWriter out, HttpServletRequest request, String text, String name, boolean onChange, SelectOption.OptionList olist, FormBean fbean, int prop, String mol, ApplicationErrorHandler ferr, String extraAction, boolean autoSubmit) throws IOException { %><% printFieldDescr(out, request, text, prop, mol, name, ferr); printSelectBox(out, name, onChange, fbean, olist, prop, extraAction, autoSubmit); %><% } /** * Creates a row with two tags, one for the field description and the second for a select box. The * select box is unique because it is just a selection of numbers, from listFloor ... listCeil * * @param listFloor The lowest option value in this select list * @param listCeil The highest option value in this select list * @param selectDefault If true, this function will highlight the currently selected option specified by * the value of the request parameter with the name fieldName. */ void printIntegerSelectBoxRow(JspWriter out, HttpServletRequest request, String fieldDesc, String fieldName, int listFloor, int listCeil, boolean selectDefault, ApplicationErrorHandler ferr) throws IOException { %> <%printFieldDescr(out, request, fieldDesc, -1, null, fieldName, ferr);%> <% } void printTableTitle(JspWriter out, HttpServletRequest request, String title, String extra, Button[] but) throws IOException { this.printTableTitle(out, request, title, extra, but, 0); } void printTableTitle(JspWriter out, String title, String extra, Button[] but) throws IOException { this.printTableTitle(out, null, title, extra, but, 0); } void printTableTitle(JspWriter out, String title, String extra, Button[] but, int depth) throws IOException { printTableTitle(out, null, title, extra, but, depth); } void printTableTitle(JspWriter out, HttpServletRequest request, String title, String extra, Button[] but, int depth) throws IOException { // Limit min depth value used by anchor jumping to zero int formDepth = depth; if (depth < 0) { formDepth = 0; } %><% if (request != null) { // Set depth attribute for comment mode so we can populate actionDepth parameter for field links request.setAttribute("depth", new Integer(formDepth)); } %> > <% } void printSpacerTable(JspWriter out, boolean debug) throws IOException { %> <% } void printCloseTable(JspWriter out) throws IOException { %>
<% out.print(title); %> <% if (but != null) { for (int i = 0; i < but.length; i++) { out.println(" "); printButton(out, but[i], depth); } } %>
" width="100%"> <% } void printSpacerTable(JspWriter out) throws IOException { printSpacerTable(out, false); } void printCloseSpacerTable(JspWriter out) throws IOException { %>
<% } void printTableSubTitle(JspWriter out, String subtitle) throws IOException { %>
<%=subtitle%>
<% } void printCloseSubTable(JspWriter out) throws IOException { %>
<% } void printTextBoxRow(JspWriter out, HttpServletRequest request, String text, String name, int size, String value, int prop, String mol, ApplicationErrorHandler ferr) throws IOException { %><% printFieldDescr(out, request, text, prop, mol, name, ferr); printTextBox(out, name, value, size); %><% } void printTextBoxRow(JspWriter out, String text, String name, int size, String value, int prop, String mol, ApplicationErrorHandler ferr) throws IOException { printTextBoxRow(out, null, text, name, size, value, prop, mol, ferr); } void printTextAreaRow(JspWriter out, HttpServletRequest request, String text, String name, int width, int height, String value, int prop, String mol, ApplicationErrorHandler ferr) throws IOException { %><% printFieldDescr(out, request, text, prop, mol, name, ferr); printTextArea(out, name, value, width, height); %><% } void printTextAreaRow(JspWriter out, String text, String name, int width, int height, String value, int prop, String mol, ApplicationErrorHandler ferr) throws IOException { printTextAreaRow(out, null, text, name, width, height, value, prop, mol, ferr); } void printPasswordRow(JspWriter out, HttpServletRequest request, String text, String name, int size, String value, int prop, String mol, ApplicationErrorHandler ferr) throws IOException { %><% printFieldDescr(out, request, text, prop, mol, name, ferr); printPassword(out, name, value, size); %><% } void printPasswordRow(JspWriter out, String text, String name, int size, String value, int prop, String mol, ApplicationErrorHandler ferr) throws IOException { printPasswordRow(out, null, text, name, size, value, prop, mol, ferr); } void printTextBoxElement(JspWriter out, String name, String value, int size) throws IOException { %> 0) { out.println("size=\"" + size + "\""); }%>> <% } void printTextBox(JspWriter out, String name, String value, int size) throws IOException { if (viewmode.isEditable()) { %> <%printTextBoxElement(out, name, value, size);%> <% } else { %><%=value%><% } } void printCheckBoxRow(String title, JspWriter out, String name, String value, boolean selected, String onClick) throws IOException { %> <% printCheckBoxAlign(out, name, value, selected, onClick, "right"); %> <%=title%> <% } /** * @param out * @param name * @param value Initial value * @param selected * @param onClick */ void printCheckBox(JspWriter out, String name, String value, boolean selected, String onClick) throws IOException { printCheckBoxAlign(out, name, value, selected, onClick, "left"); } void printCheckBoxAlign(JspWriter out, String name, String value, boolean selected, String onClick, String align) throws IOException { %> disabled <% } %>type="checkbox" name="<%=name%>" <% if (value !=null) { %> value="<%=value%>" <% } if(onClick!=null) { %> onClick="<%=onClick%>" <% } if(selected) { %> checked <% } %>> <% } /** * Use this overloaded version if the radio button has no associated action. */ void printRadioButton(JspWriter out, String name, String value, FormBean formbean, int prop, int index) throws IOException { this.printRadioButton(out, null, name, value, formbean, prop, index, -1, false, null, null, null); } /** * Use this overloaded version if selecting a radio button should trigger an action (i.e. submission * of the form) without requesting confirmation from the user. * * @param extraAction A string to be used as Javascript for setting any parameters just before form submission. */ void printRadioButton(JspWriter out, String form, String name, String value, FormBean formbean, int prop, int index, boolean blur, String action, String extraAction) throws IOException { %>><% } /** * Use this overloaded version if the radio button has an associated action (i.e. when selecting * the button some action should occur. * * @param resetIndex Will not be evaluated if (func == null) * @param func * @param args * @param action * (func, args, action) should be used together to specify a javascript function along with its args and * the 'butval' to set if func returns true. ResetIndex should also accompany these parameters * and is the index of the radio button to set if func returns false. * This function currently assumes that a change to a radio button selection should trigger a "confirm" * style message returning either true/false. In the false situation this requires a reset of the previously * selected value, the resetIndex. * */ void printRadioButton(JspWriter out, String form, String name, String value, FormBean formbean, int prop, int index, int resetIndex, boolean blur, String func, String args, String action) throws IOException { %>onChange="if (<%=func%>(<%=form%>, <%=args%>)) { this.form.butval.value='<%=action%>'; this.form.submit(); } else { this.form.<%=name%>[<%=resetIndex%>].checked=true; }"<%} if ((formbean != null) && formbean.checkSelection(value, prop)) out.print("checked");%>><% } void printPassword(JspWriter out, String name, String value, int size) throws IOException { %> 0) { out.println("size=\"" + size + "\""); }%>> <% } void printTextArea(JspWriter out, String name, String value, int width, int height) throws IOException { if (value == null) { value = ""; } if (viewmode.isEditable() || !disable) { %> <% } else { //this (wrapping) needs to be changed to something more elegant %><%=env.wrapString(value, 50)%><% } } void printFieldDescr(JspWriter out, HttpServletRequest request, String descr, ApplicationErrorHandler ehandler) throws IOException { printFieldDescr(out, request, descr, Defines.PROP_NULL, null, null, ehandler); } void printFieldDescr(JspWriter out, HttpServletRequest request, String descr, int prop, String mol, String fieldname, ApplicationErrorHandler ehandler) throws IOException { String strClass = ""; if (viewmode.canValidate()) { strClass = "viewfield"; } else { if ((prop != Defines.PROP_NULL) && (ehandler != null) && env.hasFieldError(prop, mol, ehandler)) { strClass = "fielderror"; } else { strClass = "field"; } } %><% out.print(descr + "  "); %><% } void printFieldDescr(JspWriter out, String descr, int prop, String mol, String fieldname, ApplicationErrorHandler ehandler) throws IOException { this.printFieldDescr(out, null, descr, prop, mol, fieldname, ehandler); } void printArrayList(JspWriter out, String formname, FormBeanList list, ApplicationErrorHandler ferr, String dataname, String datatype, boolean[] features, int depth) throws IOException { printArrayList(out, null, formname, list, ferr, dataname, datatype, features[0], features[1], features[2], features[3], depth); } void printArrayList(JspWriter out, HttpServletRequest request, String formname, FormBeanList list, ApplicationErrorHandler ferr, String dataname, String datatype, boolean[] features, int depth) throws IOException { printArrayList(out, request, formname, list, ferr, dataname, datatype, features[0], features[1], features[2], features[3], depth); } void printArrayList(JspWriter out, HttpServletRequest request, String formname, FormBeanList list, ApplicationErrorHandler ferr, String dataname, String datatype, boolean add, boolean edit, boolean delete, boolean selection, int depth) throws IOException { printArrayList(out, request, formname, list, ferr, dataname, datatype, add, edit, delete, selection, depth, null, null, null); } /** * @param specialConfirmList * @param editConfirm a String used for an edit button as a confirmation message. Should include a '?' if is a question. * If null, will be ignored and no confirmation will be associated with the edit button. * @param deleteConfirm a String used for a delete button as a confirmation message. Should include a '?' if is a question. * If null, will be ignored. * * SpecialConfirmList, editConfirm and deleteConfirm are used together. All are expected to have value or all should be null. * For the indexes in specialConfirmList that are true, those list elements will have the edit and deleteConfirm messages * used for their respective buttons in place of the standard confirm message. */ void printArrayList(JspWriter out, HttpServletRequest request, String formname, FormBeanList list, ApplicationErrorHandler ferr, String dataname, String datatype, boolean add, boolean edit, boolean delete, boolean selection, int depth, boolean[] specialConfirmList, String editConfirm, String deleteConfirm) throws IOException { int addindex = list.getSize(); if (addindex == -1) { addindex = 0; } String[] args_add = { new String("'" + datatype + "'"), new String("'"+ addindex +"'") }; %> <% /*No list*/ if (list.isEmpty() || list.isDiffEmpty()) { if (add) { %><% } else { %><% } } int beanCount = 0; for (int x = 0; x < list.getSize(); x++) { if (list.getBean(x) == null) { // Skip placeholder continue; } else { // Count bean beanCount++; } String[] args_del = new String[3]; String[] args_edit; String[] args_view = { new String("'" + datatype + "'"), new String("'"+ x +"'") }; if ((specialConfirmList != null) && (x < specialConfirmList.length) && specialConfirmList[x] && (deleteConfirm != null)) { args_del[0] = "'" + deleteConfirm + "'"; } else { args_del[0] = "'Are you sure you would like to delete this " + dataname + "?'"; } args_del[1] = "'" + datatype + "'"; args_del[2] = "'"+ x +"'"; if ((specialConfirmList != null) && (x < specialConfirmList.length) && specialConfirmList[x] && (editConfirm != null)) { args_edit = new String[3]; args_edit[0] = "'" + editConfirm + "'"; args_edit[1] = "'" + datatype + "'"; args_edit[2] = "'" + x + "'"; } else { args_edit = new String[2]; args_edit[0] = "'" + datatype + "'"; args_edit[1] = "'" + x + "'"; } %><% if (edit || delete || (!viewmode.isEditable() && !selection)) { %><% } else if (selection) { if (request.getParameterValues(datatype + "_selection") != null) { String [] selectList = request.getParameterValues(datatype + "_selection"); for (int y = 0; y < selectList.length; y++) { if (selectList[y].equals(String.valueOf(x))) { printCheckBox(out, datatype + "_selection", String.valueOf(x), true, null); break; } else if (y == (selectList.length - 1)) { printCheckBox(out, datatype + "_selection", String.valueOf(x), false, null); } } } else { printCheckBox(out, datatype + "_selection", String.valueOf(x), false, null); } } if (list.isPlaceholderCounted()) { %> <% } %>
None have been added yet.
Please use the add icon to add a new <%=dataname%>.
None have been added yet.
<% if (delete && viewmode.isEditable()) printButton(out, CommonButtons.createDeleteButton(formname, "Delete " + dataname , "confirmIndexedSubmit", args_del), depth); if (edit && delete && viewmode.isEditable()) out.print(" "); if (edit && viewmode.isEditable()) { if ((specialConfirmList != null) && (x < specialConfirmList.length) && specialConfirmList[x] && (editConfirm != null)) { // Edit should include confirmation message printButton(out, CommonButtons.createEditButton(formname, "Edit " + dataname, "confirmIndexedSubmit", args_edit), depth); } else { printButton(out, CommonButtons.createEditButton(formname, "Edit " + dataname , "submitIndexedBINDButton", args_edit), depth); } } if (!viewmode.isEditable() && !list.isReferenceList()) printButton(out, CommonButtons.createViewButton(formname, "View " + dataname , "submitIndexedBINDButton", args_view), depth); %> <%=(x+1)%>.  <% } else { %> <%=beanCount%>.  <% } out.println("No Description Provided."); %>
<%if (add && viewmode.isEditable()) {%> <%printButton(out, CommonButtons.createAddButton(formname, "Add Another " + dataname, "submitIndexedBINDButton", args_add), depth);%> <% } } void printButtonRow(JspWriter out, Button but) throws IOException { %><% printButton(out, but); %><% } void printButton(JspWriter out, Button but) throws IOException { printButton(out, but, -1); } void printButton(JspWriter out, Button but, int depth) throws IOException{ if(but.getFormName()!=null) { printButton(out, but.getFormName(), but.getImageName(), but.getImagePath(), but.getDescription(), but.getFunctionName(), but.getArguments(), depth); } else { if(but.getPg()>0) { printButton(out, but.getPg(), but.getImageName(), but.getImagePath(), but.getDescription(), but.getQueryString()); } else { printButton(out, but.getImageName(), but.getImagePath(), but.getDescription(), but.getFunctionName(), but.getArguments()); } } } /** * For areas of the code (like the Login screen) that use printButton but aren't affected by 'depth' issues present in the BSS. */ void printButton(JspWriter out, String form, String name, String path, String descr) throws IOException{ printButton(out, form, name, path, descr, null, null, -1); } /** * Creates a button without an associated extra javascript function. */ void printButton(JspWriter out, String form, String name, String path, String descr, int depth) throws IOException{ printButton(out, form, name, path, descr, null, null, depth); } /** * For cases when a 'special' image is necessary (eg. "Add Experimental Form" or "Edit Experimental Form" within BSS) * as opposed to the standard buttons ('add', 'edit', ...), BUT the underlying action name need not be tied * to the image name. */ void printButton(JspWriter out, String form, String actionName, String imageName, String path, String descr, String func, String args, int depth) throws IOException{ %>onClick=" return <%=func%>(<%=form%>, <%=args%>);"<%} else {%> onclick="return checkSubmitState(this.href, this.target)" <%}%> onMouseOver="MM_nbGroup('over','<%=imageName%>','images/<%=path%>but_v_<%=imageName%>.jpg','',1); window.status='<%=descr%>'; return true;" onMouseOut="MM_nbGroup('out'); window.status=''; return true;"><% } void printButton(JspWriter out, String form, String name, String path, String descr, String func, String args, int depth) throws IOException{ %>onClick=" return <%=func%>(<%=form%>, <%=args%>);"<%} else {%> onclick="return checkSubmitState(this.href, this.target)" <%}%> onMouseOver="MM_nbGroup('over','<%=name%>','images/<%=path%>but_v_<%=name%>.jpg','',1); window.status='<%=descr%>'; return true;" onMouseOut="MM_nbGroup('out'); window.status=''; return true;"><% } void printButton(JspWriter out, int pg, String imageName, String imagePath, String description, String queryString) throws IOException { %>" title="<%=description%>" onMouseOver="MM_nbGroup('over','<%=imageName%>','images/<%=imagePath%>but_v_<%=imageName%>.jpg','',1); window.status='<%=description%>'; return true;" onMouseOut="MM_nbGroup('out'); window.status=''; return true;"><% } void printButton(JspWriter out, String imageName, String imagePath, String description, String func, String args) throws IOException { %><% } void printCalendarButton(JspWriter out, Button but, String formElementName, boolean enablePast) throws IOException { printCalendarButton(out, but.getFormName(), formElementName, but.getImageName(), but.getImagePath(), but.getImageFile(), but.getDescription(), but.getOnClickEvent(), enablePast); } void printCalendarButton(JspWriter out, String formName, String formElementName, String imageName, String imagePath, String imageFile, String description, String onClick, boolean enablePast) throws IOException { %>,-1,-1);" onClick="<%if(onClick!=null) {out.print(onClick + ";"); }%> document.<%=formName%>.butval.value='changeDate';" onMouseOver="MM_nbGroup('over','<%=imageName%>','<%=imagePath%>but_v_<%=imageFile%>','',1);" onMouseOut="MM_nbGroup('out');"><% } void printSaveCancelRow(JspWriter out, String[] args_save, String[] args_cancel) throws IOException{ %>
<%printButton(out, CommonButtons.createSaveFormButton("Save Changes", "submitIndexedBINDButton", args_save), 0);%> <%printButton(out, CommonButtons.createCancelFormButton("Discard Changes", "confirmIndexedSubmit", args_cancel), 0);%>
<% } void printPagination(JspWriter out, int pages, int current, String parameterName, String query) throws IOException { int maxpages = 10; int min = 1; int max = pages; if (pages == 1) { return; } if (pages > maxpages) { min = current - 3; if (min < 1) { min = 1; } max = current + 3; if (max > pages) { max = pages; } } %> <% if (current != 1) { %><% } if (min != 1) { %><% %><% } for (int x = min; x <= max; x++) { if (x == current) { %><% } else { %><% } } if (max != pages) { %><% %><% } if (current != pages) { %><% } %>
1
--
<%=x%>
<%=x%>
--
<%=pages%>
<% } /** * Prints the pagination tool along with a "jump to page" widget * @param formName Unique name of the form to use when building the widget */ void printPagination(JspWriter out, int pages, int current, String parameterName, String query, String formName) throws IOException { printPagination(out, pages, current, parameterName, query); if (pages == 1) { return; } %>
<%printTextBox(out, "page", String.valueOf(current), 4); %>
Skip To Page: <% printButton(out, formName, "go", "bbs/buttons/", "Jump to page", "openLocation", "'index.jsp?" + parameterName + "=' + document." + formName + ".page.value + '&" + query + "'", -1); %>
<% } /** * Prints a form input element of type image, using image rollovers. * NOTE: This function is not used (but maybe used in the future). Please see printButton(). * @param out output stream * @param buttonName name of this element. This is also used to determine the image names to use * @param descr description of this button to show the user * @param path path to the images used for this button */ void printFormImageButton (JspWriter out, String buttonName, String descr, String path) throws IOException { %> <% } void printFocus(JspWriter out, String form, String element) throws IOException { %> <% } void jumpToAnchor(JspWriter out, String anchorName) throws IOException { %> <% } void printBackLink(JspWriter out, HttpServletRequest request, String linkText) throws IOException { // This method requires a backpg parameter in the request URL String backPg = (String) request.getParameter("backpg"); if (backPg != null) { String backLink = "Action?pg=" + backPg; %><%=linkText%><% } } void checkMessage(JspWriter out, HttpServletRequest request) throws IOException { ApplicationErrorHandler ehandler = env.getErrorHandler(request); if (ehandler != null) { ApplicationError err = ehandler.getApplicationError(); if (err != null) { if (err.getUFMessage()!=null && !err.getUFMessage().equals("")) { out.println(""); out.println("
" + err.getUFMessage() + "
"); jumpToAnchor(out, "error"); } } } } void printBrowseViewOptionList(JspWriter out, HttpServletRequest request, FormBean fbean, String formName) throws IOException { String extraAction = "document." + formName + "." + Defines.PARAM_BROWSE_VIEW_STYLE + ".value = this.value; document." + formName + ".butval.value = 'search'; document." + formName + ".submit();"; %>
<%printSelectBoxRow(out, "View:", Defines.PARAM_BROWSE_VIEW_STYLE, true, CommonOptionLists.getBrowseViewStyles(), fbean, Defines.BPROP_BROWSE_VIEW_STYLE, null, null, extraAction, false);%>
<% } /** * Emits the export option list in a form named 'f_export'. * @param fbean the FormBean used to render the selection box * @param textQuery the query specifying the results to export * @param filename (optional) the name prefix of the file that the user will receive */ void printExportOptionList(JspWriter out, FormBean fbean, SelectOption.OptionList optionList, String textQuery, String filename, Boolean isArchive) throws IOException { BBSFormBean searchFormBean = null; if(fbean instanceof BBSFormBean) searchFormBean = (BBSFormBean)fbean; String exportJS; if(searchFormBean == null) { exportJS = "if (document.f_export.type.value == '" + Defines.NO_EXPORT_METHOD + "' ) return;" + "document.f_export.submit();" + "document.f_export.type.value = '" + Defines.NO_EXPORT_METHOD + "';"; } else { exportJS = "if (document.f_export.type.value == '" + Defines.NO_EXPORT_METHOD + "' ) return;" + "if(!checkExportLimit(document.f_export.type.value,"+searchFormBean.getTotalRecords() +")) return;" + "document.f_export.submit();" + "document.f_export.type.value = '" + Defines.NO_EXPORT_METHOD + "';"; } %>
<% printSelectBoxRow(out, "Export Results:", "type", true, optionList, fbean, Defines.BPROP_EXPORT_METHOD, null, null, exportJS, false); %> <% if (filename != null) { %> <% } %> <%if(isArchive !=null && isArchive.booleanValue()==true) {%> <%}%>
<% } void printMultiRecordExportOptionList(JspWriter out, FormBean fbean, String textQuery, String filename) throws IOException { printExportOptionList(out, fbean, CommonOptionLists.getMultiRecordExportOptions(), textQuery, filename, null); } void printSingleRecordExportOptionList(JspWriter out, FormBean fbean, String textQuery, String filename, Boolean isArchive) throws IOException { printExportOptionList(out, fbean, CommonOptionLists.getSingleRecordExportOptions(), textQuery, filename, isArchive); } void printTitleAlt(JspWriter out, String titlealt) throws IOException { %> title="<%=titlealt%>" alt="<%=titlealt%>" <% } void printHiddenField(JspWriter out, String name, String value) throws IOException { %> <% } void printIdExportSelectBox(JspWriter out, BBSFormBean browseBean, SelectOption.OptionList exportList) throws IOException { printSelectBoxRow(out, "Export as:", "exportFormat", true, exportList, browseBean, Defines.BPROP_EXPORT_METHOD, null, null, "this.form.butval.value = 'export'; "); } void printSubmitOnEnterField(JspWriter out, String name, String inputType, String size, String action) throws IOException { %><% } void printSubmitOnEnterField(JspWriter out, String name, String inputType, String size, String action, String value) throws IOException { %><% } void printSubmitOnEnterBox(JspWriter out, String name, String inputType, String size, String action, String value) throws IOException { %> <% printSubmitOnEnterField(out, name, inputType, size, action, value); %> <% } void printSubmitOnEnterFieldRow(JspWriter out, String label, String name, String inputType, String size, String action) throws IOException { %> <%=label%> <%printSubmitOnEnterField(out, name, inputType, size, action);%> <% } void printSubmitOnEnterFieldRow(JspWriter out, String label, String name, String inputType, String size, String action, String value) throws IOException { %> <%=label%> <%printSubmitOnEnterField(out, name, inputType, size, action, value);%> <% } } %>