本文整理了Java中com.atlassian.plugin.Plugin
类的一些代码示例,展示了Plugin
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin
类的具体详情如下:
包路径:com.atlassian.plugin.Plugin
类名称:Plugin
暂无
代码示例来源:origin: com.atlassian.labs/speakeasy-plugin
public Extension(Plugin plugin)
{
notNull(plugin);
this.key = plugin.getKey();
this.name = plugin.getName();
this.description = plugin.getPluginInformation().getDescription();
this.version = plugin.getPluginInformation().getVersion();
this.params = new HashMap<String,String>(plugin.getPluginInformation().getParameters());
}
代码示例来源:origin: org.randombits.confluence/confluence-conveyor
public boolean matches( Plugin plugin ) {
try {
Class<?> loadedClass = plugin.loadClass( DefaultOverrideManager.class.getName(), null );
Class<?> myClass = DefaultOverrideManager.class;
return loadedClass == myClass;
} catch ( ClassNotFoundException e ) {
return false;
}
}
} ) ) {
代码示例来源:origin: com.atlassian.plugins.rest/atlassian-rest-module
private static boolean resourcesAvailable(Plugin plugin, String... resources) {
for (final String resource : resources) {
if (plugin.getResource(resource) == null) {
return false;
}
}
return true;
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
public String getErrorMessage(final Plugin input)
{
return "* The plugin '" + input.getName() + "' (" + input.getKey() +
") is no longer compatible with this version of JIRA and needs to be removed. Its functionality has been incorporated into JIRA core.";
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
public String getErrorMessage(final Plugin input)
{
final StringBuilder errorMessage = new StringBuilder();
errorMessage.append("* ").append(input.getName()).append(" (").append(input.getKey()).append(")");
final float pluginMinVersion = input.getPluginInformation().getMinVersion();
final String pluginVersion = input.getPluginInformation().getVersion();
errorMessage.append(" v").append(pluginVersion).append(" - requires JIRA v").append(pluginMinVersion).append(" minimum");
return errorMessage.toString();
}
}
代码示例来源:origin: com.atlassian.devrel/developer-toolbox-plugin
private void restVersion(Map<String, String> container) {
Plugin plugin = pluginAccessor.getPlugin("com.atlassian.plugins.rest.atlassian-rest-module");
if (plugin != null) {
container.put("Atlassian REST", plugin.getPluginInformation().getVersion());
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
private void removeAdminTasks(final Map<String, SimpleLink> linkIdMap, final List<String> moduleIdList)
{
final Plugin selectedPlugin = pluginAccessor.getPlugin("jira.top.navigation.bar");
if (pluginAccessor.isPluginEnabled(selectedPlugin.getKey()))
{
Collection<ModuleDescriptor<?>> moduleDescriptors = selectedPlugin.getModuleDescriptors();
for (ModuleDescriptor<?> moduleDescriptor : moduleDescriptors)
{
if (pluginAccessor.isPluginModuleEnabled(moduleDescriptor.getCompleteKey()))
{
if (moduleDescriptor instanceof WebItemModuleDescriptor)
{
moduleIdList.add(((WebItemModuleDescriptor) moduleDescriptor).getLink().getId());
}
}
}
linkIdMap.keySet().removeAll(moduleIdList);
}
}
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-core
@Override
public Optional<ConnectIFrame> fetchConnectIFrame(String addonKey, String moduleKey, Optional<String> optionalClassifier) {
if (moduleKey.startsWith(addonKey + ModuleKeyUtils.ADDON_MODULE_SEPARATOR)) {
log.info("ACDEV-2694: connect iframe requested for module " + addonKey + ":" + moduleKey);
}
ModuleDescriptor moduleDescriptor = pluginAccessor.getEnabledPluginModule(
new ModuleCompleteKey(pluginRetrievalService.getPlugin().getKey(),
ConnectIFrameModuleDescriptor.getModuleKey(addonKey, moduleKey, optionalClassifier)).getCompleteKey());
if (moduleDescriptor != null) {
return Optional.of((ConnectIFrame)moduleDescriptor.getModule());
}
return Optional.empty();
}
}
代码示例来源:origin: com.atlassian.plugin.rest/atlassian-rest-plugin-manager-plugin
@GET
@Path("content")
@Produces(APPLICATION_OCTET_STREAM)
public Response getContent()
{
return Response.ok(PluginResourceResolver.getResourceResolver(plugin).getArtifactAsStream(), APPLICATION_OCTET_STREAM_TYPE)
.header("Content-Disposition", "attachment; filename=" + plugin.getKey() + "-" + plugin.getPluginInformation().getVersion() + ".jar").build();
}
代码示例来源:origin: com.atlassian.templaterenderer/atlassian-template-renderer-velocity16-plugin
@Override
protected TemplateRenderer createRenderer(Plugin plugin) {
return new VelocityTemplateRendererImpl(plugin.getClassLoader(), plugin.getKey(),
Collections.<String, String>emptyMap(), templateContextFactory);
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
@Override
public boolean onEnableException(final Plugin plugin, final Exception pluginException)
{
PluginInfo pluginInfo = trackedPlugins.get(plugin.getKey());
if (pluginInfo != null)
{
PluginInfo value = PluginInfo.addFailures(pluginInfo, pluginException);
failedPlugins.put(plugin.getKey(), value);
}
return false;
}
代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core
public void removeState(final Plugin plugin) {
apply(builder -> {
builder.removeState(plugin.getKey());
for (final ModuleDescriptor<?> moduleDescriptor : plugin.getModuleDescriptors()) {
builder.removeState(moduleDescriptor.getCompleteKey());
}
});
}
}
代码示例来源:origin: com.atlassian.confluence.ext/newcode-macro-plugin
public List<String> listLocalization() {
Plugin plugin = pluginAccessor.getPlugin(Constants.PLUGIN_KEY);
Collection<ModuleDescriptor<?>> descriptors = plugin.getModuleDescriptors();
List<String> result = new ArrayList<>();
for (ModuleDescriptor<?> descriptor : descriptors) {
if (descriptor.getKey().startsWith(LOCALIZATION_DESCRIPTOR_PREFIX)) {
String webResourceId = descriptor.getCompleteKey();
if (StringUtils.isNotEmpty(webResourceId)) {
String languageKey = webResourceId.substring(webResourceId.length() - 2,
webResourceId.length());
result.add(languageKey.toLowerCase());
}
}
}
return result;
}
代码示例来源:origin: com.atlassian.analytics/analytics-client
@Override
public void contribute(final ImmutableMap.Builder<String, Object> builder, final String name, final Object value)
{
if (value instanceof Plugin)
builder.put(name + ".key", ((Plugin) value).getKey());
if (value instanceof ModuleDescriptor)
builder.put(name + ".key", ((ModuleDescriptor<?>) value).getCompleteKey());
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
@Override
public void append(final Plugin input, Map<String, Object> map)
{
PluginInformation info = input.getPluginInformation();
map.put("name", input.getName());
map.put("version", info.getVersion());
map.put("vendor", info.getVendorName());
map.put("enabled", extendedSystemInfoUtils.isPluginEnabled(input));
map.put("parameters", arrarify(info.getParameters()));
}
}.build(extendedSystemInfoUtils.getPlugins());
代码示例来源:origin: com.atlassian.plugins/less-transformer-plugin
@Override
public InputStream open(URI uri) throws IOException {
Plugin plugin = resolvePlugin(uri);
InputStream in = plugin.getResourceAsStream(getResourcePath(uri));
if (in == null) {
throw new IOException(uri.getPath() + " does not exist in plugin " + plugin.getKey());
}
return in;
}
代码示例来源:origin: com.atlassian.support/stp
@Override
public boolean matches(Plugin plugin)
{
return plugin != null && !pluginAccessor.isPluginEnabled(plugin.getKey());
}
});
代码示例来源:origin: com.atlassian.jira/jira-core
public Collection<Plugin> getPlugins()
{
final SortedSet<Plugin> plugins = new TreeSet<>(new PluginComparator());
for(Plugin plugin : pluginAccessor.getPlugins())
{
if (!plugins.add(plugin))
{
throw new IllegalStateException("Multiple plugins with the same key and version:" + plugin.getKey() + " " + plugin.getPluginsVersion());
}
}
return Collections.unmodifiableSet(plugins);
}
代码示例来源:origin: com.atlassian.plugin.rest/atlassian-rest-plugin-manager-plugin
protected PluginDetails expandInternal(PluginDetails entity)
{
final Plugin plugin = pluginAccessor.getPlugin(entity.getKey());
entity.setName(plugin.getName());
entity.setPluginInfo(PluginInfo.getInfo(plugin.getPluginInformation()));
entity.setPluginModules(PluginModule.getModules(pluginAccessor, plugin));
return entity;
}
}
代码示例来源:origin: com.atlassian.labs/speakeasy-plugin
public List<String> findAllEnabledExtensions(String user)
{
List<String> result = newArrayList();
for (Plugin plugin : pluginAccessor.getEnabledPlugins())
{
if (data.getUsersList(plugin.getKey()).contains(user))
{
result.add(plugin.getKey());
}
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!