com.bea.wlai.client
Class ApplicationViewPublisher

java.lang.Object
  extended bycom.bea.wlai.client.ApplicationViewPublisher
All Implemented Interfaces:
Serializable

public class ApplicationViewPublisher
extends Object
implements Serializable

This class provides utility methods for interacting with the AI client manager EJBs for doing common design time tasks. This class is helpful for other environments outside the standard design-time framework provided by WLI.

See Also:
Serialized Form

Constructor Summary
ApplicationViewPublisher()
           
 
Method Summary
static File createOrUpdateChannelFile(IApplicationViewDescriptor avd, String appName, File appRootDir)
          Generate the .channel file for the given ApplicationView, and write it into the first available Schemas project within the app rooted at appRootDir.
static File distributeApplicationViewResources(IApplicationViewDescriptor avd, File srcRepositoryRootDir, String appName, File appRootDir, File tempDir)
          For the ApplicationView represented by the given descriptor, collect all the resources referenced in the descriptor from the given source directory, and distribute them to the given application directory (in the repository dir for the app)
static File getSchemasDirectory(File[] files)
           
static boolean isApplicationViewPublished(QualifiedName appViewQName, String appName, File appRootDir)
          Is the ApplicationView given by appViewQName already published to the application given by appName and appRootDir?
static boolean isWebAppProject(File projectDir)
           
static void main(String[] args)
           
static void printUsage()
           
static File publishApplicationView(IApplicationViewDescriptor avd, boolean containerManagedSignOnEnabled, File srcRepositoryRootDir, String appName, File appRootDir)
          Compile and publish the given application view descriptor, given by the avd argument, to the J2EE app given by appName, and appRootDir.
static File publishApplicationView(String appViewQName, boolean containerManagedSignOnEnabled, File srcRepositoryRootDir, String appName, File appRootDir)
          Compile and publish the application view, with the given qualified name, to the J2EE app given by appName, and appRootDir.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationViewPublisher

public ApplicationViewPublisher()
Method Detail

publishApplicationView

public static File publishApplicationView(String appViewQName,
                                          boolean containerManagedSignOnEnabled,
                                          File srcRepositoryRootDir,
                                          String appName,
                                          File appRootDir)
                                   throws com.bea.wlai.client.DeploymentException
Compile and publish the application view, with the given qualified name, to the J2EE app given by appName, and appRootDir.

Parameters:
appViewQName - The qualified name for the ApplicationView to publish.
containerManagedSignOnEnabled - If true, enable container-managed sign-on for this ApplicationView.
srcRepositoryRootDir - The root directory of the AI repository from which the ApplicationView artifacts will be retrieved during the publish process.
appName - The name of the J2EE application that will receive the newly published ApplicationView.
appRootDir - The root directory of the destination J2EE application
Returns:
The File object representing the published ApplicationView EJB
Throws:
DeploymentException - If any communication error with the servlet occurs, or the deployment fails for any reason.

publishApplicationView

public static File publishApplicationView(IApplicationViewDescriptor avd,
                                          boolean containerManagedSignOnEnabled,
                                          File srcRepositoryRootDir,
                                          String appName,
                                          File appRootDir)
                                   throws com.bea.wlai.client.DeploymentException
Compile and publish the given application view descriptor, given by the avd argument, to the J2EE app given by appName, and appRootDir.

Parameters:
avd - The deployment descriptor document
containerManagedSignOnEnabled - If true, enable container-managed sign-on for this ApplicationView.
srcRepositoryRootDir - The root directory of the AI repository from which the ApplicationView artifacts will be retrieved during the publish process.
appName - The name of the J2EE application that will receive the newly published ApplicationView.
appRootDir - The root directory of the destination J2EE application
Returns:
The File object representing the published ApplicationView EJB
Throws:
DeploymentException - If any communication error with the servlet occurs, or the deployment fails for any reason.

isApplicationViewPublished

public static boolean isApplicationViewPublished(QualifiedName appViewQName,
                                                 String appName,
                                                 File appRootDir)
Is the ApplicationView given by appViewQName already published to the application given by appName and appRootDir?


distributeApplicationViewResources

public static File distributeApplicationViewResources(IApplicationViewDescriptor avd,
                                                      File srcRepositoryRootDir,
                                                      String appName,
                                                      File appRootDir,
                                                      File tempDir)
                                               throws com.bea.wlai.client.DeploymentException
For the ApplicationView represented by the given descriptor, collect all the resources referenced in the descriptor from the given source directory, and distribute them to the given application directory (in the repository dir for the app)

Parameters:
avd - The AppView descriptor to handle distribution for
srcRepositoryRootDir - The source directory for gathering resources
appName - The target application's name
appRootDir - The target app's root directory
tempDir - A temporary directory this method can use to generate temp working files.
Returns:
The File object representing a jar containing all the resources needed by the AppView
Throws:
DeploymentException - If any error occurs collecting or distributing resources.

createOrUpdateChannelFile

public static File createOrUpdateChannelFile(IApplicationViewDescriptor avd,
                                             String appName,
                                             File appRootDir)
                                      throws com.bea.wlai.client.DeploymentException
Generate the .channel file for the given ApplicationView, and write it into the first available Schemas project within the app rooted at appRootDir.

Returns:
the File object for the created/updated channel file, or null if no available project could be found.
Throws:
com.bea.wlai.client.DeploymentException

isWebAppProject

public static boolean isWebAppProject(File projectDir)

getSchemasDirectory

public static File getSchemasDirectory(File[] files)

printUsage

public static void printUsage()

main

public static void main(String[] args)