Package com.restfb.types

Examples of com.restfb.types.Post$Property


    expect(
        mockFbClient.publishObject(connection, FacebookType.class,
            arrayParams)).andReturn(mockFbType);
    expect(mockFbType.getId()).andReturn(POST_FBID);

    Post expectedPost = loadObjectFromJSON("/examples/post.json",
        Post.class);
    expect(mockFbClient.getFacebookObjectByID(POST_FBID, Post.class))
        .andReturn(expectedPost);
    // post comments
    expect(
View Full Code Here


  }

  public void testGetContent() throws IOException {
    String contentUrl = "facebook/accessTokenKey/fbid/post";

    Post expectedPost = loadObjectFromJSON("/examples/post.json",
        Post.class);

    // expected behavior
    // expect(mockFactory.createFacebookAPIClient(EasyMock.anyObject(String.class))).andReturn(mockFbClient);
    expect(mockFbClient.getFacebookObjectByID("fbid", Post.class))
View Full Code Here

        // Check if the post (to which the notification refers to) is
        // mine
        String[] linkPathSplitted = notif.getLink().split("/");
        String postId = notif.getTo().getId() + "_"
            + linkPathSplitted[linkPathSplitted.length - 1];
        Post p = facebookClient.fetchObject(postId, Post.class);
        if (p == null) {
          // If the post is not mine then 'p' is null and we jump to
          // the next notification
          continue;
        }
        // Get comment id
        String comment_id = getCommentId(p, notif);
        /*
         * We don't handle when comment_id is null, that would mean one
         * of two: a) the information of the notification is wrong. b)
         * we are retrieving wrongly the post id from the notification
         * information.
         */
        // Get replier's screen name
        String replierScreenName = facebookClient.fetchObject(
            notif.getFrom().getId(), User.class).getUsername();
        // Construct facebook post object and return
        FacebookMention fbp = new FacebookMention(comment_id.toString(),
            notif.getMessage(), replierScreenName, notif
                .getCreatedTime().getTime(), p.getId());
        postReplies.add(fbp);
        Boolean publishMessageResponse = facebookClient.publish(
            notif.getId(), Boolean.class,
            Parameter.with("unread", "0"));
        if (publishMessageResponse == false) {
View Full Code Here

  @Override
  public Long getTime(String mentionId) {
    LOG.info("Start getTime");
    Long time = null;
    if (mentionId != null) {
      Post p = facebookClient.fetchObject(mentionId, Post.class);
      if (p == null) {
        Comment c = facebookClient
            .fetchObject(mentionId, Comment.class);
        if (c == null) {
          LOG.info("Facebook object [" + mentionId
              + "] is not a valid post/comment");
        } else {
          LOG.info("Facebook object [" + mentionId + "] is comment");
          time = c.getCreatedTime() == null ? null : c
              .getCreatedTime().getTime() / 1000L;
        }
      } else {
        LOG.info("Facebook object [" + mentionId + "] is post");
        time = p.getCreatedTime() == null ? null : p.getCreatedTime()
            .getTime() / 1000L;
      }
    }
    LOG.info("End getTime");
    return time;
View Full Code Here

        StringBuffer url = request.getRequestURL().replace(index, request.getRequestURL().length(), newContext);
        applicationController.subscribeUserAndCreateStatistic(Long.valueOf(applicationVersionId), request);

        String itmsURL = "itms-services://?action=download-manifest&url=" + url.toString();

        Property property = new Property();
        property.setKey("URL");
        property.setValue(itmsURL);

        return property;
    }
View Full Code Here

    @RequestMapping(value = "/statistics", method = RequestMethod.GET, produces = contentType)
    public
    @ResponseBody
    Properties viewSystemManagementPage(HttpServletRequest request) {
        Property[] properties = new Property[3];
        properties[0] = new Property(SystemStatistics.ORGANIZATION_COUNT.name(), Long.toString(organizationService.countAll()), SystemStatistics.ORGANIZATION_COUNT.getDescription());
        properties[1] = new Property(SystemStatistics.USER_COUNT.name(), Long.toString(userService.countAll()), SystemStatistics.USER_COUNT.getDescription());
        properties[2] = new Property(SystemStatistics.APPLICATION_COUNT.name(), Long.toString(applicationService.countAll()), SystemStatistics.APPLICATION_COUNT.getDescription());

        Properties props = new Properties();
        props.setProperties(properties);

        return props;
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.PROPERTY: {
            Property property = (Property) theEObject;
            T result = caseProperty(property);
            if (result == null)
                result = caseItemAwareElement(property);
            if (result == null)
                result = caseBaseElement(property);
View Full Code Here

                    MetafacadeConstants.NAMESPACE_SCOPE_OPERATOR,
                    true);
            if (modelElement instanceof Type)
            {
                Type element = (Type)modelElement;
                final Property property = umlClass.createOwnedAttribute(
                        name,
                        element,
                        1,
                        1);
                VisibilityKind kind = VisibilityKind.PUBLIC_LITERAL;
                if (visibility.equalsIgnoreCase("package"))
                {
                    kind = VisibilityKind.PACKAGE_LITERAL;
                }
                if (visibility.equalsIgnoreCase("private"))
                {
                    kind = VisibilityKind.PRIVATE_LITERAL;
                }
                if (visibility.equalsIgnoreCase("protected"))
                {
                    kind = VisibilityKind.PROTECTED_LITERAL;
                }
                property.setVisibility(kind);
                Stereotype stereotype =
                    UmlUtilities.findApplicableStereotype(
                        property,
                        UMLProfile.STEREOTYPE_IDENTIFIER);
                if (stereotype == null)
                {
                    throw new MetafacadeException("Could not apply '" + UMLProfile.STEREOTYPE_IDENTIFIER + "' to " +
                        property + ", the stereotype could not be found");
                }
                property.apply(stereotype);
            }
        }
    }
View Full Code Here

    public boolean equals(final Object obj)
    {
        if (obj instanceof Attribute)
        {
            Property other = ((AttributeImpl)obj).property;
            return this.property.equals(other);
        }
        if (obj instanceof AssociationEnd)
        {
            Property other = ((AssociationEndImpl)obj).property;
            return this.property.equals(other);
        }
        return this.property.equals(obj);
    }
View Full Code Here

        for (final Iterator memberIterator = members.iterator(); memberIterator.hasNext();)
        {
            final Object nextCandidate = memberIterator.next();
            if (nextCandidate instanceof Property)
            {
                final Property property = (Property)nextCandidate;

                if (property.getAssociation() == null)
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("Attribute found for " + classifier.getName() + ": " + property.getName());
                        if (attributeMap.containsKey(property.getName()))
                        {
                            logger.warn(
                                "An attribute with this name has already been registered, overriding: " +
                                property.getName());
                        }
                    }

                    // property represents an association end
                    attributeMap.put(
                        property.getName(),
                        property);
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.restfb.types.Post$Property

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.