hasContent = sfr.hasContent();
nc.setType("siocForum");
DirectoryNode dn = new DirectoryNode();
dn.setId(sfr.getStringURI());
dn.setLevel(level);
if(sfr.getName()!=null&&!"".equals(sfr.getName()))
dn.setLabel("Forum: "+sfr.getName());
else if(sfr.getTitle()!=null&&!"".equals(sfr.getTitle()))
dn.setLabel("Forum: "+sfr.getTitle());
else dn.setLabel("Forum: "+sfr.getStringURI());
dn.setOwn(isOwner);
//TODO - get owner from this tags
//dn.setOwnerMbox((owner != null) ? (owner.getMbox().toString()) : "");
//dn.setOwnerName((owner != null) ? (owner.getName()) : "");
dn.setOwnerMbox("");
dn.setOwnerName("");
dn.setRemovable(!hasContent);
dn.setLinkedIn(parentIsOwner&!isOwner);
//check if user select this directory - we can get id or whole uri.
if(selectedUri!=null&&!"".equals(selectedUri.trim())&&selectedUri.length()>=40)
{
if(resource.getStringURI().equals(selectedUri)||
resource.getStringURI().endsWith(selectedUri.substring(selectedUri.length()-40,selectedUri.length())))
{
dn.setSelected(true);
dn.setOpened(false);
}
else dn.setSelected(false);
}
dn.setStandalone(standalone);
nc.setContent(dn);
}
else if (resource instanceof SiocSiteResource) {
SiocSiteResource ssr = SiocSiteResource.getInstance(resource.getStringURI());
hasContent = ssr.hasContent();
nc.setType("siocSite");
DirectoryNode dn = new DirectoryNode();
dn.setId(resource.getResource().toString());
dn.setLevel(level);
dn.setLabel("Site: "+ssr.getTitle());
dn.setOwn(isOwner);
//TODO - get owner from this tags
//dn.setOwnerMbox((owner != null) ? (owner.getMbox().toString()) : "");
//dn.setOwnerName((owner != null) ? (owner.getName()) : "");
dn.setOwnerMbox("");
dn.setOwnerName("");
dn.setRemovable(!hasContent);
dn.setLinkedIn(parentIsOwner&!isOwner);
//check if user select this directory - we can get id or whole uri.
if(selectedUri!=null&&!"".equals(selectedUri.trim())&&selectedUri.length()>=40)
{
if(resource.getStringURI().equals(selectedUri)||
resource.getStringURI().endsWith(selectedUri.substring(selectedUri.length()-40,selectedUri.length())))
{
dn.setSelected(true);
dn.setOpened(false);
}
else dn.setSelected(false);
}
dn.setStandalone(standalone);
nc.setContent(dn);
}
//add created nodes to the buffer
nc.toJSON(buffer);