+

Search Tips   |   Advanced Search

Import activities

Use administrative commands to import activities that you exported.

We can import only activities that you exported from the Activities application. See Export activities.

  1. Start the Activities Jython script interpreter.

    1. Access the Activities configuration file:

        execfile("activitiesAdmin.py")

      The command in this procedure reads information from a file. If prompted to specify a service to connect to, specify the node where the file to read from is stored.

  2. Do one of the following actions:

    • To import all of the activities that you exported to retrieve the activities that you exported and save them as a java.util.Vector variable:

        variable=ArchiveService.fetchActivities(java.lang.String export_directory)

      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 Windows systems. For example:

        allexports=ArchiveService.fetchActivities("C:/AllExports")

    • To filter the activities that you exported into a subset based on a member:

    1. To identify a subset of activities created by a specific member:

        variable=MemberService.fetchMemberByName(java.util.Hashtable member)

      For example:

        jane=MemberService.fetchMemberByName("Jane Doe")

    2. To retrieve a subset of activities created by the member from the repository of exported activities and save it to variable:

      Do not use these member-based commands to fetch activities that were exported from a different deployment of Connections. These commands use the member ID to find the activities, and member IDs are not persisted across different deployments. Use these commands only to collect activities when we are importing the activities to the same server from which they were exported. If we are importing the activities to a different server, use the ArchiveService.fetchActivities(directory) command instead.

        variable=ArchiveService.fetchActivitiesCreatedByMember(java.lang.string export_directory,java.util.Hashtable member)

      For example:

        janesactivities=ArchiveService.fetchActivitiesCreatedByMember("C:/AllExports",jane)

      Alternatively, we can create the following subsets of activities. Note these commands only return standard activities; they do not return community activities.

      • To retrieve a subset of standard activities to which a specific member has access from the repository of exported activities and save it to a variable:

          variable=ArchiveService.fetchActivitiesByMember(java.lang.string export_directory,java.util.Hashtable member)

      • To retrieve a subset of standard activities a specific member owns from the repository of exported activities and save them to a variable:

          variable=ArchiveService.fetchActivitiesByOwner(java.lang.string export_directory,java.util.Hashtable member)

  3. Only perform this step to delete a subset of the activities. You might want to perform this step if an employee has exited the company and 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:

      ArchiveService.deleteActivities(java.lang.String export_directory, java.util.Vector subset_of_activities)

    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 to permanently delete. For example, to remove Jane's activities from the collection of exported activities, you could use the following command:

      ArchiveService.deleteActivities("C:/AllExports",janesactivities)

  4. Use one of the following commands to import the activities:

    For community activities, the community from which the activity was created must exist on the server to which we are importing the activities. If it does not, an error is returned when we attempt to import the activities. The associated community is identified by its communityUUID which is not persisted across different deployments, so we can only include community activities in the activities to be imported when we are importing them to the same server from which they were exported.

    • To not overwrite any of the activities currently on the server and would rather create an additional copy of an activity if we are importing one that already exists, use this command:

        ArchiveService.createActivities(java.lang.String export_directory, java.util.Vector activities)

      where activities is the java.util.Vector variable you created to define the activities that you retrieved from the export directory, and to import into the Activities application. For example:

        ArchiveService.createActivities("C:/AllExports",allexports)

      or to import only Jane's activities:

        ArchiveService.createActivities("C:/AllExports",janesactivities)

    • Run 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.

        ArchiveService.importActivities(java.lang.String export_directory, java.util.Vector activities)

      where activities is the java.util.Vector variable you created to define the activities that you retrieved from the export directory, and to import into the Activities application. For example:

        ArchiveService.importActivities("C:/AllExports",allexports)

      or to import only Jane's activities:

        ArchiveService.importActivities("C:/AllExports",janesactivities)


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 SystemOut.log to find log messages that are written to it from the import process.


Parent topic:
Administer Activities


Related:

Start the wsadmin client