Examples of MessageCollection


Examples of org.apache.shindig.social.opensocial.model.MessageCollection

    UserId user = request.getUsers().iterator().next();


    if (msgCollId == null) {
      // Request to create a new message collection
      MessageCollection msgCollection = request.getTypedParameter("entity", MessageCollection.class);

      return service.createMessageCollection(user, msgCollection, request.getToken());
    }

    // A message collection has been specified, allow for posting
View Full Code Here

Examples of org.apache.shindig.social.opensocial.model.MessageCollection

          "A message collection is required");
    }

    if (messageIds.isEmpty()) {
      // No message IDs specified, this is a PUT to a message collection
      MessageCollection msgCollection = request.getTypedParameter("entity", MessageCollection.class);
      if (msgCollection == null) {
        throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST,
            "cannot parse message collection");
      }
View Full Code Here

Examples of org.apache.shindig.social.opensocial.model.MessageCollection

    UserId user = request.getUsers().iterator().next();


    if (msgCollId == null) {
      // Request to create a new message collection
      MessageCollection msgCollection = request.getTypedParameter("entity", MessageCollection.class);

      return service.createMessageCollection(user, msgCollection, request.getToken());
    }

    // A message collection has been specified, allow for posting
View Full Code Here

Examples of org.apache.shindig.social.opensocial.model.MessageCollection

          "A message collection is required");
    }

    if (messageIds.isEmpty()) {
      // No message IDs specified, this is a PUT to a message collection
      MessageCollection msgCollection = request.getTypedParameter("entity", MessageCollection.class);
      if (msgCollection == null) {
        throw new ProtocolException(HttpServletResponse.SC_BAD_REQUEST,
            "cannot parse message collection");
      }
View Full Code Here

Examples of org.broad.igv.ui.MessageCollection

            event.acceptDrop(DnDConstants.ACTION_COPY);

            Transferable transferable = event.getTransferable();

            MessageCollection messages = new MessageCollection();
            try {
                List<File> files = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);

                for (File file : files) {
                    try {
                        ResourceLocator locator = new ResourceLocator(file.getAbsolutePath());
                        IGV.getInstance().load(locator, panel);
                    } catch (DataLoadException de) {
                        messages.append(de.getMessage());
                    }
                }
                String obj = transferable.getTransferData(DataFlavor.stringFlavor).toString();
                if (HttpUtils.isRemoteURL(obj)) {
                    IGV.getInstance().load(new ResourceLocator(obj), panel);
                }
                if (messages != null && !messages.isEmpty()) {
                    log.error(messages.getFormattedMessage());
                    MessageUtils.showMessage(messages.getFormattedMessage());
                }
            } catch (Exception e) {
                String obj = null;
                try {
                    obj = transferable.getTransferData(DataFlavor.stringFlavor).toString();
                    if (HttpUtils.isRemoteURL(obj)) {
                        IGV.getInstance().load(new ResourceLocator(obj), panel);
                    }
                } catch (Exception e1) {
                    log.error(e1);
                    if (messages != null && !messages.isEmpty()) {
                        MessageUtils.showMessage(messages.getFormattedMessage());
                    }
                }
            }
            IGV.getMainFrame().repaint();
            event.dropComplete(true);
View Full Code Here

