Package com.iqser.core.model

Examples of com.iqser.core.model.Attribute


  public void testPerformActionPostContent() throws IQserTechnicalException, IOException {
    //create facebook note
    String contentUrl = URLUtils.makeContentURL("122788341354", "note");
    Content content = createDummyContentFromUrl(contentUrl);
    content.addAttribute(new Attribute("subject", "note subject", Attribute.ATTRIBUTE_TYPE_TEXT));
    content.addAttribute(new Attribute("message", "note message", Attribute.ATTRIBUTE_TYPE_TEXT));
   
    //check if documents exists in object graph
    assertTrue(repo.getContentByProvider(fbcp.getId(), true).size() == 0);
       
    //expected behavior
View Full Code Here


  public boolean canExecuteAction(String user, String password, String action,
      Content content) throws IQserSecurityException {
    if (FacebookContentProvider.ACTION_DELETE.equals(action)){
     
      for (String ownerAttrName : getOwnerAttributeName()) {
        Attribute attr = content.getAttributeByName(ownerAttrName);
        if (attr!=null){
          //obtain owner id - the facebook id of the content creator
          String value = attr.getValue();
          //obtain facebook user id associated with current user
          String fbUserId = getUserFbId().get(user);
          return ! StringUtils.isEmpty(fbUserId) && StringUtils.equals(fbUserId, value);
        }
      }
View Full Code Here

   * @param name attribute name
   * @param value attribute value
   */
  protected void addAttribute(Content content, String name, String value){
    if (value != null)
      content.addAttribute(new Attribute(name, value, Attribute.ATTRIBUTE_TYPE_TEXT, true));
  }
View Full Code Here

   * @param values attribute values
   */
  protected void addMVAttribute(Content content, String name, List<String> values){
    if ( values.isEmpty()) return;
   
    Attribute mva = new Attribute();
    mva.setMultiValue(true);
    mva.setName(name);
    mva.setType(Attribute.ATTRIBUTE_TYPE_TEXT);   
   
    for (String v : values) {
      mva.addValue(v);
    }     
         
    content.addAttribute(mva);
  }   
View Full Code Here

       
    assertEquals(0, repo.getContentByProvider(fbcp.getId()).size());
   
    Content noteContent = new Content();
    noteContent.setContentUrl(URLUtils.makeContentURL("noIdYet", "note"));
    noteContent.getAttributes().add(new Attribute("subject","My test note",Attribute.ATTRIBUTE_TYPE_TEXT));
    noteContent.getAttributes().add(new Attribute("message","Check out this funny article",Attribute.ATTRIBUTE_TYPE_TEXT));
           
    builder.performAction(FacebookContentProvider.ACTION_POST, noteContent);
   
    String fbid = URLUtils.getFbId(noteContent.getContentUrl());
   
View Full Code Here

  public void testPerformAction() throws IQserTechnicalException{
    assertEquals(0, repo.getContentByProvider(fbcp.getId()).size());
   
    Content noteContent = new Content();
    noteContent.setContentUrl(URLUtils.makeContentURL("noIdYet", "note"));
    noteContent.getAttributes().add(new Attribute("name","My post name",Attribute.ATTRIBUTE_TYPE_TEXT));
    noteContent.getAttributes().add(new Attribute("message","Check out this funny article",Attribute.ATTRIBUTE_TYPE_TEXT));   
           
    builder.performAction(FacebookContentProvider.ACTION_POST, noteContent);
   
    String fbid = URLUtils.getFbId(noteContent.getContentUrl());
   
View Full Code Here

  public void testPerformActionOnFriendWall() throws IQserTechnicalException{
    assertEquals(0, repo.getContentByProvider(fbcp.getId()).size());
   
    Content noteContent = new Content();
    noteContent.setContentUrl(URLUtils.makeContentURL("noIdYet", "note"));
    noteContent.getAttributes().add(new Attribute("name","My post name",Attribute.ATTRIBUTE_TYPE_TEXT));
    noteContent.getAttributes().add(new Attribute("message","Check out this funny article",Attribute.ATTRIBUTE_TYPE_TEXT));
    noteContent.getAttributes().add(new Attribute("from_id","543824877",Attribute.ATTRIBUTE_TYPE_TEXT));   
           
    builder.performAction(FacebookContentProvider.ACTION_POST, noteContent);
   
    String fbid = URLUtils.getFbId(noteContent.getContentUrl());
   
View Full Code Here

  public void testPerformPostAction() throws IQserTechnicalException {
    assertEquals(0, repository.getContentByProvider(contentProvider.getId()).size());
   
    Content statusContent = new Content();
    statusContent.setContentUrl(URLUtils.makeContentURL("noIdYet", "status"));
    statusContent.getAttributes().add(new Attribute("message","Random status message",Attribute.ATTRIBUTE_TYPE_TEXT));   
           
    statusBuilder.performAction(FacebookContentProvider.ACTION_POST, statusContent);
   
    String fbid = URLUtils.getFbId(statusContent.getContentUrl());
   
View Full Code Here

    long tomorrowX2 = System.currentTimeMillis() / 1000 + 60L * 60L * 48L;
   
    Content eventContent = new Content();
    eventContent.setContentUrl(URLUtils.makeContentURL("noIdYet", "event"));
    eventContent.getAttributes().add(
        new Attribute("name", "Random API Event",
            Attribute.ATTRIBUTE_TYPE_TEXT));
    eventContent.getAttributes().add(new Attribute("start_time", tomorrow + "", Attribute.ATTRIBUTE_TYPE_TEXT));
    eventContent.getAttributes().add(new Attribute("end_time", tomorrowX2 + "", Attribute.ATTRIBUTE_TYPE_TEXT));

    eventBuilder.performAction(FacebookContentProvider.ACTION_POST,
        eventContent);

    String fbid = URLUtils.getFbId(eventContent.getContentUrl());
View Full Code Here

    String message = "\u003cimg class=\"img\" src=\"http://photos-h.ak.fbcdn.net/hphotos-ak-snc1/5650_98675398379_6628568379_2126294_254285_a.jpg\" />\u003cimg class=\"img\" src=\"http://photos-c.ak.fbcdn.net/hphotos-ak-snc1/5650_98675293379_6628568379_2126292_547965_a.jpg\" />Facebook for iPhone 3.0 is coming very soon.  I can&#039;t predict an exact date when I will submit to Apple, but I can say that I am about 98\u0025 done.  So what&#039;s new in this update?\u003cBR />\u003cBR />1. The &quot;new&quot; News Feed\u003cBR />2. Like\u003cBR />3. Events (including the ability to RSVP)\u003cBR />4. Notes\u003cBR />5. Pages\u003cBR />6. Create new photo albums\u003cBR />7. Upload photos to any album\u003cBR />8. Zoom into photos\u003cBR />9. Easier photo tagging\u003cBR />10. Profile Pictures albums\u003cBR />11. A new home screen for easy access to all your stuff, search, and notifications\u003cBR />12. Add your favorite profiles and pages to the home screen\u003cBR />13. Better Notifications (they link to the comments so you can reply)\u003cBR />14. Quickly call or text people right from the Friends page\u003cBR />15. Messages you are typing will be restored if you quit or are interrupted by a phone call\u003cBR />\u003cBR />The one feature everyone is asking for, Push Notifications, is in development but it won&#039;t make it into 3.0.  You can expect it in a 3.1 update later this summer.\u003cBR />\u003cBR />When I have submitted the app to Apple I will let you all know!\u003cBR />\u003cBR />- Joe\u003cBR />";

    // create facebook post
    String contentUrl = URLUtils.makeContentURL(fbid, "note");
    Content content = createDummyContentFromUrl(contentUrl);
    content.addAttribute(new Attribute("subject", subject,
        Attribute.ATTRIBUTE_TYPE_TEXT));
    content.addAttribute(new Attribute("message", message,
        Attribute.ATTRIBUTE_TYPE_TEXT));

    // check if documents exists in object graph
    assertTrue(repo.getContentByProvider(providerID, true).size() == 0);
View Full Code Here

TOP

Related Classes of com.iqser.core.model.Attribute

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.