Skip Headers
Oracle® Communications Network Integrity Developer's Guide
Release 7.1

E23701-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

24 Exporting and Importing Cartridges

This chapter provides an overview of exporting and importing Network Integrity cartridges.

Cartridge projects can be exported to archive files. This allows the cartridge projects to be distributed as a single or a set of archive files, rather than as the many files of a cartridge project. Once a project or projects is exported to an archive file, the archive file can be distributed and then imported into a different Studio or Eclipse workspace.

Before exporting a cartridge project, you should decide whether you want to include your source code in the archive file. Cartridges can be extended without distributing source code. However, if you want to allow the user to modify the actual distributed cartridge, then you must distribute the source code.

Cartridges can also be exported in both sealed and unsealed states. It is recommended that if you are distributing a cartridge without source code, you should seal the cartridge before exporting it. This prevents the user from changing the cartridge model and therefore breaking the cartridge.

To understand the differences between sealed and unsealed cartridges, and the procedures for sealing or unsealing a cartridge, see Getting Started with Design Studio.

Network Integrity production cartridges are distributed as sealed cartridges. Unsealing Network Integrity production cartridges violates the license, support, and maintenance agreements with Oracle.

See the following:

Exporting a Cartridge With Source Code

To export a cartridge containing source code:

  1. From the Studio File menu, select Export.

    The Export Select dialog appears.

  2. From the list of export destinations, expand the General node and select Archive File.

  3. Click Next.

    The Export Archive file dialog appears.

  4. Enter a destination archive file:

    1. Select the projects that you want to include in the archive.

    2. Specify the name and location of the archive file.

    3. In the Options section, accept the defaults.

    4. Click Finish to create an archive file containing the exported projects at the specified location.

    Figure 24-1 displays cartridge resources being archived.

    Figure 24-1 Archiving Cartridge Files

    Displays archive file UI

Exporting a Cartridge Without Source Code

Before exporting a cartridge project without source code, the project's classpath must be modified.

See the following:

Modifying the Classpath

To modify the classpath:

  1. Open the Navigator view.

  2. Use the Navigator view to rename the projects output directory out, to classes.

  3. From the Studio Window menu, select Show View, and select the Package Explorer view.

  4. Select the project.

  5. From the Studio Project menu, select Properties.

    The Properties dialog appears.

  6. From the list of properties, expand the Java Build Path node and select Source.

    A list of source folders on the build path is displayed.

  7. Remove the source directories that are part of the classpath:

    1. Select the source folders on the build path.

    2. Click Remove.

    Figure 24-2 displays source projects being removed.

    Figure 24-2 Removing Source Projects

    Displays removing source projects
  8. Select the Libraries tab, and click Add Class Folder to add the class folder classes, from step 2, to the classpath.

    Figure 24-3 shows how the class folder is added to the classpath.

    Figure 24-3 Adding the Class Folder

    Displays adding the class folder in UI
  9. Select the Order and Export tab, and check the box corresponding to the class folder classes.

    Figure 24-4 shows how the class folder is exported.

    Figure 24-4 Exporting the Class Folder

    Displays exporting the class folder in UI
  10. Click OK to complete the modification of the project classpath.

    After changing the classpath, if you wish to continue development on the cartridge, you should restore the classpath to its original configuration.

Exporting the Cartridge

Now that you've modified the classpath, you can export the cartridge:

  1. From the Studio File menu, select Export.

    The Export Select dialog appears.

  2. From the list of export destinations, expand the General node and select Archive File.

  3. Click Next.

    The Export Archive file dialog appears.

  4. Enter a destination archive file:

    1. Select the projects that you want to include in the archive.

    2. For the projects for which you are not including source code, expand the project tree and deselect the source directories which you previously removed from the classpath.

    3. Specify the name and location of the archive file.

    4. In the Options section, accept the defaults.

    5. Click Finish to create an archive file containing the exported projects at the specified location.

Importing a Cartridge

In addition to creating your own cartridges, you can import existing cartridges into Studio. When you import a cartridge, it becomes a project in the current workspace.

If you import a cartridge from a technology pack or a cartridge that has been protected by its creator, it may be sealed. Sealed cartridges cannot be modified without first being unsealed.

WARNING:

While it is possible to unseal a cartridge from a technology pack, you should not do so. A technology pack is supported by Oracle only if it remains sealed. You can extend a technology pack without unsealing its cartridges.

Cartridges with dependencies display errors when you import them without the required cartridges already being present in the workspace. For example, if you import a cartridge that requires a base cartridge, you see errors. After all the cartridges have been imported, you can clean all the projects to remove the errors.

To import a cartridge project from an archive file:

  1. From the Studio File menu, select Import.

    The Import Select dialog appears.

  2. From the list of import sources, expand the General node and select Existing Projects into Workspace.

  3. Click Next.

    The Import Projects dialog appears.

  4. Select the cartridge project:

    1. Click Select archive file.

    2. Specify the name and location of the archive file.

      A list of the projects in the archive file is displayed.

    3. Select the required projects.

    4. Click Finish to import the projects into your workspace.

Figure 24-5 shows how the project is imported.

Figure 24-5 Importing a Project

Displays import projects in UI