else sb.append(String.format(rb.getString("feed_message_added_p2_levels"),changeName,mainDirName,depth,changedRes.getLabel()));
//display owner
if(changeRes.getIssuedBy()!=null)
{
Person p = PersonFactory.findPerson(changeRes.getIssuedBy().getStringURI());
if(p!=null)
{
if(p.getName()!=null&&!"".equals(p.getName()))
{
sb.append("<BR><BR>");
sb.append(String.format(rb.getString("feed_message_added_owner"),p.getName()));
}
else
{
String name = p.getGivenname()+" "+p.getFamily_name();
if(!" ".equals(name))
{
sb.append("<BR><br>");
sb.append(String.format(rb.getString("feed_message_added_owner"),name));
}
}
}
}
sb.append("<Br><br>");
StringBuilder tags = new StringBuilder();
StringBuilder tax = new StringBuilder();
//tags
List<String> tagsTab = changeRes.getTags();
if(tagsTab!=null&&tagsTab.size()>0)
{
for(String tag:tagsTab)
{
tags.append(tag);
tags.append(", ");
}
if(tags.length()>2)
tags.delete(tags.length()-2, tags.length());
}
//taxonomies
if(changeRes.isDirectory())
{
DirectoryDescription dd = SscfHelper2.getInstance().getDirectoryDescriptionObject(changedRes.getStringURI());
for(String taxonomy : dd.getTaxonomies().keySet())
{
Map<String,String> list = dd.getTaxonomyValues().get(taxonomy);
if(list!=null&&!list.isEmpty())
{
tax.append("<li>");
tax.append("<B>").append(taxonomy).append(": </B>");
for(String item : list.keySet())
{
tax.append(list.get(item)).append(", ");
}
if(tax.length()>2)
tax.delete(tax.length()-2, tax.length());
tax.append("</li>");
}
}
}
//put it into string
if(tags.length()>0||tax.length()>0)
{
sb.append(rb.getString("feed_message_added_annotations"));
sb.append("<ul>");
if(tags.length()>0)
{
sb.append("<li><b>").append(rb.getString("feed_message_added_annotations_tags")).append(": </b>");
sb.append(tags).append("</li>");
}
sb.append(tax);
sb.append("</ul>");
}
sb.append("<Br><br>");
String resUri = changeRes.getURI().toString();
if(changeRes.isDirectory())
sb.append(String.format(rb.getString("feed_message_added_link"),resUri));
else
sb.append(String.format(rb.getString("feed_message_added_link"),resUri.substring(0,resUri.lastIndexOf("__"))));
}
//removed - TODO: write support for suggestion rejection.
else if(type==2||type==ChangeTypes.SUG_REJECTED.getChangeType()) {
sb.append(String.format(rb.getString("feed_message_removed_p1"),changeName,mainDirName)).append("<br><Br>");
if(depth==0)
sb.append(String.format(rb.getString("feed_message_removed_p2"),changeName,mainDirName));
else if(depth==1)
sb.append(String.format(rb.getString("feed_message_removed_p2_level"),changeName,mainDirName,changedRes.getLabel()));
else sb.append(String.format(rb.getString("feed_message_removed_p2_levels"),changeName,mainDirName,depth,changedRes.getLabel()));
sb.append("<Br><br>");
}
//changed
else {
String chName = changedRes.getLabel();
sb.append(String.format(rb.getString("feed_message_changed_p1"),chName)).append("<br><Br>");
if(depth>0)
{
if(depth==1)
sb.append(String.format(rb.getString("feed_message_changed_p2"),chName,mainDirName));
else if(depth==2)
sb.append(String.format(rb.getString("feed_message_changed_p2_level"),chName,mainDirName));
else sb.append(String.format(rb.getString("feed_message_changed_p2_levels"),chName,mainDirName,depth));
//display owner
if(changedRes.getIssuedBy()!=null)
{
Person p = PersonFactory.findPerson(changedRes.getIssuedBy().getStringURI());
if(p!=null)
{
if(p.getName()!=null&&!"".equals(p.getName()))
{
sb.append("<BR><br>");
sb.append(String.format(rb.getString("feed_message_changed_owner"),p.getName()));
}
else
{
String name = p.getGivenname()+" "+p.getFamily_name();
if(!" ".equals(name))
{
sb.append("<BR><br>");
sb.append(String.format(rb.getString("feed_message_changed_owner"),name));
}