Package org.corrib.s3b.sscf.manage

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


    if(results!=null){
      for(QueryRow qr: results) {
       
        String uri = qr.getValue(results.getVariables().get(0)).toString();
       
        XfoafSscfResource xfsr = XfoafSscfResource.getXfoafSscfResource(uri);
        if(xfsr!=null)
          xfsr.remove();
      }
    }
   
    resp.setContentType("text/html");
    PrintWriter writer = resp.getWriter();
View Full Code Here


          ChangeBean ch = new ChangeBean();
          ch.setChangedUri(st.getObject().toString());
          ch.setChangeType(ChangeTypes.SUG_ADDED.getChangeType());
          ch.setChangeUri(st.getSubject().toString());
          //get label of the change...
          XfoafSscfResource xf = XfoafSscfResource.getXfoafSscfResource(st.getSubject().toString());
          String label = xf.getLabel();
          if(label!=null)
            ch.setChangeValue(label);
         
          addedTriples.add(ch);
        }
View Full Code Here

   *
   * @param resourceUri
   * @return
   */
  public static List<SiocPostBean> getRootPosts(String resourceUri) {
    XfoafSscfResource resource = XfoafSscfResource.getXfoafSscfResource(resourceUri);
    PostedResource postedResource = PostedResource.create(resource.getStringURI());
   
    return postedResource.getRootPosts();
   
  }
