public void onPluginUnregistered(@Observes PluginUnregistered pluginUnregistered) { if (pluginUnregistered.getType().equals(PluginType.SCREEN)) { availableWorkbenchScreensIds.remove(pluginUnregistered.getName()); } }
@Override public String getSuffix() { return "/" + PluginType.DYNAMIC_MENU.toString().toLowerCase() + ".plugin"; }
private PluginSimpleContent buildPlugin(String name, PluginType type, Framework framework) { Set<Framework> frameworks = new HashSet<Framework>(); if (framework != null) { frameworks.add(framework); } return new PluginSimpleContent(name, type, PathFactory.newPath(type.name().toLowerCase() + ".plugin", "git://amend-repo-test/" + name + "/" + type.name().toLowerCase() + ".plugin"), null, null, new HashMap<CodeType, String>(), frameworks, null); }
private PluginSimpleContent buildPlugin(String name, PluginType type, Framework framework) { Set<Framework> frameworks = new HashSet<Framework>(); if (framework != null) { frameworks.add(framework); } return new PluginSimpleContent(name, type, PathFactory.newPath(type.name().toLowerCase() + ".plugin", "git://amend-repo-test/" + name + "/" + type.name().toLowerCase() + ".plugin"), null, null, new HashMap<CodeType, String>(), frameworks, null); }
public void onPluginUnregistered(@Observes PluginUnregistered pluginUnregistered) { if (pluginUnregistered.getType().equals(PluginType.SCREEN)) { availableWorkbenchScreensIds.remove(pluginUnregistered.getName()); } }
@Override public String getSuffix() { return "/" + PluginType.SPLASH.toString().toLowerCase() + ".plugin"; }
public Plugin getLayoutTemplatePlugin(String perspectiveName) { if (perspectiveName == null) { return null; } for (Plugin plugin : pluginServices.listPlugins()) { if (PluginType.PERSPECTIVE_LAYOUT.equals(plugin.getType()) && plugin.getName().equals(perspectiveName)) { return plugin; } } return null; }
@Override public String getSuffix() { return "/" + PluginType.PERSPECTIVE_LAYOUT.toString().toLowerCase() + ".plugin"; }
public Plugin getLayoutTemplatePlugin(String perspectiveName) { if (perspectiveName == null) { return null; } for (Plugin plugin : pluginServices.listPlugins()) { if (PluginType.PERSPECTIVE_LAYOUT.equals(plugin.getType()) && plugin.getName().equals(perspectiveName)) { return plugin; } } return null; }
@Override public String getSuffix() { return "/" + PluginType.EDITOR.toString().toLowerCase() + ".plugin"; }
@Override public Plugin getPerspectivePlugin(String perspectiveName) { if (perspectiveName == null) { return null; } for (Plugin plugin : listPlugins()) { if (PluginType.PERSPECTIVE_LAYOUT.equals(plugin.getType()) && plugin.getName().equals(perspectiveName)) { return plugin; } } return null; }
@Override public String getSuffix() { return "/" + PluginType.SCREEN.toString().toLowerCase() + ".plugin"; }
@Override public Plugin getPerspectivePlugin(String perspectiveName) { if (perspectiveName == null) { return null; } for (Plugin plugin : listPlugins()) { if (PluginType.PERSPECTIVE_LAYOUT.equals(plugin.getType()) && plugin.getName().equals(perspectiveName)) { return plugin; } } return null; }
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(); }
public boolean canRead(Activity activity) { if (PluginType.PERSPECTIVE.equals(activity.getType()) || PluginType.PERSPECTIVE_LAYOUT.equals(activity.getType())) { Resource ref = new ResourceRef(activity.getName(), ActivityResourceType.PERSPECTIVE); return authorizationManager.authorize(ref, PerspectiveAction.READ, user); } return true; }
@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; }
public boolean canDelete(Activity activity) { if (PluginType.PERSPECTIVE.equals(activity.getType()) || PluginType.PERSPECTIVE_LAYOUT.equals(activity.getType())) { Resource ref = new ResourceRef(activity.getName(), ActivityResourceType.PERSPECTIVE); return authorizationManager.authorize(ref, PerspectiveAction.DELETE, user); } return true; } }
@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(); }
public boolean canDelete(Activity activity) { if (PluginType.PERSPECTIVE.equals(activity.getType()) || PluginType.PERSPECTIVE_LAYOUT.equals(activity.getType())) { Resource ref = new ResourceRef(activity.getName(), ActivityResourceType.PERSPECTIVE); return authorizationManager.authorize(ref, PerspectiveAction.DELETE, user); } return true; } }
public boolean canRead(Activity activity) { if (PluginType.PERSPECTIVE.equals(activity.getType()) || PluginType.PERSPECTIVE_LAYOUT.equals(activity.getType())) { Resource ref = new ResourceRef(activity.getName(), ActivityResourceType.PERSPECTIVE); return authorizationManager.authorize(ref, PerspectiveAction.READ, user); } return true; }