Importing activities
Use administrative commands to import activities that you exported.
Before you begin
To run administrative commands, you must use the wsadmin client. See Starting the wsadmin client for details.
Procedure
- Start the Activities Jython script interpreter.
- Do one of the following actions:
- If you want to import all of the activities that you exported,
use the following command to retrieve the activities that you exported
and save them as a java.util.Vector variable:
where export_directory is the file path, including the drive and subdirectory, on the local server where the previously exported ZIP files are located. When specifying a path separator, use the forward slash rather than backslash even on Microsoft® Windows® systems. For example:variable=ArchiveService.fetchActivities(java.lang.String export_directory)
allexports=ArchiveService.fetchActivities("C:/AllExports")
- If you want to filter the activities that you exported into a subset based on a member, complete the following steps:
- If you want to import all of the activities that you exported,
use the following command to retrieve the activities that you exported
and save them as a java.util.Vector variable:
- Optional: Only perform this step if you
want to delete a subset of the activities. You might want to perform
this step if an employee has exited the company and you want to remove
the activities that she owns from the collection before you import
them.
To delete a set of activities from the collection of exported activities, use the following command:
where subset_of_activities is the java.util.Vector variable you created to define a subset of activities that you retrieved from the export directory and that you want to permanently delete. For example, to remove Jane's activities from the collection of exported activities, you could use the following command:ArchiveService.deleteActivities(java.lang.String export_directory, java.util.Vector subset_of_activities)
ArchiveService.deleteActivities("C:/AllExports",janesactivities)
- Use one of the following commands to import the activities:
Note: For community activities, the community from which the activity was created must exist on the server to which you are importing the activities. If it does not, an error is returned when you attempt to import the activities. The associated community is identified by its communityUUID which is not persisted across different deployments, so you can only include community activities in the activities to be imported when you are importing them to the same server from which they were exported.
- If you do not want to overwrite any of the activities currently
on the server and would rather create an additional copy of an activity
if you are importing one that already exists, use this command:
where activities is the java.util.Vector variable you created to define the activities that you retrieved from the export directory and that you want to import into the Activities application. For example:ArchiveService.createActivities(java.lang.String export_directory, java.util.Vector activities)
or to import only Jane's activities:ArchiveService.createActivities("C:/AllExports",allexports)
ArchiveService.createActivities("C:/AllExports",janesactivities)
- Use the following command to import the activities from the
export repository. If the activities being imported already exist
on the Activities server, the ones on the server will be overwritten
during the import.
where activities is the java.util.Vector variable you created to define the activities that you retrieved from the export directory and that you want to import into the Activities application. For example:ArchiveService.importActivities(java.lang.String export_directory, java.util.Vector activities)
or to import only Jane's activities:ArchiveService.importActivities("C:/AllExports",allexports)
ArchiveService.importActivities("C:/AllExports",janesactivities)
- If you do not want to overwrite any of the activities currently
on the server and would rather create an additional copy of an activity
if you are importing one that already exists, use this command:
Results
If the import is successful, one activity is created from each ZIP file in the export repository and the wsadmin client returns an empty set of brackets. If one of the activities cannot be imported, information about it is returned to the wsadmin client's command line. Refer to the SystemOut.log file to find log messages that are written to it from the import process.