/** * @return the type of the application e.g. "fecru" */ public ApplicationType getApplicationType() { return applicationLink.getType(); }
@Nullable private static ApplinkErrorType validateAtlassianApplink(@Nonnull ApplicationLink link) { if (link.getType() instanceof GenericApplicationType) { return ApplinkErrorType.GENERIC_LINK; } else if (!BuiltinApplinksType.class.isInstance(link.getType())) { return ApplinkErrorType.NON_ATLASSIAN; } else { return null; } }
@Nullable @Override public Object doProvide(@Nonnull ApplicationLink applink) throws ServiceException { return ApplicationTypes.isAtlassian(applink.getType()); } }
private Set<String> getEntityTypeIdsForApplication(final ApplicationLink applicationLink) { return Sets.newHashSet( Iterables.transform(typeAccessor.getEnabledEntityTypesForApplicationType(applicationLink.getType()), new Function<EntityType, String>() { public String apply(@Nullable EntityType from) { return TypeId.getTypeId(from).get(); } })); } }
/** * @return the type of the application e.g. "fecru" */ public ApplicationType getApplicationType() { return entityLink.getApplicationLink().getType(); }
@Nullable @Override public Object doProvide(@Nonnull ApplicationLink applink) throws ServiceException { if (ApplicationTypes.isAtlassian(applink.getType())) { return getAtlassianConfigUrl(applink); } else { return applink.getDisplayUrl(); } }
/** * @since 3.1 */ public URI getDisplayUrl(final ApplicationLink link, final String path) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof SubversionPathEntityType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), path); } }
/** * @since 3.1 */ public URI getDisplayUrl(final ApplicationLink link, final String project) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof FishEyeCrucibleApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "cru", project); } }
/** * @since 3.1 */ public URI getDisplayUrl(final ApplicationLink link, final String project) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof FishEyeCrucibleApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "cru", project); } }
public URI getDisplayUrl(final ApplicationLink link, final String space) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof ConfluenceApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "display", space); } }
public URI getDisplayUrl(final ApplicationLink link, final String project) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof JiraApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "browse", project); } }
@Override public URI getDisplayUrl(ApplicationLink applicationLink, String job) { Assertions.isTrue(String.format("Application link %s is not of type %s", applicationLink.getId(), getApplicationType().getName()), (applicationLink.getType() instanceof HudsonApplicationType)); return URIUtils.appendPathsToURI(applicationLink.getDisplayUrl(), "job", job); }
public ApplicationLinkEntity(final ApplicationLink applicationLink, final Link self) { this(applicationLink.getId(), TypeId.getTypeId(applicationLink.getType()), applicationLink.getName(), applicationLink.getDisplayUrl(), applicationLink.getType().getIconUrl(), resolveIconUri(applicationLink.getType()), applicationLink.getRpcUrl(), applicationLink.isPrimary(), applicationLink.isSystem(), self); }
public URI getDisplayUrl(final ApplicationLink link, final String project) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof BitbucketApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "projects", project); }
public URI getDisplayUrl(final ApplicationLink link, final String entityKey) { Assertions.isTrue(String.format("Application link %s is not of type %s", link.getId(), getApplicationType().getName()), link.getType() instanceof BambooApplicationType); return URIUtil.uncheckedConcatenate(link.getDisplayUrl(), "browse", entityKey); } }
public ImmutableApplicationLink(final ApplicationLink that, final ApplicationLinkRequestFactoryFactory requestFactoryFactory) { checkNotNull(that, "that"); checkNotNull(requestFactoryFactory, "requestFactoryFactory"); this.applicationId = that.getId(); this.applicationType = that.getType(); this.name = that.getName(); this.displayUrl = that.getDisplayUrl(); this.rpcUrl = that.getRpcUrl(); this.isPrimary = that.isPrimary(); this.isSystem = that.isSystem(); this.requestFactoryFactory = requestFactoryFactory; }
public Map<String, String> apply(ApplicationLink from) { return ImmutableMap.of("id", from.getId().get(), "name", from.getName(), "type", i18nResolver.getText(from.getType().getI18nKey())); } })));
private Object getAtlassianConfigUrl(ApplicationLink applink) { // backwards compatibility with the older Applinks version, where theconfig screen was only exposed as a // Confluence action; // also see ConfluenceLegacyApplicationLinksUrlFilter if (applink.getType() instanceof ConfluenceApplicationType) { return Uris.uncheckedConcatenate(applink.getDisplayUrl(), "/admin/listapplicationlinks.action"); } else { return Uris.uncheckedConcatenate(applink.getDisplayUrl(), "/plugins/servlet/applinks/listApplicationLinks"); } } }
protected RendererContextBuilder createContextBuilder(final ApplicationLink applicationLink) { return new RendererContextBuilder() .put("localApplicationName", internalHostApplication.getName()) .put("localApplicationType", i18nResolver.getText(internalHostApplication.getType().getI18nKey())) .put("remoteApplicationName", applicationLink.getName()) .put("remoteApplicationType", i18nResolver.getText(applicationLink.getType().getI18nKey())); }
public static RendererContextBuilder createContextBuilder(final ApplicationLink applicationLink, final I18nResolver i18nResolver, final InternalHostApplication internalHostApplication) { final RendererContextBuilder builder = new RendererContextBuilder() .put("localApplicationName", internalHostApplication.getName()) .put("localApplicationType", i18nResolver.getText(internalHostApplication.getType().getI18nKey())) .put("remoteApplicationName", applicationLink.getName()) .put("remoteApplicationType", i18nResolver.getText(applicationLink.getType().getI18nKey())); return builder; }