Exporting activities
Use administrative commands to export activities.
Before you begin
To run administrative commands, you must use the wsadmin client. See Starting the wsadmin client for details.
About this task
The data associated with the Activities application is stored in more than one place. For standard activities the activities and the member information associated with them are stored in the Activities database tables. For community activities, the activities themselves are stored in the Activities database tables and the member information is stored in the Communities database tables. For both activity types, any file attachments that are added to activities are stored in the content store on the file system. When you run the export process to export activities, it collects the data from all of these locations and stores it in one ZIP file per activity.
To export activities, complete the following steps:Procedure
- Start the Activities Jython script interpreter.
- Use one of the following commands to get a list of activities
that you want to export:
- To get a list of all the activities from the Activities server
and save them as a java.util.Vector variable that you can pass to
the export command, use the following command:
For example:variable=ActivityService.fetchActivities()
allexports=ActivityService.fetchActivities()
- To filter the activities to export to a subset of activities
created within a specific time period, use the following command:
For example, to get all of the activities created in September, use the following command:variable=ActivityService.fetchActivitiesByDate(java.lang.String dateType, java.lang.String beginTime, java.lang.String endTime, java.lang.String lastUUID)
sept=ActivityService.fetchActivitiesByDate("created", "2008.09.01", "2008.09.30", "")
Note: This command does not return activity templates that were created during the specified date range, but does include in the activities that it returns any activities present in the Trash view that were created during the specified date range. - To filter the activities that you want to export to a subset
based on their members, complete the following steps:
- Identify the member of interest and save the member information
to a variable using the following command:
For example:variable=MemberService.fetchMemberByName(java.util.Hashtable member)
john=MemberService.fetchMemberByName("John Smith")
- To retrieve a subset of activities that were created by the member
and save it to variable, use the following command:
For example:variable=ActivityService.fetchActivitiesCreatedByMember(java.util.Hashtable member)
Alternatively, you can create the following subsets of activities. Note that these commands only return standard activities; they do not return community activities:johnsactivities=ActivityService.fetchActivitiesCreatedByMember(john)
- To get a list of all the standard activities to which the member
has access:
variable=ActivityService.fetchActivitiesByMember(java.util.Hashtable member)
- To get a list of all the standard activities that the member owns:
variable=ActivityService.fetchActivitiesByOwner(java.util.Hashtable member)
- To get a list of all the standard activities to which the member
has access:
- Identify the member of interest and save the member information
to a variable using the following command:
- To get a list of community activities to export, complete
the following steps:
- Search by name for the community that owns the activities that
you want to export using the following command:
For example:ActivitiesMemberService.fetchCommunitiesByName(java.lang.String name)
communities=ActivitiesMemberService.fetchCommunitiesByName("sales")
- From the list of communities returned, find the community of interest and make a note of its unique ID.
- Pass that unique ID into the following command to write the activities
associated with the community to a java.util.Vector variable that
you can later pass to the export command:
For example:ActivityService.fetchActivitiesByCommunityExId(java.lang.String communityUuid)
communityActivitiesToExport=ActivityService.fetchActivitiesBy communityExId( "f29b4e8e-6fad-44f4-9fca-58c46f29c38d")
- Search by name for the community that owns the activities that
you want to export using the following command:
- To get a list of all the activities from the Activities server
and save them as a java.util.Vector variable that you can pass to
the export command, use the following command:
- Use the following command to export the activities:
where:ArchiveService.exportActivities(java.lang.String export_directory, java.util.Vector activities)
- export_directory is the directory path in which you want the activities which are exported as ZIP files to be stored. This directory must exist on the server that you were prompted to provide after running the execfile command to access the activitiesAdmin.py file.
- activities is the java.util.Vector variable you created to define the activities that you want to export.
or to export only John's activities:ArchiveService.exportActivities("c:/ActivitiesExports",allexports)
or to export only the activities created in September:ArchiveService.exportActivities("c:/ActivitiesExports",johnsactivities)
or to export the community activities:ArchiveService.exportActivities("c:/ActivitiesExports",sept)
ArchiveService.exportActivities("c:/ActivitiesExports",communityActivitiesTo export)