Changeset 4239 for openmrs/branches/complex-obs/src/web/org/openmrs/web/controller/concept/ComplexHandlerFormController.java
- Timestamp:
- 05/16/08 13:07:40 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/branches/complex-obs/src/web/org/openmrs/web/controller/concept/ComplexHandlerFormController.java
r4029 r4239 21 21 import org.apache.commons.logging.Log; 22 22 import org.apache.commons.logging.LogFactory; 23 import org.openmrs.ConceptComplexHandler;24 23 import org.openmrs.api.ConceptService; 25 24 import org.openmrs.api.context.Context; … … 32 31 import org.springframework.web.servlet.view.RedirectView; 33 32 33 34 /** 35 * TODO: Either delete this class or use it to manage which concepts are assigned to each handler. 36 */ 34 37 public class ComplexHandlerFormController extends SimpleFormController { 35 38 … … 65 68 66 69 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());73 70 view = getSuccessView(); 74 71 httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR, "ConceptComplexHandler.saved"); … … 87 84 protected Object formBackingObject(HttpServletRequest request) throws ServletException { 88 85 89 ConceptComplexHandler ch = null;90 86 91 87 if (Context.isAuthenticated()) { 92 88 ConceptService cs = Context.getConceptService(); 93 89 String id = request.getParameter("handlerId"); 94 if (id != null)95 ch = cs.getComplexHandler(Integer.valueOf(id));96 90 } 97 91 98 if (ch == null)99 ch = new ConceptComplexHandler();100 92 101 return ch;93 return new Object(); 102 94 } 103 95