protected static boolean extractViewArchive(String archivePath, ViewModule viewModule, boolean systemOnly)
      throws Exception {
    Injector injector = Guice.createInjector(viewModule);

    ViewExtractor extractor = injector.getInstance(ViewExtractor.class);
    ViewArchiveUtility archiveUtility = injector.getInstance(ViewArchiveUtility.class);
    Configuration configuration = injector.getInstance(Configuration.class);

    File viewDir = configuration.getViewsDir();

    String extractedArchivesPath = viewDir.getAbsolutePath() +
        File.separator + EXTRACTED_ARCHIVES_DIR;

    if (extractor.ensureExtractedArchiveDirectory(extractedArchivesPath)) {

      File archiveFile = archiveUtility.getFile(archivePath);

      ViewConfig viewConfig = archiveUtility.getViewConfigFromArchive(archiveFile);

      String commonName = viewConfig.getName();
      String version = viewConfig.getVersion();
      String viewName = ViewEntity.getViewName(commonName, version);

      String extractedArchiveDirPath = extractedArchivesPath + File.separator + viewName;
      File extractedArchiveDirFile = archiveUtility.getFile(extractedArchiveDirPath);

      if (!extractedArchiveDirFile.exists()) {
        ViewEntity viewDefinition = new ViewEntity(viewConfig, configuration, extractedArchiveDirPath);

        if (!systemOnly || viewDefinition.isSystem()) {
          ClassLoader classLoader = null;
          try {
            List<File> additionalPaths = getViewsAdditionalClasspath(configuration);
            classLoader = extractor.extractViewArchive(viewDefinition, archiveFile, extractedArchiveDirFile, additionalPaths);
            return true;
          } finally {
            if (classLoader instanceof Closeable) {
              Closeables.closeSilently((Closeable) classLoader);
            }
          }
        }
      }
    }
    return false;
  }
Check the configured view max and min Ambari versions for the given view entity
against the given Ambari server version.

@param view          the view
@param serverVersion the server version
@return true if the given server version >= min version && <= max version for the given view
ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java