@Override public String getSuffix() { return "/" + PluginType.PERSPECTIVE_LAYOUT.toString().toLowerCase() + ".plugin"; }
@Override public String getSuffix() { return "/" + PluginType.EDITOR.toString().toLowerCase() + ".plugin"; }
@Override public String getSuffix() { return "/" + PluginType.SCREEN.toString().toLowerCase() + ".plugin"; }
@Override public String getSuffix() { return "/" + PluginType.DYNAMIC_MENU.toString().toLowerCase() + ".plugin"; }
@Override public String getSuffix() { return "/" + PluginType.SPLASH.toString().toLowerCase() + ".plugin"; }
private LayoutEditorModel loadLayoutEditor(String pluginName, org.uberfire.backend.vfs.Path path, PluginType type) { final Path path1 = getLayoutEditorPath(getPluginPath(pluginName), type.toString().toLowerCase()); if (getIoService().exists(path1)) { String fileContent = getIoService().readAllString(path1); return new LayoutEditorModel(pluginName, PluginType.PERSPECTIVE_LAYOUT, path, fileContent); } return new LayoutEditorModel(pluginName, PluginType.PERSPECTIVE_LAYOUT, path, null).emptyLayout(); }
@Override public Plugin createNewPlugin(final String pluginName, final PluginType type) { checkNotEmpty("pluginName", pluginName); checkCondition("valid plugin name", defaultFileNameValidator.isValid(pluginName)); final Path pluginRoot = getPluginPath(pluginName); if (getIoService().exists(pluginRoot)) { throw new PluginAlreadyExists(); } final Path pluginPath = pluginRoot.resolve(type.toString().toLowerCase() + ".plugin"); final Plugin plugin = new Plugin(pluginName, type, convert(pluginPath)); updatePlugin(pluginPath, plugin, true); return plugin; }
@Override public org.uberfire.backend.vfs.Path saveLayout(LayoutEditorModel plugin, String commitMessage) { final Path pluginPath = convert(plugin.getPath()); final boolean isNewPlugin = !getIoService().exists(pluginPath); try { getIoService().startBatch(fileSystem, commentedOption(commitMessage)); final Path itemsPath = getLayoutEditorPath(getPluginPath(plugin.getName()), plugin.getType().toString().toLowerCase()); getIoService().write(itemsPath, plugin.getLayoutEditorModel()); updatePlugin(pluginPath, plugin, isNewPlugin); } finally { getIoService().endBatch(); } return plugin.getPath(); }