Package org.corrib.s3b.sscf.manage

Examples of org.corrib.s3b.sscf.manage.XfoafSscfResource


      Float _level, int _distance) {
    // check if resource is directory &&if setter is owner
    int distance = _distance;
    Float level = _level;
   
    XfoafSscfResource xfsr = XfoafSscfResource
        .getXfoafSscfResource(resource);
    if (xfsr.isDirectory() && setter.equals(xfsr.getIssuedBy())) {
      if (distance > 8)
        distance = 8;
      if (distance <= 0)
        distance = 1;
      if (level >= 0F && level <= 1F) {
        level += distance;
        String realm = "F[" + setter.getMbox().toString() + "]" + level;
        xfsr.addAccessibleTo(realm);
      } else if (level == -1F) {
        String realm = "F[" + setter.getMbox().toString() + "]1.A";
        xfsr.addAccessibleTo(realm);
      } else {
        return -1;
      }
      return 0;
    }
View Full Code Here


   *
   * @param resourceUri evaluated resource
   * @return
   */
  public static Integer getEvaluationsNo(String resourceUri) {
    XfoafSscfResource resource = XfoafSscfResource.getXfoafSscfResource(resourceUri);
    return new Integer(resource.getEvaluationsNo());
  }
View Full Code Here

   *
   * @param resourceUri evaluated resource
   * @return
   */
  public static Float getAvgEvaluation(String resourceUri) {
    XfoafSscfResource resource = XfoafSscfResource.getXfoafSscfResource(resourceUri);
    Float avgRating = new Float(resource.getEvaluation());
    System.out.println("avg evaluation: "+avgRating);
    return (Float.isNaN(avgRating)) ? new Float(0) : avgRating;
  }
View Full Code Here

   * @param resourceUri evaluated resource
   * @param authorMbox of one who evaluated that resource
   * @return
   */
  public static Float getPersonEvaluation(String resourceUri, String authorMbox) {
    XfoafSscfResource resource = XfoafSscfResource.getXfoafSscfResource(resourceUri);
    Person person = PersonFactory.findPerson(authorMbox);
    if (person == null) {
      person = PersonFactory.createPerson(authorMbox,null,false);
    }
    Float personRating = new Float(resource.getEvaluation(person));
    return (Float.isNaN(personRating)) ? new Float(0) : personRating;
  }
View Full Code Here

   * @param matchAll
   * @return
   */
  public Float getPersonWhithinEvaluation(String resourceUri, String authorMbox,
      int maxDist, float minLevel,boolean matchAll) {
    XfoafSscfResource resource = XfoafSscfResource.getXfoafSscfResource(resourceUri);
    Person person = PersonFactory.findPerson(authorMbox);
    if (person == null) {
      person = PersonFactory.createPerson(authorMbox, null, false);
    }
   
    Float personRating = new Float(resource.getEvaluation(person,maxDist,minLevel,matchAll));
    return (Float.isNaN(personRating)) ? new Float(0) : personRating;
  }
View Full Code Here

    Iterator<XResource> it = parent.listContent();
    List<String> urisIn = new ArrayList<String>()// list of resource uris that were already processed.
                            // used to filter for duplicate resources
    while(it.hasNext()){
      XResource childBr = it.next();
      XfoafSscfResource xres= XfoafSscfResource.getXfoafSscfResource(childBr.getStringURI());
      //recursive call to fetch bookmarks stored in subDirectory
      if(xres != null && xres.isDirectory()){
        result.addAll(loadPosts(xres));
      }else if(xres != null){
        if(!urisIn.contains(xres.getURI().toString())){
          WebBookmarkResource childWbr = WebBookmarkResource.getWebBookmarkResource(xres.getURI().toString());
          urisIn.add(childWbr.getURI().toString());
          String[] tags = extractWebBookmarkResourceTags(childWbr);
          String wbrURI = childWbr.getSeeAlso().toString();
          //don't add resources marked as IGNORED
          if(!SynchronizationState.IGNORED.equals(childWbr.getSynchronizationState())){
View Full Code Here

      tags.add(tag);
   
    Iterator<XfoafSscfResource> isIn = wbr.listIsIn();
    //go through all parent directories and get their domains
    while(isIn.hasNext()){
      XfoafSscfResource parent = isIn.next();
      SscfDomain domain = SscfDomain.getSscfDomain(parent.getURI().toString());
      if(domain != null){
        List<TaxonomyEntry> taxList = domain.getClassification();
        List<ThesaurusEntry> thesList = domain.getWordNetClassification();
 
        //add taxonomy description tags
View Full Code Here

    //String servAddr =
    StringBuilder sb = new StringBuilder();
    //sb.append(SscfAjax.getServiceAddr(req)).append("/directory/").append(id);
    //id is now the whole uri
    String resUri = id;
    XfoafSscfResource xfsr = XfoafSscfResource.getXfoafSscfResource(resUri);
   
    if(xfsr!=null)
    {
      sb.setLength(0);
      String labelOfFeed = xfsr.getLabel();
      int type = 0; //1 for user feed;
     
      System.out.println(resUri);
     
      //in case we have top-level - user feed
      if(xfsr.getId().length()<=8)
      {
        Person p = PersonFactory.findPerson(resUri);
        if(p!=null) {
          System.out.println(p.getName());
          labelOfFeed = p.getName();
          type = 1;
        }
      }
     
      feed.setTitle(getFeedTitle(labelOfFeed, req.getLocalName(), rb, type));
   
      //TODO: - resUri may point to different server/system
      feed.setLink(resUri);
      feed.setDescription(getFeedTitle(labelOfFeed, req.getLocalName(), rb, type)); //TODO
 
      //get the changes
      ChangelogDbHandler cdh = ChangelogDbHandler.getInstance();
      List<ChangeBean> changes = new ArrayList<ChangeBean>();
      List<SyndEntry> entries = new ArrayList<SyndEntry>();
     
      if(cdh!=null)
      {
        changes = cdh.getLastChanges(resUri, numOfChanges);
      }
     
      for(ChangeBean change:changes)
      {
        SyndEntry entry;
        SyndContent description;
   
        entry = new SyndEntryImpl();
        XfoafSscfResource changeRes = null;
        XfoafSscfResource changedRes = null;
       
        changedRes = XfoafSscfResource.getXfoafSscfResource(change.getChangedUri());
        if((change.getChangeType()==ChangeTypes.ADDED.getChangeType()
            ||change.getChangeType()==ChangeTypes.REMOVED.getChangeType())
            &&change.getChangeUri()!=null)
View Full Code Here

      innerModel.addStatement(null,innerModel.createURI(uri), innerModel.createURI(S3B_SSCF.isIn), innerModel.createURI(ownerMbox));
    }
    catch (Exception e)
    {
      //if the inserting is failed, removed just created resource
      XfoafSscfResource xfsr = XfoafSscfResource.getXfoafSscfResource(uri,innerModel);
      if(xfsr!=null)
        bh.removeResource(xfsr, person);
    }
   
    return uri;
View Full Code Here

          if(p!=null) {
            labelOfFeed = p.getName();
          }
        }
        else {
          XfoafSscfResource xfsr = XfoafSscfResource.getXfoafSscfResource(feed.getDirid());
          labelOfFeed = xfsr.getLabel();
        }
       
       
       
        String lang = feed.getLang();
        Locale locale = new Locale(lang);
        ResourceBundle rb = ResourceBundle.getBundle("org.corrib.s3b.i18n.feed", locale);

        XfoafSscfResource changeRes = null;
        XfoafSscfResource changedRes = null;
       
        changedRes = XfoafSscfResource.getXfoafSscfResource(change.getChangedUri());
        if((change.getChangeType()==ChangeTypes.ADDED.getChangeType()
            ||change.getChangeType()==ChangeTypes.REMOVED.getChangeType())
            &&change.getChangeUri()!=null)
View Full Code Here

TOP

Related Classes of org.corrib.s3b.sscf.manage.XfoafSscfResource

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.