Package org.onesocialweb.model.atom

Examples of org.onesocialweb.model.atom.AtomFactory


          uiText.Oops());
      return;
    }
    // TODO disable the update panel during the update
    final OswService service = OswServiceFactory.getService();
    final AtomFactory atomFactory = service.getAtomFactory();

    Date now = new Date();
    String status = textareaUpdate.getText();

    ActivityObject object = service.getActivityFactory().object(
        ActivityObject.STATUS_UPDATE);
    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,
View Full Code Here

TOP

Related Classes of org.onesocialweb.model.atom.AtomFactory

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.