/** * @see org.opencms.workplace.list.I_CmsListAction#setWp(org.opencms.workplace.list.A_CmsListDialog) */ @Override public void setWp(A_CmsListDialog wp) { super.setWp(wp); m_cms = wp.getCms(); m_userName = null; } }
/** * Display method for two list dialogs, executes actions, but only displays if needed.<p> * * @param writeLater if <code>true</code> no output is written, * you have to call manually the <code>{@link #defaultActionHtml()}</code> method. * * @throws JspException if dialog actions fail * @throws IOException if writing to the JSP out fails, or in case of errors forwarding to the required result page * @throws ServletException in case of errors forwarding to the required result page */ public void displayDialog(boolean writeLater) throws JspException, IOException, ServletException { // perform the active list actions m_activeWp.actionDialog(); if (m_activeWp.isForwarded()) { return; } m_activeWp.refreshList(); m_passiveWp.refreshList(); if (writeLater) { return; } JspWriter out = m_activeWp.getJsp().getJspContext().getOut(); out.print(defaultActionHtml()); }
/** * Returns the html code for the default action content.<p> * * @return html code */ protected String defaultActionHtmlContent() { StringBuffer result = new StringBuffer(2048); result.append("<form name='"); result.append(getList().getId()); result.append("-form' action='"); result.append(getDialogRealUri()); result.append("' method='post' class='nomargin'"); if (getList().getMetadata().isSearchable()) { result.append(" onsubmit=\"listSearchAction('"); result.append(getList().getId()); result.append("', '"); result.append(getList().getMetadata().getSearchAction().getId()); result.append("', '"); result.append(getList().getMetadata().getSearchAction().getConfirmationMessage().key(getLocale())); result.append("');\""); } result.append(">\n"); result.append(allParamsAsHidden()); result.append("\n"); getList().setWp(this); result.append(getList().listHtml()); result.append("\n</form>\n"); return result.toString(); }
/** * Performs the dialog actions depending on the initialized action and displays the dialog form if needed.<p> * * @param writeLater if <code>true</code> no output is written, * you have to call manually the <code>{@link #defaultActionHtml()}</code> method. * * @throws JspException if dialog actions fail * @throws IOException if writing to the JSP out fails, or in case of errors forwarding to the required result page * @throws ServletException in case of errors forwarding to the required result page */ public void displayDialog(boolean writeLater) throws JspException, IOException, ServletException { actionDialog(); if (writeLater) { return; } writeDialog(); }
/** * This method should handle the default list independent actions, * by comparing <code>{@link #getParamListAction()}</code> with the id * of the action to execute.<p> * * if you want to handle additional independent actions, override this method, * handling your actions and FINALLY calling <code>super.executeListIndepActions();</code>.<p> */ public void executeListIndepActions() { if (getList().getMetadata().getItemDetailDefinition(getParamListAction()) != null) { // toggle item details getList().getMetadata().toogleDetailState(getParamListAction()); // lazy initialization initializeDetail(getParamListAction()); } listSave(); }
/** * Display method for two list dialogs, executes actions, but only displays if needed.<p> * * @param writeLater if <code>true</code> no output is written, * you have to call manually the <code>{@link #defaultActionHtml()}</code> method. * * @throws JspException if dialog actions fail * @throws IOException if writing to the JSP out fails, or in case of errros forwarding to the required result page * @throws ServletException in case of errros forwarding to the required result page */ public void displayDialog(boolean writeLater) throws JspException, IOException, ServletException { // perform the active list actions m_activeWp.actionDialog(); if (m_activeWp.isForwarded()) { return; } Iterator<A_CmsListDialog> i = m_wps.iterator(); while (i.hasNext()) { A_CmsListDialog wp = i.next(); wp.refreshList(); } if (writeLater) { return; } writeDialog(); }
/** * @see org.opencms.workplace.CmsWorkplace#initMessages() */ @Override protected void initMessages() { // add specific messages addMessages(Messages.get().getBundleName()); // add default messages super.initMessages(); }
/** * Generates the hml code for an empty table.<p> * * @return html code */ public String htmlEmptyTable() { StringBuffer html = new StringBuffer(512); html.append("<tr class='oddrowbg'>\n"); html.append("\t<td align='center' colspan='"); html.append(getWidth()); html.append("'>\n"); html.append(Messages.get().getBundle(getWp().getLocale()).key(Messages.GUI_LIST_EMPTY_0)); html.append("\t</td>\n"); html.append("</tr>\n"); return html.toString(); }
/** * Calls the <code>{@link #getListItems}</code> method and catches any exception.<p> */ protected void fillList() { try { getList().setContent(getListItems()); // initialize detail columns Iterator<CmsListItemDetails> itDetails = getList().getMetadata().getItemDetailDefinitions().iterator(); while (itDetails.hasNext()) { initializeDetail(itDetails.next().getId()); } } catch (Exception e) { throw new CmsRuntimeException( Messages.get().container(Messages.ERR_LIST_FILL_1, getList().getName().key(getLocale()), null), e); } }
result.append(getFirstWp().getDialogRealUri()); result.append("' class='nomargin' onsubmit=\"return submitAction('ok', null, 'actions');\">\n"); result.append(getFirstWp().allParamsAsHidden()); result.append("<div class=\"dialogspacer\" unselectable=\"on\"> </div>\n"); result.append("<!-- button row start -->\n<div class=\"dialogbuttons\" unselectable=\"on\">\n"); result.append("' type='button' value='"); result.append( Messages.get().container(Messages.GUI_ORGUNITUSERS_BUTTON_CONFIRM_0).key(getFirstWp().getLocale())); result.append("' onclick=\"submitAction('"); result.append(CmsDialog.DIALOG_CONFIRMED); result.append("' type='button' value='"); result.append( Messages.get().container(Messages.GUI_ORGUNITUSERS_BUTTON_CANCEL_0).key(getFirstWp().getLocale())); result.append("' onclick=\"submitAction('"); result.append(CmsDialog.DIALOG_CANCEL);
/** * Generates the need html code for ending a list.<p> * * @return html code */ protected String htmlEnd() { StringBuffer html = new StringBuffer(512); html.append("\t\t\t</td></tr>\n"); html.append("\t\t</table>\n"); if (isBoxed()) { html.append(getWp().dialogBlock(CmsWorkplace.HTML_END, m_name.key(getWp().getLocale()), false)); } html.append("</div>\n"); return html.toString(); }
/** * A convenient method to throw a list unsupported * action runtime exception.<p> * * Should be triggered if your list implementation does not * support the <code>{@link #getParamListAction()}</code> * action.<p> * * @throws CmsRuntimeException always to signal that this operation is not supported */ protected void throwListUnsupportedActionException() throws CmsRuntimeException { throw new CmsRuntimeException(Messages.get().container( Messages.ERR_LIST_UNSUPPORTED_ACTION_2, getList().getName().key(getLocale()), getParamListAction())); }
/** * @see org.opencms.workplace.tools.I_CmsHtmlIconButton#isVisible() */ @Override public boolean isVisible() { if (getResourceName() != null) { try { // if resource type if editable if (OpenCms.getWorkplaceManager().getEditorHandler().getEditorUri(getResourceName(), getWp().getJsp()) != null) { // check lock state CmsLock lock = getResourceUtil().getLock(); if (lock.isNullLock() || lock.isOwnedBy((getWp().getCms().getRequestContext().currentUser()))) { return isEnabled(); } } } catch (Throwable e) { // ignore } } return !isEnabled(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, * javax.servlet.http.HttpServletRequest) */ @Override protected void initWorkplaceRequestValues(final CmsWorkplaceSettings settings, final HttpServletRequest request) { super.initWorkplaceRequestValues(settings, request); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#actionDialog() */ @Override public void actionDialog() throws JspException, ServletException, IOException { updateGroupList(); super.actionDialog(); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#initializeDetail(java.lang.String) */ @Override protected void initializeDetail(String detailId) { super.initializeDetail(detailId); if (detailId.equals(LIST_DETAIL_OTHEROU)) { boolean visible = hasGroupsInOtherOus() && getList().getMetadata().getItemDetailDefinition(LIST_DETAIL_OTHEROU).isVisible(); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setVisible(visible); getList().getMetadata().getColumnDefinition(LIST_COLUMN_ORGUNIT).setPrintable(visible); } }
/** * @see org.opencms.workplace.CmsWorkplace#initMessages() */ @Override protected void initMessages() { // add specific dialog resource bundle addMessages(Messages.get().getBundleName()); // add default resource bundles super.initMessages(); }
/** * Generates the hml code for an empty table.<p> * * @return html code */ public String htmlEmptyTable() { StringBuffer html = new StringBuffer(512); html.append("<tr class='oddrowbg'>\n"); html.append("\t<td align='center' colspan='"); html.append(getWidth()); html.append("'>\n"); html.append(Messages.get().getBundle(getWp().getLocale()).key(Messages.GUI_LIST_EMPTY_0)); html.append("\t</td>\n"); html.append("</tr>\n"); return html.toString(); }
/** * Calls the <code>{@link #getListItems}</code> method and catches any exception.<p> */ protected void fillList() { try { getList().setContent(getListItems()); // initialize detail columns Iterator itDetails = getList().getMetadata().getItemDetailDefinitions().iterator(); while (itDetails.hasNext()) { initializeDetail(((CmsListItemDetails)itDetails.next()).getId()); } } catch (Exception e) { throw new CmsRuntimeException(Messages.get().container( Messages.ERR_LIST_FILL_1, getList().getName().key(getLocale()), null), e); } }
/** * This method should handle the default list independent actions, * by comparing <code>{@link #getParamListAction()}</code> with the id * of the action to execute.<p> * * if you want to handle additional independent actions, override this method, * handling your actions and FINALLY calling <code>super.executeListIndepActions();</code>.<p> */ public void executeListIndepActions() { if (getList().getMetadata().getItemDetailDefinition(getParamListAction()) != null) { // toggle item details getList().getMetadata().toogleDetailState(getParamListAction()); // lazy initialization initializeDetail(getParamListAction()); } listSave(); }