[opencms-dev] org.opencms.frontend.templateone.form module improvement

Stephan Hartmann hartmann at metamesh.de
Mon May 2 10:41:25 CEST 2005


I second this. You should file an issue (bug report) for this.

Stephan

N schrieb:
> Dear All,
> 
> Current org.opencms.frontend.templateone.form module implementation lacks ability to keep the XML form file apart from the page that displays the form. Sometimes this feature is necessary.
> 
> I suggest the following changes to the module implementation:
> 
> 1. In CmsForm class
> 
> 1.1 set the class class constructors to the following:
> 
>     public CmsForm(CmsJspActionElement jsp, CmsMessages messages, boolean initial) throws Exception {    
>         
>         init(jsp, messages, initial, null);
>     }
> 
>     public CmsForm(CmsJspActionElement jsp, CmsMessages messages, boolean initial, String formContentsUri) throws Exception {    
>         
>         init(jsp, messages, initial, formContentsUri);
>     }
> 
> 1.2 and use the following init method implementation:
> 
>     public void init(CmsJspActionElement jsp, CmsMessages messages, boolean initial, String formContentsUri) throws Exception {
>         
>         // read the form configuration file from VFS
>         CmsFile file = jsp.getCmsObject().readFile((formContentsUri != null) ? formContentsUri : jsp.getRequestContext().getUri());
>         CmsXmlContent content = CmsXmlContentFactory.unmarshal(jsp.getCmsObject(), file);
>         
>         // get current Locale
>         Locale locale = jsp.getRequestContext().getLocale();
>         
>         // init member variables
>         initMembers();
>         
>         // initialize general form configuration
>         initFormGlobalConfiguration(content, jsp.getCmsObject(), locale, messages);
>         
>         // initialize the form input fields
>         initInputFields(content, jsp, locale, messages, initial);
>     }
> 
> 2. In CmsFormHandler class add the following constructor:
> 
>     public CmsFormHandler(PageContext context, HttpServletRequest req, HttpServletResponse res, String formContentsUri) throws Exception {
>         super(context, req, res);
>         initFormHandler(context, req, res);
>         setFormConfiguration(new CmsForm(this, getMessages(), isInitial(), formContentsUri));
>     }
> 
> 
> Best regards
> Nikolay
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list