/** * @see org.opencms.workplace.list.A_CmsListDialog#defaultActionHtmlContent() */ @Override protected String defaultActionHtmlContent() { StringBuffer result = new StringBuffer(2048); result.append("<!-- start before list -->\n"); result.append(customHtmlBeforeList()); result.append("<!-- end before list -->\n"); result.append(dialogBlockStart(key(getList().getName().getKey()))); result.append(dialogWhiteBoxStart()); // start scrollbox // result.append("<div style=\"overflow: auto; height: 150px; \">"); getList().setWp(this); result.append(getList().listHtml()); // end scrollbox // result.append("</div>"); result.append(dialogWhiteBoxEnd()); result.append(dialogBlockEnd()); return result.toString(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#customHtmlEnd() */ @Override protected String customHtmlEnd() { StringBuffer result = new StringBuffer(256); result.append(super.customHtmlEnd()); // execute the javascript for de-/activating the continue button result.append("<script type='text/javascript'>\n"); result.append("\ttoggleButtonLabel();\n"); result.append("\tcheckValue();\n"); result.append("</script>"); return result.toString(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#customHtmlStart() */ @Override protected String customHtmlStart() { StringBuffer result = new StringBuffer(256); result.append(super.customHtmlStart()); result.append("<script type='text/javascript'>\n"); result.append("function submitAdvanced(theForm) {\n"); result.append("\ttheForm.action.value = \"" + CmsNewResource.DIALOG_ADVANCED + "\";\n"); result.append("\ttheForm.submit();\n"); result.append("}\n\n"); result.append("function submitChtype(theForm) {\n"); result.append("\ttheForm.action.value = \"" + DIALOG_OK + "\";\n"); result.append("\ttheForm.submit();\n"); result.append("}\n\n"); result.append("</script>"); return result.toString(); }
/** * Builds a default button row with a continue and cancel button.<p> * * Override this to have special buttons for your dialog.<p> * * @return the button row */ public String dialogButtons() { return dialogButtons( new int[] {BUTTON_CONTINUE, BUTTON_CANCEL}, new String[] { " onclick=\"submitAction('" + DIALOG_CONTINUE + "', form, '" + getListId() + "-form');\" id=\"nextButton\"", " onclick=\"submitAction('" + DIALOG_CANCEL + "', form, '" + getListId() + "-form');\""}); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#customHtmlEnd() */ @Override protected String customHtmlEnd() { StringBuffer result = new StringBuffer(256); result.append(dialogSpacer()); result.append(dialogButtons()); result.append("</form>\n"); return result.toString(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#actionDialog() */ @Override public void actionDialog() throws JspException, ServletException, IOException { if (getAction() == ACTION_CONTINUE) { if (actionCreateResource()) { actionEditProperties(); return; } } super.actionDialog(); }
/** * @see org.opencms.workplace.CmsDialog#dialogButtonsHtml(java.lang.StringBuffer, int, java.lang.String) */ @Override protected void dialogButtonsHtml(StringBuffer result, int button, String attribute) { attribute = appendDelimiter(attribute); switch (button) { case BUTTON_NEXT: result.append("<input name=\"next\" type=\"submit\" value=\""); result.append(key(Messages.GUI_BUTTON_NEXTSCREEN_0)); result.append("\" class=\"dialogbutton\""); result.append(attribute); result.append(">\n"); break; default: super.dialogButtonsHtml(result, button, attribute); } }
/** * Used to close the current JSP dialog.<p> * * This method overwrites the close dialog method in the super class, * because in case a new folder was created before, after this dialog the tree view has to be refreshed.<p> * * It tries to include the URI stored in the workplace settings. * This URI is determined by the frame name, which has to be set * in the framename parameter.<p> * * @throws JspException if including an element fails */ @Override public void actionCloseDialog() throws JspException { if (isCreateIndexMode()) { // set the current explorer resource to the new created folder String updateFolder = CmsResource.getParentFolder(getSettings().getExplorerResource()); getSettings().setExplorerResource(updateFolder, getCms()); List folderList = new ArrayList(1); if (updateFolder != null) { folderList.add(updateFolder); } getJsp().getRequest().setAttribute(REQUEST_ATTRIBUTE_RELOADTREE, folderList); } super.actionCloseDialog(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#customHtmlEnd() */ @Override protected String customHtmlEnd() { StringBuffer result = new StringBuffer(256); result.append(dialogSpacer()); result.append(dialogButtons()); result.append("</form>\n"); return result.toString(); }
/** * Builds a default button row with a continue and cancel button.<p> * * Override this to have special buttons for your dialog.<p> * * @return the button row */ public String dialogButtons() { return dialogButtons( new int[] {BUTTON_CONTINUE, BUTTON_CANCEL}, new String[] { " onclick=\"submitAction('" + DIALOG_CONTINUE + "', form, '" + getListId() + "-form');\" id=\"nextButton\"", " onclick=\"submitAction('" + DIALOG_CANCEL + "', form, '" + getListId() + "-form');\""}); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#actionDialog() */ @Override public void actionDialog() throws JspException, ServletException, IOException { if (getAction() == ACTION_CONTINUE) { if (actionCreateResource()) { actionEditProperties(); return; } } super.actionDialog(); }
/** * @see org.opencms.workplace.CmsDialog#dialogButtonsHtml(java.lang.StringBuffer, int, java.lang.String) */ @Override protected void dialogButtonsHtml(StringBuffer result, int button, String attribute) { attribute = appendDelimiter(attribute); switch (button) { case BUTTON_NEXT: result.append("<input name=\"next\" type=\"submit\" value=\""); result.append(key(Messages.GUI_BUTTON_NEXTSCREEN_0)); result.append("\" class=\"dialogbutton\""); result.append(attribute); result.append(">\n"); break; default: super.dialogButtonsHtml(result, button, attribute); } }
/** * Used to close the current JSP dialog.<p> * * This method overwrites the close dialog method in the super class, * because in case a new folder was created before, after this dialog the tree view has to be refreshed.<p> * * It tries to include the URI stored in the workplace settings. * This URI is determined by the frame name, which has to be set * in the framename parameter.<p> * * @throws JspException if including an element fails */ @Override public void actionCloseDialog() throws JspException { if (isCreateIndexMode()) { // set the current explorer resource to the new created folder String updateFolder = CmsResource.getParentFolder(getSettings().getExplorerResource()); getSettings().setExplorerResource(updateFolder, getCms()); List<String> folderList = new ArrayList<String>(1); if (updateFolder != null) { folderList.add(updateFolder); } getJsp().getRequest().setAttribute(REQUEST_ATTRIBUTE_RELOADTREE, folderList); } super.actionCloseDialog(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#defaultActionHtmlContent() */ @Override protected String defaultActionHtmlContent() { StringBuffer result = new StringBuffer(2048); result.append("<!-- start before list -->\n"); result.append(customHtmlBeforeList()); result.append("<!-- end before list -->\n"); result.append(dialogBlockStart(key(getList().getName().getKey()))); result.append(dialogWhiteBoxStart()); // start scrollbox // result.append("<div style=\"overflow: auto; height: 150px; \">"); getList().setWp(this); result.append(getList().listHtml()); // end scrollbox // result.append("</div>"); result.append(dialogWhiteBoxEnd()); result.append(dialogBlockEnd()); return result.toString(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#actionDialog() */ @Override public void actionDialog() throws JspException, ServletException, IOException { if (getAction() == ACTION_OK) { actionChtype(); return; } else if (getAction() == ACTION_ADVANCED) { refreshList(); return; } super.actionDialog(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#customHtmlStart() */ @Override protected String customHtmlStart() { StringBuffer result = new StringBuffer(256); result.append(super.customHtmlStart()); result.append("<script type='text/javascript'>\n"); result.append("function submitAdvanced(theForm) {\n"); result.append("\ttheForm.action.value = \"" + CmsNewResource.DIALOG_ADVANCED + "\";\n"); result.append("\ttheForm.submit();\n"); result.append("}\n\n"); result.append("function submitChtype(theForm) {\n"); result.append("\ttheForm.action.value = \"" + DIALOG_OK + "\";\n"); result.append("\ttheForm.submit();\n"); result.append("}\n\n"); result.append("</script>"); return result.toString(); }
/** * @see org.opencms.workplace.CmsDialog#dialogButtonsHtml(java.lang.StringBuffer, int, java.lang.String) */ @Override protected void dialogButtonsHtml(StringBuffer result, int button, String attribute) { switch (button) { case BUTTON_CONTINUE: result.append("<input name=\"set\" type=\"button\" value=\""); result.append(key(Messages.GUI_BUTTON_CONTINUE_0) + "\""); if (attribute.toLowerCase().indexOf("onclick") == -1) { result.append( " onclick=\"submitAction('" + DIALOG_CONTINUE + "', form, '" + getListId() + "-form');\""); } result.append(" class=\"dialogbutton\""); result.append(" id=\"nextButton\""); result.append(" disabled=\"disabled\""); result.append(attribute); result.append(">\n"); break; default: super.dialogButtonsHtml(result, button, attribute); } }
/** * @see org.opencms.workplace.list.A_CmsListDialog#customHtmlEnd() */ @Override protected String customHtmlEnd() { StringBuffer result = new StringBuffer(256); result.append(super.customHtmlEnd()); // execute the javascript for de-/activating the continue button result.append("<script type='text/javascript'>\n"); result.append("\ttoggleButtonLabel();\n"); result.append("\tcheckValue();\n"); result.append("</script>"); return result.toString(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#actionDialog() */ @Override public void actionDialog() throws JspException, ServletException, IOException { if (getAction() == ACTION_OK) { actionChtype(); return; } else if (getAction() == ACTION_ADVANCED) { refreshList(); return; } super.actionDialog(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#customHtmlStart() */ @Override protected String customHtmlStart() { StringBuffer result = new StringBuffer(256); result.append(super.customHtmlStart()); result.append("<script type='text/javascript'>\n"); result.append("function enableButton() {\n"); result.append("\tvar theButton = document.getElementById(\"nextButton\");\n"); result.append("\tif (theButton.disabled == true) {\n"); result.append("\t\ttheButton.disabled = false;\n"); result.append("\t}\n"); result.append("}\n"); result.append("function submitAdvanced() {\n"); result.append( "\tdocument.forms[\"" + getList().getId() + "-form\"].action.value = \"" + DIALOG_ADVANCED + "\";\n"); result.append("\tdocument.forms[\"" + getList().getId() + "-form\"].submit();\n"); result.append("}\n"); result.append("</script>"); return result.toString(); }