/** * Returns the widget configuration.<p> * * @param cms an initialized instance of a CmsObject * @param messages the dialog where the widget is used on * @param param the widget parameter to generate the widget for * * @return the widget configuration */ protected CmsGalleryWidgetConfiguration getWidgetConfiguration( CmsObject cms, CmsMessages messages, I_CmsWidgetParameter param) { if (m_widgetConfiguration == null) { m_widgetConfiguration = new CmsGalleryWidgetConfiguration(cms, messages, param, getConfiguration()); } return m_widgetConfiguration; }
/** * Generates an initialized configuration for the gallery item widget using the given configuration string.<p> * * @param cms an initialized instance of a CmsObject * @param widgetDialog the dialog where the widget is used on * @param param the widget parameter to generate the widget for * @param configuration the widget configuration string */ public CmsGalleryWidgetConfiguration( CmsObject cms, CmsMessages widgetDialog, I_CmsWidgetParameter param, String configuration) { init(cms, widgetDialog, param, configuration); }
setClassName(jsonObj.optString(CONFIG_KEY_CLASS, null)); I_CmsGalleryWidgetDynamicConfiguration dynConf = null; if (getClassName() != null) { try { dynConf = (I_CmsGalleryWidgetDynamicConfiguration)Class.forName(getClassName()).newInstance(); } catch (Exception e) { setType(jsonObj.optString(CONFIG_KEY_TYPE)); if ((CONFIG_VALUE_DYNAMIC.equals(getType()) || CmsStringUtil.isEmpty(getType())) && (dynConf != null)) { setType(dynConf.getType(cms, messages, param)); setGalleryTypes(jsonObj.optString(CONFIG_KEY_GALLERYTYPES, null)); setStartup(jsonObj.optString(CONFIG_KEY_STARTUP)); if ((CONFIG_VALUE_DYNAMIC.equals(getStartup()) || CmsStringUtil.isEmpty(getStartup())) && (dynConf != null)) { setStartup(dynConf.getStartup(cms, messages, param));
CmsGalleryWidgetConfiguration configuration = new CmsGalleryWidgetConfiguration( cms, widgetDialog, result.append("\nvar startupFolder").append(idHash).append(" = \"").append(configuration.getStartup()).append( "\";"); result.append("\nvar startupType").append(idHash).append(" = \"").append(configuration.getType()).append("\";"); result.append("\n</script>");
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(configuration.getStartup())) { result.put(I_CmsGalleryProviderConstants.CONFIG_GALLERY_PATH, configuration.getStartup()); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(configuration.getGalleryTypes())) { result.put(I_CmsGalleryProviderConstants.CONFIG_GALLERY_TYPES, configuration.getGalleryTypes());
setClassName(jsonObj.optString(CONFIG_KEY_CLASS, null)); I_CmsGalleryWidgetDynamicConfiguration dynConf = null; if (getClassName() != null) { try { dynConf = (I_CmsGalleryWidgetDynamicConfiguration)Class.forName(getClassName()).newInstance(); } catch (Exception e) { setType(jsonObj.optString(CONFIG_KEY_TYPE)); if ((CONFIG_VALUE_DYNAMIC.equals(getType()) || CmsStringUtil.isEmpty(getType())) && (dynConf != null)) { setType(dynConf.getType(cms, widgetDialog, param)); setStartup(jsonObj.optString(CONFIG_KEY_STARTUP)); if ((CONFIG_VALUE_DYNAMIC.equals(getStartup()) || CmsStringUtil.isEmpty(getStartup())) && (dynConf != null)) { setStartup(dynConf.getStartup(cms, widgetDialog, param));
/** * @see org.opencms.widgets.I_CmsADEWidget#getConfiguration(org.opencms.file.CmsObject, org.opencms.xml.types.A_CmsXmlContentValue, org.opencms.i18n.CmsMessages, org.opencms.file.CmsResource, java.util.Locale) */ public String getConfiguration( CmsObject cms, A_CmsXmlContentValue schemaType, CmsMessages messages, CmsResource resource, Locale contentLocale) { CmsGalleryWidgetConfiguration config = new CmsGalleryWidgetConfiguration( cms, messages, schemaType, getConfiguration()); JSONObject linkGalleryInfo = new JSONObject(); try { linkGalleryInfo.put("startupfolder", config.getStartup()); linkGalleryInfo.put("startuptype", config.getType()); linkGalleryInfo.put("editedresource", resource.getRootPath()); } catch (JSONException e) { // TODO: Auto-generated catch block e.printStackTrace(); } return "¶ms=" + linkGalleryInfo.toString(); }
CmsGalleryWidgetConfiguration configuration = new CmsGalleryWidgetConfiguration( cms, widgetDialog.getMessages(), result.append("\nvar startupFolder").append(idHash).append(" = \"").append(configuration.getStartup()).append( "\";"); result.append("\nvar startupType").append(idHash).append(" = \"").append(configuration.getType()).append("\";"); result.append("\n</script>");
/** * Generates an initialized configuration for the gallery item widget using the given configuration string.<p> * * @param cms an initialized instance of a CmsObject * @param widgetDialog the dialog where the widget is used on * @param param the widget parameter to generate the widget for * @param configuration the widget configuration string */ public CmsGalleryWidgetConfiguration( CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param, String configuration) { init(cms, widgetDialog, param, configuration); }
CmsGalleryWidgetConfiguration configuration = new CmsGalleryWidgetConfiguration( cms, widgetDialog, getConfiguration()); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(configuration.getStartup())) { result.append("\n<script type=\"text/javascript\">"); result.append("\nvar startupFolder").append(idHash).append(" = \"").append(configuration.getStartup()).append( "\";"); result.append("\nvar startupType").append(idHash).append(" = \"").append(configuration.getType()).append( "\";"); result.append("\n</script>");
CmsGalleryWidgetConfiguration configuration = new CmsGalleryWidgetConfiguration( cms, widgetDialog.getMessages(), getConfiguration()); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(configuration.getStartup())) { result.append("\n<script type=\"text/javascript\">"); result.append("\nvar startupFolder").append(idHash).append(" = \"").append( configuration.getStartup()).append("\";"); result.append("\nvar startupType").append(idHash).append(" = \"").append( configuration.getType()).append("\";"); result.append("\n</script>"); } else {