[opencms-dev] Struts integration
Anil K Patel
anil at aditisoft.com
Fri Feb 7 03:41:02 CET 2003
Kenneth,
We can make OpenCMS perfom specific action on file save.
I am very close(just few days) to Releasing a Applet Based Source code
and WYS... Editor integrated with OpenCMS.
Also There is another motivation for you to use this Editor, Source
Editor is XML syntex aware.
If you want I can extend it to fire event on file Save.
Regards
Anil K Patel
Aditisoft Inc
www.aditisoft.com
not perform a specific action w
--- Kenneth Lewelling <klewelling at curoalemanz.com> wrote:
> Hello again.
>
> I am working on the Struts integration and ran into a small problem.
> As far
> as I can tell there is no way to perform a specific action when a
> document
> in the sourcecode editor is saved. If this is not the case please
> ignore the
> rest of this message and just let me know how.
>
> First I will present a little background on why I want to do this,
> then a
> possible solution I thought up. Struts uses a configuration file,
> usualy
> name struts-config.xml (Struts can have more than one configuration
> file you
> would just change the name or the namespace). For Struts to be
> integrated
> into OpenCms this file will need to be editable within OpenCms. My
> solution
> to this was add a new folder beneath the system folder in the VFS,
> where
> each Struts application in OpenCms has its own folder. Within the
> Struts
> folder is its configuration file. This file is not intended to be
> edited
> within the VFS, and I address this problem below in the possible
> solution.
> The file is suppose to be edited within the Struts item in the
> Administrative view.
>
> The sourcecode editor will work fine for editing the file, however
> once the
> file is saved I need a way to resync the "Action" resouces in the VFS
> (If
> you are not sure what an "Action" resource is please refered to
> http://opencmsstruts.sourceforge.net/srs.html , pay special attention
> to UC4
> and UC5). A corollary to syncing with the VFS is parsing the
> configuration
> file and check it against itd dtd, and if it isn't correct do not
> save the
> file and allow the user to fix the problem.
>
> Here is a possible solution:
>
> Add a new method to the I_CmsResourceType interface called
> resourceEdited()
> (or something) that informs the Resource that its contents have been
> changed
> and are about to be saved. Then in the CmsEditor, just before the
> file is
> saved, call the resourceChanged() method. If the method returns
> false, or
> throws an exception then the user is forwarded to an error page and
> told the
> file could not be saved for whatever reason, and then forwarded back
> to the
> editor page.
>
> With this additional method I could create a new Struts Configuration
> resource type that implements the resourceEdited() method. That
> method can
> parse the configuration file to make sure it is syntacticly correct
> then
> syncronize the "Action" resources in the VFS.
>
> I wanted to ask this because my solution requires a change to a major
> interface and wanted to make sure it was the correct thing to do.
>
> Thank you for any comments
> Kenneth Lewelling
> http://opencmsstruts.sourceforge.net
>
=====
Regards
Anil K Patel
Aditisoft Inc
www.aditisoft.com
More information about the opencms-dev
mailing list