. JavaScript API improvements

. Template API improvements
. Fixed a couple more UTF-8 code file warnings when compiling the source

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3473 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-08-09 12:51:42 +00:00
parent cbe407f6b1
commit d8ba01d55e
2 changed files with 14 additions and 20 deletions

View File

@@ -243,8 +243,8 @@ public class DocumentDetailsBean extends BaseDetailsBean
{ {
// we know for now that the general classifiable aspect only will be // we know for now that the general classifiable aspect only will be
// applied so we can retrive the categories property direclty // applied so we can retrive the categories property direclty
Collection categories = (Collection)this.nodeService.getProperty(getDocument().getNodeRef(), Collection<NodeRef> categories = (Collection<NodeRef>)this.nodeService.getProperty(
ContentModel.PROP_CATEGORIES); getDocument().getNodeRef(), ContentModel.PROP_CATEGORIES);
if (categories == null || categories.size() == 0) if (categories == null || categories.size() == 0)
{ {
@@ -256,18 +256,15 @@ public class DocumentDetailsBean extends BaseDetailsBean
MSG_HAS_FOLLOWING_CATEGORIES)); MSG_HAS_FOLLOWING_CATEGORIES));
builder.append("<ul>"); builder.append("<ul>");
for (Object obj : categories) for (NodeRef ref : categories)
{ {
if (obj instanceof NodeRef) if (this.nodeService.exists(ref))
{
if (this.nodeService.exists((NodeRef)obj))
{ {
builder.append("<li>"); builder.append("<li>");
builder.append(Repository.getNameForNode(this.nodeService, (NodeRef)obj)); builder.append(Repository.getNameForNode(this.nodeService, ref));
builder.append("</li>"); builder.append("</li>");
} }
} }
}
builder.append("</ul>"); builder.append("</ul>");
html = builder.toString(); html = builder.toString();

View File

@@ -306,8 +306,8 @@ public class SpaceDetailsBean extends BaseDetailsBean
{ {
// we know for now that the general classifiable aspect only will be // we know for now that the general classifiable aspect only will be
// applied so we can retrive the categories property direclty // applied so we can retrive the categories property direclty
Collection categories = (Collection)this.nodeService.getProperty(getSpace().getNodeRef(), Collection<NodeRef> categories = (Collection<NodeRef>)this.nodeService.getProperty(
ContentModel.PROP_CATEGORIES); getSpace().getNodeRef(), ContentModel.PROP_CATEGORIES);
if (categories == null || categories.size() == 0) if (categories == null || categories.size() == 0)
{ {
@@ -319,18 +319,15 @@ public class SpaceDetailsBean extends BaseDetailsBean
MSG_HAS_FOLLOWING_CATEGORIES)); MSG_HAS_FOLLOWING_CATEGORIES));
builder.append("<ul>"); builder.append("<ul>");
for (Object obj : categories) for (NodeRef ref : categories)
{ {
if (obj instanceof NodeRef) if (this.nodeService.exists(ref))
{
if (this.nodeService.exists((NodeRef)obj))
{ {
builder.append("<li>"); builder.append("<li>");
builder.append(Repository.getNameForNode(this.nodeService, (NodeRef)obj)); builder.append(Repository.getNameForNode(this.nodeService, ref));
builder.append("</li>"); builder.append("</li>");
} }
} }
}
builder.append("</ul>"); builder.append("</ul>");
html = builder.toString(); html = builder.toString();