com.pepper.platform.program
Class PackageLocator

java.lang.Object
  extended by com.pepper.platform.program.PackageLocator

public class PackageLocator
extends Object

Interface providing access to and launch of other programs. Used for interprocess communication.


Constructor Summary
PackageLocator()
           
 
Method Summary
static List findPackageInfo(String type)
          Returns a list of com.pepper.platform.program.PackageInfo objects that match the given type
static List findPackageInfoByContentType(String contentType, String fileExtension)
          Return a List of com.pepper.platform.programPackageInfo objects (whether running or not) that support the specified mimeType and extension
static List findPackages(String type)
          Return name and ID of all packages in the Keeper of the given type, whether they're running or not.
static List findPackagesByContentType(String contentType, String fileExtension)
          Return name and ID of all packages in the Keeper of that support the specified mimeType and fileExtension, whether they're running or not.
static List findPackagesByDomain(String originURL)
          Return name and ID of all packages in the Keeper of that support pages downloaded from the specified originURL
static PackageInstance findRunningPackage(String packageID)
          Find a running package instance.
static void launchPackage(String packageID, com.pepper.platform.process.ProcessListener listener, String initialPageURL, boolean showPackage)
          Launch package if it's not running, call the listener once the package is done launching.
static void launchPackage(String packageID, String ppldURL, com.pepper.platform.process.ProcessListener listener, String initialPageURL, boolean showPackage)
          Launch package if it's not running, call the listener once the package is done launching.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackageLocator

public PackageLocator()
Method Detail

findRunningPackage

public static PackageInstance findRunningPackage(String packageID)
Find a running package instance. NOTE: this will return null if the package is running but is not instanceof PackageInstance.

Parameters:
packageID - ID of the package to find.
Returns:
PackageInstance of the running package, or null if the package is not running.

findPackages

public static List findPackages(String type)
Return name and ID of all packages in the Keeper of the given type, whether they're running or not.

Parameters:
type - Type of package, as defined in the program's PPLD.
Returns:
List of NameValues. The name is the package name, the value is the packageID.

findPackageInfo

public static List findPackageInfo(String type)
Returns a list of com.pepper.platform.program.PackageInfo objects that match the given type

Parameters:
type - Type of package, as defined in the program's PPLD.
Since:
3.2

findPackagesByContentType

public static List findPackagesByContentType(String contentType,
                                             String fileExtension)
Return name and ID of all packages in the Keeper of that support the specified mimeType and fileExtension, whether they're running or not.

Parameters:
contentType - The contentType/mimeType to search for
fileExtension - The extension of the file of type contentType
Returns:
List of NameValues. This contains two pairs for each package found: first is name=package name value=packageId, second is name=quietMode value=true|false third is name=element value=org.jdom.Element object

findPackageInfoByContentType

public static List findPackageInfoByContentType(String contentType,
                                                String fileExtension)
Return a List of com.pepper.platform.programPackageInfo objects (whether running or not) that support the specified mimeType and extension

Parameters:
contentType - The contentType/mimeType to search for
fileExtension - The extension of the file of type contentType
Returns:
List of PackageInfo objects representing the found packages
Since:
3.2

findPackagesByDomain

public static List findPackagesByDomain(String originURL)
Return name and ID of all packages in the Keeper of that support pages downloaded from the specified originURL

Parameters:
originURL - The url that a file was downloaded from
Returns:
List of NameValues. The name is the package name, the value is the packageID.

launchPackage

public static void launchPackage(String packageID,
                                 com.pepper.platform.process.ProcessListener listener,
                                 String initialPageURL,
                                 boolean showPackage)
Launch package if it's not running, call the listener once the package is done launching. The package is launched asynchrously

TODO: make sure listener only gets what it's supposed to

Parameters:
packageID - ID of the package to launch.
listener - Listener to notify when the package has finished launching. May be null.
initialPageURL - URL (pepper: or http) of the page to display. May be null.
showPackage - true to show the package when it is launched

launchPackage

public static void launchPackage(String packageID,
                                 String ppldURL,
                                 com.pepper.platform.process.ProcessListener listener,
                                 String initialPageURL,
                                 boolean showPackage)
Launch package if it's not running, call the listener once the package is done launching. The package is launched asynchrously

TODO: make sure listener only gets what it's supposed to

Parameters:
packageID - ID of the package to launch.
ppldURL - the url representing the ppld file to launch
listener - Listener to notify when the package has finished launching. May be null.
initialPageURL - URL (pepper: or http) of the page to display. May be null.
showPackage - true to show the package when it is launched


Copyright © 2006-2007 Pepper Computer, Inc. All Rights Reserved.