/// <summary>
 /// Adds an activity to the Episerver Social Activity Streams system.
 /// </summary>
 /// <param name="actor">the actor who initiated the activity</param>
 /// <param name="target">the target of the activity</param>
 /// <param name="activity">an instance of CommunityActivity</param>
 /// <exception cref="SocialRepositoryException">Thrown when errors occur
 /// interacting with the Social cloud services.</exception>
 public void Add(string actor, string target, CommunityActivity activity)
 {
     try
     {
         service.Add(new Activity(
                         Reference.Create(actor),
                         Reference.Create(target)), activity
                     );
     }
     catch (SocialAuthenticationException ex)
     {
         throw new SocialRepositoryException("The application failed to authenticate with Episerver Social.", ex);
     }
     catch (MaximumDataSizeExceededException ex)
     {
         throw new SocialRepositoryException("The application request was deemed too large for Episerver Social.", ex);
     }
     catch (SocialCommunicationException ex)
     {
         throw new SocialRepositoryException("The application failed to communicate with Episerver Social.", ex);
     }
     catch (SocialException ex)
     {
         throw new SocialRepositoryException("Episerver Social failed to process the application request.", ex);
     }
 }
Esempio n. 2
0
 public ServerResponse<string, string, ChildVm> AddActivity(int Id, string ActivityName)
 {
     try
     {
         CommunityActivity activity = new CommunityActivity() { ActivityName = ActivityName, ChildId = Id };
         baseRepo.Add<CommunityActivity>(activity);
         ChildVm cvm = new ChildVm(baseRepo.getDb().Child.Find(Id), true);
         return new ServerResponse<string, string, ChildVm>(ErrorMessages.SuccessString, null, cvm);
     }
     catch (Exception e)
     {
         return new ServerResponse<string, string, ChildVm>(ErrorMessages.ErrorString, ErrorMessages.ErrMsg_Generic, null);
     }
 }
Esempio n. 3
0
 public ServerResponse <string, string, ChildVm> AddActivity(int Id, string ActivityName)
 {
     try
     {
         CommunityActivity activity = new CommunityActivity()
         {
             ActivityName = ActivityName, ChildId = Id
         };
         baseRepo.Add <CommunityActivity>(activity);
         ChildVm cvm = new ChildVm(baseRepo.getDb().Child.Find(Id), true);
         return(new ServerResponse <string, string, ChildVm>(ErrorMessages.SuccessString, null, cvm));
     }
     catch (Exception e)
     {
         return(new ServerResponse <string, string, ChildVm>(ErrorMessages.ErrorString, ErrorMessages.ErrMsg_Generic, null));
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Interprets a CommunityActivity
 /// </summary>
 /// <param name="activity">the CommunityActivity to interpret</param>
 public void Visit(CommunityActivity activity)
 {
     activity.Accept(this);
 }
Esempio n. 5
0
 public CommunityActivityVm(CommunityActivity ca)
 {
     this.CommunityActivityId = ca.CommunityActivityId;
     this.ActivityName        = ca.ActivityName;
     this.ChildId             = ca.ChildId;
 }
Esempio n. 6
0
 public CommunityActivityVm(CommunityActivity ca)
 {
     this.CommunityActivityId = ca.CommunityActivityId;
     this.ActivityName = ca.ActivityName;
     this.ChildId = ca.ChildId;
 }