// Path: com.alkacon.opencms.v8.formgenerator/src/com/alkacon/opencms/v8/formgenerator/CmsFormContentUtil.java
// public static String getContentStringValue(CmsXmlContent content, CmsObject cms, String path, Locale locale) {
// 
//     return content.getStringValue(cms, getNestedPathPrefix(content, NODE_NESTED_FORM, locale) + path, locale);
// }
// 
// Path: com.alkacon.opencms.v8.formgenerator/src/com/alkacon/opencms/v8/formgenerator/CmsFormContentUtil.java
// public static I_CmsXmlContentValue getContentValue(CmsXmlContent content, String path, Locale locale) {
// 
//     return content.getValue(getNestedPathPrefix(content, NODE_NESTED_FORM, locale) + path, locale);
// }
// 
// Path: com.alkacon.opencms.v8.formgenerator/src/com/alkacon/opencms/v8/formgenerator/CmsFormContentUtil.java
// public static List<I_CmsXmlContentValue> getContentValues(CmsXmlContent content, String path, Locale locale) {
// 
//     return content.getValues(getNestedPathPrefix(content, NODE_NESTED_FORM, locale) + path, locale);
// }


import static com.alkacon.opencms.v8.formgenerator.CmsFormContentUtil.getContentStringValue;
import static com.alkacon.opencms.v8.formgenerator.CmsFormContentUtil.getContentValue;
import static com.alkacon.opencms.v8.formgenerator.CmsFormContentUtil.getContentValues;
import org.opencms.configuration.CmsConfigurationException;
import org.opencms.file.CmsFile;
import org.opencms.file.CmsObject;
import org.opencms.i18n.CmsMessages;
import org.opencms.jsp.CmsJspActionElement;
import org.opencms.main.OpenCms;
import org.opencms.util.CmsMacroResolver;
import org.opencms.util.CmsStringUtil;
import org.opencms.workplace.CmsWorkplace;
import org.opencms.xml.content.CmsXmlContent;
import org.opencms.xml.content.CmsXmlContentFactory;
import org.opencms.xml.types.CmsXmlHtmlValue;
import org.opencms.xml.types.I_CmsXmlContentValue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
import org.apache.commons.fileupload.FileItem;

            String textFieldPath = textField.getPath() + "/";
            String fieldLabel = content.getStringValue(jsp.getCmsObject(), textFieldPath + NODE_INPUTFIELD, locale);
            String fieldText = content.getStringValue(jsp.getCmsObject(), textFieldPath + NODE_TEXT, locale);
            String column = content.getStringValue(jsp.getCmsObject(), textFieldPath + NODE_COLUMN, locale);
            fieldTexts.put(fieldLabel, new CmsFieldText(fieldText, column));
        }

        // store the xPaths to the sub field definitions
        Map<String, List<String>> subFieldPaths = new HashMap<String, List<String>>();
        List<I_CmsXmlContentValue> subFieldValues = getContentValues(content, NODE_OPTIONALSUBFIELD, locale);
        for (Iterator<I_CmsXmlContentValue> i = subFieldValues.iterator(); i.hasNext();) {
            I_CmsXmlContentValue subField = i.next();
            String fieldLabel = content.getStringValue(
                jsp.getCmsObject(),
                subField.getPath() + "/" + NODE_PARENTFIELD,
                locale);
            List<String> storedPaths = subFieldPaths.get(fieldLabel);
            if (storedPaths == null) {
                storedPaths = new ArrayList<String>();
            }
            storedPaths.add(subField.getPath());
            subFieldPaths.put(fieldLabel, storedPaths);
        }

        // get the file uploads stored in the session
        @SuppressWarnings("unchecked")
        Map<String, FileItem> fileUploads = (Map<String, FileItem>)jsp.getRequest().getSession().getAttribute(
            CmsFormHandler.ATTRIBUTE_FILEITEMS);

        // initialize the defined input fields

