Package org.onesocialweb.model.activity

Examples of org.onesocialweb.model.activity.ActivityActor


   * @throws UserNotFoundException
   */
  public void publishActivity(String userJID, ActivityEntry entry) throws UserNotFoundException {
    // Overide the actor to avoid spoofing
    User user = UserManager.getInstance().getUser(new JID(userJID).getNode());
    ActivityActor actor = activityFactory.actor();
    actor.setUri(userJID);
    actor.setName(user.getName());
    actor.setEmail(user.getEmail());

    // Persist the activities
    final EntityManager em = OswPlugin.getEmFactory().createEntityManager();
    em.getTransaction().begin();
    entry.setId(DefaultAtomHelper.generateId());
View Full Code Here


   * @throws UserNotFoundException
   */
  public void updateActivity(String userJID, ActivityEntry entry) throws UserNotFoundException, UnauthorizedException {
    // Overide the actor to avoid spoofing
    User user = UserManager.getInstance().getUser(new JID(userJID).getNode());
    ActivityActor actor = activityFactory.actor();
    actor.setUri(userJID);
    actor.setName(user.getName());
    actor.setEmail(user.getEmail());
   
    // Persist the activities
    final EntityManager em = OswPlugin.getEmFactory().createEntityManager();
    em.getTransaction().begin();
    PersistentActivityEntry oldEntry=em.find(PersistentActivityEntry.class, entry.getId());
View Full Code Here

TOP

Related Classes of org.onesocialweb.model.activity.ActivityActor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.