/** * Filters the preferred editor from the list of all available editors.<p> * * @param preferredEditor the preferred editor identification String * @return the preferred editor configuration object or null, if none is found */ private CmsWorkplaceEditorConfiguration filterPreferredEditor(String preferredEditor) { if (m_preferredEditors.size() == 0) { Iterator<CmsWorkplaceEditorConfiguration> i = m_editorConfigurations.iterator(); while (i.hasNext()) { CmsWorkplaceEditorConfiguration currentConfig = i.next(); m_preferredEditors.put(currentConfig.getEditorUri(), currentConfig); } } return m_preferredEditors.get(preferredEditor); }
/** * Filters the preferred editor from the list of all available editors.<p> * * @param preferredEditor the preferred editor identification String * @return the preferred editor configuration object or null, if none is found */ private CmsWorkplaceEditorConfiguration filterPreferredEditor(String preferredEditor) { if (m_preferredEditors.size() == 0) { Iterator i = m_editorConfigurations.iterator(); while (i.hasNext()) { CmsWorkplaceEditorConfiguration currentConfig = (CmsWorkplaceEditorConfiguration)i.next(); m_preferredEditors.put(currentConfig.getEditorUri(), currentConfig); } } return (CmsWorkplaceEditorConfiguration)m_preferredEditors.get(preferredEditor); }
/** * Returns the default editor URI for the current resource type.<p> * * @param context the request context * @param resourceType the current resource type * @param userAgent the user agent String that identifies the browser * @return a valid default editor URI for the resource type or null, if no editor matches */ protected String getDefaultEditorUri(CmsRequestContext context, String resourceType, String userAgent) { SortedMap filteredEditors = filterEditorsForResourceType(resourceType); while (filteredEditors.size() > 0) { // get the configuration with the lowest key value from the map Float key = (Float)filteredEditors.firstKey(); CmsWorkplaceEditorConfiguration conf = (CmsWorkplaceEditorConfiguration)filteredEditors.get(key); // match the found configuration with the current users browser if (conf.matchesBrowser(userAgent)) { return conf.getEditorUri(); } filteredEditors.remove(key); } if (context == null) { // this is just so that all parameters are used, signature should be identical to getEditorUri(...) return null; } // no valid default editor found return null; }
/** * Returns the default editor URI for the current resource type.<p> * * @param context the request context * @param resourceType the current resource type * @param userAgent the user agent String that identifies the browser * @return a valid default editor URI for the resource type or null, if no editor matches */ protected String getDefaultEditorUri(CmsRequestContext context, String resourceType, String userAgent) { SortedMap<Float, CmsWorkplaceEditorConfiguration> filteredEditors = filterEditorsForResourceType(resourceType); while (filteredEditors.size() > 0) { // get the configuration with the lowest key value from the map Float key = filteredEditors.firstKey(); CmsWorkplaceEditorConfiguration conf = filteredEditors.get(key); // match the found configuration with the current users browser if (conf.matchesBrowser(userAgent)) { return conf.getEditorUri(); } filteredEditors.remove(key); } if (context == null) { // this is just so that all parameters are used, signature should be identical to getEditorUri(...) return null; } // no valid default editor found return null; }
if ((preferredConf != null) && preferredConf.matchesBrowser(userAgent)) { return preferredConf.getEditorUri(); CmsWorkplaceEditorConfiguration conf = (CmsWorkplaceEditorConfiguration)filteredEditors.get(key); if (conf.matchesBrowser(userAgent)) { return conf.getEditorUri();
CmsWorkplaceEditorConfiguration conf = availableEditors.get(key); options.add(keyDefault(conf.getEditorLabel(), conf.getEditorLabel())); values.add(conf.getEditorUri()); if (conf.getEditorUri().equals(preSelection)) { selectedIndex = counter;
CmsWorkplaceEditorConfiguration conf = (CmsWorkplaceEditorConfiguration)availableEditors.get(key); options.add(keyDefault(conf.getEditorLabel(), conf.getEditorLabel())); values.add(conf.getEditorUri()); if (conf.getEditorUri().equals(preSelection)) { selectedIndex = counter;
if ((preferredConf != null) && preferredConf.matchesBrowser(userAgent)) { return preferredConf.getEditorUri(); CmsWorkplaceEditorConfiguration conf = filteredEditors.get(key); if (conf.matchesBrowser(userAgent)) { return conf.getEditorUri();