/** * 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)) { if (conf.matchesBrowser(userAgent)) { return conf.getEditorUri();
if ((preferredConf != null) && preferredConf.matchesBrowser(userAgent)) { if (conf.matchesBrowser(userAgent)) { return conf.getEditorUri();
if ((preferredConf != null) && preferredConf.isWidgetEditor() && preferredConf.matchesBrowser(userAgent)) { if (conf.isWidgetEditor() && conf.matchesBrowser(userAgent)) { return conf.getWidgetEditor();
if ((preferredConf != null) && preferredConf.isWidgetEditor() && preferredConf.matchesBrowser(userAgent)) { if (conf.isWidgetEditor() && conf.matchesBrowser(userAgent)) { return conf.getWidgetEditor();