@Nullable public static URI resolveIconUri(@Nonnull ApplicationType type) { checkNotNull(type, "type"); if (type instanceof IconizedType) { return ((IconizedType) type).getIconUri(); } else { return type.getIconUrl(); } }
@Nullable public static URI resolveIconUri(@Nonnull ApplicationType type) { checkNotNull(type, "type"); if (type instanceof IconizedType) { return ((IconizedType) type).getIconUri(); } else { return type.getIconUrl(); } }
@GET public Response getTypes() { List<BaseRestEntity> entityList = new ArrayList<BaseRestEntity>(); for (ApplicationType type : typeAccessor.getEnabledApplicationTypes()) { BaseRestEntity.Builder builder = new BaseRestEntity.Builder(); builder.add("name", type.getI18nKey()); builder.add("iconUrl", type.getIconUrl()); builder.add("iconUri", resolveIconUri(type)); entityList.add(builder.build()); } return ok(entityList).build(); }
public ManifestEntity(final InternalHostApplication internalHostApp, final ApplicationProperties applicationProperties, final AppLinkPluginUtil pluginUtil) { this.name = internalHostApp.getName(); this.typeId = TypeId.getTypeId(internalHostApp.getType()); this.url = internalHostApp.getBaseUrl(); this.iconUrl = internalHostApp.getType().getIconUrl(); this.iconUri = IconUriResolver.resolveIconUri(internalHostApp.getType()); this.inboundAuthenticationTypes.addAll(EntityUtil.getClassNames(internalHostApp.getSupportedInboundAuthenticationTypes())); this.outboundAuthenticationTypes.addAll(EntityUtil.getClassNames(internalHostApp.getSupportedInboundAuthenticationTypes())); this.id = internalHostApp.getId(); this.applinksVersion = pluginUtil.getVersion(); this.version = applicationProperties.getVersion(); this.publicSignup = internalHostApp.hasPublicSignup(); try { this.buildNumber = Long.parseLong(applicationProperties.getBuildNumber()); } catch (NumberFormatException nfe) { this.buildNumber = 0L; LOG.warn("Cannot parse the application's build number {0}, using 0 instead.", applicationProperties.getBuildNumber()); } }
public ManifestEntity(final InternalHostApplication internalHostApp, final ApplicationProperties applicationProperties, final AppLinkPluginUtil pluginUtil) { this.name = internalHostApp.getName(); this.typeId = TypeId.getTypeId(internalHostApp.getType()); this.url = internalHostApp.getBaseUrl(); this.iconUrl = internalHostApp.getType().getIconUrl(); this.iconUri = IconUriResolver.resolveIconUri(internalHostApp.getType()); this.inboundAuthenticationTypes.addAll(EntityUtil.getClassNames(internalHostApp.getSupportedInboundAuthenticationTypes())); this.outboundAuthenticationTypes.addAll(EntityUtil.getClassNames(internalHostApp.getSupportedInboundAuthenticationTypes())); this.id = internalHostApp.getId(); this.applinksVersion = pluginUtil.getVersion(); this.version = applicationProperties.getVersion(); this.publicSignup = internalHostApp.hasPublicSignup(); try { this.buildNumber = Long.parseLong(applicationProperties.getBuildNumber()); } catch (NumberFormatException nfe) { this.buildNumber = 0L; LOG.warn("Cannot parse the application's build number {0}, using 0 instead.", applicationProperties.getBuildNumber()); } }
internalHostApplication.getName(), internalHostApplication.getBaseUrl(), internalHostApplication.getType().getIconUrl(), resolveIconUri(internalHostApplication.getType()), localRpcUrl,
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); }
internalHostApplication.getName(), internalHostApplication.getBaseUrl(), internalHostApplication.getType().getIconUrl(), IconUriResolver.resolveIconUri(internalHostApplication.getType()), localRpcUrl,
public ApplicationLinkEntity(final ApplicationId id, final TypeId typeId, final String name, final URI displayUrl, final URI iconUrl, final URI iconUri, final URI rpcUrl, final Boolean primary, final Boolean isSystem, final Link self) { this.id = id; this.typeId = typeId; this.name = name; this.displayUrl = displayUrl; this.iconUrl = iconUrl; this.iconUri = iconUri; this.isPrimary = primary; this.isSystem = isSystem; this.iconUri = iconUri; if (!isSystem()) { this.rpcUrl = rpcUrl; } addLink(self); }