Changeset 3482 for openmrs-modules/xforms/src/org/openmrs/module/xforms/download/XformDownloadManager.java
- Timestamp:
- 02/26/08 14:45:39 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/xforms/src/org/openmrs/module/xforms/download/XformDownloadManager.java
r3291 r3482 8 8 9 9 import org.openmrs.Form; 10 import org.openmrs.api.FormService; 10 11 import org.openmrs.api.context.Context; 11 import org.openmrs.module.formentry.FormEntryService; 12 import org.openmrs.module.formentry.FormEntryUtil; 13 import org.openmrs.module.formentry.FormXmlTemplateBuilder; 12 import org.openmrs.module.xforms.SerializableData; 14 13 import org.openmrs.module.xforms.Xform; 15 14 import org.openmrs.module.xforms.XformBuilder; … … 17 16 import org.openmrs.module.xforms.XformsService; 18 17 import org.openmrs.module.xforms.XformsUtil; 18 import org.openmrs.module.xforms.formentry.FormEntryWrapper; 19 19 import org.openmrs.util.OpenmrsClassLoader; 20 import org.openmrs.module.xforms.SerializableData;21 20 22 21 /** … … 61 60 62 61 XformsService xformsService = (XformsService)Context.getService(XformsService.class); 63 Form EntryService formEntryService = (FormEntryService)Context.getService(FormEntryService.class);62 FormService formService = (FormService)Context.getService(FormService.class); 64 63 65 64 List<Xform> xforms = xformsService.getXforms(); … … 67 66 for(Xform xform : xforms){ 68 67 if(xform.getFormId() != XformConstants.PATIENT_XFORM_FORM_ID){ 69 String s = getXform(form EntryService,xformsService,xform.getFormId(),createNew,actionUrl);68 String s = getXform(formService,xformsService,xform.getFormId(),createNew,actionUrl); 70 69 xmlforms.add(s); 71 70 } … … 81 80 * 82 81 * @param request - the http request. 83 * @param form EntryService - the formentryservice.82 * @param formService - the form service. 84 83 * @param formId - the form id. 85 84 * @return - the created xml form. 86 85 */ 87 public static String createNewXform(Form EntryService formEntryService, Integer formId,String actionUrl){88 Form form = form EntryService.getForm(formId);89 return createNewXform(form EntryService, form,actionUrl);86 public static String createNewXform(FormService formService, Integer formId,String actionUrl){ 87 Form form = formService.getForm(formId); 88 return createNewXform(formService, form,actionUrl); 90 89 } 91 90 … … 96 95 * 97 96 * @param request - the request object. 98 * @param form EntryService - the formentryservice.97 * @param formService - the form service. 99 98 * @param form - the form object. 100 99 * @return - the xml content of the xform. 101 100 */ 102 public static String createNewXform(Form EntryService formEntryService, Form form,String actionUrl){103 String schemaXml = formEntryService.getSchema(form);104 String templateXml = new FormXmlTemplateBuilder(form,FormEntryUtil.getFormAbsoluteUrl(form)).getXmlTemplate(false);101 public static String createNewXform(FormService formService, Form form,String actionUrl){ 102 String schemaXml = XformsUtil.getSchema(form); 103 String templateXml = FormEntryWrapper.getFormTemplate(form);//new FormXmlTemplateBuilder(form,FormEntryUtil.getFormAbsoluteUrl(form)).getXmlTemplate(false); 105 104 return XformBuilder.getXform4mStrings(schemaXml, templateXml,actionUrl); 106 105 } … … 109 108 * Gets an xform for a given form id. 110 109 * 111 * @param form EntryService - the formentryservice.110 * @param formService - the form service. 112 111 * @param xformsService the xforms service. 113 112 * @param formId - the form id. … … 115 114 * @return - the xml content of the xform. 116 115 */ 117 public static String getXform(Form EntryService formEntryService,XformsService xformsService,Integer formId,boolean createNew,String actionUrl){116 public static String getXform(FormService formService,XformsService xformsService,Integer formId,boolean createNew,String actionUrl){ 118 117 119 118 String xformXml = null; … … 126 125 127 126 if(xformXml == null) 128 xformXml = createNewXform(form EntryService, formId,actionUrl);127 xformXml = createNewXform(formService, formId,actionUrl); 129 128 130 129 return xformXml;