/** * @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.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.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#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]); } }
/** * @see org.opencms.widgets.I_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<String, String[]> formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String[] imgValues = formParameters.get(PREFIX_IMAGE + param.getId()); if ((imgValues != null) && (imgValues.length > 0)) { param.setStringValue(cms, imgValues[0]); } CmsXmlVfsImageValue value = (CmsXmlVfsImageValue)param; String[] descValues = formParameters.get(PREFIX_DESCRIPTION + param.getId()); value.setDescription(cms, descValues[0]); String[] formatValues = formParameters.get(PREFIX_FORMAT + param.getId()); value.setFormat(cms, formatValues[0]); String[] scaleValues = formParameters.get(PREFIX_SCALE + param.getId()); value.setScaleOptions(cms, scaleValues[0]); }
/** * @see org.opencms.widgets.I_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) { String[] imgValues = (String[])formParameters.get(PREFIX_IMAGE + param.getId()); if ((imgValues != null) && (imgValues.length > 0)) { param.setStringValue(cms, imgValues[0]); } CmsXmlVfsImageValue value = (CmsXmlVfsImageValue)param; String[] descValues = (String[])formParameters.get(PREFIX_DESCRIPTION + param.getId()); value.setDescription(cms, descValues[0]); String[] formatValues = (String[])formParameters.get(PREFIX_FORMAT + param.getId()); value.setFormat(cms, formatValues[0]); String[] scaleValues = (String[])formParameters.get(PREFIX_SCALE + param.getId()); value.setScaleOptions(cms, scaleValues[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) { StringBuffer result = new StringBuffer(16); result.append("<td class=\"xmlTd\">"); result.append("<input type=\"checkbox\" name=\""); result.append(param.getId()); result.append("\" value=\"true\""); boolean booleanValue = CmsXmlBooleanValue.getBooleanValue(cms, param); if (booleanValue) { result.append(" checked=\"checked\""); } result.append(">"); result.append("<input type=\"hidden\" name=\""); result.append(param.getId()); result.append(HIDDEN_SUFFIX); result.append("\" value=\""); result.append(booleanValue); result.append("\">"); result.append("</td>"); return result.toString(); }
/** * @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) { StringBuffer result = new StringBuffer(16); result.append("<td class=\"xmlTd\">"); result.append("<input type=\"checkbox\" name=\""); result.append(param.getId()); result.append("\" value=\"true\""); boolean booleanValue = CmsXmlBooleanValue.getBooleanValue(cms, param); if (booleanValue) { result.append(" checked=\"checked\""); } result.append(">"); result.append("<input type=\"hidden\" name=\""); result.append(param.getId()); result.append(HIDDEN_SUFFIX); result.append("\" value=\""); result.append(booleanValue); result.append("\">"); result.append("</td>"); return result.toString(); }
/** * @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 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=\""); result.append(CmsEncoder.escapeXml(param.getStringValue(cms))); result.append("\">"); result.append("</td>"); return result.toString(); }
/** * @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(); }
/** * @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(); }
/** * @see org.opencms.widgets.I_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<String, String[]> formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String[] values = formParameters.get(param.getId()); if ((values != null) && (values.length > 0)) { String val = CmsEncoder.decode(values[0], CmsEncoder.ENCODING_UTF_8); param.setStringValue(cms, val); } }
/** * @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 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=\""); result.append(CmsEncoder.escapeXml(param.getStringValue(cms))); result.append("\">"); result.append("</td>"); 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) */ @Override 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)) { StringBuffer value = new StringBuffer(128); for (int i = 0; i < values.length; i++) { if (i > 0) { value.append(','); } value.append(values[i]); } // set the value param.setStringValue(cms, value.toString()); } else { // erase: param.setStringValue(cms, ""); } }
/** * @see org.opencms.widgets.I_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<String, String[]> formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String[] values = formParameters.get(param.getId()); if ((values != null) && (values.length > 0)) { String val = CmsEncoder.decode(values[0], CmsEncoder.ENCODING_UTF_8); param.setStringValue(cms, val); } }
/** * @see org.opencms.widgets.I_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) { String[] values = (String[])formParameters.get(param.getId()); if ((values != null) && (values.length > 0)) { String val = CmsEncoder.decode(values[0], CmsEncoder.ENCODING_UTF_8); param.setStringValue(cms, val); } }
/** * @see org.opencms.widgets.I_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) { String[] values = (String[])formParameters.get(param.getId()); if ((values != null) && (values.length > 0)) { String val = CmsEncoder.decode(values[0], CmsEncoder.ENCODING_UTF_8); param.setStringValue(cms, val); } }
/** * @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); int rows = DEFAULT_ROWS_NUMBER; try { rows = new Integer(getConfiguration()).intValue(); } catch (Exception e) { // ignore } result.append("<td class=\"xmlTd\">"); result.append("<textarea class=\"xmlInput maxwidth"); if (param.hasError()) { result.append(" xmlInputError"); } result.append("\" name=\""); result.append(id); result.append("\" rows=\""); result.append(rows); result.append("\" cols=\"60\" style=\"overflow:auto;\">"); result.append(CmsEncoder.escapeXml(param.getStringValue(cms))); result.append("</textarea>"); result.append("</td>"); 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) */ @Override 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)) { CmsXmlColorValue castValue = (CmsXmlColorValue)param; String castColorValue = castValue.getStringValue(cms); String colorValue = values[0].trim(); if (CmsStringUtil.isNotEmpty(colorValue)) { castColorValue = colorValue; } param.setStringValue(cms, String.valueOf(castColorValue)); } }
/** * @see org.opencms.widgets.I_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<String, String[]> formParameters, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String[] values = formParameters.get(param.getId()); if ((values != null) && (values.length > 0)) { CmsXmlColorValue castValue = (CmsXmlColorValue)param; String castColorValue = castValue.getStringValue(cms); String colorValue = values[0].trim(); if (CmsStringUtil.isNotEmpty(colorValue)) { castColorValue = colorValue; } param.setStringValue(cms, String.valueOf(castColorValue)); } }