Note: For information on deployments with Oracle ATG Web Commerce Content Administration, refer to the ATG Content Administration Programming Guide.

The DAF.Deployment module is included by default on the Oracle ATG Web Commerce source server. The appropriate modules are also included by default on both the source and target servers if your environment includes Oracle ATG Web Commerce Content Administration. However, if you do not use Oracle ATG Web Commerce Content Administration, and you are deploying files, you must specify DAF.DeploymentAgent in the list of modules when you assemble your application for the target server. For more information, see Assembling Applications

To trigger a deployment for repository assets, create an object of type RepositoryDeploymentData, specifying a source and destination repository. For deploying assets from multiple source repositories, create a DeploymentData object for each pair of source and destination repositories. For each item you want to add, invoke addNewItem(). To update an item, use addItemForUpdate(). To delete an item, invoke addItemForDelete().

For example:

RepositoryDeploymentData dd = new RepositoryDeploymentDataImpl(sourceRepository,
  targetRepository);
RepositoryDeploymentData dd2 = new RepositoryDeploymentDataImpl(sourceRepository2,
  targetRepository2);

dd.addItemForUpdate(myRepositoryItem);
dd.addItemForDelete(myOtherRepositoryItem);
dd2.addItemForUpdate(myRepositoryItem2);
dd2.addItemForDelete(myOtherRepositoryItem2);

DeploymentData[] dataArray = {dd, dd2};

DeploymentManager manager = (DeploymentManager)
  Nucleus.getGlobalNucleus().resolveName("/atg/deployment/DeploymentManager");

String deploymentId = manager.deploy(dataArray, new DeploymentOptions());

To deploy file assets, construct a FileDeploymentData object, which represents a particular agent or target process. It holds only the IP address of that machine, and the port number of the FileDeploymentServer on the running agent.

Create a separate FileDeploymentData object for each agent or target server that needs data from any particular virtual file system. Also, a separate FileDeploymentData object should be created for each distinct VirtualFileSystem component targeted on a particular agent process.

Use the **byURI functions when deploying from a versioned ContentRepositoryFileSystem. The URI passed in is the String representation of the version manager URI. Use the other functions when deploying non-versioned data.

The following example deploys the same data from a single non-versioned virtual file system to two target agents simultaneously:

VirtualFileSystem sourceSystem = (VirtualFileSystem)
  Nucleus.getGlobalNucleus().resolveName("/com/path/SourceVFS");

FileDeploymentDestination dest1 =
  new FileDeploymentDestination("server1.company.com:8810");
FileDeploymentDestination dest2 =
  new FileDeploymentDestination("server2.company.com:8810");

FileDeploymentData fdd1 =
  new FileDeploymentData(sourceSystem, dest1); FileDeploymentData fdd2 =
  new FileDeploymentData(sourceSystem, dest2);

fdd1.addNewFile(myVirtualFile1); fdd2.addNewFile(myVirtualFile1);
fdd1.addFileForUpdate(myVirtualFile2);
fdd2.addFileForUpdate(myVirtualFile2);
fdd1.addFileForDelete(myVirtualFile3);
fdd2.addFileForDelete(myVirtualFile3);

DeploymentData[] dataArray = {fdd1, fdd2};

DeploymentManager manager = (DeploymentManager)
  Nucleus.getGlobalNucleus().resolveName("/atg/deployment/DeploymentManager");

String deploymentId = manager.deploy(dataArray, new DeploymentOptions());

See atg.deployment.DeploymentData for more information.


Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices