Search in sources :

Example 1 with Visibility

use of com.vodafone360.people.datatypes.ActivityItem.Visibility in project 360-Engine-for-Android by 360.

the class TestModule method createFakeActivitiesList.

/**
	 * TODO: fill in the method properly
	 * @return
	 */
public List<ActivityItem> createFakeActivitiesList() {
    List<ActivityItem> activityList = new ArrayList<ActivityItem>();
    for (int i = 0; i < TABLE_SIZE; i++) {
        ActivityItem activityItem = new ActivityItem();
        /** Unique identifier for the activity. This can be empty when setting 
			 * a new activity (the id is generated on the server side) */
        activityItem.activityId = System.currentTimeMillis();
        /** Timestamp representing the time of the activity. 
			 * This may not be related to creation/updated time. */
        activityItem.time = System.currentTimeMillis();
        /** local id for db */
        //			activityItem.mLocalId; set by DB insertion
        //			activityItem.mMoreInfo; //new Hashtable<ActivityItem, String>
        /** The parent activity for 'grouped' or aggregated activities. This must be empty 
			 * for normal activities that can be retrieved normally. Normally, a GetActivities 
			 * without filter will not yield any 'grouped' or 'child' activities. 
			 * To get activities that have a mParentActivity set, the 'children' filter must 
			 * be used with a value of the parent Activity's id.*/
        //			activityItem.mParentActivity; // null
        /** Indicates wether this activity 'groups' several child activities. When set, 
			 * there must be child activities set that refer the main activity. Normally, 
			 * a GetActivities without filter will not yield any 'grouped' or 'child' activities. 
			 * To get activities that have a parentactivity set, the 'children' filter 
			 * must be used with a value of the parent Activity's id.*/
        //			activityItem.mHasChildren = false;
        /** Defines a binary preview for the activity. The preview can be a small thumbnail 
			 * of the activity. The type of the binary data is defined into the previewmime field.*/
        //			keep null
        //			activityItem.mPreview = ByteBuffer.allocate(bytes.length);
        //			activityItem.mPreviewMime;
        /** Defines an http url that the client can use to retrieve preview binary data. 
			 * Can be used to embed the url into an IMG HTML tag.*/
        //			activityItem.mPreviewUrl
        /** Name of the store type for this message. This field contains information about the 
			 * originator network (local or external community activity). 
			 * By default, should be set to local*/
        activityItem.store = "local";
        activityItem.title = generateRandomString();
        activityItem.description = activityItem.description + activityItem.store;
        /** Defines the type of the activity. */
        activityItem.type = Type.CONTACT_FRIEND_INVITATION_SENT;
        /** Defines an internal reference (if any) to the source of the activity. 
			 * The format for the uri is "module:identifier".Some examples of valid uri are:
			 * contact:2737b322c9f6476ca152aa6cf3e5ac12 The activity is linked to some 
			 * changes on a contact identified by id=2737b322c9f6476ca152aa6cf3e5ac12.
			 * file:virtual/flickr/2590004126 The activity is linked to some actions 
			 * on a file identified by id=virtual/flickr/2590004126.
			 * message:9efd255359074dd9bd04cc1c8c4743e5 The activity is linked to a message 
			 * identified by id=9efd255359074dd9bd04cc1c8c4743e5 */
        activityItem.uri = "virtual/flickr/2590004126";
        //can be 0		activityItem.mActivityFlags;
        /** Miscellaneous flags.*/
        activityItem.flagList = new ArrayList<Flag>();
        activityItem.flagList.add(Flag.ALREADY_READ);
        /** Defines the contact information of the counter-parties in the activity. 
			 * This field is not mandatory, because some activity types 
			 * are not related to contacts, but required if known.. */
        //keep it simple - empty		activityItem.mContactList = ;
        activityItem.visibility = new ArrayList<Visibility>();
        activityItem.visibility.add(Visibility.ORIGINATOR);
        //keep it 0		activityItem.mVisibilityFlags = 0;
        activityList.add(activityItem);
    }
    return activityList;
}
Also used : ArrayList(java.util.ArrayList) Visibility(com.vodafone360.people.datatypes.ActivityItem.Visibility) Flag(com.vodafone360.people.datatypes.ActivityItem.Flag) ActivityItem(com.vodafone360.people.datatypes.ActivityItem)

Example 2 with Visibility

use of com.vodafone360.people.datatypes.ActivityItem.Visibility in project 360-Engine-for-Android by 360.

the class TestModule method createFakeStatusEventList.

/**
	 * TODO: fill in the method properly
	 * @return
	 */
public List<ActivityItem> createFakeStatusEventList() {
    List<ActivityItem> activityList = new ArrayList<ActivityItem>();
    for (int i = 0; i < TABLE_SIZE; i++) {
        ActivityItem activityItem = new ActivityItem();
        /** Unique identifier for the activity. This can be empty when setting 
			 * a new activity (the id is generated on the server side) */
        activityItem.activityId = System.currentTimeMillis();
        /** Timestamp representing the time of the activity. 
			 * This may not be related to creation/updated time. */
        activityItem.time = System.currentTimeMillis();
        /** local id for db */
        //			activityItem.mLocalId; set by DB insertion
        //			activityItem.mMoreInfo; //new Hashtable<ActivityItem, String>
        /** The parent activity for 'grouped' or aggregated activities. This must be empty 
			 * for normal activities that can be retrieved normally. Normally, a GetActivities 
			 * without filter will not yield any 'grouped' or 'child' activities. 
			 * To get activities that have a mParentActivity set, the 'children' filter must 
			 * be used with a value of the parent Activity's id.*/
        //			activityItem.mParentActivity; // null
        /** Indicates wether this activity 'groups' several child activities. When set, 
			 * there must be child activities set that refer the main activity. Normally, 
			 * a GetActivities without filter will not yield any 'grouped' or 'child' activities. 
			 * To get activities that have a parentactivity set, the 'children' filter 
			 * must be used with a value of the parent Activity's id.*/
        //			activityItem.mHasChildren = false;
        /** Defines a binary preview for the activity. The preview can be a small thumbnail 
			 * of the activity. The type of the binary data is defined into the previewmime field.*/
        //			keep null
        //			activityItem.mPreview = ByteBuffer.allocate(bytes.length);
        //			activityItem.mPreviewMime;
        /** Defines an http url that the client can use to retrieve preview binary data. 
			 * Can be used to embed the url into an IMG HTML tag.*/
        //			activityItem.mPreviewUrl
        /** Name of the store type for this message. This field contains information about the 
			 * originator network (local or external community activity). 
			 * By default, should be set to local*/
        activityItem.store = "local";
        activityItem.title = generateRandomString();
        activityItem.description = activityItem.description + activityItem.store;
        /** Defines the type of the activity. */
        activityItem.type = Type.CONTACT_RECEIVED_STATUS_UPDATE;
        /** Defines an internal reference (if any) to the source of the activity. 
			 * The format for the uri is "module:identifier".Some examples of valid uri are:
			 * contact:2737b322c9f6476ca152aa6cf3e5ac12 The activity is linked to some 
			 * changes on a contact identified by id=2737b322c9f6476ca152aa6cf3e5ac12.
			 * file:virtual/flickr/2590004126 The activity is linked to some actions 
			 * on a file identified by id=virtual/flickr/2590004126.
			 * message:9efd255359074dd9bd04cc1c8c4743e5 The activity is linked to a message 
			 * identified by id=9efd255359074dd9bd04cc1c8c4743e5 */
        activityItem.uri = "virtual/flickr/2590004126";
        //can be 0		activityItem.mActivityFlags;
        /** Miscellaneous flags.*/
        activityItem.flagList = new ArrayList<Flag>();
        activityItem.flagList.add(Flag.STATUS);
        activityItem.activityFlags = 0x04;
        /** Defines the contact information of the counter-parties in the activity. 
			 * This field is not mandatory, because some activity types 
			 * are not related to contacts, but required if known.. */
        //keep it simple - empty		activityItem.mContactList = ;
        activityItem.visibility = new ArrayList<Visibility>();
        activityItem.visibility.add(Visibility.ORIGINATOR);
        //keep it 0		activityItem.mVisibilityFlags = 0;
        activityList.add(activityItem);
    }
    return activityList;
}
Also used : ArrayList(java.util.ArrayList) Visibility(com.vodafone360.people.datatypes.ActivityItem.Visibility) Flag(com.vodafone360.people.datatypes.ActivityItem.Flag) ActivityItem(com.vodafone360.people.datatypes.ActivityItem)

Aggregations

ActivityItem (com.vodafone360.people.datatypes.ActivityItem)2 Flag (com.vodafone360.people.datatypes.ActivityItem.Flag)2 Visibility (com.vodafone360.people.datatypes.ActivityItem.Visibility)2 ArrayList (java.util.ArrayList)2