public CoreExtension getCoreExtension(String id) { return this.coreExtensionRepository.getCoreExtension(id); }
/** * Get the extension handler corresponding to the given core extension ID. The returned handler can be used to get * more information about the extension, such as the authors, an extension description, its license... * * @param feature the extension id or provided feature (virtual extension) of the extension to resolve * @return the read-only handler corresponding to the requested extension, or {@code null} if the extension isn't * provided by the platform */ public CoreExtension getCoreExtension(String feature) { return safe(this.coreExtensionRepository.getCoreExtension(feature)); } }
@Override public Extension getAccessibleExtension(String feature, Namespace namespace) { // Try installed extension Extension extension = this.installedExtensionRepository.getInstalledExtension(feature, namespace.serialize()); if (extension == null) { // Try core extension extension = this.coreExtensionRepository.getCoreExtension(feature); } return extension; }
@Override public CoreExtension getCoreExtension(String id) { return safe(getWrapped().getCoreExtension(id)); }
/** * Gets the PhenoTips version from the XWiki Distribution Manager and adds it to the patient data being loaded. * * @param versions the list of version data being constructed */ private void addPhenoTipsVersion(Map<String, String> versions) { try { CoreExtensionRepository coreExtensionRepository = ComponentManagerRegistry.getContextComponentManager().getInstance(CoreExtensionRepository.class); Version v = coreExtensionRepository.getCoreExtension("org.phenotips:patient-data-api").getId().getVersion(); versions.put("phenotips_version", v.toString()); } catch (ComponentLookupException ex) { // Shouldn't happen this.logger.error("Could not find DistributionManager component"); } }
private void removeFromBackwardDependencies(DefaultInstalledExtension installedExtension, String namespace) { // Clean provided extension dependencies backward dependencies for (ExtensionDependency dependency : installedExtension.getDependencies()) { if (this.coreExtensionRepository.getCoreExtension(dependency.getId()) == null) { InstalledFeature installedFeature = getInstalledFeatureFromCache(dependency.getId(), namespace); if (installedFeature != null) { installedFeature.root.backwardDependencies.remove(installedExtension); } } } }
public Extension resolveExtension(ExtensionId extensionId, String namespace) throws ResolveException { Extension extension = null; extension = this.coreExtensionRepository.getCoreExtension(extensionId.getId()); if (extension == null) { extension = this.localExtensionRepository.getInstalledExtension(extensionId.getId(), namespace); if (extension == null || !extension.getId().getVersion().equals(extensionId.getVersion())) { extension = this.repositoryManager.resolve(extensionId); } } return extension; } }
private boolean checkCoreDependency(ExtensionDependency extensionDependency, List<ModifableExtensionPlanNode> parentBranch) throws InstallException { CoreExtension coreExtension = this.coreExtensionRepository.getCoreExtension(extensionDependency.getId()); if (coreExtension != null) { ExtensionId feature = coreExtension.getExtensionFeature(extensionDependency.getId()); if (!extensionDependency.getVersionConstraint().isCompatible(feature.getVersion())) { throw new InstallException("Dependency [" + extensionDependency + "] is not compatible with core extension feature [" + feature + "] ([" + coreExtension + "])"); } else { if (getRequest().isVerbose()) { this.logger.debug( "There is already a core extension feature [{}] ([{}]) covering extension dependency [{}]", feature, coreExtension, extensionDependency); } ModifableExtensionPlanNode node = new ModifableExtensionPlanNode(extensionDependency, extensionDependency.getVersionConstraint()); node.setAction( new DefaultExtensionPlanAction(coreExtension, coreExtension, null, Action.NONE, null, true)); parentBranch.add(node); return true; } } return false; }
private void validateDependency(ExtensionDependency dependency, String namespace, Map<String, ExtensionDependency> managedDependencies) throws InvalidExtensionException CoreExtension coreExtension = this.coreExtensionRepository.getCoreExtension(dependency.getId());