I_CmsWidgetParameter param) { String[] values = (String[])formParameters.get(param.getId()); if ((values != null) && (values.length > 0)) { param.setStringValue(cms, String.valueOf(booleanValue)); values = (String[])formParameters.get(param.getId() + HIDDEN_SUFFIX); if ((values != null) && (values.length > 0)) { } else { value = param.getDefault(cms); param.setStringValue(cms, value);
/** * @see org.opencms.widgets.I_CmsWidget#getDialogWidget(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ public String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String id = param.getId(); StringBuffer result = new StringBuffer(16); result.append("<td class=\"xmlTd\"><input type=\"password\" class=\"xmlInput textInput"); if (param.hasError()) { result.append(" xmlInputError"); } result.append("\" name=\""); result.append(id); result.append("\" id=\""); result.append(id); result.append("\" value=\""); result.append(CmsEncoder.escapeXml(param.getStringValue(cms))); result.append("\">"); result.append("</td>"); return result.toString(); }
/** * Returns the localized label key for the provided widget parameter.<p> * @param param the widget parameter to return the localized label key for * * @return the localized label key for the provided widget parameter */ public static String getLabelKey(I_CmsWidgetParameter param) { // calculate the key StringBuffer result = new StringBuffer(64); result.append(LABEL_PREFIX); result.append(param.getKey()); return result.toString(); }
/** * @see org.opencms.widgets.I_CmsWidget#setEditorValue(org.opencms.file.CmsObject, java.util.Map, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ public void setEditorValue( CmsObject cms, Map<String, String[]> formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String[] values = formParameters.get(param.getId()); if ((values != null) && (values.length > 0)) { param.setStringValue(cms, values[0]); } }
/** * @see org.opencms.widgets.I_CmsWidget#getDialogWidget(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ public String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String id = param.getId(); // initialize bundle initConfiguration(cms, param); StringBuffer result = new StringBuffer(256); result.append("<td class=\"xmlTd\">"); result.append("<input class=\"xmlInput textInput"); if (param.hasError()) { result.append(" xmlInputError"); } result.append("\""); result.append(" name=\""); result.append(id); result.append("\" id=\""); result.append(id); result.append("\" value=\""); // determine value to show in editor String value = getValue(cms, param); result.append(CmsEncoder.escapeXml(value)); result.append("\">"); result.append("</td>"); return result.toString(); }
String colorValue = param.getStringValue(cms); String id = param.getId();
I_CmsWidgetParameter param) { String[] values = formParameters.get(param.getId()); if ((values != null) && (values.length > 0)) { String dateTimeValue = values[0].trim(); if (CmsMacroResolver.isMacro(dateTimeValue, CmsMacroResolver.KEY_CURRENT_TIME)) { param.setStringValue(cms, dateTimeValue); } else { dateTime = Long.valueOf(param.getStringValue(cms)).longValue(); } catch (NumberFormatException e) { dateTime = 0; dateTime = 0; param.setStringValue(cms, String.valueOf(dateTime));
/** * @see org.opencms.widgets.I_CmsWidget#getWidgetStringValue(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ public String getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { if (param != null) { return param.getStringValue(cms); } return null; }
/** * @see org.opencms.widgets.I_CmsWidget#getDialogWidget(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ public String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String id = param.getId(); StringBuffer result = new StringBuffer(16); result.append("<td class=\"xmlTd\">"); result.append("<input type=\"file\" name=\""); result.append(id); // accept has to be set dynamically result.append("\" class=\"maxwidth\" accept=\"text/comma-separated-values\">"); result.append("</td>"); return result.toString(); }
/** * @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<CmsSelectWidgetOption> options = CmsSelectWidgetOption.parseOptions(configuration); for (int m = 0; m < options.size(); m++) { CmsSelectWidgetOption option = options.get(m); if (result.equals(option.getValue())) { result = option.getOption(); break; } } return result; }
/** * @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, ""); } }
m_bundleKey = param.getName();
/** * @see org.opencms.widgets.I_CmsWidget#setEditorValue(org.opencms.file.CmsObject, java.util.Map, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ public void setEditorValue( CmsObject cms, Map formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String[] values = (String[])formParameters.get(param.getId()); if ((values != null) && (values.length > 0)) { param.setStringValue(cms, values[0]); } }
String colorValue = param.getStringValue(cms); String id = param.getId();
I_CmsWidgetParameter param) { String[] values = (String[])formParameters.get(param.getId()); if ((values != null) && (values.length > 0)) { String dateTimeValue = values[0].trim(); if (CmsMacroResolver.isMacro(dateTimeValue, CmsMacroResolver.KEY_CURRENT_TIME)) { param.setStringValue(cms, dateTimeValue); } else { dateTime = Long.valueOf(param.getStringValue(cms)).longValue(); } catch (NumberFormatException e) { dateTime = 0; dateTime = 0; param.setStringValue(cms, String.valueOf(dateTime));
/** * @see org.opencms.widgets.I_CmsWidget#getWidgetStringValue(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ public String getWidgetStringValue(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { if (param != null) { return param.getStringValue(cms); } return null; }
/** * @see org.opencms.widgets.I_CmsWidget#getDialogWidget(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ public String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String id = param.getId(); StringBuffer result = new StringBuffer(16); result.append("<td class=\"xmlTd\">"); result.append("<input type=\"file\" name=\""); result.append(id); // accept has to be set dynamically result.append("\" class=\"maxwidth\" accept=\"text/comma-separated-values\">"); result.append("</td>"); return result.toString(); }
/** * @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 id = param.getStringValue(cms); if (CmsStringUtil.isEmptyOrWhitespaceOnly(id)) { return; param.setStringValue(cms, cat.getRootPath()); } else { param.setStringValue(cms, ""); param.setStringValue(cms, "");