SilverStream
Application Server 3.5

com.sssw.rts.adminapi
Interface AgiAdmPublishMgr


public interface AgiAdmPublishMgr

Implemented by objects that manage publishing.


Field Summary
static int DEFAULT_MODE
          Option for the publish method.
static int PACKAGE_CONTENTS_RECURSIVE
          Option for the publish method.
static int RUNTIME_ONLY
          Option for the publish method.
 
Method Summary
 void commitChanges()
          Finish the process of publishing tables by committing the changes.
 void publish(Enumeration elements, int options, AgiAdmDatabase destinationDB)
          Publish a set of elements to a particular database.
 String publishTables(AgiAdmDatabase sourceDB, AgiAdmDatabase destinationDB)
          Attempt to publish tables from the source database to the destination database.
 

Field Detail

DEFAULT_MODE

public static final int DEFAULT_MODE
Option for the publish method. Tells the publish method to work in the default mode, that is, to publish both the metadata and the runtime items.

RUNTIME_ONLY

public static final int RUNTIME_ONLY
Option for the publish method. Tells the Publish Manager to "strip" meta data, that is, to publish runtime items only.

PACKAGE_CONTENTS_RECURSIVE

public static final int PACKAGE_CONTENTS_RECURSIVE
Option for the publish method. Tells the Publish Manager to publish the contents of a package recursively.

Use only when publishing packages.

Method Detail

publish

public void publish(Enumeration elements,
                    int options,
                    AgiAdmDatabase destinationDB)
             throws AgoUnrecoverableSystemException,
                    AgoSecurityException
Publish a set of elements to a particular database.
Parameters:
elements - items to be published: an enumeration of AgiAdmDesignElements and/or AgiAdmDirectory of the type PACKAGE
options - publish options
destinationDB - the destination database
Usage:
Use publishTables for publishing tables.
Example:
Hashtable info = new Hashtable();
 info.put(AgiAdmServer.INFO_DATABASE_NAME, "sourceDB");
// Specify the items to be published.
 Vector items = new Vector();
 AgiAdmDesignElement form = (AgiAdmDesignElement)server.getElement(
 	"myForm", AgiAdmDesignElement.FORM, info);
 AgiAdmDesignElement view = (AgiAdmDesignElement)server.getElement(
 	"myView", AgiAdmDesignElement.VIEW, info);
 items.addElement(form);
 items.addElement(view);
// Specify the destination database.
 AgiAdmDatabase destDB = (AgiAdmDatabase)server.getElement(
 "destinationDB", AgiAdmDatabase.DATABASE, null);
// Publish the selected items.
 pubMgr.publish(items.elements(), AgiAdmPublishMgr.DEFAULT_MODE, destDB);
 
See Also:
AgiAdmPublishMgr.RUNTIME_ONLY, AgiAdmPublishMgr.PACKAGE_CONTENTS_RECURSIVE, publishTables()

publishTables

public String publishTables(AgiAdmDatabase sourceDB,
                            AgiAdmDatabase destinationDB)
                     throws AgoUnrecoverableSystemException,
                            AgoSecurityException
Attempt to publish tables from the source database to the destination database. Return a string describing the effect of the change.
Parameters:
sourceDB - the source database where the tables reside
destinationDB - the destination database
Usage:
The actual publish won't take place until the caller commits the changes via commitChanges.
Example:
// Get a Publish Manager object.
 AgiAdmPublishMgr pubMgr = AgAdmin.getPublishMgrObject();
// Get a source database.
 AgiAdmDatabase sourceDB = (AgiAdmDatabase)server.getElement(
 "source", AgiAdmDatabase.DATABASE, null);
// Get a destination database.
 AgiAdmDatabase destDB = (AgiAdmDatabase)server.getElement(
 "destination", AgiAdmDatabase.DATABASE, null);
// Publish the tables from source to destination.
 String analysis = pubMgr.publishTables(
 sourceDB,destinationDB);
// ...
 // Display the analysis string and ask the user if it's OK to proceed
 // and actually publish the tables.
 // ...
 pubMgr.commitChanges();
 
See Also:
AgiAdmPublishMgr.commitChanges()

commitChanges

public void commitChanges()
                   throws AgoUnrecoverableSystemException,
                          AgoSecurityException
Finish the process of publishing tables by committing the changes.

This method must be called after publishTables so that the changes are committed.

Example:
// Get a Publish Manager object.
 AgiAdmPublishMgr pubMgr = AgAdmin.getPublishMgrObject();
// Get a source database.
 AgiAdmDatabase sourceDB = (AgiAdmDatabase)server.getElement(
 "source", AgiAdmDatabase.DATABASE, null);
// Get a destination database.
 AgiAdmDatabase destDB = (AgiAdmDatabase)server.getElement(
 "destination", AgiAdmDatabase.DATABASE, null);
// Publish the tables from source to destination.
 String analysis = pubMgr.publishTables(
 sourceDB,destinationDB);
// ...
 // Display the analysis string and ask the user if it's OK to proceed
 // and actually publish the tables.
 // ...
 pubMgr.commitChanges();
 
See Also:
publishTables()

SilverStream
Application Server 3.5