Using the Application Integration Design Console
This section presents the following topics:
WebLogic Integration provides a simple import-export utility for application views that can be executed from the command line, and incorporated into your code with the import-export API for application views. The output of the utility is a JAR
file containing all artifacts owned by the application view. You must manually import or export any artifacts that are used but not owned by the application view.
The import-export utility allows you to export application integration metadata objects from the file repository and to import those objects back into the file repository. The utility allows you to import-export the following objects:
All exported objects for a given invocation of the utility are stored in a JAR
archive. When a previously exported JAR
is imported, all objects in the JAR
are imported, too. You can also append objects to an existing exported JAR
, and deploy application views and connection factories on import.
Use the Import-Export utility to migrate application views from a WebLogic Integration 7.0 environment to a WebLogic Integration 8.1 environment. As part of the migration, the utility removes the ACLs from the application view and converts the use of connection factories to use of resource adapters. The migrated application views are loaded into the file-based repository.
Note: You must define a project in WebLogic Workshop before migrating application views. The project determines the location of the repository.
The utility is available as an API and as a command-line tool. In both cases, the server must be running. The scripts used to run the utility are located as follows:
WLI_HOME/bin/aiimportexport
(cmd
or sh
)
The following sections describe the command-line parameters and the methods on the import-export utility.
The following is the command-line syntax for the import-export utility:
aiimportexport <
appname
> <root_dir
> <file
>
[-codepage=Cp<
codepage_number
>
] [-dump=< <namespace
> | <'Root'> >]
[-append] [-overwrite] [-publish]
< [-export [object_name
]*] | [-import [edit-on-import_filename
]
[-eventProps=<connection_factory_name
>,<properties_file_name
>]*] >
The following table shows the command-line parameters for the import-export utility.
When an edit-on-import file is specified, you can execute editing commands on the text for objects to be imported. The resulting editing is done before the object is stored in the repository or deployed. Otherwise, the method is used as described in Importing Objects.
The document specified must conform to the following DTD:
<!ELEMENT ApplicationView (replace*)>
<!ATTLIST ApplicationView name NMTOKEN #REQUIRED
newName NMTOKEN #IMPLIED>
<!ELEMENT ConnectionFactory (replace*)>
<!ATTLIST ConnectionFactory name NMTOKEN #REQUIRED
newName NMTOKEN #IMPLIED>
<!ELEMENT Schema (replace*)>
<!ATTLIST Schema name NMTOKEN #REQUIRED
newName NMTOKEN #IMPLIED>
<!ELEMENT replace EMPTY>
<!ATTLIST replace xpath CDATA #REQUIRED
old CDATA #REQUIRED
new CDATA #REQUIRED
The edit-on-import document contains sections, indicated by the <ELEMENT>
tag, for each object to be edited. You can edit ApplicationView and Schema objects. Each section identifies an object by name and specifies the elements to be replaced. Optionally, each section can specify a newName
attribute that can be used to assign a new name to an object.
Each replace
element specifies the following:
""
) as the old value, all text in the selected nodes is matched.The following edit-on-import descriptor document describes how to edit an application view named DBMS.DBMS1 and rename it to DBMS.DBMS1a. The XML document illustrates three replacements for the application view and one replacement for the connection factory.
<?xml version="1.0"?>
<!DOCTYPE edit SYSTEM "ImportExportEditOnImport.dtd">
<edit>
<ApplicationView name="DBMS.DBMS1" newName="DBMS.DBMS1a">
<replace xpath="/applicationView/@connectionFactory"
old=""
new="com.bea.wlai.connectionFactories.DBMS.
DBMS1a_connectionFactoryInstance"/>
<replace xpath="/applicationView/@connectionFactoryName"
old=""
new="DBMS.DBMS1a_connectionFactory"/>
<replace xpath="/applicationView/service[@name='Service1']/
interactionSpecProperty[@name='sql']"
old="CAJUN."
new="PBPUBLIC."/>
</ApplicationView>
<ConnectionFactory name="DBMS.DBMS1_connectionFactory"
newName="DBMS.DBMS1a_connectionFactory">
<replace xpath="/connection-factory-dd/jndi-name"
old=""
new="com.bea.wlai.connectionFactories.DBMS.
DBMS1a_connectionFactoryInstance"/>
</ConnectionFactory>
</edit>
The first replacement edits the connectionFactory
attribute of the application view descriptor and changes the text in this attribute to the new value. Note the use of an empty string as the old value to match all text in the node.
The second replacement edits the connectionFactoryName
attribute of the application view descriptor and changes the text in this attribute to the new value.
The third replacement edits the service descriptor for the service named Service1
and changes the interactionSpecProperty
element named sql
by replacing CAJUN.
with PBPUBLIC.
wherever it occurs.
The fourth replacement edits the jndi-name
attribute of the connection factory descriptor and changes the text in this attribute to the new value.
The following sections describe the methods included in the import-export API. The class name for the import-export API is com.bea.wlai.client.ImportExport
.
connect(<
multiple signatures
>)
The connect
() method establishes a connection method with the server instance. Depending on where you initiate connections, you may need to specify different arguments for connect
().
dumpNamespace(String
namespaceName
)
The dumpNamespace
() method takes a string that represents the qualified name of a namespace, and prints out all objects within that namespace, as well as any other namespaces embedded in it.
exportNamespaceObjects(Set
objectNames
, boolean append, List errors)
The exportNamespaceObjects
() method takes a list of object names (qualified names as strings) and exports them to the specified output file (see Specify File for Import-Export). All objects listed for export are examined for dependencies. Any objects that are used but not owned by an application view are also exported.
When an application view is exported, the ConnectionFactory and all the Schema objects on which the application view depends are also exported. When a Namespace is exported, all objects in the namespace (including other namespaces) are also exported.
To append the exported file to an existing archive, or to overwrite or create the file, set append
to true.
Any nonfatal errors encountered during the export are stored as Exception objects in the specified errors List object.
importNamespaceObjects(boolean overwrite, boolean deploy, List errors)
The importNamespaceObjects() method takes all entries in the specified input file (see Specify File for Import-Export) and imports them into the repository. Set overwrite
to true to overwrite existing metadata in the repository. Set deploy
to true to deploy connection factories and application views on import.
Any nonfatal errors encountered during the import are stored as Exception objects in the specified errors List object.
importNamespaceObjects(IDocument
editOnImportDoc
boolean overwrite,
boolean deploy, List errors)
When an edit-on-import document is specified, the importNamespaceObjects() method allows you to execute editing commands on the text for objects to be imported. The resulting editing is done before the object is stored in the repository or deployed. Otherwise, the method is used as described in Importing Objects.
The document specified in the editOnImportDoc
argument must conform to the DTD shown in Editing on Import.
setFile(File
filename
)
The setFile
() method designates the file to be used as the export destination or import source.
setPrintWriter(PrintWriter out)
The setPrintWriter
() method designates a PrintWriter object to be used when messages (such as status, diagnostic, and error messages) are generated.
setQuiet(boolean quiet)
The setQuiet
() method specifies whether to print progress and information messages. To print messages, set quiet
to false
. To disable message printing, set quiet
to true
.