/** * Generates the HTML for the end of the widget dialog.<p> * * This HTML includes additional components, for example the <div> * tags containing the help texts.<p> * * @return the HTML for the end of the widget dialog */ public String getWidgetHtmlEnd() { StringBuffer result = new StringBuffer(32); // iterate over unique widgets from collector Iterator<CmsWidgetDialogParameter> i = getWidgets().iterator(); while (i.hasNext()) { CmsWidgetDialogParameter param = i.next(); result.append(param.getWidget().getDialogHtmlEnd(getCms(), this, param)); } return result.toString(); }
/** * @see org.opencms.widgets.I_CmsWidget#getDialogIncludes(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog) */ @Override public String getDialogIncludes(CmsObject cms, I_CmsWidgetDialog widgetDialog) { return getEditorWidget(cms, widgetDialog).getDialogIncludes(cms, widgetDialog); }
/** * @see org.opencms.widgets.I_CmsWidget#getDialogInitCall(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog) */ @Override public String getDialogInitCall(CmsObject cms, I_CmsWidgetDialog widgetDialog) { return getEditorWidget(cms, widgetDialog).getDialogInitCall(cms, widgetDialog); }
/** * Sets the editor values for the locale with the parameters from the request.<p> * * Called before saving the xml content, redisplaying the input form, * changing the language and adding or removing elements.<p> * * @param locale the locale of the content to save * @throws CmsXmlException if something goes wrong */ public void setEditorValues(Locale locale) throws CmsXmlException { List valueNames = getSimpleValueNames(m_content.getContentDefinition(), "", locale); Iterator i = valueNames.iterator(); while (i.hasNext()) { String valueName = (String)i.next(); I_CmsXmlContentValue value = m_content.getValue(valueName, locale); I_CmsWidget widget = value.getContentDefinition().getContentHandler().getWidget(value); widget.setEditorValue(getCms(), getJsp().getRequest().getParameterMap(), this, (I_CmsWidgetParameter)value); } }
if (p.getIndex() == 0) { result.append(p.getWidget().getHelpBubble(getCms(), this, p)); } else { result.append(widget.getDialogWidget(getCms(), this, p)); } else {
/** * @see org.opencms.widgets.I_CmsWidget#getDialogInitMethod(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog) */ @Override public String getDialogInitMethod(CmsObject cms, I_CmsWidgetDialog widgetDialog) { return getEditorWidget(cms, widgetDialog).getDialogInitMethod(cms, widgetDialog); }
/** * @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) { return getEditorWidget(cms, widgetDialog).getDialogWidget(cms, widgetDialog, param); }
/** * @see org.opencms.xml.content.I_CmsXmlContentHandler#getWidget(org.opencms.xml.types.I_CmsXmlContentValue) */ public I_CmsWidget getWidget(I_CmsXmlContentValue value) { // try the specific widget settings first I_CmsWidget result = m_elementWidgets.get(value.getName()); if (result == null) { // use default widget mappings result = OpenCms.getXmlContentTypeManager().getWidgetDefault(value.getTypeName()); } else { result = result.newInstance(); } // set the configuration value for this widget String configuration = getConfiguration(value); if (configuration == null) { // no individual configuration defined, try to get global default configuration configuration = OpenCms.getXmlContentTypeManager().getWidgetDefaultConfiguration(result); } result.setConfiguration(configuration); return result; }
/** * Returns the editor widget for the specified XML content type.<p> * * @param typeName the name of the XML content type to get the widget for * @return the editor widget for the specified XML content type */ public I_CmsWidget getWidgetDefault(String typeName) { I_CmsWidget result = m_defaultWidgets.get(typeName); if (result != null) { result = result.newInstance(); } return result; }
/** * * @see org.opencms.xml.content.I_CmsXmlContentValueVisitor#visit(org.opencms.xml.types.I_CmsXmlContentValue) */ public void visit(I_CmsXmlContentValue value) { // only add simple types if (value.isSimpleType()) { String locale = value.getLocale().toString(); if (!m_locales.contains(locale)) { m_buffer.append("\n\n[").append(locale).append(']'); m_locales.add(locale); } m_buffer.append("\n\n[").append(value.getPath()).append("]\n\n"); try { I_CmsWidget widget = value.getDocument().getContentDefinition().getContentHandler().getWidget(value); m_buffer.append(widget.getWidgetStringValue( getCms(), new CmsResourceInfoDialog(getJsp()), (I_CmsWidgetParameter)value)); } catch (CmsXmlException e) { LOG.error(e.getMessage(), e); } } } }
editorWidget.setConfiguration("15"); m_editorWidget = editorWidget;
/** * Sets the editor values for the locale with the parameters from the request.<p> * * Called before saving the xml content, redisplaying the input form, * changing the language and adding or removing elements.<p> * * @param locale the locale of the content to save * @throws CmsXmlException if something goes wrong */ public void setEditorValues(Locale locale) throws CmsXmlException { List<String> names = m_content.getNames(locale); Iterator<String> i = names.iterator(); while (i.hasNext()) { String path = i.next(); I_CmsXmlContentValue value = m_content.getValue(path, locale); if (value.isSimpleType()) { I_CmsWidget widget = value.getContentDefinition().getContentHandler().getWidget(value); widget.setEditorValue( getCms(), getJsp().getRequest().getParameterMap(), this, (I_CmsWidgetParameter)value); } } }
if (p.getIndex() == 0) { result.append(p.getWidget().getHelpBubble(getCms(), this, p)); } else { result.append(widget.getDialogWidget(getCms(), this, p)); } else {
/** * @see org.opencms.widgets.I_CmsWidget#getDialogInitMethod(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog) */ @Override public String getDialogInitMethod(CmsObject cms, I_CmsWidgetDialog widgetDialog) { return getEditorWidget(cms, widgetDialog).getDialogInitMethod(cms, widgetDialog); }
/** * @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) { return getEditorWidget(cms, widgetDialog).getDialogWidget(cms, widgetDialog, param); }
/** * @see org.opencms.xml.content.I_CmsXmlContentHandler#getWidget(org.opencms.xml.types.I_CmsXmlSchemaType) */ public I_CmsWidget getWidget(I_CmsXmlSchemaType value) { // try the specific widget settings first I_CmsWidget result = m_elementWidgets.get(value.getName()); if (result == null) { // use default widget mappings result = OpenCms.getXmlContentTypeManager().getWidgetDefault(value.getTypeName()); } else { result = result.newInstance(); } if (result != null) { // set the configuration value for this widget String configuration = getConfiguration(value); if (configuration == null) { // no individual configuration defined, try to get global default configuration configuration = OpenCms.getXmlContentTypeManager().getWidgetDefaultConfiguration(result); } result.setConfiguration(configuration); } return result; }
/** * Returns the editor widget for the specified XML content type.<p> * * @param typeName the name of the XML content type to get the widget for * @return the editor widget for the specified XML content type */ public I_CmsWidget getWidgetDefault(String typeName) { I_CmsWidget result = m_defaultWidgets.get(typeName); if (result != null) { result = result.newInstance(); } return result; }
/** * * @see org.opencms.xml.content.I_CmsXmlContentValueVisitor#visit(org.opencms.xml.types.I_CmsXmlContentValue) */ public void visit(I_CmsXmlContentValue value) { // only add simple types if (value.isSimpleType()) { String locale = value.getLocale().toString(); if (!m_locales.contains(locale)) { m_buffer.append("\n\n[").append(locale).append(']'); m_locales.add(locale); } m_buffer.append("\n\n[").append(value.getPath()).append("]\n\n"); try { I_CmsWidget widget = value.getDocument().getContentDefinition().getContentHandler().getWidget( value); m_buffer.append( widget.getWidgetStringValue( getCms(), new CmsResourceInfoDialog(getJsp()), (I_CmsWidgetParameter)value)); } catch (CmsXmlException e) { LOG.error(e.getMessage(), e); } } } }
editorWidget.setConfiguration("15"); m_editorWidget = editorWidget;
CmsWidgetDialogParameter param = new CmsWidgetDialogParameter(base, params.size(), j); param.setKeyPrefix(m_prefix); base.getWidget().setEditorValue(getCms(), processedParameters, this, param); params.add(param);