View Full Code Here

   * Calculates the number of all posts on given resource
   * @param resourceUri
   * @return
   */
  public static int getAllPostsNo(String resourceUri) {
    XfoafSscfResource resource = XfoafSscfResource.getXfoafSscfResource(resourceUri);
    PostedResource postedResource = PostedResource.create(resource.getStringURI());
    List<SiocPostBean> posts = postedResource.getRootPosts();
   
    int postNo = 0;
    for (SiocPostBean post : posts) {
      postNo += post.getRepliesNo();
View Full Code Here

   * @param root
   * @return list of valid resources
   */
  public List<XfoafSscfResource> getValidResourceContent(String uri,
      Person viewer) {
    XfoafSscfResource resource = XfoafSscfResource.getXfoafSscfResource(uri);
    Iterator<XResource> it = resource.listContent();
    List<XfoafSscfResource> ret = new ArrayList<XfoafSscfResource>();

    while (it.hasNext()) {
      XResource br = it.next();
      if(br instanceof XfoafSscfResource)
      {
        XfoafSscfResource res = (XfoafSscfResource)br;
        if (viewer != null) {
          if (checkCredit(viewer, res)) {
            ret.add(res);
          }
        } else
View Full Code Here

   * @return JSON representation of the directory description
   */
  @SuppressWarnings("unchecked")
  public DirectoryDescription getDirectoryDescriptionObject(String uri)
  {
    XfoafSscfResource xsscf = XfoafSscfResource.getXfoafSscfResource(uri);
    SscfDomain xsscfDom = SscfDomain.getSscfDomain(uri);
   
    List<ThesaurusEntry> thesClassList = xsscfDom.getWordNetClassification();
    //List<DdcClassification> ddcClassList = xsscfDom.getDdcClassification();
    List<TaxonomyEntry> taxClassList = xsscfDom.getClassification();
   
    if(xsscf!=null)
    {
      DirectoryDescription dd = new DirectoryDescription();
     
      //Get name and description
      dd.setName(xsscf.getLabel());
      dd.setDescription(xsscf.getComment());
      XResource xfr = xsscf.getIssuedBy();
      if(xfr instanceof Person) {
        Person tmp = (Person)xfr;
        dd.setOwner(tmp.getName());
      }
     
View Full Code Here

  public String getDirectoryPolicies(String uri)
  {
    DirectoryPolicy dp = new DirectoryPolicy();
    List<String> policies = new ArrayList<String>();
   
    XfoafSscfResource resource = XfoafSscfResource.getXfoafSscfResource(uri);
   
    if(resource!=null)
    {
      Iterator<String> itacl = resource.listAccessibleTo();
      while(itacl.hasNext())
        policies.add(itacl.next());
    }
    dp.setPolicies(policies);
   
View Full Code Here

    if((initialLevel==0||filter)&&root!=null)
      bookmarksTree(persons.iterator(), buffer, viewer, depth, session,initialLevel,false,standalone,false,true,serviceAddr,selectedUri,/*pathsToUri*/null);
    //generate only the part of the tree, starting with resource (without this resource)
    else if(initialLevel>=1&&!paste)
    {
      XfoafSscfResource xsscf = XfoafSscfResource.getXfoafSscfResource(resource.getStringURI());
      boolean parentIsOwnerInternal = parentIsOwner;
      boolean issuerEqualsViewer = false;
      if(xsscf.getIssuedBy()!=null&&xsscf.getIssuedBy().equals(viewer))
        issuerEqualsViewer = true;
      if(issuerEqualsViewer) parentIsOwnerInternal = true;
      treeContent(xsscf, buffer, viewer, depth, session, initialLevel,parentIsOwnerInternal,standalone,issuerEqualsViewer,false,serviceAddr,selectedUri,/*pathsToUri*/null);
    }
    //generate only the part of the tree, starting with resource (with this resource) - used for pasting and inserting
    else if(initialLevel>=1&&paste)
    {
      //need to get a type.
      if(type!=null)
      {
        if(type.equals(SIOC.Site))
        {
          SiocSiteResource site = SiocSiteResource.getInstance(resource.getStringURI());
          bookmarksTreeSiocData(site, viewer, buffer, depth, session, null, initialLevel, true,standalone,true,selectedUri,null);
        }
        if(type.equals(SIOC.Forum))
        {
          SiocForumResource forum = SiocForumResource.getInstance(resource.getStringURI());
          bookmarksTreeSiocData(forum, viewer, buffer, depth, session, null, initialLevel, true,standalone,true,selectedUri,null);
        }
        if(type.equals(SIOC.Post))
        {
          SiocPostResource post = SiocPostResource.getInstance(resource.getStringURI());
          bookmarksTreeSiocData(post, viewer, buffer, depth, session, null, initialLevel, true,standalone,true,selectedUri,null);
       
        if(type.equals(S3B_SSCF.WebResource))
        {
          WebBookmarkResource wbr = WebBookmarkResource.getWebBookmarkResource(resource.getStringURI());
          bookmarksTreeWebResource(wbr, viewer, buffer, initialLevel, true, standalone, true, selectedUri);
        }
        if(type.equals(S3B_SSCF.HexResource))
        {
          WebBookmarkResource wbr = WebBookmarkResource.getWebBookmarkResource(resource.getStringURI());
          bookmarksTreeHexResource(wbr, viewer, buffer, initialLevel, true, standalone, true,selectedUri);
        }
      }
      else
      {
        XfoafSscfResource xsscf = XfoafSscfResource.getXfoafSscfResource(resource.getStringURI());
        bookmarksTreeSscfResource(xsscf, viewer, buffer, depth, session, null, initialLevel, true,standalone,false,true,serviceAddr,null,/*pathsToUri*/null);
      }
    }
    //this is the case when new friend is added to the tree.
    else if(initialLevel==0&&root==null)
View Full Code Here

          onPath = true;
      }
     
      if(maxAbsoluteLevel>0||onPath)
      {       
        XfoafSscfResource xsscf = XfoafSscfResource.getXfoafSscfResource(person.getURI().toString());
     
        boolean hasCont = xsscf.hasContent();
       
        level++;
       
        NodeContainer nc = new NodeContainer();
        nc.setDyn(hasCont&!own);
View Full Code Here

    if (depth == null || depth.intValue() > 0) {
     
      //list content of xfoafsscfresource
      if(resource instanceof XfoafSscfResource)
      {
        XfoafSscfResource xfr = XfoafSscfResource.getXfoafSscfResource(resource.getStringURI());
        Iterator<? extends XResource> it = xfr.listContent();
        this.bookmarksTree(it, buffer, viewer, depth, session, level,parentIsOwner,standalone,false,inOwn,serviceAddr,selectedUri,pathsToUri);
      }
      //list content of siocdataresource
      else if (resource instanceof SiocDataResource) {
        SiocDataResource sdr = (SiocDataResource) resource;
        Iterator<? extends XResource> it = sdr.listContent();
        this.bookmarksTree(it, buffer, viewer, depth, session, level,parentIsOwner,standalone,false,inOwn,serviceAddr,selectedUri,pathsToUri);
     
       
      //suggested directories and bookmarks.
      if(inOwn&&resource instanceof XfoafSscfResource)
      {
        XfoafSscfResource xfr = XfoafSscfResource.getXfoafSscfResource(resource.getStringURI());
        Iterator<? extends XResource> it2 = xfr.listSuggestedContent();
        //create the virtual node - "additional suggested directory"
        if(it2!=null&&it2.hasNext()&&afterTheOwner)
        {
          NodeContainer nc = new NodeContainer();
          nc.setType("addDirectory");
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.