本文整理汇总了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;
}
示例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);
}
}
示例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();
}
示例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;
}
示例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);
}
}
示例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);
}
}
}
示例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();
}
示例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;
}
示例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;
}