Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
05/16/08 13:07:40 (4 months ago)
Author:
bmckown
Message:

complex_obs branch: Attempting to register ComplexObsHandlers with Map<String, ComplexObsHandler>. Only partially working. Ripped out rest of ConceptComplexHandler junk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/branches/complex-obs/src/web/org/openmrs/web/controller/concept/ComplexHandlerFormController.java

    r4029 r4239  
    2121import org.apache.commons.logging.Log; 
    2222import org.apache.commons.logging.LogFactory; 
    23 import org.openmrs.ConceptComplexHandler; 
    2423import org.openmrs.api.ConceptService; 
    2524import org.openmrs.api.context.Context; 
     
    3231import org.springframework.web.servlet.view.RedirectView; 
    3332 
     33 
     34/** 
     35 * TODO: Either delete this class or use it to manage which concepts are assigned to each handler. 
     36 */ 
    3437public class ComplexHandlerFormController extends SimpleFormController { 
    3538         
     
    6568                 
    6669                if (Context.isAuthenticated()) { 
    67                         ConceptComplexHandler ch = (ConceptComplexHandler)obj; 
    68                         log.error("1a.: ConceptComplexHandler.handlerId: " + ch.getHandlerId()); 
    69                         log.error("1b.: ConceptComplexHandler.handlerClass: " + ch.getHandlerClass() ); 
    70                         log.error("1c.: ConceptComplexHandler.description: " + ch.getDescription()); 
    71                         Context.getConceptService().saveComplexHandler(ch); 
    72                         log.error("2. ConceptComplexHandler.handlerId: " + ch.getHandlerId()); 
    7370                        view = getSuccessView(); 
    7471                        httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR, "ConceptComplexHandler.saved"); 
     
    8784    protected Object formBackingObject(HttpServletRequest request) throws ServletException { 
    8885 
    89                 ConceptComplexHandler ch = null; 
    9086                 
    9187                if (Context.isAuthenticated()) { 
    9288                        ConceptService cs = Context.getConceptService(); 
    9389                        String id = request.getParameter("handlerId"); 
    94                 if (id != null) 
    95                         ch = cs.getComplexHandler(Integer.valueOf(id));  
    9690                } 
    9791                 
    98                 if (ch == null) 
    99                         ch = new ConceptComplexHandler(); 
    10092         
    101         return ch
     93        return new Object()
    10294    } 
    10395