com.bea.wlai.client
Class ApplicationViewPublisher

java.lang.Object
  extended by com.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

Nested Class Summary
static class ApplicationViewPublisher.HostAppInfo
           
 
Field Summary
static long serialVersionUID
           
 
Constructor Summary
ApplicationViewPublisher()
           
 
Method Summary
static File createOrUpdateChannelFile(IApplicationViewDescriptor avd, File srcRepositoryRootDir, ApplicationViewPublisher.HostAppInfo hostAppInfo)
          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, ApplicationViewPublisher.HostAppInfo hostAppInfo, 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 (in the repository dir for the app)
static weblogic.j2ee.descriptor.ApplicationBean getApplicationDescriptor(File file, ClassLoader loader)
           
static ApplicationViewPublisher.HostAppInfo getHostAppInfo(String appName, File appRootDir)
           
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.
static void writeApplicationDescriptor(weblogic.j2ee.descriptor.ApplicationBean appBean, File file, ClassLoader loader)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ApplicationViewPublisher

public ApplicationViewPublisher()
Method Detail

publishApplicationView

public static File publishApplicationView(String appViewQName,
                                          boolean containerManagedSignOnEnabled,
                                          File srcRepositoryRootDir,
                                          String appName,
                                          File appRootDir)
                                   throws 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 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,
                                                      ApplicationViewPublisher.HostAppInfo hostAppInfo,
                                                      File tempDir)
                                               throws 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 (in the repository dir for the app)

Parameters:
avd - The AppView descriptor to handle distribution for
srcRepositoryRootDir - The source directory for gathering resources
hostAppInfo - The target application's HostAppInfo
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,
                                             File srcRepositoryRootDir,
                                             ApplicationViewPublisher.HostAppInfo hostAppInfo)
                                      throws 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:
DeploymentException

getApplicationDescriptor

public static weblogic.j2ee.descriptor.ApplicationBean getApplicationDescriptor(File file,
                                                                                ClassLoader loader)
                                                                         throws IOException
Throws:
IOException

writeApplicationDescriptor

public static void writeApplicationDescriptor(weblogic.j2ee.descriptor.ApplicationBean appBean,
                                              File file,
                                              ClassLoader loader)
                                       throws IOException
Throws:
IOException

isWebAppProject

public static boolean isWebAppProject(File projectDir)

printUsage

public static void printUsage()

main

public static void main(String[] args)

getHostAppInfo

public static ApplicationViewPublisher.HostAppInfo getHostAppInfo(String appName,
                                                                  File appRootDir)
                                                           throws DeploymentException
Throws:
DeploymentException