Changeset 6729


Ignore:
Timestamp:
Feb 13, 2015, 9:44:56 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #1910 and #1908.

Batch inherit annotations has been updated to not allow selection of annotation type that has been disabled for inheritance.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/AnnotationUtil.java

    r6696 r6729  
    6363    json.put("id", at.getId());
    6464    json.put("name", at.getName());
    65    
     65    if (at.getDisableInheritance())
     66    {
     67      json.put("disableInheritance", 1);
     68      return json;
     69    }
    6670    // Load categories for the annotation type
    6771    ItemQuery<AnnotationTypeCategory> categoryQuery = AnnotationTypeCategory.getQuery();
  • trunk/www/common/annotations/batch_inherit.js

    r6696 r6729  
    2929 
    3030  var selectedAnnotationTypes = [];
     31  var allowedAnnotationTypes = [];
    3132
    3233  inherit.initPage = function()
     
    5657  inherit.selectAnnotationTypes = function(event)
    5758  {
    58     var url = '&exclude='+selectedAnnotationTypes.join(',');
     59    var url = '&resetTemporary=1&tmpfilter:BOOLEAN:disableInheritance=false';
     60    url += '&exclude='+selectedAnnotationTypes.join(',');
    5961    Dialogs.selectItem('ANNOTATIONTYPE', event.currentTarget.id, 1, url);
    6062  }
     
    125127  inherit.addMoreAnnotationTypeInfo = function(item)
    126128  {
     129    if (item.disableInheritance)
     130    {
     131      var frm = document.forms['annotations'];
     132      var action = frm['action_'+item.id];
     133      action.length = 0;
     134      action[0] = new Option('Inheritance disabled');
     135      action.disabled = true;
     136      frm['from_'+item.id].disabled = true;
     137      frm['nodup_'+item.id].disabled = true;
     138      frm['replace_'+item.id].disabled = true;
     139      return;
     140    }
    127141   
     142    allowedAnnotationTypes[allowedAnnotationTypes.length] = item.id;
    128143    var selection = Doc.element('from_'+item.id);
    129144    for (var i = 0; i < item.subtypes.length; i++)
     
    142157      if (selection.selectedIndex == 0) selection.selectedIndex = 1;
    143158    }
    144    
    145159  }
    146160 
     
    161175  inherit.save = function()
    162176  {
    163     if (selectedAnnotationTypes.length == 0)
     177    if (allowedAnnotationTypes.length == 0)
    164178    {
    165179      Forms.showNotification('btnSelectAnnotationTypes', 'Please select annotation types to inherit!');
     
    168182    var frm = document.forms['annotations'];
    169183    frm.cmd.value = 'BatchInherit';
    170     Forms.addHidden(frm, 'annotationTypes', selectedAnnotationTypes.join(','));
     184    Forms.addHidden(frm, 'annotationTypes', allowedAnnotationTypes.join(','));
    171185    frm.submit();
    172186  }
  • trunk/www/common/annotations/index.jsp

    r6694 r6729  
    111111    {
    112112      AnnotationType at = AnnotationType.getById(newDc, atId);
     113      if (at.getDisableInheritance()) continue; // Inheritance has been disabled
     114     
    113115      InheritSpecification spec = new InheritSpecification(at);
    114116      String action = request.getParameter("action_"+atId);
     
    131133      }
    132134      manager.addSpecification(spec);
    133      
    134       //System.out.println("at:" + atId + "; " + action + "; from=" + from + "; noDup="+noDup + "; replace="+replaceExisting);
    135135    }
    136136    newDc.commit();
Note: See TracChangeset for help on using the changeset viewer.