=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java 2011-05-08 08:06:40 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java 2011-05-08 09:38:47 +0000 @@ -60,7 +60,7 @@ implements DataEntryFormService { private static final Pattern IDENTIFIER_PATTERN = Pattern.compile( "value\\[(.*)\\].value:value\\[(.*)\\].value" ); - private static final Pattern DATAELEMENT_PATTERN = Pattern.compile( "(", Pattern.DOTALL ); + private static final Pattern INPUT_PATTERN = Pattern.compile( "(", Pattern.DOTALL ); private static final String EMPTY = ""; // ------------------------------------------------------------------------ @@ -124,32 +124,17 @@ public String prepareDataEntryFormForSave( String htmlCode ) { - // --------------------------------------------------------------------- - // Buffer to contain the final result. - // --------------------------------------------------------------------- - StringBuffer sb = new StringBuffer(); - // --------------------------------------------------------------------- - // Pattern to match data elements in the HTML code. - // --------------------------------------------------------------------- - - Pattern patDataElement = Pattern.compile( "(" ); - Matcher matDataElement = patDataElement.matcher( htmlCode ); - - // --------------------------------------------------------------------- - // Iterate through all matching data element fields. - // --------------------------------------------------------------------- - - boolean result = matDataElement.find(); - - while ( result ) + Matcher inputMatcher = INPUT_PATTERN.matcher( htmlCode ); + + while ( inputMatcher.find() ) { // ----------------------------------------------------------------- // Get input HTML code (HTML input field code). // ----------------------------------------------------------------- - String dataElementCode = matDataElement.group( 1 ); + String dataElementCode = inputMatcher.group( 1 ); // ----------------------------------------------------------------- // Pattern to extract data element name from data element field @@ -178,51 +163,32 @@ String appendCode = dataElementCode; appendCode += "/>"; - matDataElement.appendReplacement( sb, appendCode ); + inputMatcher.appendReplacement( sb, appendCode ); } - - // ----------------------------------------------------------------- - // Go to next data entry field - // ----------------------------------------------------------------- - - result = matDataElement.find(); } - // ----------------------------------------------------------------- - // Add remaining code (after the last match), and return formatted code. - // ----------------------------------------------------------------- + // --------------------------------------------------------------------- + // Add remaining code (after the last match), and return formatted code + // --------------------------------------------------------------------- - matDataElement.appendTail( sb ); + inputMatcher.appendTail( sb ); return sb.toString(); } public String prepareDataEntryFormForEdit( String htmlCode ) { - // --------------------------------------------------------------------- - // Buffer to contain the final result. - // --------------------------------------------------------------------- - StringBuffer sb = new StringBuffer(); - // --------------------------------------------------------------------- - // Pattern to match data elements in the HTML code. - // --------------------------------------------------------------------- - - Pattern patDataElement = Pattern.compile( "(" ); - Matcher matDataElement = patDataElement.matcher( htmlCode ); - - // --------------------------------------------------------------------- - // Iterate through all matching data element fields. - // --------------------------------------------------------------------- - - while ( matDataElement.find() ) + Matcher inputMatcher = INPUT_PATTERN.matcher( htmlCode ); + + while ( inputMatcher.find() ) { // ----------------------------------------------------------------- // Get input HTML code // ----------------------------------------------------------------- - String dataElementCode = matDataElement.group( 1 ); + String dataElementCode = inputMatcher.group( 1 ); // ----------------------------------------------------------------- // Pattern to extract data element ID from data element field @@ -302,7 +268,7 @@ String appendCode = dataElementCode; appendCode += "/>"; - matDataElement.appendReplacement( sb, appendCode ); + inputMatcher.appendReplacement( sb, appendCode ); } } @@ -310,7 +276,7 @@ // Add remaining code (after the last match), and return formatted code // --------------------------------------------------------------------- - matDataElement.appendTail( sb ); + inputMatcher.appendTail( sb ); return sb.toString(); } @@ -338,11 +304,7 @@ StringBuffer sb = new StringBuffer(); - Matcher dataElementMatcher = DATAELEMENT_PATTERN.matcher( htmlCode ); - - // --------------------------------------------------------------------- - // Iterate through all matching data element fields - // --------------------------------------------------------------------- + Matcher dataElementMatcher = INPUT_PATTERN.matcher( htmlCode ); Map dataElementMap = getDataElementMap( dataSet ); @@ -372,16 +334,8 @@ return "Data Element Id :" + dataElementId + " not found in this data set"; } - // ------------------------------------------------------------- - // Find value type of data element - // ------------------------------------------------------------- - String dataElementValueType = dataElement.getType(); - // ------------------------------------------------------------- - // Find existing value of data element in data set - // ------------------------------------------------------------- - String dataElementValue = getValue( dataValues, dataElementId, optionComboId ); // ------------------------------------------------------------- @@ -531,8 +485,8 @@ return dataEntryFormStore.listDisctinctDataEntryFormByDataSetIds( dataSetIds ); } - public Collection getDataEntryForms( final Collection identifiers ){ - + public Collection getDataEntryForms( final Collection identifiers ) + { Collection dataEntryForms = getAllDataEntryForms(); return identifiers == null ? dataEntryForms : FilterUtils.filter( dataEntryForms, new Filter() === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2011-05-08 08:20:31 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2011-05-08 09:38:47 +0000 @@ -246,10 +246,7 @@ class="org.hisp.dhis.dataset.action.dataentryform.ViewDataEntryFormAction"> /main.vm /dhis-web-maintenance-dataset/viewDataEntryForm.vm - - ../dhis-web-commons/ckeditor/ckeditor.js, ../dhis-web-commons/ckeditor/adapters/jquery.js, javascript/dataEntryForm.js - - css/cde.css + ../dhis-web-commons/ckeditor/ckeditor.js, ../dhis-web-commons/ckeditor/adapters/jquery.js, javascript/dataEntryForm.js - - - - - - - - +
$i18n.getString( "dataentryform_design" )
-
- -
-
+ + + + + + + - - + + +   |  + + + + +
$i18n.getString( "dataentryform_design" )
- - - - - - -
- - - - - - -
-