Examples of Community


Examples of com.ibm.sbt.services.client.connections.communities.Community

  @Ignore
  @Test
  public final void testGetUpdatesFromCommunity() throws ActivityStreamServiceException, ClientServicesException{
    //Ignored because a method in ActivityStreamService to post to a Community is unimplemented
    Community community = createTestCommunity();
    ActivityStreamEntityList updates = service
        .getUpdatesFromCommunity(community.getCommunityUuid());

    System.err.println("number of updates from community : " + updates.size());

    for (ActivityStreamEntity asentry : updates) {
      if (null != asentry.getCommunity()) { // Updates can also come in from news service, ignore
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Community

   * @param tags
   * @param retry
   * @return
   */
  public Community createCommunity(String title, String type, String content, ArrayList<String> tags, boolean retry) {
        Community community = null;
        try {
        CommunityService communityService = new CommunityService();
        long start = System.currentTimeMillis();
         community =  new Community(communityService, "");
         community.setTitle("Test Community 1ab" + System.currentTimeMillis());
         community.setContent("");
        community.setCommunityType("public");
        community.setTags(tags);
         community = community.save();
         long duration = System.currentTimeMillis() - start;
         Trace.log("Created test community: "+community.getCommunityUuid() + " took "+duration+"(ms)");
         } catch (ClientServicesException e) {
           System.out.println("Grid Setup Error: cannot create community");

           fail("Error creating test community", e);
        }
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Community

        return;
      }
     
        String duplicateTitle = "Duplicate Title - " + System.currentTimeMillis();
        String updatedContent = "Updated Content - " + System.currentTimeMillis();
        Community community2 = createCommunity(duplicateTitle, "public", "Content for duplicate test", "duplicate");
       
        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
        addSnippetParam("sample.communityTitle", duplicateTitle);
        addSnippetParam("sample.communityContent", updatedContent);
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Community

    return createCommunity(title, type, content, tags, true);
  }

  protected Community createCommunity(String title, String type,
      String content, String tags, boolean retry) {
    Community community = null;
    try {
      loginConnections();
      CommunityService communityService = getCommunityService();

      long start = System.currentTimeMillis();
      community = new Community(communityService, "");
      community.setTitle(title);
      community.setCommunityType(type);
      community.setContent(content);
      community.setTags(tags);
      String communityUuid = communityService.createCommunity(community);
      community = communityService.getCommunity(communityUuid);

      long duration = System.currentTimeMillis() - start;
      Trace.log("Created test community: " + communityUuid + " took "
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Community

        //Assert.assertEquals(invite.getContributor().getName(), json.getAsObject("getCommunityUuid").getAsString("name"));
        //Assert.assertEquals(invite.getContributor().getUserid(), json.getAsObject("getCommunityUuid").getAsString("userid"));
    }
   
    protected Community getLastCreatedCommunity() {
        Community community = null;
        try {
            CommunityService communityService = getCommunityService();
            Collection<Community> communities = communityService.getMyCommunities();
            community = communities.iterator().next();
            Trace.log("Last created community: "+community.getCommunityUuid());
            Trace.log("Last created community: "+community.getPublished());
            Iterator<Community> i = communities.iterator();
            while (i.hasNext()) {
              Community c= i.next();
              Trace.log("Last created community: "+c.getCommunityUuid());
              Trace.log("Last created community: "+c.getTitle());
              Trace.log("Last created community: "+c.getPublished());
            }
        } catch (ClientServicesException cse) {
            fail("Error getting last created community", cse);
        }
       
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Community

    protected Community getCommunity(String communityUuid) {
        return getCommunity(communityUuid, true);
    }
   
    protected Community getCommunity(String communityUuid, boolean failOnCse) {
        Community community = null;
        try {
         
           
            CommunityService communityService = getCommunityService();
            community = communityService.getCommunity(communityUuid);
            Trace.log("Got community: "+community.getCommunityUuid());
        } catch (ClientServicesException cse) {
          if (failOnCse) {
            fail("Error retrieving community", cse);
          }
        }
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Community

    protected Community createCommunity(String title, String type, String content, String tags) {
      return createCommunity(title, type, content, tags, true);
    }
   
    protected Community createCommunity(String title, String type, String content, String tags, boolean retry) {
        Community community = null;
        try {
            CommunityService communityService = getCommunityService();
           
          long start = System.currentTimeMillis();
            community = new Community(communityService, "");
            community.setTitle(title);
            community.setCommunityType(type);
            community.setContent(content);
            community.setTags(tags);
            String communityUuid = communityService.createCommunity(community);
            community = communityService.getCommunity(communityUuid);
           
            long duration = System.currentTimeMillis() - start;
            Trace.log("Created test community: "+communityUuid + " took "+duration+"(ms)");
View Full Code Here

Examples of com.ibm.sbt.services.client.connections.communities.Community

    }
    }
   
    protected void createCommunityWithTags(String tags) {
      CommunityService communityService = new CommunityService();
      Community community = null;
      try{
      community = new Community(communityService, "");
      community.setTitle(this.getClass().getName() + "#" + this.hashCode() + " Community - " + System.currentTimeMillis());
      community.setContent("Test Community created to test Activity Streams");
      community.setTags(tags);
      String communityId = communityService.createCommunity(community);
      }catch(ClientServicesException cse){
        assertNull("CommunityServiceException in testing SearchByFilters");
      }
    }
View Full Code Here

Examples of cross.reputation.model.Community

   
    //Set All Model
    ConfigureModel.buildCrossReputationGlobalModel();
   
    //Set the destination community to import the other community reputations
    Community destinationCommunity = GlobalModel.getCommunities().get("semanticWiki");
   
    //Add all entities configured to all metrics in the destination community
    for(Entity entity : ConfigureModel.SetWikiUserEntitiesAndAccounts()) {
      destinationCommunity.addEntityToAllMetrics(entity);
    }
   
    //Set that all rest communities and theirs metrics are valid to the importation
    List<CommunityMetricToImport> metricsToImport = ConfigureModel.
      buildMetricsFromAllCommunitiesToAllMetrics(destinationCommunity);
View Full Code Here

Examples of cross.reputation.model.Community

   
    GlobalModel.addScale(new NumericScale("stackOverflowScale",30000.0,0.0,1.0));
    GlobalModel.addMetric(new Metric("stackOverflowMetric", reputationInQandA,
        GlobalModel.getScales().get("stackOverflowScale")));
    String stackOverflowCategories[] = {qandACategory};
    GlobalModel.addCommunity(new Community("stackoverflow.com","stackoverflow.com",
        stackOverflowCategories,GlobalModel.getMetrics().get("stackOverflowMetric")));   
   
    GlobalModel.addScale(new NumericScale("serverFaultScale",20000.0,0.0,1.0));
    GlobalModel.addMetric(new Metric("serverFaultMetric", reputationInQandA,
        GlobalModel.getScales().get("serverFaultScale")));
    String serverFaultCategories[] = {qandACategory};
    GlobalModel.addCommunity(new Community("serverfault.com","serverfault.com",
        serverFaultCategories,GlobalModel.getMetrics().get("serverFaultMetric")));
       
    GlobalModel.addScale(new NumericScale("webAppsStackExchangeScale",20000.0,0.0,1.0));
    GlobalModel.addMetric(new Metric("webAppsStackExchangeMetric", reputationInQandA,
        GlobalModel.getScales().get("webAppsStackExchangeScale")));
    String webAppsStackExchangeCategories[] = {qandACategory};
    GlobalModel.addCommunity(new Community("webapps.stackexchange.com","webapps.stackexchange.com",
        webAppsStackExchangeCategories,GlobalModel.getMetrics().get("webAppsStackExchangeMetric")));
       
    GlobalModel.addScale(new NumericScale("questionsSecuritytubeScale",20000.0,0.0,1.0));
    GlobalModel.addMetric(new Metric("questionsSecuritytubeMetric", reputationInQandA,
        GlobalModel.getScales().get("questionsSecuritytubeScale")));
    String questionsSecuritytubeCategories[] = {qandACategory};
    GlobalModel.addCommunity(new Community("questions.securitytube.net","questions.securitytube.net",
        questionsSecuritytubeCategories,GlobalModel.getMetrics().get("questionsSecuritytubeMetric")));
       
    GlobalModel.addScale(new NumericScale("security.StackexchangeScale",2000.0,0.0,1.0));
    GlobalModel.addMetric(new Metric("security.StackexchangeMetric", reputationInQandA,
        GlobalModel.getScales().get("security.StackexchangeScale")));
    String securityStackexchangeCategories[] = {qandACategory};
    GlobalModel.addCommunity(new Community("security.stackexchange.com","security.stackexchange.com",
        securityStackexchangeCategories,GlobalModel.getMetrics().get("security.StackexchangeMetric")));
   
    GlobalModel.addScale(new NumericScale("semanticWikiScale",10.0,0.0,1.0));
    GlobalModel.addMetric(new Metric("semanticWikiMetric", reputationInQandA,
        GlobalModel.getScales().get("semanticWikiScale")){
      public Object aggregateValues(Map<CommunityMetricToImport,Object> values) {
        Object total = null;
        int sum = 0;
        for(CommunityMetricToImport comMetToImp: values.keySet()) {
          if(comMetToImp.getCommunity() ==
              GlobalModel.getCommunities().get("ohloh.net")) {
            if(total != null) {
              total = getScale().mulValues(total,values.get(comMetToImp),0.1/0.9);
            } else {
              total = values.get(comMetToImp);
            }
            if(sum == 0) {
              sum = 1;
            }
            //System.out.println("new total in mul:"+total);
          }                   
        }
        for(CommunityMetricToImport comMetToImp: values.keySet()) {
          if(comMetToImp.getCommunity() ==
            GlobalModel.getCommunities().get("ohloh.net")) {
            continue;
          }
          //System.out.println("total:"+total+" next value to sum:"+values.get(comMetToImp));         
          total = getScale().sumValues(total, values.get(comMetToImp));
          sum++;
        }       
        //return doAverage(total,sum);
        return total;
      }
    });   
    String semanticWikiCategories[] = {securityWebAppCategory};
    Community wiki = new Community("semanticWiki","lab.gsi.dit.upm.es/semanticwiki",
        semanticWikiCategories,GlobalModel.getMetrics().get("semanticWikiMetric"));
   
    String ohlohCategories[] = {projectConnCategory};   
    Set<Metric> ohlohMetrics = new HashSet<Metric>();
    GlobalModel.addScale(new NumericScale("ohlohKudoScale",10.0,0.0,1.0));
    Metric ohlohKudoMetric = GlobalModel.addMetric(new Metric("ohlohKudoMetric",
        projectsReputation,GlobalModel.getScales().get("ohlohKudoScale")));
    ohlohMetrics.add(ohlohKudoMetric)
    GlobalModel.addScale(new NumericScale("ohlohRankScale",450000.0,0.0,1.0));
    Metric ohlohRankMetric = GlobalModel.addMetric(new Metric("ohlohRankMetric", rankReputation,
        GlobalModel.getScales().get("ohlohRankScale")));
    ohlohMetrics.add(ohlohRankMetric);   
    GlobalModel.addCommunity(new Community("ohloh.net","ohloh.net",
        ohlohCategories,ohlohMetrics));
   
    GlobalModel.addScale(new NumericScale("slackersScale",10.0,0.0,1.0));
    GlobalModel.addMetric(new Metric("slackersMetric", reputationInQandA,
        GlobalModel.getScales().get("slackersScale")));
    String slackersCategories[] = {GlobalModel.addCategory("QandA")};
    GlobalModel.addCommunity(new Community("sla.ckers.org","sla.ckers.org",
        slackersCategories,GlobalModel.getMetrics().get("slackersMetric")));
   
   
    GlobalModel.addCommunity(wiki);
   
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.