Ignore:
Timestamp:
Aug 24, 2009, 1:05:40 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1361: Unhandled item: ANNOTATION

The only "issue" is that there is no "view" page for annotations. So the "edit" page is used for that as well. The "Save" button will be disabled if the current user doesn't have write permission.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/annotations/index.jsp

    r5060 r5075  
    2929  import="net.sf.basedb.core.ItemContext"
    3030  import="net.sf.basedb.core.BasicItem"
     31  import="net.sf.basedb.core.Annotation"
     32  import="net.sf.basedb.core.AnnotationType"
    3133  import="net.sf.basedb.core.Annotatable"
    3234  import="net.sf.basedb.core.BaseException"
     
    4446final String ID = sc.getId();
    4547final String cmd = request.getParameter("cmd");
    46 final Item itemType = Item.valueOf(request.getParameter("item_type"));
    4748final int itemId = Values.getInt(request.getParameter("item_id"));
    4849
     
    5455try
    5556{
    56   if ("SaveAnnotations".equals(cmd))
     57  if ("EditItem".equals(cmd))
    5758  {
     59    newDc = sc.newDbControl();
     60    Annotation a = Annotation.getById(newDc, itemId);
     61    AnnotationType at = a.getAnnotationType();
     62    Annotatable item = a.getAnnotationSet().getItem();
     63   
     64    redirect = "annotate.jsp?ID=" + ID + "&item_id=" + item.getId() +
     65        "&item_type=" + item.getType().name() +
     66        "&annotationtype_id=" + at.getId() + "&standalone=1";
     67    newDc.close();
     68  }
     69  else if ("SaveAnnotations".equals(cmd))
     70  {
     71    final Item itemType = Item.valueOf(request.getParameter("item_type"));
    5872    newDc = sc.newDbControl();
    5973    oldDc = sc.newDbControl();
Note: See TracChangeset for help on using the changeset viewer.