// Path: com.alkacon.opencms.v8.formgenerator/src/com/alkacon/opencms/v8/formgenerator/CmsFormContentUtil.java
// public static String getContentStringValue(CmsXmlContent content, CmsObject cms, String path, Locale locale) {
// 
//     return content.getStringValue(cms, getNestedPathPrefix(content, NODE_NESTED_FORM, locale) + path, locale);
// }
// 
// Path: com.alkacon.opencms.v8.formgenerator/src/com/alkacon/opencms/v8/formgenerator/CmsFormContentUtil.java
// public static I_CmsXmlContentValue getContentValue(CmsXmlContent content, String path, Locale locale) {
// 
//     return content.getValue(getNestedPathPrefix(content, NODE_NESTED_FORM, locale) + path, locale);
// }
// 
// Path: com.alkacon.opencms.v8.formgenerator/src/com/alkacon/opencms/v8/formgenerator/CmsFormContentUtil.java
// public static List<I_CmsXmlContentValue> getContentValues(CmsXmlContent content, String path, Locale locale) {
// 
//     return content.getValues(getNestedPathPrefix(content, NODE_NESTED_FORM, locale) + path, locale);
// }


// Path: com.alkacon.opencms.v8.formgenerator/src/com/alkacon/opencms/v8/formgenerator/CmsForm.java
import static com.alkacon.opencms.v8.formgenerator.CmsFormContentUtil.getContentStringValue;
import static com.alkacon.opencms.v8.formgenerator.CmsFormContentUtil.getContentValue;
import static com.alkacon.opencms.v8.formgenerator.CmsFormContentUtil.getContentValues;
import org.opencms.configuration.CmsConfigurationException;
import org.opencms.file.CmsFile;
import org.opencms.file.CmsObject;
import org.opencms.i18n.CmsMessages;
import org.opencms.jsp.CmsJspActionElement;
import org.opencms.main.OpenCms;
import org.opencms.util.CmsMacroResolver;
import org.opencms.util.CmsStringUtil;
import org.opencms.workplace.CmsWorkplace;
import org.opencms.xml.content.CmsXmlContent;
import org.opencms.xml.content.CmsXmlContentFactory;
import org.opencms.xml.types.CmsXmlHtmlValue;
import org.opencms.xml.types.I_CmsXmlContentValue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.StringTokenizer;
import org.apache.commons.fileupload.FileItem;

            String textFieldPath = textField.getPath() + "/";
            String fieldLabel = content.getStringValue(jsp.getCmsObject(), textFieldPath + NODE_INPUTFIELD, locale);
            String fieldText = content.getStringValue(jsp.getCmsObject(), textFieldPath + NODE_TEXT, locale);
            String column = content.getStringValue(jsp.getCmsObject(), textFieldPath + NODE_COLUMN, locale);
            fieldTexts.put(fieldLabel, new CmsFieldText(fieldText, column));
        }

        // store the xPaths to the sub field definitions
        Map<String, List<String>> subFieldPaths = new HashMap<String, List<String>>();
        List<I_CmsXmlContentValue> subFieldValues = getContentValues(content, NODE_OPTIONALSUBFIELD, locale);
        for (Iterator<I_CmsXmlContentValue> i = subFieldValues.iterator(); i.hasNext();) {
            I_CmsXmlContentValue subField = i.next();
            String fieldLabel = content.getStringValue(
                jsp.getCmsObject(),
                subField.getPath() + "/" + NODE_PARENTFIELD,
                locale);
            List<String> storedPaths = subFieldPaths.get(fieldLabel);
            if (storedPaths == null) {
                storedPaths = new ArrayList<String>();
            }
            storedPaths.add(subField.getPath());
            subFieldPaths.put(fieldLabel, storedPaths);
        }

        // get the file uploads stored in the session
        @SuppressWarnings("unchecked")
        Map<String, FileItem> fileUploads = (Map<String, FileItem>)jsp.getRequest().getSession().getAttribute(
            CmsFormHandler.ATTRIBUTE_FILEITEMS);

        // initialize the defined input fields

        List<I_CmsXmlContentValue> fieldValues = getContentValues(content, NODE_INPUTFIELD, locale);
