当前位置: 首页>>代码示例>>Java>>正文


Java Package.getPackageMetaDataElement方法代码示例

本文整理汇总了Java中org.pentaho.packageManagement.Package.getPackageMetaDataElement方法的典型用法代码示例。如果您正苦于以下问题:Java Package.getPackageMetaDataElement方法的具体用法?Java Package.getPackageMetaDataElement怎么用?Java Package.getPackageMetaDataElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.packageManagement.Package的用法示例。


在下文中一共展示了Package.getPackageMetaDataElement方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compare

import org.pentaho.packageManagement.Package; //导入方法依赖的package包/类
@Override
public int compare(Package o1, Package o2) {
  String meta1 = "";
  String meta2 = "";
  if (m_sortColumn == 0) {
    meta1 = o1.getName();
    meta2 = o2.getName();
  } else {
    if (o1.getPackageMetaDataElement("Category") != null) {
      meta1 = o1.getPackageMetaDataElement("Category").toString();
    }

    if (o2.getPackageMetaDataElement("Category") != null) {
      meta2 = o2.getPackageMetaDataElement("Category").toString();
    }
  }

  int result = meta1.compareTo(meta2);
  if (m_reverseSort) {
    result = -result;
  }
  return result;
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:24,代码来源:PackageManager.java

示例2: getPackagesAndEstablishLookup

import org.pentaho.packageManagement.Package; //导入方法依赖的package包/类
private void getPackagesAndEstablishLookup() throws Exception {
  m_allPackages = WekaPackageManager.getAllPackages();

  // now fill the lookup map
  m_packageLookupInfo = new TreeMap<String, List<Object>>();
  // Iterator<Package> i = allP.iterator();

  for (Package p : m_allPackages) {
    // Package p = i.next();
    String packageName = p.getName();
    String category = "";
    if (p.getPackageMetaDataElement("Category") != null) {
      category = p.getPackageMetaDataElement("Category").toString();
    }

    // check the load status of this package (if installed)
    String loadStatus = "";
    if (p.isInstalled()) {
      File packageRoot =
        new File(WekaPackageManager.getPackageHome().toString());
      boolean loaded = WekaPackageManager.loadCheck(p, packageRoot);
      loadStatus = (loaded) ? "Yes" : "No - check log";
    }

    List<Object> versions =
      WekaPackageManager.getRepositoryPackageVersions(packageName);
    List<Object> catAndVers = new ArrayList<Object>();
    catAndVers.add(category);
    catAndVers.add(versions);
    catAndVers.add(loadStatus);
    m_packageLookupInfo.put(packageName, catAndVers);
  }
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:34,代码来源:PackageManager.java

示例3: installPackageFromArchive

import org.pentaho.packageManagement.Package; //导入方法依赖的package包/类
/**
 * Install a package from an archive
 * 
 * @param packageArchivePath the path to the package archive file to install
 * @param progress for reporting progress
 * @return true if the package was installed successfully
 * @throws Exception if a problem occurs
 */
public static String installPackageFromArchive(String packageArchivePath,
  PrintStream... progress) throws Exception {
  useCacheOrOnlineRepository();
  Package toInstall =
    PACKAGE_MANAGER.getPackageArchiveInfo(packageArchivePath);

  Object specialInstallMessage =
    toInstall.getPackageMetaDataElement("MessageToDisplayOnInstallation");
  if (specialInstallMessage != null
    && specialInstallMessage.toString().length() > 0) {
    String siM = specialInstallMessage.toString();
    try {
      siM = Environment.getSystemWide().substitute(siM);
    } catch (Exception ex) {
      // quietly ignore
    }
    String message =
      "**** Special installation message ****\n" + siM
        + "\n**** Special installation message ****";
    for (PrintStream p : progress) {
      p.println(message);
    }
  }

  PACKAGE_MANAGER.installPackageFromArchive(packageArchivePath, progress);

  boolean loadIt = checkForMissingClasses(toInstall, progress);
  if (loadIt) {
    File packageRoot =
      new File(PACKAGE_MANAGER.getPackageHome() + File.separator
        + toInstall.getName());
    loadIt = checkForMissingFiles(toInstall, packageRoot, progress);
    if (loadIt) {
      loadPackageDirectory(packageRoot, false, null, false);
    }
  }

  return toInstall.getName();
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:48,代码来源:WekaPackageManager.java

示例4: installPackageFromURL

import org.pentaho.packageManagement.Package; //导入方法依赖的package包/类
/**
 * Insstall a package from the supplied URL
 * 
 * @param packageURL the URL to the package archive to install
 * @param progress for reporting progress
 * @return true if the package was installed successfully
 * @throws Exception if a problem occurs
 */
public static String installPackageFromURL(URL packageURL,
  PrintStream... progress) throws Exception {
  useCacheOrOnlineRepository();
  String packageName =
    PACKAGE_MANAGER.installPackageFromURL(packageURL, progress);

  Package installed = PACKAGE_MANAGER.getInstalledPackageInfo(packageName);

  Object specialInstallMessage =
    installed.getPackageMetaDataElement("MessageToDisplayOnInstallation");
  if (specialInstallMessage != null
    && specialInstallMessage.toString().length() > 0) {
    String message =
      "**** Special installation message ****\n"
        + specialInstallMessage.toString()
        + "\n**** Special installation message ****";
    for (PrintStream p : progress) {
      p.println(message);
    }
  }

  boolean loadIt = checkForMissingClasses(installed, progress);
  if (loadIt) {
    File packageRoot =
      new File(PACKAGE_MANAGER.getPackageHome() + File.separator
        + installed.getName());
    loadIt = checkForMissingFiles(installed, packageRoot, progress);
    if (loadIt) {
      loadPackageDirectory(packageRoot, false, null, false);
    }
  }
  return packageName;
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:42,代码来源:WekaPackageManager.java

示例5: getPackagesAndEstablishLookup

import org.pentaho.packageManagement.Package; //导入方法依赖的package包/类
private void getPackagesAndEstablishLookup() throws Exception {
  m_allPackages = WekaPackageManager.getAllPackages();

  // now fill the lookup map
  m_packageLookupInfo = new TreeMap<String, List<Object>>();
  // Iterator<Package> i = allP.iterator();

  for (Package p : m_allPackages) {
    // Package p = i.next();
    String packageName = p.getName();
    String category = "";
    if (p.getPackageMetaDataElement("Category") != null) {
      category = p.getPackageMetaDataElement("Category").toString();
    }

    // check the load status of this package (if installed)
    String loadStatus = "";
    if (p.isInstalled()) {
      File packageRoot = new File(WekaPackageManager.getPackageHome()
          .toString());
      boolean loaded = WekaPackageManager.loadCheck(p, packageRoot);
      loadStatus = (loaded) ? "Yes" : "No - check log";
    }

    List<Object> versions = WekaPackageManager
        .getRepositoryPackageVersions(packageName);
    List<Object> catAndVers = new ArrayList<Object>();
    catAndVers.add(category);
    catAndVers.add(versions);
    catAndVers.add(loadStatus);
    m_packageLookupInfo.put(packageName, catAndVers);
  }
}
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:34,代码来源:PackageManager.java

示例6: installPackageFromRepository

import org.pentaho.packageManagement.Package; //导入方法依赖的package包/类
public static void installPackageFromRepository(String packageName,
    String version, PrintStream... progress) throws Exception {
  useCacheOrOnlineRepository();
  Package toLoad = getRepositoryPackageInfo(packageName);

  Object specialInstallMessage = toLoad
      .getPackageMetaDataElement("MessageToDisplayOnInstallation");
  if (specialInstallMessage != null
      && specialInstallMessage.toString().length() > 0) {
    String siM = specialInstallMessage.toString();
    try {
      siM = Environment.getSystemWide().substitute(siM);
    } catch (Exception ex) {
      // quietly ignore
    }
    String message = "**** Special installation message ****\n" + siM
        + "\n**** Special installation message ****";
    for (PrintStream p : progress) {
      p.println(message);
    }
  }

  PACKAGE_MANAGER
      .installPackageFromRepository(packageName, version, progress);
  File packageDir = new File(PACKAGE_MANAGER.getPackageHome().toString()
      + File.separator + packageName);

  boolean loadIt = checkForMissingClasses(toLoad, progress);
  if (loadIt) {
    File packageRoot = new File(PACKAGE_MANAGER.getPackageHome()
        + File.separator + packageName);
    loadIt = checkForMissingFiles(toLoad, packageRoot, progress);
    if (loadIt) {
      loadPackageDirectory(packageDir, false);
    }
  }
}
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:38,代码来源:WekaPackageManager.java

示例7: installPackageFromArchive

import org.pentaho.packageManagement.Package; //导入方法依赖的package包/类
public static String installPackageFromArchive(String packageArchivePath,
    PrintStream... progress) throws Exception {
  useCacheOrOnlineRepository();
  Package toInstall = PACKAGE_MANAGER
      .getPackageArchiveInfo(packageArchivePath);

  Object specialInstallMessage = toInstall
      .getPackageMetaDataElement("MessageToDisplayOnInstallation");
  if (specialInstallMessage != null
      && specialInstallMessage.toString().length() > 0) {
    String siM = specialInstallMessage.toString();
    try {
      siM = Environment.getSystemWide().substitute(siM);
    } catch (Exception ex) {
      // quietly ignore
    }
    String message = "**** Special installation message ****\n" + siM
        + "\n**** Special installation message ****";
    for (PrintStream p : progress) {
      p.println(message);
    }
  }

  PACKAGE_MANAGER.installPackageFromArchive(packageArchivePath, progress);

  boolean loadIt = checkForMissingClasses(toInstall, progress);
  if (loadIt) {
    File packageRoot = new File(PACKAGE_MANAGER.getPackageHome()
        + File.separator + toInstall.getName());
    loadIt = checkForMissingFiles(toInstall, packageRoot, progress);
    if (loadIt) {
      loadPackageDirectory(packageRoot, false);
    }
  }

  return toInstall.getName();
}
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:38,代码来源:WekaPackageManager.java

示例8: installPackageFromURL

import org.pentaho.packageManagement.Package; //导入方法依赖的package包/类
public static String installPackageFromURL(URL packageURL,
    PrintStream... progress) throws Exception {
  useCacheOrOnlineRepository();
  String packageName = PACKAGE_MANAGER.installPackageFromURL(packageURL,
      progress);

  Package installed = PACKAGE_MANAGER.getInstalledPackageInfo(packageName);

  Object specialInstallMessage = installed
      .getPackageMetaDataElement("MessageToDisplayOnInstallation");
  if (specialInstallMessage != null
      && specialInstallMessage.toString().length() > 0) {
    String message = "**** Special installation message ****\n"
        + specialInstallMessage.toString()
        + "\n**** Special installation message ****";
    for (PrintStream p : progress) {
      p.println(message);
    }
  }

  boolean loadIt = checkForMissingClasses(installed, progress);
  if (loadIt) {
    File packageRoot = new File(PACKAGE_MANAGER.getPackageHome()
        + File.separator + installed.getName());
    loadIt = checkForMissingFiles(installed, packageRoot, progress);
    if (loadIt) {
      loadPackageDirectory(packageRoot, false);
    }
  }
  return packageName;
}
 
开发者ID:dsibournemouth,项目名称:autoweka,代码行数:32,代码来源:WekaPackageManager.java

示例9: installPackageFromRepository

import org.pentaho.packageManagement.Package; //导入方法依赖的package包/类
/**
 * Install a named package by retrieving the location of the archive from the
 * meta data stored in the repository
 * 
 * @param packageName the name of the package to install
 * @param version the version of the package to install
 * @param progress for reporting progress
 * @return true if the package was installed successfully
 * @throws Exception if a problem occurs
 */
public static boolean installPackageFromRepository(String packageName,
  String version, PrintStream... progress) throws Exception {
  useCacheOrOnlineRepository();
  Package toLoad = getRepositoryPackageInfo(packageName);

  // check to see if a version is already installed. If so, we
  // wont load the updated version into the classpath immediately in
  // order to avoid conflicts, class not found exceptions etc. The
  // user is told to restart Weka for the changes to come into affect
  // anyway, so there is no point in loading the updated package now.
  boolean isAnUpgrade = toLoad.isInstalled();

  Object specialInstallMessage =
    toLoad.getPackageMetaDataElement("MessageToDisplayOnInstallation");
  if (specialInstallMessage != null
    && specialInstallMessage.toString().length() > 0) {
    String siM = specialInstallMessage.toString();
    try {
      siM = Environment.getSystemWide().substitute(siM);
    } catch (Exception ex) {
      // quietly ignore
    }
    String message =
      "**** Special installation message ****\n" + siM
        + "\n**** Special installation message ****";
    for (PrintStream p : progress) {
      p.println(message);
    }
  }

  PACKAGE_MANAGER
    .installPackageFromRepository(packageName, version, progress);
  File packageDir =
    new File(PACKAGE_MANAGER.getPackageHome().toString() + File.separator
      + packageName);

  boolean loadIt = checkForMissingClasses(toLoad, progress);
  if (loadIt && !isAnUpgrade) {
    File packageRoot =
      new File(PACKAGE_MANAGER.getPackageHome() + File.separator
        + packageName);
    loadIt = checkForMissingFiles(toLoad, packageRoot, progress);
    if (loadIt) {
      loadPackageDirectory(packageDir, false, null, false);
    }
  }

  return isAnUpgrade;
}
 
开发者ID:mydzigear,项目名称:repo.kmeanspp.silhouette_score,代码行数:60,代码来源:WekaPackageManager.java


注:本文中的org.pentaho.packageManagement.Package.getPackageMetaDataElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。