{
/* Create skeleton menu structure to ensure consistent order between aspects,
* even if they are never used
*/
options.addList("browse");
List account = options.addList("account");
List context = options.addList("context");
List admin = options.addList("administrative");
account.setHead(T_my_account);
// My Account options
if(availableExports!=null && availableExports.size()>0){
account.addItem().addXref(contextPath+"/admin/export", T_account_export);
}
//Check if a system administrator
boolean isSystemAdmin = AuthorizeManager.isAdmin(this.context);
// Context Administrative options
DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
if (dso instanceof Item)
{
Item item = (Item) dso;
if (item.canEdit())
{
context.setHead(T_context_head);
context.addItem().addXref(contextPath+"/admin/item?itemID="+item.getID(), T_context_edit_item);
if (AuthorizeManager.isAdmin(this.context, dso))
{
context.addItem().addXref(contextPath+"/admin/export?itemID="+item.getID(), T_context_export_item );
context.addItem().addXref(contextPath+ "/csv/handle/"+dso.getHandle(),T_context_export_metadata );
}
}
}
else if (dso instanceof Collection)
{
Collection collection = (Collection) dso;
// can they admin this collection?
if (collection.canEditBoolean(true))
{
context.setHead(T_context_head);
context.addItemXref(contextPath+"/admin/collection?collectionID=" + collection.getID(), T_context_edit_collection);
context.addItemXref(contextPath+"/admin/mapper?collectionID="+collection.getID(), T_context_item_mapper);
if (AuthorizeManager.isAdmin(this.context, dso))
{
context.addItem().addXref(contextPath+"/admin/export?collectionID="+collection.getID(), T_context_export_collection );
context.addItem().addXref(contextPath+ "/csv/handle/"+dso.getHandle(),T_context_export_metadata );
}
}
}
else if (dso instanceof Community)
{
Community community = (Community) dso;
// can they admin this collection?
if (community.canEditBoolean())
{
context.setHead(T_context_head);
context.addItemXref(contextPath+"/admin/community?communityID=" + community.getID(), T_context_edit_community);
if (AuthorizeManager.isAdmin(this.context, dso))
{
context.addItem().addXref(contextPath + "/admin/export?communityID=" + community.getID(), T_context_export_community);
}
context.addItem().addXref(contextPath+ "/csv/handle/"+dso.getHandle(),T_context_export_metadata );
}
// can they add to this community?
if (AuthorizeManager.authorizeActionBoolean(this.context, community,Constants.ADD))
{
context.setHead(T_context_head);
context.addItemXref(contextPath+"/admin/collection?createNew&communityID=" + community.getID(), T_context_create_collection);
context.addItemXref(contextPath+"/admin/community?createNew&communityID=" + community.getID(), T_context_create_subcommunity);
}
}
if (isSystemAdmin && ("community-list".equals(this.sitemapURI) || "".equals(this.sitemapURI)))
{
// Only System administrators can create top-level communities
context.setHead(T_context_head);
context.addItemXref(contextPath+"/admin/community?createNew", T_context_create_community);
}
// System Administrator options!
if (isSystemAdmin)
{
admin.setHead(T_administrative_head);
// Control panel
admin.addItemXref(contextPath+"/admin/panel", T_administrative_control_panel);
// Access Controls
List epeople = admin.addList("epeople");
epeople.setHead(T_administrative_access_control);
epeople.addItemXref(contextPath+"/admin/epeople", T_administrative_people);
epeople.addItemXref(contextPath+"/admin/groups", T_administrative_groups);
epeople.addItemXref(contextPath+"/admin/authorize", T_administrative_authorizations);
// Content Admin
List content = admin.addList("content");
content.setHead(T_administrative_content);
content.addItemXref(contextPath+"/admin/item", T_administrative_items);
content.addItemXref(contextPath+"/admin/withdrawn", T_administrative_withdrawn);
content.addItemXref(contextPath+"/admin/private", T_administrative_private);
content.addItemXref(contextPath+"/admin/metadataimport", T_administrative_import_metadata);
content.addItemXref(contextPath+"/admin/batchimport", T_administrative_batch_import);
// Registries
List registries = admin.addList("registries");
registries.setHead(T_administrative_registries);
registries.addItemXref(contextPath+"/admin/metadata-registry",T_administrative_metadata);
registries.addItemXref(contextPath+"/admin/format-registry",T_administrative_format);
admin.addItemXref(contextPath+"/statistics", T_statistics);
admin.addItemXref(contextPath+ "/admin/curate", T_administrative_curation);
}
}