code: private ModifableExtensionPlanNode installExtension(ExtensionId extensionId, boolean dependency, String namespace)
          throws InstallException
      {
          // Check if the feature is a root extension
          if (namespace != null) {
              // Check if the extension already exist on root, throw exception if not allowed
              if (checkRootExtension(extensionId.getId())) {
                  // Restart install on root
                  return installExtension(extensionId, dependency, null);
              }
          }
  
          this.progressManager.pushLevelProgress(2, this);
  
          try {
              this.progressManager.startStep(this);
  
              // Find the extension in a repository (starting with local one)
              Extension extension = resolveExtension(extensionId);
  
              // Rewrite the extension
              Extension rewrittenExtension;
              if (getRequest().getRewriter() != null) {
                  rewrittenExtension = getRequest().getRewriter().rewrite(extension);
              } else {
                  rewrittenExtension = extension;
              }
  
              this.progressManager.endStep(this);
  
              this.progressManager.startStep(this);
  
              try {
                  return installExtension(extension, rewrittenExtension, dependency, namespace, null,
                      Collections.emptyMap(), null);
              } catch (Exception e) {
                  throw new InstallException("Failed to resolve extension", e);
              }
          } finally {
              this.progressManager.popLevelProgress(this);
          }
      }
docs: Install provided extension.
  
  @param extensionId the identifier of the extension to install
  @param dependency indicate if the extension is installed as a dependency
  @param namespace the namespace where to install the extension
  @return the install plan node for the provided extension
  @throws InstallException error when trying to install provided extension