Changeset 20719


Ignore:
Timestamp:
24/02/10 10:06:39 (2 years ago)
Author:
julie
Message:

don't throw an exception if template has a list. this method is called on the mymine page, so if we throw an exception the user can't ever edit that template. This method is also called on the templates page, which I really don't think is correct.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/intermine/api/main/src/org/intermine/api/template/TemplatePrecomputeHelper.java

    r20511 r20719  
    1616import java.util.List; 
    1717 
     18import org.apache.log4j.Logger; 
    1819import org.intermine.api.query.MainHelper; 
    1920import org.intermine.objectstore.ObjectStoreException; 
     
    3637{ 
    3738 
     39    private static final Logger LOG = Logger.getLogger(TemplatePrecomputeHelper.class); 
     40     
    3841    /** 
    3942     * Get an ObjectStore query to precompute this template - remove editable constraints 
     
    6770        TemplateQuery templateClone = template.cloneWithoutEditableConstraints(); 
    6871 
     72        /* don't throw exception here.  this method is called on all pages that display templates 
     73         * if we throw an exception here, the user will never be able to edit the template */ 
    6974        if (template.getBagNames().size() != 0) { 
    70             throw new RuntimeException("Precomputed query can't be created " 
    71                                        + "for a template with a list."); 
     75           String msg = "Precomputed query can't be created for a template with a list."; 
     76           LOG.error(msg); 
     77           return null; 
    7278        } 
    7379 
Note: See TracChangeset for help on using the changeset viewer.