/** * @see org.opencms.widgets.A_CmsWidget#getConfiguration() */ @Override public String getConfiguration() { if (super.getConfiguration() != null) { return super.getConfiguration(); } return CmsSelectWidgetOption.createConfigurationString(m_selectOptions); }
/** * @see org.opencms.widgets.I_CmsWidget#getDialogHtmlEnd(org.opencms.file.CmsObject, I_CmsWidgetDialog, I_CmsWidgetParameter) */ public String getDialogHtmlEnd(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter value) { return getHelpText(widgetDialog, value); }
/** * Default constructor.<p> */ protected A_CmsWidget() { setConfiguration(""); }
String helpId = getHelpKey(param); Set helpIdsShown = widgetDialog.getHelpMessageIds(); if (helpIdsShown.contains(helpId)) { result.append(helpId); result.append("\""); result.append(getJsHelpMouseHandler(widgetDialog, helpId, helpId)); result.append(">"); result.append(locValue);
result.append(keyDefault(A_CmsWidget.getLabelKey(p), p.getName())); if (count > 1) { result.append(" [").append(p.getIndex() + 1).append("]");
/** * @see org.opencms.widgets.A_CmsWidget#setEditorValue(org.opencms.file.CmsObject, java.util.Map, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ @Override public void setEditorValue( CmsObject cms, Map formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { super.setEditorValue(cms, formParameters, widgetDialog, param); String id = param.getStringValue(cms); if (CmsStringUtil.isEmptyOrWhitespaceOnly(id)) { return; } try { CmsCategory cat = CmsCategoryService.getInstance().getCategory(cms, cms.readResource(new CmsUUID(id))); if (cat.getPath().startsWith(getStartingCategory(cms, cms.getSitePath(getResource(cms, param))))) { param.setStringValue(cms, cat.getRootPath()); } else { param.setStringValue(cms, ""); } } catch (CmsException e) { // invalid value param.setStringValue(cms, ""); } }
/** * @see org.opencms.widgets.A_CmsWidget#getWidgetStringValue(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ @Override public String getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String result = super.getWidgetStringValue(cms, widgetDialog, param); String configuration = CmsMacroResolver.resolveMacros(getConfiguration(), cms, widgetDialog.getMessages()); if (configuration == null) { configuration = param.getDefault(cms); } List options = CmsSelectWidgetOption.parseOptions(configuration); for (int m = 0; m < options.size(); m++) { CmsSelectWidgetOption option = (CmsSelectWidgetOption)options.get(m); if (result.equals(option.getValue())) { result = option.getOption(); break; } } return result; }
String helpId = getHelpKey(param); Set<String> helpIdsShown = widgetDialog.getHelpMessageIds(); if (helpIdsShown.contains(helpId)) { result.append(helpId); result.append("\""); result.append(getJsHelpMouseHandler(widgetDialog, helpId, helpId)); result.append(">"); result.append(locValue);
result.append(keyDefault(A_CmsWidget.getLabelKey(p), p.getName())); if (count > 1) { result.append(" [").append(p.getIndex() + 1).append("]");
I_CmsWidgetParameter param) { super.setEditorValue(cms, formParameters, widgetDialog, param); String id = param.getStringValue(cms); if (CmsStringUtil.isEmptyOrWhitespaceOnly(id)) {
/** * Constructor for preprocessing the configuration string.<p> * * @param configuration the configuration string */ protected A_CmsWidget(String configuration) { setConfiguration(configuration); }
String locKey = getHelpKey(param); String locValue = widgetDialog.getMessages().key(locKey, true); if (!widgetDialog.useNewStyle()) { if (widgetDialog.useNewStyle()) { result.append(getJsHelpMouseHandler(widgetDialog, locKey, null)); } else { result.append(getJsHelpMouseHandler(widgetDialog, locKey, CmsStringUtil.escapeJavaScript(locValue)));
Messages.ERR_PROPERTY_WRITE_3, value, dialog.keyDefault(A_CmsWidget.getLabelKey(this), getKey()), m_baseObject.getClass().getName()), e.getTargetException(), this); } catch (Exception e) { Messages.ERR_PROPERTY_WRITE_3, value, dialog.keyDefault(A_CmsWidget.getLabelKey(this), getKey()), m_baseObject.getClass().getName()), e, this); CmsWidgetException error = new CmsWidgetException(Messages.get().container( Messages.ERR_MAP_DUPLICATE_KEY_3, dialog.keyDefault(A_CmsWidget.getLabelKey(this), getKey()), key, val), this); CmsWidgetException error = new CmsWidgetException(Messages.get().container( Messages.ERR_MAP_PARAMETER_FORM_1, dialog.keyDefault(A_CmsWidget.getLabelKey(this), getKey())), this); setError(error); throw error;
/** * @see org.opencms.widgets.A_CmsWidget#getConfiguration() */ @Override public String getConfiguration() { if (super.getConfiguration() != null) { return super.getConfiguration(); } return CmsSelectWidgetOption.createConfigurationString(m_selectOptions); }
/** * @see org.opencms.widgets.I_CmsWidget#getDialogHtmlEnd(org.opencms.file.CmsObject, I_CmsWidgetDialog, I_CmsWidgetParameter) */ public String getDialogHtmlEnd(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter value) { return getHelpText(widgetDialog, value); }
/** * Constructor for preprocessing the configuration string.<p> * * @param configuration the configuration string */ protected A_CmsWidget(String configuration) { setConfiguration(configuration); }
String locKey = getHelpKey(param); String locValue = widgetDialog.getMessages().key(locKey, true); if (!widgetDialog.useNewStyle()) { if (widgetDialog.useNewStyle()) { result.append(getJsHelpMouseHandler(widgetDialog, locKey, null)); } else { result.append(getJsHelpMouseHandler(widgetDialog, locKey, CmsStringUtil.escapeJavaScript(locValue)));
Messages.ERR_PROPERTY_WRITE_3, value, dialog.keyDefault(A_CmsWidget.getLabelKey(this), getKey()), m_baseObject.getClass().getName()), e.getTargetException(), Messages.ERR_PROPERTY_WRITE_3, value, dialog.keyDefault(A_CmsWidget.getLabelKey(this), getKey()), m_baseObject.getClass().getName()), e, Messages.get().container( Messages.ERR_MAP_DUPLICATE_KEY_3, dialog.keyDefault(A_CmsWidget.getLabelKey(this), getKey()), key, val), Messages.get().container( Messages.ERR_MAP_PARAMETER_FORM_1, dialog.keyDefault(A_CmsWidget.getLabelKey(this), getKey())), this); setError(error);
/** * @see org.opencms.widgets.A_CmsWidget#getConfiguration() */ @Override public String getConfiguration() { if (super.getConfiguration() != null) { return super.getConfiguration(); } return CmsHtmlWidgetOption.createConfigurationString(getHtmlWidgetOption()); }
/** * Default constructor.<p> */ protected A_CmsWidget() { setConfiguration(""); }