Package org.onesocialweb.model.activity

Examples of org.onesocialweb.model.activity.ActivityEntry


            + " to " + toJID);
        final ActivityDomReader reader = new PersistentActivityDomReader();
        List<Element> items=(List<Element>) itemsElement.elements("item");
        if ((items!=null) && (items.size()!=0)){
          for (Element itemElement :items) {
            ActivityEntry activity = reader
            .readEntry(new ElementAdapter(itemElement
                .element("entry")));
            try {

              ActivityManager.getInstance().handleMessage(
View Full Code Here


      ActivityDomReader reader = new PersistentActivityDomReader();
      List<String> itemIds = new ArrayList<String>(items.size());
      for (Element item : items) {
        Element entry = item.element("entry");
        if (entry != null) {
          ActivityEntry activity = reader.readEntry(new ElementAdapter(entry));
          Log.debug("ActivityPublishHandler received activity: " + activity);
          try {
            if ((activity.getId()!=null) && (activity.getId().length()!=0))
              activityManager.updateActivity(sender.toBareJID(), activity);
            else{
              activityManager.publishActivity(sender.toBareJID(), activity);
              itemIds.add(activity.getId());
            }
          } catch (UserNotFoundException e) {}
        }
      }
View Full Code Here

    object.addContent(service.getAtomFactory().content(status,
        "text/plain", null));
    object.setPublished(now);

    // the basics
    ActivityEntry entry = service.getActivityFactory().entry();
    entry.setTitle(status);
    entry.addVerb(service.getActivityFactory().verb(ActivityVerb.POST));
    entry.addObject(object);
    entry.setPublished(now);

    // add attachments if there are any
    for (ActivityObject current : pictureAttachments) {
      entry.addObject(current);
    }

    // Add recipients if there are any
    for (String recipient : shoutAttachmentPanel.getRecipients()) {
      entry.addRecipient(atomFactory.reply(null, recipient, null, null));
    }

    // setup access control
    AclRule rule = service.getAclFactory().aclRule();
    rule.addAction(service.getAclFactory().aclAction(AclAction.ACTION_VIEW,
        AclAction.PERMISSION_GRANT));

    // check privacy settings
    String visibilityValue = privacyAttachmentPanel.getPrivacyValue();

    if (visibilityValue.equals(uiText.Everyone())) {
      rule.addSubject(service.getAclFactory().aclSubject(null,
          AclSubject.EVERYONE));
    } else {
      rule.addSubject(service.getAclFactory().aclSubject(visibilityValue,
          AclSubject.GROUP));
    }
    entry.addAclRule(rule);

    // we got everything we need -> clean up UI
    reset();

    // Prepare a task to monitor status
View Full Code Here

TOP

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

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.