You are here

getActivityStream

getActivityStream - returns a list of activities.

public List<ActivityEntry> getActivityStream()

public List<ActivityEntry> getActivityStream() returns a list of activities for the currently logged in user.

Parameters

None

Returns

Returns a List<ActivityEntry> representing a list of activities for the currently logged in user.

Exception

Throws an SkyVaultServiceException if the operation cannot be completed due to network or internal problems.

Example


    ActivityStreamService activityStreamService = session.getServiceRegistry()
        .getActivitystreamService();
    
    try {
    
    // Get all entries
    List<ActivityEntry> entries = activityStreamService.getActivityStream();
    
    
        // Get entries for a specified user
        entries = activityStreamService.getActivityStream("admin");
        for (ActivityEntry entry : entries) {
    
            Log.d(TAG,
                  "entry: " + entry.getIdentifier() + " type: "
                  + entry.getType() + " date: "
                  + entry.getPostDate().getTime().toString());
        }
    
    } // end try
    catch (AlfrescoServiceException e){
        Log.d(TAG, "Exception:" + e.toString());
        return 1;
    }

        

public PagingResult<ActivityEntry> getActivityStream(ListingContext listingContext)

public PagingResult<ActivityEntry> getActivityStream(ListingContext listingContext) returns a paged list of activities for the currently logged in user, using the specified listing context.

Parameters

ListingContext listingContext
The listing context to use to control paging of results. See ListingContext for further information.

Returns

Returns a PagingResult<ActivityEntry> representing a paged list of activities for the currently logged in user.

Exception

Throws an SkyVaultServiceException if the operation cannot be completed due to network or internal problems.

Example


    ActivityStreamService activityStreamService = session.getServiceRegistry()
        .getActivitystreamService();
    
    try {
    
        ListingContext lc = new ListingContext();
        lc.setMaxItems(1);
        lc.setSkipCount(0);
    
        // paged, for currently logged in user
        PagingResult<ActivityEntry> pagedEntries = activityStreamService.getActivityStream(lc);
    
    } // end try
    catch (AlfrescoServiceException e){
        Log.d(TAG, "Exception:" + e.toString());
        return 1;
    }

        

public List<ActivityEntry> getActivityStream(String username)

public List<ActivityEntry> getActivityStream(String personIdentifier) returns a list of activities for the specified user.

Parameters

String personIdentifier
The username of the user for which activities will be returned.

Returns

Returns a List<ActivityEntry> representing a list of activities for the specified user.

Exception

Throws an SkyVaultServiceException if the operation cannot be completed due to network or internal problems.

Example


    ActivityStreamService activityStreamService = session.getServiceRegistry()
        .getActivitystreamService();
    
    try {
        
        // Get entries for a specified user
        entries = activityStreamService.getActivityStream("admin");
        for (ActivityEntry entry : entries) {
    
            Log.d(TAG,
                  "entry: " + entry.getIdentifier() + " type: "
                  + entry.getType() + " date: "
                  + entry.getPostDate().getTime().toString());
        }
        
    } // end try
    catch (AlfrescoServiceException e){
        Log.d(TAG, "Exception:" + e.toString());
        return 1;
    }

        

public PagingResult<ActivityEntry> getActivityStream(String personIdentifier, ListingContext listingContext)

public PagingResult<ActivityEntry> getActivityStream(String username, ListingContext listingContext) returns a paged list of activities for the specified user, using the specified listing context.

Parameters

String personIdentifier
The username to return activities for.
ListingContext listingContext
The listing context to use.

Returns

Returns a PagingResult<ActivityEntry> representing a paged list of activities for the specified user.

Exception

Throws an SkyVaultServiceException if the operation cannot be completed due to network or internal problems.

Example


    ActivityStreamService activityStreamService = session.getServiceRegistry()
        .getActivitystreamService();
    
    try {
    
        ListingContext lc = new ListingContext();
        lc.setMaxItems(1);
        lc.setSkipCount(0);
    
        // paged, for specified user
        pagedEntries = activityStreamService.getActivityStream("joeuser", lc);
    
    } // end try
    catch (AlfrescoServiceException e){
        Log.d(TAG, "Exception:" + e.toString());
        return 1;
    }