Examples of org.wso2.carbon.registry.social.api.message.MessageCollection

     * @return A MessageCollection type object with attributes added
     */

    private MessageCollection getPropertiesAddedMessageCollectionObj(Resource collectionResource,
                                                                     Set<String> fields) {
        MessageCollection collectionObj = new MessageCollectionImpl();
        for (String field : fields) {
            if (SocialImplConstants.MSG_COLLECTION_ID.equalsIgnoreCase(field.trim())) {
                collectionObj.setId(collectionResource.getProperty(
                        SocialImplConstants.MSG_COLLECTION_ID));
            } else if (SocialImplConstants.MSG_COLLECTION_TITLE.equalsIgnoreCase(field.trim())) {
                collectionObj.setTitle(collectionResource.getProperty(
                        SocialImplConstants.MSG_COLLECTION_TITLE));
            } else if (SocialImplConstants.MSG_COLLECTION_TOTAL_MESSAGES.equalsIgnoreCase(
                    field.trim())) {
                collectionObj.setTotal(Integer.valueOf(collectionResource.getProperty(
                        SocialImplConstants.MSG_COLLECTION_TOTAL_MESSAGES)));
            } else if (SocialImplConstants.MSG_COLLECTION_UNREAD_MESSAGES.equalsIgnoreCase(
                    field.trim())) {
                collectionObj.setUnread(Integer.valueOf(collectionResource.getProperty(
                        SocialImplConstants.MSG_COLLECTION_UNREAD_MESSAGES)));
            } else if (SocialImplConstants.MSG_COLLECTION_UPDATED_DATE.equalsIgnoreCase(
                    field.trim())) {
                collectionObj.setUpdated(new Date(Long.valueOf(collectionResource.getProperty(
                        SocialImplConstants.MSG_COLLECTION_UPDATED_DATE))));
            } else if (SocialImplConstants.MSG_COLLECTION_URLS.equalsIgnoreCase(field.trim())) {
                List<Url> collectionUrls = new ArrayList<Url>();
                List<String> propertyValues = collectionResource.getPropertyValues(
                        SocialImplConstants.MSG_COLLECTION_URLS);
                for (String urlString : propertyValues) {
                    Url url = new UrlImpl();
                    url.setLinkText(urlString);
                    collectionUrls.add(url);
                }
                collectionObj.setUrls(collectionUrls);

            } else {
                //TODO: Handle non-field values
            }
        }
View Full Code Here

Examples of org.wso2.carbon.registry.social.api.message.MessageCollection

    // deleteMessageCollection()

    public void testMessageCollections() throws Exception {
        manager = new MessageManagerImpl();
        manager.setRegistry(registry);
        MessageCollection msgColl = new MessageCollectionImpl();
        msgColl.setTitle("inbox");
        msgColl.setUnread(3);
        msgColl.setUpdated(new Date());
        msgColl.setId("1");
        msgColl.setTotal(10);
        List<Url> collectionUrls = new ArrayList<Url>();
        Url url = new UrlImpl();
        url.setValue("testURL");
        collectionUrls.add(url);
        msgColl.setUrls(collectionUrls);
        /* create message collection */
        manager.createMessageCollection("UserZ", msgColl, "1");
        Set<String> fields = new HashSet<String>();
        fields.add("id");
        fields.add("TITLE");
        fields.add("total");
        fields.add("unread");
        fields.add("updated");
        fields.add("urls");
        /* get message collection */
        MessageCollection[] result1 = manager.getMessageCollections("UserZ", fields, null);
        assertNotNull(result1);
        assertEquals(1, result1.length);
        assertEquals(new Integer(10), result1[0].getTotal());
        assertNotNull(result1[0].getTitle());
        assertEquals("inbox", result1[0].getTitle());
        assertNotNull(result1[0].getId());
        assertNotNull(result1[0].getUnread());
        assertNotNull(result1[0].getUpdated());
        assertEquals(msgColl.getUpdated(), result1[0].getUpdated());
        msgColl.setTitle("All Messages");
        msgColl.setUnread(2);
        /* modify message collection */
        manager.modifyMessageCollection("UserZ", msgColl, "1");
        result1 = manager.getMessageCollections("UserZ", fields, null);
        assertNotNull(result1);
        assertEquals(1, result1.length);
        assertEquals(new Integer(10), result1[0].getTotal());
        assertNotNull(result1[0].getTitle());
        assertEquals("All Messages", result1[0].getTitle());
        assertNotNull(result1[0].getId());
        assertNotNull(result1[0].getUnread());
        assertEquals(new Integer(2), result1[0].getUnread());
        assertNotNull(result1[0].getUpdated());
        assertEquals(msgColl.getUpdated(), result1[0].getUpdated());
        /* delete message collection */
        manager.deleteMessageCollection("UserZ", "1");
        result1 = manager.getMessageCollections("UserZ", fields, null);
        assertNull(result1);
    }
View Full Code Here

Examples of org.wso2.carbon.registry.social.api.message.MessageCollection

    // modifyMessage()
    // deleteMessage()
    public void testMessages() throws Exception {
        manager = new MessageManagerImpl();
        manager.setRegistry(registry);
        MessageCollection msgColl = new MessageCollectionImpl();
        msgColl.setTitle("inbox");
        msgColl.setUnread(3);
        msgColl.setUpdated(new Date());
        msgColl.setId("1");
        msgColl.setTotal(10);
        /* create message */
        manager.createMessageCollection("UserA", msgColl, "1");
        Message message1 = new MessageImpl();
        message1.setId("1");
        message1.setTitle("Test Message");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.